summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-01-21 16:26:38 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2022-01-22 04:48:09 +0100
commitda3931fac6388716de4ac7cd402f635dc0b377e9 (patch)
tree65584997eba1dca3bc8e5fd3cfe24b8b7ae93248 /sw
parent48b4720b309acb23a8580d6eb36a00899509af38 (diff)
tdf#146891 there is a case where "chapter numbering" can be changed
where "Chapter Numbering" is present but the list is editable, so we can't be sure that just adding "Chapter Numbering" for display purposes is safe enough, so add a specific id for the "pseudo" list style and check for that id (instead of the name) to determine the additional case where "Edit" button cannot be enabled Related: tdf#145804 show "Chapter Numbering" as (uneditable) list style Change-Id: I35d852523314c985ea5b7217e9394ac3e9c6e331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128679 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 00e9a3b607bd..205bcacadb6f 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -184,10 +184,12 @@ void SwParagraphNumTabPage::Reset(const SfxItemSet* rSet)
if( aStyle == "Outline")
{
- // tdf#145804 show "Chapter Numbering"
- assert(!m_xNumberStyleBX->get_sensitive() && "pseudo entry shouldn't be editable");
- m_xNumberStyleLB->append_text(msOutlineNumbering);
- m_xNumberStyleLB->set_active_text(msOutlineNumbering);
+ if (m_xNumberStyleLB->find_id("pseudo") == -1)
+ {
+ // tdf#145804 show "Chapter Numbering"
+ m_xNumberStyleLB->append("pseudo", msOutlineNumbering);
+ }
+ m_xNumberStyleLB->set_active_id("pseudo");
m_xNumberStyleLB->save_value();
}
else
@@ -291,8 +293,8 @@ IMPL_LINK_NOARG(SwParagraphNumTabPage, LineCountHdl_Impl, weld::Toggleable&, voi
IMPL_LINK_NOARG(SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl, weld::ComboBox&, void)
{
int numSelectPos = m_xNumberStyleLB->get_active();
- // 0 is "None" and -1 is unselected state
- if (numSelectPos == 0 || numSelectPos == -1)
+ // 0 is "None" and -1 is unselected state and a "pseudo" is uneditable "Chapter Numbering"
+ if (numSelectPos == 0 || numSelectPos == -1 || m_xNumberStyleLB->get_active_id() == "pseudo")
m_xEditNumStyleBtn->set_sensitive(false);
else
m_xEditNumStyleBtn->set_sensitive(true);