Kaydet (Commit) 9e192c9f authored tarafından Brad Sowden's avatar Brad Sowden Kaydeden (comit) Luboš Luňák

Easyhack fdo#38831 remove SvStrings

üst 81726468
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <xmloff/xmlictxt.hxx> #include <xmloff/xmlictxt.hxx>
#include <xmloff/xmlimp.hxx> #include <xmloff/xmlimp.hxx>
class SvStrings; class vector;
class SwXMLSectionList : public SvXMLImport class SwXMLSectionList : public SvXMLImport
{ {
...@@ -43,11 +43,11 @@ protected: ...@@ -43,11 +43,11 @@ protected:
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList > & xAttrList ); ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
public: public:
SvStrings & rSectionList; std::vector<String*> &rSectionList;
SwXMLSectionList( SwXMLSectionList(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
SvStrings & rNewSectionList ); std::vector<String*> &rNewSectionList );
virtual ~SwXMLSectionList ( ) virtual ~SwXMLSectionList ( )
throw(); throw();
......
...@@ -56,7 +56,6 @@ class SfxItemSet; ...@@ -56,7 +56,6 @@ class SfxItemSet;
class SfxMedium; class SfxMedium;
class SvPtrarr; class SvPtrarr;
class SvStream; class SvStream;
class SvStrings;
class SvxFontItem; class SvxFontItem;
class SvxMacroTableDtor; class SvxMacroTableDtor;
class SwCntntNode; class SwCntntNode;
...@@ -64,6 +63,7 @@ class SwCrsrShell; ...@@ -64,6 +63,7 @@ class SwCrsrShell;
class SwDoc; class SwDoc;
class SwPaM; class SwPaM;
class SwTextBlocks; class SwTextBlocks;
class vector;
struct SwPosition; struct SwPosition;
struct Writer_Impl; struct Writer_Impl;
...@@ -272,8 +272,8 @@ public: ...@@ -272,8 +272,8 @@ public:
// Read the sections of the document, which is equal to the medium. // Read the sections of the document, which is equal to the medium.
// Returns the count of it // Returns the count of it
virtual sal_uInt16 GetSectionList( SfxMedium& rMedium, virtual size_t GetSectionList( SfxMedium& rMedium,
SvStrings& rStrings ) const; std::vector<String*>& rStrings ) const;
SotStorageRef getSotStorageRef() { return pStg; }; SotStorageRef getSotStorageRef() { return pStg; };
void setSotStorageRef(SotStorageRef pStgRef) { pStg = pStgRef; }; void setSotStorageRef(SotStorageRef pStgRef) { pStg = pStgRef; };
......
...@@ -26,12 +26,11 @@ ...@@ -26,12 +26,11 @@
* *
************************************************************************/ ************************************************************************/
#define _SVSTDARR_STRINGSDTOR
#define _SVSTDARR_STRINGS
#include <svl/svstdarr.hxx>
#include <SwXMLSectionList.hxx> #include <SwXMLSectionList.hxx>
#include <xmloff/nmspmap.hxx> #include <xmloff/nmspmap.hxx>
#include <xmloff/xmlnmspe.hxx> #include <xmloff/xmlnmspe.hxx>
#include <tools/string.hxx>
#include <vector>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using ::rtl::OUString; using ::rtl::OUString;
...@@ -43,7 +42,7 @@ sal_Char const sXML_np__text[] = "_otext"; ...@@ -43,7 +42,7 @@ sal_Char const sXML_np__text[] = "_otext";
// #110680# // #110680#
SwXMLSectionList::SwXMLSectionList( SwXMLSectionList::SwXMLSectionList(
const uno::Reference< lang::XMultiServiceFactory > xServiceFactory, const uno::Reference< lang::XMultiServiceFactory > xServiceFactory,
SvStrings & rNewSectionList) std::vector<String*> &rNewSectionList)
: SvXMLImport( xServiceFactory ), : SvXMLImport( xServiceFactory ),
rSectionList ( rNewSectionList ) rSectionList ( rNewSectionList )
{ {
...@@ -121,7 +120,7 @@ SvXMLImportContext *SvXMLSectionListContext::CreateChildContext( ...@@ -121,7 +120,7 @@ SvXMLImportContext *SvXMLSectionListContext::CreateChildContext(
sName = rAttrValue; sName = rAttrValue;
} }
if ( sName.Len() ) if ( sName.Len() )
rLocalRef.rSectionList.Insert ( new String(sName), rLocalRef.rSectionList.Count() ); rLocalRef.rSectionList.push_back( new String(sName) );
} }
pContext = new SvXMLSectionListContext (rLocalRef, nPrefix, rLocalName, xAttrList); pContext = new SvXMLSectionListContext (rLocalRef, nPrefix, rLocalName, xAttrList);
......
...@@ -682,7 +682,7 @@ void Reader::ResetFrmFmts( SwDoc& rDoc ) ...@@ -682,7 +682,7 @@ void Reader::ResetFrmFmts( SwDoc& rDoc )
// read the sections of the document, which is equal to the medium. // read the sections of the document, which is equal to the medium.
// returns the count of it // returns the count of it
sal_uInt16 Reader::GetSectionList( SfxMedium&, SvStrings& ) const size_t Reader::GetSectionList( SfxMedium&, std::vector<String*>& ) const
{ {
return 0; return 0;
} }
......
...@@ -64,8 +64,8 @@ public: ...@@ -64,8 +64,8 @@ public:
// read the sections of the document, which is equal to the medium. // read the sections of the document, which is equal to the medium.
// returns the count of it // returns the count of it
virtual sal_uInt16 GetSectionList( SfxMedium& rMedium, virtual size_t GetSectionList( SfxMedium& rMedium,
SvStrings& rStrings ) const; std::vector<String*>& rStrings ) const;
}; };
// die speziellen Writer // die speziellen Writer
......
...@@ -27,10 +27,6 @@ ...@@ -27,10 +27,6 @@
************************************************************************/ ************************************************************************/
#define _SVSTDARR_STRINGS
#include <rsc/rscsfx.hxx> #include <rsc/rscsfx.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/embed/XStorage.hpp>
...@@ -51,7 +47,6 @@ ...@@ -51,7 +47,6 @@
#include <com/sun/star/packages/zip/ZipIOException.hpp> #include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/packages/WrongPasswordException.hpp> #include <com/sun/star/packages/WrongPasswordException.hpp>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp> #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <svl/svstdarr.hxx>
#include <sfx2/docfile.hxx> #include <sfx2/docfile.hxx>
#include <svtools/sfxecode.hxx> #include <svtools/sfxecode.hxx>
#include <svl/stritem.hxx> #include <svl/stritem.hxx>
...@@ -1067,8 +1062,8 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con ...@@ -1067,8 +1062,8 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
// read the sections of the document, which is equal to the medium. // read the sections of the document, which is equal to the medium.
// returns the count of it // returns the count of it
sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium, size_t XMLReader::GetSectionList( SfxMedium& rMedium,
SvStrings& rStrings ) const std::vector<String*>& rStrings ) const
{ {
uno::Reference< lang::XMultiServiceFactory > xServiceFactory = uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory(); comphelper::getProcessServiceFactory();
...@@ -1095,7 +1090,6 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium, ...@@ -1095,7 +1090,6 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium,
if( xXMLParser.is() ) if( xXMLParser.is() )
{ {
// get filter // get filter
// uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( rStrings );
uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( xServiceFactory, rStrings ); uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( xServiceFactory, rStrings );
// connect parser and filter // connect parser and filter
...@@ -1123,7 +1117,7 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium, ...@@ -1123,7 +1117,7 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium,
// re throw ? // re throw ?
} }
} }
return rStrings.Count(); return rStrings.size();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -1494,16 +1494,16 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ) ...@@ -1494,16 +1494,16 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox )
uno::Reference < embed::XStorage > xStg; uno::Reference < embed::XStorage > xStg;
if( rMedium.IsStorage() && (xStg = rMedium.GetStorage()).is() ) if( rMedium.IsStorage() && (xStg = rMedium.GetStorage()).is() )
{ {
SvStrings aArr( 10, 10 ); std::vector<String*> aArr;
sal_uInt32 nFormat = SotStorage::GetFormatID( xStg ); sal_uInt32 nFormat = SotStorage::GetFormatID( xStg );
if ( nFormat == SOT_FORMATSTR_ID_STARWRITER_60 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_60 || if ( nFormat == SOT_FORMATSTR_ID_STARWRITER_60 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_60 ||
nFormat == SOT_FORMATSTR_ID_STARWRITER_8 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_8) nFormat == SOT_FORMATSTR_ID_STARWRITER_8 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_8)
SwGetReaderXML()->GetSectionList( rMedium, aArr ); SwGetReaderXML()->GetSectionList( rMedium, aArr );
for( sal_uInt16 n = 0; n < aArr.Count(); ++n ) for(std::vector<String*>::const_iterator it(aArr.begin()); it != aArr.end(); ++it) {
rBox.InsertEntry( *aArr[ n ] ); rBox.InsertEntry( **it );
delete *it;
aArr.DeleteAndDestroy(0, aArr.Count()); }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment