diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlmultiimagehelper.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx b/xmloff/source/core/xmlmultiimagehelper.cxx index b0607a2fddd1..9a6711fb339d 100644 --- a/xmloff/source/core/xmlmultiimagehelper.cxx +++ b/xmloff/source/core/xmlmultiimagehelper.cxx @@ -76,11 +76,6 @@ MultiImageImportHelper::MultiImageImportHelper() MultiImageImportHelper::~MultiImageImportHelper() { - while(!maImplContextVector.empty()) - { - delete *(maImplContextVector.end() - 1); - maImplContextVector.pop_back(); - } } SvXMLImportContextRef MultiImageImportHelper::solveMultipleImages() @@ -95,7 +90,7 @@ SvXMLImportContextRef MultiImageImportHelper::solveMultipleImages() for(a = 0; a < maImplContextVector.size(); a++) { - const OUString aStreamURL(getGraphicURLFromImportContext(**maImplContextVector[a])); + const OUString aStreamURL(getGraphicURLFromImportContext(*maImplContextVector[a])); const sal_uInt32 nNewQuality(getQualityIndex(aStreamURL)); if(nNewQuality > nBestQuality) @@ -112,15 +107,14 @@ SvXMLImportContextRef MultiImageImportHelper::solveMultipleImages() } // Take out the most valuable one - const std::vector< SvXMLImportContextRef* >::iterator aRemove(maImplContextVector.begin() + nIndexOfPreferred); - pContext = **aRemove; - delete *aRemove; + const std::vector< SvXMLImportContextRef >::iterator aRemove(maImplContextVector.begin() + nIndexOfPreferred); + pContext = *aRemove; maImplContextVector.erase(aRemove); // remove the rest from parent for(a = 0; a < maImplContextVector.size(); a++) { - SvXMLImportContext& rCandidate = **maImplContextVector[a]; + SvXMLImportContext& rCandidate = *maImplContextVector[a]; if(pContext) { @@ -134,7 +128,7 @@ SvXMLImportContextRef MultiImageImportHelper::solveMultipleImages() } else if (maImplContextVector.size() == 1) { - pContext = *maImplContextVector.front(); + pContext = maImplContextVector.front(); } return pContext; @@ -144,7 +138,7 @@ void MultiImageImportHelper::addContent(const SvXMLImportContext& rSvXMLImportCo { if(dynamic_cast< const SvXMLImportContext* >(&rSvXMLImportContext)) { - maImplContextVector.push_back(new SvXMLImportContextRef(const_cast< SvXMLImportContext* >(&rSvXMLImportContext))); + maImplContextVector.push_back(SvXMLImportContextRef(const_cast< SvXMLImportContext* >(&rSvXMLImportContext))); } } |