From 13a9727a6399df8df0b2719adb094c81e147a3e8 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 15 Jun 2016 17:57:39 +0200 Subject: screenshots: added more virtualization/abstraction TabPabe Identification to UI-File names. Isolated some data initialization constructs. Added more dialogs to dump. Should dump on all systems now Change-Id: I7ee07309e0bf88064f789c13bcbff93c17370f77 --- include/sfx2/tabdlg.hxx | 4 ++-- include/vcl/abstdlg.hxx | 4 ++-- include/vcl/builder.hxx | 15 +++++++++++++++ include/vcl/dialog.hxx | 4 ++-- sd/source/filter/html/pubdlg.cxx | 13 +++++++------ sd/source/ui/dlg/sddlgfact.hxx | 8 ++++---- sd/source/ui/inc/pubdlg.hxx | 4 ++-- sfx2/source/dialog/tabdlg.cxx | 24 +++++++++++------------- vcl/source/window/abstdlg.cxx | 9 +++++---- vcl/source/window/dialog.cxx | 9 +++++---- 10 files changed, 55 insertions(+), 39 deletions(-) diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index 85429068d0a8..d80d269c2293 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -204,8 +204,8 @@ public: virtual FactoryFunction GetUITestFactory() const override; // Screenshot interface - virtual std::vector getAllPageUIXMLDescriptions() const override; - virtual void selectPageByUIXMLDescription(const OUString& rUIXMLDescription) override; + virtual std::vector getAllPageUIXMLDescriptions() const override; + virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; }; namespace sfx { class ItemConnectionBase; } diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index da45dbe2f13a..daa897d83647 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -35,8 +35,8 @@ public: virtual short Execute() = 0; // Screenshot interface - virtual std::vector getAllPageUIXMLDescriptions() const; - virtual void selectPageByUIXMLDescription(const OUString& rUIXMLDescription); + virtual std::vector getAllPageUIXMLDescriptions() const; + virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription); virtual Bitmap createScreenshot() const; }; diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 787f6ea30b81..33f42da12023 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -110,6 +110,12 @@ public: const css::uno::Reference& getFrame() { return m_xFrame; } + /// return UI-File name (without '.ui') + const OString& getUIFile() const + { + return m_sHelpRoot; + } + private: VclBuilder(const VclBuilder&) = delete; VclBuilder& operator=(const VclBuilder&) = delete; @@ -462,6 +468,15 @@ public: return; m_pUIBuilder->setDeferredProperties(); } + OString getUIFile() const + { + if (m_pUIBuilder) + { + return m_pUIBuilder->getUIFile(); + } + + return OString(); + } protected: VclBuilder *m_pUIBuilder; diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index a1ec41f9825d..6946d6487b75 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -101,8 +101,8 @@ public: virtual void PostPaint(vcl::RenderContext& rRenderContext) override; // Screenshot interface - virtual std::vector getAllPageUIXMLDescriptions() const; - virtual void selectPageByUIXMLDescription(const OUString& rUIXMLDescription); + virtual std::vector getAllPageUIXMLDescriptions() const; + virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription); Bitmap createScreenshot(); virtual short Execute(); diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 2b913abdc537..7476251ca319 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -1586,20 +1586,20 @@ bool SdPublishingDlg::Save() return( aMedium.GetError() == 0 ); } -std::vector SdPublishingDlg::getAllPageUIXMLDescriptions() const +std::vector SdPublishingDlg::getAllPageUIXMLDescriptions() const { // this dialog has a hard number of pages - std::vector aRetval; + std::vector aRetval; for (sal_uInt32 a(0); a < 6; a++) { - aRetval.push_back(OUString::number(a)); + aRetval.push_back(OString::number(a)); } return aRetval; } -void SdPublishingDlg::selectPageByUIXMLDescription(const OUString& rUIXMLDescription) +bool SdPublishingDlg::selectPageByUIXMLDescription(const OString& rUIXMLDescription) { // rUIXMLDescription contains one of the values above, make use of it const sal_uInt32 nPage(rUIXMLDescription.toUInt32()); @@ -1607,9 +1607,10 @@ void SdPublishingDlg::selectPageByUIXMLDescription(const OUString& rUIXMLDescrip if (nPage < 6) { aAssistentFunc.GotoPage(nPage + 1); - - // does this already call 'ChangePage()'..? Check! + return true; } + + return false; } // SdDesignNameDlg Methods diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index c9a9352212bf..72b0505b6a2e 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -29,15 +29,15 @@ public: \ : pDlg(p) \ { \ } \ - virtual std::vector getAllPageUIXMLDescriptions() const override; \ - virtual void selectPageByUIXMLDescription(const OUString& rUIXMLDescription) override; \ + virtual std::vector getAllPageUIXMLDescriptions() const override; \ + virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; \ virtual Bitmap createScreenshot() const override; \ virtual ~Class(); \ virtual short Execute() override ; #define IMPL_ABSTDLG_BASE(Class) \ -std::vector Class::getAllPageUIXMLDescriptions() const { return pDlg->getAllPageUIXMLDescriptions(); } \ -void Class::selectPageByUIXMLDescription(const OUString& rUIXMLDescription) { pDlg->selectPageByUIXMLDescription(rUIXMLDescription); } \ +std::vector Class::getAllPageUIXMLDescriptions() const { return pDlg->getAllPageUIXMLDescriptions(); } \ +bool Class::selectPageByUIXMLDescription(const OString& rUIXMLDescription) { return pDlg->selectPageByUIXMLDescription(rUIXMLDescription); } \ Bitmap Class::createScreenshot() const { return pDlg->createScreenshot();} \ Class::~Class() \ { \ diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx index f5156e0ea79b..5b4f3763b9a5 100644 --- a/sd/source/ui/inc/pubdlg.hxx +++ b/sd/source/ui/inc/pubdlg.hxx @@ -202,8 +202,8 @@ public: void GetParameterSequence( css::uno::Sequence< css::beans::PropertyValue >& rParams ); // Screenshot interface - virtual std::vector getAllPageUIXMLDescriptions() const override; - virtual void selectPageByUIXMLDescription(const OUString& rUIXMLDescription) override; + virtual std::vector getAllPageUIXMLDescriptions() const override; + virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override; }; #endif // INCLUDED_SD_SOURCE_UI_INC_PUBDLG_HXX diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index b8f4041b025e..cb6842f99efb 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -1332,9 +1332,9 @@ FactoryFunction SfxTabDialog::GetUITestFactory() const return SfxTabDialogUIObject::create; } -std::vector SfxTabDialog::getAllPageUIXMLDescriptions() const +std::vector SfxTabDialog::getAllPageUIXMLDescriptions() const { - std::vector aRetval; + std::vector aRetval; for (SfxTabDlgData_Impl::const_iterator it = pImpl->aData.begin(); it != pImpl->aData.end(); ++it) { @@ -1349,21 +1349,17 @@ std::vector SfxTabDialog::getAllPageUIXMLDescriptions() const if (pCandidate) { - // for now, use IDs, later change to UI-Strings - aRetval.push_back(OUString::number((*it)->nId)); + // use UIXMLDescription (without '.ui', with '/') + aRetval.push_back(pCandidate->getUIFile()); } } return aRetval; } -void SfxTabDialog::selectPageByUIXMLDescription(const OUString& rUIXMLDescription) +bool SfxTabDialog::selectPageByUIXMLDescription(const OString& rUIXMLDescription) { - // for now, use IDs, later change to UI-Strings - const sal_uInt16 nTargetId((sal_uInt16)rUIXMLDescription.toUInt32()); - bool bDone(false); - - for (SfxTabDlgData_Impl::const_iterator it = pImpl->aData.begin(); !bDone && it != pImpl->aData.end(); ++it) + for (SfxTabDlgData_Impl::const_iterator it = pImpl->aData.begin(); it != pImpl->aData.end(); ++it) { SfxTabPage* pCandidate = (*it)->pTabPage; @@ -1374,12 +1370,14 @@ void SfxTabDialog::selectPageByUIXMLDescription(const OUString& rUIXMLDescriptio pCandidate = GetTabPage((*it)->nId); } - if (pCandidate && (*it)->nId == nTargetId) + if (pCandidate && pCandidate->getUIFile() == rUIXMLDescription) { - ShowPage(nTargetId); - bDone = true; + ShowPage((*it)->nId); + return true; } } + + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx index ebed762f3542..260055ff8566 100644 --- a/vcl/source/window/abstdlg.cxx +++ b/vcl/source/window/abstdlg.cxx @@ -57,15 +57,16 @@ VclAbstractDialog::~VclAbstractDialog() { } -std::vector VclAbstractDialog::getAllPageUIXMLDescriptions() const +std::vector VclAbstractDialog::getAllPageUIXMLDescriptions() const { // default has no pages - return std::vector(); + return std::vector(); } -void VclAbstractDialog::selectPageByUIXMLDescription(const OUString& /*rUIXMLDescription*/) +bool VclAbstractDialog::selectPageByUIXMLDescription(const OString& /*rUIXMLDescription*/) { - // default cannot select a page + // default cannot select a page (which is okay, return true) + return true; } Bitmap VclAbstractDialog::createScreenshot() const diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 837791ef012e..910d6ee2aba5 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -843,15 +843,16 @@ void Dialog::PostPaint(vcl::RenderContext& rRenderContext) mbPaintComplete = true; } -std::vector Dialog::getAllPageUIXMLDescriptions() const +std::vector Dialog::getAllPageUIXMLDescriptions() const { // default has no pages - return std::vector(); + return std::vector(); } -void Dialog::selectPageByUIXMLDescription(const OUString& /*rUIXMLDescription*/) +bool Dialog::selectPageByUIXMLDescription(const OString& /*rUIXMLDescription*/) { - // default cannot select anything + // default cannot select anything (which is okay, return true) + return true; } Bitmap Dialog::createScreenshot() -- cgit v1.2.3