--- sal/inc/rtl/allocator.hxx.orig	2006-07-28 13:39:12.000000000 +0200
+++ sal/inc/rtl/allocator.hxx	2006-07-28 13:40:05.000000000 +0200
@@ -179,6 +179,7 @@
 
 } /* namespace rtl */
 
+#if STLPORT_VERSION < 500
 //######################################################
 /** REQUIRED BY STLPort (see stlport '_alloc.h'): 
     Hack for compilers that do not support member 
@@ -195,6 +196,6 @@
         return (::rtl::Allocator<U>&)(a);
     }
 }
-
+#endif /* STLPORT_VERSION < 500 */
 #endif /* INCLUDED_RTL_ALLOCATOR_HXX */
 
--- store/source/storbase.cxx.orig	2006-03-27 21:09:31.000000000 +0200
+++ store/source/storbase.cxx	2006-03-27 21:10:51.000000000 +0200
@@ -907,6 +907,7 @@
 	return false;
 }
 
+#if STLPORT_VERSION < 500
 //----------------------------------------------------------------------------
 // see stlport '_alloc.h' comments why old compilers require the hack below.
 //----------------------------------------------------------------------------
@@ -921,6 +922,7 @@
 	}
 }
 #endif /* __STL_MEMBER_TEMPLATE_CLASSES */
+#endif /* STLPORT_VERSION < 500 */
 
 /*========================================================================
  *
--- configmgr/source/api/confeventhelpers.cxx.orig	2006-03-25 19:17:41.000000000 +0100
+++ configmgr/source/api/confeventhelpers.cxx	2006-03-25 20:57:50.000000000 +0100
@@ -105,7 +105,7 @@
 		Pathes const& pathes = iter->pathList();
 
 		// first clear the Path Map
-		for(Pathes::iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
+		for(Pathes::const_iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
 		{
 			typedef PathMap::iterator PMIter;
 			typedef std::pair<PMIter, PMIter> PMRange;
--- configmgr/source/tree/cmtree.cxx.orig	2006-03-25 20:52:15.000000000 +0100
+++ configmgr/source/tree/cmtree.cxx	2006-03-25 21:16:07.000000000 +0100
@@ -91,7 +91,7 @@
 // ------------------------ ChildListSet implementations ------------------------
     ChildListSet::ChildListSet(ChildListSet const& aSet, treeop::DeepChildCopy)
 	{
-		for(ChildList::iterator it = aSet.GetSet().begin();
+		for(ChildList::const_iterator it = aSet.GetSet().begin();
 			it != aSet.GetSet().end();
 			++it)
         {
@@ -258,7 +258,7 @@
 		}
 #endif
 
-		ChildList::iterator it = m_aChildren.GetSet().find(&searchObj);
+		ChildList::const_iterator it = m_aChildren.GetSet().find(&searchObj);
 		if (it == m_aChildren.GetSet().end())
 			return NULL;
 		else
@@ -278,7 +278,7 @@
 	::std::auto_ptr<INode> Subtree::removeChild(OUString const& aName)
 	{
 		SearchNode searchObj(aName);
-		ChildList::const_iterator it = m_aChildren.GetSet().find(&searchObj);
+		ChildList::iterator it = m_aChildren.GetSet().find(&searchObj);
 
 		::std::auto_ptr<INode> aReturn;
 		if (m_aChildren.GetSet().end() != it)
--- tools/source/generic/line.cxx.orig	2006-03-25 21:28:09.000000000 +0100
+++ tools/source/generic/line.cxx	2006-03-25 21:29:28.000000000 +0100
@@ -61,7 +61,12 @@
 
 double Line::GetLength() const
 {
+#if STLPORT_VERSION < 500
     return hypot( maStart.X() - maEnd.X(), maStart.Y() - maEnd.Y() );
+#else
+// STLport5 hypot does not accept long int's
+    return hypot( (double)(maStart.X() - maEnd.X()), (double)( maStart.Y() - maEnd.Y()) );
+#endif
 }
 
 // ------------------------------------------------------------------------
--- vcl/source/gdi/jobset.cxx.orig	2006-03-25 21:50:33.000000000 +0100
+++ vcl/source/gdi/jobset.cxx	2006-03-26 16:04:55.000000000 +0200
@@ -294,8 +294,13 @@
 		 (pData1->mnPaperWidth		== pData2->mnPaperWidth)			&&
 		 (pData1->mnPaperHeight 	== pData2->mnPaperHeight)			&&
 		 (pData1->mnDriverDataLen	== pData2->mnDriverDataLen) 		&&
-		 (memcmp( pData1->mpDriverData, pData2->mpDriverData, pData1->mnDriverDataLen ) == 0)															&&
-		 (pData1->maValueMap		== pData2->maValueMap)
+		 (memcmp( pData1->mpDriverData, pData2->mpDriverData, pData1->mnDriverDataLen ) == 0)
+#if STLPORT_VERSION < 500
+		 && (pData1->maValueMap		== pData2->maValueMap)
+#else
+//FIXME: STLport5 alternative map compare?
+		 && (pData1->maValueMap.size()	== pData2->maValueMap.size())
+#endif
 		 )
 		return TRUE;
 
--- slideshow/source/engine/drawshapesubsetting.cxx.orig	2006-03-26 12:17:50.000000000 +0200
+++ slideshow/source/engine/drawshapesubsetting.cxx	2006-03-26 12:18:36.000000000 +0200
@@ -355,7 +355,7 @@
             aEntry.mnStartActionIndex 	= rTreeNode.getStartIndex();
             aEntry.mnEndActionIndex 	= rTreeNode.getEndIndex();
 
-            ShapeSet::iterator aIter;
+            ShapeSet::const_iterator aIter;
             if( (aIter=maSubsetShapes.find( aEntry )) != maSubsetShapes.end() )
             {
                 // already created, return found entry
--- slideshow/source/engine/layer.cxx.orig	2006-03-26 12:20:26.000000000 +0200
+++ slideshow/source/engine/layer.cxx	2006-03-26 12:21:53.000000000 +0200
@@ -187,8 +187,8 @@
         {
             bool bRet( true );
 
-            const ShapeSet::iterator 	aEnd( maShapeSet.end() );
-            ShapeSet::iterator 			aCurr( maShapeSet.begin() );
+            const ShapeSet::const_iterator 	aEnd( maShapeSet.end() );
+            ShapeSet::const_iterator 			aCurr( maShapeSet.begin() );
             while( aCurr != aEnd )
             {
                 try
@@ -230,8 +230,8 @@
             bool bRet( true );
 
             // forward to each Shape's render() method
-            const ShapeSet::iterator 	aEnd( maShapeSet.end() );
-            ShapeSet::iterator 			aCurr( maShapeSet.begin() );
+            const ShapeSet::const_iterator 	aEnd( maShapeSet.end() );
+            ShapeSet::const_iterator 			aCurr( maShapeSet.begin() );
             while( aCurr != aEnd )
             {
                 try
--- xmloff/source/core/nmspmap.cxx.orig	2006-03-26 12:37:20.000000000 +0200
+++ xmloff/source/core/nmspmap.cxx	2006-03-26 15:38:07.000000000 +0200
@@ -103,7 +103,12 @@
 
 int SvXMLNamespaceMap::operator ==( const SvXMLNamespaceMap& rCmp ) const
 {
+#if STLPORT_VERSION < 500
 	return static_cast < int > (aNameHash == rCmp.aNameHash);
+#else
+//FIXME: STLport5 alternative map compare?
+	return static_cast < int > (aNameHash.size() == rCmp.aNameHash.size());
+#endif
 }
 
 sal_uInt16 SvXMLNamespaceMap::_Add( const OUString& rPrefix, const OUString &rName, sal_uInt16 nKey )
--- xmloff/source/style/xmlnumfe.cxx.orig	2006-03-26 15:54:06.000000000 +0200
+++ xmloff/source/style/xmlnumfe.cxx	2006-03-26 15:54:33.000000000 +0200
@@ -172,13 +172,13 @@
 
 sal_Bool SvXMLNumUsedList_Impl::IsUsed( sal_uInt32 nKey ) const
 {
-	SvXMLuInt32Set::iterator aItr = aUsed.find(nKey);
+	SvXMLuInt32Set::const_iterator aItr = aUsed.find(nKey);
 	return (aItr != aUsed.end());
 }
 
 sal_Bool SvXMLNumUsedList_Impl::IsWasUsed( sal_uInt32 nKey ) const
 {
-	SvXMLuInt32Set::iterator aItr = aWasUsed.find(nKey);
+	SvXMLuInt32Set::const_iterator aItr = aWasUsed.find(nKey);
 	return (aItr != aWasUsed.end());
 }
 
--- svx/source/svdraw/svdouno.cxx.orig	2006-03-26 17:21:56.000000000 +0200
+++ svx/source/svdraw/svdouno.cxx	2006-03-26 17:22:47.000000000 +0200
@@ -875,7 +875,7 @@
         SdrViewIter aIter( this );
 	    for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
         {
-            ::std::set< SdrView* >::const_iterator aPrevPos = aPreviouslyVisible.find( pView );
+            ::std::set< SdrView* >::iterator aPrevPos = aPreviouslyVisible.find( pView );
             if ( aPreviouslyVisible.end() != aPrevPos )
             {   // in pView, we were visible _before_ the layer change, and are
                 // visible _after_ the layer change, too
--- sc/source/core/inc/bcaslot.hxx.orig	2006-03-26 18:50:41.000000000 +0200
+++ sc/source/core/inc/bcaslot.hxx	2006-03-26 19:05:42.000000000 +0200
@@ -109,7 +109,7 @@
 	ScDocument*			pDoc;
 	ScBroadcastAreaSlotMachine* pBASM;
 
-    ScBroadcastAreas::iterator  FindBroadcastArea( const ScRange& rRange ) const;
+    ScBroadcastAreas::iterator  FindBroadcastArea( const ScRange& rRange );
 
 public:
 						ScBroadcastAreaSlot( ScDocument* pDoc,
--- sc/source/core/data/bcaslot.cxx.orig	2006-03-26 18:23:16.000000000 +0200
+++ sc/source/core/data/bcaslot.cxx	2006-03-26 19:04:58.000000000 +0200
@@ -204,7 +204,7 @@
 
 
 ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea(
-        const ScRange& rRange ) const
+        const ScRange& rRange )
 {
 	aTmpSeekBroadcastArea.UpdateRange( rRange);
     return aBroadcastAreaTbl.find( &aTmpSeekBroadcastArea);
--- sw/source/core/SwNumberTree/SwNumberTree.cxx.orig	2006-03-28 18:54:36.000000000 +0200
+++ sw/source/core/SwNumberTree/SwNumberTree.cxx	2006-03-28 19:13:32.000000000 +0200
@@ -160,7 +160,7 @@
     }
 }
 
-void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) const
+void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode)
 {
     tSwNumberTreeChildren::iterator aValidateIt =
         GetIterator(pNode);
@@ -282,7 +282,7 @@
     }
 }
 
-void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
+void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode)
 {
     tSwNumberTreeChildren::iterator aIt = mItLastValid;
 
@@ -340,7 +340,7 @@
     SetLastValid(aIt);
 }
 
-void SwNumberTreeNode::Validate(const SwNumberTreeNode * pNode) const
+void SwNumberTreeNode::Validate(const SwNumberTreeNode * pNode)
 {
     if (! IsValid(pNode))
     {
@@ -869,7 +869,7 @@
 
 bool SwNumberTreeNode::IsFirst(const SwNumberTreeNode * pNode) const
 {
-    tSwNumberTreeChildren::iterator aIt = mChildren.begin();
+    tSwNumberTreeChildren::const_iterator aIt = mChildren.begin();
 
     if ((*aIt)->IsPhantom())
         aIt++;
@@ -919,13 +919,13 @@
     return mChildren.size();
 }
 
-bool SwNumberTreeNode::Contains(const SwNumberTreeNode * pChild) const
+bool SwNumberTreeNode::Contains(const SwNumberTreeNode * pChild)
 {
     bool bResult = false;
 
     if (GetChildCount() > 0)
     {
-        tSwNumberTreeChildren::const_iterator aIt = GetIterator(pChild);
+        tSwNumberTreeChildren::iterator aIt = GetIterator(pChild);
 
         if (aIt != mChildren.end())
             bResult = true;
@@ -1020,7 +1020,7 @@
 #endif // __SW_NUMBER_TREE_SANITY_CHECK
 
 SwNumberTreeNode::tSwNumberTreeChildren::iterator
-SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild) const
+SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild)
 {
     SwNumberTreeNode * pRoot = GetRoot();
 
@@ -1136,7 +1136,7 @@
     return ! SwNumberTreeNodeLessThan(pA, pB);
 }
 
-SwNumberTreeNode * SwNumberTreeNode::GetLastDescendant() const
+SwNumberTreeNode * SwNumberTreeNode::GetLastDescendant()
 {
     SwNumberTreeNode * pResult = NULL;
     tSwNumberTreeChildren::reverse_iterator aIt = mChildren.rbegin();
@@ -1184,7 +1184,7 @@
 
 void SwNumberTreeNode::SetLastValid
                     ( SwNumberTreeNode::tSwNumberTreeChildren::iterator aItValid,
-                      bool bValidating ) const
+                      bool bValidating )
 {
     if (! (aItValid == mChildren.end() ||
            GetIterator(*aItValid) != mChildren.end()))
@@ -1249,7 +1249,7 @@
     }
 }
 
-void SwNumberTreeNode::InvalidateTree() const
+void SwNumberTreeNode::InvalidateTree()
 {
     // do not call SetInvalid, would cause loop !!!
     mItLastValid = mChildren.end();
--- sw/inc/SwNumberTree.hxx.orig	2006-03-28 18:54:48.000000000 +0200
+++ sw/inc/SwNumberTree.hxx	2006-03-28 19:13:44.000000000 +0200
@@ -196,7 +196,7 @@
 
        @attention All invalid children preceding pNode are validated, too.
      */
-    void Validate(const SwNumberTreeNode * pNode) const;
+    void Validate(const SwNumberTreeNode * pNode);
 
     /**
        Validates a child using hierarchical numbering.
@@ -205,7 +205,7 @@
 
        @attention All invalid children preceding pNode are validated, too.
      */
-    void ValidateHierarchical(const SwNumberTreeNode * pNode) const;
+    void ValidateHierarchical(const SwNumberTreeNode * pNode);
 
     /**
        Validates a child using continuous numbering.
@@ -214,7 +214,7 @@
 
        @attention All invalid children preceding pNode are validated, too.
      */
-    void ValidateContinuous(const SwNumberTreeNode * pNode) const;
+    void ValidateContinuous(const SwNumberTreeNode * pNode);
 
     /**
         HB, OD : return node, if it isn't a phantom, otherwise return first
@@ -230,7 +230,7 @@
 
        @return last descendant of the node
     */
-    SwNumberTreeNode * GetLastDescendant() const;
+    SwNumberTreeNode * GetLastDescendant();
 
     /**
        Returns the greatest descendant of the root that is smaller than
@@ -250,7 +250,7 @@
                                         the current last valid node
      */
     void SetLastValid(tSwNumberTreeChildren::iterator aItLastValid,
-                      bool bValidating = false) const;
+                      bool bValidating = false);
 
     /**
        Set this node as last valid child of its parent.
@@ -266,7 +266,7 @@
        of childs are set to the end of this list, thereby stating all
        children in the list are invalid.
      */
-    void InvalidateTree() const;
+    void InvalidateTree();
 
     /**
        Notifies the node.
@@ -368,7 +368,7 @@
 #endif // __SW_NUMBER_TREE_SANITY_CHECK
 
     tSwNumberTreeChildren::iterator
-    GetIterator(const SwNumberTreeNode * pChild) const;
+    GetIterator(const SwNumberTreeNode * pChild);
 
     // --> OD 2006-04-26 #i64010# - made pure virtual
     virtual bool HasCountedChildren() const = 0;
@@ -640,7 +640,7 @@
        @retval true    pChild is a child of this node
        @retval false   else
      */
-    bool Contains(const SwNumberTreeNode * pChild) const;
+    bool Contains(const SwNumberTreeNode * pChild);
 
     /**
        Returns a string representation of this node.
--- sw/source/core/SwNumberTree/SwNodeNum.cxx.orig	2006-05-13 20:32:14.000000000 +0200
+++ sw/source/core/SwNumberTree/SwNodeNum.cxx	2006-05-13 20:30:38.000000000 +0200
@@ -167,7 +167,7 @@
 {
     bool bResult = false;
 
-    tSwNumberTreeChildren::iterator aIt;
+    tSwNumberTreeChildren::const_iterator aIt;
 
     for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
     {
