summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-03-08 11:11:22 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-03-08 11:12:18 +0100
commit879325fcf7b9cbf9376bdd0260bbaa943234a654 (patch)
treeddb89591eebf8ff3625c7837c9bb0fda4923125a /writerfilter
parent294b86e3dbbdb9b136cb17a51687f4e2762711cf (diff)
rtftok: get rid of unnecessary lcl_getNumPr()
The more generic lcl_putNestedSprm() can be used instead.
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx26
1 files changed, 3 insertions, 23 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index ec01aac976b9..82b1614d88d2 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -70,21 +70,6 @@ using rtl::OUStringToOString;
namespace writerfilter {
namespace rtftok {
-static RTFSprms& lcl_getNumPr(std::stack<RTFParserState>& aStates)
-{
- // insert the numpr sprm if necessary
- RTFValue::Pointer_t p = aStates.top().aParagraphSprms.find(NS_ooxml::LN_CT_PPrBase_numPr);
- if (!p.get())
- {
- RTFSprms aAttributes;
- RTFSprms aSprms;
- RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
- aStates.top().aParagraphSprms->push_back(make_pair(NS_ooxml::LN_CT_PPrBase_numPr, pValue));
- p = aStates.top().aParagraphSprms.find(NS_ooxml::LN_CT_PPrBase_numPr);
- }
- return p->getSprms();
-}
-
static Id lcl_getParagraphBorder(sal_uInt32 nIndex)
{
static const Id aBorderIds[] =
@@ -2337,10 +2322,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
}
break;
case RTF_ILVL:
- {
- RTFSprms& rSprms = lcl_getNumPr(m_aStates);
- rSprms->push_back(make_pair(NS_sprm::LN_PIlvl, pIntValue));
- }
+ lcl_putNestedSprm(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_numPr, NS_sprm::LN_PIlvl, pIntValue);
+ break;
case RTF_LISTTEMPLATEID:
// This one is not referenced anywhere, so it's pointless to store it at the moment.
break;
@@ -2357,10 +2340,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY)
m_aStates.top().aTableAttributes->push_back(make_pair(NS_rtf::LN_LSID, pIntValue));
else
- {
- RTFSprms& rSprms = lcl_getNumPr(m_aStates);
- rSprms->push_back(make_pair(NS_sprm::LN_PIlfo, pIntValue));
- }
+ lcl_putNestedSprm(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_tabs, NS_sprm::LN_PIlfo, pIntValue);
}
break;
case RTF_UC: