summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-20 14:37:40 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-30 12:38:20 +0100
commit8ca0a74e40555af503b7d254161975944079ddd2 (patch)
tree4968d17b29221e7260d805f3c0bcf42aee165125
parentbe45361ce49a39307017b9a562af5e619869bb12 (diff)
sw_redlinehide_4a: adapt SwEditShell::SetTextFormatColl()
Skip hidden nodes, apply to properties-node. Change-Id: I9c511e87c431bd39dc6efdcddf2cad9bbf18c592
-rw-r--r--sw/inc/doc.hxx3
-rw-r--r--sw/source/core/doc/docfmt.cxx18
-rw-r--r--sw/source/core/edit/edattr.cxx1
-rw-r--r--sw/source/core/edit/edfcol.cxx2
4 files changed, 20 insertions, 4 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 1230304fae5e..196bea0a202d 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -782,7 +782,8 @@ public:
that <bReset = true> and the paragraph style has a list style attribute set. */
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat,
const bool bReset = true,
- const bool bResetListAttrs = false);
+ const bool bResetListAttrs = false,
+ SwRootFrame const* pLayout = nullptr);
SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const
{ return static_cast<SwTextFormatColl*>(FindFormatByName( *mpTextFormatCollTable, rName )); }
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 59960e71e700..116e170cc124 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1008,6 +1008,18 @@ static bool lcl_SetTextFormatColl( const SwNodePtr& rpNode, void* pArgs )
sw::DocumentContentOperationsManager::ParaRstFormat* pPara = static_cast<sw::DocumentContentOperationsManager::ParaRstFormat*>(pArgs);
+ if (pPara->pLayout && pPara->pLayout->IsHideRedlines())
+ {
+ if (pCNd->GetRedlineMergeFlag() == SwNode::Merge::Hidden)
+ {
+ return true;
+ }
+ if (pCNd->IsTextNode())
+ {
+ pCNd = sw::GetParaPropsNode(*pPara->pLayout, SwNodeIndex(*pCNd));
+ }
+ }
+
SwTextFormatColl* pFormat = static_cast<SwTextFormatColl*>(pPara->pFormatColl);
if ( pPara->bReset )
{
@@ -1070,7 +1082,8 @@ static bool lcl_SetTextFormatColl( const SwNodePtr& rpNode, void* pArgs )
bool SwDoc::SetTextFormatColl(const SwPaM &rRg,
SwTextFormatColl *pFormat,
const bool bReset,
- const bool bResetListAttrs)
+ const bool bResetListAttrs,
+ SwRootFrame const*const pLayout)
{
SwDataChanged aTmp( rRg );
const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
@@ -1086,7 +1099,8 @@ bool SwDoc::SetTextFormatColl(const SwPaM &rRg,
GetIDocumentUndoRedo().AppendUndo(std::move(pUndo));
}
- sw::DocumentContentOperationsManager::ParaRstFormat aPara( pStt, pEnd, pHst );
+ sw::DocumentContentOperationsManager::ParaRstFormat aPara(
+ pStt, pEnd, pHst, nullptr, pLayout);
aPara.pFormatColl = pFormat;
aPara.bReset = bReset;
// #i62675#
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 2171a4230115..4f3e26de89b5 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -293,6 +293,7 @@ SwTextFormatColl* SwEditShell::GetPaMTextFormatColl( SwPaM* pPaM ) const
std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell::GetItemWithPaM( sal_uInt16 nWhich )
{
+ assert(isCHRATR(nWhich)); // sw_redlinehide: only thing that works
std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> vItem;
for(SwPaM& rCurrentPaM : GetCursor()->GetRingContainer())
{ // for all the point and mark (selections)
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 5da40eb2555b..3a4f94d280fd 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -2168,7 +2168,7 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
if ( !rPaM.HasReadonlySel( GetViewOptions()->IsFormView() ) )
{
// Change the paragraph style to pLocal and remove all direct paragraph formatting.
- GetDoc()->SetTextFormatColl( rPaM, pLocal, true, bResetListAttrs );
+ GetDoc()->SetTextFormatColl(rPaM, pLocal, true, bResetListAttrs, GetLayout());
// If there are hints on the nodes which cover the whole node, then remove those, too.
SwPaM aPaM(*rPaM.Start(), *rPaM.End());