From ace21b4b2537a3cf2301fca2ac6f78d0612e911f Mon Sep 17 00:00:00 2001 From: AkshayWarrier Date: Fri, 2 Feb 2024 02:18:24 +0530 Subject: tdf#159372 svx: Add goto dialog Adds a goto page/slide dialog for Impress and Draw similar to Writer. To avoid duplicating code and ui, the dialog is created in svx/ and used in other modules. The old goto dialog in Writer has now been replaced with this dialog. Change-Id: I28f819f0d0734fb2bb08a7b99a628217ef66dba9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162913 Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze Tested-by: Jenkins Reviewed-by: Jim Raykowski --- include/sfx2/sfxsids.hrc | 2 +- include/svx/dialog/gotodlg.hxx | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 include/svx/dialog/gotodlg.hxx (limited to 'include') diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index 176e500c55b3..e2fafac7321a 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -228,7 +228,7 @@ class SvxZoomItem; #define SID_UNPACK TypedWhichId(SID_SFX_START + 1662) // (SID_SFX_START + 1663) used further down #define SID_ATTR_TARGETLANG_STR (SID_SFX_START + 1664) - // FREE +#define SID_GO_TO_PAGE (SID_SFX_START + 1665) #define SID_OUTPUTSTREAM TypedWhichId(SID_SFX_START + 1666) #define SID_IMAGE_ORIENTATION TypedWhichId(SID_SFX_START + 1667) diff --git a/include/svx/dialog/gotodlg.hxx b/include/svx/dialog/gotodlg.hxx new file mode 100644 index 000000000000..304f1352b0db --- /dev/null +++ b/include/svx/dialog/gotodlg.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include +#include + +namespace svx +{ +class SVX_DLLPUBLIC GotoPageDlg final : public weld::GenericDialogController +{ +public: + GotoPageDlg(weld::Window* pParent, const OUString& title, const OUString& label, + sal_uInt16 curPagePos, sal_uInt16 pageCnt); + + sal_uInt16 GetPageSelection() const { return mxMtrPageCtrl->get_text().toUInt32(); } + +private: + sal_uInt16 mnMaxPageCnt; + + std::unique_ptr mxMtrPageCtrl; + std::unique_ptr mxPageNumberLbl; + std::unique_ptr mxPageLbl; + + DECL_LINK(PageModifiedHdl, weld::Entry&, void); +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit