[Libreoffice-commits] core.git: 23 commits - include/sfx2 include/svtools sd/inc sd/source sfx2/inc sfx2/source svtools/inc svtools/source svx/source vcl/inc vcl/source
Noel Grandin
noel at peralex.com
Wed Nov 11 22:47:39 PST 2015
include/sfx2/app.hxx | 6 +--
include/sfx2/mnuitem.hxx | 4 +-
include/sfx2/module.hxx | 6 +--
include/sfx2/stbitem.hxx | 4 +-
include/sfx2/tbxctrl.hxx | 6 +--
include/svtools/fontsubstconfig.hxx | 4 +-
sd/inc/pch/precompiled_sd.hxx | 1
sd/inc/pch/precompiled_sdui.hxx | 1
sd/source/core/sdpage2.cxx | 17 ++++-----
sd/source/filter/eppt/epptbase.hxx | 5 +-
sd/source/filter/eppt/epptso.cxx | 12 +++---
sd/source/filter/eppt/pptexsoundcollection.cxx | 13 +++----
sd/source/filter/eppt/pptexsoundcollection.hxx | 14 +++----
sd/source/filter/eppt/pptx-text.cxx | 19 +++++-----
sd/source/filter/eppt/text.hxx | 10 ++---
sd/source/filter/html/pubdlg.cxx | 29 +++++++---------
sd/source/filter/ppt/propread.cxx | 44 +++++++++++++------------
sd/source/filter/ppt/propread.hxx | 9 ++---
sd/source/ui/dlg/dlgass.cxx | 7 +--
sd/source/ui/inc/View.hxx | 14 +------
sd/source/ui/inc/pubdlg.hxx | 4 +-
sd/source/ui/view/sdview.cxx | 8 ----
sfx2/inc/pch/precompiled_sfx.hxx | 1
sfx2/source/appl/appreg.cxx | 30 ++++++++---------
sfx2/source/appl/childwinimpl.cxx | 12 +++---
sfx2/source/appl/module.cxx | 24 ++++++-------
sfx2/source/bastyp/fltfnc.cxx | 34 +++++--------------
sfx2/source/control/bindings.cxx | 8 ++--
sfx2/source/control/ctrlfactoryimpl.cxx | 6 +--
sfx2/source/control/shell.cxx | 11 +++---
sfx2/source/dialog/splitwin.cxx | 24 ++++++-------
sfx2/source/inc/childwinimpl.hxx | 7 ++-
sfx2/source/inc/ctrlfactoryimpl.hxx | 14 +++----
sfx2/source/inc/splitwin.hxx | 5 +-
sfx2/source/inc/virtmenu.hxx | 5 +-
sfx2/source/menu/mnuitem.cxx | 6 +--
sfx2/source/menu/virtmenu.cxx | 14 +++----
sfx2/source/statbar/stbitem.cxx | 4 +-
sfx2/source/toolbox/tbxitem.cxx | 4 +-
svtools/inc/pch/precompiled_svt.hxx | 1
svtools/source/config/fontsubstconfig.cxx | 18 +++++-----
svtools/source/svrtf/svparser.cxx | 6 +--
svx/source/tbxctrls/tbcontrl.cxx | 8 ++--
vcl/inc/ilstbox.hxx | 9 ++---
vcl/source/app/svdata.cxx | 1
vcl/source/control/ilstbox.cxx | 26 +++++++-------
vcl/source/edit/textdat2.hxx | 26 +++++++-------
vcl/source/edit/textdoc.cxx | 44 +++++++++++++------------
vcl/source/edit/textdoc.hxx | 11 +++---
vcl/source/edit/texteng.cxx | 26 +++++++-------
50 files changed, 296 insertions(+), 326 deletions(-)
New commits:
commit 1998824899489a2e2c2f8519493fc9ad8dae8637
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 15:35:16 2015 +0200
sd: boost::ptr_vector->std::vector
Change-Id: I59ecb4a46c21ceb82beb28c65b1fb43b329567da
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index 71e2db4..6b13f77 100644
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -71,7 +71,6 @@
#include <boost/limits.hpp>
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <canvas/canvastools.hxx>
#include <canvas/elapsedtime.hxx>
diff --git a/sd/inc/pch/precompiled_sdui.hxx b/sd/inc/pch/precompiled_sdui.hxx
index 10a15b4..fc39e59 100644
--- a/sd/inc/pch/precompiled_sdui.hxx
+++ b/sd/inc/pch/precompiled_sdui.hxx
@@ -28,7 +28,6 @@
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbstar.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index d273e22..214d5bf 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -469,7 +469,7 @@ SdPublishingDlg::SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType)
pPage5_Buttons->SetLineCount( 4 );
pPage5_Buttons->SetExtraSpacing( 1 );
- boost::ptr_vector<SdPublishingDesign>::iterator it;
+ std::vector<SdPublishingDesign>::iterator it;
for( it = m_aDesignList.begin(); it != m_aDesignList.end(); ++it )
pPage1_Designs->InsertEntry(it->m_aDesignName);
@@ -988,7 +988,7 @@ IMPL_LINK_NOARG_TYPED(SdPublishingDlg, DesignDeleteHdl, Button*, void)
{
const sal_Int32 nPos = pPage1_Designs->GetSelectEntryPos();
- boost::ptr_vector<SdPublishingDesign>::iterator iter = m_aDesignList.begin()+nPos;
+ std::vector<SdPublishingDesign>::iterator iter = m_aDesignList.begin()+nPos;
DBG_ASSERT(iter != m_aDesignList.end(), "No Design? That's not allowed (CL)");
@@ -1116,21 +1116,21 @@ IMPL_LINK_NOARG_TYPED(SdPublishingDlg, SlideChgHdl, Button*, void)
IMPL_LINK_NOARG_TYPED(SdPublishingDlg, FinishHdl, Button*, void)
{
//End
- SdPublishingDesign* pDesign = new SdPublishingDesign();
- GetDesign(pDesign);
+ SdPublishingDesign aDesign;
+ GetDesign(&aDesign);
bool bSave = false;
if(pPage1_OldDesign->IsChecked() && m_pDesign)
{
// are there changes?
- if(!(*pDesign == *m_pDesign))
+ if(!(aDesign == *m_pDesign))
bSave = true;
}
else
{
SdPublishingDesign aDefaultDesign;
- if(!(aDefaultDesign == *pDesign))
+ if(!(aDefaultDesign == aDesign))
bSave = true;
}
@@ -1149,12 +1149,12 @@ IMPL_LINK_NOARG_TYPED(SdPublishingDlg, FinishHdl, Button*, void)
if ( aDlg->Execute() == RET_OK )
{
- pDesign->m_aDesignName = aDlg->GetDesignName();
+ aDesign.m_aDesignName = aDlg->GetDesignName();
- boost::ptr_vector<SdPublishingDesign>::iterator iter;
+ std::vector<SdPublishingDesign>::iterator iter;
for (iter = m_aDesignList.begin(); iter != m_aDesignList.end(); ++iter)
{
- if (iter->m_aDesignName == pDesign->m_aDesignName)
+ if (iter->m_aDesignName == aDesign.m_aDesignName)
break;
}
@@ -1170,17 +1170,14 @@ IMPL_LINK_NOARG_TYPED(SdPublishingDlg, FinishHdl, Button*, void)
if(!bRetry)
{
- m_aDesignList.push_back(pDesign);
+ m_aDesignList.push_back(aDesign);
m_bDesignListDirty = true;
- pDesign = nullptr;
}
}
}
while(bRetry);
}
- delete pDesign;
-
if(m_bDesignListDirty)
Save();
@@ -1557,10 +1554,10 @@ bool SdPublishingDlg::Load()
pStream->GetError() == SVSTREAM_OK && nIndex < nDesigns;
nIndex++ )
{
- SdPublishingDesign* pDesign = new SdPublishingDesign();
- *pStream >> *pDesign;
+ SdPublishingDesign aDesign;
+ *pStream >> aDesign;
- m_aDesignList.push_back(pDesign);
+ m_aDesignList.push_back(aDesign);
}
return( pStream->GetError() == SVSTREAM_OK );
diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx
index 4136f49..12db763 100644
--- a/sd/source/ui/inc/pubdlg.hxx
+++ b/sd/source/ui/inc/pubdlg.hxx
@@ -32,7 +32,7 @@
#include "assclass.hxx"
#include <memory>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
class FixedText;
class RadioButton;
@@ -166,7 +166,7 @@ private:
void ChangePage();
void UpdatePage();
- boost::ptr_vector<SdPublishingDesign> m_aDesignList;
+ std::vector<SdPublishingDesign> m_aDesignList;
bool m_bDesignListDirty;
SdPublishingDesign* m_pDesign;
bool Load();
commit b5216432a86ea6b0be9af29c71b864629b748c13
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 15:26:57 2015 +0200
sd: remove the maLockedRedraws field
not doing anything useful
Change-Id: I3c11261cff73886eb93cd76062c0ff5018384b3d
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index a870c39..935ba07 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -20,8 +20,6 @@
#ifndef INCLUDED_SD_SOURCE_UI_INC_VIEW_HXX
#define INCLUDED_SD_SOURCE_UI_INC_VIEW_HXX
-#include <boost/ptr_container/ptr_vector.hpp>
-
#include "pres.hxx"
#include <tools/gen.hxx>
#include <svtools/transfer.hxx>
@@ -56,13 +54,6 @@ class ViewShell;
class Window;
class ViewClipboard;
-// SdViewRedrawRec
-struct SdViewRedrawRec
-{
- VclPtr<OutputDevice> mpOut;
- Rectangle aRect;
-};
-
//For master view we want to force that master
//textboxes have readonly text, because the
//text is the auto-generated click-here-to-edit
@@ -262,14 +253,13 @@ protected:
SdrMarkList* mpDragSrcMarkList;
SdrObject* mpDropMarkerObj;
SdrDropMarkerOverlay* mpDropMarker;
- sal_uInt16 mnDragSrcPgNum;
+ sal_uInt16 mnDragSrcPgNum;
Point maDropPos;
::std::vector<OUString> maDropFileVector;
sal_Int8 mnAction;
Idle maDropErrorIdle;
Idle maDropInsertFileIdle;
- sal_uInt16 mnLockRedrawSmph;
- boost::ptr_vector<SdViewRedrawRec> maLockedRedraws;
+ sal_uInt16 mnLockRedrawSmph;
bool mbIsDropAllowed;
DECL_LINK_TYPED( DropErrorHdl, Idle*, void );
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index a7576d0..71c6ce2 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -503,14 +503,6 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const vcl::Region& rReg, sdr::c
ViewRedirector aViewRedirector;
FmFormView::CompleteRedraw(pOutDev, rReg, pRedirector ? pRedirector : &aViewRedirector);
}
- // or save?
- else
- {
- SdViewRedrawRec* pRec = new SdViewRedrawRec;
- pRec->mpOut = pOutDev;
- pRec->aRect = rReg.GetBoundRect();
- maLockedRedraws.push_back(pRec);
- }
}
void View::MarkListHasChanged()
commit 77ae2a45c7cddc0475b4e2b3d38661e21eb170ed
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 15:16:19 2015 +0200
sd: boost::ptr_vector->std::vector
Change-Id: If67e06ec320afdb1975947d06ded1ebacfa0b06a
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 334d841..f79fcc9 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -69,7 +69,6 @@
#include <comphelper/processfactory.hxx>
#include <vector>
-#include <boost/ptr_container/ptr_vector.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -167,7 +166,7 @@ public:
uno::Sequence < beans::NamedValue > GetPassword( const OUString& rPath );
void DeletePasswords();
- boost::ptr_vector< PasswordEntry > maPasswordList;
+ std::vector< PasswordEntry > maPasswordList;
OUString maDocFile;
OUString maLayoutFile;
@@ -1585,9 +1584,9 @@ void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const OUString& rP
if(pEntry == nullptr)
{
- pEntry = new PasswordEntry();
+ maPasswordList.push_back( PasswordEntry() );
+ pEntry = &maPasswordList.back();
pEntry->maPath = rPath;
- maPasswordList.push_back( pEntry );
}
pEntry->aEncryptionData = aEncryptionData;
commit 788587b1c5d93f55dfbdcf12119cc70e3e8b5364
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 15:14:13 2015 +0200
sd: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I0950b732f60a7b75d87da520f8cbc131d1a04137
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index d2d3e4d..2a3c092 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -566,16 +566,16 @@ PropRead::PropRead( SotStorage& rStorage, const OUString& rName ) :
void PropRead::AddSection( Section& rSection )
{
- maSections.push_back( new Section( rSection ) );
+ maSections.push_back( o3tl::make_unique<Section>( rSection ) );
}
const Section* PropRead::GetSection( const sal_uInt8* pFMTID )
{
- boost::ptr_vector<Section>::iterator it;
+ std::vector<std::unique_ptr<Section> >::iterator it;
for ( it = maSections.begin(); it != maSections.end(); ++it)
{
- if ( memcmp( it->GetFMTID(), pFMTID, 16 ) == 0 )
- return &(*it);
+ if ( memcmp( (*it)->GetFMTID(), pFMTID, 16 ) == 0 )
+ return it->get();
}
return nullptr;
}
@@ -628,7 +628,8 @@ PropRead& PropRead::operator=( const PropRead& rPropRead )
mnVersionHi = rPropRead.mnVersionHi;
memcpy( mApplicationCLSID, rPropRead.mApplicationCLSID, 16 );
- maSections = rPropRead.maSections.clone();
+ for(const std::unique_ptr<Section>& rSection : rPropRead.maSections)
+ maSections.push_back(o3tl::make_unique<Section>(*rSection.get()));
}
return *this;
}
diff --git a/sd/source/filter/ppt/propread.hxx b/sd/source/filter/ppt/propread.hxx
index a4d74fe..23115f0 100644
--- a/sd/source/filter/ppt/propread.hxx
+++ b/sd/source/filter/ppt/propread.hxx
@@ -23,7 +23,6 @@
#include <map>
#include <vector>
#include <memory>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <sal/types.h>
#include <sot/storage.hxx>
@@ -148,7 +147,7 @@ class PropRead
sal_uInt16 mnVersionLo;
sal_uInt16 mnVersionHi;
sal_uInt8 mApplicationCLSID[ 16 ];
- boost::ptr_vector<Section> maSections;
+ std::vector<std::unique_ptr<Section> > maSections;
void AddSection( Section& rSection );
commit 9304ce96d1d6bd52b655fb4710d1529c2a941f83
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 15:11:54 2015 +0200
sd: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ie0073c439cdfe37e5340081f16afb906d32a8369
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index b90d305..d2d3e4d 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -21,6 +21,7 @@
#include "rtl/tencinfo.h"
#include "rtl/textenc.h"
#include <osl/diagnose.h>
+#include <o3tl/make_unique.hxx>
PropEntry::PropEntry( sal_uInt32 nId, const sal_uInt8* pBuf, sal_uInt32 nBufSize, sal_uInt16 nTextEnc ) :
mnId ( nId ),
@@ -207,11 +208,12 @@ PropItem& PropItem::operator=( PropItem& rPropItem )
}
Section::Section( const Section& rSection )
- : mnTextEnc(rSection.mnTextEnc),
- maEntries(rSection.maEntries.clone())
+ : mnTextEnc(rSection.mnTextEnc)
{
for ( int i = 0; i < 16; i++ )
aFMTID[ i ] = rSection.aFMTID[ i ];
+ for(const std::unique_ptr<PropEntry>& rEntry : rSection.maEntries)
+ maEntries.push_back(o3tl::make_unique<PropEntry>(*rEntry.get()));
}
Section::Section( const sal_uInt8* pFMTID )
@@ -225,10 +227,10 @@ bool Section::GetProperty( sal_uInt32 nId, PropItem& rPropItem )
{
if ( nId )
{
- boost::ptr_vector<PropEntry>::const_iterator iter;
+ std::vector<std::unique_ptr<PropEntry> >::const_iterator iter;
for (iter = maEntries.begin(); iter != maEntries.end(); ++iter)
{
- if (iter->mnId == nId)
+ if ((*iter)->mnId == nId)
break;
}
@@ -236,7 +238,7 @@ bool Section::GetProperty( sal_uInt32 nId, PropItem& rPropItem )
{
rPropItem.Clear();
rPropItem.SetTextEncoding( mnTextEnc );
- rPropItem.Write( iter->mpBuf,iter->mnSize );
+ rPropItem.Write( (*iter)->mpBuf, (*iter)->mnSize );
rPropItem.Seek( STREAM_SEEK_TO_BEGIN );
return true;
}
@@ -254,34 +256,34 @@ void Section::AddProperty( sal_uInt32 nId, const sal_uInt8* pBuf, sal_uInt32 nBu
nId = 0;
// do not allow same PropId's, sort
- boost::ptr_vector<PropEntry>::iterator iter;
+ std::vector<std::unique_ptr<PropEntry> >::iterator iter;
for ( iter = maEntries.begin(); iter != maEntries.end(); ++iter )
{
- if ( iter->mnId == nId )
- maEntries.replace( iter, new PropEntry( nId, pBuf, nBufSize, mnTextEnc ));
- else if ( iter->mnId > nId )
- maEntries.insert( iter, new PropEntry( nId, pBuf, nBufSize, mnTextEnc ));
+ if ( (*iter)->mnId == nId )
+ (*iter).reset(new PropEntry( nId, pBuf, nBufSize, mnTextEnc ));
+ else if ( (*iter)->mnId > nId )
+ maEntries.insert( iter, o3tl::make_unique<PropEntry>( nId, pBuf, nBufSize, mnTextEnc ));
else
continue;
return;
}
- maEntries.push_back( new PropEntry( nId, pBuf, nBufSize, mnTextEnc ) );
+ maEntries.push_back( o3tl::make_unique<PropEntry>( nId, pBuf, nBufSize, mnTextEnc ) );
}
void Section::GetDictionary(Dictionary& rDict)
{
- boost::ptr_vector<PropEntry>::iterator iter;
+ std::vector<std::unique_ptr<PropEntry> >::iterator iter;
for (iter = maEntries.begin(); iter != maEntries.end(); ++iter)
{
- if ( iter->mnId == 0 )
+ if ( (*iter)->mnId == 0 )
break;
}
if (iter == maEntries.end())
return;
- SvMemoryStream aStream( iter->mpBuf, iter->mnSize, StreamMode::READ );
+ SvMemoryStream aStream( (*iter)->mpBuf, (*iter)->mnSize, StreamMode::READ );
aStream.Seek( STREAM_SEEK_TO_BEGIN );
sal_uInt32 nDictCount(0);
aStream.ReadUInt32( nDictCount );
@@ -537,7 +539,8 @@ Section& Section::operator=( const Section& rSection )
{
memcpy( static_cast<void*>(aFMTID), static_cast<void const *>(rSection.aFMTID), 16 );
- maEntries = rSection.maEntries.clone();
+ for(const std::unique_ptr<PropEntry>& rEntry : rSection.maEntries)
+ maEntries.push_back(o3tl::make_unique<PropEntry>(*rEntry.get()));
}
return *this;
}
diff --git a/sd/source/filter/ppt/propread.hxx b/sd/source/filter/ppt/propread.hxx
index 095e831..a4d74fe 100644
--- a/sd/source/filter/ppt/propread.hxx
+++ b/sd/source/filter/ppt/propread.hxx
@@ -21,6 +21,8 @@
#define INCLUDED_SD_SOURCE_FILTER_PPT_PROPREAD_HXX
#include <map>
+#include <vector>
+#include <memory>
#include <boost/ptr_container/ptr_vector.hpp>
#include <sal/types.h>
@@ -108,7 +110,7 @@ public:
void Clear();
void SetTextEncoding( sal_uInt16 nTextEnc ){ mnTextEnc = nTextEnc; };
- bool Read( OUString& rString, sal_uInt32 nType = VT_EMPTY, bool bDwordAlign = true );
+ bool Read( OUString& rString, sal_uInt32 nType = VT_EMPTY, bool bDwordAlign = true );
PropItem& operator=( PropItem& rPropItem );
using SvStream::Read;
@@ -117,7 +119,7 @@ public:
class Section
{
sal_uInt16 mnTextEnc;
- boost::ptr_vector<PropEntry> maEntries;
+ std::vector<std::unique_ptr<PropEntry> > maEntries;
protected:
commit 85d26ef99760d1b6f538b416263232b10b3e967c
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:59:45 2015 +0200
sd: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ib22556bc6af1700e62d1710ac32068c541c72f86
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 41426b5..74c8807 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -796,9 +796,9 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
for ( sal_uInt32 i = 0; i < rTextObj.ParagraphCount(); ++i )
{
ParagraphObj* pPara = rTextObj.GetParagraph(i);
- for ( boost::ptr_vector<PortionObj>::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
+ for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
{
- const PortionObj& rPortion = *it;
+ const PortionObj& rPortion = *(*it).get();
nPropertyFlags = 0;
sal_uInt32 nCharAttr = rPortion.mnCharAttr;
sal_uInt32 nCharColor = rPortion.mnCharColor;
@@ -1094,9 +1094,9 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
for ( sal_uInt32 i = 0; i < aTextObj.ParagraphCount(); ++i )
{
pPara = aTextObj.GetParagraph(i);
- for ( boost::ptr_vector<PortionObj>::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
+ for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
{
- const PortionObj& rPortion = *it;
+ const PortionObj& rPortion = *(*it).get();
if ( rPortion.mpFieldEntry )
{
const FieldEntry* pFieldEntry = rPortion.mpFieldEntry;
@@ -3864,9 +3864,9 @@ void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm )
for ( sal_uInt32 i = 0; nCharactersLeft && i < ParagraphCount(); ++i )
{
ParagraphObj* pPtr = GetParagraph(i);
- for ( boost::ptr_vector<PortionObj>::const_iterator it = pPtr->begin(); nCharactersLeft && it != pPtr->end(); ++it )
+ for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPtr->begin(); nCharactersLeft && it != pPtr->end(); ++it )
{
- const PortionObj& rPortion = *it;
+ const PortionObj& rPortion = *(*it).get();
sal_Int32 nPortionSize = rPortion.mnTextSize >= nCharactersLeft ? nCharactersLeft : rPortion.mnTextSize;
sal_Int32 nFlags = 7;
nCharactersLeft -= nPortionSize;
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index b831e91..8eae702 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -49,6 +49,7 @@
#include <vcl/metric.hxx>
#include <vcl/outdev.hxx>
#include <vcl/virdev.hxx>
+#include <o3tl/make_unique.hxx>
css::uno::Reference< css::i18n::XBreakIterator > xPPTBreakIter;
@@ -725,7 +726,7 @@ ParagraphObj::ParagraphObj(css::uno::Reference< css::text::XTextContent > & rXTe
{
PortionObj* pPortionObj = new PortionObj( aXCursorText, !aXTextPortionE->hasMoreElements(), rFontCollection );
if ( pPortionObj->Count() )
- mvPortions.push_back( pPortionObj );
+ mvPortions.push_back( std::unique_ptr<PortionObj>(pPortionObj) );
else
delete pPortionObj;
}
@@ -751,8 +752,8 @@ ParagraphObj::~ParagraphObj()
void ParagraphObj::Write( SvStream* pStrm )
{
- for ( boost::ptr_vector<PortionObj>::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it )
- it->Write( pStrm, mbLastParagraph );
+ for ( std::vector<std::unique_ptr<PortionObj> >::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it )
+ (*it)->Write( pStrm, mbLastParagraph );
}
void ParagraphObj::ImplClear()
@@ -916,7 +917,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
}
}
- CalculateGraphicBulletSize( ( mvPortions.empty() ) ? 24 : mvPortions.front().mnCharHeight );
+ CalculateGraphicBulletSize( ( mvPortions.empty() ) ? 24 : mvPortions.front()->mnCharHeight );
switch( nNumberingType )
{
@@ -1228,8 +1229,8 @@ void ParagraphObj::ImplConstruct( const ParagraphObj& rParagraphObj )
mbForbiddenRules = rParagraphObj.mbForbiddenRules;
mnBiDi = rParagraphObj.mnBiDi;
- for ( boost::ptr_vector<PortionObj>::const_iterator it = rParagraphObj.begin(); it != rParagraphObj.end(); ++it )
- mvPortions.push_back( new PortionObj( *it ) );
+ for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = rParagraphObj.begin(); it != rParagraphObj.end(); ++it )
+ mvPortions.push_back( o3tl::make_unique<PortionObj>( **it ) );
maTabStop = rParagraphObj.maTabStop;
bExtendedParameters = rParagraphObj.bExtendedParameters;
@@ -1257,8 +1258,8 @@ void ParagraphObj::ImplConstruct( const ParagraphObj& rParagraphObj )
sal_uInt32 ParagraphObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition )
{
mnTextSize = 0;
- for ( boost::ptr_vector<PortionObj>::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it )
- mnTextSize += it->ImplCalculateTextPositions( nCurrentTextPosition + mnTextSize );
+ for ( std::vector<std::unique_ptr<PortionObj> >::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it )
+ mnTextSize += (*it)->ImplCalculateTextPositions( nCurrentTextPosition + mnTextSize );
return mnTextSize;
}
diff --git a/sd/source/filter/eppt/text.hxx b/sd/source/filter/eppt/text.hxx
index e96783c..3439774 100644
--- a/sd/source/filter/eppt/text.hxx
+++ b/sd/source/filter/eppt/text.hxx
@@ -27,7 +27,7 @@
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <editeng/svxenum.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
#include <memory>
namespace com { namespace sun { namespace star {
@@ -177,7 +177,7 @@ class ParagraphObj : public PropStateValue, public SOParagraph
friend class TextObj;
friend struct PPTExParaSheet;
- boost::ptr_vector<PortionObj> mvPortions;
+ std::vector<std::unique_ptr<PortionObj> > mvPortions;
MapMode maMapModeSrc;
MapMode maMapModeDest;
@@ -226,10 +226,10 @@ class ParagraphObj : public PropStateValue, public SOParagraph
bool empty() const { return mvPortions.empty(); }
- const PortionObj& front() const { return mvPortions.front(); }
+ const PortionObj& front() const { return *mvPortions.front().get(); }
- boost::ptr_vector<PortionObj>::const_iterator begin() const { return mvPortions.begin(); }
- boost::ptr_vector<PortionObj>::const_iterator end() const { return mvPortions.end(); }
+ std::vector<std::unique_ptr<PortionObj> >::const_iterator begin() const { return mvPortions.begin(); }
+ std::vector<std::unique_ptr<PortionObj> >::const_iterator end() const { return mvPortions.end(); }
void CalculateGraphicBulletSize( sal_uInt16 nFontHeight );
~ParagraphObj();
commit 1c0371a561b336e37b4ba4699842b60685e90125
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:54:30 2015 +0200
sd: boost::ptr_vector->std::vector
Change-Id: Idff9e260f180ea4d68ae7c04414d61f5f5887f0b
diff --git a/sd/source/filter/eppt/pptexsoundcollection.cxx b/sd/source/filter/eppt/pptexsoundcollection.cxx
index 6521b8c..f7d8c16 100644
--- a/sd/source/filter/eppt/pptexsoundcollection.cxx
+++ b/sd/source/filter/eppt/pptexsoundcollection.cxx
@@ -154,7 +154,7 @@ sal_uInt32 ExSoundCollection::GetId(const OUString& rString)
if (!rString.isEmpty())
{
const sal_uInt32 nSoundCount = maEntries.size();
- boost::ptr_vector<ExSoundEntry>::const_iterator iter;
+ std::vector<ExSoundEntry>::const_iterator iter;
for (iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++nSoundId)
{
@@ -164,13 +164,12 @@ sal_uInt32 ExSoundCollection::GetId(const OUString& rString)
if ( nSoundId++ == nSoundCount )
{
- ExSoundEntry* pEntry = new ExSoundEntry( rString );
- if ( pEntry->GetFileSize() )
- maEntries.push_back(pEntry);
+ ExSoundEntry aEntry( rString );
+ if ( aEntry.GetFileSize() )
+ maEntries.push_back(aEntry);
else
{
nSoundId = 0; // only insert sounds that are accessible
- delete pEntry;
}
}
}
@@ -183,7 +182,7 @@ sal_uInt32 ExSoundCollection::GetSize() const
if (!maEntries.empty())
{
nSize += 8 + 12; // size of SoundCollectionContainerHeader + SoundCollAtom
- boost::ptr_vector<ExSoundEntry>::const_iterator iter;
+ std::vector<ExSoundEntry>::const_iterator iter;
sal_uInt32 i = 1;
for ( iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++i)
nSize += iter->GetSize(i);
@@ -204,7 +203,7 @@ void ExSoundCollection::Write( SvStream& rSt ) const
// create SoundCollAtom ( reference to the next free SoundId );
rSt.WriteUInt32( EPP_SoundCollAtom << 16 ).WriteUInt32( 4 ).WriteUInt32( nSoundCount );
- boost::ptr_vector<ExSoundEntry>::const_iterator iter;
+ std::vector<ExSoundEntry>::const_iterator iter;
for ( iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++i)
iter->Write(rSt,i);
}
diff --git a/sd/source/filter/eppt/pptexsoundcollection.hxx b/sd/source/filter/eppt/pptexsoundcollection.hxx
index 2d9b20b..a104cd4 100644
--- a/sd/source/filter/eppt/pptexsoundcollection.hxx
+++ b/sd/source/filter/eppt/pptexsoundcollection.hxx
@@ -20,7 +20,7 @@
#ifndef INCLUDED_SD_SOURCE_FILTER_EPPT_PPTEXSOUNDCOLLECTION_HXX
#define INCLUDED_SD_SOURCE_FILTER_EPPT_PPTEXSOUNDCOLLECTION_HXX
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
#ifdef DBG_ANIM_LOG
#include <stdio.h>
@@ -34,7 +34,7 @@ namespace ppt
class ExSoundEntry
{
- sal_uInt32 nFileSize;
+ sal_uInt32 nFileSize;
OUString aSoundURL;
OUString ImplGetName() const;
@@ -43,13 +43,13 @@ class ExSoundEntry
public:
bool IsSameURL(const OUString& rURL) const;
- sal_uInt32 GetFileSize( ) const { return nFileSize; };
+ sal_uInt32 GetFileSize( ) const { return nFileSize; };
- ExSoundEntry(const OUString& rSoundURL);
+ ExSoundEntry(const OUString& rSoundURL);
/// @return size of a complete SoundContainer.
- sal_uInt32 GetSize( sal_uInt32 nId ) const;
- void Write( SvStream& rSt, sal_uInt32 nId ) const;
+ sal_uInt32 GetSize( sal_uInt32 nId ) const;
+ void Write( SvStream& rSt, sal_uInt32 nId ) const;
};
class ExSoundCollection
@@ -64,7 +64,7 @@ class ExSoundCollection
private:
- boost::ptr_vector<ExSoundEntry> maEntries;
+ std::vector<ExSoundEntry> maEntries;
};
} // namespace ppt
commit afc3f660cb6b9f48bed24e9ee636ffe4d202f47b
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:52:17 2015 +0200
sd: boost::ptr_vector->std::vector
Change-Id: I8eb4327163f7b3b5b8f88e93719fb7b15f31e7fd
diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx
index 77c5d52..0297cf5 100644
--- a/sd/source/filter/eppt/epptbase.hxx
+++ b/sd/source/filter/eppt/epptbase.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SD_SOURCE_FILTER_EPPT_EPPTBASE_HXX
#include <vector>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <vcl/mapmod.hxx>
#include <tools/stream.hxx>
@@ -144,7 +143,7 @@ struct FontCollectionEntry
sal_Int16 CharSet;
OUString Original;
- bool bIsConverted;
+ bool bIsConverted;
FontCollectionEntry( const OUString& rName, sal_Int16 nFamily, sal_Int16 nPitch, sal_Int16 nCharSet ) :
Scaling ( 1.0 ),
@@ -195,7 +194,7 @@ public:
private:
VclPtr<VirtualDevice> pVDev;
- boost::ptr_vector<FontCollectionEntry> maFonts;
+ std::vector<FontCollectionEntry> maFonts;
};
#define PPTEX_STYLESHEETENTRYS 9
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index 6bc7dfd..b831e91 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -1431,7 +1431,7 @@ sal_uInt32 FontCollection::GetId( FontCollectionEntry& rEntry )
rEntry.Scaling = fScaling;
}
- maFonts.push_back(new FontCollectionEntry(rEntry));
+ maFonts.push_back(rEntry);
return nFonts;
}
return 0;
commit 78624d3ee463232ce70ebd07ad6aa567e1e7702a
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:50:56 2015 +0200
sd: boost::ptr_vector->std::vector
Change-Id: I6b72d6642b8d6da0942dd1ed24b484c065162aae
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 34a5510..b165f95 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -18,7 +18,6 @@
*/
#include <vector>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <libxml/xmlwriter.h>
#include <sfx2/docfile.hxx>
@@ -141,7 +140,7 @@ void SdPage::SetPresentationLayout(const OUString& rLayoutName,
// - replace-data for OutlinerParaObject
std::vector<SfxStyleSheetBase*> aOutlineStyles;
std::vector<SfxStyleSheetBase*> aOldOutlineStyles;
- boost::ptr_vector<StyleReplaceData> aReplList;
+ std::vector<StyleReplaceData> aReplList;
bool bListsFilled = false;
const size_t nObjCount = GetObjCount();
@@ -177,12 +176,12 @@ void SdPage::SetPresentationLayout(const OUString& rLayoutName,
if (bReplaceStyleSheets && pSheet)
{
// Replace instead Set
- StyleReplaceData* pReplData = new StyleReplaceData;
- pReplData->nNewFamily = pSheet->GetFamily();
- pReplData->nFamily = pSheet->GetFamily();
- pReplData->aNewName = aFullName;
- pReplData->aName = aOldFullName;
- aReplList.push_back(pReplData);
+ StyleReplaceData aReplData;
+ aReplData.nNewFamily = pSheet->GetFamily();
+ aReplData.nFamily = pSheet->GetFamily();
+ aReplData.aNewName = aFullName;
+ aReplData.aName = aOldFullName;
+ aReplList.push_back(aReplData);
}
else
{
@@ -221,7 +220,7 @@ void SdPage::SetPresentationLayout(const OUString& rLayoutName,
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
if ( bReplaceStyleSheets && pOPO )
{
- boost::ptr_vector<StyleReplaceData>::const_iterator it = aReplList.begin();
+ std::vector<StyleReplaceData>::const_iterator it = aReplList.begin();
while (it != aReplList.end())
{
pOPO->ChangeStyleSheets( it->aName, it->nFamily, it->aNewName, it->nNewFamily );
commit e2d92d641b81d4c0698e442ddb2a4fd4f37c3621
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:36:01 2015 +0200
vcl: boost::ptr_vector->std::vector
Change-Id: Ib75e4dffb35032f273b9482341a438ccb9b00397
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 487c895..edfdbc9 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -18,7 +18,6 @@
*/
#include <string.h>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index f903310..9c7eb49 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -19,13 +19,12 @@
#include <textdoc.hxx>
#include <stdlib.h>
-#include <boost/mem_fn.hpp>
#include <osl/diagnose.h>
// compare function called by QuickSort
-static bool CompareStart( const TextCharAttrib& pFirst, const TextCharAttrib& pSecond )
+static bool CompareStart( const std::unique_ptr<TextCharAttrib>& pFirst, const std::unique_ptr<TextCharAttrib>& pSecond )
{
- return pFirst.GetStart() < pSecond.GetStart();
+ return pFirst->GetStart() < pSecond->GetStart();
}
TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_Int32 nStart, sal_Int32 nEnd )
@@ -71,31 +70,31 @@ void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib )
bool bInserted = false;
for (TextCharAttribs::iterator it = maAttribs.begin(); it != maAttribs.end(); ++it)
{
- if ( it->GetStart() > nStart )
+ if ( (*it)->GetStart() > nStart )
{
- maAttribs.insert( it, pAttrib );
+ maAttribs.insert( it, std::unique_ptr<TextCharAttrib>(pAttrib) );
bInserted = true;
break;
}
}
if ( !bInserted )
- maAttribs.push_back( pAttrib );
+ maAttribs.push_back( std::unique_ptr<TextCharAttrib>(pAttrib) );
}
void TextCharAttribList::ResortAttribs()
{
- maAttribs.sort(CompareStart);
+ std::sort( maAttribs.begin(), maAttribs.end(), CompareStart );
}
TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos )
{
for (TextCharAttribs::reverse_iterator it = maAttribs.rbegin(); it != maAttribs.rend(); ++it)
{
- if ( it->GetEnd() < nPos )
+ if ( (*it)->GetEnd() < nPos )
return nullptr;
- if ( ( it->Which() == nWhich ) && it->IsIn(nPos) )
- return &*it;
+ if ( ( (*it)->Which() == nWhich ) && (*it)->IsIn(nPos) )
+ return it->get();
}
return nullptr;
}
@@ -105,10 +104,10 @@ const TextCharAttrib* TextCharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal
DBG_ASSERT( nWhich, "FindNextAttrib: Which?" );
for (TextCharAttribs::const_iterator it = maAttribs.begin(); it != maAttribs.end(); ++it)
{
- if ( ( it->GetStart() >= nFromPos ) &&
- ( it->GetEnd() <= nMaxPos ) &&
- ( it->Which() == nWhich ) )
- return &*it;
+ if ( ( (*it)->GetStart() >= nFromPos ) &&
+ ( (*it)->GetEnd() <= nMaxPos ) &&
+ ( (*it)->Which() == nWhich ) )
+ return it->get();
}
return nullptr;
}
@@ -117,7 +116,7 @@ bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const
{
for (TextCharAttribs::const_reverse_iterator it = maAttribs.rbegin(); it != maAttribs.rend(); ++it)
{
- if ( it->Which() == nWhich )
+ if ( (*it)->Which() == nWhich )
return true;
}
return false;
@@ -127,10 +126,10 @@ bool TextCharAttribList::HasBoundingAttrib( sal_Int32 nBound )
{
for (TextCharAttribs::reverse_iterator it = maAttribs.rbegin(); it != maAttribs.rend(); ++it)
{
- if ( it->GetEnd() < nBound )
+ if ( (*it)->GetEnd() < nBound )
return false;
- if ( ( it->GetStart() == nBound ) || ( it->GetEnd() == nBound ) )
+ if ( ( (*it)->GetStart() == nBound ) || ( (*it)->GetEnd() == nBound ) )
return true;
}
return false;
@@ -143,18 +142,21 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_Int3
for (TextCharAttribs::iterator it = maAttribs.begin(); it != maAttribs.end(); ++it)
{
- if ( it->GetStart() > nPos )
+ if ( (*it)->GetStart() > nPos )
return nullptr;
- if ( ( it->GetStart() == nPos ) && ( it->GetEnd() == nPos ) && ( it->Which() == nWhich ) )
- return &*it;
+ if ( ( (*it)->GetStart() == nPos ) && ( (*it)->GetEnd() == nPos ) && ( (*it)->Which() == nWhich ) )
+ return it->get();
}
return nullptr;
}
void TextCharAttribList::DeleteEmptyAttribs()
{
- maAttribs.erase_if(boost::mem_fn(&TextCharAttrib::IsEmpty));
+ maAttribs.erase(
+ std::remove_if( maAttribs.begin(), maAttribs.end(),
+ [] (const std::unique_ptr<TextCharAttrib>& rAttrib) { return rAttrib->IsEmpty(); } ),
+ maAttribs.end() );
mbHasEmptyAttribs = false;
}
diff --git a/vcl/source/edit/textdoc.hxx b/vcl/source/edit/textdoc.hxx
index f332f8b..cf5f62e 100644
--- a/vcl/source/edit/textdoc.hxx
+++ b/vcl/source/edit/textdoc.hxx
@@ -23,7 +23,8 @@
#include <rtl/ustring.hxx>
#include <vcl/textdata.hxx>
#include <vcl/txtattr.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
class TextCharAttribList
{
@@ -31,7 +32,7 @@ private:
TextCharAttribList(const TextCharAttribList&) = delete;
TextCharAttribList& operator=(const TextCharAttribList&) = delete;
- typedef boost::ptr_vector<TextCharAttrib> TextCharAttribs;
+ typedef std::vector<std::unique_ptr<TextCharAttrib> > TextCharAttribs;
TextCharAttribs maAttribs;
bool mbHasEmptyAttribs;
@@ -42,9 +43,9 @@ public:
void Clear();
sal_uInt16 Count() const { return maAttribs.size(); }
- const TextCharAttrib& GetAttrib( sal_uInt16 n ) const { return maAttribs[n]; }
- TextCharAttrib& GetAttrib( sal_uInt16 n ) { return maAttribs[n]; }
- void RemoveAttrib( sal_uInt16 n ) { maAttribs.release( maAttribs.begin() + n ).release(); }
+ const TextCharAttrib& GetAttrib( sal_uInt16 n ) const { return *maAttribs[n].get(); }
+ TextCharAttrib& GetAttrib( sal_uInt16 n ) { return *maAttribs[n].get(); }
+ void RemoveAttrib( sal_uInt16 n ) { maAttribs[n].release(); maAttribs.erase( maAttribs.begin() + n ); }
void InsertAttrib( TextCharAttrib* pAttrib );
commit 6cc4118a1014acad34f29901eebc1be7a9208112
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:20:23 2015 +0200
vcl: boost::ptr_vector->std::vector
Change-Id: I21f90c8d4b3d52b7119d664cb7af471b33f27649
diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx
index ff36df7..7abb7f0 100644
--- a/vcl/source/edit/textdat2.hxx
+++ b/vcl/source/edit/textdat2.hxx
@@ -25,7 +25,7 @@
#include <vcl/cursor.hxx>
#include <vcl/idle.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
class TextNode;
class TextView;
@@ -105,9 +105,9 @@ private:
sal_uInt16 mnStartPortion;
sal_uInt16 mnEndPortion;
- short mnStartX;
+ short mnStartX;
- bool mbInvalid; // fuer geschickte Formatierung/Ausgabe
+ bool mbInvalid; // fuer geschickte Formatierung/Ausgabe
public:
TextLine()
@@ -131,12 +131,12 @@ public:
sal_Int32& GetEnd() { return mnEnd; }
void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; }
- sal_uInt16 GetStartPortion() const { return mnStartPortion; }
- sal_uInt16& GetStartPortion() { return mnStartPortion; }
+ sal_uInt16 GetStartPortion() const { return mnStartPortion; }
+ sal_uInt16& GetStartPortion() { return mnStartPortion; }
void SetEndPortion( sal_uInt16 n ) { mnEndPortion = n; }
- sal_uInt16 GetEndPortion() const { return mnEndPortion; }
- sal_uInt16& GetEndPortion() { return mnEndPortion; }
+ sal_uInt16 GetEndPortion() const { return mnEndPortion; }
+ sal_uInt16& GetEndPortion() { return mnEndPortion; }
sal_Int32 GetLen() const { return mnEnd - mnStart; }
@@ -170,15 +170,15 @@ class TEParaPortion
private:
TextNode* mpNode;
- boost::ptr_vector<TextLine> maLines;
+ std::vector<TextLine> maLines;
TETextPortionList maTextPortions;
std::vector<TEWritingDirectionInfo> maWritingDirectionInfos;
- sal_Int32 mnInvalidPosStart;
- sal_Int32 mnInvalidDiff;
+ sal_Int32 mnInvalidPosStart;
+ sal_Int32 mnInvalidDiff;
- bool mbInvalid;
- bool mbSimple; // only type linearly
+ bool mbInvalid;
+ bool mbSimple; // only type linearly
TEParaPortion( const TEParaPortion& ) {;}
@@ -198,7 +198,7 @@ public:
sal_Int32 GetInvalidDiff() const { return mnInvalidDiff; }
TextNode* GetNode() const { return mpNode; }
- boost::ptr_vector<TextLine>& GetLines() { return maLines; }
+ std::vector<TextLine>& GetLines() { return maLines; }
TETextPortionList& GetTextPortions() { return maTextPortions; }
std::vector<TEWritingDirectionInfo>& GetWritingDirectionInfos() { return maWritingDirectionInfos; }
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 5eeded2..58e0bc9 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1620,17 +1620,16 @@ void TextEngine::CreateAndInsertEmptyLine( sal_uInt32 nPara )
TextNode* pNode = mpDoc->GetNodes()[ nPara ];
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- TextLine* pTmpLine = new TextLine;
- pTmpLine->SetStart( pNode->GetText().getLength() );
- pTmpLine->SetEnd( pTmpLine->GetStart() );
- pTEParaPortion->GetLines().push_back( pTmpLine );
+ TextLine aTmpLine;
+ aTmpLine.SetStart( pNode->GetText().getLength() );
+ aTmpLine.SetEnd( aTmpLine.GetStart() );
if ( ImpGetAlign() == TXTALIGN_CENTER )
- pTmpLine->SetStartX( (short)(mnMaxTextWidth / 2) );
+ aTmpLine.SetStartX( (short)(mnMaxTextWidth / 2) );
else if ( ImpGetAlign() == TXTALIGN_RIGHT )
- pTmpLine->SetStartX( (short)mnMaxTextWidth );
+ aTmpLine.SetStartX( (short)mnMaxTextWidth );
else
- pTmpLine->SetStartX( mpDoc->GetLeftMargin() );
+ aTmpLine.SetStartX( mpDoc->GetLeftMargin() );
bool bLineBreak = !pNode->GetText().isEmpty();
@@ -1642,9 +1641,10 @@ void TextEngine::CreateAndInsertEmptyLine( sal_uInt32 nPara )
{
// -2: The new one is already inserted.
sal_uInt16 nPos = (sal_uInt16) pTEParaPortion->GetTextPortions().size() - 1 ;
- pTmpLine->SetStartPortion( nPos );
- pTmpLine->SetEndPortion( nPos );
+ aTmpLine.SetStartPortion( nPos );
+ aTmpLine.SetEndPortion( nPos );
}
+ pTEParaPortion->GetLines().push_back( aTmpLine );
}
void TextEngine::ImpBreakLine( sal_uInt32 nPara, TextLine* pLine, TETextPortion*, sal_Int32 nPortionStart, long nRemainingWidth )
@@ -2142,8 +2142,7 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
// initialization
if ( pTEParaPortion->GetLines().empty() )
{
- TextLine* pL = new TextLine;
- pTEParaPortion->GetLines().push_back( pL );
+ pTEParaPortion->GetLines().push_back( TextLine() );
}
const sal_Int32 nInvalidDiff = pTEParaPortion->GetInvalidDiff();
@@ -2394,8 +2393,9 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
{
if ( nIndex < pNode->GetText().getLength() )
{
- pLine = new TextLine;
- pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + ++nLine, pLine );
+ ++nLine;
+ pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + nLine, TextLine() );
+ pLine = &pTEParaPortion->GetLines()[nLine];
}
else
{
commit 6e1c20b9949eebdb5e52d076d87157ca7f237f64
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:13:43 2015 +0200
vcl: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I91d833a541f1d21be66789bba6c983aa741731d8
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 7552f00..f6c092c 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -20,7 +20,8 @@
#ifndef INCLUDED_VCL_INC_ILSTBOX_HXX
#define INCLUDED_VCL_INC_ILSTBOX_HXX
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
#include <boost/signals2/signal.hpp>
#include <vcl/image.hxx>
#include <vcl/ctrl.hxx>
@@ -51,7 +52,7 @@ struct ImplEntryType
OUString maStr;
Image maImage;
void* mpUserData;
- bool mbIsSelected;
+ bool mbIsSelected;
ListBoxEntryFlags mnFlags;
long mnHeight;
@@ -97,13 +98,13 @@ private:
Link<sal_Int32,void> maSelectionChangedHdl;
bool mbCallSelectionChangedHdl;
- boost::ptr_vector<ImplEntryType> maEntries;
+ std::vector<std::unique_ptr<ImplEntryType> > maEntries;
ImplEntryType* GetEntry( sal_Int32 nPos ) const
{
if (nPos < 0 || static_cast<size_t>(nPos) >= maEntries.size())
return nullptr;
- return const_cast<ImplEntryType*>(&maEntries[nPos]);
+ return const_cast<ImplEntryType*>(maEntries[nPos].get());
}
public:
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index caf3099..1cd6e52 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -87,12 +87,12 @@ void ImplEntryList::SelectEntry( sal_Int32 nPos, bool bSelect )
{
if (0 <= nPos && static_cast<size_t>(nPos) < maEntries.size())
{
- boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+nPos;
+ std::vector<std::unique_ptr<ImplEntryType> >::iterator iter = maEntries.begin()+nPos;
- if ( ( iter->mbIsSelected != bSelect ) &&
- ( (iter->mnFlags & ListBoxEntryFlags::DisableSelection) == ListBoxEntryFlags::NONE ) )
+ if ( ( (*iter)->mbIsSelected != bSelect ) &&
+ ( ( (*iter)->mnFlags & ListBoxEntryFlags::DisableSelection) == ListBoxEntryFlags::NONE ) )
{
- iter->mbIsSelected = bSelect;
+ (*iter)->mbIsSelected = bSelect;
if ( mbCallSelectionChangedHdl )
maSelectionChangedHdl.Call( nPos );
}
@@ -135,12 +135,12 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
if (0 <= nPos && nPos < nEntriesSize)
{
insPos = nPos;
- maEntries.insert( maEntries.begin() + nPos, pNewEntry );
+ maEntries.insert( maEntries.begin() + nPos, std::unique_ptr<ImplEntryType>(pNewEntry) );
}
else
{
insPos = nEntriesSize;
- maEntries.push_back(pNewEntry);
+ maEntries.push_back(std::unique_ptr<ImplEntryType>(pNewEntry));
}
}
else
@@ -159,7 +159,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
if ( nComp >= 0 )
{
insPos = nEntriesSize;
- maEntries.push_back(pNewEntry);
+ maEntries.push_back(std::unique_ptr<ImplEntryType>(pNewEntry));
}
else
{
@@ -169,7 +169,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
if ( nComp <= 0 )
{
insPos = 0;
- maEntries.insert(maEntries.begin(),pNewEntry);
+ maEntries.insert(maEntries.begin(), std::unique_ptr<ImplEntryType>(pNewEntry));
}
else
{
@@ -201,7 +201,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
nMid++;
insPos = nMid;
- maEntries.insert(maEntries.begin()+nMid,pNewEntry);
+ maEntries.insert(maEntries.begin()+nMid, std::unique_ptr<ImplEntryType>(pNewEntry));
}
}
}
@@ -212,7 +212,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
// Collator implementation is garbage then give the user a chance to see
// his stuff
insPos = 0;
- maEntries.insert(maEntries.begin(),pNewEntry);
+ maEntries.insert(maEntries.begin(), std::unique_ptr<ImplEntryType>(pNewEntry));
}
}
@@ -224,9 +224,9 @@ void ImplEntryList::RemoveEntry( sal_Int32 nPos )
{
if (0 <= nPos && static_cast<size_t>(nPos) < maEntries.size())
{
- boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+ nPos;
+ std::vector<std::unique_ptr<ImplEntryType> >::iterator iter = maEntries.begin()+ nPos;
- if ( !!iter->maImage )
+ if ( !!(*iter)->maImage )
mnImages--;
maEntries.erase(iter);
@@ -238,7 +238,7 @@ sal_Int32 ImplEntryList::FindEntry( const OUString& rString, bool bSearchMRUArea
const sal_Int32 nEntries = static_cast<sal_Int32>(maEntries.size());
for ( sal_Int32 n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
{
- OUString aComp( vcl::I18nHelper::filterFormattingChars( maEntries[n].maStr ) );
+ OUString aComp( vcl::I18nHelper::filterFormattingChars( maEntries[n]->maStr ) );
if ( aComp == rString )
return n;
}
commit c8b2f752ceefaf128579524eb2bd62bc6c79f0ba
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:08:04 2015 +0200
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I6a0b9d539489b7774c3437871f31fd28e737c901
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 30f8c8d..8c5132a 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -44,7 +44,6 @@
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
#include <boost/ptr_container/ptr_map.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <boost/tuple/tuple.hpp>
#include <cassert>
diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx
index f353169..bf892ee 100644
--- a/sfx2/source/inc/virtmenu.hxx
+++ b/sfx2/source/inc/virtmenu.hxx
@@ -19,14 +19,15 @@
#ifndef INCLUDED_SFX2_SOURCE_INC_VIRTMENU_HXX
#define INCLUDED_SFX2_SOURCE_INC_VIRTMENU_HXX
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
#include <sfx2/mnuitem.hxx>
class SfxBindings;
class SfxMenuImageControl_Impl;
-typedef ::boost::ptr_vector<SfxMenuControl> SfxMenuCtrlArr_Impl;
+typedef std::vector<std::unique_ptr<SfxMenuControl> > SfxMenuCtrlArr_Impl;
class SAL_DLLPUBLIC_EXPORT SfxVirtualMenu
{
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index cdf4752..dc3b36f 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -366,7 +366,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
pPopup = nullptr;
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
- rCtrlArr.push_back(pMnuCtrl);
+ rCtrlArr.push_back(std::unique_ptr<SfxMenuControl>(pMnuCtrl));
(pItems+nPos)->Bind( nullptr, nSlotId, sItemText, *pBindings);
pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings);
@@ -409,7 +409,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
if ( pMnuCtrl )
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
- rCtrlArr.push_back(pMnuCtrl);
+ rCtrlArr.push_back(std::unique_ptr<SfxMenuControl>(pMnuCtrl));
(pItems+nPos)->Bind( nullptr, nSlotId, sItemText, *pBindings);
}
}
@@ -421,7 +421,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
if ( pMnuCtrl )
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
- rCtrlArr.push_back(pMnuCtrl);
+ rCtrlArr.push_back(std::unique_ptr<SfxMenuControl>(pMnuCtrl));
(pItems+nPos)->Bind( nullptr, nSlotId, sItemText, *pBindings);
}
else
@@ -691,10 +691,10 @@ void SfxVirtualMenu::BindControllers()
for (SfxMenuCtrlArr_Impl::iterator i = rCtrlArr.begin();
i != rCtrlArr.end(); ++i)
{
- sal_uInt16 nSlotId = i->GetId();
+ sal_uInt16 nSlotId = (*i)->GetId();
if (pSVMenu->GetItemCommand(nSlotId).isEmpty())
{
- i->ReBind();
+ (*i)->ReBind();
}
}
@@ -718,10 +718,10 @@ void SfxVirtualMenu::UnbindControllers()
for (SfxMenuCtrlArr_Impl::iterator i = rCtrlArr.begin();
i != rCtrlArr.end(); ++i)
{
- if (i->IsBound())
+ if ((*i)->IsBound())
{
// UnoController is not bound!
- i->UnBind();
+ (*i)->UnBind();
}
}
commit 10629489d39044c79967c0e7a38e1fdd5025f069
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 14:05:05 2015 +0200
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ida6aa572b182f966180debc9bf8665975fe51ea2
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 567fdee..16e5a5b 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -285,7 +285,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
pDock->bNewLine = true;
}
- pDockArr->insert(pDockArr->begin() + n, pDock);
+ pDockArr->insert(pDockArr->begin() + n, std::unique_ptr<SfxDock_Impl>(pDock));
}
}
}
@@ -339,7 +339,7 @@ void SfxSplitWindow::SaveConfig_Impl()
sal_uInt16 n;
for ( n=0; n<pDockArr->size(); n++ )
{
- const SfxDock_Impl& rDock = (*pDockArr)[n];
+ const SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.bHide || rDock.pWin )
nCount++;
}
@@ -348,7 +348,7 @@ void SfxSplitWindow::SaveConfig_Impl()
for ( n=0; n<pDockArr->size(); n++ )
{
- const SfxDock_Impl& rDock = (*pDockArr)[n];
+ const SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( !rDock.bHide && !rDock.pWin )
continue;
if ( rDock.bNewLine )
@@ -419,7 +419,7 @@ void SfxSplitWindow::Split()
sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- const SfxDock_Impl& rD = (*pDockArr)[n];
+ const SfxDock_Impl& rD = *(*pDockArr)[n].get();
if ( rD.pWin )
{
const sal_uInt16 nId = rD.nType;
@@ -476,7 +476,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- SfxDock_Impl& rDock = (*pDockArr)[n];
+ SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.bNewLine )
{
// The window opens a new line
@@ -533,7 +533,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
// Not found, insert at end
pFoundDock = new SfxDock_Impl;
pFoundDock->bHide = true;
- pDockArr->push_back( pFoundDock );
+ pDockArr->push_back( std::unique_ptr<SfxDock_Impl>(pFoundDock) );
pFoundDock->nType = pDockWin->GetType();
nLine++;
nPos = 0;
@@ -557,11 +557,11 @@ void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin, bool bSave)
sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- const SfxDock_Impl& rDock = (*pDockArr)[n];
+ const SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.nType == pDockWin->GetType() )
{
if ( rDock.bNewLine && n<nCount-1 )
- (*pDockArr)[n+1].bNewLine = true;
+ (*pDockArr)[n+1]->bNewLine = true;
// Window has a position, this we forget
pDockArr->erase(pDockArr->begin() + n);
@@ -628,7 +628,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
sal_uInt16 nInsertPos = 0;
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- SfxDock_Impl& rD = (*pDockArr)[n];
+ SfxDock_Impl& rD = *(*pDockArr)[n].get();
if (rD.pWin)
{
@@ -662,7 +662,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
nInsertPos = nLastWindowIdx + 1; // ignore all non-windows after the last window
}
- pDockArr->insert(pDockArr->begin() + nInsertPos, pDock);
+ pDockArr->insert(pDockArr->begin() + nInsertPos, std::unique_ptr<SfxDock_Impl>(pDock));
InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine );
SaveConfig_Impl();
}
@@ -782,7 +782,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; ++n )
{
- const SfxDock_Impl& rD = (*pDockArr)[n];
+ const SfxDock_Impl& rD = *(*pDockArr)[n].get();
if ( rD.pWin )
{
const sal_uInt16 nId = rD.nType;
@@ -839,7 +839,7 @@ void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, bool bHide )
sal_uInt16 nCount = pDockArr->size();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- SfxDock_Impl& rDock = (*pDockArr)[n];
+ SfxDock_Impl& rDock = *(*pDockArr)[n].get();
if ( rDock.nType == pDockWin->GetType() )
{
rDock.pWin = nullptr;
diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx
index 86d9d7f..2f3b8d6 100644
--- a/sfx2/source/inc/splitwin.hxx
+++ b/sfx2/source/inc/splitwin.hxx
@@ -22,7 +22,8 @@
#include <vcl/splitwin.hxx>
#include <sfx2/childwin.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
class SfxWorkWindow;
class SfxDockingWindow;
@@ -37,7 +38,7 @@ struct SfxDock_Impl
long nSize;
};
-typedef boost::ptr_vector<SfxDock_Impl> SfxDockArr_Impl;
+typedef std::vector<std::unique_ptr<SfxDock_Impl> > SfxDockArr_Impl;
class SfxSplitWindow : public SplitWindow
{
commit 31a4248332cc95a23337ac9c6d7218fe109bce57
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 13:52:28 2015 +0200
sfx2: boost::ptr_vector->std::vector
Change-Id: I0ffe29145fb56f284300d40dfea323a8b16c26de
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index f9d4cd8..0d9e8e3 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -198,9 +198,9 @@ public:
// Object-Factories/global arrays
SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*);
SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, SfxChildWinContextFactory*);
- SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, SfxStbCtrlFactory*);
+ SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, const SfxStbCtrlFactory&);
SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, const SfxMenuCtrlFactory&);
- SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, SfxTbxCtrlFactory*);
+ SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, const SfxTbxCtrlFactory&);
SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const;
SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl& GetStbCtrlFactories_Impl() const;
SAL_DLLPRIVATE SfxMenuCtrlFactArr_Impl& GetMenuCtrlFactories_Impl() const;
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index 363bbf9..824a9c8 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -77,9 +77,9 @@ public:
ResMgr* GetResMgr();
SfxSlotPool* GetSlotPool() const;
- void RegisterToolBoxControl(SfxTbxCtrlFactory*);
+ void RegisterToolBoxControl(const SfxTbxCtrlFactory&);
void RegisterChildWindow(SfxChildWinFactory*);
- void RegisterStatusBarControl(SfxStbCtrlFactory*);
+ void RegisterStatusBarControl(const SfxStbCtrlFactory&);
void RegisterMenuControl(const SfxMenuCtrlFactory&);
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId,
diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx
index 97cc515..43eb733 100644
--- a/include/sfx2/stbitem.hxx
+++ b/include/sfx2/stbitem.hxx
@@ -115,7 +115,7 @@ public:
StatusBar& GetStatusBar() const { return *pBar; }
static SfxStatusBarControl* CreateControl( sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar *pBar, SfxModule* );
- static void RegisterStatusBarControl(SfxModule*, SfxStbCtrlFactory*);
+ static void RegisterStatusBarControl(SfxModule*, const SfxStbCtrlFactory&);
};
@@ -129,7 +129,7 @@ public:
SfxStatusBarControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \
{ return new Class( nSlotId, nId, rStb ); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
- { SfxStatusBarControl::RegisterStatusBarControl( pMod, new SfxStbCtrlFactory( \
+ { SfxStatusBarControl::RegisterStatusBarControl( pMod, SfxStbCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index b0fdb60..f8969fb 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -224,21 +224,21 @@ public:
static SfxItemState GetItemState( const SfxPoolItem* pState );
static SfxToolBoxControl* CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule *pMod );
- static void RegisterToolBoxControl( SfxModule*, SfxTbxCtrlFactory*);
+ static void RegisterToolBoxControl( SfxModule*, const SfxTbxCtrlFactory&);
};
#define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \
SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx ); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
- { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
+ { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
#define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \
SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx, Arg); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
- { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
+ { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index 04b68b8..fc648ff 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -66,11 +66,11 @@ void SfxApplication::Registrations_Impl()
-void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFactory *pFact )
+void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, const SfxTbxCtrlFactory& rFact )
{
if ( pMod )
{
- pMod->RegisterToolBoxControl( pFact );
+ pMod->RegisterToolBoxControl( rFact );
return;
}
@@ -78,24 +78,24 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac
for ( size_t n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ )
{
SfxTbxCtrlFactory *pF = &(*pAppData_Impl->pTbxCtrlFac)[n];
- if ( pF->nTypeId == pFact->nTypeId &&
- (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ if ( pF->nTypeId == rFact.nTypeId &&
+ (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{
SAL_INFO("sfx", "TbxController registration is not clearly defined!");
}
}
#endif
- pAppData_Impl->pTbxCtrlFac->push_back( pFact );
+ pAppData_Impl->pTbxCtrlFac->push_back( rFact );
}
-void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlFactory *pFact )
+void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, const SfxStbCtrlFactory& rFact )
{
if ( pMod )
{
- pMod->RegisterStatusBarControl( pFact );
+ pMod->RegisterStatusBarControl( rFact );
return;
}
@@ -103,15 +103,15 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF
for ( size_t n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ )
{
SfxStbCtrlFactory *pF = &(*pAppData_Impl->pStbCtrlFac)[n];
- if ( pF->nTypeId == pFact->nTypeId &&
- (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ if ( pF->nTypeId == rFact.nTypeId &&
+ (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{
SAL_INFO("sfx", "StbController registration is not clearly defined!");
}
}
#endif
- pAppData_Impl->pStbCtrlFac->push_back( pFact );
+ pAppData_Impl->pStbCtrlFac->push_back( rFact );
}
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index f9152c9..327ace2 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -233,7 +233,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact)
-void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact )
+void SfxModule::RegisterToolBoxControl( const SfxTbxCtrlFactory& rFact )
{
if (!pImpl->pTbxCtrlFac)
pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl;
@@ -242,20 +242,20 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact )
for ( size_t n=0; n<pImpl->pTbxCtrlFac->size(); n++ )
{
SfxTbxCtrlFactory *pF = &(*pImpl->pTbxCtrlFac)[n];
- if ( pF->nTypeId == pFact->nTypeId &&
- (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ if ( pF->nTypeId == rFact.nTypeId &&
+ (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{
SAL_INFO("sfx2.appl", "TbxController-Registering is not clearly defined!");
}
}
#endif
- pImpl->pTbxCtrlFac->push_back( pFact );
+ pImpl->pTbxCtrlFac->push_back( rFact );
}
-void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
+void SfxModule::RegisterStatusBarControl( const SfxStbCtrlFactory& rFact )
{
if (!pImpl->pStbCtrlFac)
pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl;
@@ -264,15 +264,15 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
for ( size_t n=0; n<pImpl->pStbCtrlFac->size(); n++ )
{
SfxStbCtrlFactory *pF = &(*pImpl->pStbCtrlFac)[n];
- if ( pF->nTypeId == pFact->nTypeId &&
- (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ if ( pF->nTypeId == rFact.nTypeId &&
+ (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{
SAL_INFO("sfx2.appl", "TbxController-Registering is not clearly defined!");
}
}
#endif
- pImpl->pStbCtrlFac->push_back( pFact );
+ pImpl->pStbCtrlFac->push_back( rFact );
}
diff --git a/sfx2/source/control/ctrlfactoryimpl.cxx b/sfx2/source/control/ctrlfactoryimpl.cxx
index 6bfe2d4..1df7301 100644
--- a/sfx2/source/control/ctrlfactoryimpl.cxx
+++ b/sfx2/source/control/ctrlfactoryimpl.cxx
@@ -49,7 +49,7 @@ SfxStbCtrlFactory& SfxStbCtrlFactArr_Impl::operator []( size_t i )
return maData[i];
}
-void SfxStbCtrlFactArr_Impl::push_back( SfxStbCtrlFactory* p )
+void SfxStbCtrlFactArr_Impl::push_back( const SfxStbCtrlFactory& p )
{
maData.push_back(p);
}
@@ -69,7 +69,7 @@ SfxTbxCtrlFactory& SfxTbxCtrlFactArr_Impl::operator []( size_t i )
return maData[i];
}
-void SfxTbxCtrlFactArr_Impl::push_back( SfxTbxCtrlFactory* p )
+void SfxTbxCtrlFactArr_Impl::push_back( const SfxTbxCtrlFactory& p )
{
maData.push_back(p);
}
diff --git a/sfx2/source/inc/ctrlfactoryimpl.hxx b/sfx2/source/inc/ctrlfactoryimpl.hxx
index 28e92d8..38a25d8 100644
--- a/sfx2/source/inc/ctrlfactoryimpl.hxx
+++ b/sfx2/source/inc/ctrlfactoryimpl.hxx
@@ -24,7 +24,6 @@
#include <sfx2/stbitem.hxx>
#include <sfx2/tbxctrl.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
class SfxMenuCtrlFactArr_Impl
@@ -43,28 +42,28 @@ public:
class SfxStbCtrlFactArr_Impl
{
- typedef boost::ptr_vector<SfxStbCtrlFactory> DataType;
+ typedef std::vector<SfxStbCtrlFactory> DataType;
DataType maData;
public:
const SfxStbCtrlFactory& operator []( size_t i ) const;
SfxStbCtrlFactory& operator []( size_t i );
- void push_back( SfxStbCtrlFactory* p );
+ void push_back( const SfxStbCtrlFactory& );
size_t size() const;
};
class SfxTbxCtrlFactArr_Impl
{
- typedef boost::ptr_vector<SfxTbxCtrlFactory> DataType;
+ typedef std::vector<SfxTbxCtrlFactory> DataType;
DataType maData;
public:
const SfxTbxCtrlFactory& operator []( size_t i ) const;
SfxTbxCtrlFactory& operator []( size_t i );
- void push_back( SfxTbxCtrlFactory* p );
+ void push_back( const SfxTbxCtrlFactory& );
size_t size() const;
};
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 4c0d962..4b3b9c0 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -633,9 +633,9 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl
}
-void SfxStatusBarControl::RegisterStatusBarControl(SfxModule* pMod, SfxStbCtrlFactory* pFact)
+void SfxStatusBarControl::RegisterStatusBarControl(SfxModule* pMod, const SfxStbCtrlFactory& rFact)
{
- SfxGetpApp()->RegisterStatusBarControl_Impl( pMod, pFact );
+ SfxGetpApp()->RegisterStatusBarControl_Impl( pMod, rFact );
}
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 7cbe75d..a23c55f 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -272,9 +272,9 @@ void SAL_CALL SfxToolBoxControl::dispose() throw (css::uno::RuntimeException, st
}
-void SfxToolBoxControl::RegisterToolBoxControl( SfxModule* pMod, SfxTbxCtrlFactory* pFact)
+void SfxToolBoxControl::RegisterToolBoxControl( SfxModule* pMod, const SfxTbxCtrlFactory& rFact)
{
- SfxGetpApp()->RegisterToolBoxControl_Impl( pMod, pFact );
+ SfxGetpApp()->RegisterToolBoxControl_Impl( pMod, rFact );
}
SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule* pMod )
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 0c7de3d..0b2ef24 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2799,13 +2799,13 @@ SfxToolBoxControl* SvxColorToolBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_u
void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod)
{
if ( nSlotId == SID_ATTR_LINE_COLOR )
- SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XLineColorItem), nSlotId ) );
+ SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XLineColorItem), nSlotId ) );
else if ( nSlotId == SID_ATTR_FILL_COLOR )
- SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XFillColorItem), nSlotId ) );
+ SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XFillColorItem), nSlotId ) );
else if ( nSlotId == SID_ATTR_CHAR_BACK_COLOR )
- SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxBackgroundColorItem), nSlotId ) );
+ SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxBackgroundColorItem), nSlotId ) );
else
- SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxColorItem), nSlotId ) );
+ SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxColorItem), nSlotId ) );
}
// class SvxFrameToolBoxControl --------------------------------------------
commit b6639b0e12e2bf914371124b870e55761b1155a2
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 12:51:09 2015 +0200
sfx2: boost::ptr_vector->std::vector
Change-Id: Icb9c44a6c251817a66276af32f0c2d1b26fb923a
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 8db9229..f9d4cd8 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -199,7 +199,7 @@ public:
SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*);
SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, SfxChildWinContextFactory*);
SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, SfxStbCtrlFactory*);
- SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, SfxMenuCtrlFactory*);
+ SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, const SfxMenuCtrlFactory&);
SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, SfxTbxCtrlFactory*);
SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const;
SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl& GetStbCtrlFactories_Impl() const;
diff --git a/include/sfx2/mnuitem.hxx b/include/sfx2/mnuitem.hxx
index 7afaec0..56dc4bd 100644
--- a/include/sfx2/mnuitem.hxx
+++ b/include/sfx2/mnuitem.hxx
@@ -68,7 +68,7 @@ public:
static SfxMenuControl* CreateControl( sal_uInt16 nId, Menu &, SfxBindings & );
static SfxUnoMenuControl* CreateControl( const OUString&, sal_uInt16, Menu&, const OUString& sItemText, SfxBindings&, SfxVirtualMenu* );
- static void RegisterMenuControl( SfxModule*, SfxMenuCtrlFactory* );
+ static void RegisterMenuControl( SfxModule*, const SfxMenuCtrlFactory& );
};
@@ -116,7 +116,7 @@ inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const
SfxMenuControl* Class::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) \
{ return new Class(nId, rMenu, rBindings); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
- { SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \
+ { SfxMenuControl::RegisterMenuControl( pMod, SfxMenuCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
#endif
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index 6d257b1..363bbf9 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -80,7 +80,7 @@ public:
void RegisterToolBoxControl(SfxTbxCtrlFactory*);
void RegisterChildWindow(SfxChildWinFactory*);
void RegisterStatusBarControl(SfxStbCtrlFactory*);
- void RegisterMenuControl(SfxMenuCtrlFactory*);
+ void RegisterMenuControl(const SfxMenuCtrlFactory&);
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId,
vcl::Window* pParent,
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index 215478f..04b68b8 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -116,11 +116,11 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF
-void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFactory *pFact )
+void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, const SfxMenuCtrlFactory& rFact )
{
if ( pMod )
{
- pMod->RegisterMenuControl( pFact );
+ pMod->RegisterMenuControl( rFact );
return;
}
@@ -128,15 +128,15 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto
for ( size_t n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ )
{
SfxMenuCtrlFactory *pF = &(*pAppData_Impl->pMenuCtrlFac)[n];
- if ( pF->nTypeId == pFact->nTypeId &&
- (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ if ( pF->nTypeId == rFact.nTypeId &&
+ (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{
SAL_INFO("sfx", "MenuController register is not clearly defined!");
}
}
#endif
- pAppData_Impl->pMenuCtrlFac->push_back( pFact );
+ pAppData_Impl->pMenuCtrlFac->push_back( rFact );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 6de9ecb..f9152c9 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -277,7 +277,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
-void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
+void SfxModule::RegisterMenuControl( const SfxMenuCtrlFactory& rFact )
{
if (!pImpl->pMenuCtrlFac)
pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl;
@@ -286,15 +286,15 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
for ( size_t n=0; n<pImpl->pMenuCtrlFac->size(); n++ )
{
SfxMenuCtrlFactory *pF = &(*pImpl->pMenuCtrlFac)[n];
- if ( pF->nTypeId == pFact->nTypeId &&
- (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ if ( pF->nTypeId == rFact.nTypeId &&
+ (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{
SAL_INFO("sfx2.appl", "MenuController-Registering is not clearly defined!");
}
}
#endif
- pImpl->pMenuCtrlFac->push_back( pFact );
+ pImpl->pMenuCtrlFac->push_back( rFact );
}
diff --git a/sfx2/source/control/ctrlfactoryimpl.cxx b/sfx2/source/control/ctrlfactoryimpl.cxx
index 9a877e1..6bfe2d4 100644
--- a/sfx2/source/control/ctrlfactoryimpl.cxx
+++ b/sfx2/source/control/ctrlfactoryimpl.cxx
@@ -29,7 +29,7 @@ SfxMenuCtrlFactory& SfxMenuCtrlFactArr_Impl::operator []( size_t i )
return maData[i];
}
-void SfxMenuCtrlFactArr_Impl::push_back( SfxMenuCtrlFactory* p )
+void SfxMenuCtrlFactArr_Impl::push_back( const SfxMenuCtrlFactory& p )
{
maData.push_back(p);
}
diff --git a/sfx2/source/inc/ctrlfactoryimpl.hxx b/sfx2/source/inc/ctrlfactoryimpl.hxx
index 81feb31a..28e92d8 100644
--- a/sfx2/source/inc/ctrlfactoryimpl.hxx
+++ b/sfx2/source/inc/ctrlfactoryimpl.hxx
@@ -25,17 +25,18 @@
#include <sfx2/tbxctrl.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
class SfxMenuCtrlFactArr_Impl
{
- typedef boost::ptr_vector<SfxMenuCtrlFactory> DataType;
+ typedef std::vector<SfxMenuCtrlFactory> DataType;
DataType maData;
public:
const SfxMenuCtrlFactory& operator []( size_t i ) const;
SfxMenuCtrlFactory& operator []( size_t i );
- void push_back( SfxMenuCtrlFactory* p );
+ void push_back( const SfxMenuCtrlFactory& );
size_t size() const;
};
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index cf76a3a..b871d71 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -246,14 +246,14 @@ SfxMenuControl* SfxMenuControl::CreateImpl( sal_uInt16 /*nId*/, Menu& /*rMenu*/,
void SfxMenuControl::RegisterControl( sal_uInt16 nSlotId, SfxModule *pMod )
{
- RegisterMenuControl( pMod, new SfxMenuCtrlFactory(
+ RegisterMenuControl( pMod, SfxMenuCtrlFactory(
SfxMenuControl::CreateImpl, typeid(SfxStringItem), nSlotId ) );
}
-void SfxMenuControl::RegisterMenuControl(SfxModule* pMod, SfxMenuCtrlFactory* pFact)
+void SfxMenuControl::RegisterMenuControl(SfxModule* pMod, const SfxMenuCtrlFactory& rFact)
{
- SfxGetpApp()->RegisterMenuControl_Impl( pMod, pFact );
+ SfxGetpApp()->RegisterMenuControl_Impl( pMod, rFact );
}
SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings )
commit 51f9d14ae75bb01ebb79a5ed85eecabc794da490
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 12:05:56 2015 +0200
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I9e4942a0b5c3f6f863b3fa35bf0cc30911944724
diff --git a/sfx2/source/appl/childwinimpl.cxx b/sfx2/source/appl/childwinimpl.cxx
index 806084d..7e8b0b7 100644
--- a/sfx2/source/appl/childwinimpl.cxx
+++ b/sfx2/source/appl/childwinimpl.cxx
@@ -46,17 +46,17 @@ size_t SfxChildWinFactArr_Impl::size() const
const SfxChildWinFactory& SfxChildWinFactArr_Impl::operator []( size_t i ) const
{
- return maData[i];
+ return *maData[i].get();
}
SfxChildWinFactory& SfxChildWinFactArr_Impl::operator []( size_t i )
{
- return maData[i];
+ return *maData[i].get();
}
void SfxChildWinFactArr_Impl::push_back( SfxChildWinFactory* p )
{
- maData.push_back(p);
+ maData.push_back(std::unique_ptr<SfxChildWinFactory>(p));
}
void SfxChildWinFactArr_Impl::erase( iterator it )
diff --git a/sfx2/source/inc/childwinimpl.hxx b/sfx2/source/inc/childwinimpl.hxx
index 0838b37..1132686 100644
--- a/sfx2/source/inc/childwinimpl.hxx
+++ b/sfx2/source/inc/childwinimpl.hxx
@@ -22,7 +22,6 @@
#include <sfx2/childwin.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
#include <memory>
@@ -42,7 +41,7 @@ public:
class SfxChildWinFactArr_Impl
{
- typedef boost::ptr_vector<SfxChildWinFactory> DataType;
+ typedef std::vector<std::unique_ptr<SfxChildWinFactory> > DataType;
DataType maData;
public:
commit 8acacaede11b35c853659526d3c77cc5a9f05b3a
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 12:04:38 2015 +0200
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ic1ca1166874d0d90ed04b841d8143d3b10900cf5
diff --git a/sfx2/source/appl/childwinimpl.cxx b/sfx2/source/appl/childwinimpl.cxx
index 11b09e8..806084d 100644
--- a/sfx2/source/appl/childwinimpl.cxx
+++ b/sfx2/source/appl/childwinimpl.cxx
@@ -26,17 +26,17 @@ size_t SfxChildWinContextArr_Impl::size() const
const SfxChildWinContextFactory& SfxChildWinContextArr_Impl::operator []( size_t i ) const
{
- return maData[i];
+ return *maData[i].get();
}
SfxChildWinContextFactory& SfxChildWinContextArr_Impl::operator []( size_t i )
{
- return maData[i];
+ return *maData[i].get();
}
void SfxChildWinContextArr_Impl::push_back( SfxChildWinContextFactory* p )
{
- maData.push_back(p);
+ maData.push_back(std::unique_ptr<SfxChildWinContextFactory>(p));
}
size_t SfxChildWinFactArr_Impl::size() const
diff --git a/sfx2/source/inc/childwinimpl.hxx b/sfx2/source/inc/childwinimpl.hxx
index e30f79f..0838b37 100644
--- a/sfx2/source/inc/childwinimpl.hxx
+++ b/sfx2/source/inc/childwinimpl.hxx
@@ -23,12 +23,14 @@
#include <sfx2/childwin.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
class SfxFrame;
class SfxChildWinContextArr_Impl
{
- typedef boost::ptr_vector<SfxChildWinContextFactory> DataType;
+ typedef std::vector<std::unique_ptr<SfxChildWinContextFactory> > DataType;
DataType maData;
public:
commit 1715a995c2d57b9d5e56bc0706f1e56cdb2f732d
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 12:02:20 2015 +0200
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I13c6ede42f2fba55397addf7a48adeb80c6a3cb6
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 17550ae..a073b46 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -46,7 +46,8 @@
#include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp>
#include <boost/ptr_container/ptr_map.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
// Maps the Which() field to a pointer to a SfxPoolItem
typedef boost::ptr_map<sal_uInt16, SfxPoolItem> SfxItemPtrMap;
@@ -67,7 +68,7 @@ struct SfxShell_Impl: public SfxBroadcaster
sal_uIntPtr nHelpId;
svtools::AsynchronLink* pExecuter;
svtools::AsynchronLink* pUpdater;
- boost::ptr_vector<SfxSlot> aSlotArr;
+ std::vector<std::unique_ptr<SfxSlot> > aSlotArr;
css::uno::Sequence < css::embed::VerbDescriptor > aVerbList;
::sfx2::sidebar::ContextChangeBroadcaster maContextChangeBroadcaster;
@@ -572,14 +573,14 @@ void SfxShell::SetVerbs(const css::uno::Sequence < css::embed::VerbDescriptor >&
if (!pImp->aSlotArr.empty())
{
- SfxSlot& rSlot = pImp->aSlotArr[0];
+ SfxSlot& rSlot = *pImp->aSlotArr[0].get();
pNewSlot->pNextSlot = rSlot.pNextSlot;
rSlot.pNextSlot = pNewSlot;
}
else
pNewSlot->pNextSlot = pNewSlot;
- pImp->aSlotArr.insert(pImp->aSlotArr.begin() + (sal_uInt16) n, pNewSlot);
+ pImp->aSlotArr.insert(pImp->aSlotArr.begin() + (sal_uInt16) n, std::unique_ptr<SfxSlot>(pNewSlot));
}
pImp->aVerbList = aVerbs;
@@ -640,7 +641,7 @@ const SfxSlot* SfxShell::GetVerbSlot_Impl(sal_uInt16 nId) const
DBG_ASSERT(nIndex < rList.getLength(),"Wrong VerbId!");
if (nIndex < rList.getLength())
- return &pImp->aSlotArr[nIndex];
+ return pImp->aSlotArr[nIndex].get();
else
return nullptr;
}
commit 9149faa165d314694898dcecb25e36acee3bd1fd
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 12:00:24 2015 +0200
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I497702f3cdde1db0712d030756b9850d48d67380
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 39f85b1..fabf45f 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -64,8 +64,8 @@
#include <com/sun/star/frame/XModuleManager.hpp>
#include <memory>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <unordered_map>
+#include <vector>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -100,14 +100,14 @@ struct SfxFoundCache_Impl
class SfxFoundCacheArr_Impl
{
- typedef boost::ptr_vector<SfxFoundCache_Impl> DataType;
+ typedef std::vector<std::unique_ptr<SfxFoundCache_Impl> > DataType;
DataType maData;
public:
SfxFoundCache_Impl& operator[] ( size_t i )
{
- return maData[i];
+ return *maData[i].get();
}
size_t size() const
@@ -117,7 +117,7 @@ public:
void push_back( SfxFoundCache_Impl* p )
{
- maData.push_back(p);
+ maData.push_back(std::unique_ptr<SfxFoundCache_Impl>(p));
}
};
commit 47612d6beb4fb0aa669f73954f67910480c3cc1e
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 11:58:17 2015 +0200
sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Idd5bec160e81deac2b570ee3137a1d5ccdc55975
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 518afe4..3f7df44 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -99,8 +99,10 @@
#include "fltlst.hxx"
#include <sfx2/request.hxx>
#include "arrdecl.hxx"
+#include <o3tl/make_unique.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
#include <functional>
#if defined(DBG_UTIL)
@@ -280,23 +282,10 @@ public:
namespace
{
- typedef boost::ptr_vector<SfxFilterMatcher_Impl> SfxFilterMatcherArr_Impl;
+ typedef std::vector<std::unique_ptr<SfxFilterMatcher_Impl> > SfxFilterMatcherArr_Impl;
static SfxFilterMatcherArr_Impl aImplArr;
static int nSfxFilterMatcherCount;
- class hasName :
- public std::unary_function<SfxFilterMatcher_Impl, bool>
- {
- private:
- const OUString& mrName;
- public:
- explicit hasName(const OUString &rName) : mrName(rName) {}
- bool operator() (const SfxFilterMatcher_Impl& rImpl) const
- {
- return rImpl.aName == mrName;
- }
- };
-
SfxFilterMatcher_Impl & getSfxFilterMatcher_Impl(const OUString &rName)
{
OUString aName;
@@ -306,16 +295,13 @@ namespace
// find the impl-Data of any comparable FilterMatcher that was created
// previously
- SfxFilterMatcherArr_Impl::iterator aEnd = aImplArr.end();
- SfxFilterMatcherArr_Impl::iterator aIter =
- std::find_if(aImplArr.begin(), aEnd, hasName(aName));
- if (aIter != aEnd)
- return *aIter;
+ for (std::unique_ptr<SfxFilterMatcher_Impl>& aImpl : aImplArr)
+ if (aImpl->aName == aName)
+ return *aImpl.get();
// first Matcher created for this factory
- SfxFilterMatcher_Impl *pImpl = new SfxFilterMatcher_Impl(aName);
- aImplArr.push_back(pImpl);
- return *pImpl;
+ aImplArr.push_back(o3tl::make_unique<SfxFilterMatcher_Impl>(aName));
+ return *aImplArr.back().get();
}
}
@@ -1198,7 +1184,7 @@ void SfxFilterContainer::ReadFilters_Impl( bool bUpdate )
// global filter arry was modified, factory specific ones might need an
// update too
for (auto& aImpl : aImplArr)
- aImpl.Update();
+ aImpl->Update();
}
}
commit fe6554d1f49a142fc960ed255e8ed12eb752c6b0
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 11:50:43 2015 +0200
svtools: boost::ptr_vector->std::vector
Change-Id: Iee77fa2a6b8bc5d186157430c4bfeb7d29056129
diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx
index 94d59250..90d65d1 100644
--- a/svtools/inc/pch/precompiled_svt.hxx
+++ b/svtools/inc/pch/precompiled_svt.hxx
@@ -22,7 +22,6 @@
#include <basegfx/range/b2drange.hxx>
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <cassert>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index e0c5522..657a355 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -23,7 +23,7 @@
#include <rtl/textcvt.h>
#include <rtl/tencinfo.h>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
// structure to store the actuel data
struct SvParser_Impl
@@ -650,7 +650,7 @@ IMPL_LINK_NOARG_TYPED( SvParser, NewDataRead, LinkParamNone*, void )
*
*======================================================================*/
-typedef boost::ptr_vector<SvKeyValue> SvKeyValueList_Impl;
+typedef std::vector<SvKeyValue> SvKeyValueList_Impl;
struct SvKeyValueIterator::Impl
{
@@ -689,7 +689,7 @@ bool SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal)
void SvKeyValueIterator::Append (const SvKeyValue &rKeyVal)
{
- mpImpl->maList.push_back(new SvKeyValue(rKeyVal));
+ mpImpl->maList.push_back(rKeyVal);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit aeeef71b9850b77b7de468a9748c441314e3fa6e
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 11 11:48:51 2015 +0200
svtools: boost::ptr_vector->std::vector
Change-Id: If03ab05ff90585285063705bf56527c6138e22fd
diff --git a/include/svtools/fontsubstconfig.hxx b/include/svtools/fontsubstconfig.hxx
index 15493ae..ed2357c 100644
--- a/include/svtools/fontsubstconfig.hxx
+++ b/include/svtools/fontsubstconfig.hxx
@@ -27,8 +27,8 @@ struct SvtFontSubstConfig_Impl;
struct SubstitutionStruct
{
- OUString sFont;
- OUString sReplaceBy;
+ OUString sFont;
+ OUString sReplaceBy;
bool bReplaceAlways;
bool bReplaceOnScreenOnly;
};
diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx
index 347df64..e25836e 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -24,7 +24,7 @@
#include <tools/debug.hxx>
#include <vcl/outdev.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
using namespace utl;
using namespace com::sun::star;
@@ -40,7 +40,7 @@ const sal_Char cSubstituteFont[]= "SubstituteFont";
const sal_Char cOnScreenOnly[] = "OnScreenOnly";
const sal_Char cAlways[] = "Always";
-typedef boost::ptr_vector<SubstitutionStruct> SubstitutionStructArr;
+typedef std::vector<SubstitutionStruct> SubstitutionStructArr;
struct SvtFontSubstConfig_Impl
{
@@ -80,12 +80,12 @@ SvtFontSubstConfig::SvtFontSubstConfig() :
nName = 0;
for(nNode = 0; nNode < aNodeNames.getLength(); nNode++)
{
- SubstitutionStruct* pInsert = new SubstitutionStruct;
- pNodeValues[nName++] >>= pInsert->sFont;
- pNodeValues[nName++] >>= pInsert->sReplaceBy;
- pInsert->bReplaceAlways = *static_cast<sal_Bool const *>(pNodeValues[nName++].getValue());
- pInsert->bReplaceOnScreenOnly = *static_cast<sal_Bool const *>(pNodeValues[nName++].getValue());
- pImpl->aSubstArr.push_back(pInsert);
+ SubstitutionStruct aInsert;
+ pNodeValues[nName++] >>= aInsert.sFont;
+ pNodeValues[nName++] >>= aInsert.sReplaceBy;
+ aInsert.bReplaceAlways = *static_cast<sal_Bool const *>(pNodeValues[nName++].getValue());
+ aInsert.bReplaceOnScreenOnly = *static_cast<sal_Bool const *>(pNodeValues[nName++].getValue());
+ pImpl->aSubstArr.push_back(aInsert);
}
}
@@ -160,7 +160,7 @@ const SubstitutionStruct* SvtFontSubstConfig::GetSubstitution(sal_Int32 nPos)
void SvtFontSubstConfig::AddSubstitution(const SubstitutionStruct& rToAdd)
{
- pImpl->aSubstArr.push_back(new SubstitutionStruct(rToAdd));
+ pImpl->aSubstArr.push_back(rToAdd);
}
void SvtFontSubstConfig::Apply()
More information about the Libreoffice-commits
mailing list