[Libreoffice-commits] core.git: Branch 'private/mst/sw_redlinehide_4a' - 10 commits - sw/inc sw/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 20 11:15:19 UTC 2018


Rebased ref, commits from common ancestor:
commit bdfe74259ec1179527b7d883021210f0bce634a5
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Nov 20 11:04:41 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:56:38 2018 +0100

    sw_redlinehide_4a: SwEditShell::ReplaceDropText
    
    Change-Id: Iaf6101f02bd5dbeb9a07e796932186b5e2b1a563

diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 111fec2ae91f..5727845b060f 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -511,6 +511,13 @@ void SwEditShell::ReplaceDropText( const OUString &rStr, SwPaM* pPaM )
 
         const SwNodeIndex& rNd = pCursor->GetPoint()->nNode;
         SwPaM aPam( rNd, rStr.getLength(), rNd, 0 );
+        SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(
+            rNd.GetNode().GetTextNode()->getLayoutFrame(GetLayout())));
+        if (pTextFrame)
+        {
+            *aPam.GetPoint() = pTextFrame->MapViewToModelPos(TextFrameIndex(0));
+            *aPam.GetMark() = pTextFrame->MapViewToModelPos(TextFrameIndex(rStr.getLength()));
+        }
         if( !GetDoc()->getIDocumentContentOperations().Overwrite( aPam, rStr ) )
         {
             OSL_FAIL( "Doc->getIDocumentContentOperations().Overwrite(Str) failed." );
commit 98935d4cc936f7ec50abb2c456c906f908b7d3db
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Nov 19 17:44:37 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:56:38 2018 +0100

    sw_redlinehide_4a: InsertItemSet/InsertPoolItem
    
    It's really quite annoying to have RES_BREAK applied to all nodes; so
    apply the node-items only to the first-/properties-node and skip hidden
    nodes.
    
    Keep applying text/character items as before, except skip over hidden
    nodes.
    
    Change-Id: I085afd59af78caf1ca8dac4080c53bdbdb4e56a1

diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx
index fb4006334a15..f761b27aa331 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -37,6 +37,7 @@ class SwFrameFormat;
 class SwDrawFrameFormat;
 class SwFlyFrameFormat;
 class SwNodeIndex;
+class SwRootFrame;
 
 namespace utl { class TransliterationWrapper; }
 namespace svt { class EmbeddedObjectRef; }
@@ -212,10 +213,13 @@ public:
         false.
     */
     virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
-                                const SetAttrMode nFlags = SetAttrMode::DEFAULT, bool bExpandCharToPara=false) = 0;
+                                const SetAttrMode nFlags = SetAttrMode::DEFAULT,
+                                SwRootFrame const* pLayout = nullptr,
+                                bool bExpandCharToPara=false) = 0;
 
     virtual void InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
-        const SetAttrMode nFlags = SetAttrMode::DEFAULT) = 0;
+        const SetAttrMode nFlags = SetAttrMode::DEFAULT,
+        SwRootFrame const* pLayout = nullptr) = 0;
 
     /** Removes any leading white space from the paragraph
     */
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 2727b3e39274..55cdf20367e2 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -45,6 +45,7 @@
 #include <SwStyleNameMapper.hxx>
 #include <redline.hxx>
 #include <txtfrm.hxx>
+#include <rootfrm.hxx>
 #include <unocrsr.hxx>
 #include <mvsave.hxx>
 #include <ndtxt.hxx>
@@ -1013,6 +1014,81 @@ namespace
 
 namespace //local functions originally from docfmt.cxx
 {
+
+    bool lcl_ApplyOtherSet(
+            SwContentNode & rNode,
+            SwHistory *const pHistory,
+            SfxItemSet const& rOtherSet,
+            SfxItemSet const& rFirstSet,
+            SfxItemSet const& rPropsSet,
+            SwRootFrame const*const pLayout,
+            SwNodeIndex *const o_pIndex = nullptr)
+    {
+        assert(rOtherSet.Count());
+
+        bool ret(false);
+        SwTextNode *const pTNd = rNode.GetTextNode();
+        sw::MergedPara const* pMerged(nullptr);
+        if (pLayout && pLayout->IsHideRedlines() && pTNd)
+        {
+            SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(
+                pTNd->getLayoutFrame(pLayout)));
+            if (pTextFrame)
+            {
+                pMerged = pTextFrame->GetMergedPara();
+            }
+            if (pMerged)
+            {
+                if (rFirstSet.Count())
+                {
+                    if (pHistory)
+                    {
+                        SwRegHistory aRegH(pMerged->pFirstNode, *pMerged->pFirstNode, pHistory);
+                        ret = pMerged->pFirstNode->SetAttr(rFirstSet);
+                    }
+                    else
+                    {
+                        ret = pMerged->pFirstNode->SetAttr(rFirstSet);
+                    }
+                }
+                if (rPropsSet.Count())
+                {
+                    if (pHistory)
+                    {
+                        SwRegHistory aRegH(pMerged->pParaPropsNode, *pMerged->pParaPropsNode, pHistory);
+                        ret = pMerged->pParaPropsNode->SetAttr(rPropsSet) || ret;
+                    }
+                    else
+                    {
+                        ret = pMerged->pParaPropsNode->SetAttr(rPropsSet) || ret;
+                    }
+                }
+                if (o_pIndex)
+                {
+                    *o_pIndex = *pMerged->pLastNode; // skip hidden
+                }
+            }
+        }
+
+        // input cursor can't be on hidden node, and iteration skips them
+        assert(!pLayout || !pLayout->IsHideRedlines()
+            || rNode.GetRedlineMergeFlag() != SwNode::Merge::Hidden);
+
+        if (!pMerged)
+        {
+            if (pHistory)
+            {
+                SwRegHistory aRegH(&rNode, rNode, pHistory);
+                ret = rNode.SetAttr( rOtherSet );
+            }
+            else
+            {
+                ret = rNode.SetAttr( rOtherSet );
+            }
+        }
+        return ret;
+    }
+
     #define DELETECHARSETS if ( bDelete ) { delete pCharSet; delete pOtherSet; }
 
     /// Insert Hints according to content types;
@@ -1024,6 +1100,7 @@ namespace //local functions originally from docfmt.cxx
         const SfxItemSet& rChgSet,
         const SetAttrMode nFlags,
         SwUndoAttr *const pUndo,
+        SwRootFrame const*const pLayout,
         const bool bExpandCharToPara=false)
     {
         // Divide the Sets (for selections in Nodes)
@@ -1106,6 +1183,10 @@ namespace //local functions originally from docfmt.cxx
             if (rRg.IsInFrontOfLabel())
             {
                 SwTextNode * pTextNd = pNode->GetTextNode();
+                if (pLayout)
+                {
+                    pTextNd = sw::GetParaPropsNode(*pLayout, *pTextNd);
+                }
                 SwNumRule * pNumRule = pTextNd->GetNumRule();
 
                 if ( !pNumRule )
@@ -1246,8 +1327,13 @@ namespace //local functions originally from docfmt.cxx
                     }
                     else
                     {
-                        SwRegHistory aRegH( pNode, *pNode, pHistory );
-                        bRet = pNode->SetAttr( aNew ) || bRet;
+                        SwContentNode * pFirstNode(pNode);
+                        if (pLayout && pLayout->IsHideRedlines())
+                        {
+                            pFirstNode = sw::GetFirstAndLastNode(*pLayout, pStt->nNode).first;
+                        }
+                        SwRegHistory aRegH( pFirstNode, *pFirstNode, pHistory );
+                        bRet = pFirstNode->SetAttr( aNew ) || bRet;
                     }
                 }
 
@@ -1309,6 +1395,21 @@ namespace //local functions originally from docfmt.cxx
             }
         }
 
+        SfxItemSet firstSet(pDoc->GetAttrPool(),
+                svl::Items<RES_PAGEDESC, RES_BREAK>{});
+        if (pOtherSet && pOtherSet->Count())
+        {   // actually only RES_BREAK is possible here...
+            firstSet.Put(*pOtherSet);
+        }
+        SfxItemSet propsSet(pDoc->GetAttrPool(),
+            svl::Items<RES_PARATR_BEGIN, RES_PAGEDESC,
+                       RES_BREAK+1, RES_FRMATR_END,
+                       XATTR_FILL_FIRST, XATTR_FILL_LAST+1>{});
+        if (pOtherSet && pOtherSet->Count())
+        {
+            propsSet.Put(*pOtherSet);
+        }
+
         if( !rRg.HasMark() )        // no range
         {
             if( !pNode )
@@ -1387,15 +1488,13 @@ namespace //local functions originally from docfmt.cxx
             }
             if( pOtherSet && pOtherSet->Count() )
             {
-                SwRegHistory aRegH( pNode, *pNode, pHistory );
-
                 // Need to check for unique item for DrawingLayer items of type NameOrIndex
                 // and evtl. correct that item to ensure unique names for that type. This call may
                 // modify/correct entries inside of the given SfxItemSet
                 SfxItemSet aTempLocalCopy(*pOtherSet);
 
                 pDoc->CheckForUniqueItemForLineFillNameOrIndex(aTempLocalCopy);
-                bRet = pNode->SetAttr(aTempLocalCopy) || bRet;
+                bRet = lcl_ApplyOtherSet(*pNode, pHistory, aTempLocalCopy, firstSet, propsSet, pLayout) || bRet;
             }
 
             DELETECHARSETS
@@ -1435,8 +1534,7 @@ namespace //local functions originally from docfmt.cxx
 
                 if( pOtherSet && pOtherSet->Count() )
                 {
-                    SwRegHistory aRegH( pNode, *pNode, pHistory );
-                    bRet = pNode->SetAttr( *pOtherSet ) || bRet;
+                    bRet = lcl_ApplyOtherSet(*pNode, pHistory, *pOtherSet, firstSet, propsSet, pLayout) || bRet;
                 }
 
                 // Only selection in a Node.
@@ -1495,8 +1593,7 @@ namespace //local functions originally from docfmt.cxx
 
                     if( pOtherSet && pOtherSet->Count() )
                     {
-                        SwRegHistory aRegH( pNode, *pNode, pHistory );
-                        pNode->SetAttr( *pOtherSet );
+                        lcl_ApplyOtherSet(*pNode, pHistory, *pOtherSet, firstSet, propsSet, pLayout);
                     }
 
                     ++nNodes;
@@ -1525,18 +1622,23 @@ namespace //local functions originally from docfmt.cxx
             SfxItemState::SET == pCharSet->GetItemState( RES_TXTATR_CHARFMT, false ) ||
             SfxItemState::SET == pCharSet->GetItemState( RES_TXTATR_INETFMT, false ) );
 
-        for(; aSt < aEnd; ++aSt )
+        for (SwNodeIndex current = aSt; current < aEnd; ++current)
         {
-            pNode = aSt.GetNode().GetContentNode();
-            if( !pNode )
+            SwTextNode *const pTNd = current.GetNode().GetTextNode();
+            if (!pTNd)
                 continue;
 
-            SwTextNode* pTNd = pNode->GetTextNode();
+            if (pLayout && pLayout->IsHideRedlines() &&
+                pTNd->GetRedlineMergeFlag() == SwNode::Merge::Hidden)
+            {   // not really sure what to do here, but applying to hidden
+                continue; // nodes doesn't make sense...
+            }
+
             if( pHistory )
             {
-                SwRegHistory aRegH( pNode, *pNode, pHistory );
+                SwRegHistory aRegH( pTNd, *pTNd, pHistory );
 
-                if( pTNd && pCharSet && pCharSet->Count() )
+                if (pCharSet && pCharSet->Count())
                 {
                     SwpHints *pSwpHints = bCreateSwpHints ? &pTNd->GetOrCreateSwpHints()
                                                 : pTNd->GetpSwpHints();
@@ -1547,19 +1649,28 @@ namespace //local functions originally from docfmt.cxx
                     if( pSwpHints )
                         pSwpHints->DeRegister();
                 }
-                if( pOtherSet && pOtherSet->Count() )
-                    pNode->SetAttr( *pOtherSet );
             }
             else
             {
-                if( pTNd && pCharSet && pCharSet->Count() )
+                if (pCharSet && pCharSet->Count())
                     pTNd->SetAttr(*pCharSet, 0, pTNd->GetText().getLength(), nFlags);
-                if( pOtherSet && pOtherSet->Count() )
-                    pNode->SetAttr( *pOtherSet );
             }
             ++nNodes;
         }
 
+        if (pOtherSet && pOtherSet->Count())
+        {
+            for (; aSt < aEnd; ++aSt)
+            {
+                pNode = aSt.GetNode().GetContentNode();
+                if (!pNode)
+                    continue;
+
+                lcl_ApplyOtherSet(*pNode, pHistory, *pOtherSet, firstSet, propsSet, pLayout, &aSt);
+                ++nNodes;
+            }
+        }
+
         //The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
         //which is set in SW MS Word Binary filter WW8ImplRreader. With this flag on, means that
         //current setting attribute set is a character range properties set and comes from a MS Word
@@ -3101,6 +3212,7 @@ bool DocumentContentOperationsManager::InsertPoolItem(
     const SwPaM &rRg,
     const SfxPoolItem &rHt,
     const SetAttrMode nFlags,
+    SwRootFrame const*const pLayout,
     const bool bExpandCharToPara)
 {
     if (utl::ConfigManager::IsFuzzing())
@@ -3116,7 +3228,7 @@ bool DocumentContentOperationsManager::InsertPoolItem(
 
     SfxItemSet aSet( m_rDoc.GetAttrPool(), {{rHt.Which(), rHt.Which()}} );
     aSet.Put( rHt );
-    const bool bRet = lcl_InsAttr( &m_rDoc, rRg, aSet, nFlags, pUndoAttr.get(), bExpandCharToPara );
+    const bool bRet = lcl_InsAttr(&m_rDoc, rRg, aSet, nFlags, pUndoAttr.get(), pLayout, bExpandCharToPara);
 
     if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
     {
@@ -3131,7 +3243,7 @@ bool DocumentContentOperationsManager::InsertPoolItem(
 }
 
 void DocumentContentOperationsManager::InsertItemSet ( const SwPaM &rRg, const SfxItemSet &rSet,
-                            const SetAttrMode nFlags )
+        const SetAttrMode nFlags, SwRootFrame const*const pLayout)
 {
     SwDataChanged aTmp( rRg );
     std::unique_ptr<SwUndoAttr> pUndoAttr;
@@ -3141,7 +3253,7 @@ void DocumentContentOperationsManager::InsertItemSet ( const SwPaM &rRg, const S
         pUndoAttr.reset(new SwUndoAttr( rRg, rSet, nFlags ));
     }
 
-    bool bRet = lcl_InsAttr( &m_rDoc, rRg, rSet, nFlags, pUndoAttr.get() );
+    bool bRet = lcl_InsAttr(&m_rDoc, rRg, rSet, nFlags, pUndoAttr.get(), pLayout);
 
     if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
     {
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index 6e58be8cee1e..964d8ffe1361 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -110,7 +110,7 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags )
             if( rPaM.HasMark() && ( bIsTableMode ||
                 *rPaM.GetPoint() != *rPaM.GetMark() ))
             {
-                GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, rHint, nFlags );
+                GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, rHint, nFlags, GetLayout());
             }
         }
 
@@ -120,7 +120,7 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags )
     {
         if( !HasSelection() )
             UpdateAttr();
-        GetDoc()->getIDocumentContentOperations().InsertPoolItem( *pCursor, rHint, nFlags );
+        GetDoc()->getIDocumentContentOperations().InsertPoolItem(*pCursor, rHint, nFlags, GetLayout());
     }
     EndAllAction();
 }
@@ -141,7 +141,7 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM*
             if( rTmpCursor.HasMark() && ( bIsTableMode ||
                 *rTmpCursor.GetPoint() != *rTmpCursor.GetMark() ))
             {
-                GetDoc()->getIDocumentContentOperations().InsertItemSet(rTmpCursor, rSet, nFlags );
+                GetDoc()->getIDocumentContentOperations().InsertItemSet(rTmpCursor, rSet, nFlags, GetLayout());
             }
         }
 
@@ -151,7 +151,7 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM*
     {
         if( !HasSelection() )
             UpdateAttr();
-        GetDoc()->getIDocumentContentOperations().InsertItemSet( *pCursor, rSet, nFlags );
+        GetDoc()->getIDocumentContentOperations().InsertItemSet(*pCursor, rSet, nFlags, GetLayout());
     }
     EndAllAction();
 }
diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx
index c60676617b78..9ace1f5ecd58 100644
--- a/sw/source/core/inc/DocumentContentOperationsManager.hxx
+++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx
@@ -87,10 +87,13 @@ public:
 
     // Add a para for the char attribute exp...
     bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
-                                const SetAttrMode nFlags = SetAttrMode::DEFAULT, bool bExpandCharToPara=false) override;
+                        const SetAttrMode nFlags = SetAttrMode::DEFAULT,
+                        SwRootFrame const* pLayout = nullptr,
+                        bool bExpandCharToPara=false) override;
 
     void InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
-        const SetAttrMode nFlags = SetAttrMode::DEFAULT) override;
+        const SetAttrMode nFlags = SetAttrMode::DEFAULT,
+        SwRootFrame const* pLayout = nullptr) override;
 
     void RemoveLeadingWhiteSpace(const SwPosition & rPos ) override;
 
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 8b219d2b60b3..e737167c5c1f 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -795,7 +795,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
             {
                 if (rEntry.IsParaEnd())
                 {
-                    pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, true);
+                    pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, nullptr, true);
                 }
                 else
                 {
commit 66bacaa8bc7e9d694436eed6f6a6f10abd9f323d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Nov 19 12:47:59 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:56:38 2018 +0100

    sw_redlinehide_4a: ignore hidden nodes in SwEditShell::GetPaMAttr()
    
    MergeValues would set everything to invalid.
    
    Change-Id: I45795fe9bd113399e276ac42851cbf5a198c9694

diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 65da45aca713..2171a4230115 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -159,7 +159,13 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
             if( pNd )
             {
                 if( pSet != &rSet )
-                    rSet.MergeValues( aSet );
+                {
+                    if (!GetLayout()->IsHideRedlines()
+                        || pNd->GetRedlineMergeFlag() != SwNode::Merge::Hidden)
+                    {
+                        rSet.MergeValues( aSet );
+                    }
+                }
 
                 if( aSet.Count() )
                     aSet.ClearItem();
commit 616b5942d19aeeb1b551150ddf0fca047922ae91
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Nov 19 12:44:46 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:56:38 2018 +0100

    Revert "need some annoying custom set merge here, to handle different"
    
    This reverts commit a31511ddb43310884c7045e988138c976379f273.
    
    too complicated...

diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 95200c04e64f..65da45aca713 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -60,47 +60,6 @@ static sal_uInt16 getMaxLookup()
     return 1000;
 }
 
-static void
-MergeItem(SfxItemSet & rSet, SfxItemSet const& rTempSet, sal_uInt16 const nWhich)
-{
-    SfxPoolItem const*const pItem(rTempSet.GetItem(nWhich, false));
-    if (!pItem || IsInvalidItem(pItem))
-    {
-        rSet.InvalidateItem(nWhich);
-    }
-    else
-    {
-        rSet.MergeValue(*pItem, false);
-    }
-}
-
-static void MergeSet(sw::MergedPara const& rMerged, SwTextNode const& rNode,
-        SfxItemSet & rSet, SfxItemSet const& rTempSet)
-{
-    for (sal_uInt16 const* pWhich = rSet.GetRanges(); *pWhich; ++pWhich)
-    {
-        if (   (RES_PARATR_BEGIN <= *pWhich && RES_FRMATR_END < *pWhich)
-            || (XATTR_FILL_FIRST <= *pWhich && XATTR_FILL_LAST <= *pWhich))
-        {
-            if (*pWhich == RES_BREAK || *pWhich == RES_PAGEDESC)
-            {
-                if (rMerged.pFirstNode == &rNode)
-                {
-                    MergeItem(rSet, rTempSet, *pWhich);
-                }
-            }
-            else if (rMerged.pParaPropsNode == &rNode)
-            {
-                MergeItem(rSet, rTempSet, *pWhich);
-            }
-        }
-        else
-        {
-            MergeItem(rSet, rTempSet, *pWhich);
-        }
-    }
-}
-
 bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
                               const bool bMergeIndentValuesOfNumRule ) const
 {
@@ -173,7 +132,6 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
         for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
         {
             SwNode* pNd = GetDoc()->GetNodes()[ n ];
-            sw::MergedPara const* pMerged(nullptr);
             switch( pNd->GetNodeType() )
             {
             case SwNodeType::Text:
@@ -187,12 +145,6 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
                                                 false, true,
                                                 bMergeIndentValuesOfNumRule,
                                                 GetLayout());
-
-                    SwTextFrame const*const pFrame(GetLayout()->IsHideRedlines() ? static_cast<SwTextFrame const*>(pNd->GetTextNode()->getLayoutFrame(GetLayout())) : nullptr);
-                    if (pFrame)
-                    {
-                        pMerged = pFrame->GetMergedPara();
-                    }
                 }
                 break;
             case SwNodeType::Grf:
@@ -207,19 +159,7 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
             if( pNd )
             {
                 if( pSet != &rSet )
-                {
-                    if (pMerged)
-                    {
-                        if (pNd->GetRedlineMergeFlag() != SwNode::Merge::Hidden)
-                        {
-                            MergeSet(*pMerged, *pNd->GetTextNode(), rSet, aSet);
-                        }
-                    }
-                    else
-                    {
-                        rSet.MergeValues( aSet );
-                    }
-                }
+                    rSet.MergeValues( aSet );
 
                 if( aSet.Count() )
                     aSet.ClearItem();
commit 3deab34dcc741f4177f3d5f07eb8743ea4ab472b
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 16 18:55:37 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:56:38 2018 +0100

    need some annoying custom set merge here, to handle different
    
    items differently.
    
    Change-Id: I89da8fc3272f6126573992bd54bfc5b8bef3de1d

diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 65da45aca713..95200c04e64f 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -60,6 +60,47 @@ static sal_uInt16 getMaxLookup()
     return 1000;
 }
 
+static void
+MergeItem(SfxItemSet & rSet, SfxItemSet const& rTempSet, sal_uInt16 const nWhich)
+{
+    SfxPoolItem const*const pItem(rTempSet.GetItem(nWhich, false));
+    if (!pItem || IsInvalidItem(pItem))
+    {
+        rSet.InvalidateItem(nWhich);
+    }
+    else
+    {
+        rSet.MergeValue(*pItem, false);
+    }
+}
+
+static void MergeSet(sw::MergedPara const& rMerged, SwTextNode const& rNode,
+        SfxItemSet & rSet, SfxItemSet const& rTempSet)
+{
+    for (sal_uInt16 const* pWhich = rSet.GetRanges(); *pWhich; ++pWhich)
+    {
+        if (   (RES_PARATR_BEGIN <= *pWhich && RES_FRMATR_END < *pWhich)
+            || (XATTR_FILL_FIRST <= *pWhich && XATTR_FILL_LAST <= *pWhich))
+        {
+            if (*pWhich == RES_BREAK || *pWhich == RES_PAGEDESC)
+            {
+                if (rMerged.pFirstNode == &rNode)
+                {
+                    MergeItem(rSet, rTempSet, *pWhich);
+                }
+            }
+            else if (rMerged.pParaPropsNode == &rNode)
+            {
+                MergeItem(rSet, rTempSet, *pWhich);
+            }
+        }
+        else
+        {
+            MergeItem(rSet, rTempSet, *pWhich);
+        }
+    }
+}
+
 bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
                               const bool bMergeIndentValuesOfNumRule ) const
 {
@@ -132,6 +173,7 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
         for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
         {
             SwNode* pNd = GetDoc()->GetNodes()[ n ];
+            sw::MergedPara const* pMerged(nullptr);
             switch( pNd->GetNodeType() )
             {
             case SwNodeType::Text:
@@ -145,6 +187,12 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
                                                 false, true,
                                                 bMergeIndentValuesOfNumRule,
                                                 GetLayout());
+
+                    SwTextFrame const*const pFrame(GetLayout()->IsHideRedlines() ? static_cast<SwTextFrame const*>(pNd->GetTextNode()->getLayoutFrame(GetLayout())) : nullptr);
+                    if (pFrame)
+                    {
+                        pMerged = pFrame->GetMergedPara();
+                    }
                 }
                 break;
             case SwNodeType::Grf:
@@ -159,7 +207,19 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
             if( pNd )
             {
                 if( pSet != &rSet )
-                    rSet.MergeValues( aSet );
+                {
+                    if (pMerged)
+                    {
+                        if (pNd->GetRedlineMergeFlag() != SwNode::Merge::Hidden)
+                        {
+                            MergeSet(*pMerged, *pNd->GetTextNode(), rSet, aSet);
+                        }
+                    }
+                    else
+                    {
+                        rSet.MergeValues( aSet );
+                    }
+                }
 
                 if( aSet.Count() )
                     aSet.ClearItem();
commit 645f57b47d295e4291d68dea6ec74a2293b59b5f
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 16 18:52:32 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:56:38 2018 +0100

    sw_redlinehide_4a: add layout to SwTextNode::GetParaAttr()
    
    Merge items from first-node and props-node, as they are used in the
    text formatting.
    
    Change-Id: I4cbab55bc3b0f8bc6dc5bd3577da53b3160018a3

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 0818fde96434..64eef11f9221 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -305,7 +305,8 @@ public:
     bool GetParaAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
                   const bool bOnlyTextAttr  = false,
                   const bool bGetFromChrFormat = true,
-                  const bool bMergeIndentValuesOfNumRule = false ) const;
+                  const bool bMergeIndentValuesOfNumRule = false,
+                  SwRootFrame const* pLayout = nullptr) const;
 
     /// Convey attributes of an AttrSet (AutoFormat) to SwpHintsArray.
     void FormatToTextAttr( SwTextNode* pNd );
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 5fe78b683964..65da45aca713 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -143,7 +143,8 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
 
                     static_cast<SwTextNode*>(pNd)->GetParaAttr(*pSet, nStt, nEnd,
                                                 false, true,
-                                                bMergeIndentValuesOfNumRule );
+                                                bMergeIndentValuesOfNumRule,
+                                                GetLayout());
                 }
                 break;
             case SwNodeType::Grf:
diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx
index 6816bd84172a..a2142249b5c7 100644
--- a/sw/source/core/edit/edfmt.cxx
+++ b/sw/source/core/edit/edfmt.cxx
@@ -93,7 +93,7 @@ void SwEditShell::FillByEx(SwCharFormat* pCharFormat)
 
         SfxItemSet aSet( mxDoc->GetAttrPool(),
                             pCharFormat->GetAttrSet().GetRanges() );
-        pTextNode->GetParaAttr( aSet, nStt, nEnd );
+        pTextNode->GetParaAttr(aSet, nStt, nEnd, false, true, false, GetLayout());
         pCharFormat->SetFormatAttr( aSet );
     }
     else if( pCNd->HasSwAttrSet() )
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index c319d135d93f..142cbe61ab09 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -65,6 +65,7 @@
 #include <pam.hxx>
 #include <ndtxt.hxx>
 #include <txtfrm.hxx>
+#include <rootfrm.hxx>
 #include <rolbck.hxx>
 #include <ddefld.hxx>
 #include <docufld.hxx>
@@ -2050,18 +2051,68 @@ static void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTextNode& rTextNode,
 // request the attributes of the TextNode at the range
 bool SwTextNode::GetParaAttr(SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
                          const bool bOnlyTextAttr, const bool bGetFromChrFormat,
-                         const bool bMergeIndentValuesOfNumRule ) const
+                         const bool bMergeIndentValuesOfNumRule,
+                         SwRootFrame const*const pLayout) const
 {
     assert(!rSet.Count()); // handled inconsistently, typically an error?
 
+    if (pLayout && pLayout->IsHideRedlines())
+    {
+        if (GetRedlineMergeFlag() == SwNode::Merge::Hidden)
+        {
+            return false; // ignore deleted node
+        }
+    }
+
     // get the node's automatic attributes
     SfxItemSet aFormatSet( *rSet.GetPool(), rSet.GetRanges() );
     if (!bOnlyTextAttr)
     {
+        SwTextNode const* pParaPropsNode(this);
         SwContentNode::GetAttr( aFormatSet );
-        if ( bMergeIndentValuesOfNumRule )
+        if (pLayout && pLayout->IsHideRedlines())
+        {
+            if (sw::MergedPara const*const pMerged =
+                static_cast<SwTextFrame*>(getLayoutFrame(pLayout))->GetMergedPara())
+            {
+                if (pMerged->pFirstNode != this)
+                {
+                    aFormatSet.ClearItem(RES_PAGEDESC);
+                    aFormatSet.ClearItem(RES_BREAK);
+                    static_assert(RES_PAGEDESC + 1 == sal_uInt16(RES_BREAK));
+                    SfxItemSet firstSet(*rSet.GetPool(),
+                            svl::Items<RES_PAGEDESC, RES_BREAK>{});
+                    pMerged->pFirstNode->SwContentNode::GetAttr(firstSet);
+                    aFormatSet.Put(firstSet);
+
+                }
+                if (pMerged->pParaPropsNode != this)
+                {
+                    for (sal_uInt16 i = RES_PARATR_BEGIN; i != RES_FRMATR_END; ++i)
+                    {
+                        if (i != RES_PAGEDESC && i != RES_BREAK)
+                        {
+                            aFormatSet.ClearItem(i);
+                        }
+                    }
+                    for (sal_uInt16 i = XATTR_FILL_FIRST; i <= XATTR_FILL_LAST; ++i)
+                    {
+                        aFormatSet.ClearItem(i);
+                    }
+                    SfxItemSet propsSet(*rSet.GetPool(),
+                        svl::Items<RES_PARATR_BEGIN, RES_PAGEDESC,
+                                   RES_BREAK+1, RES_FRMATR_END,
+                                   XATTR_FILL_FIRST, XATTR_FILL_LAST+1>{});
+                    pMerged->pParaPropsNode->SwContentNode::GetAttr(propsSet);
+                    aFormatSet.Put(propsSet);
+                    pParaPropsNode = pMerged->pParaPropsNode;
+                }
+                // keep all the CHRATR/UNKNOWNATR anyway...
+            }
+        }
+        if (bMergeIndentValuesOfNumRule)
         {
-            lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFormatSet );
+            lcl_MergeListLevelIndentAsLRSpaceItem(*pParaPropsNode, aFormatSet);
         }
     }
 
commit 67763597792f32cdc0ea6fff27ac7367aba27f93
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 16 16:45:20 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:56:38 2018 +0100

    rename to GetParaAttr, at least that's unique
    
    Change-Id: I1de6b544a4868f0d30077ba2c6d195bffd2e8b00

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 8fd2c5449f7b..0818fde96434 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -302,7 +302,7 @@ public:
        the requested item set as a LR-SPACE item, if <bOnlyTextAttr> == false,
        corresponding node has not its own indent attributes and the
        position-and-space mode of the list level is SvxNumberFormat::LABEL_ALIGNMENT. */
-    bool GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
+    bool GetParaAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
                   const bool bOnlyTextAttr  = false,
                   const bool bGetFromChrFormat = true,
                   const bool bMergeIndentValuesOfNumRule = false ) const;
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 82867e7ea21a..fb399694ed9d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -2402,7 +2402,7 @@ void SwUiWriterTest::testTdf72788()
     rIDCO.InsertPoolItem(*pCursor, aWeightItem);
     SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT>{});
     //Add selected text's attributes to aSet
-    pCursor->GetNode().GetTextNode()->GetAttr(aSet, 5, 12);
+    pCursor->GetNode().GetTextNode()->GetParaAttr(aSet, 5, 12);
     SfxPoolItem const * pPoolItem = aSet.GetItem(RES_CHRATR_WEIGHT);
     //Check that bold is active on the selection and it's in aSet
     CPPUNIT_ASSERT_EQUAL(true, (*pPoolItem == aWeightItem));
@@ -2423,7 +2423,7 @@ void SwUiWriterTest::testTdf72788()
     //In case of Regression RstTextAttr() call will result to infinite recursion
     //Check that bold is removed in first paragraph
     aSet.ClearItem();
-    pTextNode->GetAttr(aSet, 5, 12);
+    pTextNode->GetParaAttr(aSet, 5, 12);
     SfxPoolItem const * pPoolItem2 = aSet.GetItem(RES_CHRATR_WEIGHT);
     CPPUNIT_ASSERT_EQUAL(true, (*pPoolItem2 != aWeightItem));
 }
@@ -3661,7 +3661,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + u"foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
     SfxPoolItem const* pItem;
     SfxItemSet query(pDoc->GetAttrPool(), svl::Items<RES_CHRATR_HIDDEN, RES_CHRATR_HIDDEN>{});
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 1, 4);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
     query.ClearItem(RES_CHRATR_HIDDEN);
@@ -3672,7 +3672,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
     CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 0, 1);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
     rUndoManager.Undo();
@@ -3681,10 +3681,10 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
     CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + u"foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 0, 1);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 1, 4);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
     query.ClearItem(RES_CHRATR_HIDDEN);
@@ -3692,7 +3692,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
     CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 0, 1);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
     rUndoManager.Undo();
@@ -3701,10 +3701,10 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
     CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + u"foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 0, 1);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 1, 4);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
     query.ClearItem(RES_CHRATR_HIDDEN);
@@ -3715,7 +3715,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
     CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 4, 5);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
     rUndoManager.Undo();
@@ -3724,10 +3724,10 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
     CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + u"foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 4, 5);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 1, 4);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
     query.ClearItem(RES_CHRATR_HIDDEN);
@@ -3735,7 +3735,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
     CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 4, 5);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
     rUndoManager.Undo();
@@ -3744,10 +3744,10 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
     CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
     CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + u"foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 4, 5);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     query.ClearItem(RES_CHRATR_HIDDEN);
-    pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+    pShell->GetCursor()->GetNode().GetTextNode()->GetParaAttr(query, 1, 4);
     CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
     CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
     query.ClearItem(RES_CHRATR_HIDDEN);
@@ -3775,7 +3775,7 @@ void SwUiWriterTest::testUndoCharAttribute()
     rIDCO.InsertPoolItem(*pCursor, aWeightItem);
     SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT>{});
     // Adds selected text's attributes to aSet
-    pCursor->GetNode().GetTextNode()->GetAttr(aSet, 10, 19);
+    pCursor->GetNode().GetTextNode()->GetParaAttr(aSet, 10, 19);
     SfxPoolItem const * pPoolItem = aSet.GetItem(RES_CHRATR_WEIGHT);
     // Check that bold is active on the selection; checks if it's in aSet
     CPPUNIT_ASSERT_EQUAL(true, (*pPoolItem == aWeightItem));
@@ -3783,7 +3783,7 @@ void SwUiWriterTest::testUndoCharAttribute()
     rUndoManager.Undo();
     // Check that bold is no longer active
     aSet.ClearItem(RES_CHRATR_WEIGHT);
-    pCursor->GetNode().GetTextNode()->GetAttr(aSet, 10, 19);
+    pCursor->GetNode().GetTextNode()->GetParaAttr(aSet, 10, 19);
     pPoolItem = aSet.GetItem(RES_CHRATR_WEIGHT);
     CPPUNIT_ASSERT_EQUAL(false, (*pPoolItem == aWeightItem));
 }
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 72e0c5f81547..2727b3e39274 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3991,7 +3991,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt
                 SfxItemSet aSet( m_rDoc.GetAttrPool(),
                             svl::Items<RES_CHRATR_BEGIN,     RES_TXTATR_WITHEND_END - 1,
                             RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1>{} );
-                pTextNd->GetAttr( aSet, nStt+1, nStt+1 );
+                pTextNd->GetParaAttr( aSet, nStt+1, nStt+1 );
 
                 aSet.ClearItem( RES_TXTATR_REFMARK );
                 aSet.ClearItem( RES_TXTATR_TOXMARK );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index ccebf3bfac0b..59960e71e700 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1817,7 +1817,7 @@ void SwDoc::SetFormatItemByAutoFormat( const SwPaM& rPam, const SfxItemSet& rSet
     }
     whichIds.push_back(0);
     SfxItemSet currentSet(GetAttrPool(), &whichIds[0]);
-    pTNd->GetAttr(currentSet, nEnd, nEnd);
+    pTNd->GetParaAttr(currentSet, nEnd, nEnd);
     for (size_t i = 0; whichIds[i]; i += 2)
     {   // yuk - want to explicitly set the pool defaults too :-/
         currentSet.Put(currentSet.Get(whichIds[i]));
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index f5dbd66c27a4..a78c94942ec8 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -471,7 +471,7 @@ void SwDontExpandItem::SaveDontExpandItems( const SwPosition& rPos )
         pDontExpItems.reset( new SfxItemSet( const_cast<SwDoc*>(pTextNd->GetDoc())->GetAttrPool(),
                                             aCharFormatSetRange ) );
         const sal_Int32 n = rPos.nContent.GetIndex();
-        if( !pTextNd->GetAttr( *pDontExpItems, n, n,
+        if (!pTextNd->GetParaAttr( *pDontExpItems, n, n,
                                 n != pTextNd->GetText().getLength() ))
         {
             pDontExpItems.reset();
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index e80ef6f109e1..5fe78b683964 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -141,7 +141,7 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
                         ? nEndCnt
                         : pNd->GetTextNode()->GetText().getLength();
 
-                    static_cast<SwTextNode*>(pNd)->GetAttr( *pSet, nStt, nEnd,
+                    static_cast<SwTextNode*>(pNd)->GetParaAttr(*pSet, nStt, nEnd,
                                                 false, true,
                                                 bMergeIndentValuesOfNumRule );
                 }
diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx
index 81722996aba6..6816bd84172a 100644
--- a/sw/source/core/edit/edfmt.cxx
+++ b/sw/source/core/edit/edfmt.cxx
@@ -93,7 +93,7 @@ void SwEditShell::FillByEx(SwCharFormat* pCharFormat)
 
         SfxItemSet aSet( mxDoc->GetAttrPool(),
                             pCharFormat->GetAttrSet().GetRanges() );
-        pTextNode->GetAttr( aSet, nStt, nEnd );
+        pTextNode->GetParaAttr( aSet, nStt, nEnd );
         pCharFormat->SetFormatAttr( aSet );
     }
     else if( pCNd->HasSwAttrSet() )
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 964d9d5d150f..d3787483c85b 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -1000,7 +1000,7 @@ sal_Int32 SwGetExpField::GetReferenceTextPos( const SwFormatField& rFormat, SwDo
             0, 0
         };
         SwAttrSet aSet(rDoc.GetAttrPool(), nIds);
-        rTextNode.GetAttr(aSet, nRet, nRet+1);
+        rTextNode.GetParaAttr(aSet, nRet, nRet+1);
 
         if( RTL_TEXTENCODING_SYMBOL != static_cast<const SvxFontItem&>(aSet.Get(
                 GetWhichOfScript( RES_CHRATR_FONT, nSrcpt )) ).GetCharSet() )
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d4e30e17c05c..8d721140cb37 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -5285,7 +5285,7 @@ void SwTextNode::dumpAsXml(xmlTextWriterPtr pWriter) const
 sal_uInt32 SwTextNode::GetRsid( sal_Int32 nStt, sal_Int32 nEnd ) const
 {
     SfxItemSet aSet( const_cast<SfxItemPool&>(static_cast<SfxItemPool const &>(GetDoc()->GetAttrPool())), svl::Items<RES_CHRATR_RSID, RES_CHRATR_RSID>{} );
-    if ( GetAttr(aSet, nStt, nEnd) )
+    if (GetParaAttr(aSet, nStt, nEnd))
     {
         const SvxRsidItem* pRsid = aSet.GetItem<SvxRsidItem>(RES_CHRATR_RSID);
         if( pRsid )
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index c2d9d1f09569..c319d135d93f 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2048,7 +2048,7 @@ static void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTextNode& rTextNode,
 }
 
 // request the attributes of the TextNode at the range
-bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
+bool SwTextNode::GetParaAttr(SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
                          const bool bOnlyTextAttr, const bool bGetFromChrFormat,
                          const bool bMergeIndentValuesOfNumRule ) const
 {
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 80ef021dddfb..b2ddbe1e1997 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -405,7 +405,7 @@ void SwUnoCursorHelper::GetCursorAttr(SwPaM & rPam,
                     const sal_Int32 nEnd   = (n == nEndNd)
                         ? rEnd.nContent.GetIndex()
                         : pNd->GetTextNode()->GetText().getLength();
-                    pNd->GetTextNode()->GetAttr(*pSet, nStart, nEnd, bOnlyTextAttr, bGetFromChrFormat);
+                    pNd->GetTextNode()->GetParaAttr(*pSet, nStart, nEnd, bOnlyTextAttr, bGetFromChrFormat);
                 }
                 break;
 
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 4c5911e72090..c28ff7c8b27a 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -332,7 +332,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField,
                                    RES_CHRATR_POSTURE, RES_CHRATR_POSTURE,
                                    RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT,
                                    RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT>{} );
-        rTextNd.GetAttr( aScriptItemSet, nFieldPos, nFieldPos+1 );
+        rTextNd.GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
 
         sal_uInt16 aWesternWhichIds[4] =
             { RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f0ab7e1ed7c4..6453b5b7e640 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2100,7 +2100,8 @@ static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, sal_Int32 nR
             if( pCNd && pCNd->IsTextNode())
             {
                 SfxItemSet aCoreSet(rDoc.GetAttrPool(), svl::Items<RES_CHRATR_ROTATE, RES_CHRATR_ROTATE>{});
-                static_cast<const SwTextNode*>(pCNd)->GetAttr( aCoreSet, 0, static_cast<const SwTextNode*>(pCNd)->GetText().getLength());
+                static_cast<const SwTextNode*>(pCNd)->GetParaAttr(aCoreSet,
+                    0, static_cast<const SwTextNode*>(pCNd)->GetText().getLength());
                 const SfxPoolItem * pRotItem;
                 if ( SfxItemState::SET == aCoreSet.GetItemState(RES_CHRATR_ROTATE, true, &pRotItem))
                 {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index b50e12003daa..44b4825528cb 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3414,7 +3414,7 @@ void WW8Export::WriteFootnoteBegin( const SwFormatFootnote& rFootnote, ww::bytes
 
             pCFormat = pInfo->GetCharFormat( *m_pDoc );
 
-            pTextFootnote->GetTextNode().GetAttr(aSet,
+            pTextFootnote->GetTextNode().GetParaAttr(aSet,
                 pTextFootnote->GetStart(), pTextFootnote->GetStart() + 1, true);
             if (aSet.Count())
             {
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 19171a4c8c6a..b1174771c554 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1494,7 +1494,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos,
             {
                 const sal_Int32 nPos = rPos.nContent.GetIndex();
                 m_xScratchSet.reset(new SfxItemSet(pDoc->GetAttrPool(), {{nWhich, nWhich}}));
-                if (pNd->GetTextNode()->GetAttr(*m_xScratchSet, nPos, nPos))
+                if (pNd->GetTextNode()->GetParaAttr(*m_xScratchSet, nPos, nPos))
                     pItem = m_xScratchSet->GetItem(nWhich);
             }
 
commit f20ab0f5928cafbace99888b4be05839904e70b1
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 16 16:44:41 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:55:56 2018 +0100

    simplify SwTextNode::GetAttr()
    
    Change-Id: I78d32031ebc42d749dbc750b7127983810bbfb1d

diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index f021b17b3a28..c2d9d1f09569 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2054,6 +2054,17 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
 {
     assert(!rSet.Count()); // handled inconsistently, typically an error?
 
+    // get the node's automatic attributes
+    SfxItemSet aFormatSet( *rSet.GetPool(), rSet.GetRanges() );
+    if (!bOnlyTextAttr)
+    {
+        SwContentNode::GetAttr( aFormatSet );
+        if ( bMergeIndentValuesOfNumRule )
+        {
+            lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFormatSet );
+        }
+    }
+
     if( HasHints() )
     {
         // First, check which text attributes are valid in the range.
@@ -2071,17 +2082,6 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
             = bGetFromChrFormat ? &lcl_MergeAttr_ExpandChrFormat
                              : &lcl_MergeAttr;
 
-        // get the node's automatic attributes
-        SfxItemSet aFormatSet( *rSet.GetPool(), rSet.GetRanges() );
-        if( !bOnlyTextAttr )
-        {
-            SwContentNode::GetAttr( aFormatSet );
-            if ( bMergeIndentValuesOfNumRule )
-            {
-                lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFormatSet );
-            }
-        }
-
         const size_t nSize = m_pSwpHints->Count();
 
         if (nStt == nEnd)               // no range:
@@ -2249,18 +2249,13 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
         {
             // remove all from the format-set that are also set in the text-set
             aFormatSet.Differentiate( rSet );
-            // now "merge" everything
-            rSet.Put( aFormatSet );
         }
     }
-    else if( !bOnlyTextAttr )
+
+    if (aFormatSet.Count())
     {
-        // get the node's automatic attributes
-        SwContentNode::GetAttr( rSet );
-        if ( bMergeIndentValuesOfNumRule )
-        {
-            lcl_MergeListLevelIndentAsLRSpaceItem( *this, rSet );
-        }
+        // now "merge" everything
+        rSet.Put( aFormatSet );
     }
 
     return rSet.Count() != 0;
commit 3a3b674bdb1457445e12c2d3b51dd092e33b5d0c
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 16 16:26:38 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Nov 20 11:55:46 2018 +0100

    sw: SwTextNode::GetAttr() inconsistency
    
    If there are hints, the aFormatSet.Differentiate(rSet) will cause the
    pre-existing items in the parameter rSet to win, whereas without hints
    the SwContentNode::GetAttr() calls rSet.Set() which clears everything.
    
    It looks like WW8Export::WriteFootnoteBegin() was sort of relying on
    this; presumably it wants the pCFormat to win over node's items but
    hints on the position to win over pCFormat.  Well that's what it
    currently gets anyway, so try to preserve that.
    
    The other use in SwUnoCursorHelper::SetPropertyValues() looks like an
    oversight.
    
    Change-Id: I80e18e040413fcf26f6f77844ed731de31a464d2

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index b711a3cbbd90..82867e7ea21a 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -2422,6 +2422,7 @@ void SwUiWriterTest::testTdf72788()
     pTextNode->RstTextAttr(aSt, nEnd - aSt.GetIndex());
     //In case of Regression RstTextAttr() call will result to infinite recursion
     //Check that bold is removed in first paragraph
+    aSet.ClearItem();
     pTextNode->GetAttr(aSet, 5, 12);
     SfxPoolItem const * pPoolItem2 = aSet.GetItem(RES_CHRATR_WEIGHT);
     CPPUNIT_ASSERT_EQUAL(true, (*pPoolItem2 != aWeightItem));
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 66ef3ede1721..e849a7ffa4dd 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -85,6 +85,7 @@ void SwUiWriterTest2::testTdf101534()
     pWrtShell->EndPara(/*bSelect=*/false);
     TransferableDataHelper aHelper(pTransfer.get());
     SwTransferable::Paste(*pWrtShell, aHelper);
+    aSet.ClearItem();
     pWrtShell->GetCurAttr(aSet);
     // This failed, direct formatting was lost.
     CPPUNIT_ASSERT(aSet.HasItem(RES_LR_SPACE));
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index e467a79f7634..f021b17b3a28 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2052,6 +2052,8 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
                          const bool bOnlyTextAttr, const bool bGetFromChrFormat,
                          const bool bMergeIndentValuesOfNumRule ) const
 {
+    assert(!rSet.Count()); // handled inconsistently, typically an error?
+
     if( HasHints() )
     {
         // First, check which text attributes are valid in the range.
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 1f8613046c36..342cac0ab623 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1827,7 +1827,10 @@ void SwUnoCursorHelper::SetPropertyValues(
 
             // we need to get up-to-date item set from nodes
             if (i == 0 || bPreviousPropertyCausesSideEffectsInNodes)
+            {
+                aItemSet.ClearItem();
                 SwUnoCursorHelper::GetCursorAttr(rPaM, aItemSet);
+            }
 
             const uno::Any &rValue = rPropertyValues[i].Value;
             // this can set some attributes in nodes' mpAttrSet
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d8411eed8796..b50e12003daa 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3413,11 +3413,17 @@ void WW8Export::WriteFootnoteBegin( const SwFormatFootnote& rFootnote, ww::bytes
                                                   RES_CHRATR_FONT>{} );
 
             pCFormat = pInfo->GetCharFormat( *m_pDoc );
-            aSet.Set( pCFormat->GetAttrSet() );
 
-            pTextFootnote->GetTextNode().GetAttr( aSet, pTextFootnote->GetStart(),
-                                            (pTextFootnote->GetStart()) + 1 );
-            m_pAttrOutput->OutputItem( aSet.Get( RES_CHRATR_FONT ) );
+            pTextFootnote->GetTextNode().GetAttr(aSet,
+                pTextFootnote->GetStart(), pTextFootnote->GetStart() + 1, true);
+            if (aSet.Count())
+            {
+                m_pAttrOutput->OutputItem( aSet.Get( RES_CHRATR_FONT ) );
+            }
+            else
+            {
+                m_pAttrOutput->OutputItem( pCFormat->GetAttrSet().Get(RES_CHRATR_FONT) );
+            }
             pO = pOld;
         }
         m_pChpPlc->AppendFkpEntry( Strm().Tell(), aOutArr.size(),
commit ab304328049c62ddc634068e37eaab970e6d0519
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Nov 19 12:21:59 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Nov 19 12:37:42 2018 +0100

    sw_redlinehide_4a: the SwTextNode item set contains XATTR_FILL too
    
    ... so handle them as well in SwTextFrame::SwClientNotify().
    
    Change-Id: Ifa8bf8f44bcd08a64dc36939bad58efefbd7af55

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index bc5f6e9cfa0f..70d34dc4ff91 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2344,6 +2344,11 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint)
                                 aNewSet.ClearItem(i);
                             }
                         }
+                        for (sal_uInt16 i = XATTR_FILL_FIRST; i <= XATTR_FILL_LAST; ++i)
+                        {
+                            aOldSet.ClearItem(i);
+                            aNewSet.ClearItem(i);
+                        }
                     }
                     if (m_pMergedPara && m_pMergedPara->pFirstNode != &rModify)
                     {


More information about the Libreoffice-commits mailing list