[Libreoffice-commits] .: sdext/source xmloff/source

Michael Stahl mst at kemper.freedesktop.org
Tue Jun 12 05:16:26 PDT 2012


 sdext/source/pdfimport/test/tests.cxx         |    3 ++-
 sdext/source/pdfimport/tree/pdfiprocessor.cxx |    3 ++-
 xmloff/source/core/DomExport.cxx              |    3 ++-
 xmloff/source/text/txtlists.cxx               |    9 ++++++---
 4 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit cd18b8e313b792f5fc42edb3314a95d202406899
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jun 12 14:13:22 2012 +0200

    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

diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx
index c00d72e..60a2c7e 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -175,7 +175,8 @@ namespace
 
         virtual void pushState()
         {
-            m_aGCStack.push_back( m_aGCStack.back() );
+            GraphicsContextStack::value_type const a(m_aGCStack.back());
+            m_aGCStack.push_back(a);
         }
 
         virtual void popState()
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 9d066b9..1024803 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -116,7 +116,8 @@ void PDFIProcessor::setPageNum( sal_Int32 nPages )
 
 void PDFIProcessor::pushState()
 {
-    m_aGCStack.push_back( m_aGCStack.back() );
+    GraphicsContextStack::value_type const a(m_aGCStack.back());
+    m_aGCStack.push_back(a);
 }
 
 void PDFIProcessor::popState()
diff --git a/xmloff/source/core/DomExport.cxx b/xmloff/source/core/DomExport.cxx
index eff5c49..3f5c7af 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 f4d20c6..b6d3666 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()) {


More information about the Libreoffice-commits mailing list