34 #include <viewimp.hxx>
85 bool bNewFlyPor =
false;
86 sal_uInt16 subType = 0;
100 bool const bInClipboard( pDoc ==
nullptr || pDoc->IsClipBoard() );
101 bool bPlaceHolder =
false;
121 OUString
const aStr( bName
132 &static_txtattr_cast<SwTextField const*>(pHint)->GetTextNode());
135 OUString
const aStr( bName
148 OUString
const aStr( bName
166 sal_uInt16 nNumPages = pTmpRootFrame->
GetPageNum();
171 ->ChangeExpansion(nVirtNum, nNumPages);
173 bVirt, nNumFormat !=
SvxNumType(-1) ? &nNumFormat :
nullptr);
176 OUString
const aStr( bName
193 *static_txtattr_cast<SwTextField const*>(pHint));
199 *static_txtattr_cast<SwTextField const*>(pHint));
204 OUString
const aStr( bName
219 OUString
const aStr( bName
230 static_txtattr_cast<SwTextField const*>(pHint));
233 OUString
const aStr( bName
249 OUString
const str( bName
262 OUString
const str( bName
274 OUString
const aStr( bName
283 std::unique_ptr<SwFont> pTmpFnt;
289 OUString
const aStr( bName
292 pRet =
new SwFieldPortion(aStr, std::move(pTmpFnt), bPlaceHolder);
301 static_cast<SwFormatMeta &>(rHint.
GetAttr()).GetMeta() );
303 ::sw::MetaField *
const pField( dynamic_cast< ::sw::MetaField * >(pMeta) );
304 OSL_ENSURE(pField,
"lcl_NewMetaPortion: no meta field?");
308 pField->
GetPrefixAndSuffix(bPrefix ? &fix :
nullptr, bPrefix ?
nullptr : &fix, &color);
338 SwTextAttr & rHint(const_cast<SwTextAttr&>(*pHint));
372 switch( pHint->
Which() )
428 std::shared_ptr<SfxItemSet> pSet(rListAutoFormat.GetStyleHandle());
432 if (!isDOCX && !pSet)
437 for (
SwTextAttr const* pHint = iter.PrevAttr(&pNode); pHint;
438 pHint = iter.PrevAttr(&pNode))
442 if (nHintEnd < nTextLen)
452 pSet = pHint->GetAutoFormat().GetStyleHandle();
454 if (pHint->GetStart() == *pHint->End())
464 std::unique_ptr<SfxItemSet>
const pCleanedSet = pSet->Clone();
476 && !pCleanedSet->HasItem(nWhich)
477 && !(pFormat && pFormat->
HasItem(nWhich)) )
482 pCleanedSet->Put(*pItem);
496 pCleanedSet->ClearItem(pItem->
Which());
498 pCleanedSet->ClearItem(pItem->
Which());
501 bool bShadingWasImported =
false;
507 std::map<OUString, css::uno::Any>& rMap = aGrabBag.
GetGrabBag();
508 auto aIterator = rMap.find(
"CharShadingMarker");
509 if (aIterator != rMap.end())
510 aIterator->second >>= bShadingWasImported;
514 if (bShadingWasImported
518 pCleanedSet->ClearItem(pItem->
Which());
526 const std::optional<Color> oFontBackColor = pNumFnt->
GetBackColor();
530 pNumFnt->
SetDiffFnt(pCleanedSet.get(), pIDSA);
548 for( ; nRedlPos < rTable.
size() ; ++nRedlPos )
551 if( RedlineType::Delete == pTmp->
GetType() ||
552 RedlineType::Insert == pTmp->
GetType() )
555 if( pRStt->
nNode <= nNdIdx && pREnd->nNode > nNdIdx )
580 if ( RedlineType::Delete == pRedlineNum->
GetType() )
594 if ( RedlineType::Delete == pRedlineNum->
GetType() )
595 SW_MOD()->GetDeletedAuthorAttr(aAuthor, aSet);
597 SW_MOD()->GetInsertAuthorAttr(aAuthor, aSet);
600 pNumFnt->SetColor(pItem->GetValue());
602 pNumFnt->SetUnderline(pItem->GetLineStyle());
604 pNumFnt->SetStrikeout( pItem->GetStrikeout() );
634 const bool bLeft = SvxAdjust::Left == rNumFormat.
GetNumAdjust();
635 const bool bCenter = SvxAdjust::Center == rNumFormat.
GetNumAdjust();
636 const bool bLabelAlignmentPosAndSpaceModeActive(
638 const sal_uInt16 nMinDist = bLabelAlignmentPosAndSpaceModeActive
644 if (
auto const sh1 = rInf.
GetVsh()) {
645 if (
auto const doc = sh1->GetDoc()) {
646 auto const sh2 = doc->GetPersist();
647 if (sh2 !=
nullptr && sh2->HasName()) {
648 referer = sh2->GetMedium()->GetName();
656 bLeft, bCenter, nMinDist,
657 bLabelAlignmentPosAndSpaceModeActive );
661 static_cast<SwGrfNumPortion*>(pRet)->SetBase( nTmpA, nTmpD, nTmpA, nTmpD );
675 const std::optional<vcl::Font> pFormatFnt = rNumFormat.
GetBulletFont();
701 pNumFnt->SetDiffFnt( pFormat, pIDSA );
708 pNumFnt->SetFamily( pFormatFnt->GetFamilyType(), nAct );
709 pNumFnt->SetName( pFormatFnt->GetFamilyName(), nAct );
710 pNumFnt->SetStyleName( pFormatFnt->GetStyleName(), nAct );
711 pNumFnt->SetCharSet( pFormatFnt->GetCharSet(), nAct );
712 pNumFnt->SetPitch( pFormatFnt->GetPitch(), nAct );
716 pNumFnt->SetVertical( pNumFnt->GetOrientation(),
727 bLeft, bCenter, nMinDist,
728 bLabelAlignmentPosAndSpaceModeActive);
734 if ( !aText.isEmpty() )
743 if( !aText.isEmpty() )
762 pNumFnt->SetDiffFnt( pFormat, pIDSA );
772 bLeft, bCenter, nMinDist,
773 bLabelAlignmentPosAndSpaceModeActive );
SvxNumType GetNumberingType() const
Base class of the Writer layout elements.
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
Marks a position in the document model.
LanguageType GetLanguage() const
Language at field position.
OUString GetLabelFollowedBy() const
Retrieves the character following the list label, if the paragraph's list level defines one...
SwFlyCntPortion * NewFlyCntPortion(SwTextFormatInfo &rInf, SwTextAttr *pHt) const
Sets a new portion for an object anchored as character.
SwExpandPortion * NewFieldPortion(SwTextFormatInfo &rInf, const SwTextAttr *pHt) const
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
SwTextAttr * GetAttr(TextFrameIndex nPos) const
Returns the attribute for a position.
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Base class of all fields.
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
constexpr sal_uInt8 MAXLEVEL
void SetLen(TextFrameIndex const nLen)
Distinguish only for painting/hide.
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
bool SeekAndChg(SwTextSizeInfo &rInf)
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
sal_Int32 GetAnyEnd() const
end (if available), else start
constexpr TypedWhichId< SfxGrabBagItem > RES_CHRATR_GRABBAG(43)
The root element of a Writer document layout.
For old documents the Field-Which IDs must be preserved !!!
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
const SfxPoolItem * NextItem()
SwExpandPortion * TryNewNoLengthPortion(SwTextFormatInfo const &rInfo)
Try to create a new portion with zero length, for an end of a hint (where there is no CH_TXTATR)...
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
void ChangeExpansion(SwDoc *pDoc, bool bVirtPageNum, const SvxNumType *pNumFormat)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
static const SwRangeRedline * lcl_GetRedlineAtNodeInsertionOrDeletion(const SwTextNode &rTextNode, bool &bIsMoved)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
const SwFormatField & GetFormatField() const
SwFlyFrame * FindFlyFrame()
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
const std::optional< Color > & GetBackColor() const
sal_uInt16 GetStackCount() const
This portion represents a part of the paragraph string.
sal_uInt16 GetVirtPageNum() const
static void lcl_setRedlineAttr(SwTextFormatInfo &rInf, const SwTextNode &rTextNode, const std::unique_ptr< SwFont > &pNumFnt)
static SwFieldPortion * lcl_NewMetaPortion(SwTextAttr &rHint, const bool bPrefix)
const SwViewOption & GetOpt() const
Used in for asian layout specialities to display up to six characters in 2 rows and 2-3 columns...
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
SwTextNode const * GetTextNodeForParaProps() const
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
SwFootnotePortion * NewFootnotePortion(SwTextFormatInfo &rInf, SwTextAttr *pHt)
The portion for the Footnote Reference in the Text.
void ChgBodyTextFlag(bool bIsInBody)
Set by UpdateExpFields where node position is known.
SwPageFrame * FindPageFrame()
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
SwPageDesc * GetPageDesc()
SwNumberPortion * NewNumberPortion(SwTextFormatInfo &rInf) const
SwNodeOffset GetIndex() const
vector_type::size_type size_type
SwLinePortion * NewExtraPortion(SwTextFormatInfo &rInf)
std::unique_ptr< sw::MergedAttrIterByEnd > m_pByEndIter
bool IsInBodyText() const
Called by formatting.
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
const std::map< OUString, css::uno::Any > & GetGrabBag() const
Provides access to settings of a document.
TextFrameIndex GetIdx() const
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
SwTextFrame * GetTextFrame()
const SwPosition * Start() const
const SwAttrSet & GetCharAttr() const
SwFieldType * GetTyp() const
static void checkApplyParagraphMarkFormatToNumbering(SwFont *pNumFnt, SwTextFormatInfo &rInf, const IDocumentSettingAccess *pIDSA, const SwAttrSet *pFormat)
OOXML spec says that w:rPr inside w:pPr specifies formatting for the paragraph mark symbol (i...
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
Base class for anything that can be part of a line in the Writer layout.
const SwNumFormat & Get(sal_uInt16 i) const
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
SwTextNode is a paragraph in the document model.
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
LanguageType GetLanguage() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
void SetLen(const TextFrameIndex nNew)
virtual void SetLanguage(LanguageType nLng)
general base class for all free-flowing frames
std::size_t GetAuthor(sal_uInt16 nPos=0) const
void SetBackColor(std::optional< Color > xNewColor)
static bool IsIgnoredCharFormatForNumbering(const sal_uInt16 nWhich, bool bIsCharStyle=false)
In MS Word, the font underline setting of the paragraph end position won't affect the formatting of n...
bool IsNumbered(SwRootFrame const *pLayout=nullptr) const
Returns is this text node is numbered.
constexpr::Color COL_GREEN(0x00, 0x80, 0x00)
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
bool IsCountedInList() const
IDocumentSettingAccess const & getIDocumentSettingAccess() const
const SwPosition * End() const
const SwModify * GetRegisteredIn() const
RedlineType GetType(sal_uInt16 nPos=0) const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
virtual OUString GetFieldName() const
get name or content
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
SwLinePortion * GetLast()
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
const Color & GetHighlightColor() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr sal_uInt16 RES_CHRATR_END(46)
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr) const
Returns outline of numbering string.
const SfxPoolItem & GetAttr() const
constexpr TypedWhichId< SwFormatAutoFormat > RES_PARATR_LIST_AUTOFMT(87)
void SetDiffFnt(const SfxItemSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
SwTextFrame * GetTextFrame()
const SwFrame * GetAnchorFrame() const
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
void ChangeExpansion(const SwFrame &, const SwTextField &)
For fields in header/footer/footnotes/flys: Only called by formatting!!
virtual const SwRedlineTable & GetRedlineTable() const =0
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
SS for PoolItems: hard attributation.
void ChgBodyTextFlag(bool bIsInBody)
set from UpdateExpFields (the Node-Position is known there)
void SetHighlightColor(const Color &aNewColor)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SwRootFrame * GetLayout() const
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
static constexpr size_type npos
sal_uInt16 GetPageNum() const
TextFrameIndex GetTextStart() const
SwRootFrame * getRootFrame()
const SfxPoolItem * GetCurItem() const
const SwAttrPool & GetAttrPool() const
bool IsVirtPageNum() const
static bool lcl_IsInBody(SwFrame const *pFrame)
const SvxNumberType & GetNumType() const