diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-19 16:21:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-20 12:54:55 +0100 |
commit | 7b8a0b7c0dcf8380a6bd2d458d0e20ffc6a5d355 (patch) | |
tree | 388b2fba4742064ed47c51f0a2688cb53de405ce /svtools | |
parent | b7da3f2d2518a8b92b0242e311bb31267acd1cd0 (diff) |
loplugin:changetoolsgen in svtools
Change-Id: I63271ee3126368868db7e7e859aaaa76b15e559e
Reviewed-on: https://gerrit.libreoffice.org/50023
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
40 files changed, 792 insertions, 792 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 519c4ccc1b07..027549077fcb 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -377,10 +377,10 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ) // determine old column area Size aDataWinSize( pDataWin->GetSizePixel() ); if ( pDataWin->pHeaderBar ) - aDataWinSize.Height() += pDataWin->pHeaderBar->GetSizePixel().Height(); + aDataWinSize.AdjustHeight(pDataWin->pHeaderBar->GetSizePixel().Height() ); tools::Rectangle aFromRect( GetFieldRect( nColumnId) ); - aFromRect.Right() += 2*MIN_COLUMNWIDTH; + aFromRect.AdjustRight(2*MIN_COLUMNWIDTH ); sal_uInt16 nNextPos = nOldPos + 1; if ( nOldPos > nPos ) @@ -402,7 +402,7 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ) // determine new column area tools::Rectangle aToRect( GetFieldRect( nColumnId ) ); - aToRect.Right() += 2*MIN_COLUMNWIDTH; + aToRect.AdjustRight(2*MIN_COLUMNWIDTH ); // do scroll, let redraw if( pDataWin->GetBackground().IsScrollable() ) @@ -413,7 +413,7 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ) { long nFrozenWidth = GetFrozenWidth(); if ( aToRect.Left() < nFrozenWidth ) - aToRect.Left() = nFrozenWidth; + aToRect.SetLeft( nFrozenWidth ); aScrollArea = tools::Rectangle(Point(aToRect.Left(),0), Point(aNextRect.Right(),aDataWinSize.Height())); nScroll *= -1; // reverse direction @@ -423,8 +423,8 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ) Point(aToRect.Right(),aDataWinSize.Height())); pDataWin->Scroll( nScroll, 0, aScrollArea ); - aToRect.Top() = 0; - aToRect.Bottom() = aScrollArea.Bottom(); + aToRect.SetTop( 0 ); + aToRect.SetBottom( aScrollArea.Bottom() ); Invalidate( aToRect ); } else @@ -588,7 +588,7 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth ) GetSizePixel().Width() , // the header is longer than the datawin pDataWin->GetPosPixel().Y() - 1 ); Control::Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); - aScrRect.Bottom() = pDataWin->GetSizePixel().Height(); + aScrRect.SetBottom( pDataWin->GetSizePixel().Height() ); pDataWin->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); tools::Rectangle aInvRect( nX, 0, nX + std::max( nWidth, static_cast<sal_uLong>(nOldWidth) ), USHRT_MAX ); Control::Invalidate( aInvRect, InvalidateFlags::NoChildren ); @@ -875,20 +875,20 @@ long BrowseBox::ScrollColumns( long nCols ) // invalidate the area of the column which was scrolled out to the left hand side tools::Rectangle aInvalidateRect( aScrollRect ); - aInvalidateRect.Left() = nFrozenWidth; - aInvalidateRect.Right() = nFrozenWidth + nDelta - 1; + aInvalidateRect.SetLeft( nFrozenWidth ); + aInvalidateRect.SetRight( nFrozenWidth + nDelta - 1 ); Invalidate( aInvalidateRect ); } // scroll the data-area - aScrollRect.Bottom() = pDataWin->GetOutputSizePixel().Height(); + aScrollRect.SetBottom( pDataWin->GetOutputSizePixel().Height() ); // actually scroll pDataWin->Scroll( -nDelta, 0, aScrollRect, SCROLL_FLAGS ); // invalidate the area of the column which was scrolled out to the left hand side - aScrollRect.Left() = nFrozenWidth; - aScrollRect.Right() = nFrozenWidth + nDelta - 1; + aScrollRect.SetLeft( nFrozenWidth ); + aScrollRect.SetRight( nFrozenWidth + nDelta - 1 ); pDataWin->Invalidate( aScrollRect ); } } @@ -920,7 +920,7 @@ long BrowseBox::ScrollColumns( long nCols ) } // scroll the data-area - aScrollRect.Bottom() = pDataWin->GetOutputSizePixel().Height(); + aScrollRect.SetBottom( pDataWin->GetOutputSizePixel().Height() ); pDataWin->Scroll( nDelta, 0, aScrollRect, SCROLL_FLAGS ); } } diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 99040fcb7e75..7432a57edf49 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -279,10 +279,10 @@ void BrowseBox::ToggleSelection() tools::Rectangle aRect( GetFieldRectPixel(nCurRow, pCols[ nColId ]->GetId(), false ) ); - aRect.Left() -= MIN_COLUMNWIDTH; - aRect.Right() += MIN_COLUMNWIDTH; - aRect.Top() = 0; - aRect.Bottom() = pDataWin->GetOutputSizePixel().Height(); + aRect.AdjustLeft( -(MIN_COLUMNWIDTH) ); + aRect.AdjustRight(MIN_COLUMNWIDTH ); + aRect.SetTop( 0 ); + aRect.SetBottom( pDataWin->GetOutputSizePixel().Height() ); pDataWin->Invalidate( aRect ); } @@ -319,9 +319,9 @@ void BrowseBox::DrawCursor() if ( bColumnCursor ) { aCursor = GetFieldRectPixel( nCurRow, nCurColId, false ); - aCursor.Left() -= MIN_COLUMNWIDTH; - aCursor.Right() += 1; - aCursor.Bottom() += 1; + aCursor.AdjustLeft( -(MIN_COLUMNWIDTH) ); + aCursor.AdjustRight(1 ); + aCursor.AdjustBottom(1 ); } else aCursor = tools::Rectangle( @@ -333,8 +333,8 @@ void BrowseBox::DrawCursor() if ( bHLines ) { if ( !bMultiSelection ) - --aCursor.Top(); - --aCursor.Bottom(); + aCursor.AdjustTop( -1 ); + aCursor.AdjustBottom( -1 ); } if (m_aCursorColor == COL_TRANSPARENT) @@ -520,8 +520,8 @@ void BrowseBox::Resize() // Control-Area tools::Rectangle aInvalidArea( GetControlArea() ); - aInvalidArea.Right() = GetOutputSizePixel().Width(); - aInvalidArea.Left() = 0; + aInvalidArea.SetRight( GetOutputSizePixel().Width() ); + aInvalidArea.SetLeft( 0 ); Invalidate( aInvalidArea ); // external header-bar @@ -690,10 +690,10 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, } // a smaller area for the content - ++aRealPos.X(); - ++aRealPos.Y(); - aRealSize.Width() -= 2; - aRealSize.Height() -= 2; + aRealPos.AdjustX( 1 ); + aRealPos.AdjustY( 1 ); + aRealSize.AdjustWidth( -2 ); + aRealSize.AdjustHeight( -2 ); // let the header bar draw itself if ( pBar ) @@ -735,8 +735,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, pDev->Pop(); } - aRealPos.Y() += aHeaderSize.Height(); - aRealSize.Height() -= aHeaderSize.Height(); + aRealPos.AdjustY(aHeaderSize.Height() ); + aRealSize.AdjustHeight( -(aHeaderSize.Height()) ); } // draw our own content (with clipping) @@ -807,7 +807,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec // redraw the invalid fields for ( sal_uLong nRelRow = nRelTopRow; nRelRow <= nRelBottomRow && static_cast<sal_uLong>(nTopRow)+nRelRow < static_cast<sal_uLong>(nRowCount); - ++nRelRow, aPos.Y() += nDataRowHeigt ) + ++nRelRow, aPos.AdjustY(nDataRowHeigt ) ) { // get row // check valid area, to be on the safe side: @@ -821,7 +821,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec OSL_FAIL("BrowseBox::ImplPaintData: SeekRow failed"); } _rOut.SetClipRegion(); - aPos.X() = aOverallAreaPos.X(); + aPos.setX( aOverallAreaPos.X() ); // #73325# don't paint the row outside the painting rectangle (DG) @@ -893,14 +893,14 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec Size aFieldSize(pCol->Width(), nDataRowHeigt); if (aPos.X() + aFieldSize.Width() > aOverallAreaBRPos.X()) - aFieldSize.Width() = aOverallAreaBRPos.X() - aPos.X(); + aFieldSize.setWidth( aOverallAreaBRPos.X() - aPos.X() ); if (aPos.Y() + aFieldSize.Height() > aOverallAreaBRPos.Y() + 1) { // for non-handle cols we don't clip vertically : we just don't draw the cell if the line isn't completely visible if (pCol->GetId() != 0) continue; - aFieldSize.Height() = aOverallAreaBRPos.Y() + 1 - aPos.Y(); + aFieldSize.setHeight( aOverallAreaBRPos.Y() + 1 - aPos.Y() ); } vcl::Region aClipToField(tools::Rectangle(aPos, aFieldSize)); @@ -920,7 +920,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec } // skip column - aPos.X() += pCol->Width(); + aPos.AdjustX(pCol->Width() ); } // reset auto-highlight @@ -949,7 +949,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec } if (aPos.Y() > aOverallAreaBRPos.Y() + 1) - aPos.Y() = aOverallAreaBRPos.Y() + 1; + aPos.setY( aOverallAreaBRPos.Y() + 1 ); // needed for some of the following drawing // retouching @@ -996,7 +996,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec } // skip column - aVertPos.X() += pCol->Width(); + aVertPos.AdjustX(pCol->Width() ); // at end of invalid area // invalid area is first reached when X > Right @@ -1067,14 +1067,14 @@ void BrowseBox::UpdateScrollbars() { pVScroll->Hide(); Size aNewSize( aDataWinSize ); - aNewSize.Width() = GetOutputSizePixel().Width(); + aNewSize.setWidth( GetOutputSizePixel().Width() ); aDataWinSize = aNewSize; } } else if ( !pVScroll->IsVisible() ) { Size aNewSize( aDataWinSize ); - aNewSize.Width() = GetOutputSizePixel().Width() - nCornerSize; + aNewSize.setWidth( GetOutputSizePixel().Width() - nCornerSize ); aDataWinSize = aNewSize; } @@ -1091,14 +1091,14 @@ void BrowseBox::UpdateScrollbars() { aHScroll->Hide(); } - aDataWinSize.Height() = GetOutputSizePixel().Height() - GetTitleHeight(); + aDataWinSize.setHeight( GetOutputSizePixel().Height() - GetTitleHeight() ); if ( nControlAreaWidth != USHRT_MAX ) - aDataWinSize.Height() -= nCornerSize; + aDataWinSize.AdjustHeight( -sal_Int32(nCornerSize) ); } else if ( !aHScroll->IsVisible() ) { Size aNewSize( aDataWinSize ); - aNewSize.Height() = GetOutputSizePixel().Height() - GetTitleHeight() - nCornerSize; + aNewSize.setHeight( GetOutputSizePixel().Height() - GetTitleHeight() - nCornerSize ); aDataWinSize = aNewSize; } @@ -1941,7 +1941,7 @@ tools::Rectangle BrowseBox::calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen) } else { - aTopLeft.Y() = GetDataRowHeight(); + aTopLeft.setY( GetDataRowHeight() ); nWidth = GetColumnWidth(0); nHeight = GetWindowExtentsRelative( pParent ).GetHeight() - aTopLeft.Y() - GetControlArea().GetSize().Height(); } diff --git a/svtools/source/brwbox/brwhead.cxx b/svtools/source/brwbox/brwhead.cxx index f8ffa0e834e3..2f592281d45e 100644 --- a/svtools/source/brwbox/brwhead.cxx +++ b/svtools/source/brwbox/brwhead.cxx @@ -53,7 +53,7 @@ void BrowserHeader::Command( const CommandEvent& rCEvt ) { Point aPos( rCEvt.GetMousePosPixel() ); if ( _pBrowseBox->IsFrozen(0) ) - aPos.X() += _pBrowseBox->GetColumnWidth(0); + aPos.AdjustX(_pBrowseBox->GetColumnWidth(0) ); _pBrowseBox->GetDataWindow().Command( CommandEvent( Point( aPos.X(), aPos.Y() - GetSizePixel().Height() ), CommandEventId::ContextMenu, rCEvt.IsMouseEvent() ) ); diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index 2ca807be8276..2385b7d8b907 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -362,7 +362,7 @@ void BrowserDataWin::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) if ( !GetParent()->bRowDividerDrag ) { Point aEventPos( _rPosPixel ); - aEventPos.Y() += GetParent()->GetTitleHeight(); + aEventPos.AdjustY(GetParent()->GetTitleHeight() ); GetParent()->StartDrag( _nAction, aEventPos ); } } @@ -394,7 +394,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt ) bInCommand = false; } - aEventPos.Y() += GetParent()->GetTitleHeight(); + aEventPos.AdjustY(GetParent()->GetTitleHeight() ); CommandEvent aEvt( aEventPos, rEvt.GetCommand(), rEvt.IsMouseEvent(), rEvt.GetEventData() ); bInCommand = true; @@ -528,7 +528,7 @@ void BrowserDataWin::Tracking( const TrackingEvent& rTEvt ) Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel(); // stop resizing at our bottom line if ( aMousePos.Y() > GetOutputSizePixel().Height() ) - aMousePos.Y() = GetOutputSizePixel().Height(); + aMousePos.setY( GetOutputSizePixel().Height() ); if ( rTEvt.IsTrackingEnded() ) { diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 02f2cb83cdda..05094cc40c30 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -317,18 +317,18 @@ namespace svt Image aImage(GetImage(eStatus)); // calc the image position Size aImageSize(aImage.GetSizePixel()); - aImageSize.Width() = CalcZoom(aImageSize.Width()); - aImageSize.Height() = CalcZoom(aImageSize.Height()); + aImageSize.setWidth( CalcZoom(aImageSize.Width()) ); + aImageSize.setHeight( CalcZoom(aImageSize.Height()) ); Point aPos( rRect.TopLeft() ); if ( ( aImageSize.Width() > rRect.GetWidth() ) || ( aImageSize.Height() > rRect.GetHeight() ) ) rDev.SetClipRegion(vcl::Region(rRect)); if ( aImageSize.Width() < rRect.GetWidth() ) - aPos.X() += ( rRect.GetWidth() - aImageSize.Width() ) / 2; + aPos.AdjustX(( rRect.GetWidth() - aImageSize.Width() ) / 2 ); if ( aImageSize.Height() < rRect.GetHeight() ) - aPos.Y() += ( rRect.GetHeight() - aImageSize.Height() ) / 2; + aPos.AdjustY(( rRect.GetHeight() - aImageSize.Height() ) / 2 ); if ( IsZoom() ) rDev.DrawImage( aPos, aImageSize, aImage ); @@ -1019,8 +1019,8 @@ return; tools::Rectangle aRect( GetFieldRectPixel(nRow, nColId, bRel)); if ((GetMode() & BrowserMode::CURSOR_WO_FOCUS) == BrowserMode::CURSOR_WO_FOCUS) { - aRect.Top() += 1; - aRect.Bottom() -= 1; + aRect.AdjustTop(1 ); + aRect.AdjustBottom( -1 ); } return aRect; } @@ -1193,7 +1193,7 @@ return; { tools::Rectangle aHdlFieldRect( GetFieldRectPixel( 0, 0 )); tools::Rectangle aInvalidRect( Point(0,0), GetOutputSizePixel() ); - aInvalidRect.Right() = aHdlFieldRect.Right(); + aInvalidRect.SetRight( aHdlFieldRect.Right() ); Invalidate( aInvalidRect ); } diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 02565a04ef84..df6ef2fda9ae 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -569,7 +569,7 @@ void ViewTabListBox_Impl::Resize() if ( mbShowHeader ) { aBarSize = mpHeaderBar->GetSizePixel(); - aBarSize.Width() = mbAutoResize ? aBoxSize.Width() : GetSizePixel().Width(); + aBarSize.setWidth( mbAutoResize ? aBoxSize.Width() : GetSizePixel().Width() ); mpHeaderBar->SetSizePixel( aBarSize ); } @@ -1299,7 +1299,7 @@ IMPL_LINK( SvtFileView, HeaderEndDrag_Impl, HeaderBar*, pBar, void ) for ( sal_uInt16 i = 1; i <= nTabs; ++i ) { long nWidth = pBar->GetItemSize(i); - aSize.Width() = nWidth + nTmpSize; + aSize.setWidth( nWidth + nTmpSize ); nTmpSize += nWidth; mpImpl->mpView->SetTab( i, aSize.Width(), MapUnit::MapPixel ); } diff --git a/svtools/source/contnr/iconview.cxx b/svtools/source/contnr/iconview.cxx index 76fab5ef5159..c7f7d9181d59 100644 --- a/svtools/source/contnr/iconview.cxx +++ b/svtools/source/contnr/iconview.cxx @@ -50,12 +50,12 @@ void IconView::Resize() tools::Rectangle IconView::GetFocusRect( SvTreeListEntry*, long nEntryPos ) { Size aSize; - aSize.Height() = nEntryHeight; - aSize.Width() = nEntryWidth; + aSize.setHeight( nEntryHeight ); + aSize.setWidth( nEntryWidth ); Point aPos; - aPos.X() = 0; - aPos.Y() = 0; + aPos.setX( 0 ); + aPos.setY( 0 ); tools::Rectangle aRect; @@ -63,8 +63,8 @@ tools::Rectangle IconView::GetFocusRect( SvTreeListEntry*, long nEntryPos ) if(nCols) { - aPos.Y() = ( nEntryPos / nCols ) * nEntryHeight; - aPos.X() = ( nEntryPos % nCols ) * nEntryWidth; + aPos.setY( ( nEntryPos / nCols ) * nEntryHeight ); + aPos.setX( ( nEntryPos % nCols ) * nEntryWidth ); } aRect.SetPos( aPos ); @@ -132,8 +132,8 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, long nY, Size aSize(SvLBoxItem::GetSize(pViewDataEntry, nCurItem)); - aEntryPos.X() = nX; - aEntryPos.Y() = nY; + aEntryPos.setX( nX ); + aEntryPos.setY( nY ); // set background pattern/color @@ -192,12 +192,12 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, long nY, } // center vertically - aEntryPos.Y() += (nTempEntryHeight - aSize.Height()) / 2; + aEntryPos.AdjustY((nTempEntryHeight - aSize.Height()) / 2 ); // draw item pViewDataEntry->SetPaintRectangle(aRect); - aEntryPos.Y() += 15; + aEntryPos.AdjustY(15 ); pItem->Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, rEntry); @@ -211,15 +211,15 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, long nY, { Size aSize(SvLBoxItem::GetSize(pViewDataEntry, nIconItem)); - aEntryPos.X() = nX; - aEntryPos.Y() = nY; + aEntryPos.setX( nX ); + aEntryPos.setY( nY ); // center horizontally - aEntryPos.X() += (nTempEntryWidth - aSize.Width()) / 2; + aEntryPos.AdjustX((nTempEntryWidth - aSize.Width()) / 2 ); // center vertically - aEntryPos.Y() += (nTempEntryHeight - aSize.Height()) / 2; + aEntryPos.AdjustY((nTempEntryHeight - aSize.Height()) / 2 ); - aEntryPos.Y() -= 10; + aEntryPos.AdjustY( -10 ); SvLBoxItem* pItem = &rEntry.GetItem(nIconItem); diff --git a/svtools/source/contnr/iconviewimpl.cxx b/svtools/source/contnr/iconviewimpl.cxx index 3b3380a7d972..f1613fe4e6bd 100644 --- a/svtools/source/contnr/iconviewimpl.cxx +++ b/svtools/source/contnr/iconviewimpl.cxx @@ -45,7 +45,7 @@ void IconViewImpl::CursorUp() pView->Update(); pStartEntry = pPrevFirstToDraw; tools::Rectangle aArea( GetVisibleArea() ); - aArea.Bottom() -= nEntryHeight; + aArea.AdjustBottom( -nEntryHeight ); pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); pView->Update(); ShowCursor( true ); @@ -445,13 +445,13 @@ void IconViewImpl::InvalidateEntry( long nId ) const tools::Rectangle aRect( GetVisibleArea() ); long nMaxBottom = aRect.Bottom(); - aRect.Top() = nId / pView->GetColumnsCount() * pView->GetEntryHeight(); - aRect.Bottom() = aRect.Top(); aRect.Bottom() += pView->GetEntryHeight(); + aRect.SetTop( nId / pView->GetColumnsCount() * pView->GetEntryHeight() ); + aRect.SetBottom( aRect.Top() ); aRect.AdjustBottom(pView->GetEntryHeight() ); if( aRect.Top() > nMaxBottom ) return; if( aRect.Bottom() > nMaxBottom ) - aRect.Bottom() = nMaxBottom; + aRect.SetBottom( nMaxBottom ); pView->Invalidate( aRect ); } diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index f8dbb98176e1..e97d67952430 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -161,7 +161,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( Size gridSize(100,70); if(pView->GetDPIScaleFactor() > 1) { - gridSize.Height() *= pView->GetDPIScaleFactor(); + gridSize.setHeight( gridSize.Height() * ( pView->GetDPIScaleFactor()) ); } SetGrid(gridSize); } @@ -203,8 +203,8 @@ void SvxIconChoiceCtrl_Impl::Clear( bool bInCtor ) { pImpCursor->Clear(); pGridMap->Clear(); - aVirtOutputSize.Width() = 0; - aVirtOutputSize.Height() = 0; + aVirtOutputSize.setWidth( 0 ); + aVirtOutputSize.setHeight( 0 ); Size aSize( pView->GetOutputSizePixel() ); nMaxVirtWidth = aSize.Width() - nVerSBarWidth; if( nMaxVirtWidth <= 0 ) @@ -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.Right() = LONG_MAX; + pEntry->aRect.SetRight( LONG_MAX ); if( bUpdateMode ) { FindBoundingRect( pEntry ); @@ -427,8 +427,8 @@ void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool void SvxIconChoiceCtrl_Impl::ResetVirtSize() { StopEditTimer(); - aVirtOutputSize.Width() = 0; - aVirtOutputSize.Height() = 0; + aVirtOutputSize.setWidth( 0 ); + aVirtOutputSize.setHeight( 0 ); const size_t nCount = aEntries.size(); for( size_t nCur = 0; nCur < nCount; nCur++ ) { @@ -484,11 +484,11 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const tools::Rectangle& rRect ) return; Range aRange; - aVirtOutputSize.Width() += nWidthOffs; + aVirtOutputSize.AdjustWidth(nWidthOffs ); aRange.Max() = aVirtOutputSize.Width(); aHorSBar->SetRange( aRange ); - aVirtOutputSize.Height() += nHeightOffs; + aVirtOutputSize.AdjustHeight(nHeightOffs ); aRange.Max() = aVirtOutputSize.Height(); aVerSBar->SetRange( aRange ); @@ -1039,8 +1039,8 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) tools::Rectangle aRect( GetEntryBoundRect( pCursor ) ); if( aRect.Top()) { - aRect.Bottom() -= aRect.Top(); - aRect.Top() = 0; + aRect.AdjustBottom( -(aRect.Top()) ); + aRect.SetTop( 0 ); MakeVisible( aRect ); } } @@ -1094,8 +1094,8 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) tools::Rectangle aRect( GetEntryBoundRect(pCursor)); if( aRect.Left() ) { - aRect.Right() -= aRect.Left(); - aRect.Left() = 0; + aRect.AdjustRight( -(aRect.Left()) ); + aRect.SetLeft( 0 ); MakeVisible( aRect ); } } @@ -1211,16 +1211,16 @@ void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeig { // horizontal scrollbar Point aPos( 0, nRealHeight ); - aPos.Y() -= nHorSBarHeight; + aPos.AdjustY( -(nHorSBarHeight) ); if( aHorSBar->GetPosPixel() != aPos ) aHorSBar->SetPosPixel( aPos ); // vertical scrollbar - aPos.X() = nRealWidth; aPos.Y() = 0; - aPos.X() -= nVerSBarWidth; - aPos.X()++; - aPos.Y()--; + aPos.setX( nRealWidth ); aPos.setY( 0 ); + aPos.AdjustX( -(nVerSBarWidth) ); + aPos.AdjustX( 1 ); + aPos.AdjustY( -1 ); if( aVerSBar->GetPosPixel() != aPos ) aVerSBar->SetPosPixel( aPos ); @@ -1300,7 +1300,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars() // size vertical scrollbar long nThumb = aVerSBar->GetThumbPos(); Size aSize( nVerSBarWidth, nRealHeight ); - aSize.Height() += 2; + aSize.AdjustHeight(2 ); if( aSize != aVerSBar->GetSizePixel() ) aVerSBar->SetSizePixel( aSize ); aVerSBar->SetVisibleSize( nVisibleHeight ); @@ -1319,12 +1319,12 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars() // size horizontal scrollbar nThumb = aHorSBar->GetThumbPos(); - aSize.Width() = nRealWidth; - aSize.Height() = nHorSBarHeight; - aSize.Width()++; + aSize.setWidth( nRealWidth ); + aSize.setHeight( nHorSBarHeight ); + aSize.AdjustWidth( 1 ); if( nResult & 0x0001 ) // vertical scrollbar? { - aSize.Width()++; + aSize.AdjustWidth( 1 ); nRealWidth++; } if( aSize != aHorSBar->GetSizePixel() ) @@ -1342,10 +1342,10 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars() aHorSBar->Hide(); } - aOutputSize.Width() = nRealWidth; + aOutputSize.setWidth( nRealWidth ); if( nResult & 0x0002 ) // horizontal scrollbar ? nRealHeight++; // because lower border is clipped - aOutputSize.Height() = nRealHeight; + aOutputSize.setHeight( nRealHeight ); if( (nResult & (0x0001|0x0002)) == (0x0001|0x0002) ) aScrBarBox->Show(); @@ -1397,8 +1397,8 @@ bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar() nMostRight = nRight; } aHorSBar->Hide(); - aOutputSize.Height() += nHorSBarHeight; - aVirtOutputSize.Width() = nMostRight; + aOutputSize.AdjustHeight(nHorSBarHeight ); + aVirtOutputSize.setWidth( nMostRight ); aHorSBar->SetThumbPos( 0 ); Range aRange; aRange.Max() = nMostRight - 1; @@ -1406,7 +1406,7 @@ bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar() if( aVerSBar->IsVisible() ) { Size aSize( aVerSBar->GetSizePixel()); - aSize.Height() += nHorSBarHeight; + aSize.AdjustHeight(nHorSBarHeight ); aVerSBar->SetSizePixel( aSize ); } return true; @@ -1435,8 +1435,8 @@ bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar() nDeepest = nBottom; } aVerSBar->Hide(); - aOutputSize.Width() += nVerSBarWidth; - aVirtOutputSize.Height() = nDeepest; + aOutputSize.AdjustWidth(nVerSBarWidth ); + aVirtOutputSize.setHeight( nDeepest ); aVerSBar->SetThumbPos( 0 ); Range aRange; aRange.Max() = nDeepest - 1; @@ -1444,7 +1444,7 @@ bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar() if( aHorSBar->IsVisible() ) { Size aSize( aHorSBar->GetSizePixel()); - aSize.Width() += nVerSBarWidth; + aSize.AdjustWidth(nVerSBarWidth ); aHorSBar->SetSizePixel( aSize ); } return true; @@ -1570,9 +1570,9 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect, { Point aPos(rRect.TopLeft()); if (nPaintFlags & PAINTFLAG_HOR_CENTERED) - aPos.X() += (rRect.GetWidth() - aImageSize.Width()) / 2; + aPos.AdjustX((rRect.GetWidth() - aImageSize.Width()) / 2 ); if (nPaintFlags & PAINTFLAG_VER_CENTERED) - aPos.Y() += (rRect.GetHeight() - aImageSize.Height()) / 2; + aPos.AdjustY((rRect.GetHeight() - aImageSize.Height()) / 2 ); SvtIconChoiceCtrl::DrawEntryImage(pEntry, aPos, rRenderContext); } } @@ -1721,10 +1721,10 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, if( bHit ) { tools::Rectangle aRect = CalcBmpRect( pEntry ); - aRect.Top() -= 3; - aRect.Bottom() += 3; - aRect.Left() -= 3; - aRect.Right() += 3; + aRect.AdjustTop( -3 ); + aRect.AdjustBottom(3 ); + aRect.AdjustLeft( -3 ); + aRect.AdjustRight(3 ); if( aRect.IsInside( rDocPos ) ) return pEntry; aRect = CalcTextRect( pEntry ); @@ -1749,10 +1749,10 @@ void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, b { tools::Rectangle aRect = CalcBmpRect( pEntry ); aRect.Union( CalcTextRect( pEntry ) ); - aRect.Top() += TBOFFS_BOUND; - aRect.Bottom() += TBOFFS_BOUND; - aRect.Left() += LROFFS_BOUND; - aRect.Right() += LROFFS_BOUND; + aRect.AdjustTop(TBOFFS_BOUND ); + aRect.AdjustBottom(TBOFFS_BOUND ); + aRect.AdjustLeft(LROFFS_BOUND ); + aRect.AdjustRight(LROFFS_BOUND ); MakeVisible( aRect ); } } @@ -1775,13 +1775,13 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( SvxIconChoiceCtrlEntry* pE { case WB_ICON: { - aPos.X() += ( aBound.GetWidth() - aImageSize.Width() ) / 2; + aPos.AdjustX(( aBound.GetWidth() - aImageSize.Width() ) / 2 ); return tools::Rectangle( aPos, aImageSize ); } case WB_SMALLICON: case WB_DETAILS: - aPos.Y() += ( aBound.GetHeight() - aImageSize.Height() ) / 2; + aPos.AdjustY(( aBound.GetHeight() - aImageSize.Height() ) / 2 ); //TODO: determine horizontal distance to bounding rectangle return tools::Rectangle( aPos, aImageSize ); @@ -1818,8 +1818,8 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* p switch( nWinBits & VIEWMODE_MASK ) { case WB_ICON: - aPos.Y() += aImageSize.Height(); - aPos.Y() += VER_DIST_BMP_STRING; + aPos.AdjustY(aImageSize.Height() ); + aPos.AdjustY(VER_DIST_BMP_STRING ); // at little more space when editing if( bEdit ) { @@ -1830,21 +1830,21 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* p nMinWidth = nBoundWidth; if( aTextSize.Width() < nMinWidth ) - aTextSize.Width() = nMinWidth; + aTextSize.setWidth( nMinWidth ); // when editing, overlap with the area below is allowed Size aOptSize = aMaxTextRect.GetSize(); if( aOptSize.Height() > aTextSize.Height() ) - aTextSize.Height() = aOptSize.Height(); + aTextSize.setHeight( aOptSize.Height() ); } - aPos.X() += (nBoundWidth - aTextSize.Width()) / 2; + aPos.AdjustX((nBoundWidth - aTextSize.Width()) / 2 ); break; case WB_SMALLICON: case WB_DETAILS: - aPos.X() += aImageSize.Width(); - aPos.X() += HOR_DIST_BMP_STRING; - aPos.Y() += (nBoundHeight - aTextSize.Height()) / 2; + aPos.AdjustX(aImageSize.Width() ); + aPos.AdjustX(HOR_DIST_BMP_STRING ); + aPos.AdjustY((nBoundHeight - aTextSize.Height()) / 2 ); break; } return tools::Rectangle( aPos, aTextSize ); @@ -2097,10 +2097,10 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) if( nScrollDX || nScrollDY ) { - aVisRect.Top() -= nScrollDY; - aVisRect.Bottom() -= nScrollDY; - aVisRect.Left() -= nScrollDX; - aVisRect.Right() -= nScrollDX; + aVisRect.AdjustTop( -nScrollDY ); + aVisRect.AdjustBottom( -nScrollDY ); + aVisRect.AdjustLeft( -nScrollDX ); + aVisRect.AdjustRight( -nScrollDX ); MakeVisible( aVisRect ); return true; } @@ -2143,13 +2143,13 @@ void SvxIconChoiceCtrl_Impl::ToTop( SvxIconChoiceCtrlEntry* pEntry ) void SvxIconChoiceCtrl_Impl::ClipAtVirtOutRect( tools::Rectangle& rRect ) const { if( rRect.Bottom() >= aVirtOutputSize.Height() ) - rRect.Bottom() = aVirtOutputSize.Height() - 1; + rRect.SetBottom( aVirtOutputSize.Height() - 1 ); if( rRect.Right() >= aVirtOutputSize.Width() ) - rRect.Right() = aVirtOutputSize.Width() - 1; + rRect.SetRight( aVirtOutputSize.Width() - 1 ); if( rRect.Top() < 0 ) - rRect.Top() = 0; + rRect.SetTop( 0 ); if( rRect.Left() < 0 ) - rRect.Left() = 0; + rRect.SetLeft( 0 ); } // rRect: area of the document (in document coordinates) that we want to make @@ -2195,8 +2195,8 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS else nDx = 0; - aOrigin.X() += nDx; - aOrigin.Y() += nDy; + aOrigin.AdjustX(nDx ); + aOrigin.AdjustY(nDy ); aOutputArea.SetPos( aOrigin ); if( GetUpdateMode() ) { @@ -2282,19 +2282,19 @@ void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry const * pThi Size SvxIconChoiceCtrl_Impl::GetMinGrid() const { Size aMinSize( aImageSize ); - aMinSize.Width() += 2 * LROFFS_BOUND; - aMinSize.Height() += TBOFFS_BOUND; // single offset is enough (FileDlg) + aMinSize.AdjustWidth(2 * LROFFS_BOUND ); + aMinSize.AdjustHeight(TBOFFS_BOUND ); // single offset is enough (FileDlg) OUString const aStrDummy( "XXX" ); Size aTextSize( pView->GetTextWidth( aStrDummy ), pView->GetTextHeight() ); if( nWinBits & WB_ICON ) { - aMinSize.Height() += VER_DIST_BMP_STRING; - aMinSize.Height() += aTextSize.Height(); + aMinSize.AdjustHeight(VER_DIST_BMP_STRING ); + aMinSize.AdjustHeight(aTextSize.Height() ); } else { - aMinSize.Width() += HOR_DIST_BMP_STRING; - aMinSize.Width() += aTextSize.Width(); + aMinSize.AdjustWidth(HOR_DIST_BMP_STRING ); + aMinSize.AdjustWidth(aTextSize.Width() ); } return aMinSize; } @@ -2304,9 +2304,9 @@ void SvxIconChoiceCtrl_Impl::SetGrid( const Size& rSize ) Size aSize( rSize ); Size aMinSize( GetMinGrid() ); if( aSize.Width() < aMinSize.Width() ) - aSize.Width() = aMinSize.Width(); + aSize.setWidth( aMinSize.Width() ); if( aSize.Height() < aMinSize.Height() ) - aSize.Height() = aMinSize.Height(); + aSize.setHeight( aMinSize.Height() ); nGridDX = aSize.Width(); // HACK: Detail mode is not yet fully implemented, this workaround makes it @@ -2338,31 +2338,31 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtr const_cast<SvxIconChoiceCtrlEntry*>(pEntry) ) ); if( nWinBits & WB_ICON ) { - aBoundRect.Top() = aBmpRect.Bottom(); - aBoundRect.Top() += VER_DIST_BMP_STRING; + aBoundRect.SetTop( aBmpRect.Bottom() ); + aBoundRect.AdjustTop(VER_DIST_BMP_STRING ); if( aBoundRect.Top() > aBoundRect.Bottom()) - aBoundRect.Top() = aBoundRect.Bottom(); - aBoundRect.Left() += LROFFS_BOUND; - aBoundRect.Left()++; - aBoundRect.Right() -= LROFFS_BOUND; - aBoundRect.Right()--; + aBoundRect.SetTop( aBoundRect.Bottom() ); + aBoundRect.AdjustLeft(LROFFS_BOUND ); + aBoundRect.AdjustLeft( 1 ); + aBoundRect.AdjustRight( -(LROFFS_BOUND) ); + aBoundRect.AdjustRight( -1 ); if( aBoundRect.Left() > aBoundRect.Right()) - aBoundRect.Left() = aBoundRect.Right(); + aBoundRect.SetLeft( aBoundRect.Right() ); if( pEntry->GetTextMode() == SvxIconChoiceCtrlTextMode::Full ) - aBoundRect.Bottom() = LONG_MAX; + aBoundRect.SetBottom( LONG_MAX ); } else { - aBoundRect.Left() = aBmpRect.Right(); - aBoundRect.Left() += HOR_DIST_BMP_STRING; - aBoundRect.Right() -= LROFFS_BOUND; + aBoundRect.SetLeft( aBmpRect.Right() ); + aBoundRect.AdjustLeft(HOR_DIST_BMP_STRING ); + aBoundRect.AdjustRight( -(LROFFS_BOUND) ); if( aBoundRect.Left() > aBoundRect.Right() ) - aBoundRect.Left() = aBoundRect.Right(); + aBoundRect.SetLeft( aBoundRect.Right() ); long nHeight = aBoundRect.GetSize().Height(); nHeight = nHeight - aDefaultTextSize.Height(); nHeight /= 2; - aBoundRect.Top() += nHeight; - aBoundRect.Bottom() -= nHeight; + aBoundRect.AdjustTop(nHeight ); + aBoundRect.AdjustBottom( -nHeight ); } return aBoundRect; } @@ -2401,11 +2401,11 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const { // center horizontally long nBorder = pEntry->aGridRect.GetWidth() - aSize.Width(); - pEntry->aRect.Left() += nBorder / 2; - pEntry->aRect.Right() -= nBorder / 2; + pEntry->aRect.AdjustLeft(nBorder / 2 ); + pEntry->aRect.AdjustRight( -(nBorder / 2) ); } // center vertically - pEntry->aRect.Bottom() = pEntry->aRect.Top() + aSize.Height(); + pEntry->aRect.SetBottom( pEntry->aRect.Top() + aSize.Height() ); } @@ -2418,8 +2418,8 @@ void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY ) Point aOrigin( rMapMode.GetOrigin() ); // convert to document coordinate aOrigin *= -1; - aOrigin.Y() += nDeltaY; - aOrigin.X() += nDeltaX; + aOrigin.AdjustY(nDeltaY ); + aOrigin.AdjustX(nDeltaX ); tools::Rectangle aRect( aOrigin, aOutputSize ); MakeVisible( aRect, true/*bScrollBar*/ ); } @@ -2448,11 +2448,11 @@ static tools::Rectangle GetHotSpot( const tools::Rectangle& rRect ) aResult.Justify(); Size aSize( rRect.GetSize() ); long nDelta = aSize.Width() / 4; - aResult.Left() += nDelta; - aResult.Right() -= nDelta; + aResult.AdjustLeft(nDelta ); + aResult.AdjustRight( -nDelta ); nDelta = aSize.Height() / 4; - aResult.Top() += nDelta; - aResult.Bottom() -= nDelta; + aResult.AdjustTop(nDelta ); + aResult.AdjustBottom( -nDelta ); return aResult; } @@ -3074,13 +3074,13 @@ void SvxIconChoiceCtrl_Impl::InitSettings() nHorSBarHeight = nScrBarSize; Size aSize( aHorSBar->GetSizePixel() ); - aSize.Height() = nScrBarSize; + aSize.setHeight( nScrBarSize ); aHorSBar->Hide(); aHorSBar->SetSizePixel( aSize ); nVerSBarWidth = nScrBarSize; aSize = aVerSBar->GetSizePixel(); - aSize.Width() = nScrBarSize; + aSize.setWidth( nScrBarSize ); aVerSBar->Hide(); aVerSBar->SetSizePixel( aSize ); @@ -3226,8 +3226,8 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const { Point aPos( rPos ); - aPos.X() -= LROFFS_WINBORDER; - aPos.Y() -= TBOFFS_WINBORDER; + aPos.AdjustX( -(LROFFS_WINBORDER) ); + aPos.AdjustY( -(TBOFFS_WINBORDER) ); long nMaxCol = aVirtOutputSize.Width() / nGridDX; if( nMaxCol ) nMaxCol--; @@ -3267,7 +3267,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) return false; tools::Rectangle aOptTextRect( aTextRect ); - aOptTextRect.Bottom() = LONG_MAX; + aOptTextRect.SetBottom( LONG_MAX ); DrawTextFlags nNewFlags = nCurTextDrawFlags; nNewFlags &= ~DrawTextFlags( DrawTextFlags::Clip | DrawTextFlags::EndEllipsis ); aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags ); @@ -3278,8 +3278,8 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) aPt += pView->GetMapMode().GetOrigin(); aPt = pView->OutputToScreenPixel( aPt ); // subtract border of tooltip help - aPt.Y() -= 1; - aPt.X() -= 3; + aPt.AdjustY( -1 ); + aPt.AdjustX( -3 ); aOptTextRect.SetPos( aPt ); OUString sHelpText; if ( !sQuickHelpText.isEmpty() ) @@ -3334,10 +3334,10 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderConte long nBorder = 2; if (aImageSize.Width() < 32) nBorder = 1; - aBmpRect.Right() += nBorder; - aBmpRect.Left() -= nBorder; - aBmpRect.Bottom() += nBorder; - aBmpRect.Top() -= nBorder; + aBmpRect.AdjustRight(nBorder ); + aBmpRect.AdjustLeft( -nBorder ); + aBmpRect.AdjustBottom(nBorder ); + aBmpRect.AdjustTop( -nBorder ); DecorationView aDecoView(&rRenderContext); DrawHighlightFrameStyle nDecoFlags; diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx index bb78c42851d9..7807f93b39ad 100644 --- a/svtools/source/contnr/simptabl.cxx +++ b/svtools/source/contnr/simptabl.cxx @@ -144,7 +144,7 @@ void SvSimpleTable::UpdateViewSize() Size theWinSize=m_rParentTableContainer.GetOutputSizePixel(); Size HbSize=aHeaderBar->GetSizePixel(); - HbSize.Width()=theWinSize.Width(); + HbSize.setWidth(theWinSize.Width() ); theWinSize.Height()-=HbSize.Height(); Point thePos(0,0); @@ -346,8 +346,8 @@ void SvSimpleTable::HBarDrag() { tools::Rectangle aSizeRect(Point(0,0), SvHeaderTabListBox::GetOutputSizePixel()); - aSizeRect.Left()=-GetXOffset()+aHeaderBar->GetDragPos(); - aSizeRect.Right()=-GetXOffset()+aHeaderBar->GetDragPos(); + aSizeRect.SetLeft(-GetXOffset()+aHeaderBar->GetDragPos() ); + aSizeRect.SetRight(-GetXOffset()+aHeaderBar->GetDragPos() ); ShowTracking( aSizeRect, ShowTrackFlags::Split ); } } @@ -391,8 +391,8 @@ IMPL_LINK( SvSimpleTable, StartDragHdl, HeaderBar*, pCtr, void) { tools::Rectangle aSizeRect(Point(0,0), SvHeaderTabListBox::GetOutputSizePixel()); - aSizeRect.Left()=-GetXOffset()+aHeaderBar->GetDragPos(); - aSizeRect.Right()=-GetXOffset()+aHeaderBar->GetDragPos(); + aSizeRect.SetLeft(-GetXOffset()+aHeaderBar->GetDragPos() ); + aSizeRect.SetRight(-GetXOffset()+aHeaderBar->GetDragPos() ); ShowTracking( aSizeRect, ShowTrackFlags::Split ); } } diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 88f6dc6d691e..0a229ca5e6f3 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -223,14 +223,14 @@ void SvImpLBox::CalcCellFocusRect( SvTreeListEntry const * pEntry, tools::Rectan if ( nCurTabPos > FIRST_ENTRY_TAB ) { SvLBoxItem& rItem = pCursor->GetItem( nCurTabPos ); - rRect.Left() = pView->GetTab( pCursor, &rItem )->GetPos(); + rRect.SetLeft( pView->GetTab( pCursor, &rItem )->GetPos() ); } if (pCursor->ItemCount() > static_cast<size_t>(nCurTabPos+1)) { SvLBoxItem& rNextItem = pCursor->GetItem( nCurTabPos + 1 ); long nRight = pView->GetTab( pCursor, &rNextItem )->GetPos() - 1; if ( nRight < rRect.Right() ) - rRect.Right() = nRight; + rRect.SetRight( nRight ); } } @@ -379,7 +379,7 @@ void SvImpLBox::CursorUp() pView->Update(); pStartEntry = pPrevFirstToDraw; tools::Rectangle aArea( GetVisibleArea() ); - aArea.Bottom() -= nEntryHeight; + aArea.AdjustBottom( -nEntryHeight ); pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); pView->Update(); ShowCursor( true ); @@ -533,7 +533,7 @@ void SvImpLBox::InvalidateEntriesFrom( long nY ) const if( !(nFlags & LBoxFlags::InPaint )) { tools::Rectangle aRect( GetVisibleArea() ); - aRect.Top() = nY; + aRect.SetTop( nY ); pView->Invalidate( aRect ); } } @@ -544,12 +544,12 @@ void SvImpLBox::InvalidateEntry( long nY ) const { tools::Rectangle aRect( GetVisibleArea() ); long nMaxBottom = aRect.Bottom(); - aRect.Top() = nY; - aRect.Bottom() = nY; aRect.Bottom() += pView->GetEntryHeight(); + aRect.SetTop( nY ); + aRect.SetBottom( nY ); aRect.AdjustBottom(pView->GetEntryHeight() ); if( aRect.Top() > nMaxBottom ) return; if( aRect.Bottom() > nMaxBottom ) - aRect.Bottom() = nMaxBottom; + aRect.SetBottom( nMaxBottom ); pView->Invalidate( aRect ); } } @@ -783,11 +783,11 @@ bool SvImpLBox::EntryReallyHit(SvTreeListEntry* pEntry, const Point& rPosPixel, return true; tools::Rectangle aRect( pView->GetFocusRect( pEntry, nLine )); - aRect.Right() = GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X(); + aRect.SetRight( GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X() ); SvLBoxContextBmp* pBmp = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SvLBoxItemType::ContextBmp)); - aRect.Left() -= pBmp->GetSize(pView,pEntry).Width(); - aRect.Left() -= 4; // a little tolerance + aRect.AdjustLeft( -(pBmp->GetSize(pView,pEntry).Width()) ); + aRect.AdjustLeft( -4 ); // a little tolerance Point aPos( rPosPixel ); aPos -= pView->GetMapMode().GetOrigin(); @@ -858,9 +858,9 @@ SvTreeListEntry* SvImpLBox::MakePointVisible(const Point& rPoint) tools::Rectangle SvImpLBox::GetClipRegionRect() const { Point aOrigin( pView->GetMapMode().GetOrigin() ); - aOrigin.X() *= -1; // conversion document coordinates + aOrigin.setX( aOrigin.X() * -1 ); // conversion document coordinates tools::Rectangle aClipRect( aOrigin, aOutputSize ); - aClipRect.Bottom()++; + aClipRect.AdjustBottom( 1 ); return aClipRect; } @@ -1067,21 +1067,21 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext) { if (pView->IsExpanded(pEntry)) { - aPos1.X() = pView->GetTabPos(pEntry, pFirstDynamicTab); + aPos1.setX( pView->GetTabPos(pEntry, pFirstDynamicTab) ); // if it is not a context bitmap, go a little to the right below the // first text (node bitmap, too) if (!pView->nContextBmpWidthMax) - aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2; + aPos1.AdjustX(rExpandedNodeBitmap.GetSizePixel().Width() / 2 ); - aPos1.Y() = nY; - aPos1.Y() += nEntryHeightDIV2; + aPos1.setY( nY ); + aPos1.AdjustY(nEntryHeightDIV2 ); pChild = pView->FirstChild( pEntry ); DBG_ASSERT(pChild,"Child?"); pChild = SvTreeList::LastSibling( pChild ); nDistance = static_cast<sal_uInt16>(pView->GetVisiblePos(pChild) - pView->GetVisiblePos(pEntry)); aPos2 = aPos1; - aPos2.Y() += nDistance * nEntryHeight; + aPos2.AdjustY(nDistance * nEntryHeight ); rRenderContext.DrawLine(aPos1, aPos2); } // visible in control? @@ -1091,17 +1091,17 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext) if (!pView->IsExpanded(pEntry)) { // nope - aPos1.X() = pView->GetTabPos(pEntry, pFirstDynamicTab); + aPos1.setX( pView->GetTabPos(pEntry, pFirstDynamicTab) ); // if it is not a context bitmap, go a little to the right below // the first text (node bitmap, too) if (!pView->nContextBmpWidthMax) - aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2; - aPos1.Y() = nY; - aPos1.Y() += nEntryHeightDIV2; - aPos2.X() = aPos1.X(); + aPos1.AdjustX(rExpandedNodeBitmap.GetSizePixel().Width() / 2 ); + aPos1.setY( nY ); + aPos1.AdjustY(nEntryHeightDIV2 ); + aPos2.setX( aPos1.X() ); } - aPos2.Y() = aPos1.Y(); - aPos2.X() -= pView->GetIndent(); + aPos2.setY( aPos1.Y() ); + aPos2.AdjustX( -(pView->GetIndent()) ); rRenderContext.DrawLine(aPos1, aPos2); } nY += nEntryHeight; @@ -1110,18 +1110,18 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext) if (m_nStyle & WB_HASLINESATROOT) { pEntry = pView->First(); - aPos1.X() = pView->GetTabPos(pEntry, pFirstDynamicTab); + aPos1.setX( pView->GetTabPos(pEntry, pFirstDynamicTab) ); // if it is not a context bitmap, go a little to the right below the // first text (node bitmap, too) if (!pView->nContextBmpWidthMax) - aPos1.X() += rExpandedNodeBitmap.GetSizePixel().Width() / 2; - aPos1.X() -= pView->GetIndent(); - aPos1.Y() = GetEntryLine( pEntry ); - aPos1.Y() += nEntryHeightDIV2; + aPos1.AdjustX(rExpandedNodeBitmap.GetSizePixel().Width() / 2 ); + aPos1.AdjustX( -(pView->GetIndent()) ); + aPos1.setY( GetEntryLine( pEntry ) ); + aPos1.AdjustY(nEntryHeightDIV2 ); pChild = SvTreeList::LastSibling( pEntry ); - aPos2.X() = aPos1.X(); - aPos2.Y() = GetEntryLine( pChild ); - aPos2.Y() += nEntryHeightDIV2; + aPos2.setX( aPos1.X() ); + aPos2.setY( GetEntryLine( pChild ) ); + aPos2.AdjustY(nEntryHeightDIV2 ); rRenderContext.DrawLine(aPos1, aPos2); } rRenderContext.Pop(); @@ -1135,23 +1135,23 @@ void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask ) Size aHorSize( rSize.Width(), nHorSBarHeight ); if( nMask & 0x0001 ) - aHorSize.Width() -= nVerSBarWidth; + aHorSize.AdjustWidth( -(nVerSBarWidth) ); if( nMask & 0x0002 ) - aVerSize.Height() -= nHorSBarHeight; + aVerSize.AdjustHeight( -(nHorSBarHeight) ); - aVerSize.Height() += 2 * nOverlap; + aVerSize.AdjustHeight(2 * nOverlap ); Point aVerPos( rSize.Width() - aVerSize.Width() + nOverlap, -nOverlap ); aVerSBar->SetPosSizePixel( aVerPos, aVerSize ); - aHorSize.Width() += 2 * nOverlap; + aHorSize.AdjustWidth(2 * nOverlap ); Point aHorPos( -nOverlap, rSize.Height() - aHorSize.Height() + nOverlap ); aHorSBar->SetPosSizePixel( aHorPos, aHorSize ); if( nMask & 0x0001 ) - rSize.Width() = aVerPos.X(); + rSize.setWidth( aVerPos.X() ); if( nMask & 0x0002 ) - rSize.Height() = aHorPos.Y(); + rSize.setHeight( aHorPos.Y() ); if( (nMask & (0x0001|0x0002)) == (0x0001|0x0002) ) aScrBarBox->Show(); @@ -1174,7 +1174,7 @@ void SvImpLBox::AdjustScrollBars( Size& rSize ) bool bHorBar = false; long nMaxRight = aOSize.Width(); //GetOutputSize().Width(); Point aOrigin( pView->GetMapMode().GetOrigin() ); - aOrigin.X() *= -1; + aOrigin.setX( aOrigin.X() * -1 ); nMaxRight += aOrigin.X() - 1; long nVis = nMostRight - aOrigin.X(); if( (nWindowStyle & WB_HSCROLL) && @@ -1379,7 +1379,7 @@ void SvImpLBox::ShowVerSBar() long nMaxRight = GetOutputSize().Width(); Point aPos( pView->GetMapMode().GetOrigin() ); - aPos.X() *= -1; // convert document coordinates + aPos.setX( aPos.X() * -1 ); // convert document coordinates nMaxRight = nMaxRight + aPos.X() - 1; if( nMaxRight < nMostRight ) { @@ -3045,7 +3045,7 @@ void SvImpLBox::EndScroll() tools::Rectangle SvImpLBox::GetVisibleArea() const { Point aPos( pView->GetMapMode().GetOrigin() ); - aPos.X() *= -1; + aPos.setX( aPos.X() * -1 ); tools::Rectangle aRect( aPos, aOutputSize ); return aRect; } @@ -3112,14 +3112,14 @@ bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) return false; aPos = GetEntryPosition( pEntry ); - aPos.X() = pView->GetTabPos( pEntry, pTab ); //pTab->GetPos(); + aPos.setX( pView->GetTabPos( pEntry, pTab ) ); //pTab->GetPos(); Size aSize( pItem->GetSize( pView, pEntry ) ); SvLBoxTab* pNextTab = NextTab( pTab ); bool bItemClipped = false; // is the item cut off by its right neighbor? if( pNextTab && pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() ) { - aSize.Width() = pNextTab->GetPos() - pTab->GetPos(); + aSize.setWidth( pNextTab->GetPos() - pTab->GetPos() ); bItemClipped = true; } tools::Rectangle aItemRect( aPos, aSize ); @@ -3133,11 +3133,11 @@ bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) // aItemRect.Right() = aViewRect.Right(); Point aPt = pView->OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = pView->OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); Help::ShowQuickHelp( pView, aItemRect, static_cast<SvLBoxString*>(pItem)->GetText(), QuickHelpFlags::Left | QuickHelpFlags::VCenter ); @@ -3200,7 +3200,7 @@ bool SvImpLBox::SetMostRight( SvTreeListEntry* pEntry ) long nMaxRight = GetOutputSize().Width(); Point aPos( pView->GetMapMode().GetOrigin() ); - aPos.X() *= -1; // conversion document coordinates + aPos.setX( aPos.X() * -1 ); // conversion document coordinates nMaxRight = nMaxRight + aPos.X() - 1; long nNextTab = nTabPos < nMaxRight ? nMaxRight : nMaxRight + 50; diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 710cce12b686..c3aad1254602 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -194,7 +194,7 @@ void SvLBoxString::Paint( if (rDev.TextCenterAndClipEnabled()) { nStyle |= DrawTextFlags::PathEllipsis | DrawTextFlags::Center; - aSize.Width() = rDev.GetEntryWidth(); + aSize.setWidth( rDev.GetEntryWidth() ); } rRenderContext.DrawText(tools::Rectangle(rPos, aSize), maText, nStyle); } @@ -338,9 +338,9 @@ void SvLBoxButton::ImplAdjustBoxSize(Size& io_rSize, ControlType i_eType, vcl::R Size aContentSize( aNativeContent.GetSize() ); // leave a little space around the box image (looks better) if( aContentSize.Height() + 2 > io_rSize.Height() ) - io_rSize.Height() = aContentSize.Height() + 2; + io_rSize.setHeight( aContentSize.Height() + 2 ); if( aContentSize.Width() + 2 > io_rSize.Width() ) - io_rSize.Width() = aContentSize.Width() + 2; + io_rSize.setWidth( aContentSize.Width() + 2 ); } } diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 092725983735..21b458212319 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -811,7 +811,7 @@ tools::Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_ Point aTopLeft = aRect.TopLeft(); DBG_ASSERT( m_pImpl->m_pHeaderBar->GetItemCount() > _nColumn, "invalid column" ); tools::Rectangle aItemRect = m_pImpl->m_pHeaderBar->GetItemRect( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) ); - aTopLeft.X() = aItemRect.Left(); + aTopLeft.setX( aItemRect.Left() ); Size aSize = aItemRect.GetSize(); aRect = tools::Rectangle( aTopLeft, aSize ); vcl::Window* pParent = nullptr; diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 64236a8a8d45..0a68c3405e18 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -2479,8 +2479,8 @@ void SvTreeListBox::EditItemText(SvTreeListEntry* pEntry, SvLBoxString* pItem, c Size aItemSize( pItem->GetSize(this, pEntry) ); Point aPos = GetEntryPosition( pEntry ); - aPos.Y() += ( nEntryHeight - aItemSize.Height() ) / 2; - aPos.X() = GetTabPos( pEntry, pTab ); + aPos.AdjustY(( nEntryHeight - aItemSize.Height() ) / 2 ); + aPos.setX( GetTabPos( pEntry, pTab ) ); long nOutputWidth = pImpl->GetOutputSize().Width(); Size aSize( nOutputWidth - aPos.X(), aItemSize.Height() ); sal_uInt16 nPos = std::find( aTabs.begin(), aTabs.end(), pTab ) - aTabs.begin(); @@ -2489,11 +2489,11 @@ void SvTreeListBox::EditItemText(SvTreeListEntry* pEntry, SvLBoxString* pItem, c SvLBoxTab* pRightTab = aTabs[ nPos + 1 ]; long nRight = GetTabPos( pEntry, pRightTab ); if( nRight <= nOutputWidth ) - aSize.Width() = nRight - aPos.X(); + aSize.setWidth( nRight - aPos.X() ); } Point aOrigin( GetMapMode().GetOrigin() ); aPos += aOrigin; // convert to win coordinates - aSize.Width() -= aOrigin.X(); + aSize.AdjustWidth( -(aOrigin.X()) ); tools::Rectangle aRect( aPos, aSize ); EditText( pItem->GetText(), aRect, rSelection ); } @@ -2679,7 +2679,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render rRenderContext.SetClipRegion(vcl::Region(pImpl->GetClipRegionRect())); Point aEntryPos(rRenderContext.GetMapMode().GetOrigin()); - aEntryPos.X() *= -1; // conversion document coordinates + aEntryPos.setX( aEntryPos.X() * -1 ); // conversion document coordinates long nMaxRight = nWidth + aEntryPos.X() - 1; Color aBackupTextColor(rRenderContext.GetTextColor()); @@ -2734,8 +2734,8 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render else nX = nTabPos + pTab->CalcOffset(aSize.Width(), nNextTabPos - nTabPos); - aEntryPos.X() = nX; - aEntryPos.Y() = nLine; + aEntryPos.setX( nX ); + aEntryPos.setY( nLine ); // set background pattern/color @@ -2788,7 +2788,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render if (!(nTreeFlags & SvTreeFlags::USESEL)) { // only draw the area that is used by the item - aRectSize.Width() = aSize.Width(); + aRectSize.setWidth( aSize.Width() ); aRect.SetPos(aEntryPos); aRect.SetSize(aRectSize); } @@ -2796,24 +2796,24 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render { // draw from the current to the next tab if (nCurTab != 0) - aRect.Left() = nTabPos; + aRect.SetLeft( nTabPos ); else // if we're in the 0th tab, always draw from column 0 -- // else we get problems with centered tabs - aRect.Left() = 0; - aRect.Top() = nLine; - aRect.Bottom() = nLine + nTempEntryHeight - 1; + aRect.SetLeft( 0 ); + aRect.SetTop( nLine ); + aRect.SetBottom( nLine + nTempEntryHeight - 1 ); if (pNextTab) { long nRight; nRight = GetTabPos(&rEntry, pNextTab) - 1; if (nRight > nMaxRight) nRight = nMaxRight; - aRect.Right() = nRight; + aRect.SetRight( nRight ); } else { - aRect.Right() = nMaxRight; + aRect.SetRight( nMaxRight ); } } // A custom selection that starts at a tab position > 0, do not fill @@ -2832,7 +2832,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render } // draw item // center vertically - aEntryPos.Y() += (nTempEntryHeight - aSize.Height()) / 2; + aEntryPos.AdjustY((nTempEntryHeight - aSize.Height()) / 2 ); pViewDataEntry->SetPaintRectangle(aRect); pItem->Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, rEntry); @@ -2842,7 +2842,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render // not at the right edge of the window! aRect.Right() < nMaxRight) { - aRect.Left() = aRect.Right() - SV_TAB_BORDER; + aRect.SetLeft( aRect.Right() - SV_TAB_BORDER ); rRenderContext.DrawRect(aRect); } @@ -2887,7 +2887,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render return; Point aPos(GetTabPos(&rEntry, pFirstDynamicTab), nLine); - aPos.X() += pImpl->nNodeBmpTabDistance; + aPos.AdjustX(pImpl->nNodeBmpTabDistance ); const Image* pImg = nullptr; @@ -2906,7 +2906,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render pImg = &pImpl->GetCollapsedNodeBmp( ); } } - aPos.Y() += (nTempEntryHeight - pImg->GetSizePixel().Height()) / 2; + aPos.AdjustY((nTempEntryHeight - pImg->GetSizePixel().Height()) / 2 ); DrawImageFlags nStyle = DrawImageFlags::NONE; if (!IsEnabled()) @@ -2958,8 +2958,8 @@ tools::Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLin Size aSize; tools::Rectangle aRect; - aRect.Top() = nLine; - aSize.Height() = GetEntryHeight(); + aRect.SetTop( nLine ); + aSize.setHeight( GetEntryHeight() ); long nRealWidth = pImpl->GetOutputSize().Width(); nRealWidth -= GetMapMode().GetOrigin().X(); @@ -2988,18 +2988,18 @@ tools::Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLin if( pTab && nCurTab < pEntry->ItemCount() ) { SvLBoxItem& rItem = pEntry->GetItem( nCurTab ); - aSize.Width() = rItem.GetSize( this, pEntry ).Width(); + aSize.setWidth( rItem.GetSize( this, pEntry ).Width() ); if( !aSize.Width() ) - aSize.Width() = 15; + aSize.setWidth( 15 ); long nX = nTabPos; //GetTabPos( pEntry, pTab ); // alignment nX += pTab->CalcOffset( aSize.Width(), nNextTabPos - nTabPos ); - aRect.Left() = nX; + aRect.SetLeft( nX ); // make sure that first and last letter aren't cut off slightly aRect.SetSize( aSize ); if( aRect.Left() > 0 ) - aRect.Left()--; - aRect.Right()++; + aRect.AdjustLeft( -1 ); + aRect.AdjustRight( 1 ); } } else @@ -3015,34 +3015,34 @@ tools::Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLin if( nLastTab < aTabs.size() ) // is there another one? pLastTab = aTabs[ nLastTab ]; - aSize.Width() = pLastTab ? pLastTab->GetPos() : 0x0fffffff; + aSize.setWidth( pLastTab ? pLastTab->GetPos() : 0x0fffffff ); nFocusWidth = static_cast<short>(aSize.Width()); if( pTab ) nFocusWidth = nFocusWidth - static_cast<short>(nTabPos); //pTab->GetPos(); } else { - aSize.Width() = nFocusWidth; + aSize.setWidth( nFocusWidth ); if( pTab ) { if( nCurTab ) - aSize.Width() += nTabPos; + aSize.AdjustWidth(nTabPos ); else - aSize.Width() += pTab->GetPos(); // Tab0 always from the leftmost position + aSize.AdjustWidth(pTab->GetPos() ); // Tab0 always from the leftmost position } } // if selection starts with 0th tab, draw from column 0 on if( nCurTab != 0 ) { - aRect.Left() = nTabPos; - aSize.Width() -= nTabPos; + aRect.SetLeft( nTabPos ); + aSize.AdjustWidth( -nTabPos ); } aRect.SetSize( aSize ); } // adjust right edge because of clipping if( aRect.Right() >= nRealWidth ) { - aRect.Right() = nRealWidth-1; + aRect.SetRight( nRealWidth-1 ); nFocusWidth = static_cast<short>(aRect.GetWidth()); } return aRect; @@ -3152,15 +3152,15 @@ Size SvTreeListBox::GetOptimalSize() const std::vector<long> aWidths; Size aRet(0, getPreferredDimensions(aWidths)); for (long aWidth : aWidths) - aRet.Width() += aWidth; + aRet.AdjustWidth(aWidth ); if (GetStyle() & WB_BORDER) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - aRet.Width() += rStyleSettings.GetBorderSize() * 2; - aRet.Height() += rStyleSettings.GetBorderSize() * 2; + aRet.AdjustWidth(rStyleSettings.GetBorderSize() * 2 ); + aRet.AdjustHeight(rStyleSettings.GetBorderSize() * 2 ); } long nMinWidth = nMinWidthInChars * approximate_char_width(); - aRet.Width() = std::max(aRet.Width(), nMinWidth); + aRet.setWidth( std::max(aRet.Width(), nMinWidth) ); return aRet; } diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index 962e35ade5c1..efd07162ce05 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -252,14 +252,14 @@ void Calendar::ImplFormat() // calculate spinfields long nSpinSize = nTextHeight+TITLE_BORDERY-SPIN_OFFY; - maPrevRect.Left() = SPIN_OFFX; - maPrevRect.Top() = SPIN_OFFY; - maPrevRect.Right() = maPrevRect.Left()+nSpinSize; - maPrevRect.Bottom() = maPrevRect.Top()+nSpinSize; - maNextRect.Left() = aOutSize.Width()-SPIN_OFFX-nSpinSize-1; - maNextRect.Top() = SPIN_OFFY; - maNextRect.Right() = maNextRect.Left()+nSpinSize; - maNextRect.Bottom() = maNextRect.Top()+nSpinSize; + maPrevRect.SetLeft( SPIN_OFFX ); + maPrevRect.SetTop( SPIN_OFFY ); + maPrevRect.SetRight( maPrevRect.Left()+nSpinSize ); + maPrevRect.SetBottom( maPrevRect.Top()+nSpinSize ); + maNextRect.SetLeft( aOutSize.Width()-SPIN_OFFX-nSpinSize-1 ); + maNextRect.SetTop( SPIN_OFFY ); + maNextRect.SetRight( maNextRect.Left()+nSpinSize ); + maNextRect.SetBottom( maNextRect.Top()+nSpinSize ); // Calculate DayOfWeekText (gets displayed in a narrow font) maDayOfWeekText.clear(); @@ -498,8 +498,8 @@ void ImplDrawSpinArrow(vcl::RenderContext& rRenderContext, const tools::Rectangl Size(1, 1)); if (!bPrev) { - aRect.Left() += nLines; - aRect.Right() += nLines; + aRect.AdjustLeft(nLines ); + aRect.AdjustRight(nLines ); } rRenderContext.DrawRect(aRect); @@ -507,16 +507,16 @@ void ImplDrawSpinArrow(vcl::RenderContext& rRenderContext, const tools::Rectangl { if (bPrev) { - aRect.Left()++; - aRect.Right()++; + aRect.AdjustLeft( 1 ); + aRect.AdjustRight( 1 ); } else { - aRect.Left()--; - aRect.Right()--; + aRect.AdjustLeft( -1 ); + aRect.AdjustRight( -1 ); } - aRect.Top()--; - aRect.Bottom()++; + aRect.AdjustTop( -1 ); + aRect.AdjustBottom( 1 ); rRenderContext.DrawRect(aRect); } } @@ -528,16 +528,16 @@ void Calendar::ImplDrawSpin(vcl::RenderContext& rRenderContext ) rRenderContext.SetLineColor(); rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor()); tools::Rectangle aOutRect = maPrevRect; - aOutRect.Left() += 3; - aOutRect.Top() += 3; - aOutRect.Right() -= 3; - aOutRect.Bottom() -= 3; + aOutRect.AdjustLeft(3 ); + aOutRect.AdjustTop(3 ); + aOutRect.AdjustRight( -3 ); + aOutRect.AdjustBottom( -3 ); ImplDrawSpinArrow(rRenderContext, aOutRect, true); aOutRect = maNextRect; - aOutRect.Left() += 3; - aOutRect.Top() += 3; - aOutRect.Right() -= 3; - aOutRect.Bottom() -= 3; + aOutRect.AdjustLeft(3 ); + aOutRect.AdjustTop(3 ); + aOutRect.AdjustRight( -3 ); + aOutRect.AdjustBottom( -3 ); ImplDrawSpinArrow(rRenderContext, aOutRect, false); } @@ -677,12 +677,12 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) Point aSepPos2(0, aTitleRect.Bottom() - TITLE_BORDERY); for (j = 0; j < mnMonthPerLine-1; j++) { - aSepPos1.X() += mnMonthWidth-1; - aSepPos2.X() = aSepPos1.X(); + aSepPos1.AdjustX(mnMonthWidth-1 ); + aSepPos2.setX( aSepPos1.X() ); rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); rRenderContext.DrawLine(aSepPos1, aSepPos2); - aSepPos1.X()++; - aSepPos2.X() = aSepPos1.X(); + aSepPos1.AdjustX( 1 ); + aSepPos2.setX( aSepPos1.X() ); rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); rRenderContext.DrawLine(aSepPos1, aSepPos2); } @@ -901,8 +901,8 @@ void Calendar::ImplUpdate( bool bCalcNew ) void Calendar::ImplInvertDropPos() { tools::Rectangle aRect = GetDateRect( maDropDate );//this is one Pixel to width and one to height - aRect.Bottom() = aRect.Top()+mnDayHeight-1; - aRect.Right() = aRect.Left()+mnDayWidth-1; + aRect.SetBottom( aRect.Top()+mnDayHeight-1 ); + aRect.SetRight( aRect.Left()+mnDayWidth-1 ); Invert( aRect ); } @@ -1227,11 +1227,11 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt ) { tools::Rectangle aDateRect = GetDateRect( aDate ); Point aPt = OutputToScreenPixel( aDateRect.TopLeft() ); - aDateRect.Left() = aPt.X(); - aDateRect.Top() = aPt.Y(); + aDateRect.SetLeft( aPt.X() ); + aDateRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aDateRect.BottomRight() ); - aDateRect.Right() = aPt.X(); - aDateRect.Bottom() = aPt.Y(); + aDateRect.SetRight( aPt.X() ); + aDateRect.SetBottom( aPt.Y() ); if ( rHEvt.GetMode() & HelpEventMode::QUICK ) { @@ -1469,8 +1469,8 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const aRect = GetDateRect( aDate ); nDaysOff = aDate-rDate; nX = nDaysOff*mnDayWidth; - aRect.Left() -= nX; - aRect.Right() -= nX; + aRect.AdjustLeft( -nX ); + aRect.AdjustRight( -nX ); return aRect; } else @@ -1488,15 +1488,15 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const { if ( aLastDate == rDate ) { - aRect.Left() += nDayIndex*mnDayWidth; - aRect.Right() = aRect.Left()+mnDayWidth; + aRect.AdjustLeft(nDayIndex*mnDayWidth ); + aRect.SetRight( aRect.Left()+mnDayWidth ); return aRect; } if ( nDayIndex == 6 ) { nDayIndex = 0; - aRect.Top() += mnDayHeight; - aRect.Bottom() += mnDayHeight; + aRect.AdjustTop(mnDayHeight ); + aRect.AdjustBottom(mnDayHeight ); } else nDayIndex++; @@ -1525,10 +1525,10 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const { if ( nDay == rDate.GetDay() ) { - aRect.Left() = nDayX + (nDayIndex*mnDayWidth); - aRect.Top() = nDayY; - aRect.Right() = aRect.Left()+mnDayWidth; - aRect.Bottom() = aRect.Top()+mnDayHeight; + aRect.SetLeft( nDayX + (nDayIndex*mnDayWidth) ); + aRect.SetTop( nDayY ); + aRect.SetRight( aRect.Left()+mnDayWidth ); + aRect.SetBottom( aRect.Top()+mnDayHeight ); break; } if ( nDayIndex == 6 ) @@ -1584,13 +1584,13 @@ Size Calendar::CalcWindowSizePixel() const long n99TextWidth = GetTextWidth( a99Text ); long nTextHeight = GetTextHeight(); - aSize.Width() += ((n99TextWidth+DAY_OFFX)*7); - aSize.Width() += MONTH_BORDERX*2; + aSize.AdjustWidth((n99TextWidth+DAY_OFFX)*7); + aSize.AdjustWidth(MONTH_BORDERX*2 ); - aSize.Height() = nTextHeight + TITLE_OFFY + (TITLE_BORDERY*2); - aSize.Height() += nTextHeight + WEEKDAY_OFFY; - aSize.Height() += ((nTextHeight+DAY_OFFY)*6); - aSize.Height() += MONTH_OFFY; + aSize.setHeight( nTextHeight + TITLE_OFFY + (TITLE_BORDERY*2) ); + aSize.AdjustHeight(nTextHeight + WEEKDAY_OFFY ); + aSize.AdjustHeight((nTextHeight+DAY_OFFY)*6); + aSize.AdjustHeight(MONTH_OFFY ); return aSize; } @@ -1658,10 +1658,10 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( bool bEnable ) OUString aTodayText(SvtResId(STR_SVT_CALENDAR_TODAY)); mpTodayBtn->SetText( aTodayText ); Size aSize; - aSize.Width() = mpTodayBtn->GetCtrlTextWidth( mpTodayBtn->GetText() ); - aSize.Height() = mpTodayBtn->GetTextHeight(); - aSize.Width() += CALFIELD_EXTRA_BUTTON_WIDTH; - aSize.Height() += CALFIELD_EXTRA_BUTTON_HEIGHT; + aSize.setWidth( mpTodayBtn->GetCtrlTextWidth( mpTodayBtn->GetText() ) ); + aSize.setHeight( mpTodayBtn->GetTextHeight() ); + aSize.AdjustWidth(CALFIELD_EXTRA_BUTTON_WIDTH ); + aSize.AdjustHeight(CALFIELD_EXTRA_BUTTON_HEIGHT ); mpTodayBtn->SetSizePixel( aSize ); mpTodayBtn->Show(); } @@ -1684,10 +1684,10 @@ PushButton* ImplCFieldFloatWin::EnableNoneBtn( bool bEnable ) OUString aNoneText(SvtResId(STR_SVT_CALENDAR_NONE)); mpNoneBtn->SetText( aNoneText ); Size aSize; - aSize.Width() = mpNoneBtn->GetCtrlTextWidth( mpNoneBtn->GetText() ); - aSize.Height() = mpNoneBtn->GetTextHeight(); - aSize.Width() += CALFIELD_EXTRA_BUTTON_WIDTH; - aSize.Height() += CALFIELD_EXTRA_BUTTON_HEIGHT; + aSize.setWidth( mpNoneBtn->GetCtrlTextWidth( mpNoneBtn->GetText() ) ); + aSize.setHeight( mpNoneBtn->GetTextHeight() ); + aSize.AdjustWidth(CALFIELD_EXTRA_BUTTON_WIDTH ); + aSize.AdjustHeight(CALFIELD_EXTRA_BUTTON_HEIGHT ); mpNoneBtn->SetSizePixel( aSize ); mpNoneBtn->Show(); } @@ -1710,13 +1710,13 @@ void ImplCFieldFloatWin::ArrangeButtons() Size aTodayBtnSize = mpTodayBtn->GetSizePixel(); Size aNoneBtnSize = mpNoneBtn->GetSizePixel(); if ( aTodayBtnSize.Width() < aNoneBtnSize.Width() ) - aTodayBtnSize.Width() = aNoneBtnSize.Width(); + aTodayBtnSize.setWidth( aNoneBtnSize.Width() ); else - aNoneBtnSize.Width() = aTodayBtnSize.Width(); + aNoneBtnSize.setWidth( aTodayBtnSize.Width() ); if ( aTodayBtnSize.Height() < aNoneBtnSize.Height() ) - aTodayBtnSize.Height() = aNoneBtnSize.Height(); + aTodayBtnSize.setHeight( aNoneBtnSize.Height() ); else - aNoneBtnSize.Height() = aTodayBtnSize.Height(); + aNoneBtnSize.setHeight( aTodayBtnSize.Height() ); nBtnWidth = aTodayBtnSize.Width() + aNoneBtnSize.Width() + CALFIELD_SEP_X; nBtnHeight = aTodayBtnSize.Height(); @@ -1751,7 +1751,7 @@ void ImplCFieldFloatWin::ArrangeButtons() long nLineWidth = aOutSize.Width()-(CALFIELD_BORDERLINE_X*2); mpFixedLine->setPosSizePixel( (aOutSize.Width()-nLineWidth)/2, aOutSize.Height()+((CALFIELD_BORDER_YTOP-2)/2), nLineWidth, 2 ); - aOutSize.Height() += nBtnHeight + (CALFIELD_BORDER_Y*2) + CALFIELD_BORDER_YTOP; + aOutSize.AdjustHeight(nBtnHeight + (CALFIELD_BORDER_Y*2) + CALFIELD_BORDER_YTOP ); SetOutputSizePixel( aOutSize ); } else @@ -1867,7 +1867,7 @@ bool CalendarField::ShowDropDown( bool bShow ) pCalendar->SetCurDate( aDate ); Point aPos( GetParent()->OutputToScreenPixel( GetPosPixel() ) ); tools::Rectangle aRect( aPos, GetSizePixel() ); - aRect.Bottom() -= 1; + aRect.AdjustBottom( -1 ); mpCalendar->SetOutputSizePixel( mpCalendar->CalcWindowSizePixel() ); mpFloatWin->SetOutputSizePixel( mpCalendar->GetSizePixel() ); mpFloatWin->SetCalendar( mpCalendar ); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 2cceca8fd9a5..29665a781a25 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -415,10 +415,10 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance, //line within that long nMinWidth = GetTextWidth("----------"); Size aSize = CalcSubEditSize(); - aSize.Width() = std::max(nMinWidth, aSize.Width()); - aSize.Width() -= aTxtSize.Width(); - aSize.Width() -= 6; - aSize.Height() = aTxtSize.Height(); + aSize.setWidth( std::max(nMinWidth, aSize.Width()) ); + aSize.AdjustWidth( -(aTxtSize.Width()) ); + aSize.AdjustWidth( -6 ); + aSize.setHeight( aTxtSize.Height() ); // SourceUnit to Twips if ( eSourceUnit == FUNIT_POINT ) @@ -445,7 +445,7 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance, } long nVirHeight = n1+nDist+n2; if ( nVirHeight > aSize.Height() ) - aSize.Height() = nVirHeight; + aSize.setHeight( nVirHeight ); // negative width should not be drawn if ( aSize.Width() <= 0 ) return; @@ -478,8 +478,8 @@ LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) : aColor( COL_BLACK ), maPaintCol( COL_BLACK ) { - aTxtSize.Width() = GetTextWidth( " " ); - aTxtSize.Height() = GetTextHeight(); + aTxtSize.setWidth( GetTextWidth( " " ) ); + aTxtSize.setHeight( GetTextHeight() ); eSourceUnit = FUNIT_POINT; aVirDev->SetLineColor(); @@ -820,8 +820,8 @@ void FontNameBox::ImplCalcUserItemSize() if ( mbWYSIWYG && mpFontList ) { aUserItemSz = Size(MAXPREVIEWWIDTH, GetTextHeight() ); - aUserItemSz.Height() *= 16; - aUserItemSz.Height() /= 10; + aUserItemSz.setHeight( aUserItemSz.Height() * 16 ); + aUserItemSz.setHeight( aUserItemSz.Height() / 10 ); } SetUserItemSize( aUserItemSz ); } @@ -845,7 +845,7 @@ namespace break; } - aSize.Height() -= EXTRAFONTSIZE; + aSize.AdjustHeight( -(EXTRAFONTSIZE) ); rFont.SetFontSize(aSize); rDevice.SetFont(rFont); } @@ -873,7 +873,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) Color aTextColor = pRenderContext->GetTextColor(); vcl::Font aOldFont(pRenderContext->GetFont()); Size aSize( aOldFont.GetFontSize() ); - aSize.Height() += EXTRAFONTSIZE; + aSize.AdjustHeight(EXTRAFONTSIZE ); vcl::Font aFont( rFontMetric ); aFont.SetFontSize( aSize ); pRenderContext->SetFont(aFont); diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index db32b5009191..d2777c670e7e 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -144,10 +144,10 @@ long HeaderBar::ImplGetItemPos( sal_uInt16 nPos ) const tools::Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const { tools::Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 ); - aRect.Right() = aRect.Left() + mvItemList[ nPos ]->mnSize - 1; + aRect.SetRight( aRect.Left() + mvItemList[ nPos ]->mnSize - 1 ); // check for overflow on various systems if ( aRect.Right() > 16000 ) - aRect.Right() = 16000; + aRect.SetRight( 16000 ); return aRect; } @@ -221,13 +221,13 @@ void HeaderBar::ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) if ( nEndPos > nStartPos ) { - aStartPos.X() += 3; - aEndPos.X() = aRect2.Right()-6; + aStartPos.AdjustX(3 ); + aEndPos.setX( aRect2.Right()-6 ); } else { - aStartPos.X() -= 3; - aEndPos.X() = aRect2.Left()+6; + aStartPos.AdjustX( -3 ); + aEndPos.setX( aRect2.Left()+6 ); } SetRasterOp( RasterOp::Invert ); @@ -299,8 +299,8 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos else { // do not draw border - aRect.Top() += mnBorderOff1; - aRect.Bottom() -= mnBorderOff2; + aRect.AdjustTop(mnBorderOff1 ); + aRect.AdjustBottom( -(mnBorderOff2) ); // delete background if ( !pRect ) @@ -344,7 +344,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos Size aImageSize = pItem->maImage.GetSizePixel(); Size aTxtSize(rRenderContext.GetTextWidth(pItem->maOutText), 0); if (!pItem->maOutText.isEmpty()) - aTxtSize.Height() = rRenderContext.GetTextHeight(); + aTxtSize.setHeight( rRenderContext.GetTextHeight() ); long nArrowWidth = 0; if (nBits & (HeaderBarItemBits::UPARROW | HeaderBarItemBits::DOWNARROW)) nArrowWidth = HEAD_ARROWSIZE2 + HEADERBAR_ARROWOFF; @@ -355,8 +355,8 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos nTestHeight += aTxtSize.Height(); if ((aImageSize.Width() > aRect.GetWidth()) || (nTestHeight > aRect.GetHeight())) { - aImageSize.Width() = 0; - aImageSize.Height() = 0; + aImageSize.setWidth( 0 ); + aImageSize.setHeight( 0 ); } // cut text to correct length @@ -605,14 +605,14 @@ void HeaderBar::ImplUpdate(sal_uInt16 nPos, bool bEnd) aRect = ImplGetItemRect(nPos); else { - aRect.Bottom() = mnDY - 1; + aRect.SetBottom( mnDY - 1 ); if (nItemCount) - aRect.Left() = ImplGetItemRect(nItemCount - 1).Right(); + aRect.SetLeft( ImplGetItemRect(nItemCount - 1).Right() ); } if (bEnd) - aRect.Right() = mnDX - 1; - aRect.Top() += mnBorderOff1; - aRect.Bottom() -= mnBorderOff2; + aRect.SetRight( mnDX - 1 ); + aRect.AdjustTop(mnBorderOff1 ); + aRect.AdjustBottom( -(mnBorderOff2) ); Invalidate(aRect); } @@ -952,11 +952,11 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, size_t nItemCount = mvItemList.size(); for ( size_t i = 0; i < nItemCount; i++ ) { - aItemRect.Left() = aRect.Left()+ImplGetItemPos( i ); - aItemRect.Right() = aItemRect.Left() + mvItemList[ i ]->mnSize - 1; + aItemRect.SetLeft( aRect.Left()+ImplGetItemPos( i ) ); + aItemRect.SetRight( aItemRect.Left() + mvItemList[ i ]->mnSize - 1 ); // check for overflow on some systems if ( aItemRect.Right() > 16000 ) - aItemRect.Right() = 16000; + aItemRect.SetRight( 16000 ); vcl::Region aRegion( aRect ); pDev->SetClipRegion( aRegion ); ImplDrawItem(*pDev, i, false, aItemRect, &aRect ); @@ -995,11 +995,11 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) { tools::Rectangle aItemRect = GetItemRect( nItemId ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); OUString aStr = GetHelpText( nItemId ); if ( aStr.isEmpty() || !(rHEvt.GetMode() & HelpEventMode::BALLOON) ) @@ -1316,18 +1316,18 @@ Size HeaderBar::CalcWindowSizePixel() const nMaxImageSize = nImageHeight; // add width - aSize.Width() += pItem->mnSize; + aSize.AdjustWidth(pItem->mnSize ); } if ( nMaxImageSize > aSize.Height() ) - aSize.Height() = nMaxImageSize; + aSize.setHeight( nMaxImageSize ); // add border if ( mbButtonStyle ) - aSize.Height() += 4; + aSize.AdjustHeight(4 ); else - aSize.Height() += 2; - aSize.Height() += mnBorderOff1+mnBorderOff2; + aSize.AdjustHeight(2 ); + aSize.AdjustHeight(mnBorderOff1+mnBorderOff2 ); return aSize; } diff --git a/svtools/source/control/hyperlabel.cxx b/svtools/source/control/hyperlabel.cxx index 036088385102..2cebdc20d27a 100644 --- a/svtools/source/control/hyperlabel.cxx +++ b/svtools/source/control/hyperlabel.cxx @@ -59,8 +59,8 @@ namespace svt m_pImpl->m_aMinSize = FixedText::CalcMinimumSize( nMaxWidth ); // the MinimumSize is used to size the FocusRectangle // and for the MouseMove method - m_pImpl->m_aMinSize.Height() += 2; - m_pImpl->m_aMinSize.Width() += 1; + m_pImpl->m_aMinSize.AdjustHeight(2 ); + m_pImpl->m_aMinSize.AdjustWidth(1 ); return m_pImpl->m_aMinSize; } diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx index dfcf27a44294..bf1840702f3a 100644 --- a/svtools/source/control/roadmap.cxx +++ b/svtools/source/control/roadmap.cxx @@ -187,8 +187,8 @@ public: void RoadmapImpl::initItemSize() { Size aLabelSize( m_rAntiImpl.GetOutputSizePixel() ); - aLabelSize.Height() = m_rAntiImpl.LogicToPixel(Size(0, LABELBASEMAPHEIGHT), MapMode(MapUnit::MapAppFont)).Height(); - aLabelSize.Width() -= m_rAntiImpl.LogicToPixel(Size(2 * ROADMAP_INDENT_X, 0), MapMode(MapUnit::MapAppFont)).Width(); + aLabelSize.setHeight( m_rAntiImpl.LogicToPixel(Size(0, LABELBASEMAPHEIGHT), MapMode(MapUnit::MapAppFont)).Height() ); + aLabelSize.AdjustWidth( -(m_rAntiImpl.LogicToPixel(Size(2 * ROADMAP_INDENT_X, 0), MapMode(MapUnit::MapAppFont)).Width()) ); m_aItemSizePixel = aLabelSize; } @@ -737,8 +737,8 @@ void RoadmapItem::SetPosition(RoadmapItem const * _pOldItem) Size aOldSize = _pOldItem->mpDescription->GetSizePixel(); aIDPos = _pOldItem->mpID->GetPosPixel(); - aIDPos.Y() += aOldSize.Height(); - aIDPos.Y() += mpID->GetParent()->LogicToPixel( Size( 0, ROADMAP_ITEM_DISTANCE_Y ) ).Height(); + aIDPos.AdjustY(aOldSize.Height() ); + aIDPos.AdjustY(mpID->GetParent()->LogicToPixel( Size( 0, ROADMAP_ITEM_DISTANCE_Y ) ).Height() ); } mpID->SetPosPixel( aIDPos ); diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 2c1aa5be85ff..9e4a87d60f8f 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -206,9 +206,9 @@ void Ruler::ImplInit( WinBits nWinBits ) Size aDefSize; if ( nWinBits & WB_HORZ ) - aDefSize.Height() = nDefHeight; + aDefSize.setHeight( nDefHeight ); else - aDefSize.Width() = nDefHeight; + aDefSize.setWidth( nDefHeight ); SetOutputSizePixel( aDefSize ); SetType(WindowType::RULER); } @@ -340,9 +340,9 @@ void Ruler::ImplInvertLines(vcl::RenderContext& rRenderContext) // Calculate rectangle tools::Rectangle aRect; if (mnWinStyle & WB_HORZ) - aRect.Bottom() = nY; + aRect.SetBottom( nY ); else - aRect.Right() = nY; + aRect.SetRight( nY ); // Draw lines for (RulerLine & rLine : mpData->pLines) @@ -352,32 +352,32 @@ void Ruler::ImplInvertLines(vcl::RenderContext& rRenderContext) { if (mnWinStyle & WB_HORZ ) { - aRect.Left() = n; - aRect.Right() = n; + aRect.SetLeft( n ); + aRect.SetRight( n ); } else { - aRect.Top() = n; - aRect.Bottom() = n; + aRect.SetTop( n ); + aRect.SetBottom( n ); } tools::Rectangle aTempRect = aRect; if (mnWinStyle & WB_HORZ) - aTempRect.Bottom() = RULER_OFF - 1; + aTempRect.SetBottom( RULER_OFF - 1 ); else - aTempRect.Right() = RULER_OFF - 1; + aTempRect.SetRight( RULER_OFF - 1 ); rRenderContext.Erase(aTempRect); if (mnWinStyle & WB_HORZ) { - aTempRect.Bottom() = aRect.Bottom(); - aTempRect.Top() = aTempRect.Bottom() - RULER_OFF + 1; + aTempRect.SetBottom( aRect.Bottom() ); + aTempRect.SetTop( aTempRect.Bottom() - RULER_OFF + 1 ); } else { - aTempRect.Right() = aRect.Right(); - aTempRect.Left() = aTempRect.Right() - RULER_OFF + 1; + aTempRect.SetRight( aRect.Right() ); + aTempRect.SetLeft( aTempRect.Right() - RULER_OFF + 1 ); } rRenderContext.Erase(aTempRect); Invert(aRect); @@ -786,17 +786,17 @@ static void ImplCenterTabPos(Point& rPos, sal_uInt16 nTabStyle) { bool bRTL = 0 != (nTabStyle & RULER_TAB_RTL); nTabStyle &= RULER_TAB_STYLE; - rPos.Y() += ruler_tab.height/2; + rPos.AdjustY(ruler_tab.height/2 ); if ( (!bRTL && nTabStyle == RULER_TAB_LEFT) || ( bRTL && nTabStyle == RULER_TAB_RIGHT) ) { - rPos.X() -= ruler_tab.width / 2; + rPos.AdjustX( -(ruler_tab.width / 2) ); } else if ( (!bRTL && nTabStyle == RULER_TAB_RIGHT) || ( bRTL && nTabStyle == RULER_TAB_LEFT) ) { - rPos.X() += ruler_tab.width / 2; + rPos.AdjustX(ruler_tab.width / 2 ); } } @@ -806,16 +806,16 @@ static void lcl_RotateRect_Impl(tools::Rectangle& rRect, const long nReference, return; tools::Rectangle aTmp(rRect); - rRect.Top() = aTmp.Left(); - rRect.Bottom() = aTmp.Right(); - rRect.Left() = aTmp.Top(); - rRect.Right() = aTmp.Bottom(); + rRect.SetTop( aTmp.Left() ); + rRect.SetBottom( aTmp.Right() ); + rRect.SetLeft( aTmp.Top() ); + rRect.SetRight( aTmp.Bottom() ); if (bRightAligned) { long nRef = 2 * nReference; - rRect.Left() = nRef - rRect.Left(); - rRect.Right() = nRef - rRect.Right(); + rRect.SetLeft( nRef - rRect.Left() ); + rRect.SetRight( nRef - rRect.Right() ); } } @@ -841,59 +841,59 @@ static void ImplDrawRulerTab(vcl::RenderContext& rRenderContext, const Point& rP if (nTabStyle == RULER_TAB_DEFAULT) { - aRect1.Left() = rPos.X() - ruler_tab.dwidth2 + 1; - aRect1.Top() = rPos.Y() - ruler_tab.dheight2 + 1; - aRect1.Right() = rPos.X() - ruler_tab.dwidth2 + ruler_tab.dwidth + DPIOffset; - aRect1.Bottom() = rPos.Y(); + aRect1.SetLeft( rPos.X() - ruler_tab.dwidth2 + 1 ); + aRect1.SetTop( rPos.Y() - ruler_tab.dheight2 + 1 ); + aRect1.SetRight( rPos.X() - ruler_tab.dwidth2 + ruler_tab.dwidth + DPIOffset ); + aRect1.SetBottom( rPos.Y() ); - aRect2.Left() = rPos.X() - ruler_tab.dwidth2 + ruler_tab.dwidth3; - aRect2.Top() = rPos.Y() - ruler_tab.dheight + 1; - aRect2.Right() = rPos.X() - ruler_tab.dwidth2 + ruler_tab.dwidth3 + ruler_tab.dwidth4 - 1; - aRect2.Bottom() = rPos.Y(); + aRect2.SetLeft( rPos.X() - ruler_tab.dwidth2 + ruler_tab.dwidth3 ); + aRect2.SetTop( rPos.Y() - ruler_tab.dheight + 1 ); + aRect2.SetRight( rPos.X() - ruler_tab.dwidth2 + ruler_tab.dwidth3 + ruler_tab.dwidth4 - 1 ); + aRect2.SetBottom( rPos.Y() ); } else if ((!bRTL && nTabStyle == RULER_TAB_LEFT) || (bRTL && nTabStyle == RULER_TAB_RIGHT)) { - aRect1.Left() = rPos.X(); - aRect1.Top() = rPos.Y() - ruler_tab.height2 + 1; - aRect1.Right() = rPos.X() + ruler_tab.width - 1; - aRect1.Bottom() = rPos.Y(); + aRect1.SetLeft( rPos.X() ); + aRect1.SetTop( rPos.Y() - ruler_tab.height2 + 1 ); + aRect1.SetRight( rPos.X() + ruler_tab.width - 1 ); + aRect1.SetBottom( rPos.Y() ); - aRect2.Left() = rPos.X(); - aRect2.Top() = rPos.Y() - ruler_tab.height + 1; - aRect2.Right() = rPos.X() + ruler_tab.width2 - 1; - aRect2.Bottom() = rPos.Y(); + aRect2.SetLeft( rPos.X() ); + aRect2.SetTop( rPos.Y() - ruler_tab.height + 1 ); + aRect2.SetRight( rPos.X() + ruler_tab.width2 - 1 ); + aRect2.SetBottom( rPos.Y() ); } else if ((!bRTL && nTabStyle == RULER_TAB_RIGHT) || (bRTL && nTabStyle == RULER_TAB_LEFT)) { - aRect1.Left() = rPos.X() - ruler_tab.width + 1; - aRect1.Top() = rPos.Y() - ruler_tab.height2 + 1; - aRect1.Right() = rPos.X(); - aRect1.Bottom() = rPos.Y(); + aRect1.SetLeft( rPos.X() - ruler_tab.width + 1 ); + aRect1.SetTop( rPos.Y() - ruler_tab.height2 + 1 ); + aRect1.SetRight( rPos.X() ); + aRect1.SetBottom( rPos.Y() ); - aRect2.Left() = rPos.X() - ruler_tab.width2 + 1; - aRect2.Top() = rPos.Y() - ruler_tab.height + 1; - aRect2.Right() = rPos.X(); - aRect2.Bottom() = rPos.Y(); + aRect2.SetLeft( rPos.X() - ruler_tab.width2 + 1 ); + aRect2.SetTop( rPos.Y() - ruler_tab.height + 1 ); + aRect2.SetRight( rPos.X() ); + aRect2.SetBottom( rPos.Y() ); } else { - aRect1.Left() = rPos.X() - ruler_tab.cwidth2 + 1; - aRect1.Top() = rPos.Y() - ruler_tab.height2 + 1; - aRect1.Right() = rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth + DPIOffset; - aRect1.Bottom() = rPos.Y(); + aRect1.SetLeft( rPos.X() - ruler_tab.cwidth2 + 1 ); + aRect1.SetTop( rPos.Y() - ruler_tab.height2 + 1 ); + aRect1.SetRight( rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth + DPIOffset ); + aRect1.SetBottom( rPos.Y() ); - aRect2.Left() = rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth3; - aRect2.Top() = rPos.Y() - ruler_tab.height + 1; - aRect2.Right() = rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth3 + ruler_tab.cwidth4 - 1; - aRect2.Bottom() = rPos.Y(); + aRect2.SetLeft( rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth3 ); + aRect2.SetTop( rPos.Y() - ruler_tab.height + 1 ); + aRect2.SetRight( rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth3 + ruler_tab.cwidth4 - 1 ); + aRect2.SetBottom( rPos.Y() ); if (nTabStyle == RULER_TAB_DECIMAL) { - aRect3.Left() = rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth - 1; - aRect3.Top() = rPos.Y() - ruler_tab.height + 1 + 1 - DPIOffset; - aRect3.Right() = rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth + DPIOffset; - aRect3.Bottom() = rPos.Y() - ruler_tab.height + 1 + 2; + aRect3.SetLeft( rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth - 1 ); + aRect3.SetTop( rPos.Y() - ruler_tab.height + 1 + 1 - DPIOffset ); + aRect3.SetRight( rPos.X() - ruler_tab.cwidth2 + ruler_tab.cwidth + DPIOffset ); + aRect3.SetBottom( rPos.Y() - ruler_tab.height + 1 + 2 ); } } if (0 == (nWinBits & WB_HORZ)) @@ -1100,13 +1100,13 @@ void Ruler::ImplFormat(vcl::RenderContext const & rRenderContext) // initialize VirtualDevice if (mnWinStyle & WB_HORZ) { - aVirDevSize.Width() = mnVirWidth; - aVirDevSize.Height() = mnVirHeight; + aVirDevSize.setWidth( mnVirWidth ); + aVirDevSize.setHeight( mnVirHeight ); } else { - aVirDevSize.Height() = mnVirWidth; - aVirDevSize.Width() = mnVirHeight; + aVirDevSize.setHeight( mnVirWidth ); + aVirDevSize.setWidth( mnVirHeight ); } if (aVirDevSize != maVirDev->GetOutputSizePixel()) maVirDev->SetOutputSizePixel(aVirDevSize); @@ -1230,10 +1230,10 @@ void Ruler::ImplInitExtraField( bool bUpdate ) // extra field evaluate if ( mnWinStyle & WB_EXTRAFIELD ) { - maExtraRect.Left() = RULER_OFF; - maExtraRect.Top() = RULER_OFF; - maExtraRect.Right() = RULER_OFF + mnVirHeight - 1; - maExtraRect.Bottom() = RULER_OFF + mnVirHeight - 1; + maExtraRect.SetLeft( RULER_OFF ); + maExtraRect.SetTop( RULER_OFF ); + maExtraRect.SetRight( RULER_OFF + mnVirHeight - 1 ); + maExtraRect.SetBottom( RULER_OFF + mnVirHeight - 1 ); if(mpData->bTextRTL) { if(mnWinStyle & WB_HORZ) @@ -1289,16 +1289,16 @@ void Ruler::ImplDraw(vcl::RenderContext& rRenderContext) if (mnWinStyle & WB_HORZ) { - aOffPos.X() = mnVirOff; + aOffPos.setX( mnVirOff ); if (mpData->bTextRTL) - aVirDevSize.Width() -= maExtraRect.GetWidth(); + aVirDevSize.AdjustWidth( -(maExtraRect.GetWidth()) ); - aOffPos.Y() = RULER_OFF; + aOffPos.setY( RULER_OFF ); } else { - aOffPos.X() = RULER_OFF; - aOffPos.Y() = mnVirOff; + aOffPos.setX( RULER_OFF ); + aOffPos.setY( mnVirOff ); } rRenderContext.DrawOutDev(aOffPos, aVirDevSize, Point(), aVirDevSize, *maVirDev.get()); @@ -1312,10 +1312,10 @@ void Ruler::ImplDrawExtra(vcl::RenderContext& rRenderContext) tools::Rectangle aRect = maExtraRect; bool bEraseRect = false; - aRect.Left() += 2; - aRect.Top() += 2; - aRect.Right() -= 2; - aRect.Bottom() -= 2; + aRect.AdjustLeft(2 ); + aRect.AdjustTop(2 ); + aRect.AdjustRight( -2 ); + aRect.AdjustBottom( -2 ); if (mnExtraStyle & RULER_STYLE_HIGHLIGHT) { @@ -1350,13 +1350,13 @@ void Ruler::ImplDrawExtra(vcl::RenderContext& rRenderContext) if (0 == (nWinBits & WB_HORZ)) { if ((nWinBits & WB_RIGHT_ALIGNED) != 0) - aDraw.Y() = 2 * aCenter.Y() - aDraw.Y(); + aDraw.setY( 2 * aCenter.Y() - aDraw.Y() ); if (mpData->bTextRTL) { long nTemp = aDraw.X(); - aDraw.X() = aDraw.Y(); - aDraw.Y() = nTemp; + aDraw.setX( aDraw.Y() ); + aDraw.setY( nTemp ); } } ImplDrawTab(rRenderContext, aDraw, nTabStyle); @@ -1445,8 +1445,8 @@ bool Ruler::ImplHitTest( const Point& rPos, RulerSelection* pHitTest, tools::Rectangle aRect; if ( !mpData->pTabs.empty() ) { - aRect.Bottom() = nHitBottom; - aRect.Top() = aRect.Bottom() - ruler_tab.height - RULER_OFF; + aRect.SetBottom( nHitBottom ); + aRect.SetTop( aRect.Bottom() - ruler_tab.height - RULER_OFF ); for ( i = mpData->pTabs.size() - 1; i >= 0; i-- ) { @@ -1462,18 +1462,18 @@ bool Ruler::ImplHitTest( const Point& rPos, RulerSelection* pHitTest, if ( nStyle == RULER_TAB_LEFT ) { - aRect.Left() = n1; - aRect.Right() = n1 + ruler_tab.width - 1; + aRect.SetLeft( n1 ); + aRect.SetRight( n1 + ruler_tab.width - 1 ); } else if ( nStyle == RULER_TAB_RIGHT ) { - aRect.Right() = n1; - aRect.Left() = n1 - ruler_tab.width - 1; + aRect.SetRight( n1 ); + aRect.SetLeft( n1 - ruler_tab.width - 1 ); } else { - aRect.Left() = n1 - ruler_tab.cwidth2 + 1; - aRect.Right() = n1 - ruler_tab.cwidth2 + ruler_tab.cwidth; + aRect.SetLeft( n1 - ruler_tab.cwidth2 + 1 ); + aRect.SetRight( n1 - ruler_tab.cwidth2 + ruler_tab.cwidth ); } if ( aRect.IsInside( Point( nX, nY ) ) ) @@ -1503,17 +1503,17 @@ bool Ruler::ImplHitTest( const Point& rPos, RulerSelection* pHitTest, if ( (nIndentStyle == RulerIndentStyle::Bottom) != !bIsHori ) { - aRect.Left() = n1-nIndentWidth2; - aRect.Right() = n1+nIndentWidth2; - aRect.Top() = nHitBottom-nIndentHeight-RULER_OFF+1; - aRect.Bottom() = nHitBottom; + aRect.SetLeft( n1-nIndentWidth2 ); + aRect.SetRight( n1+nIndentWidth2 ); + aRect.SetTop( nHitBottom-nIndentHeight-RULER_OFF+1 ); + aRect.SetBottom( nHitBottom ); } else { - aRect.Left() = n1-nIndentWidth2; - aRect.Right() = n1+nIndentWidth2; - aRect.Top() = 0; - aRect.Bottom() = nIndentHeight+RULER_OFF-1; + aRect.SetLeft( n1-nIndentWidth2 ); + aRect.SetRight( n1+nIndentWidth2 ); + aRect.SetTop( 0 ); + aRect.SetBottom( nIndentHeight+RULER_OFF-1 ); } if ( aRect.IsInside( Point( nX, nY ) ) ) @@ -1628,8 +1628,8 @@ bool Ruler::ImplHitTest( const Point& rPos, RulerSelection* pHitTest, // test tabs again if ( !mpData->pTabs.empty() ) { - aRect.Top() = RULER_OFF; - aRect.Bottom() = nHitBottom; + aRect.SetTop( RULER_OFF ); + aRect.SetBottom( nHitBottom ); for ( i = mpData->pTabs.size() - 1; i >= 0; i-- ) { @@ -1645,22 +1645,22 @@ bool Ruler::ImplHitTest( const Point& rPos, RulerSelection* pHitTest, if ( nStyle == RULER_TAB_LEFT ) { - aRect.Left() = n1; - aRect.Right() = n1 + ruler_tab.width - 1; + aRect.SetLeft( n1 ); + aRect.SetRight( n1 + ruler_tab.width - 1 ); } else if ( nStyle == RULER_TAB_RIGHT ) { - aRect.Right() = n1; - aRect.Left() = n1 - ruler_tab.width - 1; + aRect.SetRight( n1 ); + aRect.SetLeft( n1 - ruler_tab.width - 1 ); } else { - aRect.Left() = n1 - ruler_tab.cwidth2 + 1; - aRect.Right() = n1 - ruler_tab.cwidth2 + ruler_tab.cwidth; + aRect.SetLeft( n1 - ruler_tab.cwidth2 + 1 ); + aRect.SetRight( n1 - ruler_tab.cwidth2 + ruler_tab.cwidth ); } - aRect.Left()--; - aRect.Right()++; + aRect.AdjustLeft( -1 ); + aRect.AdjustRight( 1 ); if ( aRect.IsInside( Point( nX, nY ) ) ) { @@ -1690,16 +1690,16 @@ bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, } if ( mnWinStyle & WB_HORZ ) - aPos.X() += mnWinOff; + aPos.AdjustX(mnWinOff ); else - aPos.Y() += mnWinOff; + aPos.AdjustY(mnWinOff ); if ( (eDragType == RulerType::Indent) || (eDragType == RulerType::DontKnow) ) { if ( mnWinStyle & WB_HORZ ) - aPos.Y() = RULER_OFF + 1; + aPos.setY( RULER_OFF + 1 ); else - aPos.X() = RULER_OFF + 1; + aPos.setX( RULER_OFF + 1 ); if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { @@ -1713,9 +1713,9 @@ bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, (eDragType == RulerType::DontKnow) ) { if ( mnWinStyle & WB_HORZ ) - aPos.Y() = mnHeight - RULER_OFF - 1; + aPos.setY( mnHeight - RULER_OFF - 1 ); else - aPos.X() = mnWidth - RULER_OFF - 1; + aPos.setX( mnWidth - RULER_OFF - 1 ); if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { @@ -1728,9 +1728,9 @@ bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, (eDragType == RulerType::Border) || (eDragType == RulerType::DontKnow) ) { if ( mnWinStyle & WB_HORZ ) - aPos.Y() = RULER_OFF + (mnVirHeight / 2); + aPos.setY( RULER_OFF + (mnVirHeight / 2) ); else - aPos.X() = RULER_OFF + (mnVirHeight / 2); + aPos.setX( RULER_OFF + (mnVirHeight / 2) ); if ( ImplHitTest( aPos, pHitTest ) ) { @@ -2092,22 +2092,22 @@ void Ruler::Resize() if ( mnWinStyle & WB_HORZ ) { if ( mnWidth < aWinSize.Width() ) - aRect.Left() = mnWidth - RULER_RESIZE_OFF; + aRect.SetLeft( mnWidth - RULER_RESIZE_OFF ); else - aRect.Left() = aWinSize.Width() - RULER_RESIZE_OFF; - aRect.Right() = aRect.Left() + RULER_RESIZE_OFF; - aRect.Top() = RULER_OFF; - aRect.Bottom() = RULER_OFF + mnVirHeight; + aRect.SetLeft( aWinSize.Width() - RULER_RESIZE_OFF ); + aRect.SetRight( aRect.Left() + RULER_RESIZE_OFF ); + aRect.SetTop( RULER_OFF ); + aRect.SetBottom( RULER_OFF + mnVirHeight ); } else { if ( mnHeight < aWinSize.Height() ) - aRect.Top() = mnHeight-RULER_RESIZE_OFF; + aRect.SetTop( mnHeight-RULER_RESIZE_OFF ); else - aRect.Top() = aWinSize.Height()-RULER_RESIZE_OFF; - aRect.Bottom() = aRect.Top() + RULER_RESIZE_OFF; - aRect.Left() = RULER_OFF; - aRect.Right() = RULER_OFF + mnVirHeight; + aRect.SetTop( aWinSize.Height()-RULER_RESIZE_OFF ); + aRect.SetBottom( aRect.Top() + RULER_RESIZE_OFF ); + aRect.SetLeft( RULER_OFF ); + aRect.SetRight( RULER_OFF + mnVirHeight ); } Invalidate(aRect, InvalidateFlags::NoErase); diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx index 4a9b204646cf..9d06321e42a5 100644 --- a/svtools/source/control/scriptedtext.cxx +++ b/svtools/source/control/scriptedtext.cxx @@ -130,18 +130,18 @@ void SvtScriptedTextHelper_Impl::CalculateSizes() SetOutDevFont( nScript ); nCurrWidth = mrOutDevice.GetTextWidth( maText, nThisPos, nNextPos - nThisPos ); maWidthVec.push_back( nCurrWidth ); - maTextSize.Width() += nCurrWidth; + maTextSize.AdjustWidth(nCurrWidth ); nThisPos = nNextPos; } } // calculate maximum font height SetOutDevFont( i18n::ScriptType::LATIN ); - maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); + maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); SetOutDevFont( i18n::ScriptType::ASIAN ); - maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); + maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); SetOutDevFont( i18n::ScriptType::COMPLEX ); - maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); + maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); mrOutDevice.Pop(); } @@ -263,8 +263,8 @@ void SvtScriptedTextHelper_Impl::DrawText( const Point& _rPos ) SetOutDevFont( nScript ); mrOutDevice.DrawText( aCurrPos, maText, nThisPos, nNextPos - nThisPos ); - aCurrPos.X() += maWidthVec[ nVecIndex++ ]; - aCurrPos.X() += mrOutDevice.GetTextHeight() / 5; // add 20% of font height as portion spacing + aCurrPos.AdjustX(maWidthVec[ nVecIndex++ ] ); + aCurrPos.AdjustX(mrOutDevice.GetTextHeight() / 5 ); // add 20% of font height as portion spacing nThisPos = nNextPos; } diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx index e105f0b5fb1a..b648074ceff3 100644 --- a/svtools/source/control/scrwin.cxx +++ b/svtools/source/control/scrwin.cxx @@ -99,9 +99,9 @@ Size ScrollableWindow::GetOutputSizePixel() const long nTmp = GetSettings().GetStyleSettings().GetScrollBarSize(); if ( aHScroll->IsVisible() ) - aSz.Height() -= nTmp; + aSz.AdjustHeight( -nTmp ); if ( aVScroll->IsVisible() ) - aSz.Width() -= nTmp; + aSz.AdjustWidth( -nTmp ); return aSz; } @@ -166,7 +166,7 @@ void ScrollableWindow::Resize() if ( aOutPixSz.Width() < aTotPixSz.Width() && !bHVisible ) { bHVisible = true; - aOutPixSz.Height() -= nScrSize; + aOutPixSz.AdjustHeight( -nScrSize ); bChanged = true; } @@ -174,7 +174,7 @@ void ScrollableWindow::Resize() if ( aOutPixSz.Height() < aTotPixSz.Height() && !bVVisible ) { bVVisible = true; - aOutPixSz.Width() -= nScrSize; + aOutPixSz.AdjustWidth( -nScrSize ); bChanged = true; } @@ -189,16 +189,16 @@ void ScrollableWindow::Resize() Size aPixDelta; if ( aPixOffset.X() < 0 && aPixOffset.X() + aTotPixSz.Width() < aOutPixSz.Width() ) - aPixDelta.Width() = - aOutPixSz.Width() - ( aPixOffset.X() + aTotPixSz.Width() ); + aPixDelta.setWidth( + aOutPixSz.Width() - ( aPixOffset.X() + aTotPixSz.Width() ) ); if ( aPixOffset.Y() < 0 && aPixOffset.Y() + aTotPixSz.Height() < aOutPixSz.Height() ) - aPixDelta.Height() = - aOutPixSz.Height() - ( aPixOffset.Y() + aTotPixSz.Height() ); + aPixDelta.setHeight( + aOutPixSz.Height() - ( aPixOffset.Y() + aTotPixSz.Height() ) ); if ( aPixDelta.Width() || aPixDelta.Height() ) { - aPixOffset.X() += aPixDelta.Width(); - aPixOffset.Y() += aPixDelta.Height(); + aPixOffset.AdjustX(aPixDelta.Width() ); + aPixOffset.AdjustY(aPixDelta.Height() ); } // for axis without scrollbar restore the origin @@ -217,9 +217,9 @@ void ScrollableWindow::Resize() : 0 ) ); } if ( bHVisible && !aHScroll->IsVisible() ) - aPixOffset.X() = 0; + aPixOffset.setX( 0 ); if ( bVVisible && !aVScroll->IsVisible() ) - aPixOffset.Y() = 0; + aPixOffset.setY( 0 ); // select the shifted map-mode if ( aPixOffset != aOldPixOffset ) @@ -305,26 +305,26 @@ void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, ScrollFlags ) // scrolling horizontally? if ( nDeltaX != 0 ) { - aNewPixOffset.X() -= aDeltaPix.Width(); + aNewPixOffset.AdjustX( -(aDeltaPix.Width()) ); if ( ( aOutPixSz.Width() - aNewPixOffset.X() ) > aTotPixSz.Width() ) - aNewPixOffset.X() = - ( aTotPixSz.Width() - aOutPixSz.Width() ); + aNewPixOffset.setX( - ( aTotPixSz.Width() - aOutPixSz.Width() ) ); else if ( aNewPixOffset.X() > 0 ) - aNewPixOffset.X() = 0; + aNewPixOffset.setX( 0 ); } // scrolling vertically? if ( nDeltaY != 0 ) { - aNewPixOffset.Y() -= aDeltaPix.Height(); + aNewPixOffset.AdjustY( -(aDeltaPix.Height()) ); if ( ( aOutPixSz.Height() - aNewPixOffset.Y() ) > aTotPixSz.Height() ) - aNewPixOffset.Y() = - ( aTotPixSz.Height() - aOutPixSz.Height() ); + aNewPixOffset.setY( - ( aTotPixSz.Height() - aOutPixSz.Height() ) ); else if ( aNewPixOffset.Y() > 0 ) - aNewPixOffset.Y() = 0; + aNewPixOffset.setY( 0 ); } // recompute the logical scroll units - aDeltaPix.Width() = aPixOffset.X() - aNewPixOffset.X(); - aDeltaPix.Height() = aPixOffset.Y() - aNewPixOffset.Y(); + aDeltaPix.setWidth( aPixOffset.X() - aNewPixOffset.X() ); + aDeltaPix.setHeight( aPixOffset.Y() - aNewPixOffset.Y() ); Size aDelta( PixelToLogic(aDeltaPix) ); nDeltaX = aDelta.Width(); nDeltaY = aDelta.Height(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 6857bf46cd13..2cd5bd234484 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -119,8 +119,8 @@ public: long nTextWidth = mrRenderContext.GetTextWidth(aText); long nTextHeight = mrRenderContext.GetTextHeight(); Point aPos = aRect.TopLeft(); - aPos.X() += (aRect.getWidth() - nTextWidth) / 2; - aPos.Y() += (aRect.getHeight() - nTextHeight) / 2; + aPos.AdjustX((aRect.getWidth() - nTextWidth) / 2 ); + aPos.AdjustY((aRect.getHeight() - nTextHeight) / 2 ); if (mbEnabled) mrRenderContext.DrawText(aPos, aText); @@ -143,7 +143,7 @@ public: mrRenderContext.SetLineColor(maCustomColor); tools::Rectangle aLineRect(maRect.BottomLeft(), maRect.BottomRight()); - aLineRect.Top() -= 3; + aLineRect.AdjustTop( -3 ); mrRenderContext.DrawRect(aLineRect); } @@ -714,20 +714,20 @@ void TabBar::ImplFormat() // Slightly before the tab before the first visible page // should also be visible if (n + 1 == mnFirstPos) - pItem->maRect.Left() = x-pItem->mnWidth; + pItem->maRect.SetLeft( x-pItem->mnWidth ); else { - pItem->maRect.Left() = x; + pItem->maRect.SetLeft( x ); x += pItem->mnWidth; } - pItem->maRect.Right() = x; - pItem->maRect.Bottom() = maWinSize.Height() - 1; + pItem->maRect.SetRight( x ); + pItem->maRect.SetBottom( maWinSize.Height() - 1 ); if (mbMirrored) { long nTmp = mnOffX + mnLastOffX - pItem->maRect.Right(); - pItem->maRect.Right() = mnOffX + mnLastOffX - pItem->maRect.Left(); - pItem->maRect.Left() = nTmp; + pItem->maRect.SetRight( mnOffX + mnLastOffX - pItem->maRect.Left() ); + pItem->maRect.SetLeft( nTmp ); } } @@ -1380,11 +1380,11 @@ void TabBar::RequestHelp(const HelpEvent& rHEvt) { tools::Rectangle aItemRect = GetPageRect(nItemId); Point aPt = OutputToScreenPixel(aItemRect.TopLeft()); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel(aItemRect.BottomRight()); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); Help::ShowBalloon(this, aItemRect.Center(), aItemRect, aStr); return; } @@ -1412,11 +1412,11 @@ void TabBar::RequestHelp(const HelpEvent& rHEvt) { tools::Rectangle aItemRect = GetPageRect(nItemId); Point aPt = OutputToScreenPixel(aItemRect.TopLeft()); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel(aItemRect.BottomRight()); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); OUString aStr = mpImpl->mpItemList[nPos]->maText; if (!aStr.isEmpty()) { diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index eb0c3dcc9b03..1685f115b621 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -571,7 +571,7 @@ Size ToolbarMenu::implCalcSize() { Size aImgSz( pEntry->maImage.GetSizePixel() ); nMinMenuItemHeight = std::max( nMinMenuItemHeight, aImgSz.Height() + 6 ); - aMaxImgSz.Width() = std::max( aMaxImgSz.Width(), aImgSz.Width() ); + aMaxImgSz.setWidth( std::max( aMaxImgSz.Width(), aImgSz.Width() ) ); } } } @@ -591,7 +591,7 @@ Size ToolbarMenu::implCalcSize() // Text: if( pEntry->mbHasText || pEntry->mbHasImage ) { - pEntry->maSize.Height() = nMinMenuItemHeight; + pEntry->maSize.setHeight( nMinMenuItemHeight ); if( pEntry->mbHasText ) { @@ -605,7 +605,7 @@ Size ToolbarMenu::implCalcSize() Size aControlSize( pEntry->mpControl->GetOutputSizePixel() ); nMaxTextWidth = std::max( aControlSize.Width(), nMaxTextWidth ); - pEntry->maSize.Height() = aControlSize.Height() + 1; + pEntry->maSize.setHeight( aControlSize.Height() + 1 ); } if( pEntry->HasCheck() && !pEntry->mbHasImage ) @@ -632,7 +632,7 @@ Size ToolbarMenu::implCalcSize() } } - aSz.Width() = nMaxTextWidth + (BORDER_X<<1); + aSz.setWidth( nMaxTextWidth + (BORDER_X<<1) ); // positionate controls int nY = BORDER_Y; @@ -640,7 +640,7 @@ Size ToolbarMenu::implCalcSize() { if (pEntry) { - pEntry->maSize.Width() = nMaxTextWidth; + pEntry->maSize.setWidth( nMaxTextWidth ); if( pEntry->mpControl ) { @@ -664,7 +664,7 @@ Size ToolbarMenu::implCalcSize() } } - aSz.Height() += nY + BORDER_Y; + aSz.AdjustHeight(nY + BORDER_Y ); return aSz; } @@ -779,7 +779,7 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi if (pEntry->mnBits & MenuItemBits::POPUPSELECT) { long nFontHeight = GetTextHeight(); - aItemRect.Right() -= nFontHeight + nFontHeight / 4; + aItemRect.AdjustRight( -(nFontHeight + nFontHeight / 4) ); } if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire)) @@ -1180,11 +1180,11 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry if ((pEntry == nullptr) && !pThisOnly) { // Separator - aTmpPos.Y() = aPos.Y() + ((SEPARATOR_HEIGHT - 2) / 2); - aTmpPos.X() = aPos.X() + 2 + nOuterSpace; + aTmpPos.setY( aPos.Y() + ((SEPARATOR_HEIGHT - 2) / 2) ); + aTmpPos.setX( aPos.X() + 2 + nOuterSpace ); rRenderContext.SetLineColor(rSettings.GetShadowColor()); rRenderContext.DrawLine(aTmpPos, Point(aOutSz.Width() - 3 - 2 * nOuterSpace, aTmpPos.Y())); - aTmpPos.Y()++; + aTmpPos.AdjustY( 1 ); rRenderContext.SetLineColor(rSettings.GetLightColor()); rRenderContext.DrawLine(aTmpPos, Point( aOutSz.Width() - 3 - 2 * nOuterSpace, aTmpPos.Y())); rRenderContext.SetLineColor(); @@ -1213,10 +1213,10 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry tools::Rectangle aOuterCheckRect(Point(aPos.X() + mpImpl->mnCheckPos, aPos.Y()), Size(pEntry->maSize.Height(), pEntry->maSize.Height())); - aOuterCheckRect.Left() += 1; - aOuterCheckRect.Right() -= 1; - aOuterCheckRect.Top() += 1; - aOuterCheckRect.Bottom() -= 1; + aOuterCheckRect.AdjustLeft(1 ); + aOuterCheckRect.AdjustRight( -1 ); + aOuterCheckRect.AdjustTop(1 ); + aOuterCheckRect.AdjustBottom( -1 ); if (bTitle) { @@ -1263,8 +1263,8 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry nState |= ControlState::SELECTED; long nCtrlHeight = (pEntry->mnBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight; - aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight) / 2; - aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight) / 2; + aTmpPos.setX( aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight) / 2 ); + aTmpPos.setY( aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight) / 2 ); tools::Rectangle aCheckRect(aTmpPos, Size(nCtrlHeight, nCtrlHeight)); rRenderContext.DrawNativeControl(ControlType::MenuPopup, nPart, aCheckRect, @@ -1287,8 +1287,8 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry eSymbol = SymbolType::CHECKMARK; aSymbolSize = Size((nFontHeight * 25) / 40, nFontHeight / 2); } - aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - aSymbolSize.Width())/2; - aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - aSymbolSize.Height())/2; + aTmpPos.setX( aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - aSymbolSize.Width())/2 ); + aTmpPos.setY( aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - aSymbolSize.Height())/2 ); tools::Rectangle aRect( aTmpPos, aSymbolSize ); aDecoView.DrawSymbol(aRect, eSymbol, GetTextColor(), nSymbolStyle); aPos.setX(aPos.getX() + aSymbolSize.getWidth( ) + gfxExtra); @@ -1302,17 +1302,17 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry if (pEntry->mbChecked) ImplPaintCheckBackground(rRenderContext, *this, aOuterCheckRect, pThisOnly && bHighlighted); aTmpPos = aOuterCheckRect.TopLeft(); - aTmpPos.X() += (aOuterCheckRect.GetWidth()-pEntry->maImage.GetSizePixel().Width())/2; - aTmpPos.Y() += (aOuterCheckRect.GetHeight()-pEntry->maImage.GetSizePixel().Height())/2; + aTmpPos.AdjustX((aOuterCheckRect.GetWidth()-pEntry->maImage.GetSizePixel().Width())/2 ); + aTmpPos.AdjustY((aOuterCheckRect.GetHeight()-pEntry->maImage.GetSizePixel().Height())/2 ); rRenderContext.DrawImage( aTmpPos, pEntry->maImage, nImageStyle ); } // Text: if (pEntry->mbHasText) { - aTmpPos.X() = aPos.X() + (bTitle ? 4 : mpImpl->mnTextPos); - aTmpPos.Y() = aPos.Y(); - aTmpPos.Y() += nTextOffsetY; + aTmpPos.setX( aPos.X() + (bTitle ? 4 : mpImpl->mnTextPos) ); + aTmpPos.setY( aPos.Y() ); + aTmpPos.AdjustY(nTextOffsetY ); DrawTextFlags nStyle = nTextStyle|DrawTextFlags::Mnemonic; rRenderContext.DrawCtrlText(aTmpPos, pEntry->maText, 0, pEntry->maText.getLength(), nStyle); @@ -1327,7 +1327,7 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry } } - aTopLeft.Y() += pEntry ? pEntry->maSize.Height() : SEPARATOR_HEIGHT; + aTopLeft.AdjustY(pEntry ? pEntry->maSize.Height() : SEPARATOR_HEIGHT ); } } diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 76a4dc89465e..4d4e0a8d89bc 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -206,19 +206,19 @@ void ValueSet::ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSe WinBits nStyle = GetStyle(); if (nStyle & WB_ITEMBORDER) { - aRect.Left() += 1; - aRect.Top() += 1; - aRect.Right() -= 1; - aRect.Bottom() -= 1; + aRect.AdjustLeft(1 ); + aRect.AdjustTop(1 ); + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); if (nStyle & WB_FLATVALUESET) { sal_Int32 nBorder = (nStyle & WB_DOUBLEBORDER) ? 2 : 1; - aRect.Left() += nBorder; - aRect.Top() += nBorder; - aRect.Right() -= nBorder; - aRect.Bottom() -= nBorder; + aRect.AdjustLeft(nBorder ); + aRect.AdjustTop(nBorder ); + aRect.AdjustRight( -nBorder ); + aRect.AdjustBottom( -nBorder ); } else { @@ -280,10 +280,10 @@ void ValueSet::ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSe Size aImageSize = pItem->maImage.GetSizePixel(); Size aRectSize = aRect.GetSize(); Point aPos(aRect.Left(), aRect.Top()); - aPos.X() += (aRectSize.Width() - aImageSize.Width()) / 2; + aPos.AdjustX((aRectSize.Width() - aImageSize.Width()) / 2 ); if (pItem->meType != VALUESETITEM_IMAGE_AND_TEXT) - aPos.Y() += (aRectSize.Height() - aImageSize.Height()) / 2; + aPos.AdjustY((aRectSize.Height() - aImageSize.Height()) / 2 ); DrawImageFlags nImageStyle = DrawImageFlags::NONE; if (!IsEnabled()) @@ -377,12 +377,12 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) if (nStyle & WB_NAMEFIELD) { mnTextOffset = aWinSize.Height() - nTxtHeight - NAME_OFFSET; - aWinSize.Height() -= nTxtHeight + NAME_OFFSET; + aWinSize.AdjustHeight( -(nTxtHeight + NAME_OFFSET) ); if (!(nStyle & WB_FLATVALUESET)) { mnTextOffset -= NAME_LINE_HEIGHT + NAME_LINE_OFF_Y; - aWinSize.Height() -= NAME_LINE_HEIGHT + NAME_LINE_OFF_Y; + aWinSize.AdjustHeight( -(NAME_LINE_HEIGHT + NAME_LINE_OFF_Y) ); } } else @@ -583,10 +583,10 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) mpNoneItem->mnId = 0; mpNoneItem->meType = VALUESETITEM_NONE; mpNoneItem->mbVisible = true; - maNoneItemRect.Left() = x; - maNoneItemRect.Top() = y; - maNoneItemRect.Right() = maNoneItemRect.Left() + aWinSize.Width() - x - 1; - maNoneItemRect.Bottom() = y + nNoneHeight - 1; + maNoneItemRect.SetLeft( x ); + maNoneItemRect.SetTop( y ); + maNoneItemRect.SetRight( maNoneItemRect.Left() + aWinSize.Width() - x - 1 ); + maNoneItemRect.SetBottom( y + nNoneHeight - 1 ); ImplFormatItem(rRenderContext, mpNoneItem.get(), maNoneItemRect); @@ -597,10 +597,10 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) sal_uLong nFirstItem = static_cast<sal_uLong>(mnFirstLine) * mnCols; sal_uLong nLastItem = nFirstItem + (mnVisLines * mnCols); - maItemListRect.Left() = x; - maItemListRect.Top() = y; - maItemListRect.Right() = x + mnCols * (mnItemWidth + mnSpacing) - mnSpacing - 1; - maItemListRect.Bottom() = y + mnVisLines * (mnItemHeight + mnSpacing) - mnSpacing - 1; + maItemListRect.SetLeft( x ); + maItemListRect.SetTop( y ); + maItemListRect.SetRight( x + mnCols * (mnItemWidth + mnSpacing) - mnSpacing - 1 ); + maItemListRect.SetBottom( y + mnVisLines * (mnItemHeight + mnSpacing) - mnSpacing - 1 ); if (!mbFullMode) { @@ -609,7 +609,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) // visible if (y + (mnVisLines * (mnItemHeight + mnSpacing)) < aWinSize.Height()) nLastItem += mnCols; - maItemListRect.Bottom() = aWinSize.Height() - y; + maItemListRect.SetBottom( aWinSize.Height() - y ); } for (size_t i = 0; i < nItemCount; i++) { @@ -660,8 +660,8 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) // If a none field is visible, then we center the scrollbar if (nStyle & WB_NONEFIELD) { - aPos.Y() = nStartY + nNoneHeight + 1; - aSize.Height() = ((mnItemHeight + mnSpacing) * mnVisLines) - 2 - mnSpacing; + aPos.setY( nStartY + nNoneHeight + 1 ); + aSize.setHeight( ((mnItemHeight + mnSpacing) * mnVisLines) - 2 - mnSpacing ); } mxScrollBar->SetPosSizePixel(aPos, aSize); mxScrollBar->SetRangeMax(mnLines); @@ -805,30 +805,30 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt } if (mbDoubleSel) { - aRect.Left()++; - aRect.Top()++; - aRect.Right()--; - aRect.Bottom()--; + aRect.AdjustLeft( 1 ); + aRect.AdjustTop( 1 ); + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); if (bDrawSel) rRenderContext.DrawRect(aRect); } - aRect.Left()++; - aRect.Top()++; - aRect.Right()--; - aRect.Bottom()--; + aRect.AdjustLeft( 1 ); + aRect.AdjustTop( 1 ); + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); tools::Rectangle aRect2 = aRect; - aRect.Left()++; - aRect.Top()++; - aRect.Right()--; - aRect.Bottom()--; + aRect.AdjustLeft( 1 ); + aRect.AdjustTop( 1 ); + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); if (bDrawSel) rRenderContext.DrawRect(aRect); if (mbDoubleSel) { - aRect.Left()++; - aRect.Top()++; - aRect.Right()--; - aRect.Bottom()--; + aRect.AdjustLeft( 1 ); + aRect.AdjustTop( 1 ); + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); if (bDrawSel) rRenderContext.DrawRect(aRect); } @@ -915,12 +915,12 @@ void ValueSet::ImplDraw(vcl::RenderContext& rRenderContext) Size aTempSize(aSize.Width(), aScrPos.Y()); rRenderContext.DrawOutDev(aDefPos, aTempSize, aDefPos, aTempSize, *maVirDev.get()); - aTempSize.Width() = aScrPos.X() - 1; - aTempSize.Height() = aScrSize.Height(); + aTempSize.setWidth( aScrPos.X() - 1 ); + aTempSize.setHeight( aScrSize.Height() ); rRenderContext.DrawOutDev(aTempPos, aTempSize, aTempPos, aTempSize, *maVirDev.get()); - aTempPos.Y() = aScrPos.Y() + aScrSize.Height(); - aTempSize.Width() = aSize.Width(); - aTempSize.Height() = aSize.Height() - aTempPos.Y(); + aTempPos.setY( aScrPos.Y() + aScrSize.Height() ); + aTempSize.setWidth( aSize.Width() ); + aTempSize.setHeight( aSize.Height() - aTempPos.Y() ); rRenderContext.DrawOutDev(aTempPos, aTempSize, aTempPos, aTempSize, *maVirDev.get()); } else @@ -939,8 +939,8 @@ void ValueSet::ImplDraw(vcl::RenderContext& rRenderContext) { rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); rRenderContext.DrawLine(aPos1, aPos2); - aPos1.Y()++; - aPos2.Y()++; + aPos1.AdjustY( 1 ); + aPos2.AdjustY( 1 ); rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); } else @@ -1434,11 +1434,11 @@ void ValueSet::RequestHelp( const HelpEvent& rHelpEvent ) { tools::Rectangle aItemRect = ImplGetItemRect( nItemPos ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); Help::ShowQuickHelp( this, aItemRect, GetItemText( ImplGetItem( nItemPos )->mnId ) ); return; } @@ -2151,32 +2151,32 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol else n = ITEM_OFFSET; - aSize.Width() += n * nCalcCols; - aSize.Height() += n * nCalcLines; + aSize.AdjustWidth(n * nCalcCols ); + aSize.AdjustHeight(n * nCalcLines ); } else n = 0; if ( mnSpacing ) { - aSize.Width() += mnSpacing * (nCalcCols - 1); - aSize.Height() += mnSpacing * (nCalcLines - 1); + aSize.AdjustWidth(mnSpacing * (nCalcCols - 1) ); + aSize.AdjustHeight(mnSpacing * (nCalcLines - 1) ); } if ( nStyle & WB_NAMEFIELD ) { - aSize.Height() += nTxtHeight + NAME_OFFSET; + aSize.AdjustHeight(nTxtHeight + NAME_OFFSET ); if ( !(nStyle & WB_FLATVALUESET) ) - aSize.Height() += NAME_LINE_HEIGHT + NAME_LINE_OFF_Y; + aSize.AdjustHeight(NAME_LINE_HEIGHT + NAME_LINE_OFF_Y ); } if ( nStyle & WB_NONEFIELD ) { - aSize.Height() += nTxtHeight + n + mnSpacing; + aSize.AdjustHeight(nTxtHeight + n + mnSpacing ); } // sum possible ScrollBar width - aSize.Width() += GetScrollWidth(); + aSize.AdjustWidth(GetScrollWidth() ); return aSize; } @@ -2195,8 +2195,8 @@ Size ValueSet::CalcItemSizePixel( const Size& rItemSize) const else n = ITEM_OFFSET; - aSize.Width() += n; - aSize.Height() += n; + aSize.AdjustWidth(n ); + aSize.AdjustHeight(n ); } return aSize; @@ -2242,14 +2242,14 @@ Size ValueSet::GetLargestItemSize() Size aSize = pItem->maImage.GetSizePixel(); if (pItem->meType == VALUESETITEM_IMAGE_AND_TEXT) { - aSize.Height() += 3 * NAME_LINE_HEIGHT + - maVirDev->GetTextHeight(); - aSize.Width() = std::max(aSize.Width(), - maVirDev->GetTextWidth(pItem->maText) + NAME_OFFSET); + aSize.AdjustHeight(3 * NAME_LINE_HEIGHT + + maVirDev->GetTextHeight() ); + aSize.setWidth( std::max(aSize.Width(), + maVirDev->GetTextWidth(pItem->maText) + NAME_OFFSET) ); } - aLargestItem.Width() = std::max(aLargestItem.Width(), aSize.Width()); - aLargestItem.Height() = std::max(aLargestItem.Height(), aSize.Height()); + aLargestItem.setWidth( std::max(aLargestItem.Width(), aSize.Width()) ); + aLargestItem.setHeight( std::max(aLargestItem.Height(), aSize.Height()) ); } return aLargestItem; diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index fc256f3bfcef..281009f5f5e9 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -140,7 +140,7 @@ namespace svt m_pImpl->pRoadmap->SetItemSelectHdl( LINK( this, RoadmapWizard, OnRoadmapItemSelected ) ); Size aRoadmapSize = LogicToPixel(Size(85, 0), MapMode(MapUnit::MapAppFont)); - aRoadmapSize.Height() = GetSizePixel().Height(); + aRoadmapSize.setHeight( GetSizePixel().Height() ); m_pImpl->pRoadmap->SetSizePixel( aRoadmapSize ); SetViewWindow( m_pImpl->pRoadmap ); diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index a24522bcaf56..c0b3c3788c4a 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -88,20 +88,20 @@ void WizardDialog::ImplCalcSize( Size& rSize ) } if ( nMaxHeight ) nMaxHeight += WIZARDDIALOG_BUTTON_OFFSET_Y*2; - rSize.Height() += nMaxHeight; + rSize.AdjustHeight(nMaxHeight ); // View-Window-Groesse dazurechnen if ( mpViewWindow && mpViewWindow->IsVisible() ) { Size aViewSize = mpViewWindow->GetSizePixel(); if ( meViewAlign == WindowAlign::Top ) - rSize.Height() += aViewSize.Height(); + rSize.AdjustHeight(aViewSize.Height() ); else if ( meViewAlign == WindowAlign::Left ) - rSize.Width() += aViewSize.Width(); + rSize.AdjustWidth(aViewSize.Width() ); else if ( meViewAlign == WindowAlign::Bottom ) - rSize.Height() += aViewSize.Height(); + rSize.AdjustHeight(aViewSize.Height() ); else if ( meViewAlign == WindowAlign::Right ) - rSize.Width() += aViewSize.Width(); + rSize.AdjustWidth(aViewSize.Width() ); } } @@ -264,7 +264,7 @@ void WizardDialog::ImplPosTabPage() // position TabPage Size aDlgSize = GetOutputSizePixel(); - aDlgSize.Height() -= nMaxHeight; + aDlgSize.AdjustHeight( -nMaxHeight ); long nOffX = 0; long nOffY = 0; if ( mpViewWindow && mpViewWindow->IsVisible() ) @@ -273,18 +273,18 @@ void WizardDialog::ImplPosTabPage() if ( meViewAlign == WindowAlign::Top ) { nOffY += aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y; - aDlgSize.Height() -= aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y; + aDlgSize.AdjustHeight( -(aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y) ); } else if ( meViewAlign == WindowAlign::Left ) { long nViewOffset = mbEmptyViewMargin ? 0 : WIZARDDIALOG_VIEW_DLGOFFSET_X; nOffX += aViewSize.Width() + nViewOffset; - aDlgSize.Width() -= nOffX; + aDlgSize.AdjustWidth( -nOffX ); } else if ( meViewAlign == WindowAlign::Bottom ) - aDlgSize.Height() -= aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y; + aDlgSize.AdjustHeight( -(aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y) ); else if ( meViewAlign == WindowAlign::Right ) - aDlgSize.Width() -= aViewSize.Width()+WIZARDDIALOG_VIEW_DLGOFFSET_X; + aDlgSize.AdjustWidth( -(aViewSize.Width()+WIZARDDIALOG_VIEW_DLGOFFSET_X) ); } Point aPos( nOffX, nOffY ); mpCurTabPage->SetPosSizePixel( aPos, aDlgSize ); @@ -397,9 +397,9 @@ void WizardDialog::StateChanged( StateChangedType nType ) { Size aPageSize = pPageData->mpPage->GetSizePixel(); if ( aPageSize.Width() > aDlgSize.Width() ) - aDlgSize.Width() = aPageSize.Width(); + aDlgSize.setWidth( aPageSize.Width() ); if ( aPageSize.Height() > aDlgSize.Height() ) - aDlgSize.Height() = aPageSize.Height(); + aDlgSize.setHeight( aPageSize.Height() ); } pPageData = pPageData->mpNext; diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 51f474d2b563..5e0c2e57a83b 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -274,16 +274,16 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si const long nNewRight = nNewLeft + FRound( aSize100.Width() * fScale ) - 1; fScale = static_cast<double>(rSz.Width()) / aSize100.Width(); - rPt.X() += FRound( nNewLeft * fScale ); - rSz.Width() = FRound( ( nNewRight - nNewLeft + 1 ) * fScale ); + rPt.AdjustX(FRound( nNewLeft * fScale ) ); + rSz.setWidth( FRound( ( nNewRight - nNewLeft + 1 ) * fScale ) ); fScale = static_cast<double>(aSize100.Height()) / nTotalHeight; const long nNewTop = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Vertical ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale ); const long nNewBottom = nNewTop + FRound( aSize100.Height() * fScale ) - 1; fScale = static_cast<double>(rSz.Height()) / aSize100.Height(); - rPt.Y() += FRound( nNewTop * fScale ); - rSz.Height() = FRound( ( nNewBottom - nNewTop + 1 ) * fScale ); + rPt.AdjustY(FRound( nNewTop * fScale ) ); + rSz.setHeight( FRound( ( nNewBottom - nNewTop + 1 ) * fScale ) ); if( nRot10 ) { @@ -464,16 +464,16 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, // mirrored horizontically if( aSz.Width() < 0 ) { - aPt.X() += aSz.Width() + 1; - aSz.Width() = -aSz.Width(); + aPt.AdjustX(aSz.Width() + 1 ); + aSz.setWidth( -aSz.Width() ); aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Horizontal ); } // mirrored vertically if( aSz.Height() < 0 ) { - aPt.Y() += aSz.Height() + 1; - aSz.Height() = -aSz.Height(); + aPt.AdjustY(aSz.Height() + 1 ); + aSz.setHeight( -aSz.Height() ); aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Vertical ); } @@ -786,10 +786,10 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo const double fFactorX(static_cast<double>(aBitmapEx.GetSizePixel().Width()) / aSrcSizePixel.Width()); const double fFactorY(static_cast<double>(aBitmapEx.GetSizePixel().Height()) / aSrcSizePixel.Height()); - aCropLeftTop.Width() = basegfx::fround(aCropLeftTop.Width() * fFactorX); - aCropLeftTop.Height() = basegfx::fround(aCropLeftTop.Height() * fFactorY); - aCropRightBottom.Width() = basegfx::fround(aCropRightBottom.Width() * fFactorX); - aCropRightBottom.Height() = basegfx::fround(aCropRightBottom.Height() * fFactorY); + aCropLeftTop.setWidth( basegfx::fround(aCropLeftTop.Width() * fFactorX) ); + aCropLeftTop.setHeight( basegfx::fround(aCropLeftTop.Height() * fFactorY) ); + aCropRightBottom.setWidth( basegfx::fround(aCropRightBottom.Width() * fFactorX) ); + aCropRightBottom.setHeight( basegfx::fround(aCropRightBottom.Height() * fFactorY) ); aSrcSizePixel = aBitmapEx.GetSizePixel(); } @@ -834,10 +834,10 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo aCropRightBottom.Height() < 0 ) { Size aNewSize( aAnim.GetDisplaySizePixel() ); - aNewSize.Width() += aCropRightBottom.Width() < 0 ? -aCropRightBottom.Width() : 0; - aNewSize.Width() += aCropLeftTop.Width() < 0 ? -aCropLeftTop.Width() : 0; - aNewSize.Height() += aCropRightBottom.Height() < 0 ? -aCropRightBottom.Height() : 0; - aNewSize.Height() += aCropLeftTop.Height() < 0 ? -aCropLeftTop.Height() : 0; + aNewSize.AdjustWidth(aCropRightBottom.Width() < 0 ? -aCropRightBottom.Width() : 0 ); + aNewSize.AdjustWidth(aCropLeftTop.Width() < 0 ? -aCropLeftTop.Width() : 0 ); + aNewSize.AdjustHeight(aCropRightBottom.Height() < 0 ? -aCropRightBottom.Height() : 0 ); + aNewSize.AdjustHeight(aCropLeftTop.Height() < 0 ? -aCropLeftTop.Height() : 0 ); aAnim.SetDisplaySizePixel( aNewSize ); } diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 584c31daa07f..bc3dab23f454 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -1733,7 +1733,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr, nFlags)) return false; - aCurrPos.X() += aTileInfo.aTileSizePixel.Width(); + aCurrPos.AdjustX(aTileInfo.aTileSizePixel.Width() ); } #ifdef DBG_TEST @@ -1747,14 +1747,14 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent // now fill one column from aTileInfo.aNextTileTopLeft.Y() all // the way to the bottom - aCurrPos.X() = aTileInfo.aTileTopLeft.X(); - aCurrPos.Y() = aTileInfo.aNextTileTopLeft.Y(); + aCurrPos.setX( aTileInfo.aTileTopLeft.X() ); + aCurrPos.setY( aTileInfo.aNextTileTopLeft.Y() ); for (int nY=0; nY < aTileInfo.nTilesEmptyY; nY += nMSBFactor) { if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr, nFlags)) return false; - aCurrPos.Y() += aTileInfo.aTileSizePixel.Height(); + aCurrPos.AdjustY(aTileInfo.aTileSizePixel.Height() ); } #ifdef DBG_TEST @@ -1805,7 +1805,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent // we don't draw beyond the right or bottom border. for (int nY=0; nY < aTileInfo.nTilesEmptyY && nY < nExponent*nMSBFactor; nY += nMSBFactor) { - aCurrPos.X() = aTileInfo.aNextTileTopLeft.X(); + aCurrPos.setX( aTileInfo.aNextTileTopLeft.X() ); for (int nX=0; nX < aTileInfo.nTilesEmptyX && nX < nExponent*nMSBFactor; nX += nMSBFactor) { @@ -1814,10 +1814,10 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent else if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr, nFlags)) return false; - aCurrPos.X() += aTileInfo.aTileSizePixel.Width(); + aCurrPos.AdjustX(aTileInfo.aTileSizePixel.Width() ); } - aCurrPos.Y() += aTileInfo.aTileSizePixel.Height(); + aCurrPos.AdjustY(aTileInfo.aTileSizePixel.Height() ); } #ifdef DBG_TEST @@ -1959,7 +1959,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, for( nY=0; nY < nNumTilesY; ++nY ) { - aCurrPos.X() = rPosPixel.X(); + aCurrPos.setX( rPosPixel.X() ); for( nX=0; nX < nNumTilesX; ++nX ) { @@ -1974,10 +1974,10 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel, bDrawInPixel ? rTileSizePixel : aTileSizeLogic, pAttr, nFlags ); - aCurrPos.X() += rTileSizePixel.Width(); + aCurrPos.AdjustX(rTileSizePixel.Width() ); } - aCurrPos.Y() += rTileSizePixel.Height(); + aCurrPos.AdjustY(rTileSizePixel.Height() ); } if( bDrawInPixel ) diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 0c4a481021dd..f0dddfc5610c 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -514,10 +514,10 @@ void ImplCalculateCropRect( ::Graphic const & rGraphic, const text::GraphicCrop& { double fSourceSizePixelWidth = static_cast<double>(aSourceSizePixel.Width()); double fSourceSizePixelHeight= static_cast<double>(aSourceSizePixel.Height()); - rGraphicCropPixel.Left() = static_cast< sal_Int32 >((fSourceSizePixelWidth * rGraphicCropLogic.Left ) / aSize100thMM.Width()); - rGraphicCropPixel.Top() = static_cast< sal_Int32 >((fSourceSizePixelHeight * rGraphicCropLogic.Top ) / aSize100thMM.Height()); - rGraphicCropPixel.Right() = static_cast< sal_Int32 >(( fSourceSizePixelWidth * ( aSize100thMM.Width() - rGraphicCropLogic.Right ) ) / aSize100thMM.Width() ); - rGraphicCropPixel.Bottom() = static_cast< sal_Int32 >(( fSourceSizePixelHeight * ( aSize100thMM.Height() - rGraphicCropLogic.Bottom ) ) / aSize100thMM.Height() ); + rGraphicCropPixel.SetLeft( static_cast< sal_Int32 >((fSourceSizePixelWidth * rGraphicCropLogic.Left ) / aSize100thMM.Width()) ); + rGraphicCropPixel.SetTop( static_cast< sal_Int32 >((fSourceSizePixelHeight * rGraphicCropLogic.Top ) / aSize100thMM.Height()) ); + rGraphicCropPixel.SetRight( static_cast< sal_Int32 >(( fSourceSizePixelWidth * ( aSize100thMM.Width() - rGraphicCropLogic.Right ) ) / aSize100thMM.Width() ) ); + rGraphicCropPixel.SetBottom( static_cast< sal_Int32 >(( fSourceSizePixelHeight * ( aSize100thMM.Height() - rGraphicCropLogic.Bottom ) ) / aSize100thMM.Height() ) ); } } diff --git a/svtools/source/hatchwindow/ipwin.cxx b/svtools/source/hatchwindow/ipwin.cxx index 071e47c7f4c0..9da230d76dbf 100644 --- a/svtools/source/hatchwindow/ipwin.cxx +++ b/svtools/source/hatchwindow/ipwin.cxx @@ -88,16 +88,16 @@ void SvResizeHelper::FillMoveRectsPixel( tools::Rectangle aRects[ 4 ] ) const { // upper aRects[ 0 ] = aOuter; - aRects[ 0 ].Bottom() = aRects[ 0 ].Top() + aBorder.Height() -1; + aRects[ 0 ].SetBottom( aRects[ 0 ].Top() + aBorder.Height() -1 ); // right aRects[ 1 ] = aOuter; - aRects[ 1 ].Left() = aRects[ 1 ].Right() - aBorder.Width() -1; + aRects[ 1 ].SetLeft( aRects[ 1 ].Right() - aBorder.Width() -1 ); // lower aRects[ 2 ] = aOuter; - aRects[ 2 ].Top() = aRects[ 2 ].Bottom() - aBorder.Height() -1; + aRects[ 2 ].SetTop( aRects[ 2 ].Bottom() - aBorder.Height() -1 ); // left aRects[ 3 ] = aOuter; - aRects[ 3 ].Right() = aRects[ 3 ].Left() + aBorder.Width() -1; + aRects[ 3 ].SetRight( aRects[ 3 ].Left() + aBorder.Width() -1 ); } /************************************************************************* @@ -214,7 +214,7 @@ Point SvResizeHelper::GetTrackPosPixel( const tools::Rectangle & rRect ) const aPos = aRect.TopLeft() - aOuter.TopLeft(); break; case 1: - aPos.Y() = aRect.Top() - aOuter.Top(); + aPos.setY( aRect.Top() - aOuter.Top() ); break; case 2: // FIXME: disable it for RTL because it's wrong calculations @@ -224,9 +224,9 @@ Point SvResizeHelper::GetTrackPosPixel( const tools::Rectangle & rRect ) const break; case 3: if( bRTL ) - aPos.X() = aRect.Left() - aTR.X(); + aPos.setX( aRect.Left() - aTR.X() ); else - aPos.X() = aRect.Right() - aTR.X(); + aPos.setX( aRect.Right() - aTR.X() ); break; case 4: // FIXME: disable it for RTL because it's wrong calculations @@ -235,7 +235,7 @@ Point SvResizeHelper::GetTrackPosPixel( const tools::Rectangle & rRect ) const aPos = aRect.BottomRight() - aBR; break; case 5: - aPos.Y() = aRect.Bottom() - aBR.Y(); + aPos.setY( aRect.Bottom() - aBR.Y() ); break; case 6: // FIXME: disable it for RTL because it's wrong calculations @@ -245,9 +245,9 @@ Point SvResizeHelper::GetTrackPosPixel( const tools::Rectangle & rRect ) const break; case 7: if( bRTL ) - aPos.X() = aRect.Right() + aOuter.Right() - aOuter.TopRight().X(); + aPos.setX( aRect.Right() + aOuter.Right() - aOuter.TopRight().X() ); else - aPos.X() = aRect.Left() - aOuter.Left(); + aPos.setX( aRect.Left() - aOuter.Left() ); break; case 8: aPos = aRect.TopLeft() - aOuter.TopLeft(); @@ -273,60 +273,60 @@ tools::Rectangle SvResizeHelper::GetTrackRectPixel( const Point & rTrackPos ) co switch( nGrab ) { case 0: - aTrackRect.Top() += aDiff.Y(); + aTrackRect.AdjustTop(aDiff.Y() ); // ugly solution for resizing OLE objects in RTL if( bRTL ) - aTrackRect.Right() = aBR.X() - aDiff.X(); + aTrackRect.SetRight( aBR.X() - aDiff.X() ); else - aTrackRect.Left() += aDiff.X(); + aTrackRect.AdjustLeft(aDiff.X() ); break; case 1: - aTrackRect.Top() += aDiff.Y(); + aTrackRect.AdjustTop(aDiff.Y() ); break; case 2: - aTrackRect.Top() += aDiff.Y(); + aTrackRect.AdjustTop(aDiff.Y() ); // ugly solution for resizing OLE objects in RTL if( bRTL ) - aTrackRect.Left() -= aDiff.X(); + aTrackRect.AdjustLeft( -(aDiff.X()) ); else - aTrackRect.Right() = aBR.X() + aDiff.X(); + aTrackRect.SetRight( aBR.X() + aDiff.X() ); break; case 3: // ugly solution for resizing OLE objects in RTL if( bRTL ) - aTrackRect.Left() -= aDiff.X(); + aTrackRect.AdjustLeft( -(aDiff.X()) ); else - aTrackRect.Right() = aBR.X() + aDiff.X(); + aTrackRect.SetRight( aBR.X() + aDiff.X() ); break; case 4: - aTrackRect.Bottom() = aBR.Y() + aDiff.Y(); + aTrackRect.SetBottom( aBR.Y() + aDiff.Y() ); // ugly solution for resizing OLE objects in RTL if( bRTL ) - aTrackRect.Left() -= aDiff.X(); + aTrackRect.AdjustLeft( -(aDiff.X()) ); else - aTrackRect.Right() = aBR.X() + aDiff.X(); + aTrackRect.SetRight( aBR.X() + aDiff.X() ); break; case 5: - aTrackRect.Bottom() = aBR.Y() + aDiff.Y(); + aTrackRect.SetBottom( aBR.Y() + aDiff.Y() ); break; case 6: - aTrackRect.Bottom() = aBR.Y() + aDiff.Y(); + aTrackRect.SetBottom( aBR.Y() + aDiff.Y() ); // ugly solution for resizing OLE objects in RTL if( bRTL ) - aTrackRect.Right() = aBR.X() - aDiff.X(); + aTrackRect.SetRight( aBR.X() - aDiff.X() ); else - aTrackRect.Left() += aDiff.X(); + aTrackRect.AdjustLeft(aDiff.X() ); break; case 7: // ugly solution for resizing OLE objects in RTL if( bRTL ) - aTrackRect.Right() = aBR.X() - aDiff.X(); + aTrackRect.SetRight( aBR.X() - aDiff.X() ); else - aTrackRect.Left() += aDiff.X(); + aTrackRect.AdjustLeft(aDiff.X() ); break; case 8: if( bRTL ) - aDiff.X() = -aDiff.X(); // workaround for move in RTL mode + aDiff.setX( -aDiff.X() ); // workaround for move in RTL mode aTrackRect.SetPos( aTrackRect.TopLeft() + aDiff ); break; } @@ -340,51 +340,51 @@ void SvResizeHelper::ValidateRect( tools::Rectangle & rValidate ) const { case 0: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Top() = rValidate.Bottom(); + rValidate.SetTop( rValidate.Bottom() ); if( rValidate.Left() > rValidate.Right() ) - rValidate.Left() = rValidate.Right(); + rValidate.SetLeft( rValidate.Right() ); break; case 1: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Top() = rValidate.Bottom(); + rValidate.SetTop( rValidate.Bottom() ); break; case 2: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Top() = rValidate.Bottom(); + rValidate.SetTop( rValidate.Bottom() ); if( rValidate.Left() > rValidate.Right() ) - rValidate.Right() = rValidate.Left(); + rValidate.SetRight( rValidate.Left() ); break; case 3: if( rValidate.Left() > rValidate.Right() ) - rValidate.Right() = rValidate.Left(); + rValidate.SetRight( rValidate.Left() ); break; case 4: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Bottom() = rValidate.Top(); + rValidate.SetBottom( rValidate.Top() ); if( rValidate.Left() > rValidate.Right() ) - rValidate.Right() = rValidate.Left(); + rValidate.SetRight( rValidate.Left() ); break; case 5: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Bottom() = rValidate.Top(); + rValidate.SetBottom( rValidate.Top() ); break; case 6: if( rValidate.Top() > rValidate.Bottom() ) - rValidate.Bottom() = rValidate.Top(); + rValidate.SetBottom( rValidate.Top() ); if( rValidate.Left() > rValidate.Right() ) - rValidate.Left() = rValidate.Right(); + rValidate.SetLeft( rValidate.Right() ); break; case 7: if( rValidate.Left() > rValidate.Right() ) - rValidate.Left() = rValidate.Right(); + rValidate.SetLeft( rValidate.Right() ); break; } // Mindestgr"osse 5 x 5 if( rValidate.Left() + 5 > rValidate.Right() ) - rValidate.Right() = rValidate.Left() + 5; + rValidate.SetRight( rValidate.Left() + 5 ); if( rValidate.Top() + 5 > rValidate.Bottom() ) - rValidate.Bottom() = rValidate.Top() + 5; + rValidate.SetBottom( rValidate.Top() + 5 ); } /************************************************************************* diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index bf61fe1cb8ac..c6890a2c6f29 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -638,19 +638,19 @@ void EmbeddedObjectRef::DrawPaintReplacement( const tools::Rectangle &rRect, con // We start with the default size and decrease 1-AppFont for( sal_uInt16 i = 8; i > 2; i-- ) { - aPt.X() = (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2; - aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2; + aPt.setX( (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2 ); + aPt.setY( (rRect.GetHeight() - pOut->GetTextHeight()) / 2 ); bool bTiny = false; if( aPt.X() < 0 ) { bTiny = true; - aPt.X() = 0; + aPt.setX( 0 ); } if( aPt.Y() < 0 ) { bTiny = true; - aPt.Y() = 0; + aPt.setY( 0 ); } if( bTiny ) { @@ -667,7 +667,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const tools::Rectangle &rRect, con long nWidth = rRect.GetWidth(); if(nHeight > 0 && nWidth > 0 && aBmp.GetSizePixel().Width() > 0) { - aPt.Y() = nHeight; + aPt.setY( nHeight ); Point aP = rRect.TopLeft(); Size aBmpSize = aBmp.GetSizePixel(); // fit bitmap in @@ -678,7 +678,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const tools::Rectangle &rRect, con // keep proportions long nH = nWidth * aBmpSize.Height() / aBmpSize.Width(); // center - aP.Y() += (nHeight - nH) / 2; + aP.AdjustY((nHeight - nH) / 2 ); nHeight = nH; } else @@ -687,7 +687,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const tools::Rectangle &rRect, con // keep proportions long nW = nHeight * aBmpSize.Width() / aBmpSize.Height(); // center - aP.X() += (nWidth - nW) / 2; + aP.AdjustX((nWidth - nW) / 2 ); nWidth = nW; } @@ -710,8 +710,8 @@ void EmbeddedObjectRef::DrawShading( const tools::Rectangle &rRect, OutputDevice pOut->SetLineColor( Color( COL_BLACK ) ); Size aPixSize = pOut->LogicToPixel( rRect.GetSize() ); - aPixSize.Width() -= 1; - aPixSize.Height() -= 1; + aPixSize.AdjustWidth( -1 ); + aPixSize.AdjustHeight( -1 ); Point aPixViewPos = pOut->LogicToPixel( rRect.TopLeft() ); sal_Int32 nMax = aPixSize.Width() + aPixSize.Height(); for( sal_Int32 i = 5; i < nMax; i += 5 ) diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index d304298b26af..3792f06996a6 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -776,10 +776,10 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize, if ( nFlags ) { if ( nFlags & IMAP_MIRROR_HORZ ) - aRelPoint.X() = rTotalSize.Width() - aRelPoint.X(); + aRelPoint.setX( rTotalSize.Width() - aRelPoint.X() ); if ( nFlags & IMAP_MIRROR_VERT ) - aRelPoint.Y() = rTotalSize.Height() - aRelPoint.Y(); + aRelPoint.setY( rTotalSize.Height() - aRelPoint.Y() ); } // walk over all objects and execute HitTest diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 17624b8917e5..7f6d83dee5a7 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -203,22 +203,22 @@ static void ImplSetParameterString( TransferableObjectDescriptor& rObjDesc, cons if( xMimeType->hasParameter( aWidthString ) ) { - rObjDesc.maSize.Width() = xMimeType->getParameterValue( aWidthString ).toInt32(); + rObjDesc.maSize.setWidth( xMimeType->getParameterValue( aWidthString ).toInt32() ); } if( xMimeType->hasParameter( aHeightString ) ) { - rObjDesc.maSize.Height() = xMimeType->getParameterValue( aHeightString ).toInt32(); + rObjDesc.maSize.setHeight( xMimeType->getParameterValue( aHeightString ).toInt32() ); } if( xMimeType->hasParameter( aPosXString ) ) { - rObjDesc.maDragStartPos.X() = xMimeType->getParameterValue( aPosXString ).toInt32(); + rObjDesc.maDragStartPos.setX( xMimeType->getParameterValue( aPosXString ).toInt32() ); } if( xMimeType->hasParameter( aPosYString ) ) { - rObjDesc.maDragStartPos.Y() = xMimeType->getParameterValue( aPosYString ).toInt32(); + rObjDesc.maDragStartPos.setY( xMimeType->getParameterValue( aPosYString ).toInt32() ); } } } diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index aadc04e61a88..df384d2c6a51 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -129,16 +129,16 @@ namespace svt { namespace table tools::Rectangle aContentArea( i_cellArea ); if ( i_impl.bUseGridLines ) { - --aContentArea.Right(); - --aContentArea.Bottom(); + aContentArea.AdjustRight( -1 ); + aContentArea.AdjustBottom( -1 ); } return aContentArea; } tools::Rectangle lcl_getTextRenderingArea( tools::Rectangle const & i_contentArea ) { tools::Rectangle aTextArea( i_contentArea ); - aTextArea.Left() += 2; aTextArea.Right() -= 2; - ++aTextArea.Top(); --aTextArea.Bottom(); + aTextArea.AdjustLeft(2 ); aTextArea.AdjustRight( -2 ); + aTextArea.AdjustTop( 1 ); aTextArea.AdjustBottom( -1 ); return aTextArea; } @@ -456,10 +456,10 @@ namespace svt { namespace table switch ( eHorzAlign ) { case HorizontalAlignment_CENTER: - imagePos.X() += ( i_context.aContentArea.GetWidth() - imageSize.Width() ) / 2; + imagePos.AdjustX(( i_context.aContentArea.GetWidth() - imageSize.Width() ) / 2 ); break; case HorizontalAlignment_RIGHT: - imagePos.X() = i_context.aContentArea.Right() - imageSize.Width(); + imagePos.setX( i_context.aContentArea.Right() - imageSize.Width() ); break; default: break; @@ -467,7 +467,7 @@ namespace svt { namespace table } else - imageSize.Width() = i_context.aContentArea.GetWidth(); + imageSize.setWidth( i_context.aContentArea.GetWidth() ); if ( i_context.aContentArea.GetHeight() > imageSize.Height() ) { @@ -475,17 +475,17 @@ namespace svt { namespace table switch ( eVertAlign ) { case VerticalAlignment_MIDDLE: - imagePos.Y() += ( i_context.aContentArea.GetHeight() - imageSize.Height() ) / 2; + imagePos.AdjustY(( i_context.aContentArea.GetHeight() - imageSize.Height() ) / 2 ); break; case VerticalAlignment_BOTTOM: - imagePos.Y() = i_context.aContentArea.Bottom() - imageSize.Height(); + imagePos.setY( i_context.aContentArea.Bottom() - imageSize.Height() ); break; default: break; } } else - imageSize.Height() = i_context.aContentArea.GetHeight() - 1; + imageSize.setHeight( i_context.aContentArea.GetHeight() - 1 ); DrawImageFlags const nStyle = m_pImpl->rModel.isEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable; i_context.rDevice.DrawImage( imagePos, imageSize, i_image, nStyle ); } diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index dbbd1d3db6fa..8c493e12c787 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -503,7 +503,7 @@ namespace svt { namespace table // determine the right-most border of the last column which is // at least partially visible - aArea.Right() = m_nRowHeaderWidthPixel; + aArea.SetRight( m_nRowHeaderWidthPixel ); if ( !m_aColumnWidths.empty() ) { // the number of pixels which are scrolled out of the left hand @@ -513,7 +513,7 @@ namespace svt { namespace table ColumnPositions::const_reverse_iterator loop = m_aColumnWidths.rbegin(); do { - aArea.Right() = loop->getEnd() - nScrolledOutLeft + m_nRowHeaderWidthPixel; + aArea.SetRight( loop->getEnd() - nScrolledOutLeft + m_nRowHeaderWidthPixel ); ++loop; } while ( ( loop != m_aColumnWidths.rend() ) @@ -521,13 +521,13 @@ namespace svt { namespace table ); } // so far, aArea.Right() denotes the first pixel *after* the cell area - --aArea.Right(); + aArea.AdjustRight( -1 ); // determine the last row which is at least partially visible - aArea.Bottom() = + aArea.SetBottom( m_nColHeaderHeightPixel + impl_getVisibleRows( true ) * m_nRowHeightPixel - - 1; + - 1 ); return aArea; } @@ -536,8 +536,8 @@ namespace svt { namespace table tools::Rectangle TableControl_Impl::impl_getAllVisibleDataCellArea() const { tools::Rectangle aArea( impl_getAllVisibleCellsArea() ); - aArea.Left() = m_nRowHeaderWidthPixel; - aArea.Top() = m_nColHeaderHeightPixel; + aArea.SetLeft( m_nRowHeaderWidthPixel ); + aArea.SetTop( m_nColHeaderHeightPixel ); return aArea; } @@ -969,8 +969,8 @@ namespace svt { namespace table // determine the playground for the data cells (excluding headers) // TODO: what if the control is smaller than needed for the headers/scrollbars? tools::Rectangle aDataCellPlayground( Point( 0, 0 ), m_rAntiImpl.GetOutputSizePixel() ); - aDataCellPlayground.Left() = m_nRowHeaderWidthPixel; - aDataCellPlayground.Top() = m_nColHeaderHeightPixel; + aDataCellPlayground.SetLeft( m_nRowHeaderWidthPixel ); + aDataCellPlayground.SetTop( m_nColHeaderHeightPixel ); OSL_ENSURE( ( m_nRowCount == m_pModel->getRowCount() ) && ( m_nColumnCount == m_pModel->getColumnCount() ), "TableControl_Impl::impl_ni_relayout: how is this expected to work with invalid data?" ); @@ -985,7 +985,7 @@ namespace svt { namespace table bool bFirstRoundVScrollNeed = false; if ( bNeedVerticalScrollbar ) { - aDataCellPlayground.Right() -= nScrollbarMetrics; + aDataCellPlayground.AdjustRight( -nScrollbarMetrics ); bFirstRoundVScrollNeed = true; } @@ -994,7 +994,7 @@ namespace svt { namespace table m_nLeftColumn, eHorzScrollbar, aDataCellPlayground.GetWidth(), nAllColumnsWidth ); if ( bNeedHorizontalScrollbar ) { - aDataCellPlayground.Bottom() -= nScrollbarMetrics; + aDataCellPlayground.AdjustBottom( -nScrollbarMetrics ); // now that we just found that we need a horizontal scrollbar, // the need for a vertical one may have changed, since the horizontal @@ -1006,7 +1006,7 @@ namespace svt { namespace table m_nTopRow, eVertScrollbar, aDataCellPlayground.GetHeight(), m_nRowHeightPixel * m_nRowCount ); if ( bNeedVerticalScrollbar ) { - aDataCellPlayground.Right() -= nScrollbarMetrics; + aDataCellPlayground.AdjustRight( -nScrollbarMetrics ); } } } @@ -1205,13 +1205,13 @@ namespace svt { namespace table if (m_pModel->hasRowHeaders()) { aRowHeaderArea = aAllCellsWithHeaders; - aRowHeaderArea.Right() = m_nRowHeaderWidthPixel - 1; + aRowHeaderArea.SetRight( m_nRowHeaderWidthPixel - 1 ); TableSize const nVisibleRows = impl_getVisibleRows(true); TableSize nActualRows = nVisibleRows; if (m_nTopRow + nActualRows > m_nRowCount) nActualRows = m_nRowCount - m_nTopRow; - aRowHeaderArea.Bottom() = m_nColHeaderHeightPixel + m_nRowHeightPixel * nActualRows - 1; + aRowHeaderArea.SetBottom( m_nColHeaderHeightPixel + m_nRowHeightPixel * nActualRows - 1 ); pRenderer->PaintHeaderArea(rRenderContext, aRowHeaderArea, false, true, rStyle); // Note that strictly, aRowHeaderArea also contains the intersection between column @@ -1819,33 +1819,33 @@ namespace svt { namespace table tools::Rectangle const aAllCells( impl_getAllVisibleCellsArea() ); tools::Rectangle aInvalidateRect; - aInvalidateRect.Left() = aAllCells.Left(); - aInvalidateRect.Right() = aAllCells.Right(); + aInvalidateRect.SetLeft( aAllCells.Left() ); + aInvalidateRect.SetRight( aAllCells.Right() ); // if only one row is selected if ( _nPrevRow == _nCurRow ) { tools::Rectangle aCellRect; impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect ); - aInvalidateRect.Top() = aCellRect.Top(); - aInvalidateRect.Bottom() = aCellRect.Bottom(); + aInvalidateRect.SetTop( aCellRect.Top() ); + aInvalidateRect.SetBottom( aCellRect.Bottom() ); } //if the region is above the current row else if(_nPrevRow < _nCurRow ) { tools::Rectangle aCellRect; impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect ); - aInvalidateRect.Top() = aCellRect.Top(); + aInvalidateRect.SetTop( aCellRect.Top() ); impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect ); - aInvalidateRect.Bottom() = aCellRect.Bottom(); + aInvalidateRect.SetBottom( aCellRect.Bottom() ); } //if the region is beneath the current row else { tools::Rectangle aCellRect; impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect ); - aInvalidateRect.Top() = aCellRect.Top(); + aInvalidateRect.SetTop( aCellRect.Top() ); impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect ); - aInvalidateRect.Bottom() = aCellRect.Bottom(); + aInvalidateRect.SetBottom( aCellRect.Bottom() ); } invalidateRect(aInvalidateRect); @@ -1884,7 +1884,7 @@ namespace svt { namespace table } if ( i_lastRow == ROW_INVALID ) - aInvalidateRect.Bottom() = m_pDataWindow->GetOutputSizePixel().Height(); + aInvalidateRect.SetBottom( m_pDataWindow->GetOutputSizePixel().Height() ); invalidateRect(aInvalidateRect); } diff --git a/svtools/source/table/tablegeometry.cxx b/svtools/source/table/tablegeometry.cxx index 1c07ef4411aa..f7376a14907c 100644 --- a/svtools/source/table/tablegeometry.cxx +++ b/svtools/source/table/tablegeometry.cxx @@ -37,8 +37,8 @@ namespace svt { namespace table { if ( m_nRowPos == ROW_COL_HEADERS ) { - m_aRect.Top() = 0; - m_aRect.Bottom() = m_rControl.m_nColHeaderHeightPixel - 1; + m_aRect.SetTop( 0 ); + m_aRect.SetBottom( m_rControl.m_nColHeaderHeightPixel - 1 ); } else { @@ -51,8 +51,8 @@ namespace svt { namespace table { if ( ( m_nRowPos >= m_rControl.m_nTopRow ) && impl_isValidRow( m_nRowPos ) ) { - m_aRect.Top() = m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel; - m_aRect.Bottom() = m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1; + m_aRect.SetTop( m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel ); + m_aRect.SetBottom( m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1 ); } else m_aRect.SetEmpty(); @@ -93,8 +93,8 @@ namespace svt { namespace table { if ( m_nColPos == COL_ROW_HEADERS ) { - m_aRect.Left() = 0; - m_aRect.Right() = m_rControl.m_nRowHeaderWidthPixel - 1; + m_aRect.SetLeft( 0 ); + m_aRect.SetRight( m_rControl.m_nRowHeaderWidthPixel - 1 ); } else { @@ -108,12 +108,12 @@ namespace svt { namespace table ColPos nLeftColumn = m_rControl.m_nLeftColumn; if ( ( m_nColPos >= nLeftColumn ) && impl_isValidColumn( m_nColPos ) ) { - m_aRect.Left() = m_rControl.m_nRowHeaderWidthPixel; + m_aRect.SetLeft( m_rControl.m_nRowHeaderWidthPixel ); // TODO: take into account any possibly frozen columns for ( ColPos col = nLeftColumn; col < m_nColPos; ++col ) - m_aRect.Left() += m_rControl.m_aColumnWidths[ col ].getWidth(); - m_aRect.Right() = m_aRect.Left() + m_rControl.m_aColumnWidths[ m_nColPos ].getWidth() - 1; + m_aRect.AdjustLeft(m_rControl.m_aColumnWidths[ col ].getWidth() ); + m_aRect.SetRight( m_aRect.Left() + m_rControl.m_aColumnWidths[ m_nColPos ].getWidth() - 1 ); } else m_aRect.SetEmpty(); @@ -137,8 +137,8 @@ namespace svt { namespace table { if ( impl_isValidColumn( ++m_nColPos ) ) { - m_aRect.Left() = m_aRect.Right() + 1; - m_aRect.Right() += m_rControl.m_aColumnWidths[ m_nColPos ].getWidth(); + m_aRect.SetLeft( m_aRect.Right() + 1 ); + m_aRect.AdjustRight(m_rControl.m_aColumnWidths[ m_nColPos ].getWidth() ); } else m_aRect.SetEmpty(); diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 36ef421c39ed..4c068748fab5 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1503,8 +1503,8 @@ void UnoTreeListItem::Paint( { rRenderContext.DrawImage(aPos, maImage, rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable); int nWidth = maImage.GetSizePixel().Width() + 6; - aPos.X() += nWidth; - aSize.Width() -= nWidth; + aPos.AdjustX(nWidth ); + aSize.AdjustWidth( -nWidth ); } rRenderContext.DrawText(tools::Rectangle(aPos,aSize),maText, rDev.IsEnabled() ? DrawTextFlags::NONE : DrawTextFlags::Disable); } @@ -1549,9 +1549,9 @@ void UnoTreeListItem::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry const Size aTextSize(pView->GetTextWidth( maText ), pView->GetTextHeight()); if( pViewData->maSize.Width() ) { - pViewData->maSize.Width() += 6 + aTextSize.Width(); + pViewData->maSize.AdjustWidth(6 + aTextSize.Width() ); if( pViewData->maSize.Height() < aTextSize.Height() ) - pViewData->maSize.Height() = aTextSize.Height(); + pViewData->maSize.setHeight( aTextSize.Height() ); } else { diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index 948fe4d00e60..27b2c7180f40 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -742,7 +742,7 @@ css::awt::Size VCLXFileControl::getMinimumSize() if ( pControl ) { Size aTmpSize = pControl->GetEdit().CalcMinimumSize(); - aTmpSize.Width() += pControl->GetButton().CalcMinimumSize().Width(); + aTmpSize.AdjustWidth(pControl->GetButton().CalcMinimumSize().Width() ); aSz = AWTSize(pControl->CalcWindowSize( aTmpSize )); } return aSz; diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx index 3ea57fbd45ce..f3b92c69b305 100644 --- a/svtools/source/urlobj/inetimg.cxx +++ b/svtools/source/urlobj/inetimg.cxx @@ -68,10 +68,10 @@ bool INetImage::Read( SvStream& rIStm, SotClipboardFormatId nFormat ) aTargetURL = sINetImg.getToken( 0, TOKEN_SEPARATOR, nStart ); aTargetFrame = sINetImg.getToken( 0, TOKEN_SEPARATOR, nStart ); /*aAlternateText =*/ sINetImg.getToken( 0, TOKEN_SEPARATOR, nStart ); - aSizePixel.Width() = sINetImg.getToken( 0, TOKEN_SEPARATOR, - nStart ).toInt32(); - aSizePixel.Height() = sINetImg.getToken( 0, TOKEN_SEPARATOR, - nStart ).toInt32(); + aSizePixel.setWidth( sINetImg.getToken( 0, TOKEN_SEPARATOR, + nStart ).toInt32() ); + aSizePixel.setHeight( sINetImg.getToken( 0, TOKEN_SEPARATOR, + nStart ).toInt32() ); bRet = !sINetImg.isEmpty(); } break; @@ -100,8 +100,8 @@ bool INetImage::Read( SvStream& rIStm, SotClipboardFormatId nFormat ) nFilePos = rIStm.Tell(); // skip over iSize (int), bIsMao ( sal_Bool ) alignment of 4 !!!! rIStm.SeekRel( 8 ); - rIStm.ReadInt32( nVal ); aSizePixel.Width() = nVal; - rIStm.ReadInt32( nVal ); aSizePixel.Height() = nVal; + rIStm.ReadInt32( nVal ); aSizePixel.setWidth( nVal ); + rIStm.ReadInt32( nVal ); aSizePixel.setHeight( nVal ); // skip over iHSpace, iVSpace, iBorder, iLowResOffset rIStm.SeekRel( 3 * sizeof( sal_Int32 ) + sizeof( int ) ); rIStm.ReadInt32( nAltOffset ); |