summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-11-29 23:24:35 +0100
committerMichael Stahl <mstahl@redhat.com>2017-11-30 22:32:46 +0100
commitdfe635d4f523224b7a6991b524dc2635311a5956 (patch)
treeb27b77e3d8084e07636a20e74ef82f8756b7a6df /sw
parent2c081e66cd63df812c2d248c7d2b5bb384b21156 (diff)
sw: std::vector<OUString*> considered silly
Change-Id: Ie5141a01b1a63c083d5fce1842a35a9a4b0d36e3
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/SwXMLSectionList.hxx5
-rw-r--r--sw/inc/shellio.hxx2
-rw-r--r--sw/source/core/swg/SwXMLSectionList.cxx8
-rw-r--r--sw/source/filter/basflt/shellio.cxx2
-rw-r--r--sw/source/filter/inc/fltini.hxx2
-rw-r--r--sw/source/filter/xml/swxml.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx10
7 files changed, 16 insertions, 15 deletions
diff --git a/sw/inc/SwXMLSectionList.hxx b/sw/inc/SwXMLSectionList.hxx
index f157f17fa76f..45fd8bc8c2c7 100644
--- a/sw/inc/SwXMLSectionList.hxx
+++ b/sw/inc/SwXMLSectionList.hxx
@@ -29,12 +29,13 @@ protected:
virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override;
+
public:
- std::vector<OUString*> &rSectionList;
+ std::vector<OUString> & m_rSectionList;
SwXMLSectionList(
const css::uno::Reference< css::uno::XComponentContext >& rContext,
- std::vector<OUString*> &rNewSectionList );
+ std::vector<OUString> & rNewSectionList);
virtual ~SwXMLSectionList ( )
throw() override;
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 2b2be71c06b5..3509685638f7 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -251,7 +251,7 @@ public:
// Read the sections of the document, which is equal to the medium.
// Returns the count of it
virtual size_t GetSectionList( SfxMedium& rMedium,
- std::vector<OUString*>& rStrings ) const;
+ std::vector<OUString>& rStrings) const;
const tools::SvRef<SotStorage>& getSotStorageRef() { return pStg; };
void setSotStorageRef(const tools::SvRef<SotStorage>& pStgRef) { pStg = pStgRef; };
diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx
index a0f484098201..2e90f05a518a 100644
--- a/sw/source/core/swg/SwXMLSectionList.cxx
+++ b/sw/source/core/swg/SwXMLSectionList.cxx
@@ -84,9 +84,9 @@ public:
SwXMLSectionList::SwXMLSectionList(
const uno::Reference< uno::XComponentContext >& rContext,
- std::vector<OUString*> &rNewSectionList)
-: SvXMLImport( rContext, "" ),
- rSectionList ( rNewSectionList )
+ std::vector<OUString> &rNewSectionList)
+: SvXMLImport(rContext, "")
+, m_rSectionList(rNewSectionList)
{
// TODO: verify if these should match the same-name constants
// in xmloff/source/core/xmlimp.cxx ("_office" and "_office")
@@ -143,7 +143,7 @@ SvXMLImportContextRef SvXMLSectionListContext::CreateChildContext(
sName = xAttrList->getValueByIndex( i );
}
if ( !sName.isEmpty() )
- m_rImport.rSectionList.push_back( new OUString(sName) );
+ m_rImport.m_rSectionList.push_back(sName);
}
pContext = new SvXMLSectionListContext(m_rImport, nPrefix, rLocalName, xAttrList);
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 8b66489885dd..037c12b4a993 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -632,7 +632,7 @@ void Reader::ResetFrameFormats( SwDoc& rDoc )
// read the sections of the document, which is equal to the medium.
// returns the count of it
-size_t Reader::GetSectionList( SfxMedium&, std::vector<OUString*>& ) const
+size_t Reader::GetSectionList(SfxMedium&, std::vector<OUString>&) const
{
return 0;
}
diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx
index 4dd40872e77a..2a6b55fc0724 100644
--- a/sw/source/filter/inc/fltini.hxx
+++ b/sw/source/filter/inc/fltini.hxx
@@ -50,7 +50,7 @@ public:
// read the sections of the document, which is equal to the medium.
// returns the count of it
virtual size_t GetSectionList( SfxMedium& rMedium,
- std::vector<OUString*>& rStrings ) const override;
+ std::vector<OUString>& rStrings) const override;
};
// the special writers
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 652e84ef5ab8..7387986bb892 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -957,7 +957,7 @@ ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, con
// read the sections of the document, which is equal to the medium.
// returns the count of it
size_t XMLReader::GetSectionList( SfxMedium& rMedium,
- std::vector<OUString*>& rStrings ) const
+ std::vector<OUString>& rStrings) const
{
uno::Reference< uno::XComponentContext > xContext =
comphelper::getProcessComponentContext();
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 78bf7c681bd5..404b2a0f59bc 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1379,22 +1379,22 @@ IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent&, rEvent, void )
}
}
-// helper function - read region names from medium
+// helper function - read section names from medium
static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox )
{
rBox.Clear();
uno::Reference < embed::XStorage > xStg;
if( rMedium.IsStorage() && (xStg = rMedium.GetStorage()).is() )
{
- std::vector<OUString*> aArr;
+ std::vector<OUString> aArr;
SotClipboardFormatId nFormat = SotStorage::GetFormatID( xStg );
if ( nFormat == SotClipboardFormatId::STARWRITER_60 || nFormat == SotClipboardFormatId::STARWRITERGLOB_60 ||
nFormat == SotClipboardFormatId::STARWRITER_8 || nFormat == SotClipboardFormatId::STARWRITERGLOB_8)
SwGetReaderXML()->GetSectionList( rMedium, aArr );
- for(std::vector<OUString*>::const_iterator it(aArr.begin()); it != aArr.end(); ++it) {
- rBox.InsertEntry( **it );
- delete *it;
+ for (auto const& it : aArr)
+ {
+ rBox.InsertEntry(it);
}
}
}