diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-03 20:03:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-04 17:46:20 +0200 |
commit | 322d8e516b81671c097717f406e821f8edf7f39b (patch) | |
tree | d43b24a0b03e0d0fb490590d974d3dd3fa819b99 | |
parent | 49f26e7dae550aff6ca90b3cda7f89e11ac8cfd4 (diff) |
for these we know what the SearchFamily and GetSearchMask are already
Change-Id: If12f144bb4e9d02a5caafc5ea64dd1dc7b8b5709
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93355
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docdesc.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 36 |
3 files changed, 21 insertions, 21 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 95d530155309..fc4a1fd548b3 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1584,8 +1584,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, { for ( const auto& rRData : aReplList ) { - SfxStyleSheetBase* pSOld = mxStyleSheetPool->Find(rRData.aName, mxStyleSheetPool->GetSearchFamily(), mxStyleSheetPool->GetSearchMask()); - SfxStyleSheetBase* pSNew = mxStyleSheetPool->Find(rRData.aNewName, mxStyleSheetPool->GetSearchFamily(), mxStyleSheetPool->GetSearchMask()); + SfxStyleSheetBase* pSOld = mxStyleSheetPool->Find(rRData.aName, SfxStyleFamily::Page); + SfxStyleSheetBase* pSNew = mxStyleSheetPool->Find(rRData.aNewName, SfxStyleFamily::Page); if (pSOld && pSNew) { diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 59a287e5959d..a832eed9ef9e 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -603,7 +603,7 @@ void SwDoc::BroadcastStyleOperation(const OUString& rName, SfxStyleFamily eFamil if (pPool) { pPool->SetSearchMask(eFamily); - SfxStyleSheetBase* pBase = pPool->Find(rName, pPool->GetSearchFamily(), pPool->GetSearchMask()); + SfxStyleSheetBase* pBase = pPool->Find(rName, eFamily); if (pBase != nullptr) pPool->Broadcast(SfxStyleSheetHint( nOp, *pBase )); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 328334961eb1..2c3c2a60d3cb 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -891,7 +891,7 @@ uno::Any XStyleFamily::getByName(const OUString& rName) if(!m_pBasePool) throw uno::RuntimeException(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily); if(!pBase) throw container::NoSuchElementException(); uno::Reference<style::XStyle> xStyle = FindStyle(sStyleName); @@ -924,7 +924,7 @@ sal_Bool XStyleFamily::hasByName(const OUString& rName) OUString sStyleName; SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily); return nullptr != pBase; } @@ -937,8 +937,8 @@ void XStyleFamily::insertByName(const OUString& rName, const uno::Any& rElement) OUString sStyleName; SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); - SfxStyleSheetBase* pUINameBase = m_pBasePool->Find(sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily); + SfxStyleSheetBase* pUINameBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily); if(pBase || pUINameBase) throw container::ElementExistException(); if(rElement.getValueType().getTypeClass() != uno::TypeClass_INTERFACE) @@ -990,7 +990,7 @@ void XStyleFamily::insertByName(const OUString& rName, const uno::Any& rElement) if (!sParentStyleName.isEmpty()) { m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pParentBase = m_pBasePool->Find(sParentStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pParentBase = m_pBasePool->Find(sParentStyleName, m_rEntry.m_eFamily); if(pParentBase && pParentBase->GetFamily() == m_rEntry.m_eFamily && pParentBase->GetPool() == m_pBasePool) m_pBasePool->SetParent(m_rEntry.m_eFamily, sStyleName, sParentStyleName); @@ -1008,7 +1008,7 @@ void XStyleFamily::replaceByName(const OUString& rName, const uno::Any& rElement OUString sStyleName; SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.m_eFamily); // replacements only for userdefined styles if(!pBase) throw container::NoSuchElementException(); @@ -1070,7 +1070,7 @@ void XStyleFamily::removeByName(const OUString& rName) m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); OUString sName; SwStyleNameMapper::FillUIName(rName, sName, m_rEntry.m_aPoolId); - SfxStyleSheetBase* pBase = m_pBasePool->Find(sName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(sName, m_rEntry.m_eFamily); if(!pBase) throw container::NoSuchElementException(); if (SwGetPoolIdFromName::CellStyle == m_rEntry.m_aPoolId) @@ -1306,7 +1306,7 @@ static bool lcl_InitConditional(SfxStyleSheetBasePool* pBasePool, const SfxStyle if(!pBasePool || eFamily != SfxStyleFamily::Para) return false; pBasePool->SetSearchMask(eFamily); - SfxStyleSheetBase* pBase = pBasePool->Find(rStyleName, pBasePool->GetSearchFamily(), pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = pBasePool->Find(rStyleName, eFamily); SAL_WARN_IF(!pBase, "sw.uno", "where is the style?" ); if(!pBase) return false; @@ -1375,7 +1375,7 @@ OUString SwXStyle::getName() if(!m_pBasePool) return m_sStyleName; m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); SAL_WARN_IF(!pBase, "sw.uno", "where is the style?"); if(!pBase) throw uno::RuntimeException(); @@ -1393,7 +1393,7 @@ void SwXStyle::setName(const OUString& rName) return; } m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); SAL_WARN_IF(!pBase, "sw.uno", "where is the style?"); if(!pBase || !pBase->IsUserDefined()) throw uno::RuntimeException(); @@ -1409,7 +1409,7 @@ sal_Bool SwXStyle::isUserDefined() if(!m_pBasePool) throw uno::RuntimeException(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); //if it is not found it must be non user defined return pBase && pBase->IsUserDefined(); } @@ -1420,7 +1420,7 @@ sal_Bool SwXStyle::isInUse() if(!m_pBasePool) throw uno::RuntimeException(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily, SfxStyleSearchBits::Used); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily, SfxStyleSearchBits::Used); return pBase && pBase->IsUsed(); } @@ -1434,7 +1434,7 @@ OUString SwXStyle::getParentStyle() return m_sParentStyleName; } m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); OUString aString; if(pBase) aString = pBase->GetParent(); @@ -1462,7 +1462,7 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle) return; } m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); if(!pBase) throw uno::RuntimeException(); rtl::Reference<SwDocStyleSheet> xBase(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); @@ -2076,7 +2076,7 @@ void SwXStyle::SetPropertyValues_Impl(const uno::Sequence<OUString>& rPropertyNa { const SfxStyleSearchBits nSaveMask = m_pBasePool->GetSearchMask(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily, nSaveMask); SAL_WARN_IF(!pBase, "sw.uno", "where is the style?"); if(!pBase) @@ -2129,7 +2129,7 @@ SfxStyleSheetBase* SwXStyle::GetStyleSheetBase() return nullptr; const SfxStyleSearchBits nSaveMask = m_pBasePool->GetSearchMask(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily, nSaveMask ); return pBase; } @@ -2521,7 +2521,7 @@ uno::Sequence<beans::PropertyState> SwXStyle::getPropertyStates(const uno::Seque if(!m_pBasePool) throw uno::RuntimeException(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_pBasePool->GetSearchFamily(), m_pBasePool->GetSearchMask()); + SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, m_rEntry.m_eFamily); SAL_WARN_IF(!pBase, "sw.uno", "where is the style?"); if(!pBase) @@ -2819,7 +2819,7 @@ void SwXStyle::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { SfxStyleSheetBasePool& rBP = static_cast<SfxStyleSheetBasePool&>(rBC); rBP.SetSearchMask(m_rEntry.m_eFamily); - SfxStyleSheetBase* pOwnBase = rBP.Find(m_sStyleName, rBP.GetSearchFamily(), rBP.GetSearchMask()); + SfxStyleSheetBase* pOwnBase = rBP.Find(m_sStyleName, m_rEntry.m_eFamily); if(!pOwnBase) { SfxListener::EndListening(rBC); |