[Libreoffice-commits] core.git: 2 commits - oox/source writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sun Mar 22 10:27:01 PDT 2015
oox/source/core/filterbase.cxx | 9 +++--
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 38 +++++++++++--------------
2 files changed, 23 insertions(+), 24 deletions(-)
New commits:
commit 4c414d3b1d69e3dd33344f062188951dbe18899c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Mar 22 18:26:09 2015 +0100
boost::shared_ptr -> std::shared_ptr
Change-Id: I8d08a5865a0e7b40ed9efc2be156957f8f4a2f49
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index cfa2796..f56397e 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -34,6 +34,7 @@
#include <osl/diagnose.h>
#include <rtl/instance.hxx>
#include <rtl/uri.hxx>
+#include <memory>
#include <set>
#include "oox/core/filterbase.hxx"
@@ -118,10 +119,10 @@ enum FilterDirection
struct FilterBaseImpl
{
- typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef;
- typedef ::boost::shared_ptr< ModelObjectHelper > ModelObjHelperRef;
- typedef ::boost::shared_ptr< OleObjectHelper > OleObjHelperRef;
- typedef ::boost::shared_ptr< VbaProject > VbaProjectRef;
+ typedef std::shared_ptr< GraphicHelper > GraphicHelperRef;
+ typedef std::shared_ptr< ModelObjectHelper > ModelObjHelperRef;
+ typedef std::shared_ptr< OleObjectHelper > OleObjHelperRef;
+ typedef std::shared_ptr< VbaProject > VbaProjectRef;
FilterDirection meDirection;
SequenceAsHashMap maArguments;
commit 809c401ae15dc26b1e9bcee06db944903c468c89
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Mar 22 16:28:13 2015 +0100
Use std::make_shared<>
Change-Id: I93edddca93e1c1c7aa88a3bd9aaefe7af855d1d0
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2abd5c7..a1f9007 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3530,12 +3530,12 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
nValue = NS_ooxml::LN_Value_ST_Jc_right;
break;
}
- pIntValue.reset(new RTFValue(nValue));
+ pIntValue = std::make_shared<RTFValue>(nValue);
break;
}
case RTF_LEVELNFC:
nSprm = NS_ooxml::LN_CT_Lvl_numFmt;
- pIntValue.reset(new RTFValue(lcl_getNumberFormat(nParam)));
+ pIntValue = std::make_shared<RTFValue>(lcl_getNumberFormat(nParam));
break;
case RTF_LEVELSTARTAT:
nSprm = NS_ooxml::LN_CT_Lvl_start;
@@ -3545,7 +3545,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break;
case RTF_SBASEDON:
nSprm = NS_ooxml::LN_CT_Style_basedOn;
- pIntValue.reset(new RTFValue(getStyleName(nParam)));
+ pIntValue = std::make_shared<RTFValue>(getStyleName(nParam));
break;
default:
break;
@@ -4971,10 +4971,8 @@ RTFError RTFDocumentImpl::pushState()
writerfilter::Reference<Properties>::Pointer_t
RTFDocumentImpl::createStyleProperties()
{
- RTFValue::Pointer_t const pParaProps(
- new RTFValue(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms));
- RTFValue::Pointer_t const pCharProps(
- new RTFValue(m_aStates.top().aCharacterAttributes, m_aStates.top().aCharacterSprms));
+ RTFValue::Pointer_t pParaProps = std::make_shared<RTFValue>(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms);
+ RTFValue::Pointer_t pCharProps = std::make_shared<RTFValue>(m_aStates.top().aCharacterAttributes, m_aStates.top().aCharacterSprms);
// resetSprms will clean up this modification
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Style_pPr, pParaProps);
@@ -6313,52 +6311,52 @@ RTFSprms RTFFrame::getSprms()
{
case NS_ooxml::LN_CT_FramePr_x:
if (nX != 0)
- pValue.reset(new RTFValue(nX));
+ pValue = std::make_shared<RTFValue>(nX);
break;
case NS_ooxml::LN_CT_FramePr_y:
if (nY != 0)
- pValue.reset(new RTFValue(nY));
+ pValue = std::make_shared<RTFValue>(nY);
break;
case NS_ooxml::LN_CT_FramePr_h:
if (nH != 0)
{
if (nHRule == NS_ooxml::LN_Value_doc_ST_HeightRule_exact)
- pValue.reset(new RTFValue(-nH)); // The negative value just sets nHRule
+ pValue = std::make_shared<RTFValue>(-nH); // The negative value just sets nHRule
else
- pValue.reset(new RTFValue(nH));
+ pValue = std::make_shared<RTFValue>(nH);
}
break;
case NS_ooxml::LN_CT_FramePr_w:
if (nW != 0)
- pValue.reset(new RTFValue(nW));
+ pValue = std::make_shared<RTFValue>(nW);
break;
case NS_ooxml::LN_CT_FramePr_hSpace:
if (nHoriPadding != 0)
- pValue.reset(new RTFValue(nHoriPadding));
+ pValue = std::make_shared<RTFValue>(nHoriPadding);
break;
case NS_ooxml::LN_CT_FramePr_vSpace:
if (nVertPadding != 0)
- pValue.reset(new RTFValue(nVertPadding));
+ pValue = std::make_shared<RTFValue>(nVertPadding);
break;
case NS_ooxml::LN_CT_FramePr_hAnchor:
{
if (nHoriAnchor == 0)
nHoriAnchor = NS_ooxml::LN_Value_doc_ST_HAnchor_margin;
- pValue.reset(new RTFValue(nHoriAnchor));
+ pValue = std::make_shared<RTFValue>(nHoriAnchor);
}
break;
case NS_ooxml::LN_CT_FramePr_vAnchor:
{
if (nVertAnchor == 0)
nVertAnchor = NS_ooxml::LN_Value_doc_ST_VAnchor_margin;
- pValue.reset(new RTFValue(nVertAnchor));
+ pValue = std::make_shared<RTFValue>(nVertAnchor);
}
break;
case NS_ooxml::LN_CT_FramePr_xAlign:
- pValue.reset(new RTFValue(nHoriAlign));
+ pValue = std::make_shared<RTFValue>(nHoriAlign);
break;
case NS_ooxml::LN_CT_FramePr_yAlign:
- pValue.reset(new RTFValue(nVertAlign));
+ pValue = std::make_shared<RTFValue>(nVertAlign);
break;
case NS_ooxml::LN_CT_FramePr_hRule:
{
@@ -6366,12 +6364,12 @@ RTFSprms RTFFrame::getSprms()
nHRule = NS_ooxml::LN_Value_doc_ST_HeightRule_exact;
else if (nH > 0)
nHRule = NS_ooxml::LN_Value_doc_ST_HeightRule_atLeast;
- pValue.reset(new RTFValue(nHRule));
+ pValue = std::make_shared<RTFValue>(nHRule);
}
break;
case NS_ooxml::LN_CT_FramePr_wrap:
if (oWrap)
- pValue.reset(new RTFValue(*oWrap));
+ pValue = std::make_shared<RTFValue>(*oWrap);
break;
default:
break;
More information about the Libreoffice-commits
mailing list