[Libreoffice-commits] .: sc/source svl/inc svl/source sw/source unusedcode.easy
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Nov 9 08:57:13 PST 2011
sc/source/filter/html/htmlexp.cxx | 35 +++++++++++-----------------------
sc/source/filter/inc/htmlexp.hxx | 5 +---
svl/inc/svl/svstdarr.hxx | 5 ----
svl/source/memtools/svarray.cxx | 1
sw/source/filter/writer/writer.cxx | 38 ++++++++++++++-----------------------
unusedcode.easy | 5 ----
6 files changed, 29 insertions(+), 60 deletions(-)
New commits:
commit ff9fab243bb8f746077dbbc2d7d3a76616647839
Author: Daisuke Nishino <niboshi000 at gmail.com>
Date: Wed Nov 9 22:16:38 2011 +0900
Removed SvStringsSortDtor
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 8510edf..25f967b 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -243,8 +243,6 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const String& rBaseURL, ScDocument
aBaseURL( rBaseURL ),
aStreamPath( rStreamPathP ),
pAppWin( Application::GetDefaultDevice() ),
- pSrcArr( NULL ),
- pDestArr( NULL ),
nUsedTables( 0 ),
nIndent( 0 ),
bAll( bAllP ),
@@ -294,8 +292,6 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const String& rBaseURL, ScDocument
ScHTMLExport::~ScHTMLExport()
{
aGraphList.clear();
- delete pSrcArr;
- delete pDestArr;
}
@@ -1313,31 +1309,30 @@ sal_Bool ScHTMLExport::CopyLocalFileToINet( String& rFileNm,
INET_PROT_FTP <= aTargetUrl.GetProtocol() &&
INET_PROT_NEWS >= aTargetUrl.GetProtocol()) ) )
{
- if( pSrcArr )
+ if( pFileNameMap )
{
// wurde die Datei schon verschoben
- sal_uInt16 nPos;
- if( pSrcArr->Seek_Entry( &rFileNm, &nPos ))
+ std::map<String, String>::iterator it = pFileNameMap->find( rFileNm );
+ if( it != pFileNameMap->end() )
{
- rFileNm = *(*pDestArr)[ nPos ];
+ rFileNm = it->second;
return sal_True;
}
}
else
{
- pSrcArr = new SvStringsSortDtor( 4, 4 );
- pDestArr = new SvStringsSortDtor( 4, 4 );
+ pFileNameMap.reset( new std::map<String, String>() );
}
- String* pSrc = new String( rFileNm );
SvFileStream aTmp( aFileUrl.PathToFileName(), STREAM_READ );
- String* pDest = new String( aTargetUrl.GetPartBeforeLastName() );
- *pDest += String(aFileUrl.GetName());
+ String aSrc = rFileNm;
+ String aDest = aTargetUrl.GetPartBeforeLastName();
+ aDest += String(aFileUrl.GetName());
if( bFileToFile )
{
- INetURLObject aCpyURL( *pDest );
+ INetURLObject aCpyURL( aDest );
SvFileStream aCpy( aCpyURL.PathToFileName(), STREAM_WRITE );
aCpy << aTmp;
@@ -1346,7 +1341,7 @@ sal_Bool ScHTMLExport::CopyLocalFileToINet( String& rFileNm,
}
else
{
- SfxMedium aMedium( *pDest, STREAM_WRITE | STREAM_SHARE_DENYNONE,
+ SfxMedium aMedium( aDest, STREAM_WRITE | STREAM_SHARE_DENYNONE,
false );
{
@@ -1363,14 +1358,8 @@ sal_Bool ScHTMLExport::CopyLocalFileToINet( String& rFileNm,
if( bRet )
{
- pSrcArr->Insert( pSrc );
- pDestArr->Insert( pDest );
- rFileNm = *pDest;
- }
- else
- {
- delete pSrc;
- delete pDest;
+ pFileNameMap->insert( std::make_pair( aSrc, aDest ) );
+ rFileNm = aDest;
}
}
diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx
index 286997e..ecf90b4 100644
--- a/sc/source/filter/inc/htmlexp.hxx
+++ b/sc/source/filter/inc/htmlexp.hxx
@@ -34,6 +34,7 @@
#include <tools/gen.hxx>
#include <tools/color.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/scoped_ptr.hpp>
#include "expbase.hxx"
@@ -45,7 +46,6 @@ class Graphic;
class SdrObject;
class OutputDevice;
class ScDrawLayer;
-class SvStringsSortDtor;
class ScEditCell;
namespace editeng { class SvxBorderLine; }
@@ -109,8 +109,7 @@ class ScHTMLExport : public ScExportBase
String aStreamPath;
String aCId; // Content-Id fuer Mail-Export
OutputDevice* pAppWin; // fuer Pixelei
- SvStringsSortDtor* pSrcArr; // fuer CopyLocalFileToINet
- SvStringsSortDtor* pDestArr;
+ boost::scoped_ptr< std::map<String, String> > pFileNameMap; // fuer CopyLocalFileToINet
String aNonConvertibleChars; // collect nonconvertible characters
rtl_TextEncoding eDestEnc;
SCTAB nUsedTables;
diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index 3d3cc80..79c95c1 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -57,11 +57,6 @@ SV_DECL_PTRARR_DEL_VISIBILITY( SvStringsDtor, StringPtr, 1, 1, SVL_DLLPUBLIC )
#define _SVSTDARR_STRINGSDTOR_DECL
#endif
-#ifndef _SVSTDARR_STRINGSSORTDTOR_DECL
-SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsSortDtor, StringPtr, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_STRINGSSORTDTOR_DECL
-#endif
-
#ifndef _SVSTDARR_STRINGSISORT_DECL
SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsISort, StringPtr, 1, 1, SVL_DLLPUBLIC )
#define _SVSTDARR_STRINGSISORT_DECL
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index d1aeda7..3b4fa71 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -63,7 +63,6 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const
SV_IMPL_PTRARR( SvStrings, StringPtr )
SV_IMPL_PTRARR( SvStringsDtor, StringPtr )
-SV_IMPL_OP_PTRARR_SORT( SvStringsSortDtor, StringPtr )
// ---------------- strings -------------------------------------
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index bbda865..c4a3426 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -47,6 +47,7 @@
#include <numrule.hxx>
#include <swerror.h>
#include <boost/bind.hpp>
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -61,7 +62,7 @@ struct Writer_Impl
{
SvStream * m_pStream;
- SvStringsSortDtor *pSrcArr, *pDestArr;
+ boost::scoped_ptr< std::map<String, String> > pFileNameMap;
SvPtrarr* pFontRemoveLst, *pBkmkArr;
SwBookmarkNodeTable* pBkmkNodePos;
@@ -74,15 +75,13 @@ struct Writer_Impl
Writer_Impl::Writer_Impl()
: m_pStream(0)
- , pSrcArr( 0 ), pDestArr( 0 ), pFontRemoveLst( 0 )
+ , pFontRemoveLst( 0 )
, pBkmkArr( 0 ), pBkmkNodePos( 0 )
{
}
Writer_Impl::~Writer_Impl()
{
- delete pSrcArr;
- delete pDestArr;
delete pFontRemoveLst;
if( pBkmkNodePos )
@@ -357,28 +356,27 @@ sal_Bool Writer::CopyLocalFileToINet( String& rFileNm )
INET_PROT_NEWS >= aTargetUrl.GetProtocol() ) )
return bRet;
- if (m_pImpl->pSrcArr)
+ if (m_pImpl->pFileNameMap)
{
// wurde die Datei schon verschoben
- sal_uInt16 nPos;
- if (m_pImpl->pSrcArr->Seek_Entry( &rFileNm, &nPos ))
+ std::map<String, String>::iterator it = m_pImpl->pFileNameMap->find( rFileNm );
+ if ( it != m_pImpl->pFileNameMap->end() )
{
- rFileNm = *(*m_pImpl->pDestArr)[ nPos ];
+ rFileNm = it->second;
return sal_True;
}
}
else
{
- m_pImpl->pSrcArr = new SvStringsSortDtor( 4, 4 );
- m_pImpl->pDestArr = new SvStringsSortDtor( 4, 4 );
+ m_pImpl->pFileNameMap.reset( new std::map<String, String>() );
}
- String *pSrc = new String( rFileNm );
- String *pDest = new String( aTargetUrl.GetPartBeforeLastName() );
- *pDest += String(aFileUrl.GetName());
+ String aSrc = rFileNm;
+ String aDest = aTargetUrl.GetPartBeforeLastName();
+ aDest += String(aFileUrl.GetName());
- SfxMedium aSrcFile( *pSrc, STREAM_READ, sal_False );
- SfxMedium aDstFile( *pDest, STREAM_WRITE | STREAM_SHARE_DENYNONE, sal_False );
+ SfxMedium aSrcFile( aSrc, STREAM_READ, sal_False );
+ SfxMedium aDstFile( aDest, STREAM_WRITE | STREAM_SHARE_DENYNONE, sal_False );
*aDstFile.GetOutStream() << *aSrcFile.GetInStream();
@@ -389,14 +387,8 @@ sal_Bool Writer::CopyLocalFileToINet( String& rFileNm )
if( bRet )
{
- m_pImpl->pSrcArr->Insert( pSrc );
- m_pImpl->pDestArr->Insert( pDest );
- rFileNm = *pDest;
- }
- else
- {
- delete pSrc;
- delete pDest;
+ m_pImpl->pFileNameMap->insert( std::make_pair( aSrc, aDest ) );
+ rFileNm = aDest;
}
return bRet;
diff --git a/unusedcode.easy b/unusedcode.easy
index e3e59cb..afee20e 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -731,11 +731,6 @@ SvStringsISort::Insert(SvStringsISort const*, unsigned short, unsigned short)
SvStringsISort::Remove(String* const&, unsigned short)
SvStringsISort::Remove(unsigned short, unsigned short)
SvStringsISortDtor::Insert(String* const*, unsigned short)
-SvStringsSortDtor::Insert(String* const&, unsigned short&)
-SvStringsSortDtor::Insert(String* const*, unsigned short)
-SvStringsSortDtor::Insert(SvStringsSortDtor const*, unsigned short, unsigned short)
-SvStringsSortDtor::Remove(String* const&, unsigned short)
-SvStringsSortDtor::Remove(unsigned short, unsigned short)
SvTabListBox::GetTabJustify(unsigned short) const
SvUnoAttributeContainer::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>)
SvXMLAutoStylePoolNamesP_Impl::GetPos(rtl::OUString const*) const
More information about the Libreoffice-commits
mailing list