summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-06-12 14:13:22 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-12 14:16:21 +0200
commit73d3edc46e49411750294e203131cef3f6570210 (patch)
treee807c35f07c445314b9d6c23aeb534736b6fb9cb /xmloff
parent422db2834c81d7a1d38b760209f7dec4a3cf43e0 (diff)
fix invalid vector.push_back(vector.back())
The vector::back() does not return a value but a reference, hence this is invalid. Change-Id: I8624b649deb8fb4de0d1d8af1288068acc80cef2 (cherry picked from commit cd18b8e313b792f5fc42edb3314a95d202406899) Signed-off-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/DomExport.cxx3
-rw-r--r--xmloff/source/text/txtlists.cxx9
2 files changed, 8 insertions, 4 deletions
diff --git a/xmloff/source/core/DomExport.cxx b/xmloff/source/core/DomExport.cxx
index eff5c49269a1..3f5c7af163ce 100644
--- a/xmloff/source/core/DomExport.cxx
+++ b/xmloff/source/core/DomExport.cxx
@@ -196,7 +196,8 @@ DomExport::~DomExport()
void DomExport::pushNamespace()
{
- maNamespaces.push_back( maNamespaces.back() );
+ SvXMLNamespaceMap const aMap(maNamespaces.back());
+ maNamespaces.push_back(aMap);
}
void DomExport::popNamespace()
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index f4d20c6a88ce..b6d3666b7103 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -412,12 +412,15 @@ XMLTextListsHelper::EnsureNumberedParagraph(
if (static_cast<sal_uInt16>(io_rLevel) + 1U > rNPList.size()) {
// new level: need to enlarge
for (size_t i = rNPList.size();
- i < static_cast<size_t>(io_rLevel); ++i) {
- rNPList.push_back(rNPList.back());
+ i < static_cast<size_t>(io_rLevel); ++i)
+ {
+ NumParaList_t::value_type const rule(rNPList.back());
+ rNPList.push_back(rule);
}
+ NumParaList_t::value_type const rule(rNPList.back());
rNPList.push_back(xNumRules.is()
? ::std::make_pair(i_StyleName, xNumRules)
- : rNPList.back());
+ : rule);
} else {
// old level: no need to enlarge; possibly shrink
if (xNumRules.is()) {