Easyhack fdo#38831 remove SvStrings
This commit is contained in:
parent
8172646815
commit
9e192c9fd1
7 changed files with 21 additions and 28 deletions
|
@ -31,7 +31,7 @@
|
|||
#include <xmloff/xmlictxt.hxx>
|
||||
#include <xmloff/xmlimp.hxx>
|
||||
|
||||
class SvStrings;
|
||||
class vector;
|
||||
|
||||
class SwXMLSectionList : public SvXMLImport
|
||||
{
|
||||
|
@ -43,11 +43,11 @@ protected:
|
|||
const ::com::sun::star::uno::Reference<
|
||||
::com::sun::star::xml::sax::XAttributeList > & xAttrList );
|
||||
public:
|
||||
SvStrings & rSectionList;
|
||||
std::vector<String*> &rSectionList;
|
||||
|
||||
SwXMLSectionList(
|
||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
|
||||
SvStrings & rNewSectionList );
|
||||
std::vector<String*> &rNewSectionList );
|
||||
|
||||
virtual ~SwXMLSectionList ( )
|
||||
throw();
|
||||
|
|
|
@ -56,7 +56,6 @@ class SfxItemSet;
|
|||
class SfxMedium;
|
||||
class SvPtrarr;
|
||||
class SvStream;
|
||||
class SvStrings;
|
||||
class SvxFontItem;
|
||||
class SvxMacroTableDtor;
|
||||
class SwCntntNode;
|
||||
|
@ -64,6 +63,7 @@ class SwCrsrShell;
|
|||
class SwDoc;
|
||||
class SwPaM;
|
||||
class SwTextBlocks;
|
||||
class vector;
|
||||
struct SwPosition;
|
||||
struct Writer_Impl;
|
||||
|
||||
|
@ -272,8 +272,8 @@ public:
|
|||
|
||||
// Read the sections of the document, which is equal to the medium.
|
||||
// Returns the count of it
|
||||
virtual sal_uInt16 GetSectionList( SfxMedium& rMedium,
|
||||
SvStrings& rStrings ) const;
|
||||
virtual size_t GetSectionList( SfxMedium& rMedium,
|
||||
std::vector<String*>& rStrings ) const;
|
||||
|
||||
SotStorageRef getSotStorageRef() { return pStg; };
|
||||
void setSotStorageRef(SotStorageRef pStgRef) { pStg = pStgRef; };
|
||||
|
|
|
@ -26,12 +26,11 @@
|
|||
*
|
||||
************************************************************************/
|
||||
|
||||
#define _SVSTDARR_STRINGSDTOR
|
||||
#define _SVSTDARR_STRINGS
|
||||
#include <svl/svstdarr.hxx>
|
||||
#include <SwXMLSectionList.hxx>
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
#include <xmloff/xmlnmspe.hxx>
|
||||
#include <tools/string.hxx>
|
||||
#include <vector>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
using ::rtl::OUString;
|
||||
|
@ -43,7 +42,7 @@ sal_Char const sXML_np__text[] = "_otext";
|
|||
// #110680#
|
||||
SwXMLSectionList::SwXMLSectionList(
|
||||
const uno::Reference< lang::XMultiServiceFactory > xServiceFactory,
|
||||
SvStrings & rNewSectionList)
|
||||
std::vector<String*> &rNewSectionList)
|
||||
: SvXMLImport( xServiceFactory ),
|
||||
rSectionList ( rNewSectionList )
|
||||
{
|
||||
|
@ -121,7 +120,7 @@ SvXMLImportContext *SvXMLSectionListContext::CreateChildContext(
|
|||
sName = rAttrValue;
|
||||
}
|
||||
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);
|
||||
|
|
|
@ -682,7 +682,7 @@ void Reader::ResetFrmFmts( SwDoc& rDoc )
|
|||
|
||||
// read the sections of the document, which is equal to the medium.
|
||||
// returns the count of it
|
||||
sal_uInt16 Reader::GetSectionList( SfxMedium&, SvStrings& ) const
|
||||
size_t Reader::GetSectionList( SfxMedium&, std::vector<String*>& ) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -64,8 +64,8 @@ public:
|
|||
|
||||
// read the sections of the document, which is equal to the medium.
|
||||
// returns the count of it
|
||||
virtual sal_uInt16 GetSectionList( SfxMedium& rMedium,
|
||||
SvStrings& rStrings ) const;
|
||||
virtual size_t GetSectionList( SfxMedium& rMedium,
|
||||
std::vector<String*>& rStrings ) const;
|
||||
};
|
||||
|
||||
// die speziellen Writer
|
||||
|
|
|
@ -27,10 +27,6 @@
|
|||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define _SVSTDARR_STRINGS
|
||||
#include <rsc/rscsfx.hxx>
|
||||
#include <tools/urlobj.hxx>
|
||||
#include <com/sun/star/embed/XStorage.hpp>
|
||||
|
@ -51,7 +47,6 @@
|
|||
#include <com/sun/star/packages/zip/ZipIOException.hpp>
|
||||
#include <com/sun/star/packages/WrongPasswordException.hpp>
|
||||
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
|
||||
#include <svl/svstdarr.hxx>
|
||||
#include <sfx2/docfile.hxx>
|
||||
#include <svtools/sfxecode.hxx>
|
||||
#include <svl/stritem.hxx>
|
||||
|
@ -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.
|
||||
// returns the count of it
|
||||
sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium,
|
||||
SvStrings& rStrings ) const
|
||||
size_t XMLReader::GetSectionList( SfxMedium& rMedium,
|
||||
std::vector<String*>& rStrings ) const
|
||||
{
|
||||
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
|
||||
comphelper::getProcessServiceFactory();
|
||||
|
@ -1095,7 +1090,6 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium,
|
|||
if( xXMLParser.is() )
|
||||
{
|
||||
// get filter
|
||||
// uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( rStrings );
|
||||
uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( xServiceFactory, rStrings );
|
||||
|
||||
// connect parser and filter
|
||||
|
@ -1123,7 +1117,7 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium,
|
|||
// re throw ?
|
||||
}
|
||||
}
|
||||
return rStrings.Count();
|
||||
return rStrings.size();
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
|
@ -1494,16 +1494,16 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox )
|
|||
uno::Reference < embed::XStorage > xStg;
|
||||
if( rMedium.IsStorage() && (xStg = rMedium.GetStorage()).is() )
|
||||
{
|
||||
SvStrings aArr( 10, 10 );
|
||||
std::vector<String*> aArr;
|
||||
sal_uInt32 nFormat = SotStorage::GetFormatID( xStg );
|
||||
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)
|
||||
SwGetReaderXML()->GetSectionList( rMedium, aArr );
|
||||
|
||||
for( sal_uInt16 n = 0; n < aArr.Count(); ++n )
|
||||
rBox.InsertEntry( *aArr[ n ] );
|
||||
|
||||
aArr.DeleteAndDestroy(0, aArr.Count());
|
||||
for(std::vector<String*>::const_iterator it(aArr.begin()); it != aArr.end(); ++it) {
|
||||
rBox.InsertEntry( **it );
|
||||
delete *it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue