[Libreoffice-commits] core.git: cui/CppunitTest_cui_dialogs_test.mk cui/qa cui/source include/sfx2 sc/source sd/source sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 9 11:16:34 UTC 2019


 cui/CppunitTest_cui_dialogs_test.mk     |    1 
 cui/qa/unit/cui-dialogs-test.cxx        |   48 ++++++-
 cui/qa/unit/data/cui-dialogs-test.txt   |    4 
 cui/qa/unit/data/cui-dialogs-test_2.txt |    2 
 cui/qa/unit/data/cui-dialogs-test_4.txt |    1 
 cui/source/factory/dlgfact.cxx          |   20 ++
 cui/source/factory/dlgfact.hxx          |    7 -
 cui/source/tabpages/textanim.cxx        |   15 +-
 include/sfx2/tabdlg.hxx                 |    6 
 sc/source/ui/attrdlg/scdlgfact.cxx      |  176 +++++++++++++++++++++++++
 sc/source/ui/attrdlg/scdlgfact.hxx      |   59 ++++++++
 sd/source/ui/dlg/sddlgfact.cxx          |  217 ++++++++++++++++++++++++++++++++
 sd/source/ui/dlg/sddlgfact.hxx          |   79 ++++++++++-
 sfx2/source/dialog/tabdlg.cxx           |   45 ++++++
 14 files changed, 655 insertions(+), 25 deletions(-)

New commits:
commit dc78b82db539401cc7e63d96f4727e1e884b86cb
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 8 14:31:24 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 9 13:15:08 2019 +0200

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/CppunitTest_cui_dialogs_test.mk b/cui/CppunitTest_cui_dialogs_test.mk
index 353abb8a3a25..2bafdb5fa6b0 100644
--- a/cui/CppunitTest_cui_dialogs_test.mk
+++ b/cui/CppunitTest_cui_dialogs_test.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_CppunitTest_use_libraries,cui_dialogs_test, \
     svl \
     svt \
     cui \
+    svxcore \
     test \
     tl \
     tk \
diff --git a/cui/qa/unit/cui-dialogs-test.cxx b/cui/qa/unit/cui-dialogs-test.cxx
index 8a485cce9850..781dc364a960 100644
--- a/cui/qa/unit/cui-dialogs-test.cxx
+++ b/cui/qa/unit/cui-dialogs-test.cxx
@@ -12,6 +12,8 @@
 #include <rtl/strbuf.hxx>
 #include <osl/file.hxx>
 #include <sfx2/app.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svxdlg.hxx>
 #include <vcl/abstdlg.hxx>
 
 using namespace ::com::sun::star;
@@ -20,6 +22,12 @@ using namespace ::com::sun::star;
 class CuiDialogsTest : public ScreenshotTest
 {
 private:
+    std::unique_ptr<SdrModel> mxModel;
+    std::unique_ptr<SfxItemSet> mxAttr;
+    SvxAbstractDialogFactory* mpFact;
+
+    void initialize();
+
     /// helper method to populate KnownDialogs, called in setUp(). Needs to be
     /// written and has to add entries to KnownDialogs
     virtual void registerKnownDialogsByID(mapType& rKnownDialogs) override;
@@ -43,18 +51,52 @@ CuiDialogsTest::CuiDialogsTest()
 {
 }
 
-void CuiDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
+void CuiDialogsTest::initialize()
+{
+    mpFact = SvxAbstractDialogFactory::Create();
+    mxModel.reset(new SdrModel(nullptr, nullptr, true));
+    mxModel->GetItemPool().FreezeIdRanges();
+    mxAttr.reset(new SfxItemSet(mxModel->GetItemPool()));
+}
+
+void CuiDialogsTest::registerKnownDialogsByID(mapType& rKnownDialogs)
 {
     // fill map of known dialogs
+    rKnownDialogs["cui/ui/formatcellsdialog.ui"] = 0;
+    rKnownDialogs["cui/ui/textdialog.ui"] = 1;
 }
 
-VclPtr<VclAbstractDialog> CuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
+VclPtr<VclAbstractDialog> CuiDialogsTest::createDialogByID(sal_uInt32 nID)
 {
-    return nullptr;
+    VclPtr<VclAbstractDialog> pReturnDialog;
+
+    switch ( nID )
+    {
+        case 0: // "cui/ui/formatcellsdialog.ui"
+        {
+            pReturnDialog = mpFact->CreateSvxFormatCellsDialog(
+                nullptr, mxAttr.get(), *mxModel, nullptr);
+            break;
+        }
+
+        case 1: // "cui/ui/textdialog.ui"
+        {
+            pReturnDialog = mpFact->CreateTextTabDialog(
+                nullptr, mxAttr.get(), nullptr);
+            break;
+        }
+
+        default:
+            break;
+    }
+
+    return pReturnDialog;
 }
 
 void CuiDialogsTest::openAnyDialog()
 {
+    initialize();
+
     /// process input file containing the UXMLDescriptions of the dialogs to dump
     processDialogBatchFile("cui/qa/unit/data/cui-dialogs-test.txt");
 }
diff --git a/cui/qa/unit/data/cui-dialogs-test.txt b/cui/qa/unit/data/cui-dialogs-test.txt
index 8bab3ce88f5f..b9f8f99813f6 100644
--- a/cui/qa/unit/data/cui-dialogs-test.txt
+++ b/cui/qa/unit/data/cui-dialogs-test.txt
@@ -23,7 +23,8 @@
 # in registerKnownDialogsByID/createDialogByID
 #
 
-# No known dialogs in cui for now
+cui/ui/formatcellsdialog.ui
+cui/ui/textdialog.ui
 
 #
 # Dialogs without a hard-coded representation. These will
@@ -97,4 +98,3 @@ cui/ui/effectspage.ui
 cui/ui/embossdialog.ui
 cui/ui/eventassigndialog.ui
 cui/ui/eventassignpage.ui
-cui/ui/eventsconfigpage.ui
diff --git a/cui/qa/unit/data/cui-dialogs-test_2.txt b/cui/qa/unit/data/cui-dialogs-test_2.txt
index 5d87d13ffb73..bccb005632fc 100644
--- a/cui/qa/unit/data/cui-dialogs-test_2.txt
+++ b/cui/qa/unit/data/cui-dialogs-test_2.txt
@@ -11,8 +11,8 @@
 
 # covering f to n
 
+cui/ui/eventsconfigpage.ui
 cui/ui/fmsearchdialog.ui
-cui/ui/formatcellsdialog.ui
 cui/ui/galleryapplyprogress.ui
 cui/ui/galleryfilespage.ui
 cui/ui/gallerygeneralpage.ui
diff --git a/cui/qa/unit/data/cui-dialogs-test_4.txt b/cui/qa/unit/data/cui-dialogs-test_4.txt
index eaa3a6ce3dd8..a537b2b09d1e 100644
--- a/cui/qa/unit/data/cui-dialogs-test_4.txt
+++ b/cui/qa/unit/data/cui-dialogs-test_4.txt
@@ -63,7 +63,6 @@ cui/ui/storedwebconnectiondialog.ui
 cui/ui/swpossizepage.ui
 cui/ui/textanimtabpage.ui
 cui/ui/textattrtabpage.ui
-cui/ui/textdialog.ui
 cui/ui/textflowpage.ui
 cui/ui/transparencytabpage.ui
 cui/ui/tsaurldialog.ui
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index e08cd60cfd7d..1e422f1fa85e 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -365,6 +365,26 @@ void CuiAbstractTabController_Impl::SetText( const OUString& rStr )
     m_xDlg->set_title(rStr);
 }
 
+std::vector<OString> CuiAbstractTabController_Impl::getAllPageUIXMLDescriptions() const
+{
+    return m_xDlg->getAllPageUIXMLDescriptions();
+}
+
+bool CuiAbstractTabController_Impl::selectPageByUIXMLDescription(const OString& rUIXMLDescription)
+{
+    return m_xDlg->selectPageByUIXMLDescription(rUIXMLDescription);
+}
+
+BitmapEx CuiAbstractTabController_Impl::createScreenshot() const
+{
+    return m_xDlg->createScreenshot();
+}
+
+OString CuiAbstractTabController_Impl::GetScreenshotId() const
+{
+    return m_xDlg->GetScreenshotId();
+}
+
 const SfxItemSet* CuiAbstractSingleTabController_Impl::GetOutputItemSet() const
 {
     return m_xDlg->GetOutputItemSet();
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 3bc6e90cc377..207405024dde 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -152,8 +152,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;
 };
 
 class SvxDistributeDialog;
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 9f4acaa05b76..254f87c79b48 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -59,15 +59,18 @@ void SvxTextTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
 {
     if (rId == "RID_SVXPAGE_TEXTATTR")
     {
-        const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
-        bool bHasMarked = rMarkList.GetMarkCount() > 0;
         SdrObjKind eKind = OBJ_NONE;
-        if (bHasMarked)
+        if (pView)
         {
-            if (rMarkList.GetMarkCount() == 1)
+            const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
+            bool bHasMarked = rMarkList.GetMarkCount() > 0;
+            if (bHasMarked)
             {
-                const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-                eKind = static_cast<SdrObjKind>(pObj->GetObjIdentifier());
+                if (rMarkList.GetMarkCount() == 1)
+                {
+                    const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+                    eKind = static_cast<SdrObjKind>(pObj->GetObjIdentifier());
+                }
             }
         }
         static_cast<SvxTextAttrPage&>(rPage).SetObjKind(eKind);
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index dbaef0e7dc32..5ece422136c9 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -148,6 +148,12 @@ public:
     //calls Ok without closing dialog
     bool Apply();
     void Applied() { m_xExampleSet->Put(*GetInputSetImpl()); }
+
+    //screenshotting
+    std::vector<OString> getAllPageUIXMLDescriptions() const;
+    bool selectPageByUIXMLDescription(const OString& rUIXMLDescription);
+    BitmapEx createScreenshot() const;
+    OString GetScreenshotId() const;
 };
 
 enum class DeactivateRC {
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
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 55ad1c25556d..1a1182a0e026 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -43,6 +43,7 @@
 #include <masterlayoutdlg.hxx>
 #include <headerfooterdlg.hxx>
 #include "PhotoAlbumDialog.hxx"
+#include <vcl/virdev.hxx>
 
 short AbstractSvxBulletAndPositionDlg_Impl::Execute()
 {
@@ -54,6 +55,18 @@ short SdAbstractGenericDialog_Impl::Execute()
     return m_xDlg->run();
 }
 
+BitmapEx SdAbstractGenericDialog_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString SdAbstractGenericDialog_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 const SfxItemSet* AbstractSvxBulletAndPositionDlg_Impl::GetOutputItemSet( SfxItemSet* pSet ) const
 {
     return m_xDlg->GetOutputItemSet( pSet );
@@ -149,6 +162,18 @@ bool AbstractHeaderFooterDialog_Impl::StartExecuteAsync(AsyncContext &rCtx)
     return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
 }
 
+BitmapEx AbstractHeaderFooterDialog_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractHeaderFooterDialog_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 short AbstractBulletDialog_Impl::Execute()
 {
     return m_xDlg->run();
@@ -169,6 +194,18 @@ short AbstractBreakDlg_Impl::Execute()
     return m_xDlg->run();
 }
 
+BitmapEx AbstractBreakDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractBreakDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 AbstractMasterLayoutDialog_Impl::AbstractMasterLayoutDialog_Impl(std::unique_ptr<::sd::MasterLayoutDialog> pDlg)
     : m_xDlg(std::move(pDlg))
 {
@@ -179,11 +216,35 @@ short AbstractMasterLayoutDialog_Impl::Execute()
     return m_xDlg->run();
 }
 
+BitmapEx AbstractMasterLayoutDialog_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractMasterLayoutDialog_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractCopyDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
 {
     m_xDlg->GetAttr( rOutAttrs );
 }
 
+BitmapEx AbstractCopyDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractCopyDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 bool AbstractSdCustomShowDlg_Impl::IsModified() const
 {
     return m_xDlg->IsModified();
@@ -194,6 +255,18 @@ bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const
     return m_xDlg->IsCustomShow();
 }
 
+BitmapEx AbstractSdCustomShowDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdCustomShowDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 short SdAbstractTabController_Impl::Execute()
 {
     return m_xDlg->run();
@@ -230,6 +303,18 @@ void SdAbstractTabController_Impl::SetText( const OUString& rStr )
     m_xDlg->set_title(rStr);
 }
 
+BitmapEx SdAbstractTabController_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString SdAbstractTabController_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractBulletDialog_Impl::SetCurPageId( const OString& rName )
 {
     m_xDlg->SetCurPageId( rName );
@@ -255,6 +340,18 @@ void AbstractBulletDialog_Impl::SetText( const OUString& rStr )
     m_xDlg->set_title(rStr);
 }
 
+BitmapEx AbstractBulletDialog_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractBulletDialog_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void SdPresLayoutTemplateDlg_Impl::SetCurPageId( const OString& rName )
 {
     m_xDlg->SetCurPageId( rName );
@@ -280,6 +377,18 @@ void SdPresLayoutTemplateDlg_Impl::SetText( const OUString& rStr )
     m_xDlg->set_title(rStr);
 }
 
+BitmapEx SdPresLayoutTemplateDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString SdPresLayoutTemplateDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 SvxFieldData* AbstractSdModifyFieldDlg_Impl::GetField()
 {
     return m_xDlg->GetField();
@@ -290,6 +399,18 @@ SfxItemSet AbstractSdModifyFieldDlg_Impl::GetItemSet()
     return m_xDlg->GetItemSet();
 }
 
+BitmapEx AbstractSdModifyFieldDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdModifyFieldDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractSdSnapLineDlg_Impl::GetAttr(SfxItemSet& rOutAttrs)
 {
     m_xDlg->GetAttr(rOutAttrs);
@@ -315,6 +436,18 @@ void AbstractSdSnapLineDlg_Impl::SetText( const OUString& rStr )
     m_xDlg->set_title(rStr);
 }
 
+BitmapEx AbstractSdSnapLineDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdSnapLineDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractSdInsertLayerDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
 {
     m_xDlg->GetAttr(rOutAttrs);
@@ -325,6 +458,18 @@ void AbstractSdInsertLayerDlg_Impl::SetHelpId( const OString& rHelpId )
     m_xDlg->set_help_id(rHelpId);
 }
 
+BitmapEx AbstractSdInsertLayerDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdInsertLayerDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 std::vector<OUString> AbstractSdInsertPagesObjsDlg_Impl::GetList(const sal_uInt16 nType)
 {
     return m_xDlg->GetList(nType);
@@ -340,6 +485,18 @@ bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const
     return m_xDlg->IsRemoveUnnessesaryMasterPages();
 }
 
+BitmapEx AbstractSdInsertPagesObjsDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdInsertPagesObjsDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractMorphDlg_Impl::SaveSettings() const
 {
     m_xDlg->SaveSettings();
@@ -360,16 +517,52 @@ bool AbstractMorphDlg_Impl::IsOrientationFade() const
     return m_xDlg->IsOrientationFade();
 }
 
+BitmapEx AbstractMorphDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractMorphDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractSdStartPresDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
 {
     m_xDlg->GetAttr(rOutAttrs);
 }
 
+BitmapEx AbstractSdStartPresDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdStartPresDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractSdPresLayoutDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
 {
     m_xDlg->GetAttr(rOutAttrs);
 }
 
+BitmapEx AbstractSdPresLayoutDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdPresLayoutDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 const SfxItemSet* SdAbstractSfxDialog_Impl::GetOutputItemSet() const
 {
     return m_xDlg->GetOutputItemSet();
@@ -385,11 +578,35 @@ const GDIMetaFile& AbstractSdVectorizeDlg_Impl::GetGDIMetaFile() const
     return m_xDlg->GetGDIMetaFile();
 }
 
+BitmapEx AbstractSdVectorizeDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdVectorizeDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 void AbstractSdPublishingDlg_Impl::GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams )
 {
     m_xDlg->GetParameterSequence( rParams );
 }
 
+BitmapEx AbstractSdPublishingDlg_Impl::createScreenshot() const
+{
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDlg->getDialog()->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString AbstractSdPublishingDlg_Impl::GetScreenshotId() const
+{
+    return m_xDlg->get_help_id();
+}
+
 //-------------- SdAbstractDialogFactory implementation--------------
 
 VclPtr<AbstractSvxBulletAndPositionDlg> SdAbstractDialogFactory_Impl::CreateSvxBulletAndPositionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView)
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 7b05f8dc7290..2c58cf05b53b 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -75,6 +75,10 @@ public:
     {
     }
     virtual short Execute() override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractMasterLayoutDialog_Impl : public VclAbstractDialog
@@ -84,6 +88,10 @@ private:
 public:
     AbstractMasterLayoutDialog_Impl(std::unique_ptr<::sd::MasterLayoutDialog> pDlg);
     virtual short Execute() override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractBreakDlg_Impl : public VclAbstractDialog
@@ -93,6 +101,10 @@ private:
 public:
     AbstractBreakDlg_Impl(std::unique_ptr<::sd::BreakDlg> pDlg);
     virtual short Execute() override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractCopyDlg_Impl : public AbstractCopyDlg
@@ -106,6 +118,10 @@ public:
     }
     virtual short Execute() override;
     virtual void    GetAttr( SfxItemSet& rOutAttrs ) override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdCustomShowDlg_Impl : public AbstractSdCustomShowDlg
@@ -120,6 +136,10 @@ public:
     virtual short       Execute() override;
     virtual bool        IsModified() const override ;
     virtual bool        IsCustomShow() const override ;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class SdAbstractTabController_Impl : public SfxAbstractTabDialog
@@ -136,8 +156,11 @@ 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 BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractBulletDialog_Impl : public SfxAbstractTabDialog
@@ -154,8 +177,11 @@ 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 BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class SdPresLayoutTemplateDlg_Impl : public SfxAbstractTabDialog
@@ -172,8 +198,11 @@ 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 BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdModifyFieldDlg_Impl : public AbstractSdModifyFieldDlg
@@ -188,6 +217,10 @@ public:
     virtual short Execute() override;
     virtual SvxFieldData*       GetField() override;
     virtual SfxItemSet          GetItemSet() override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdSnapLineDlg_Impl : public AbstractSdSnapLineDlg
@@ -204,8 +237,11 @@ public:
     virtual void HideRadioGroup() override;
     virtual void HideDeleteBtn() override;
     virtual void SetInputFields(bool bEnableX, bool bEnableY) override;
-    //from class Window
-    virtual void    SetText( const OUString& rStr ) override;
+    virtual void SetText( const OUString& rStr ) override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdInsertLayerDlg_Impl : public AbstractSdInsertLayerDlg
@@ -219,8 +255,11 @@ public:
     }
     virtual short   Execute() override;
     virtual void    GetAttr( SfxItemSet& rOutAttrs ) override ;
-    //from class Window
     virtual void    SetHelpId( const OString& rHelpId ) override ;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdInsertPagesObjsDlg_Impl : public AbstractSdInsertPagesObjsDlg
@@ -236,6 +275,10 @@ public:
     virtual std::vector<OUString> GetList ( const sal_uInt16 nType ) override;
     virtual bool        IsLink() override;
     virtual bool        IsRemoveUnnessesaryMasterPages() const override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractMorphDlg_Impl : public AbstractMorphDlg
@@ -252,6 +295,10 @@ public:
     virtual sal_uInt16      GetFadeSteps() const override;
     virtual bool            IsAttributeFade() const override ;
     virtual bool            IsOrientationFade() const override ;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdStartPresDlg_Impl : public AbstractSdStartPresDlg
@@ -265,6 +312,10 @@ public:
     }
     virtual short   Execute() override;
     virtual void    GetAttr( SfxItemSet& rOutAttrs ) override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdPresLayoutDlg_Impl : public AbstractSdPresLayoutDlg
@@ -278,6 +329,10 @@ public:
     }
     virtual short   Execute() override;
     virtual void    GetAttr(SfxItemSet& rOutAttrs) override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class SdAbstractSfxDialog_Impl : public SfxAbstractDialog
@@ -305,6 +360,10 @@ public:
     }
     virtual short Execute() override;
     virtual const GDIMetaFile&  GetGDIMetaFile() const override ;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractSdPublishingDlg_Impl :public AbstractSdPublishingDlg
@@ -318,6 +377,10 @@ public:
     }
     virtual short Execute() override;
     virtual void GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams ) override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 class AbstractHeaderFooterDialog_Impl :public AbstractHeaderFooterDialog
@@ -331,6 +394,10 @@ public:
     }
     virtual short Execute() override;
     virtual bool  StartExecuteAsync(AsyncContext &rCtx) override;
+
+    // screenshotting
+    virtual BitmapEx createScreenshot() const override;
+    virtual OString GetScreenshotId() const override;
 };
 
 //AbstractDialogFactory_Impl implementations
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 719563505f2d..aaa688347b1b 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -35,6 +35,7 @@
 #include <sfx2/viewsh.hxx>
 #include <unotools/viewoptions.hxx>
 #include <vcl/IDialogRenderable.hxx>
+#include <vcl/virdev.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
 
@@ -94,11 +95,13 @@ typedef std::vector<Data_Impl*> SfxTabDlgData_Impl;
 
 struct TabDlg_Impl
 {
-    bool                bHideResetBtn   : 1;
+    bool                bHideResetBtn : 1;
+    bool                bStarted : 1;
     SfxTabDlgData_Impl  aData;
 
-    explicit TabDlg_Impl( sal_uInt8 nCnt ) :
-        bHideResetBtn   ( false )
+    explicit TabDlg_Impl(sal_uInt8 nCnt)
+        : bHideResetBtn(false)
+        , bStarted(false)
     {
         aData.reserve( nCnt );
     }
@@ -1004,6 +1007,8 @@ void SfxTabDialogController::Start_Impl()
     }
 
     ActivatePageHdl(m_xTabCtrl->get_current_page_ident());
+
+    m_pImpl->bStarted = true;
 }
 
 void SfxTabDialogController::SetCurPageId(const OString& rIdent)
@@ -1120,4 +1125,38 @@ bool SfxTabDialogController::Apply()
     return bApplied;
 }
 
+std::vector<OString> SfxTabDialogController::getAllPageUIXMLDescriptions() const
+{
+    int nPages = m_xTabCtrl->get_n_pages();
+    std::vector<OString> aRet;
+    aRet.reserve(nPages);
+    for (int i = 0; i < nPages; ++i)
+        aRet.push_back(m_xTabCtrl->get_page_ident(i));
+    return aRet;
+}
+
+bool SfxTabDialogController::selectPageByUIXMLDescription(const OString& rUIXMLDescription)
+{
+    ShowPage(rUIXMLDescription);
+    return m_xTabCtrl->get_current_page_ident() == rUIXMLDescription;
+}
+
+BitmapEx SfxTabDialogController::createScreenshot() const
+{
+    // if we haven't run Start_Impl yet, do so now to create the initial pages
+    if (!m_pImpl->bStarted)
+    {
+        const_cast<SfxTabDialogController*>(this)->Start_Impl();
+    }
+
+    VclPtr<VirtualDevice> xDialogSurface(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+    m_xDialog->draw(*xDialogSurface);
+    return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel());
+}
+
+OString SfxTabDialogController::GetScreenshotId() const
+{
+    return m_xDialog->get_help_id();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list