Kaydet (Commit) c253dde8 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 2ad1767c
......@@ -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
*/
......
......@@ -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();
}
......
......@@ -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;
......@@ -117,6 +120,7 @@ public:
SwHistory* pHistory;
const SwPosition *pSttNd, *pEndNd;
const SfxItemSet* pDelSet;
SwRootFrame const*const pLayout;
sal_uInt16 nWhich;
bool bReset;
bool bResetListAttrs; // #i62575#
......@@ -126,12 +130,14 @@ public:
bool bExactRange;
ParaRstFormat(const SwPosition* pStt, const SwPosition* pEnd,
SwHistory* pHst, const SfxItemSet* pSet = nullptr)
SwHistory* pHst, const SfxItemSet* pSet = nullptr,
SwRootFrame const*const pLay = nullptr)
: pFormatColl(nullptr)
, pHistory(pHst)
, pSttNd(pStt)
, pEndNd(pEnd)
, pDelSet(pSet)
, pLayout(pLay)
, nWhich(0)
, bReset(false) // #i62675#
, bResetListAttrs(false)
......
......@@ -796,7 +796,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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment