sfx2/source/dialog/templdlg.cxx | 23 +++++++++++++++++++++++ sw/inc/poolfmt.hxx | 3 ++- sw/inc/strings.hrc | 1 + sw/qa/python/check_styles.py | 2 +- sw/source/core/doc/DocumentStylePoolManager.cxx | 1 + sw/source/core/doc/SwStyleNameMapper.cxx | 1 + sw/source/ui/chrdlg/pardlg.cxx | 3 ++- sw/source/ui/fmtui/tmpdlg.cxx | 1 + sw/source/uibase/app/docst.cxx | 5 +++++ sw/uiconfig/swriter/ui/numparapage.ui | 2 +- 10 files changed, 38 insertions(+), 4 deletions(-)
New commits: commit a56aa46fcc62227df7dc9a8fa04205e8ff5ed2a1 Author: Anshu <anshukhar...@gmail.com> AuthorDate: Sun Mar 7 23:39:32 2021 +0530 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Mar 29 14:08:10 2021 +0200 tdf#101965 : Add No List default in Styles deck in sidebar Change-Id: I167b379f31809bc252d3c091d0f545f8c2a3f13e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112143 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 608b1790190d..efc99c1af294 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -863,6 +863,15 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const OUString &rStr, bool bIsCal bEntry = mxTreeBox->iter_next(*xEntry); } } + else if (eFam == SfxStyleFamily::Pseudo) + { + std::unique_ptr<weld::TreeIter> xEntry = mxTreeBox->make_iterator(); + if (mxTreeBox->get_iter_first(*xEntry)) + { + mxTreeBox->scroll_to_row(*xEntry); + mxTreeBox->select(*xEntry); + } + } else mxTreeBox->unselect_all(); } @@ -938,6 +947,8 @@ static OUString lcl_GetStyleFamilyName( SfxStyleFamily nFamily ) return "PageStyles"; if(nFamily == SfxStyleFamily::Table) return "TableStyles"; + if (nFamily == SfxStyleFamily::Pseudo) + return "NumberingStyles"; return OUString(); } @@ -947,6 +958,8 @@ OUString SfxCommonTemplateDialog_Impl::getDefaultStyleName( const SfxStyleFamily OUString aFamilyName = lcl_GetStyleFamilyName(eFam); if( aFamilyName == "TableStyles" ) sDefaultStyle = "Default Style"; + else if(aFamilyName == "NumberingStyles") + sDefaultStyle = "No List"; else sDefaultStyle = "Standard"; uno::Reference< style::XStyleFamiliesSupplier > xModel(GetObjectShell()->GetModel(), uno::UNO_QUERY); @@ -2039,6 +2052,16 @@ void SfxCommonTemplateDialog_Impl::CreateContextMenu() mxMenu->set_sensitive("edit", false); mxMenu->set_sensitive("new", false); } + if (pItem && pItem->GetFamily() == SfxStyleFamily::Pseudo) + { + const OUString aTemplName(GetSelectedEntry()); + if (aTemplName == "No List") + { + mxMenu->set_sensitive("edit", false); + mxMenu->set_sensitive("new", false); + mxMenu->set_sensitive("hide", false); + } + } } SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanelControl* pDlgWindow) diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx index 56f787d5e46a..358747e37808 100644 --- a/sw/inc/poolfmt.hxx +++ b/sw/inc/poolfmt.hxx @@ -185,7 +185,8 @@ RES_POOLPAGE_END enum RES_POOL_NUMRULE_TYPE { RES_POOLNUMRULE_BEGIN = POOLGRP_NUMRULE, -RES_POOLNUMRULE_NUM1 = RES_POOLNUMRULE_BEGIN, ///< NumRule Numbering 123. +RES_POOLNUMRULE_NOLIST = RES_POOLNUMRULE_BEGIN, +RES_POOLNUMRULE_NUM1, ///< NumRule Numbering 123. RES_POOLNUMRULE_NUM2, ///< NumRule Numbering ABC. RES_POOLNUMRULE_NUM3, ///< NumRule Numbering abc. RES_POOLNUMRULE_NUM4, ///< NumRule Numbering IVX. diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index e234e3162949..f9914efa4742 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -211,6 +211,7 @@ #define STR_POOLPAGE_ENDNOTE NC_("STR_POOLPAGE_ENDNOTE", "Endnote") #define STR_POOLPAGE_LANDSCAPE NC_("STR_POOLPAGE_LANDSCAPE", "Landscape") // Numbering rules +#define STR_POOLNUMRULE_NOLIST NC_("STR_POOLNUMRULE_NOLIST", "No List") #define STR_POOLNUMRULE_NUM1 NC_("STR_POOLNUMRULE_NUM1", "Numbering 123") #define STR_POOLNUMRULE_NUM2 NC_("STR_POOLNUMRULE_NUM2", "Numbering ABC") #define STR_POOLNUMRULE_NUM3 NC_("STR_POOLNUMRULE_NUM3", "Numbering abc") diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py index c2ae21cf9899..48a46a770988 100644 --- a/sw/qa/python/check_styles.py +++ b/sw/qa/python/check_styles.py @@ -159,7 +159,7 @@ class CheckStyle(unittest.TestCase): def test_NumberingFamily(self): xDoc = CheckStyle._uno.openEmptyWriterDoc() xNumberingStyles = xDoc.StyleFamilies["NumberingStyles"] - vEmptyDocStyles = ['List 1', 'List 2', 'List 3', 'List 4', 'List 5', 'Numbering 123', 'Numbering ABC', 'Numbering abc', 'Numbering IVX', 'Numbering ivx'] + vEmptyDocStyles = ['No List','List 1', 'List 2', 'List 3', 'List 4', 'List 5', 'Numbering 123', 'Numbering ABC', 'Numbering abc', 'Numbering IVX', 'Numbering ivx'] self.__test_StyleFamily(xNumberingStyles, vEmptyDocStyles, "SwXStyle") self.__test_StyleFamilyIndex(xNumberingStyles, vEmptyDocStyles, "SwXStyle") self.__test_StyleFamilyInsert(xDoc, xNumberingStyles, vEmptyDocStyles, "com.sun.star.style.NumberingStyle", "com.sun.star.style.CharacterStyle") diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index b2f2b09e1b54..7fa92a05befe 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -516,6 +516,7 @@ static const char* STR_POOLPAGE_ARY[] = static const char* STR_POOLNUMRULE_NUM_ARY[] = { // Numbering styles + STR_POOLNUMRULE_NOLIST, STR_POOLNUMRULE_NUM1, STR_POOLNUMRULE_NUM2, STR_POOLNUMRULE_NUM3, diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx index b7753c33773a..7635a9771e8c 100644 --- a/sw/source/core/doc/SwStyleNameMapper.cxx +++ b/sw/source/core/doc/SwStyleNameMapper.cxx @@ -709,6 +709,7 @@ const std::vector<OUString>& SwStyleNameMapper::GetPageDescProgNameArray() const std::vector<OUString>& SwStyleNameMapper::GetNumRuleProgNameArray() { static const std::vector<OUString> s_aNumRuleProgNameArray = { + "No List", "Numbering 123", // STR_POOLNUMRULE_PRGM_NUM1 "Numbering ABC", "Numbering abc", diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index e64932300c3b..336669241daa 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -215,7 +215,8 @@ void SwParaDlg::PageCreated(const OString& rId, SfxTabPage& rPage) aNames.insert(pBase->GetName()); pBase = pPool->Next(); } - for(const auto& rName : aNames) + aNames.erase("No List"); + for (const auto& rName : aNames) rBox.append_text(rName); } // inits for Area and Transparency TabPages diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index ff6dd3e6bb45..7c6ac6406fe3 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -460,6 +460,7 @@ void SwTemplateDlgController::PageCreated(const OString& rId, SfxTabPage &rPage aNames.insert(pBase->GetName()); pBase = pPool->Next(); } + aNames.erase("No List"); for(std::set<OUString>::const_iterator it = aNames.begin(); it != aNames.end(); ++it) rBox.append_text(*it); } diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 99939d0b5155..ac044a5589a0 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -1159,6 +1159,11 @@ SfxStyleFamily SwDocShell::ApplyStyles(const OUString &rName, SfxStyleFamily nFa // reset indent attribute on applying list style // continue list of list style const SwNumRule* pNumRule = pStyle->GetNumRule(); + if (pNumRule->GetName() == "No List") + { + SfxViewFrame::Current()->GetDispatcher()->Execute(FN_NUM_BULLET_OFF); + break; + } const OUString sListIdForStyle =pNumRule->GetDefaultListId(); pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true ); break; diff --git a/sw/uiconfig/swriter/ui/numparapage.ui b/sw/uiconfig/swriter/ui/numparapage.ui index ff1c1a817062..cb8f931c21da 100644 --- a/sw/uiconfig/swriter/ui/numparapage.ui +++ b/sw/uiconfig/swriter/ui/numparapage.ui @@ -144,7 +144,7 @@ <property name="can_focus">False</property> <property name="tooltip_text" translatable="yes" context="numparapage|comboLB_NUMBER_STYLE">Assigned List Style</property> <items> - <item translatable="yes" context="numparapage|comboLB_NUMBER_STYLE">None</item> + <item translatable="yes" context="numparapage|comboLB_NUMBER_STYLE">No List</item> </items> <child internal-child="accessible"> <object class="AtkObject" id="comboLB_NUMBER_STYLE-atkobject"> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits