[Libreoffice-commits] core.git: vcl/source
Michaël Lefèvre
lefevre00 at yahoo.fr
Wed Oct 15 12:36:16 PDT 2014
vcl/source/edit/textdat2.hxx | 13 ++++++++++---
vcl/source/edit/textdata.cxx | 14 ++------------
2 files changed, 12 insertions(+), 15 deletions(-)
New commits:
commit 07f9ccf99c6746351dfdd26a046c788693632dfb
Author: Michaël Lefèvre <lefevre00 at yahoo.fr>
Date: Mon Oct 13 16:13:31 2014 +0200
fdo#75757: remove inheritance to std::vector
from TEParaPortions (through ToolsList, close to be deleted ;).
Change-Id: Iec92ebb54ebc44d94ccc8cb30230ffb44b937b35
Reviewed-on: https://gerrit.libreoffice.org/11954
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx
index 85f3b36..b5e2118 100644
--- a/vcl/source/edit/textdat2.hxx
+++ b/vcl/source/edit/textdat2.hxx
@@ -225,12 +225,19 @@ public:
void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine );
};
-class TEParaPortions : public ToolsList<TEParaPortion*>
+class TEParaPortions
{
+private:
+ std::vector<TEParaPortion*> mvData;
+
public:
- TEParaPortions();
+ TEParaPortions() : mvData() {}
~TEParaPortions();
- void Reset();
+
+ size_t Count() const { return mvData.size(); }
+ TEParaPortion* GetObject( size_t nIndex ) { return mvData[nIndex]; }
+ void Insert( TEParaPortion* pObject, size_t nPos ) { mvData.insert( mvData.begin()+nPos, pObject ); }
+ void Remove( size_t nPos ) { mvData.erase( mvData.begin()+nPos ); }
};
class TextSelFunctionSet: public FunctionSet
diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx
index 195bf85..e6bebd2 100644
--- a/vcl/source/edit/textdata.cxx
+++ b/vcl/source/edit/textdata.cxx
@@ -212,21 +212,11 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat
}
}
-TEParaPortions::TEParaPortions()
-{
-}
-
TEParaPortions::~TEParaPortions()
{
- Reset();
-}
-
-void TEParaPortions::Reset()
-{
- TEParaPortions::iterator aIter( begin() );
- while ( aIter != end() )
+ std::vector<TEParaPortion*>::iterator aIter( mvData.begin() );
+ while ( aIter != mvData.end() )
delete *aIter++;
- clear();
}
IdleFormatter::IdleFormatter()
More information about the Libreoffice-commits
mailing list