tdf#173170 Don’t show the “resize all pages” checkbox if not requested
If the caller of the dialog doesn’t request the SID_ATTR_RESIZE_ALL_PAGES attribute then the checkbox to configure whether to resize all pages will now be hidden. This fixes the problem that the checkbox was shown in Writer and Calc but it actually only has any effect in Draw and Impress. Change-Id: I47a0d5320071c00830f5e95ad3d6753c56ecc0f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209413 Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
|
||||
#
|
||||
|
||||
from uitest.framework import UITestCase
|
||||
from uitest.uihelper.common import get_state_as_dict
|
||||
|
||||
|
||||
class PageTabTest(UITestCase):
|
||||
# Tests that the “Resize all pages” checkbox is only visible when the dialog is opened from a
|
||||
# Draw or Impress document and not from Writer or Calc. See tdf#173170
|
||||
def test_resize_all_visibility(self):
|
||||
with self.ui_test.create_doc_in_start_center("impress") as xComponent:
|
||||
xTemplate = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(xTemplate.getChild("close"))
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xDialog:
|
||||
xResizeCheckBox = xDialog.getChild("checkResizeAllPages")
|
||||
self.assertEqual(get_state_as_dict(xResizeCheckBox)["ReallyVisible"], "true")
|
||||
|
||||
with self.ui_test.create_doc_in_start_center("draw") as xComponent:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xDialog:
|
||||
xResizeCheckBox = xDialog.getChild("checkResizeAllPages")
|
||||
self.assertEqual(get_state_as_dict(xResizeCheckBox)["ReallyVisible"], "true")
|
||||
|
||||
with self.ui_test.create_doc_in_start_center("writer") as xComponent:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
|
||||
xResizeCheckBox = xDialog.getChild("checkResizeAllPages")
|
||||
self.assertEqual(get_state_as_dict(xResizeCheckBox)["ReallyVisible"], "false")
|
||||
|
||||
with self.ui_test.create_doc_in_start_center("calc") as xComponent:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog") as xDialog:
|
||||
xResizeCheckBox = xDialog.getChild("checkResizeAllPages")
|
||||
self.assertEqual(get_state_as_dict(xResizeCheckBox)["ReallyVisible"], "false")
|
||||
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
@@ -300,6 +300,10 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController*
|
||||
|
||||
// Get the i18n framework numberings and add them to the listbox.
|
||||
SvxNumOptionsTabPageHelper::GetI18nNumbering(m_xNumberFormatBox->get_widget(), std::numeric_limits<sal_uInt16>::max());
|
||||
|
||||
// Hide the “resize all pages” checkbox if the attribute isn’t used. tdf#173170
|
||||
if (!rAttr.HasItem(SID_ATTR_RESIZE_ALL_PAGES))
|
||||
m_xResizeAllPages->set_visible(false);
|
||||
}
|
||||
|
||||
SvxPageDescPage::~SvxPageDescPage()
|
||||
|
||||
Reference in New Issue
Block a user