diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-21 15:54:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-22 13:17:30 +0200 |
commit | c200aa27ee4a0f5a89af6e970c2c22580029eded (patch) | |
tree | 3988c0c756df2d1eb182c50ad1dc0e226d2ecf14 /toolkit | |
parent | af6561532832615f39b5ea82aa5d9b3e240784e8 (diff) |
remove Size arg from Window::Draw and depend on GetSizePixel
90% of cases pass GetSizePixel as the Size arg already
and this aligns Window::Draw with how Window::PaintToDevice
works
Change-Id: If5b024179a4b7a3b099177c2f6d4b1fb006b95ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94644
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/inc/controls/filectrl.hxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtabpagecontainer.cxx | 6 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 12 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 16 | ||||
-rw-r--r-- | toolkit/source/controls/filectrl.cxx | 7 |
5 files changed, 14 insertions, 29 deletions
diff --git a/toolkit/inc/controls/filectrl.hxx b/toolkit/inc/controls/filectrl.hxx index 2aea66f3936e..1ffcb67e3441 100644 --- a/toolkit/inc/controls/filectrl.hxx +++ b/toolkit/inc/controls/filectrl.hxx @@ -58,7 +58,7 @@ public: Edit& GetEdit() { return *maEdit; } PushButton& GetButton() { return *maButton; } - void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) override; + void Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override; void SetText( const OUString& rStr ) override; OUString GetText() const override; diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index bc5d19964d2e..d51fedcff6a2 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -64,12 +64,8 @@ void SAL_CALL VCLXTabPageContainer::draw( sal_Int32 nX, sal_Int32 nY ) if (pTabPage && pDev) { ::Point aPos( nX, nY ); - ::Size aSize = pTabPage->GetSizePixel(); - aPos = pDev->PixelToLogic( aPos ); - aSize = pDev->PixelToLogic( aSize ); - - pTabPage->Draw( pDev, aPos, aSize, DrawFlags::NONE ); + pTabPage->Draw( pDev, aPos, DrawFlags::NONE ); } } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 8aeb3a49679f..8c7b306b084e 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2217,12 +2217,8 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) if ( pTabPage ) { Point aPos( nX, nY ); - Size aSize = pWindow->GetSizePixel(); - - aPos = pDev->PixelToLogic( aPos ); - aSize = pDev->PixelToLogic( aSize ); - - pTabPage->Draw( pDev, aPos, aSize, DrawFlags::NONE ); + aPos = pDev->PixelToLogic( aPos ); + pTabPage->Draw( pDev, aPos, DrawFlags::NONE ); return; } @@ -2269,8 +2265,6 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) } else if ( pDev ) { - Size aSz = pWindow->GetSizePixel(); - aSz = pDev->PixelToLogic( aSz ); Point aP = pDev->PixelToLogic( aPos ); vcl::PDFExtOutDevData* pPDFExport = dynamic_cast<vcl::PDFExtOutDevData*>(pDev->GetExtOutDevData()); @@ -2279,7 +2273,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) || ( pPDFExport != nullptr ); if ( bDrawSimple ) { - pWindow->Draw( pDev, aP, aSz, DrawFlags::NoControls ); + pWindow->Draw( pDev, aP, DrawFlags::NoControls ); } else { diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index ab190525b478..fd47e1d2275e 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2386,10 +2386,8 @@ void SAL_CALL VCLXDialog::draw( sal_Int32 nX, sal_Int32 nY ) if ( !pDev ) pDev = pWindow->GetParent(); - Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() ); Point aPos = pDev->PixelToLogic( Point( nX, nY ) ); - - pWindow->Draw( pDev, aPos, aSize, DrawFlags::NoControls ); + pWindow->Draw( pDev, aPos, DrawFlags::NoControls ); } } @@ -2509,10 +2507,8 @@ void SAL_CALL VCLXMultiPage::draw( sal_Int32 nX, sal_Int32 nY ) if ( !pDev ) pDev = pWindow->GetParent(); - Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() ); Point aPos = pDev->PixelToLogic( Point( nX, nY ) ); - - pWindow->Draw( pDev, aPos, aSize, DrawFlags::NoControls ); + pWindow->Draw( pDev, aPos, DrawFlags::NoControls ); } } @@ -2756,10 +2752,8 @@ void SAL_CALL VCLXTabPage::draw( sal_Int32 nX, sal_Int32 nY ) if ( !pDev ) pDev = pWindow->GetParent(); - Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() ); Point aPos = pDev->PixelToLogic( Point( nX, nY ) ); - - pWindow->Draw( pDev, aPos, aSize, DrawFlags::NoControls ); + pWindow->Draw( pDev, aPos, DrawFlags::NoControls ); } } @@ -6618,10 +6612,8 @@ void SAL_CALL VCLXFrame::draw( sal_Int32 nX, sal_Int32 nY ) if ( !pDev ) pDev = pWindow->GetParent(); - Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() ); Point aPos = pDev->PixelToLogic( Point( nX, nY ) ); - - pWindow->Draw( pDev, aPos, aSize, DrawFlags::NoControls ); + pWindow->Draw( pDev, aPos, DrawFlags::NoControls ); } } diff --git a/toolkit/source/controls/filectrl.cxx b/toolkit/source/controls/filectrl.cxx index 3757f91da678..9f6dce0accc8 100644 --- a/toolkit/source/controls/filectrl.cxx +++ b/toolkit/source/controls/filectrl.cxx @@ -187,12 +187,15 @@ void FileControl::SetEditModifyHdl( const Link<Edit&,void>& rLink ) maEdit->SetModifyHdl(rLink); } -void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) +void FileControl::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) { WinBits nOldEditStyle = GetEdit().GetStyle(); if ( GetStyle() & WB_BORDER ) GetEdit().SetStyle( nOldEditStyle|WB_BORDER ); - GetEdit().Draw( pDev, rPos, rSize, nFlags ); + Size aOrigSize(GetEdit().GetSizePixel()); + GetEdit().SetSizePixel(GetSizePixel()); + GetEdit().Draw( pDev, rPos, nFlags ); + GetEdit().SetSizePixel(aOrigSize); if ( GetStyle() & WB_BORDER ) GetEdit().SetStyle( nOldEditStyle ); } |