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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 45 |
1 files changed, 42 insertions, 3 deletions
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: */ |