diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-08 14:31:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-09 13:15:08 +0200 |
commit | dc78b82db539401cc7e63d96f4727e1e884b86cb (patch) | |
tree | 6421310e52bf4daa2719c6f16d107cfd3823f6d9 /sc | |
parent | 9bb0219e8284a99dd1caf6aa50cd9a5b85e8f7a3 (diff) |
Related: tdf#123765 fix up some screenshotting
and add in two special cases for the mentioned cui dialogs
Change-Id: Ibd2bf8e9e5bff131f2c009c784652f4500842326
Reviewed-on: https://gerrit.libreoffice.org/80488
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 176 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 59 |
2 files changed, 233 insertions, 2 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index f957e9f9af1e..caccf863349e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -118,6 +118,18 @@ short AbstractScDataFormDlg_Impl::Execute() return m_xDlg->run(); } +BitmapEx AbstractScDataFormDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScDataFormDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + short AbstractScDeleteContentsDlg_Impl::Execute() { return m_xDlg->run(); @@ -163,6 +175,18 @@ short AbstractScMoveTableDlg_Impl::Execute() return m_xDlg->run(); } +BitmapEx AbstractScMoveTableDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScMoveTableDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + short AbstractScNameCreateDlg_Impl::Execute() { return m_xDlg->run(); @@ -277,11 +301,35 @@ bool AbstractScColRowLabelDlg_Impl::IsRow() return m_xDlg->IsRow(); } +BitmapEx AbstractScColRowLabelDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScColRowLabelDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + void AbstractScDataPilotDatabaseDlg_Impl::GetValues( ScImportSourceDesc& rDesc ) { m_xDlg->GetValues(rDesc); } +BitmapEx AbstractScDataPilotDatabaseDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScDataPilotDatabaseDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + bool AbstractScDataPilotSourceTypeDlg_Impl::IsDatabase() const { return m_xDlg->IsDatabase(); @@ -307,6 +355,18 @@ void AbstractScDataPilotSourceTypeDlg_Impl::AppendNamedRange(const OUString& rNa m_xDlg->AppendNamedRange(rName); } +BitmapEx AbstractScDataPilotSourceTypeDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScDataPilotSourceTypeDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + OUString AbstractScDataPilotServiceDlg_Impl::GetServiceName() const { return m_xDlg->GetServiceName(); @@ -337,6 +397,18 @@ DelCellCmd AbstractScDeleteCellDlg_Impl::GetDelCellCmd() const return m_xDlg->GetDelCellCmd(); } +BitmapEx AbstractScDeleteCellDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScDeleteCellDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + void AbstractScDeleteContentsDlg_Impl::DisableObjects() { m_xDlg->DisableObjects(); @@ -347,6 +419,18 @@ InsertDeleteFlags AbstractScDeleteContentsDlg_Impl::GetDelContentsCmdBits() cons return m_xDlg->GetDelContentsCmdBits(); } +BitmapEx AbstractScDeleteContentsDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScDeleteContentsDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + FillDir AbstractScFillSeriesDlg_Impl::GetFillDir() const { return m_xDlg->GetFillDir(); @@ -447,6 +531,18 @@ InsCellCmd AbstractScInsertContentsDlg_Impl::GetMoveMode() return m_xDlg->GetMoveMode(); } +BitmapEx AbstractScInsertContentsDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScInsertContentsDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + bool AbstractScInsertTableDlg_Impl::GetTablesFromFile() { return m_xDlg->GetTablesFromFile(); @@ -482,6 +578,18 @@ const OUString* AbstractScInsertTableDlg_Impl::GetNextTable( sal_uInt16* pN ) return m_xDlg->GetNextTable( pN ); } +BitmapEx AbstractScInsertTableDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScInsertTableDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + OUString AbstractScSelEntryDlg_Impl::GetSelectedEntry() const { return m_xDlg->GetSelectedEntry(); @@ -584,6 +692,18 @@ CreateNameFlags AbstractScNameCreateDlg_Impl::GetFlags() const return m_xDlg->GetFlags(); } +BitmapEx AbstractScNameCreateDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScNameCreateDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + std::vector<OUString> AbstractScNamePasteDlg_Impl::GetSelectedNames() const { return m_xDlg->GetSelectedNames(); @@ -678,11 +798,35 @@ OUString AbstractScStringInputDlg_Impl::GetInputString() const return m_xDlg->GetInputString(); } +BitmapEx AbstractScStringInputDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScStringInputDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const { m_xDlg->GetSelectedColor( rColor ); } +BitmapEx AbstractScTabBgColorDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScTabBgColorDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const { m_xDlg->GetImportOptions(rOptions); @@ -703,6 +847,18 @@ bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const return m_xDlg->isDateConversionSet(); } +BitmapEx AbstractScTextImportOptionsDlg_Impl::createScreenshot() const +{ + VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + m_xDlg->getDialog()->draw(*xDialogSurface); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +} + +OString AbstractScTextImportOptionsDlg_Impl::GetScreenshotId() const +{ + return m_xDlg->get_help_id(); +} + short ScAbstractTabController_Impl::Execute() { return m_xDlg->run(); @@ -739,6 +895,26 @@ void ScAbstractTabController_Impl::SetText( const OUString& rStr ) m_xDlg->set_title(rStr); } +std::vector<OString> ScAbstractTabController_Impl::getAllPageUIXMLDescriptions() const +{ + return m_xDlg->getAllPageUIXMLDescriptions(); +} + +bool ScAbstractTabController_Impl::selectPageByUIXMLDescription(const OString& rUIXMLDescription) +{ + return m_xDlg->selectPageByUIXMLDescription(rUIXMLDescription); +} + +BitmapEx ScAbstractTabController_Impl::createScreenshot() const +{ + return m_xDlg->createScreenshot(); +} + +OString ScAbstractTabController_Impl::GetScreenshotId() const +{ + return m_xDlg->GetScreenshotId(); +} + // =========================Factories for createdialog =================== VclPtr<AbstractScImportAsciiDlg> ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( vcl::Window* pParent, const OUString& aDatName, diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 8655e6bc9ad4..445bf57ff6a1 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -130,6 +130,10 @@ public: virtual short Execute() override; virtual bool IsCol() override; virtual bool IsRow() override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScCondFormatManagerDlg_Impl : public AbstractScCondFormatManagerDlg @@ -157,7 +161,11 @@ public: { } virtual short Execute() override; - virtual void GetValues( ScImportSourceDesc& rDesc ) override; + virtual void GetValues( ScImportSourceDesc& rDesc ) override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScDataPilotSourceTypeDlg_Impl :public AbstractScDataPilotSourceTypeDlg @@ -174,6 +182,10 @@ public: virtual bool IsNamedRange() const override; virtual OUString GetSelectedNamedRange() const override; virtual void AppendNamedRange(const OUString& rName) override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScDataPilotServiceDlg_Impl : public AbstractScDataPilotServiceDlg @@ -202,6 +214,10 @@ public: } virtual short Execute() override; virtual DelCellCmd GetDelCellCmd() const override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; //for dataform @@ -215,6 +231,9 @@ public: } virtual short Execute() override; + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg @@ -228,6 +247,10 @@ public: virtual short Execute() override; virtual void DisableObjects() override; virtual InsertDeleteFlags GetDelContentsCmdBits() const override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScFillSeriesDlg_Impl:public AbstractScFillSeriesDlg @@ -292,6 +315,10 @@ public: virtual void SetChangeTrack( bool bSet ) override; virtual void SetCellShiftDisabled( CellShiftDisabledFlags nDisable ) override; virtual InsCellCmd GetMoveMode() override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScInsertTableDlg_Impl : public AbstractScInsertTableDlg @@ -311,6 +338,9 @@ public: virtual sal_uInt16 GetTableCount() override; virtual const OUString* GetNextTable( sal_uInt16* pN ) override; + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScSelEntryDlg_Impl : public AbstractScSelEntryDlg @@ -373,6 +403,10 @@ public: virtual void GetTabNameString( OUString& rString ) const override; virtual void SetForceCopyTable () override; virtual void EnableRenameTable (bool bFlag) override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScNameCreateDlg_Impl : public AbstractScNameCreateDlg @@ -385,6 +419,10 @@ public: } virtual short Execute() override; virtual CreateNameFlags GetFlags() const override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScNamePasteDlg_Impl : public AbstractScNamePasteDlg @@ -528,6 +566,10 @@ public: } virtual short Execute() override; virtual OUString GetInputString() const override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScTabBgColorDlg_Impl : public AbstractScTabBgColorDlg @@ -540,6 +582,10 @@ public: } virtual short Execute() override; virtual void GetSelectedColor( Color& rColor ) const override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg @@ -566,6 +612,10 @@ public: virtual short Execute() override; virtual LanguageType GetLanguageType() const override; virtual bool IsDateConversionSet() const override; + + // screenshotting + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; class ScAbstractTabController_Impl : public SfxAbstractTabDialog @@ -582,8 +632,13 @@ public: virtual const SfxItemSet* GetOutputItemSet() const override; virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ) override; virtual void SetInputSet( const SfxItemSet* pInSet ) override; - //From class Window. virtual void SetText( const OUString& rStr ) override; + + // screenshotting + virtual std::vector<OString> getAllPageUIXMLDescriptions() const override; + virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; + virtual BitmapEx createScreenshot() const override; + virtual OString GetScreenshotId() const override; }; //AbstractDialogFactory_Impl implementations |