Kaydet (Commit) 50c3352e authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

clean up and reduce indent levels, remove hugely scoped Any

Change-Id: I2681ddb9b9cba0529ea88c5b81c1f060d1df8eb4
üst a9618132
...@@ -576,39 +576,30 @@ uno::Any SwXStyleFamily::getByName(const OUString& rName) ...@@ -576,39 +576,30 @@ uno::Any SwXStyleFamily::getByName(const OUString& rName)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Any aRet;
OUString sStyleName; OUString sStyleName;
SwStyleNameMapper::FillUIName(rName, sStyleName, lcl_GetSwEnumFromSfxEnum ( m_eFamily ), true ); SwStyleNameMapper::FillUIName(rName, sStyleName, lcl_GetSwEnumFromSfxEnum(m_eFamily), true);
if(m_pBasePool) if(!m_pBasePool)
throw uno::RuntimeException();
m_pBasePool->SetSearchMask(m_eFamily);
SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName);
if(!pBase)
throw container::NoSuchElementException();
uno::Reference<style::XStyle> xStyle = _FindStyle(sStyleName);
if(!xStyle.is())
{ {
m_pBasePool->SetSearchMask(m_eFamily); switch(m_eFamily)
SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName);
if(pBase)
{ {
uno::Reference< style::XStyle > xStyle = _FindStyle(sStyleName); case SFX_STYLE_FAMILY_PAGE:
if(!xStyle.is()) xStyle = new SwXPageStyle(*m_pBasePool, m_pDocShell, m_eFamily, sStyleName);
{ break;
switch(m_eFamily) case SFX_STYLE_FAMILY_FRAME:
{ xStyle = new SwXFrameStyle(*m_pBasePool, m_pDocShell->GetDoc(), pBase->GetName());
case SFX_STYLE_FAMILY_PAGE: break;
xStyle = new SwXPageStyle(*m_pBasePool, m_pDocShell, m_eFamily, sStyleName); default:
break; xStyle = new SwXStyle(*m_pBasePool, m_eFamily, m_pDocShell->GetDoc(), sStyleName);
case SFX_STYLE_FAMILY_FRAME:
xStyle = new SwXFrameStyle(*m_pBasePool, m_pDocShell->GetDoc(), pBase->GetName());
break;
default:
xStyle = new SwXStyle(*m_pBasePool, m_eFamily, m_pDocShell->GetDoc(), sStyleName);
}
}
aRet.setValue(&xStyle, cppu::UnoType<style::XStyle>::get());
} }
else
throw container::NoSuchElementException();
} }
else return uno::makeAny(xStyle);
throw uno::RuntimeException();
return aRet;
} }
uno::Sequence< OUString > SwXStyleFamily::getElementNames() throw( uno::RuntimeException, std::exception ) uno::Sequence< OUString > SwXStyleFamily::getElementNames() throw( uno::RuntimeException, std::exception )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment