Kaydet (Commit) bddd6c77 authored tarafından Noel Grandin's avatar Noel Grandin

Revert "loplugin:changetoolsgen in avmedia..basic" and reapply plugin

because I
(a) forgot to insert parentheses which changes the meaning of some expressions and
(b) I now use the AdjustFoo calls when changing unary operations, which reads much better

This reverts commit 1adb1a32.

Change-Id: I52924b35008c8e4b44c8a6b6657cc3a1ac513886
Reviewed-on: https://gerrit.libreoffice.org/49848Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst eb5563e7
...@@ -71,22 +71,22 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl ...@@ -71,22 +71,22 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpTimeSlider->SetEndSlideHdl( LINK( this, MediaControl, implTimeEndHdl ) ); mpTimeSlider->SetEndSlideHdl( LINK( this, MediaControl, implTimeEndHdl ) );
mpTimeSlider->SetSizePixel( Size( 128, mpPlayToolBox->GetSizePixel().Height() ) ); mpTimeSlider->SetSizePixel( Size( 128, mpPlayToolBox->GetSizePixel().Height() ) );
mpTimeSlider->Show(); mpTimeSlider->Show();
maMinSize.Width() += mpTimeSlider->GetSizePixel().Width(); maMinSize.AdjustWidth(mpTimeSlider->GetSizePixel().Width() );
const OUString aTimeText( " 00:00:00/00:00:00 " ); const OUString aTimeText( " 00:00:00/00:00:00 " );
mpTimeEdit->SetSizePixel( Size( mpTimeEdit->GetTextWidth( aTimeText ) + 8, mpPlayToolBox->GetSizePixel().Height() ) ); mpTimeEdit->SetSizePixel( Size( mpTimeEdit->GetTextWidth( aTimeText ) + 8, mpPlayToolBox->GetSizePixel().Height() ) );
mpTimeEdit->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() ); mpTimeEdit->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
maMinSize.Width() += mpTimeEdit->GetSizePixel().Width(); maMinSize.AdjustWidth(mpTimeEdit->GetSizePixel().Width() );
mpMuteToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) ); mpMuteToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
mpMuteToolBox->SetSizePixel( mpMuteToolBox->CalcWindowSizePixel() ); mpMuteToolBox->SetSizePixel( mpMuteToolBox->CalcWindowSizePixel() );
mpMuteToolBox->Show(); mpMuteToolBox->Show();
maMinSize.Width() += mpMuteToolBox->GetSizePixel().Width(); maMinSize.AdjustWidth(mpMuteToolBox->GetSizePixel().Width() );
mpVolumeSlider->SetSlideHdl( LINK( this, MediaControl, implVolumeHdl ) ); mpVolumeSlider->SetSlideHdl( LINK( this, MediaControl, implVolumeHdl ) );
mpVolumeSlider->SetSizePixel( Size( 48, mpPlayToolBox->GetSizePixel().Height() ) ); mpVolumeSlider->SetSizePixel( Size( 48, mpPlayToolBox->GetSizePixel().Height() ) );
mpVolumeSlider->Show(); mpVolumeSlider->Show();
maMinSize.Width() += mpVolumeSlider->GetSizePixel().Width(); maMinSize.AdjustWidth(mpVolumeSlider->GetSizePixel().Width() );
mpZoomListBox->SetSizePixel( Size( mpTimeEdit->GetSizePixel().Width(), 260 ) ); mpZoomListBox->SetSizePixel( Size( mpTimeEdit->GetSizePixel().Width(), 260 ) );
mpZoomListBox->SetSelectHdl( LINK( this, MediaControl, implZoomSelectHdl ) ); mpZoomListBox->SetSelectHdl( LINK( this, MediaControl, implZoomSelectHdl ) );
...@@ -98,7 +98,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl ...@@ -98,7 +98,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpZoomToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) ); mpZoomToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
mpZoomToolBox->SetSizePixel( mpZoomToolBox->CalcWindowSizePixel() ); mpZoomToolBox->SetSizePixel( mpZoomToolBox->CalcWindowSizePixel() );
mpZoomToolBox->Show(); mpZoomToolBox->Show();
maMinSize.Width() += mpZoomToolBox->GetSizePixel().Width(); maMinSize.AdjustWidth(mpZoomToolBox->GetSizePixel().Width() );
const OUString aMediaPath( AvmResId( AVMEDIA_MEDIA_PATH_DEFAULT ) ); const OUString aMediaPath( AvmResId( AVMEDIA_MEDIA_PATH_DEFAULT ) );
mpMediaPath->SetText(aMediaPath); mpMediaPath->SetText(aMediaPath);
...@@ -106,12 +106,12 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl ...@@ -106,12 +106,12 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aMediaPath ) + 400, mpPlayToolBox->GetSizePixel().Height() ) ); // maybe extend the no. 400 to span the screen width mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aMediaPath ) + 400, mpPlayToolBox->GetSizePixel().Height() ) ); // maybe extend the no. 400 to span the screen width
mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() ); mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
mpMediaPath->Show(); mpMediaPath->Show();
maMinSize.Width() += mpMediaPath->GetSizePixel().Width(); maMinSize.AdjustWidth(mpMediaPath->GetSizePixel().Width() );
if( meControlStyle == MEDIACONTROLSTYLE_MULTILINE ) if( meControlStyle == MEDIACONTROLSTYLE_MULTILINE )
{ {
maMinSize.Width() = 256; maMinSize.setWidth( 256 );
maMinSize.Height() = ( maMinSize.Height() << 1 ) + AVMEDIA_CONTROLOFFSET; maMinSize.setHeight( ( maMinSize.Height() << 1 ) + AVMEDIA_CONTROLOFFSET );
mpZoomToolBox->SetBackground(); mpZoomToolBox->SetBackground();
mpZoomToolBox->SetPaintTransparent( true ); mpZoomToolBox->SetPaintTransparent( true );
} }
...@@ -178,7 +178,7 @@ void MediaControl::UpdateURLField(MediaItem const & tempItem) ...@@ -178,7 +178,7 @@ void MediaControl::UpdateURLField(MediaItem const & tempItem)
mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aURL ) + 8, mpPlayToolBox->GetSizePixel().Height() ) ); mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aURL ) + 8, mpPlayToolBox->GetSizePixel().Height() ) );
mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() ); mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
mpMediaPath->Show(); mpMediaPath->Show();
maMinSize.Width() += mpMediaPath->GetSizePixel().Width(); maMinSize.AdjustWidth(mpMediaPath->GetSizePixel().Width() );
} }
void MediaControl::Resize() void MediaControl::Resize()
...@@ -199,22 +199,22 @@ void MediaControl::Resize() ...@@ -199,22 +199,22 @@ void MediaControl::Resize()
mpPlayToolBox->SetPosSizePixel( aPos, mpPlayToolBox->GetSizePixel() ); mpPlayToolBox->SetPosSizePixel( aPos, mpPlayToolBox->GetSizePixel() );
aPos.X() += nPlayToolBoxWidth; aPos.AdjustX(nPlayToolBoxWidth );
mpTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) ); mpTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
aPos.X() += nTimeSliderWidth + AVMEDIA_CONTROLOFFSET; aPos.AdjustX(nTimeSliderWidth + AVMEDIA_CONTROLOFFSET );
mpTimeEdit->SetPosSizePixel( aPos, mpTimeEdit->GetSizePixel() ); mpTimeEdit->SetPosSizePixel( aPos, mpTimeEdit->GetSizePixel() );
aPos.X() += nTimeEditWidth + AVMEDIA_CONTROLOFFSET; aPos.AdjustX(nTimeEditWidth + AVMEDIA_CONTROLOFFSET );
mpMuteToolBox->SetPosSizePixel( aPos, mpMuteToolBox->GetSizePixel() ); mpMuteToolBox->SetPosSizePixel( aPos, mpMuteToolBox->GetSizePixel() );
aPos.X() += nMuteToolBoxWidth; aPos.AdjustX(nMuteToolBoxWidth );
mpVolumeSlider->SetPosSizePixel( aPos, mpVolumeSlider->GetSizePixel() ); mpVolumeSlider->SetPosSizePixel( aPos, mpVolumeSlider->GetSizePixel() );
aPos.X() += nVolumeSliderWidth + AVMEDIA_CONTROLOFFSET; aPos.AdjustX(nVolumeSliderWidth + AVMEDIA_CONTROLOFFSET );
mpZoomToolBox->SetPosSizePixel( aPos, mpZoomToolBox->GetSizePixel() ); mpZoomToolBox->SetPosSizePixel( aPos, mpZoomToolBox->GetSizePixel() );
aPos.X() += nZoomToolBoxWidth + AVMEDIA_CONTROLOFFSET; aPos.AdjustX(nZoomToolBoxWidth + AVMEDIA_CONTROLOFFSET );
mpMediaPath->SetPosSizePixel( aPos, mpMediaPath->GetSizePixel() ); mpMediaPath->SetPosSizePixel( aPos, mpMediaPath->GetSizePixel() );
} }
else else
...@@ -223,20 +223,20 @@ void MediaControl::Resize() ...@@ -223,20 +223,20 @@ void MediaControl::Resize()
mpTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) ); mpTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
aPos.X() += nTimeSliderWidth + AVMEDIA_CONTROLOFFSET; aPos.AdjustX(nTimeSliderWidth + AVMEDIA_CONTROLOFFSET );
mpTimeEdit->SetPosSizePixel( aPos, mpTimeEdit->GetSizePixel() ); mpTimeEdit->SetPosSizePixel( aPos, mpTimeEdit->GetSizePixel() );
aPos.X() = 0; aPos.setX( 0 );
aPos.Y() += nTimeSliderHeight + AVMEDIA_CONTROLOFFSET; aPos.AdjustY(nTimeSliderHeight + AVMEDIA_CONTROLOFFSET );
mpPlayToolBox->SetPosSizePixel( aPos, mpPlayToolBox->GetSizePixel() ); mpPlayToolBox->SetPosSizePixel( aPos, mpPlayToolBox->GetSizePixel() );
aPos.X() = GetSizePixel().Width() - nVolumeSliderWidth - nMuteToolBoxWidth - nZoomToolBoxWidth - AVMEDIA_CONTROLOFFSET; aPos.setX( GetSizePixel().Width() - nVolumeSliderWidth - nMuteToolBoxWidth - nZoomToolBoxWidth - AVMEDIA_CONTROLOFFSET );
mpMuteToolBox->SetPosSizePixel( aPos, mpMuteToolBox->GetSizePixel() ); mpMuteToolBox->SetPosSizePixel( aPos, mpMuteToolBox->GetSizePixel() );
aPos.X() += nMuteToolBoxWidth; aPos.AdjustX(nMuteToolBoxWidth );
mpVolumeSlider->SetPosSizePixel( aPos, mpVolumeSlider->GetSizePixel() ); mpVolumeSlider->SetPosSizePixel( aPos, mpVolumeSlider->GetSizePixel() );
aPos.X() = GetSizePixel().Width() - nZoomToolBoxWidth; aPos.setX( GetSizePixel().Width() - nZoomToolBoxWidth );
mpZoomToolBox->SetPosSizePixel( aPos, mpZoomToolBox->GetSizePixel() ); mpZoomToolBox->SetPosSizePixel( aPos, mpZoomToolBox->GetSizePixel() );
} }
} }
......
...@@ -131,7 +131,7 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, sal_uInt16 nCurPage, ...@@ -131,7 +131,7 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, sal_uInt16 nCurPage,
{ {
aFont.SetWeight( WEIGHT_NORMAL ); aFont.SetWeight( WEIGHT_NORMAL );
pPrinter->SetFont( aFont ); pPrinter->SetFont( aFont );
aPos.setX( aPos.X() + pPrinter->GetTextWidth( rTitle ) ); aPos.AdjustX(pPrinter->GetTextWidth( rTitle ) );
if( bOutput ) if( bOutput )
{ {
...@@ -810,8 +810,8 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) ...@@ -810,8 +810,8 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
} }
Size aPaperSz = pPrinter->GetOutputSize(); Size aPaperSz = pPrinter->GetOutputSize();
aPaperSz.setWidth( aPaperSz.Width() - (Print::nLeftMargin + Print::nRightMargin) ); aPaperSz.AdjustWidth( -(Print::nLeftMargin + Print::nRightMargin) );
aPaperSz.setHeight( aPaperSz.Height() - (Print::nTopMargin + Print::nBottomMargin) ); aPaperSz.AdjustHeight( -(Print::nTopMargin + Print::nBottomMargin) );
// nLinepPage is not correct if there's a line break // nLinepPage is not correct if there's a line break
sal_Int32 nLinespPage = aPaperSz.Height()/nLineHeight; sal_Int32 nLinespPage = aPaperSz.Height()/nLineHeight;
...@@ -835,7 +835,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) ...@@ -835,7 +835,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
sal_Int32 nBeginIndex = nLine*nCharspLine; sal_Int32 nBeginIndex = nLine*nCharspLine;
sal_Int32 nCopyCount = std::min<sal_Int32>(nCharspLine, aLine.getLength()-nBeginIndex); sal_Int32 nCopyCount = std::min<sal_Int32>(nCharspLine, aLine.getLength()-nBeginIndex);
OUString aTmpLine = aLine.copy(nBeginIndex, nCopyCount); OUString aTmpLine = aLine.copy(nBeginIndex, nCopyCount);
aPos.setY( aPos.Y() + nLineHeight ); aPos.AdjustY(nLineHeight );
if ( aPos.Y() > ( aPaperSz.Height() + Print::nTopMargin ) ) if ( aPos.Y() > ( aPaperSz.Height() + Print::nTopMargin ) )
{ {
nCurPage++; nCurPage++;
...@@ -845,7 +845,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) ...@@ -845,7 +845,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
if( nCurPage-1 == nPrintPage ) if( nCurPage-1 == nPrintPage )
pPrinter->DrawText( aPos, aTmpLine ); pPrinter->DrawText( aPos, aTmpLine );
} }
aPos.setY( aPos.Y() + 10 ); // nParaSpace aPos.AdjustY(10 ); // nParaSpace
} }
pPrinter->SetFont( aOldFont ); pPrinter->SetFont( aOldFont );
......
...@@ -372,8 +372,8 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt ) ...@@ -372,8 +372,8 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
{ {
aTopLeft = GetEditView()->GetTextEngine()->PaMtoEditCursor( aStartOfWord ).BottomLeft(); aTopLeft = GetEditView()->GetTextEngine()->PaMtoEditCursor( aStartOfWord ).BottomLeft();
aTopLeft = GetEditView()->GetWindowPos( aTopLeft ); aTopLeft = GetEditView()->GetWindowPos( aTopLeft );
aTopLeft.setX( aTopLeft.X() + 5 ); aTopLeft.AdjustX(5 );
aTopLeft.setY( aTopLeft.Y() + 5 ); aTopLeft.AdjustY(5 );
aTopLeft = OutputToScreenPixel( aTopLeft ); aTopLeft = OutputToScreenPixel( aTopLeft );
} }
} }
...@@ -1571,8 +1571,8 @@ WatchWindow::WatchWindow (Layout* pParent) ...@@ -1571,8 +1571,8 @@ WatchWindow::WatchWindow (Layout* pParent)
aRemoveWatchButton->SetModeImage(Image(BitmapEx(RID_BMP_REMOVEWATCH))); aRemoveWatchButton->SetModeImage(Image(BitmapEx(RID_BMP_REMOVEWATCH)));
aRemoveWatchButton->SetQuickHelpText(IDEResId(RID_STR_REMOVEWATCHTIP)); aRemoveWatchButton->SetQuickHelpText(IDEResId(RID_STR_REMOVEWATCHTIP));
Size aSz( aRemoveWatchButton->GetModeImage().GetSizePixel() ); Size aSz( aRemoveWatchButton->GetModeImage().GetSizePixel() );
aSz.setWidth( aSz.Width() + 6 ); aSz.AdjustWidth(6 );
aSz.setHeight( aSz.Height() + 6 ); aSz.AdjustHeight(6 );
aRemoveWatchButton->SetSizePixel( aSz ); aRemoveWatchButton->SetSizePixel( aSz );
aRemoveWatchButton->Show(); aRemoveWatchButton->Show();
...@@ -1656,7 +1656,7 @@ void WatchWindow::Resize() ...@@ -1656,7 +1656,7 @@ void WatchWindow::Resize()
if ( aBoxSz.Height() < 4 ) if ( aBoxSz.Height() < 4 )
aBoxSz.setHeight( 0 ); aBoxSz.setHeight( 0 );
aBoxSz.setHeight( aBoxSz.Height() - nHeaderBarHeight ); aBoxSz.AdjustHeight( -nHeaderBarHeight );
aTreeListBox->SetSizePixel( aBoxSz ); aTreeListBox->SetSizePixel( aBoxSz );
aTreeListBox->GetHScroll()->SetPageSize( aTreeListBox->GetHScroll()->GetVisibleSize() ); aTreeListBox->GetHScroll()->SetPageSize( aTreeListBox->GetHScroll()->GetVisibleSize() );
...@@ -1991,8 +1991,8 @@ void ComplexEditorWindow::Resize() ...@@ -1991,8 +1991,8 @@ void ComplexEditorWindow::Resize()
{ {
Size aOutSz = GetOutputSizePixel(); Size aOutSz = GetOutputSizePixel();
Size aSz(aOutSz); Size aSz(aOutSz);
aSz.setWidth( aSz.Width() - 2*DWBORDER ); aSz.AdjustWidth( -(2*DWBORDER) );
aSz.setHeight( aSz.Height() - 2*DWBORDER ); aSz.AdjustHeight( -(2*DWBORDER) );
long nBrkWidth = 20; long nBrkWidth = 20;
long nSBWidth = aEWVScrollBar->GetSizePixel().Width(); long nSBWidth = aEWVScrollBar->GetSizePixel().Width();
...@@ -2844,12 +2844,12 @@ void CodeCompleteWindow::ResizeAndPositionListBox() ...@@ -2844,12 +2844,12 @@ void CodeCompleteWindow::ResizeAndPositionListBox()
if( aVisArea.TopRight().getY() + aPos.getY() + aSize.getHeight() > aBottomPoint.getY() ) if( aVisArea.TopRight().getY() + aPos.getY() + aSize.getHeight() > aBottomPoint.getY() )
{//clipped at the bottom: move it up {//clipped at the bottom: move it up
const long& nParentFontHeight = pParent->GetEditEngine()->GetFont().GetFontHeight(); //parent's font (in the IDE): needed for height const long& nParentFontHeight = pParent->GetEditEngine()->GetFont().GetFontHeight(); //parent's font (in the IDE): needed for height
aPos.setY( aPos.Y() - aSize.getHeight() + nParentFontHeight + nCursorPad ); aPos.AdjustY( -(aSize.getHeight() + nParentFontHeight + nCursorPad) );
} }
if( aVisArea.TopLeft().getX() + aPos.getX() + aSize.getWidth() > aBottomPoint.getX() ) if( aVisArea.TopLeft().getX() + aPos.getX() + aSize.getWidth() > aBottomPoint.getX() )
{//clipped at the right side, move it a bit left {//clipped at the right side, move it a bit left
aPos.setX( aPos.X() - aSize.getWidth() + aVisArea.TopLeft().getX() ); aPos.AdjustX( -(aSize.getWidth() + aVisArea.TopLeft().getX()) );
} }
//set the position //set the position
SetPosPixel( aPos ); SetPosPixel( aPos );
......
...@@ -1247,11 +1247,11 @@ void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize ) ...@@ -1247,11 +1247,11 @@ void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
Size aSz( rSize ); Size aSz( rSize );
Size aScrollBarBoxSz( aScrollBarBox->GetSizePixel() ); Size aScrollBarBoxSz( aScrollBarBox->GetSizePixel() );
aSz.setHeight( aSz.Height() - aScrollBarBoxSz.Height() ); aSz.AdjustHeight( -(aScrollBarBoxSz.Height()) );
aSz.setHeight( aSz.Height() - aTabBarSize.Height() ); aSz.AdjustHeight( -(aTabBarSize.Height()) );
Size aOutSz( aSz ); Size aOutSz( aSz );
aSz.setWidth( aSz.Width() - aScrollBarBoxSz.Width() ); aSz.AdjustWidth( -(aScrollBarBoxSz.Width()) );
aScrollBarBox->SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) ); aScrollBarBox->SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) );
aVScrollBar->SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) ); aVScrollBar->SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) );
aHScrollBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width(), aScrollBarBoxSz.Height() ) ); aHScrollBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width(), aScrollBarBoxSz.Height() ) );
......
...@@ -58,8 +58,8 @@ ObjectCatalog::ObjectCatalog (vcl::Window* pParent) ...@@ -58,8 +58,8 @@ ObjectCatalog::ObjectCatalog (vcl::Window* pParent)
Point aPos = rParent.OutputToScreenPixel(Point(0, 0)); Point aPos = rParent.OutputToScreenPixel(Point(0, 0));
Size const aParentSize = rParent.GetSizePixel(); Size const aParentSize = rParent.GetSizePixel();
Size const aSize = GetSizePixel(); Size const aSize = GetSizePixel();
aPos.setX( aPos.X() + (aParentSize.Width() - aSize.Width()) / 2 ); aPos.AdjustX((aParentSize.Width() - aSize.Width()) / 2 );
aPos.setY( aPos.Y() + (aParentSize.Height() - aSize.Height()) / 2 ); aPos.AdjustY((aParentSize.Height() - aSize.Height()) / 2 );
SetPosPixel(aPos); SetPosPixel(aPos);
} }
......
...@@ -493,8 +493,8 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle ...@@ -493,8 +493,8 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
// align with grid // align with grid
Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY())); Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY()));
aSize.setWidth( aSize.Width() - aSize.Width() % aGridSize_.Width() ); aSize.AdjustWidth( -(aSize.Width() % aGridSize_.Width()) );
aSize.setHeight( aSize.Height() - aSize.Height() % aGridSize_.Height() ); aSize.AdjustHeight( -(aSize.Height() % aGridSize_.Height()) );
Point aPos; Point aPos;
Size aOutSize = rRenderContext.GetOutputSize(); Size aOutSize = rRenderContext.GetOutputSize();
...@@ -502,16 +502,16 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle ...@@ -502,16 +502,16 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
aPos.setY( (aOutSize.Height()>>1) - (aSize.Height()>>1) ); aPos.setY( (aOutSize.Height()>>1) - (aSize.Height()>>1) );
// align with grid // align with grid
aPos.setX( aPos.X() - aPos.X() % aGridSize_.Width() ); aPos.AdjustX( -(aPos.X() % aGridSize_.Width()) );
aPos.setY( aPos.Y() - aPos.Y() % aGridSize_.Height() ); aPos.AdjustY( -(aPos.Y() % aGridSize_.Height()) );
// don't put in the corner // don't put in the corner
Point aMinPos = rRenderContext.PixelToLogic( Point( 30, 20 ) ); Point aMinPos = rRenderContext.PixelToLogic( Point( 30, 20 ) );
if( (aPos.X() < aMinPos.X()) || (aPos.Y() < aMinPos.Y()) ) if( (aPos.X() < aMinPos.X()) || (aPos.Y() < aMinPos.Y()) )
{ {
aPos = aMinPos; aPos = aMinPos;
aPos.setX( aPos.X() - aPos.X() % aGridSize_.Width() ); aPos.AdjustX( -(aPos.X() % aGridSize_.Width()) );
aPos.setY( aPos.Y() - aPos.Y() % aGridSize_.Height() ); aPos.AdjustY( -(aPos.Y() % aGridSize_.Height()) );
} }
// set dialog position and size // set dialog position and size
...@@ -617,8 +617,8 @@ void DlgEditor::CreateDefaultObject() ...@@ -617,8 +617,8 @@ void DlgEditor::CreateDefaultObject()
// set position and size // set position and size
Size aSize = rWindow.PixelToLogic( Size( 96, 24 ) ); Size aSize = rWindow.PixelToLogic( Size( 96, 24 ) );
Point aPoint = pDlgEdForm->GetSnapRect().Center(); Point aPoint = pDlgEdForm->GetSnapRect().Center();
aPoint.setX( aPoint.X() - aSize.Width() / 2 ); aPoint.AdjustX( -(aSize.Width() / 2) );
aPoint.setY( aPoint.Y() - aSize.Height() / 2 ); aPoint.AdjustY( -(aSize.Height() / 2) );
pDlgEdObj->SetSnapRect( tools::Rectangle( aPoint, aSize ) ); pDlgEdObj->SetSnapRect( tools::Rectangle( aPoint, aSize ) );
// set default property values // set default property values
...@@ -1156,8 +1156,8 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor ...@@ -1156,8 +1156,8 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor
pPrinter->SetFont( aFont ); pPrinter->SetFont( aFont );
Size aPaperSz = pPrinter->GetOutputSize(); Size aPaperSz = pPrinter->GetOutputSize();
aPaperSz.setWidth( aPaperSz.Width() - (Print::nLeftMargin + Print::nRightMargin) ); aPaperSz.AdjustWidth( -(Print::nLeftMargin + Print::nRightMargin) );
aPaperSz.setHeight( aPaperSz.Height() - (Print::nTopMargin + Print::nBottomMargin) ); aPaperSz.AdjustHeight( -(Print::nTopMargin + Print::nBottomMargin) );
lcl_PrintHeader( pPrinter, rTitle ); lcl_PrintHeader( pPrinter, rTitle );
...@@ -1186,8 +1186,8 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor ...@@ -1186,8 +1186,8 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor
(aPaperSz.Width() / 2) - (aOutputSz.Width() / 2), (aPaperSz.Width() / 2) - (aOutputSz.Width() / 2),
(aPaperSz.Height()/ 2) - (aOutputSz.Height() / 2)); (aPaperSz.Height()/ 2) - (aOutputSz.Height() / 2));
aPosOffs.setX( aPosOffs.X() + Print::nLeftMargin ); aPosOffs.AdjustX(Print::nLeftMargin );
aPosOffs.setY( aPosOffs.Y() + Print::nTopMargin ); aPosOffs.AdjustY(Print::nTopMargin );
pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg ); pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg );
......
...@@ -140,8 +140,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates( ...@@ -140,8 +140,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
aFormPos = pDevice->LogicToPixel( aFormPos, MapMode( MapUnit::Map100thMM ) ); aFormPos = pDevice->LogicToPixel( aFormPos, MapMode( MapUnit::Map100thMM ) );
// subtract form position // subtract form position
aPos.setWidth( aPos.Width() - aFormPos.Width() ); aPos.AdjustWidth( -(aFormPos.Width()) );
aPos.setHeight( aPos.Height() - aFormPos.Height() ); aPos.AdjustHeight( -(aFormPos.Height()) );
// take window borders into account // take window borders into account
Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY ); Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
...@@ -153,8 +153,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates( ...@@ -153,8 +153,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
if( bDecoration ) if( bDecoration )
{ {
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo(); awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
aPos.setWidth( aPos.Width() - aDeviceInfo.LeftInset ); aPos.AdjustWidth( -(aDeviceInfo.LeftInset) );
aPos.setHeight( aPos.Height() - aDeviceInfo.TopInset ); aPos.AdjustHeight( -(aDeviceInfo.TopInset) );
} }
// convert pixel to logic units // convert pixel to logic units
...@@ -201,8 +201,8 @@ bool DlgEdObj::TransformSdrToFormCoordinates( ...@@ -201,8 +201,8 @@ bool DlgEdObj::TransformSdrToFormCoordinates(
if( bDecoration ) if( bDecoration )
{ {
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo(); awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
aSize.setWidth( aSize.Width() - aDeviceInfo.LeftInset + aDeviceInfo.RightInset ); aSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
aSize.setHeight( aSize.Height() - aDeviceInfo.TopInset + aDeviceInfo.BottomInset ); aSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
} }
// convert pixel to logic units // convert pixel to logic units
aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont)); aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont));
...@@ -251,8 +251,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates( ...@@ -251,8 +251,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
aFormPos = pDevice->LogicToPixel(aFormPos, MapMode(MapUnit::MapAppFont)); aFormPos = pDevice->LogicToPixel(aFormPos, MapMode(MapUnit::MapAppFont));
// add form position // add form position
aPos.setWidth( aPos.Width() + aFormPos.Width() ); aPos.AdjustWidth(aFormPos.Width() );
aPos.setHeight( aPos.Height() + aFormPos.Height() ); aPos.AdjustHeight(aFormPos.Height() );
// take window borders into account // take window borders into account
bool bDecoration = true; bool bDecoration = true;
...@@ -260,8 +260,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates( ...@@ -260,8 +260,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
if( bDecoration ) if( bDecoration )
{ {
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo(); awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
aPos.setWidth( aPos.Width() + aDeviceInfo.LeftInset ); aPos.AdjustWidth(aDeviceInfo.LeftInset );
aPos.setHeight( aPos.Height() + aDeviceInfo.TopInset ); aPos.AdjustHeight(aDeviceInfo.TopInset );
} }
// convert pixel to 100th_mm // convert pixel to 100th_mm
...@@ -309,8 +309,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates( ...@@ -309,8 +309,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates(
if( bDecoration ) if( bDecoration )
{ {
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo(); awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
aSize.setWidth( aSize.Width() + aDeviceInfo.LeftInset + aDeviceInfo.RightInset ); aSize.AdjustWidth(aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
aSize.setHeight( aSize.Height() + aDeviceInfo.TopInset + aDeviceInfo.BottomInset ); aSize.AdjustHeight(aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
} }
// convert pixel to 100th_mm // convert pixel to 100th_mm
......
...@@ -156,8 +156,8 @@ void PropBrw::ImplReCreateController() ...@@ -156,8 +156,8 @@ void PropBrw::ImplReCreateController()
Point aPropWinPos = Point( WIN_BORDER, WIN_BORDER ); Point aPropWinPos = Point( WIN_BORDER, WIN_BORDER );
Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y); Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y);
aPropWinSize.setWidth( aPropWinSize.Width() - (2*WIN_BORDER) ); aPropWinSize.AdjustWidth( -(2*WIN_BORDER) );
aPropWinSize.setHeight( aPropWinSize.Height() - (2*WIN_BORDER) ); aPropWinSize.AdjustHeight( -(2*WIN_BORDER) );
if ( m_xBrowserComponentWindow.is() ) if ( m_xBrowserComponentWindow.is() )
{ {
...@@ -426,8 +426,8 @@ void PropBrw::Resize() ...@@ -426,8 +426,8 @@ void PropBrw::Resize()
// adjust size // adjust size
Size aSize_ = GetOutputSizePixel(); Size aSize_ = GetOutputSizePixel();
Size aPropWinSize( aSize_ ); Size aPropWinSize( aSize_ );
aPropWinSize.setWidth( aPropWinSize.Width() - (2*WIN_BORDER) ); aPropWinSize.AdjustWidth( -(2*WIN_BORDER) );
aPropWinSize.setHeight( aPropWinSize.Height() - (2*WIN_BORDER) ); aPropWinSize.AdjustHeight( -(2*WIN_BORDER) );
if (m_xBrowserComponentWindow.is()) if (m_xBrowserComponentWindow.is())
{ {
......
...@@ -92,7 +92,7 @@ void SvRTLInputBox::InitButtons( const Size& rDlgSize ) ...@@ -92,7 +92,7 @@ void SvRTLInputBox::InitButtons( const Size& rDlgSize )
aCancel->SetSizePixel( LogicToPixel( Size( 45, 15) )); aCancel->SetSizePixel( LogicToPixel( Size( 45, 15) ));
Point aPos( rDlgSize.Width()-45-10, 5 ); Point aPos( rDlgSize.Width()-45-10, 5 );
aOk->SetPosPixel( LogicToPixel( aPos )); aOk->SetPosPixel( LogicToPixel( aPos ));
aPos.setY( aPos.Y() + 16 ); aPos.AdjustY(16 );
aCancel->SetPosPixel( LogicToPixel( aPos )); aCancel->SetPosPixel( LogicToPixel( aPos ));
aOk->SetClickHdl(LINK(this,SvRTLInputBox, OkHdl)); aOk->SetClickHdl(LINK(this,SvRTLInputBox, OkHdl));
aCancel->SetClickHdl(LINK(this,SvRTLInputBox,CancelHdl)); aCancel->SetClickHdl(LINK(this,SvRTLInputBox,CancelHdl));
...@@ -123,8 +123,8 @@ void SvRTLInputBox::PositionPrompt(const OUString& rPrompt,const Size& rDlgSize) ...@@ -123,8 +123,8 @@ void SvRTLInputBox::PositionPrompt(const OUString& rPrompt,const Size& rDlgSize)
aPromptText->SetPosPixel( LogicToPixel(Point(5,5))); aPromptText->SetPosPixel( LogicToPixel(Point(5,5)));
aPromptText->SetText( aText_ ); aPromptText->SetText( aText_ );
Size aSize( rDlgSize ); Size aSize( rDlgSize );
aSize.setWidth( aSize.Width() - 70 ); aSize.AdjustWidth( -70 );
aSize.setHeight( aSize.Height() - 50 ); aSize.AdjustHeight( -50 );
aPromptText->SetSizePixel( LogicToPixel(aSize)); aPromptText->SetSizePixel( LogicToPixel(aSize));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment