summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMarcel Metz <mmetz@adrian-broher.net>2011-12-21 19:04:04 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-21 20:14:52 +0100
commit13f8d799b9ad799e3e91a304b66ebd2151307fd5 (patch)
treefeeea42ac97c934b4fa00613a21e45156d81ad59 /sw
parent40fe511d0ed56d4481cad9c278899f3b9167cdb5 (diff)
Replace SwTxtPortionTable with std::map.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/inftxt.hxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 34845ec06072..0dc05d02de3c 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -30,7 +30,7 @@
#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
#include <com/sun/star/beans/PropertyValues.hpp>
-#include <tools/table.hxx>
+#include <map>
#include "swtypes.hxx"
#include "txttypes.hxx"
@@ -168,14 +168,14 @@ public:
* class SwTxtSizeInfo
*************************************************************************/
-DECLARE_TABLE( SwTxtPortionTable, sal_IntPtr )
+typedef ::std::map< sal_uLong, sal_IntPtr > SwTxtPortionMap;
class SwTxtSizeInfo : public SwTxtInfo
{
protected:
// during formatting, a small database is built, mapping portion pointers
// to their maximum size (used for kana compression)
- SwTxtPortionTable aMaxWidth;
+ SwTxtPortionMap aMaxWidth;
// for each line, an array of compression values is calculated
// this array is passed over to the info structure
std::deque<sal_uInt16>* pKanaComp;
@@ -343,19 +343,24 @@ public:
// stored in aMaxWidth and discarded after a line has been formatted.
inline void SetMaxWidthDiff( sal_uLong nKey, sal_uInt16 nVal )
{
- aMaxWidth.Insert( nKey, nVal );
+ aMaxWidth.insert( ::std::make_pair( nKey, nVal ) );
};
inline sal_uInt16 GetMaxWidthDiff( sal_uLong nKey )
{
- return (sal_uInt16)aMaxWidth.Get( nKey );
+ SwTxtPortionMap::iterator it = aMaxWidth.find( nKey );
+
+ if( it != aMaxWidth.end() )
+ return it->second;
+ else
+ return 0;
};
inline void ResetMaxWidthDiff()
{
- aMaxWidth.Clear();
+ aMaxWidth.clear();
};
inline sal_Bool CompressLine()
{
- return (sal_Bool)aMaxWidth.Count();
+ return (sal_Bool)!aMaxWidth.empty();
};
//