summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDaisuke Nishino <niboshi000@gmail.com>2011-11-08 03:05:41 +0900
committerCaolán McNamara <caolanm@redhat.com>2011-11-08 15:00:03 +0000
commite494bd26e5415dd0926bcef7c51ab99a4322730f (patch)
tree0978a9e61ab0595ca0964a089349d8bd7ba2d841 /xmloff
parenta8bdbeb1a819c0296940b4dd882890be16ec4cba (diff)
Removed some SvStringsSortDtor
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/styleexp.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 4c6375004063..76bbc16e7e97 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -53,6 +53,8 @@
#include <xmloff/styleexp.hxx>
#include <xmloff/xmlexp.hxx>
#include <xmloff/XMLEventExport.hxx>
+#include <set>
+#include <boost/scoped_ptr.hpp>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -409,7 +411,7 @@ void XMLStyleExport::exportStyleFamily(
// If next styles are supported and used styles should be exported only,
// the next style may be unused but has to be exported, too. In this case
// the names of all exported styles are remembered.
- SvStringsSortDtor *pExportedStyles = 0;
+ boost::scoped_ptr<std::set<String> > pExportedStyles(0);
sal_Bool bFirstStyle = sal_True;
const uno::Sequence< ::rtl::OUString> aSeq = xStyles->getElementNames();
@@ -447,16 +449,14 @@ void XMLStyleExport::exportStyleFamily(
xPropSet->getPropertySetInfo();
if( xPropSetInfo->hasPropertyByName( sFollowStyle ) )
- pExportedStyles = new SvStringsSortDtor;
+ pExportedStyles.reset(new std::set<String>());
bFirstStyle = sal_False;
}
if( pExportedStyles && bExported )
{
// If next styles are supported, remember this style's name.
- String *pTmp = new String( xStyle->getName() );
- if( !pExportedStyles->Insert( pTmp ) )
- delete pTmp;
+ pExportedStyles->insert( xStyle->getName() );
}
}
@@ -507,19 +507,17 @@ void XMLStyleExport::exportStyleFamily(
// if the next style hasn't been exported by now, export it now
// and remember its name.
if( xStyle->getName() != sNextName &&
- !pExportedStyles->Seek_Entry( &sTmp ) )
+ 0 == pExportedStyles->count( sTmp ) )
{
xStyleCont->getByName( sNextName ) >>= xStyle;
DBG_ASSERT( xStyle.is(), "Style not found for export!" );
if( xStyle.is() && exportStyle( xStyle, rXMLFamily, rPropMapper, xStyles,pPrefix ) )
- pExportedStyles->Insert( new String( sTmp ) );
+ pExportedStyles->insert( sTmp );
}
}
}
}
-
- delete pExportedStyles;
}