diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-07 20:27:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-08 13:39:11 +0200 |
commit | 19fd82ac6e08896bd17169d1b6ea090458fc18da (patch) | |
tree | a179a2651dc58d4574833ac39ab0ea70f1dd8110 /sd/source/ui | |
parent | 2d8e2813ddc87f7ce03b97e4d603df11613461f0 (diff) |
distinguish between dialog screenshoting and rendering a widget
Change-Id: I43ee0c68d72c97a15d26e2ffea577c2a44ba91e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98326
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.cxx | 54 |
1 files changed, 18 insertions, 36 deletions
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index 8db686217c86..30b945a82e51 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -57,8 +57,7 @@ short SdAbstractGenericDialog_Impl::Execute() BitmapEx SdAbstractGenericDialog_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -164,8 +163,7 @@ bool AbstractHeaderFooterDialog_Impl::StartExecuteAsync(AsyncContext &rCtx) BitmapEx AbstractHeaderFooterDialog_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -196,8 +194,7 @@ short AbstractBreakDlg_Impl::Execute() BitmapEx AbstractBreakDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -218,8 +215,7 @@ short AbstractMasterLayoutDialog_Impl::Execute() BitmapEx AbstractMasterLayoutDialog_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -235,8 +231,7 @@ void AbstractCopyDlg_Impl::GetAttr( SfxItemSet& rOutAttrs ) BitmapEx AbstractCopyDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -257,8 +252,7 @@ bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const BitmapEx AbstractSdCustomShowDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -305,8 +299,7 @@ void SdAbstractTabController_Impl::SetText( const OUString& rStr ) BitmapEx SdAbstractTabController_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -342,8 +335,7 @@ void AbstractBulletDialog_Impl::SetText( const OUString& rStr ) BitmapEx AbstractBulletDialog_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -379,8 +371,7 @@ void SdPresLayoutTemplateDlg_Impl::SetText( const OUString& rStr ) BitmapEx SdPresLayoutTemplateDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -401,8 +392,7 @@ SfxItemSet AbstractSdModifyFieldDlg_Impl::GetItemSet() BitmapEx AbstractSdModifyFieldDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -438,8 +428,7 @@ void AbstractSdSnapLineDlg_Impl::SetText( const OUString& rStr ) BitmapEx AbstractSdSnapLineDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -460,8 +449,7 @@ void AbstractSdInsertLayerDlg_Impl::SetHelpId( const OString& rHelpId ) BitmapEx AbstractSdInsertLayerDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -487,8 +475,7 @@ bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const BitmapEx AbstractSdInsertPagesObjsDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -519,8 +506,7 @@ bool AbstractMorphDlg_Impl::IsOrientationFade() const BitmapEx AbstractMorphDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -536,8 +522,7 @@ void AbstractSdStartPresDlg_Impl::GetAttr( SfxItemSet& rOutAttrs ) BitmapEx AbstractSdStartPresDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -553,8 +538,7 @@ void AbstractSdPresLayoutDlg_Impl::GetAttr( SfxItemSet& rOutAttrs ) BitmapEx AbstractSdPresLayoutDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -580,8 +564,7 @@ const GDIMetaFile& AbstractSdVectorizeDlg_Impl::GetGDIMetaFile() const BitmapEx AbstractSdVectorizeDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -597,8 +580,7 @@ void AbstractSdPublishingDlg_Impl::GetParameterSequence( css::uno::Sequence< css BitmapEx AbstractSdPublishingDlg_Impl::createScreenshot() const { - VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); - m_xDlg->getDialog()->draw(*xDialogSurface); + VclPtr<VirtualDevice> xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } |