sw/inc/unocrsrhelper.hxx                 |    8 +++++---
 sw/source/core/txtnode/ndtxt.cxx         |    8 +++++++-
 sw/source/core/unocore/unocrsrhelper.cxx |   14 +++++++-------
 3 files changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 15a439dacf77bfcd7cc47bd1c360945375a24141
Author: Michael Stahl <mst...@redhat.com>
Date:   Thu Sep 3 23:11:50 2015 +0200

    sw: replace boost::ptr_map with std::map
    
    Change-Id: I8cf906b7f3f9647a60b20a977ea11c8698438ec2

diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx
index 9692639..4dc6ffd 100644
--- a/sw/inc/unocrsrhelper.hxx
+++ b/sw/inc/unocrsrhelper.hxx
@@ -19,8 +19,6 @@
 #ifndef INCLUDED_SW_INC_UNOCRSRHELPER_HXX
 #define INCLUDED_SW_INC_UNOCRSRHELPER_HXX
 
-#include <boost/ptr_container/ptr_map.hpp>
-
 #include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/uno/DeploymentException.hpp>
@@ -29,6 +27,8 @@
 #include <flyenum.hxx>
 #include <pam.hxx>
 
+#include <map>
+
 class SfxItemSet;
 class SfxItemPropertySet;
 struct SfxItemPropertySimpleEntry;
@@ -68,8 +68,10 @@ namespace SwUnoCursorHelper
 {
     class SwAnyMapHelper
     {
+        private:
             //  keep Any's mapped by (WhichId << 16 ) + (MemberId)
-            boost::ptr_map<sal_uInt32,com::sun::star::uno::Any> maMap;
+            std::map<sal_uInt32, com::sun::star::uno::Any> m_Map;
+
         public:
             void    SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const 
com::sun::star::uno::Any& rAny );
             bool    FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, 
const com::sun::star::uno::Any*& pAny );
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index 983b5ed..c6dcb50 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1402,21 +1402,21 @@ void makeTableCellRedline( SwTableBox& rTableBox,
 void SwAnyMapHelper::SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, 
const uno::Any& rAny )
 {
     sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
-    auto aIt = maMap.find( nKey );
-    if( aIt != maMap.end() )
-        *(aIt->second) = rAny;
+    auto aIt = m_Map.find( nKey );
+    if (aIt != m_Map.end())
+        aIt->second = rAny;
     else
-        maMap.insert( nKey, new uno::Any(rAny) );
+        m_Map.insert(std::make_pair(nKey, rAny));
 }
 
 bool    SwAnyMapHelper::FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, 
const uno::Any*& pAny )
 {
     bool bRet = false;
     sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
-    auto aIt = maMap.find( nKey );
-    if( aIt != maMap.end() )
+    auto aIt = m_Map.find( nKey );
+    if (aIt != m_Map.end())
     {
-        pAny = aIt->second;
+        pAny = & aIt->second;
         bRet = true;
     }
     return bRet;
commit 9b5d96d7e074dd9ea26f835351ac6d36fe01b086
Author: Michael Stahl <mst...@redhat.com>
Date:   Thu Sep 3 22:25:47 2015 +0200

    sw: avoid asserts from RsidOnlyAutoFormats check
    
    This happens with a document that has a header or footer that is not
    displayed after loading, for example 1-page document with separate
    left/right or first page header.
    
    The SwTextNode::FileLoadedInitHints() is not called for these headers
    because they are not visible so MakeFrm() is not called.
    
    If they are not visible the RSID related flags don't matter.
    
    Change-Id: Ie3bd1ce3bc0ac2ff1c429386149294e0c8fd3cb6

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d8e8698..3317369 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -102,8 +102,12 @@ TYPEINIT1( SwTextNode, SwContentNode )
 #define CHECK_SWPHINTS(pNd)  { if( pNd->GetpSwpHints() && \
                                    !pNd->GetDoc()->IsInReading() ) \
                                   pNd->GetpSwpHints()->Check(true); }
+#define CHECK_SWPHINTS_IF_FRM(pNd)  { if( pNd->GetpSwpHints() && \
+                                   !pNd->GetDoc()->IsInReading() ) \
+    pNd->GetpSwpHints()->Check(getLayoutFrm(nullptr, nullptr, nullptr, false) 
!= nullptr); }
 #else
 #define CHECK_SWPHINTS(pNd)
+#define CHECK_SWPHINTS_IF_FRM(pNd)
 #endif
 
 SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
@@ -1643,6 +1647,8 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
                       sal_Int32 nLen,
                       const bool bForceCopyOfAllAttrs )
 {
+    CHECK_SWPHINTS_IF_FRM(this);
+    CHECK_SWPHINTS(pDest);
     sal_Int32 nTextStartIdx = rStart.GetIndex();
     sal_Int32 nDestStart = rDestStart.GetIndex();      // alte Pos merken
 
@@ -1896,7 +1902,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
         }
     }
 
-    CHECK_SWPHINTS(this);
+    CHECK_SWPHINTS_IF_FRM(this);
     CHECK_SWPHINTS(pDest);
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to