diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-17 16:40:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-18 11:00:17 +0000 |
commit | c19c242ec0757d5d5f2936e2a57430e39c692b2b (patch) | |
tree | fe8f71cab2739904472e74597e04aadefd9d19dc /sw/source | |
parent | 1215efbf616024bc262f94c38038d6de6d960b17 (diff) |
boost->std
Change-Id: I412137e7e7b9b2b87f401bc140a9499d1fc012c6
Diffstat (limited to 'sw/source')
25 files changed, 79 insertions, 83 deletions
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 439b1b33e6fd..25d4ca3ec8f1 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -19,7 +19,6 @@ #include <bookmrk.hxx> #include <boost/function.hpp> -#include <boost/make_shared.hpp> #include <cntfrm.hxx> #include <doc.hxx> #include <IDocumentRedlineAccess.hxx> @@ -39,6 +38,7 @@ #include <sal/types.h> #include <unocrsr.hxx> #include <edimp.hxx> +#include <memory> using namespace ::boost; using namespace ::sw::mark; @@ -437,9 +437,9 @@ void CntntIdxStoreImpl::RestoreShellCrsrs(updater_t& rUpdater) } namespace sw { namespace mark { - boost::shared_ptr<CntntIdxStore> CntntIdxStore::Create() + std::shared_ptr<CntntIdxStore> CntntIdxStore::Create() { - return boost::make_shared<CntntIdxStoreImpl>(); + return std::make_shared<CntntIdxStoreImpl>(); } }} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 4323e000f936..99366fb7e494 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1959,7 +1959,7 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos, bSplit = true; const sal_Int32 nMkCntnt = rPaM.GetMark()->nContent.GetIndex(); - const boost::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); pCntntStore->Save( &m_rDoc, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(), true ); pTNd = pTNd->SplitCntntNode( rPos )->GetTxtNode(); @@ -2880,7 +2880,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b } } - const boost::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); pCntntStore->Save( &m_rDoc, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(), true ); // FIXME: only SwTxtNode has a valid implementation of SplitCntntNode! OSL_ENSURE(pNode->IsTxtNode(), "splitting non-text node?"); @@ -4096,7 +4096,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos, SwUndoCpyDoc* pUndo = 0; // lcl_DeleteRedlines may delete the start or end node of the cursor when // removing the redlines so use cursor that is corrected by PaMCorrAbs - ::boost::scoped_ptr<SwUnoCrsr> const pCopyPam(pDoc->CreateUnoCrsr(rPos)); + std::unique_ptr<SwUnoCrsr> const pCopyPam(pDoc->CreateUnoCrsr(rPos)); SwTblNumFmtMerge aTNFM( m_rDoc, *pDoc ); diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 01c0b16ae83e..e3cc45e425e0 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -378,7 +378,7 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev ) } pOldTxtNd->FmtToTxtAttr( pTxtNd ); - const boost::shared_ptr< sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr< sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); pCntntStore->Save( pDoc, aOldIdx.GetIndex(), pOldTxtNd->Len() ); SwIndex aAlphaIdx(pTxtNd); diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 35fb4c5517ef..e0fa41f6ec7a 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -73,7 +73,7 @@ #include <ToxTabStopTokenHandler.hxx> #include <tools/datetimeutils.hxx> -#include <boost/make_shared.hpp> +#include <memory> using namespace ::com::sun::star; @@ -995,8 +995,8 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, // to method <GenerateText(..)>. ::SetProgressState( 0, pDoc->GetDocShell() ); - boost::shared_ptr<sw::ToxTabStopTokenHandler> tabStopTokenHandler = - boost::make_shared<sw::DefaultToxTabStopTokenHandler>( + std::shared_ptr<sw::ToxTabStopTokenHandler> tabStopTokenHandler = + std::make_shared<sw::DefaultToxTabStopTokenHandler>( pSectNd->GetIndex(), *pDefaultPageDesc, GetTOXForm().IsRelTabPos(), pDoc->GetDocumentSettingManager().get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT) ? sw::DefaultToxTabStopTokenHandler::TABSTOPS_RELATIVE_TO_INDENT : @@ -1678,7 +1678,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, const SwTOXInternational& rIntl ) { // collect starts end ends of main entry character style - boost::scoped_ptr< std::vector<sal_uInt16> > xCharStyleIdx(pMainEntryNums ? new std::vector<sal_uInt16> : 0); + std::unique_ptr< std::vector<sal_uInt16> > xCharStyleIdx(pMainEntryNums ? new std::vector<sal_uInt16> : 0); OUString sSrchStr = OUStringBuffer().append(C_NUM_REPL). append(S_PAGE_DELI).append(C_NUM_REPL).makeStringAndClear(); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index c0cceb443cbb..fa262dea4cde 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -748,8 +748,8 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) ) { sal_uInt8 nBoxArrLen = pTAFmt ? 16 : 4; - boost::scoped_ptr< DfltBoxAttrList_t > aBoxFmtArr1; - boost::scoped_ptr< std::vector<SwTableBoxFmt*> > aBoxFmtArr2; + std::unique_ptr< DfltBoxAttrList_t > aBoxFmtArr1; + std::unique_ptr< std::vector<SwTableBoxFmt*> > aBoxFmtArr2; if( bUseBoxFmt ) { aBoxFmtArr1.reset(new DfltBoxAttrList_t( nBoxArrLen, NULL )); @@ -1052,7 +1052,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, SwStartNode* pSttNd; SwPosition aCntPos( aSttIdx, SwIndex( pTxtNd )); - const boost::shared_ptr< sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr< sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); pCntntStore->Save( pDoc, aSttIdx.GetIndex(), pTxtNd->GetTxt().getLength() ); if( T2T_PARA != cCh ) @@ -1520,7 +1520,7 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) pDelPara->pUndo->AddBoxPos( *pDoc, nNdIdx, aDelRg.aEnd.GetIndex(), aCntIdx.GetIndex() ); - const boost::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); const sal_Int32 nOldTxtLen = aCntIdx.GetIndex(); pCntntStore->Save( pDoc, nNdIdx, pCurTxtNd->GetTxt().getLength() ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 544352d8b724..d9700e9721bc 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -81,7 +81,7 @@ TYPEINIT2( SwCntntNode, SwModify, SwIndexReg ) namespace AttrSetHandleHelper { -void GetNewAutoStyle( boost::shared_ptr<const SfxItemSet>& rpAttrSet, +void GetNewAutoStyle( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, SwAttrSet& rNewAttrSet ) { @@ -96,7 +96,7 @@ void GetNewAutoStyle( boost::shared_ptr<const SfxItemSet>& rpAttrSet, rNode.SetModifyAtAttr( bSetModifyAtAttr ); } -void SetParent( boost::shared_ptr<const SfxItemSet>& rpAttrSet, +void SetParent( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, const SwFmt* pParentFmt, const SwFmt* pConditionalFmt ) @@ -132,7 +132,7 @@ void SetParent( boost::shared_ptr<const SfxItemSet>& rpAttrSet, } } -const SfxPoolItem* Put( boost::shared_ptr<const SfxItemSet>& rpAttrSet, +const SfxPoolItem* Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, const SfxPoolItem& rAttr ) { @@ -143,7 +143,7 @@ const SfxPoolItem* Put( boost::shared_ptr<const SfxItemSet>& rpAttrSet, return pRet; } -bool Put( boost::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, +bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, const SfxItemSet& rSet ) { SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); @@ -171,7 +171,7 @@ bool Put( boost::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNo return nRet; } -bool Put_BC( boost::shared_ptr<const SfxItemSet>& rpAttrSet, +bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -190,7 +190,7 @@ bool Put_BC( boost::shared_ptr<const SfxItemSet>& rpAttrSet, return nRet; } -bool Put_BC( boost::shared_ptr<const SfxItemSet>& rpAttrSet, +bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -224,7 +224,7 @@ bool Put_BC( boost::shared_ptr<const SfxItemSet>& rpAttrSet, return nRet; } -sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& rpAttrSet, +sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -237,7 +237,7 @@ sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& rpAttrSet, return nRet; } -sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& rpAttrSet, +sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, sal_uInt16 nWhich1, sal_uInt16 nWhich2, SwAttrSet* pOld, SwAttrSet* pNew ) diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 24f35e4311dc..7ab7fe8e3ec6 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -324,7 +324,7 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w ) const if (pHint->Which() == RES_TXTATR_AUTOFMT) { - boost::shared_ptr<SfxItemSet> const pSet(pHint->GetAutoFmt().GetStyleHandle()); + std::shared_ptr<SfxItemSet> const pSet(pHint->GetAutoFmt().GetStyleHandle()); writer.startElement("autofmt"); pSet->dumpAsXml(writer); writer.endElement(); diff --git a/sw/source/core/inc/UndoDelete.hxx b/sw/source/core/inc/UndoDelete.hxx index 4cec6dc69057..965bfe8d8897 100644 --- a/sw/source/core/inc/UndoDelete.hxx +++ b/sw/source/core/inc/UndoDelete.hxx @@ -40,8 +40,8 @@ class SwUndoDelete OUString *pSttStr, *pEndStr; SwRedlineData* pRedlData; SwRedlineSaveDatas* pRedlSaveData; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; OUString sTableName; diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx index 8eb9ba3a76fa..6aac04f35f23 100644 --- a/sw/source/core/inc/UndoTable.hxx +++ b/sw/source/core/inc/UndoTable.hxx @@ -21,12 +21,12 @@ #define INCLUDED_SW_SOURCE_CORE_INC_UNDOTABLE_HXX #include <undobj.hxx> -#include <vector> #include <set> #include <swtypes.hxx> #include <itabenum.hxx> +#include <memory> +#include <vector> #include <boost/noncopyable.hpp> -#include <boost/scoped_ptr.hpp> class SfxItemSet; @@ -145,7 +145,7 @@ class SwUndoTblAutoFmt : public SwUndo { sal_uLong nSttNode; _SaveTable* pSaveTbl; - ::std::vector< ::boost::shared_ptr<SwUndoTblNumFmt> > m_Undos; + std::vector< std::shared_ptr<SwUndoTblNumFmt> > m_Undos; bool bSaveCntntAttr; sal_uInt16 m_nRepeatHeading; @@ -173,8 +173,8 @@ class SwUndoTblNdsChg : public SwUndo, private boost::noncopyable _BoxMove(sal_uLong idx, bool moved=false) : index(idx), hasMoved(moved) {}; bool operator<(const _BoxMove other) const { return index < other.index; }; }; - boost::scoped_ptr< std::set<_BoxMove> > pNewSttNds; - boost::scoped_ptr< SwUndoSaveSections > pDelSects; + std::unique_ptr< std::set<_BoxMove> > pNewSttNds; + std::unique_ptr< SwUndoSaveSections > pDelSects; long nMin, nMax; // for redo of delete column sal_uLong nSttNode, nCurrBox; sal_uInt16 nCount, nRelDiff, nAbsDiff, nSetColType; diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index f103eca4db66..aeed0030eb11 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -203,7 +203,7 @@ enum MakePageType //UUUU namespace drawinglayer { namespace attribute { class SdrAllFillAttributesHelper; - typedef boost::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr; + typedef std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr; }} /** diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index c3de3bedf205..412f2902852d 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -68,7 +68,7 @@ namespace sw { namespace mark sal_uLong m_nNode2; sal_Int32 m_nCntnt1; sal_Int32 m_nCntnt2; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo; }; /// Takes care of storing relevant attributes of an SwTxtNode before split, then restore them on the new node. @@ -81,7 +81,7 @@ namespace sw { namespace mark virtual void Restore(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nOffset=0, bool bAuto = false) =0; virtual void Restore(SwNode& rNd, sal_Int32 nLen, sal_Int32 nCorrLen) =0; virtual ~CntntIdxStore() {}; - static boost::shared_ptr<CntntIdxStore> Create(); + static std::shared_ptr<CntntIdxStore> Create(); }; }} diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx index 65bb964a5ea8..c26665e9c136 100644 --- a/sw/source/core/inc/rolbck.hxx +++ b/sw/source/core/inc/rolbck.hxx @@ -260,7 +260,7 @@ class SwHistoryBookmark : public SwHistoryHint const bool m_bSaveOtherPos; const bool m_bHadOtherPos; const IDocumentMarkAccess::MarkType m_eBkmkType; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo; }; class SwHistorySetAttrSet : public SwHistoryHint diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index fc5cb0d16feb..e98104e1fbe0 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -427,10 +427,10 @@ static void checkApplyParagraphMarkFormatToNumbering( SwFont* pNumFnt, SwTxtForm if( hint->Which() == RES_TXTATR_AUTOFMT && hint->GetEnd() != NULL && hint->GetStart() == *hint->GetEnd() && hint->GetStart() == node->Len()) { - boost::shared_ptr<SfxItemSet> pSet(hint->GetAutoFmt().GetStyleHandle()); + std::shared_ptr<SfxItemSet> pSet(hint->GetAutoFmt().GetStyleHandle()); // Check each item and in case it should be ignored, then clear it. - boost::shared_ptr<SfxItemSet> pCleanedSet; + std::shared_ptr<SfxItemSet> pCleanedSet; if (pSet.get()) { pCleanedSet.reset(pSet->Clone()); diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx index 56f753f75a8a..eb4194a019ab 100644 --- a/sw/source/core/tox/ToxTextGenerator.cxx +++ b/sw/source/core/tox/ToxTextGenerator.cxx @@ -41,8 +41,8 @@ #include "svl/itemiter.hxx" -#include <boost/make_shared.hpp> #include <cassert> +#include <memory> namespace { @@ -92,7 +92,7 @@ ToxTextGenerator::GetNumStringOfFirstNode( const SwTOXSortTabBase& rBase, bool b ToxTextGenerator::ToxTextGenerator(const SwForm& toxForm, - boost::shared_ptr<ToxTabStopTokenHandler> tabStopHandler) + std::shared_ptr<ToxTabStopTokenHandler> tabStopHandler) : mToxForm(toxForm), mLinkProcessor(new ToxLinkProcessor()), mTabStopTokenHandler(tabStopHandler) @@ -264,10 +264,10 @@ ToxTextGenerator::GenerateText(SwDoc* pDoc, const std::vector<SwTOXSortTabBase*> mLinkProcessor->InsertLinkAttributes(*pTOXNd); } -/*static*/ boost::shared_ptr<SfxItemSet> +/*static*/ std::shared_ptr<SfxItemSet> ToxTextGenerator::CollectAttributesForTox(const SwTxtAttr& hint, SwAttrPool& pool) { - boost::shared_ptr<SfxItemSet> retval(new SfxItemSet(pool)); + std::shared_ptr<SfxItemSet> retval(new SfxItemSet(pool)); if (hint.Which() != RES_TXTATR_AUTOFMT) { return retval; } @@ -304,7 +304,7 @@ ToxTextGenerator::HandleTextToken(const SwTOXSortTabBase& source, SwAttrPool& po const SwpHints& hints = pSrc->GetSwpHints(); for (size_t i = 0; i < hints.Count(); ++i) { const SwTxtAttr* hint = hints[i]; - boost::shared_ptr<SfxItemSet> attributesToClone = CollectAttributesForTox(*hint, pool); + std::shared_ptr<SfxItemSet> attributesToClone = CollectAttributesForTox(*hint, pool); if (attributesToClone->Count() <= 0) { continue; } diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx index 6cd9ec9382b3..bbaea16e05a0 100644 --- a/sw/source/core/txtnode/ndhints.cxx +++ b/sw/source/core/txtnode/ndhints.cxx @@ -173,7 +173,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const SwTxtAttr const*const pHint(m_HintStarts[i]); if (RES_TXTATR_AUTOFMT == pHint->Which()) { - boost::shared_ptr<SfxItemSet> const pSet( + std::shared_ptr<SfxItemSet> const pSet( pHint->GetAutoFmt().GetStyleHandle()); if (pSet->Count() == 1 && pSet->GetItem(RES_CHRATR_RSID, false)) { diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 9b1b4a26a311..e157578f911d 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -85,7 +85,7 @@ #include <sortedobjs.hxx> #include <switerator.hxx> #include <attrhint.hxx> -#include <boost/scoped_ptr.hpp> +#include <memory> //UUUU #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx> @@ -636,7 +636,7 @@ SwCntntNode *SwTxtNode::JoinNext() if( SwCntntNode::CanJoinNext( &aIdx ) ) { SwDoc* pDoc = rNds.GetDoc(); - const boost::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); pCntntStore->Save(pDoc, aIdx.GetIndex(), SAL_MAX_INT32); SwTxtNode *pTxtNode = aIdx.GetNode().GetTxtNode(); sal_Int32 nOldLen = m_Text.getLength(); @@ -730,7 +730,7 @@ SwCntntNode *SwTxtNode::JoinPrev() if( SwCntntNode::CanJoinPrev( &aIdx ) ) { SwDoc* pDoc = rNds.GetDoc(); - const boost::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); pCntntStore->Save( pDoc, aIdx.GetIndex(), SAL_MAX_INT32); SwTxtNode *pTxtNode = aIdx.GetNode().GetTxtNode(); const sal_Int32 nLen = pTxtNode->Len(); @@ -848,7 +848,7 @@ void SwTxtNode::Update( { SetAutoCompleteWordDirty( true ); - boost::scoped_ptr<SwpHts> pCollector; + std::unique_ptr<SwpHts> pCollector; const sal_Int32 nChangePos = rPos.GetIndex(); if ( HasHints() ) diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 343eb6448627..a22b7dcf9b4e 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -74,7 +74,7 @@ #include <svl/smplhint.hxx> #include <algorithm> #include <map> -#include <boost/scoped_ptr.hpp> +#include <memory> #ifdef DBG_UTIL #define CHECK Check(true); @@ -768,7 +768,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // the new character format: OSL_ENSURE( RES_TXTATR_AUTOFMT == (*aIter)->Which(), "AUTOSTYLES - Misc trouble" ); SwTxtAttr* pOther = *aIter; - boost::shared_ptr<SfxItemSet> pOldStyle = static_cast<const SwFmtAutoFmt&>(pOther->GetAttr()).GetStyleHandle(); + std::shared_ptr<SfxItemSet> pOldStyle = static_cast<const SwFmtAutoFmt&>(pOther->GetAttr()).GetStyleHandle(); // For each attribute in the automatic style check if it // is also set the new character style: @@ -836,10 +836,10 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, ++aIter; } - boost::shared_ptr<SfxItemSet> pNewStyle = static_cast<const SwFmtAutoFmt&>(rNewHint.GetAttr()).GetStyleHandle(); + std::shared_ptr<SfxItemSet> pNewStyle = static_cast<const SwFmtAutoFmt&>(rNewHint.GetAttr()).GetStyleHandle(); if ( pCurrentAutoStyle ) { - boost::shared_ptr<SfxItemSet> pCurrentStyle = static_cast<const SwFmtAutoFmt&>(pCurrentAutoStyle->GetAttr()).GetStyleHandle(); + std::shared_ptr<SfxItemSet> pCurrentStyle = static_cast<const SwFmtAutoFmt&>(pCurrentAutoStyle->GetAttr()).GetStyleHandle(); // Merge attributes SfxItemSet aNewSet( *pCurrentStyle ); @@ -1013,7 +1013,7 @@ SwTxtAttr* MakeTxtAttr( // If the attribute is an auto-style which refers to a pool that is // different from rDoc's pool, we have to correct this: const StylePool::SfxItemSet_Pointer_t pAutoStyle = static_cast<const SwFmtAutoFmt&>(rAttr).GetStyleHandle(); - boost::scoped_ptr<const SfxItemSet> pNewSet( + std::unique_ptr<const SfxItemSet> pNewSet( pAutoStyle->SfxItemSet::Clone( true, &rDoc.GetAttrPool() )); SwTxtAttr* pNew = MakeTxtAttr( rDoc, *pNewSet, nStt, nEnd ); return pNew; @@ -1900,7 +1900,7 @@ bool SwTxtNode::SetAttr( const bool bAutoStyle = SfxItemState::SET == aTxtSet.GetItemState( RES_TXTATR_AUTOFMT, false, &pItem ); if ( bAutoStyle ) { - boost::shared_ptr<SfxItemSet> pAutoStyleSet = static_cast<const SwFmtAutoFmt*>(pItem)->GetStyleHandle(); + std::shared_ptr<SfxItemSet> pAutoStyleSet = static_cast<const SwFmtAutoFmt*>(pItem)->GetStyleHandle(); const bool bRet = SetAttr( *pAutoStyleSet ); if( 1 == aTxtSet.Count() ) return bRet; @@ -2130,7 +2130,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, else // es ist ein Bereich definiert { // #i75299# - boost::scoped_ptr< std::vector< SwPoolItemEndPair > > pAttrArr; + std::unique_ptr< std::vector< SwPoolItemEndPair > > pAttrArr; const size_t coArrSz = RES_TXTATR_WITHEND_END - RES_CHRATR_BEGIN; @@ -2165,7 +2165,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, if( bChkInvalid ) { // uneindeutig ? - boost::scoped_ptr< SfxItemIter > pItemIter; + std::unique_ptr< SfxItemIter > pItemIter; const SfxPoolItem* pItem = 0; if ( RES_TXTATR_AUTOFMT == pHt->Which() ) @@ -2458,7 +2458,7 @@ SwTxtNode::impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet) // there already is an automatic style on that span: // create new one and remove the original one SwTxtAttr* const pAutoStyle(const_cast<SwTxtAttr*>(aAutoStyleIt->second)); - const boost::shared_ptr<SfxItemSet> pOldStyle( + const std::shared_ptr<SfxItemSet> pOldStyle( static_cast<const SwFmtAutoFmt&>( pAutoStyle->GetAttr()).GetStyleHandle()); aCurSet.Put(*pOldStyle); @@ -2672,7 +2672,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) // check for RSID-only AUTOFMT if (RES_TXTATR_AUTOFMT == pHt->Which()) { - boost::shared_ptr<SfxItemSet> const pSet( + std::shared_ptr<SfxItemSet> const pSet( pHt->GetAutoFmt().GetStyleHandle()); if ((pSet->Count() == 1) && pSet->GetItem(RES_CHRATR_RSID, false)) { @@ -2989,7 +2989,7 @@ bool SwpHints::TryInsertHint( // #i75430# Recalc hidden flags if necessary case RES_TXTATR_AUTOFMT: { - boost::shared_ptr<SfxItemSet> const pSet( pHint->GetAutoFmt().GetStyleHandle() ); + std::shared_ptr<SfxItemSet> const pSet( pHint->GetAutoFmt().GetStyleHandle() ); if (pHint->GetStart() == *pHint->GetEnd()) { if (pSet->Count() == 1 && pSet->GetItem(RES_CHRATR_RSID, false)) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 13ea4c1e74be..c40f1a603151 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -302,7 +302,7 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess, const SfxItemSet* pSet1, sal_uInt16 nWhichId, const SfxItemSet& rSet2, - boost::shared_ptr<SfxItemSet>& pStyleHandle ) + std::shared_ptr<SfxItemSet>& pStyleHandle ) { bool bRet = false; @@ -450,7 +450,7 @@ void SwTxtNode::RstTxtAttr( // Default behavior is to process all attributes: bool bSkipAttr = false; - boost::shared_ptr<SfxItemSet> pStyleHandle; + std::shared_ptr<SfxItemSet> pStyleHandle; // 1. case: We want to reset only the attributes listed in pSet: if ( pSet ) diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 51d540fb34d8..1a68e2a78624 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -492,8 +492,8 @@ class SwUndoReplace::Impl bool m_bSplitNext : 1; bool m_bRegExp : 1; // metadata references for paragraph and following para (if m_bSplitNext) - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; public: Impl(SwPaM const& rPam, OUString const& rIns, bool const bRegExp); diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index b00e5aaf91fa..4fbf9f497843 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -277,7 +277,7 @@ private: ::std::unique_ptr<SwSectionData> const m_pSectionData; /// section not TOX ::std::unique_ptr<SwTOXBase> const m_pTOXBase; /// set iff section is TOX ::std::unique_ptr<SfxItemSet> const m_pAttrSet; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > const m_pMetadataUndo; + std::shared_ptr< ::sfx2::MetadatableUndo > const m_pMetadataUndo; sal_uLong const m_nStartNode; sal_uLong const m_nEndNode; diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 9778de2e6213..1e83bd01a1ed 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -17,10 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <vector> - -#include <boost/shared_ptr.hpp> - #include <UndoTable.hxx> #include <UndoRedline.hxx> #include <UndoDelete.hxx> @@ -67,6 +63,8 @@ #include <comcore.hrc> #include <unochart.hxx> #include <switerator.hxx> +#include <memory> +#include <vector> #ifdef DBG_UTIL #define CHECK_TABLE(t) (t).CheckConsistency(); @@ -80,7 +78,7 @@ #define _DEBUG_REDLINE( pDoc ) #endif -typedef std::vector<boost::shared_ptr<SfxItemSet> > SfxItemSets; +typedef std::vector<std::shared_ptr<SfxItemSet> > SfxItemSets; class SwUndoSaveSections : public boost::ptr_vector<SwUndoSaveSection> { public: @@ -206,8 +204,8 @@ struct SwTblToTxtSave sal_Int32 m_nCntnt; SwHistory* m_pHstry; // metadata references for first and last paragraph in cell - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; + std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; SwTblToTxtSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, sal_Int32 nCntnt ); ~SwTblToTxtSave() { delete m_pHstry; } @@ -543,7 +541,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd, SwTableLine* pLine = new SwTableLine( pLineFmt, rSavedData.size(), 0 ); pTblNd->GetTable().GetTabLines().insert( pTblNd->GetTable().GetTabLines().begin(), pLine ); - const boost::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); for( size_t n = rSavedData.size(); n; ) { const SwTblToTxtSave* pSave = &rSavedData[ --n ]; @@ -895,7 +893,7 @@ sal_uInt16 _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine ) if( USHRT_MAX == nRet ) { // Create copy of ItemSet - boost::shared_ptr<SfxItemSet> pSet( new SfxItemSet( *pFmt->GetAttrSet().GetPool(), + std::shared_ptr<SfxItemSet> pSet( new SfxItemSet( *pFmt->GetAttrSet().GetPool(), bIsLine ? aTableLineSetRange : aTableBoxSetRange ) ); pSet->Put( pFmt->GetAttrSet() ); // When a formula is set, never save the value. It possibly must be @@ -1274,7 +1272,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl ) SwCntntNode* pCNd = rNds[ n ]->GetCntntNode(); if( pCNd ) { - boost::shared_ptr<SfxItemSet> pSet( (*Ptrs.pCntntAttrs)[ nSet++ ] ); + std::shared_ptr<SfxItemSet> pSet( (*Ptrs.pCntntAttrs)[ nSet++ ] ); if( pSet ) { sal_uInt16 *pRstAttr = aSave_BoxCntntSet; @@ -1313,7 +1311,7 @@ void _SaveBox::SaveCntntAttrs( SwDoc* pDoc ) SwCntntNode* pCNd = pDoc->GetNodes()[ n ]->GetCntntNode(); if( pCNd ) { - boost::shared_ptr<SfxItemSet> pSet; + std::shared_ptr<SfxItemSet> pSet; if( pCNd->HasSwAttrSet() ) { pSet.reset( new SfxItemSet( pDoc->GetAttrPool(), @@ -1436,7 +1434,7 @@ SwUndoTblAutoFmt::~SwUndoTblAutoFmt() void SwUndoTblAutoFmt::SaveBoxCntnt( const SwTableBox& rBox ) { - ::boost::shared_ptr<SwUndoTblNumFmt> const p(new SwUndoTblNumFmt(rBox)); + std::shared_ptr<SwUndoTblNumFmt> const p(new SwUndoTblNumFmt(rBox)); m_Undos.push_back(p); } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 6141ea65527d..499e73bd96c4 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -83,12 +83,11 @@ #include <swunohelper.hxx> #include <svx/xbtmpit.hxx> -#include <boost/shared_ptr.hpp> - #include "ccoll.hxx" #include "unocore.hrc" #include <cassert> +#include <memory> #include <set> #define STYLE_FAMILY_COUNT 5 // we have 5 style families diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index d94fcc7cac0b..5897f904b38b 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -77,7 +77,7 @@ #include <svtools/HtmlWriter.hxx> -#include <boost/scoped_ptr.hpp> +#include <memory> using namespace css; @@ -202,7 +202,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1ScriptForScriptType( sal_uInt16 nScriptType ) struct SwHTMLTxtCollOutputInfo { OString aToken; // auszugendens End-Token - boost::scoped_ptr<SfxItemSet> pItemSet; // harte Attributierung + std::unique_ptr<SfxItemSet> pItemSet; // harte Attributierung bool bInNumBulList; // in einer Aufzaehlungs-Liste; bool bParaPossible; // ein </P> darf zusaetzlich ausgegeben werden @@ -210,7 +210,6 @@ struct SwHTMLTxtCollOutputInfo bool bOutDiv; // write a </DIV> SwHTMLTxtCollOutputInfo() : - pItemSet(NULL), bInNumBulList( false ), bParaPossible( false ), bOutPara( false ), @@ -1733,7 +1732,7 @@ void HTMLEndPosLst::InsertNoScript( const SfxPoolItem& rItem, case HTML_AUTOFMT_VALUE: { const SwFmtAutoFmt& rAutoFmt = static_cast<const SwFmtAutoFmt&>(rItem); - const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle(); + const std::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle(); if( pSet.get() ) Insert( *pSet.get(), nStart, nEnd, rFmtInfos, true, bParaAttrs ); } diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index d086500fe928..7220cf2cd328 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1697,7 +1697,7 @@ bool DocxSdrExport::checkFrameBtlr(SwNode* pStartNode, sax_fastparser::FastAttri if (!pTxtAttr || pTxtAttr->Which() != RES_TXTATR_AUTOFMT) return false; - boost::shared_ptr<SfxItemSet> pItemSet = pTxtAttr->GetAutoFmt().GetStyleHandle(); + std::shared_ptr<SfxItemSet> pItemSet = pTxtAttr->GetAutoFmt().GetStyleHandle(); bItemSet = pItemSet->GetItemState(RES_CHRATR_ROTATE, true, &pItem) == SfxItemState::SET; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index bc7185f0b72e..2a9c05db8c72 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -429,7 +429,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) if (nWhich == RES_TXTATR_AUTOFMT) { const SwFmtAutoFmt& rAutoFmt = static_cast<const SwFmtAutoFmt&>(pHt->GetAttr()); - const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle(); + const std::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle(); SfxWhichIter aIter( *pSet ); const SfxPoolItem* pItem; sal_uInt16 nWhichId = aIter.FirstWhich(); |