diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-12 14:01:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-13 10:54:18 +0200 |
commit | 9265f9bd35ff6ef0e4ab285dd9fecebce6976e8d (patch) | |
tree | c4771a0e87563954360a389d87cca96402312ae1 /sc/source | |
parent | 83a58be116762abeab4ec3a90b8aafa076484b4a (diff) |
sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I4c1d48b93ebb50aead0ee263a13e42e66eb714da
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 11 | ||||
-rw-r--r-- | sc/source/filter/inc/eeparser.hxx | 16 | ||||
-rw-r--r-- | sc/source/filter/rtf/eeimpars.cxx | 4 |
3 files changed, 16 insertions, 15 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index c5dad934a2eb..a59c4e3a9444 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -66,6 +66,7 @@ #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <utility> +#include <o3tl/make_unique.hxx> using ::editeng::SvxBorderLine; using namespace ::com::sun::star; @@ -1331,8 +1332,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) { - ScHTMLImage* pImage = new ScHTMLImage; - pActEntry->maImageList.push_back( pImage ); + pActEntry->maImageList.push_back( o3tl::make_unique<ScHTMLImage>() ); + ScHTMLImage* pImage = pActEntry->maImageList.back().get(); const HTMLOptions& rOptions = static_cast<HTMLParser*>(pInfo->pParser)->GetOptions(); for (size_t i = 0, n = rOptions.size(); i < n; ++i) { @@ -1410,7 +1411,7 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) long nWidth = 0; for ( size_t i=0; i < pActEntry->maImageList.size(); ++i ) { - ScHTMLImage* pI = &pActEntry->maImageList[ i ]; + ScHTMLImage* pI = pActEntry->maImageList[ i ].get(); if ( pI->nDir & nHorizontal ) nWidth += pI->aSize.Width() + 2 * pI->aSpace.X(); else @@ -1419,7 +1420,7 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) if ( pActEntry->nWidth && (nWidth + pImage->aSize.Width() + 2 * pImage->aSpace.X() >= pActEntry->nWidth) ) - pActEntry->maImageList.back().nDir = nVertical; + pActEntry->maImageList.back()->nDir = nVertical; } } @@ -1628,7 +1629,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) case HTML_PARABREAK_OFF: { // We continue vertically after an image if ( pActEntry->maImageList.size() > 0 ) - pActEntry->maImageList.back().nDir = nVertical; + pActEntry->maImageList.back()->nDir = nVertical; } break; case HTML_ANCHOR_ON: diff --git a/sc/source/filter/inc/eeparser.hxx b/sc/source/filter/inc/eeparser.hxx index ec2b45b6fce2..ba25d617669a 100644 --- a/sc/source/filter/inc/eeparser.hxx +++ b/sc/source/filter/inc/eeparser.hxx @@ -25,7 +25,7 @@ #include <svl/itemset.hxx> #include <editeng/editdata.hxx> #include <address.hxx> -#include <boost/ptr_container/ptr_vector.hpp> +#include <memory> #include <vector> const sal_Char nHorizontal = 1; @@ -34,10 +34,10 @@ const sal_Char nHoriVerti = nHorizontal | nVertical; struct ScHTMLImage { - OUString aURL; + OUString aURL; Size aSize; Point aSpace; - OUString aFilterName; + OUString aFilterName; Graphic* pGraphic; // wird von WriteToDocument uebernommen sal_Char nDir; // 1==hori, 2==verti, 3==beides @@ -53,11 +53,11 @@ struct ScEEParseEntry { SfxItemSet aItemSet; ESelection aSel; // Selection in EditEngine - OUString* pValStr; // HTML evtl. SDVAL String - OUString* pNumStr; // HTML evtl. SDNUM String - OUString* pName; // HTML evtl. Anchor/RangeName - OUString aAltText; // HTML IMG ALT Text - boost::ptr_vector< ScHTMLImage > maImageList; // Grafiken in dieser Zelle + OUString* pValStr; // HTML evtl. SDVAL String + OUString* pNumStr; // HTML evtl. SDNUM String + OUString* pName; // HTML evtl. Anchor/RangeName + OUString aAltText; // HTML IMG ALT Text + std::vector< std::unique_ptr<ScHTMLImage> > maImageList; // Grafiken in dieser Zelle SCCOL nCol; // relativ zum Beginn des Parse SCROW nRow; sal_uInt16 nTab; // HTML TableInTable diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 2b91ff2ad5ac..e31c215b230e 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -478,7 +478,7 @@ bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/, ScEEParseE sal_Char nDir = nHorizontal; for ( size_t i = 0; i < pE->maImageList.size() ; ++i ) { - ScHTMLImage* pI = &pE->maImageList[ i ]; + ScHTMLImage* pI = pE->maImageList[ i ].get(); if ( pI->pGraphic ) bHasGraphics = true; Size aSizePix = pI->aSize; @@ -554,7 +554,7 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Char nDir = nHorizontal; for ( size_t i = 0; i < pE->maImageList.size(); ++i ) { - ScHTMLImage* pI = &pE->maImageList[ i ]; + ScHTMLImage* pI = pE->maImageList[ i ].get(); if ( nDir & nHorizontal ) { // Horizontal aInsertPos.X() += aLogicSize.Width(); |