[Libreoffice-commits] .: editeng/source
Lubos Lunak
llunak at kemper.freedesktop.org
Fri Mar 30 07:39:31 PDT 2012
editeng/source/editeng/editattr.cxx | 10 ----------
editeng/source/editeng/editattr.hxx | 4 +---
editeng/source/editeng/editdoc.cxx | 2 +-
3 files changed, 2 insertions(+), 14 deletions(-)
New commits:
commit d52d301660df47527a69c12bca49bb4e0199b4f5
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Fri Mar 30 16:36:01 2012 +0200
avoid sc crashes
Boost is reportedly 'expertly designed C++ library', so why do I
find the idea of a container containing pointers but exposing them
by value to be rather retarded? I don't know why exactly this
crashes, but I expect std::sort() either either does unwanted
copies that break things or the copies slice off inherited classes.
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx
index 171eb36..2e79644 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -66,12 +66,6 @@ EditAttrib::EditAttrib( const SfxPoolItem& rAttr )
pItem = &rAttr;
}
-EditAttrib::EditAttrib(const EditAttrib& r) :
- pItem(r.pItem)
-{
- DBG_CTOR( EE_EditAttrib, 0 );
-}
-
EditAttrib::~EditAttrib()
{
DBG_DTOR( EE_EditAttrib, 0 );
@@ -88,10 +82,6 @@ EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uIn
DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" );
}
-EditCharAttrib::EditCharAttrib(const EditCharAttrib& r) :
- EditAttrib(r),
- nStart(r.nStart), nEnd(r.nEnd), bFeature(r.bFeature), bEdge(r.bEdge) {}
-
void EditCharAttrib::SetFont( SvxFont&, OutputDevice* )
{
}
diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx
index 0ad35a2..5855e47 100644
--- a/editeng/source/editeng/editattr.hxx
+++ b/editeng/source/editeng/editattr.hxx
@@ -68,7 +68,7 @@ class SfxVoidItem;
// -------------------------------------------------------------------------
// class EditAttrib
// -------------------------------------------------------------------------
-class EditAttrib
+class EditAttrib : public boost::noncopyable
{
private:
EditAttrib();
@@ -77,7 +77,6 @@ protected:
const SfxPoolItem* pItem;
EditAttrib( const SfxPoolItem& rAttr );
- EditAttrib(const EditAttrib& r);
virtual ~EditAttrib();
public:
@@ -104,7 +103,6 @@ protected:
public:
EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd );
- EditCharAttrib(const EditCharAttrib& r);
sal_uInt16& GetStart() { return nStart; }
sal_uInt16& GetEnd() { return nEnd; }
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 6b35b47..86a709b 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2005,7 +2005,7 @@ void CharAttribList::InsertAttrib( EditCharAttrib* pAttrib )
void CharAttribList::ResortAttribs()
{
- std::sort(aAttribs.begin(), aAttribs.end(), LessByStart());
+ aAttribs.sort(LessByStart());
}
void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool )
More information about the Libreoffice-commits
mailing list