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; ...@@ -37,6 +37,7 @@ class SwFrameFormat;
class SwDrawFrameFormat; class SwDrawFrameFormat;
class SwFlyFrameFormat; class SwFlyFrameFormat;
class SwNodeIndex; class SwNodeIndex;
class SwRootFrame;
namespace utl { class TransliterationWrapper; } namespace utl { class TransliterationWrapper; }
namespace svt { class EmbeddedObjectRef; } namespace svt { class EmbeddedObjectRef; }
...@@ -212,10 +213,13 @@ public: ...@@ -212,10 +213,13 @@ public:
false. false.
*/ */
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&, 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&, 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 /** Removes any leading white space from the paragraph
*/ */
......
...@@ -110,7 +110,7 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags ) ...@@ -110,7 +110,7 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags )
if( rPaM.HasMark() && ( bIsTableMode || if( rPaM.HasMark() && ( bIsTableMode ||
*rPaM.GetPoint() != *rPaM.GetMark() )) *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 ) ...@@ -120,7 +120,7 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags )
{ {
if( !HasSelection() ) if( !HasSelection() )
UpdateAttr(); UpdateAttr();
GetDoc()->getIDocumentContentOperations().InsertPoolItem( *pCursor, rHint, nFlags ); GetDoc()->getIDocumentContentOperations().InsertPoolItem(*pCursor, rHint, nFlags, GetLayout());
} }
EndAllAction(); EndAllAction();
} }
...@@ -141,7 +141,7 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM* ...@@ -141,7 +141,7 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM*
if( rTmpCursor.HasMark() && ( bIsTableMode || if( rTmpCursor.HasMark() && ( bIsTableMode ||
*rTmpCursor.GetPoint() != *rTmpCursor.GetMark() )) *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* ...@@ -151,7 +151,7 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM*
{ {
if( !HasSelection() ) if( !HasSelection() )
UpdateAttr(); UpdateAttr();
GetDoc()->getIDocumentContentOperations().InsertItemSet( *pCursor, rSet, nFlags ); GetDoc()->getIDocumentContentOperations().InsertItemSet(*pCursor, rSet, nFlags, GetLayout());
} }
EndAllAction(); EndAllAction();
} }
......
...@@ -87,10 +87,13 @@ public: ...@@ -87,10 +87,13 @@ public:
// Add a para for the char attribute exp... // Add a para for the char attribute exp...
bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&, 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&, 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; void RemoveLeadingWhiteSpace(const SwPosition & rPos ) override;
...@@ -117,6 +120,7 @@ public: ...@@ -117,6 +120,7 @@ public:
SwHistory* pHistory; SwHistory* pHistory;
const SwPosition *pSttNd, *pEndNd; const SwPosition *pSttNd, *pEndNd;
const SfxItemSet* pDelSet; const SfxItemSet* pDelSet;
SwRootFrame const*const pLayout;
sal_uInt16 nWhich; sal_uInt16 nWhich;
bool bReset; bool bReset;
bool bResetListAttrs; // #i62575# bool bResetListAttrs; // #i62575#
...@@ -126,12 +130,14 @@ public: ...@@ -126,12 +130,14 @@ public:
bool bExactRange; bool bExactRange;
ParaRstFormat(const SwPosition* pStt, const SwPosition* pEnd, 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) : pFormatColl(nullptr)
, pHistory(pHst) , pHistory(pHst)
, pSttNd(pStt) , pSttNd(pStt)
, pEndNd(pEnd) , pEndNd(pEnd)
, pDelSet(pSet) , pDelSet(pSet)
, pLayout(pLay)
, nWhich(0) , nWhich(0)
, bReset(false) // #i62675# , bReset(false) // #i62675#
, bResetListAttrs(false) , bResetListAttrs(false)
......
...@@ -796,7 +796,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, ...@@ -796,7 +796,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
{ {
if (rEntry.IsParaEnd()) if (rEntry.IsParaEnd())
{ {
pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, true); pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, nullptr, true);
} }
else 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