diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-05 10:57:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-05 13:41:03 +0200 |
commit | a5bbbba632c6aecb8cf24d906b05f145dea1fc41 (patch) | |
tree | e4ee31230a6247a4932b6840bfc33e3a6fb05de3 /sfx2/source | |
parent | a46cf617e39be24f16d074c836d558eaa7f1f336 (diff) |
make the family and mask explicit in SfxStyleSheetBasePool::First
Change-Id: I36655b65ca00e5f7b8779a28d4a1778c8e35dc4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93461
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 17 | ||||
-rw-r--r-- | sfx2/source/styles/StyleManager.cxx | 2 |
3 files changed, 11 insertions, 14 deletions
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 44aba7480eaf..5598880e2189 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -104,7 +104,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(weld::Container* pPage, weld::D if ( pPool ) { pPool->SetSearchMask( pStyle->GetFamily() ); - pPool->First(); // for SW - update internal list + pPool->First(pStyle->GetFamily()); // for SW - update internal list } if ( pStyle->GetName().isEmpty() && pPool ) @@ -128,7 +128,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(weld::Container* pPage, weld::D if ( pStyle->HasFollowSupport() && pPool ) { - SfxStyleSheetBase* pPoolStyle = pPool->First(); + SfxStyleSheetBase* pPoolStyle = pPool->First(pStyle->GetFamily()); m_xFollowLb->freeze(); @@ -161,7 +161,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(weld::Container* pPage, weld::D // the base template can be set to NULL m_xBaseLb->append_text(SfxResId(STR_NONE)); - SfxStyleSheetBase* pPoolStyle = pPool->First(); + SfxStyleSheetBase* pPoolStyle = pPool->First(pStyle->GetFamily()); while ( pPoolStyle ) { diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 1493bcc8a23d..b56583362026 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -906,7 +906,7 @@ void SfxCommonTemplateDialog_Impl::EnableTreeDrag(bool bEnable) { if (pStyleSheetPool) { - SfxStyleSheetBase* pStyle = pStyleSheetPool->First(); + SfxStyleSheetBase* pStyle = pStyleSheetPool->First(pStyleSheetPool->GetSearchFamily(), pStyleSheetPool->GetSearchMask()); bAllowReParentDrop = pStyle && pStyle->HasParentSupport() && bEnable; } bTreeDrag = bEnable; @@ -962,7 +962,7 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox() const SfxStyleFamily eFam = pItem->GetFamily(); pStyleSheetPool->SetSearchMask(eFam, SfxStyleSearchBits::AllVisible); StyleTreeArr_Impl aArr; - SfxStyleSheetBase* pStyle = pStyleSheetPool->First(); + SfxStyleSheetBase* pStyle = pStyleSheetPool->First(eFam, SfxStyleSearchBits::AllVisible); bAllowReParentDrop = pStyle && pStyle->HasParentSupport() && bTreeDrag; @@ -1041,7 +1041,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags) const SfxStyleFamily eFam = pItem->GetFamily(); SfxStyleSearchBits nFilter (nActFilter < pItem->GetFilterList().size() ? pItem->GetFilterList()[nActFilter].nFlags : SfxStyleSearchBits::Auto); - if(nFilter == SfxStyleSearchBits::Auto) // automatic + if (nFilter == SfxStyleSearchBits::Auto) // automatic nFilter = nAppFilter; OSL_ENSURE(pStyleSheetPool, "no StyleSheetPool"); @@ -1061,10 +1061,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags) mxFilterLb->append(OUString::number(static_cast<int>(SfxStyleSearchBits::All)), SfxResId(STR_STYLE_FILTER_HIERARCHICAL)); const SfxStyleFilter& rFilter = pItem->GetFilterList(); for (const SfxFilterTuple& i : rFilter) - { - SfxStyleSearchBits nFilterFlags = i.nFlags; - mxFilterLb->append(OUString::number(static_cast<int>(nFilterFlags)), i.aName); - } + mxFilterLb->append(OUString::number(static_cast<int>(i.nFlags)), i.aName); mxFilterLb->thaw(); if (nActFilter < mxFilterLb->get_count() - 1) @@ -1073,8 +1070,8 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags) { nActFilter = 0; mxFilterLb->set_active(1); - SfxStyleSearchBits nFilterFlags = (nActFilter < rFilter.size()) ? rFilter[nActFilter].nFlags : SfxStyleSearchBits::Auto; - pStyleSheetPool->SetSearchMask(eFam, nFilterFlags); + nFilter = (nActFilter < rFilter.size()) ? rFilter[nActFilter].nFlags : SfxStyleSearchBits::Auto; + pStyleSheetPool->SetSearchMask(eFam, nFilter); } // if the tree view again, select family hierarchy @@ -1100,7 +1097,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags) EnableItem("watercan", false); - SfxStyleSheetBase *pStyle = pStyleSheetPool->First(); + SfxStyleSheetBase *pStyle = pStyleSheetPool->First(eFam, nFilter); std::unique_ptr<weld::TreeIter> xEntry = mxFmtLb->make_iterator(); bool bEntry = mxFmtLb->get_iter_first(*xEntry); diff --git a/sfx2/source/styles/StyleManager.cxx b/sfx2/source/styles/StyleManager.cxx index 7d1525ebccac..83fc314d8407 100644 --- a/sfx2/source/styles/StyleManager.cxx +++ b/sfx2/source/styles/StyleManager.cxx @@ -20,7 +20,7 @@ SfxStyleSheetBase* StyleManager::Search(const OUString& rStyleName, SfxStyleFami pPool->SetSearchMask(eFamily); - SfxStyleSheetBase* pStyle = pPool->First(); + SfxStyleSheetBase* pStyle = pPool->First(eFamily); while (pStyle) { if (rStyleName == pStyle->GetName()) |