Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hello lo-devs,

this patch replaces yet another Table class use.

regards Marcel Metz
---
 sw/source/core/text/inftxt.hxx |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)


diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 34845ec..0dc05d0 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();
     };
 
     //


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.