[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source vcl/inc vcl/source
Caolán McNamara
caolanm at redhat.com
Fri Sep 4 03:38:03 PDT 2015
sw/qa/core/data/ww8/pass/crash-4.doc |binary
sw/source/filter/ww8/ww8par.cxx | 17 ++++++++---------
sw/source/filter/ww8/ww8par.hxx | 13 +++++++++++--
sw/source/filter/ww8/ww8par6.cxx | 2 +-
vcl/inc/outdevstatestack.hxx | 6 +++---
vcl/source/outdev/outdevstatestack.cxx | 4 ++--
6 files changed, 25 insertions(+), 17 deletions(-)
New commits:
commit 01e6e93eed5efc22aa7818f50807ec68a4a3aa52
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 4 10:25:28 2015 +0100
vcl: replace boost::ptr_deque with std::deque<std::unique_ptr>
Change-Id: Id53ee54dda5454669affd5ca5324a2d7c5387063
diff --git a/vcl/inc/outdevstatestack.hxx b/vcl/inc/outdevstatestack.hxx
index 406d62b..10fa108 100644
--- a/vcl/inc/outdevstatestack.hxx
+++ b/vcl/inc/outdevstatestack.hxx
@@ -11,12 +11,12 @@
#define INCLUDED_VCL_OUTDEVSTATESTACK_HXX
#include <vcl/outdevstate.hxx>
-
-#include <boost/ptr_container/ptr_deque.hpp>
+#include <memory>
+#include <deque>
class OutDevStateStack
{
- typedef boost::ptr_deque<OutDevState> DataType;
+ typedef std::deque<std::unique_ptr<OutDevState>> DataType;
DataType maData;
public:
bool empty() const;
diff --git a/vcl/source/outdev/outdevstatestack.cxx b/vcl/source/outdev/outdevstatestack.cxx
index 0fcdcd5..24eb245 100644
--- a/vcl/source/outdev/outdevstatestack.cxx
+++ b/vcl/source/outdev/outdevstatestack.cxx
@@ -21,7 +21,7 @@ size_t OutDevStateStack::size() const
void OutDevStateStack::push_back( OutDevState* p )
{
- maData.push_back(p);
+ maData.push_back(std::unique_ptr<OutDevState>(p));
}
void OutDevStateStack::pop_back()
@@ -31,7 +31,7 @@ void OutDevStateStack::pop_back()
OutDevState& OutDevStateStack::back()
{
- return maData.back();
+ return *maData.back();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d64105fd3a16356ff858da1497d7fd73b98f55c6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 4 10:07:13 2015 +0100
drop pams before removing extraneous paras
and remove extra paras in order of largest index first
Change-Id: Iafbe612a8a8bd51cb157b4a4c07031c6603d92ee
diff --git a/sw/qa/core/data/ww8/pass/crash-4.doc b/sw/qa/core/data/ww8/pass/crash-4.doc
new file mode 100644
index 0000000..8658e0e
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/crash-4.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d6a25cc..1142325 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4632,9 +4632,8 @@ void wwSectionManager::InsertSegments()
void wwExtraneousParas::delete_all_from_doc()
{
- typedef std::vector<SwTextNode*>::iterator myParaIter;
- myParaIter aEnd = m_aTextNodes.end();
- for (myParaIter aI = m_aTextNodes.begin(); aI != aEnd; ++aI)
+ auto aEnd = m_aTextNodes.rend();
+ for (auto aI = m_aTextNodes.rbegin(); aI != aEnd; ++aI)
{
SwTextNode *pTextNode = *aI;
SwNodeIndex aIdx(*pTextNode);
@@ -5357,6 +5356,12 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
DELETEZ( m_pLstManager );
}
+ SAL_WARN_IF(m_pTableEndPaM, "sw.ww8", "document ended without table ending");
+ m_pTableEndPaM.reset(); //ensure this is deleted before pPaM
+ mpCrsr.reset();
+ m_pPaM = nullptr;
+ m_pLastAnchorPos.reset();//ensure this is deleted before UpdatePageDescs
+
// remove extra paragraphs after attribute ctrl
// stacks etc. are destroyed, and before fields
// are updated
@@ -5368,12 +5373,6 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
if (m_bNewDoc)
m_rDoc.getIDocumentRedlineAccess().SetRedlineMode((RedlineMode_t)( eMode ));
- SAL_WARN_IF(m_pTableEndPaM, "sw.ww8", "document ended without table ending");
- m_pTableEndPaM.reset(); //ensure this is deleted before pPaM
- mpCrsr.reset();
- m_pPaM = nullptr;
- m_pLastAnchorPos.reset();//ensure this is deleted before UpdatePageDescs
-
UpdatePageDescs(m_rDoc, nPageDescOffset);
return nErrRet;
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index a0d7202..7187bfe 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -49,6 +49,7 @@
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
+#include <ndtxt.hxx>
#include <editeng/lrspitem.hxx>
#include <oox/ole/olehelper.hxx>
@@ -453,6 +454,14 @@ namespace SwWW8
return r1.compareToIgnoreAsciiCase(r2)<0;
}
};
+
+ struct ltnode
+ {
+ bool operator()(const SwTextNode *r1, const SwTextNode *r2) const
+ {
+ return r1->GetIndex() < r2->GetIndex();
+ }
+ };
};
class SwWW8ReferencedFltEndStack : public SwFltEndStack
@@ -920,12 +929,12 @@ private:
/*
A vector of SwTextNodes to erase from a document after import is complete
*/
- std::vector<SwTextNode*> m_aTextNodes;
+ std::set<SwTextNode*, SwWW8::ltnode> m_aTextNodes;
SwDoc& m_rDoc;
public:
explicit wwExtraneousParas(SwDoc &rDoc) : m_rDoc(rDoc) {}
~wwExtraneousParas() { delete_all_from_doc(); }
- void push_back(SwTextNode *pTextNode) { m_aTextNodes.push_back(pTextNode); }
+ void insert(SwTextNode *pTextNode) { m_aTextNodes.insert(pTextNode); }
void delete_all_from_doc();
};
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index e36633a..fc54c76 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2220,7 +2220,7 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrameFormat *pFlyFormat,
//delete after import is complete rather than now
//to avoid the complication of managing uncommitted
//ctrlstack properties that refer to it.
- m_aExtraneousParas.push_back(pNd);
+ m_aExtraneousParas.insert(pNd);
SwTable& rTable = pTable->GetTable();
SwFrameFormat* pTableFormat = rTable.GetFrameFormat();
More information about the Libreoffice-commits
mailing list