20#include <libxml/xmlwriter.h>
29#include <officecfg/Office/Common.hxx>
30#include <osl/diagnose.h>
35#include <com/sun/star/i18n/WordType.hpp>
36#include <com/sun/star/i18n/XBreakIterator.hpp>
74#include <UndoManager.hxx>
109 const bool bLocked = pNode->IsModifyLocked();
122 std::vector<sal_uInt16> aClearWhichIds;
126 aListAttrSet.Set(*pAttrSetOfNode);
127 if ( aListAttrSet.Count() )
129 aSavedAttrsSet.Put(aListAttrSet);
134 aClearWhichIds.push_back( pItem->
Which() );
143 for (sal_uInt16 aSavId : aSavIds)
145 if (SfxItemState::SET == pAttrSetOfNode->
GetItemState(aSavId,
false, &pItem))
162 aSavedAttrsSet.Put(*pItem);
163 aClearWhichIds.push_back(aSavId);
170 const bool bKeepAttributes =
172 if ( bKeepAttributes )
178 pNode->UnlockModify();
186 OSL_ENSURE( !bKeepAttributes,
187 "<lcl_RstAttr(..)> - certain attributes are kept, but not needed." );
194 ( aSavedAttrsSet.GetItemState( pItem->
Which(),
false ) != SfxItemState::SET ) )
209 if (bKeepAttributes && aSavedAttrsSet.Count())
213 pNode->
SetAttr(aSavedAttrsSet);
216 pNode->UnlockModify();
230 pHst = &pUndo->GetHistory();
235 pStt, pEnd, pHst,
nullptr, pLayout );
246 const bool bSendDataChangedEvents,
250 std::optional<SwPaM> oExtraPaM;
260 oExtraPaM.emplace( *rRg.
GetPoint() );
272 nPtPos = *pURLAttr->
End();
283 if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
285 nMkPos = aBndry.startPos;
286 nPtPos = aBndry.endPos;
302 std::optional< SwDataChanged > oDataChanged;
303 if ( bSendDataChangedEvents )
305 oDataChanged.emplace( *pPam );
312 if( !rAttrs.
empty() )
316 pHst = &pUndo->GetHistory();
320 auto [pStt, pEnd] = pPam->
StartEnd();
322 pStt, pEnd, pHst,
nullptr, pLayout);
330 for(
auto it = rAttrs.
rbegin(); it != rAttrs.
rend(); ++it )
335 if( aDelSet.Count() )
341 if( pStt->GetContentIndex() )
360 if( pEnd->GetContentIndex() == pEnd->GetNode().GetContentNode()->Len() )
366 else if( pStt->GetNode() != pEnd->GetNode() || !pStt->GetContentIndex() )
383 if( aTmpStt < aTmpEnd )
401 oDataChanged.reset();
407 if (!
SW_MOD()->GetModuleConfig()->IsStoreRsid())
420 bool const bRet(pTextNode->
SetAttr(aSet, nStart,
438 if (!
SW_MOD()->GetModuleConfig()->IsStoreRsid())
447 return pTextNode->
SetAttr( aRsid );
485 if (
auto pObj = pShapeFormat->FindRealSdrObject())
498 std::unique_ptr<SwUndo> pUndo;
523 sal_uInt16 nOldCnt = rChgTabStop.
Count();
524 if( !nOldCnt || nOldWidth == nNewWidth )
529 for(
n = nOldCnt;
n ; --
n )
530 if( SvxTabAdjust::Default != rChgTabStop[
n - 1].GetAdjustment() )
534 rChgTabStop.
Remove(
n, nOldCnt -
n );
552 sw::BroadcastingModify aCallMod;
560 bool bCheckSdrDflt =
false;
561 const sal_uInt16 nWhich = pItem->
Which();
562 aOld.Put(
GetAttrPool().GetDefaultItem( nWhich ) );
570 bCheckSdrDflt =
nullptr != pSdrPool;
576 bCheckSdrDflt =
nullptr != pSdrPool;
597 if( 0 != nSlotId && nSlotId != nWhich )
599 sal_uInt16 nEdtWhich = pSdrPool->
GetWhich( nSlotId );
600 if( 0 != nEdtWhich && nSlotId != nEdtWhich )
602 std::unique_ptr<SfxPoolItem> pCpy(pItem->
Clone());
603 pCpy->SetWhich( nEdtWhich );
612 if( aNew.
Count() && aCallMod.HasWriterListeners() )
620 if( pTmpItem && pTmpItem->
Count() )
626 SwTwips nNewWidth = (*pTmpItem)[ 0 ].GetTabPos(),
648 if( aNew.
Count() && aCallMod.HasWriterListeners() )
657 for(
SwClient* pClient = aClientIter.
First(); pClient; pClient = aClientIter.
Next())
658 aCallMod.Remove( pClient );
676 SfxHintId::StyleSheetErased);
681 std::make_unique<SwUndoCharFormatDelete>(pDel, *
this));
684 delete (*mpCharFormatTable)[nFormat];
693 OSL_ENSURE( SIZE_MAX != nFormat,
"Format not found," );
701 OSL_ENSURE(
false,
"Format is not in the DocArray any more, "
702 "so it can be deleted with delete" );
712 SfxStyleFamily::Frame,
713 SfxHintId::StyleSheetErased);
718 std::make_unique<SwUndoFrameFormatDelete>(pFormat, *
this));
727 OSL_ENSURE( contains,
"FrameFormat not found." );
780 if (!pFormat->GetInfo(aGetHt))
790 return *((*mpTableFrameFormatTable)[nFormat]);
799 if (!pFormat->GetInfo(aGetHt))
801 if (
index == nFormat)
807 throw std::out_of_range(
"Format index out of range.");
822 bool bBroadcast,
bool bAuto)
833 std::make_unique<SwUndoFrameFormatCreate>(pFormat, pDerivedFrom, *
this));
839 SfxHintId::StyleSheetCreated);
847 bool bBroadcast,
bool bAuto)
850 pFrameFormat =
MakeFrameFormat( rFormatName, pFrameFormat, bBroadcast, bAuto );
866 std::make_unique<SwUndoCharFormatCreate>(pFormat, pDerivedFrom, *
this));
872 SfxHintId::StyleSheetCreated);
880 bool bBroadcast,
bool )
883 pCharFormat =
MakeCharFormat( rFormatName, pCharFormat, bBroadcast );
901 std::make_unique<SwUndoTextFormatCollCreate>(pFormatColl, pDerivedFrom,
907 SfxHintId::StyleSheetCreated);
914 bool bBroadcast,
bool )
918 return pTextFormatColl;
926 rFormatName, pDerivedFrom );
934 std::make_unique<SwUndoCondTextFormatCollCreate>(pFormatColl, pDerivedFrom,
940 SfxHintId::StyleSheetCreated);
959 OSL_ENSURE( nFormatColl,
"Remove of Coll 0." );
968 SfxHintId::StyleSheetErased);
972 std::unique_ptr<SwUndoTextFormatCollDelete> pUndo;
997 OSL_ENSURE( SIZE_MAX != nFormat,
"Collection not found," );
1005 if( pCNd ==
nullptr)
1033 bool bChangeOfListStyleAtParagraph(
true );
1037 if ( pNumRuleAtParagraph )
1041 if ( rNumRuleItemAtParagraphStyle.
GetValue() ==
1042 pNumRuleAtParagraph->
GetName() )
1044 bChangeOfListStyleAtParagraph =
false;
1049 if ( bChangeOfListStyleAtParagraph )
1051 std::unique_ptr< SwRegHistory > pRegH;
1084 const bool bResetListAttrs,
1088 auto [pStt, pEnd] = rRg.
StartEnd();
1094 std::unique_ptr<SwUndoFormatColl> pUndo(
new SwUndoFormatColl( rRg, pFormat,
1097 pHst = pUndo->GetHistory();
1102 pStt, pEnd, pHst,
nullptr, pLayout);
1124 FNCopyFormat fnCopyFormat,
const SwFormat& rDfltFormat )
1128 if( !rFormat.
IsAuto() || !rFormat.GetRegisteredIn() )
1140 fnCopyFormat, rDfltFormat );
1144 SwFormat* pNewFormat = (this->*fnCopyFormat)( rFormat.
GetName(), pParent,
false, true );
1214 if(
this != rColl.
GetDoc() )
1220 const OUString& rName = pItem->
GetValue();
1221 if( !rName.isEmpty() )
1267 FNCopyFormat fnCopyFormat,
1285 (this->*fnCopyFormat)( pSrc->
GetName(), &rDfltFormat,
false, true );
1315 aTmpAttrSet.
Put( aPageDesc );
1372 std::unique_ptr<SfxPoolItem> pNewItem(pItem->
Clone());
1376 pOldFormat = pNewItem->StaticWhichCast(
RES_HEADER).GetHeaderFormat();
1378 pOldFormat = pNewItem->StaticWhichCast(
RES_FOOTER).GetFooterFormat();
1390 if( pContent->GetContentIdx() )
1397 const SwNode& rCSttNd = pContent->GetContentIdx()->GetNode();
1411 pNewItem->StaticWhichCast(
RES_HEADER).RegisterToFormat(*pNewFormat);
1413 pNewItem->StaticWhichCast(
RES_FOOTER).RegisterToFormat(*pNewFormat);
1420 bool bNotifyLayout =
false;
1428 bNotifyLayout =
true;
1450 bNotifyLayout =
true;
1520 if( bNotifyLayout && pTmpRoot )
1523 aLayout->AllCheckPageDescs();
1531 rDstDesc.
GetMaster().CallSwClientNotify(aHint);
1532 rDstDesc.
GetLeft().CallSwClientNotify(aHint);
1538 for (
bool bFirst : {
true,
false })
1539 for (
bool bLeft : {
true,
false })
1540 for (
bool bHeader : {
true,
false })
1542 if (!bLeft && !bFirst)
1567 if (bIncludePageStyles)
1615 SAL_WARN(
"sw.core",
"Found unknown auto SwNumRule during reset!" );
1638 pHistory = &pUndo->GetHistory();
1643 const sal_Int32 nDefDist = rTabItem.
Count() ? rTabItem[0].GetTabPos() : 1134;
1646 while( aIdx <= rEnd.
GetNode() )
1663 if ( nListLevel >= 0 )
1665 const SwNumFormat& rFormat = pRule->
Get(o3tl::narrowing<sal_uInt16>(nListLevel));
1672 if (indents & ::sw::ListLevelIndents::FirstLine)
1683 nNext = ( nNext / nDefDist ) * nDefDist;
1721 pFormat->
SetFormatName(
"TableBox" + OUString::number(
reinterpret_cast<sal_IntPtr
>(pFormat)));
1729 pFormat->
SetFormatName(
"TableLine" + OUString::number(
reinterpret_cast<sal_IntPtr
>(pFormat)));
1748 : pNFormat( nullptr )
1751 if( &rSrc != &rDest )
1761 if( &rSrc != &rDest )
1763 MergeWithOtherDoc( rDest );
1809 if (pSet && pSet->
Count())
1847 std::vector<WhichPair> whichIds;
1851 whichIds.push_back({pItem->Which(), pItem->Which()});
1857 currentSet.
Put(currentSet.
Get(rPair.first));
1864 SwPaM endPam(*pTNd, nEnd);
1897 std::make_unique<SwUndoFormatAttr>(std::move(aOldSet), rFormat,
true));
1910 std::unique_ptr<SwUndo> pUndo;
1912 switch (rFormat.
Which())
1916 eFamily = SfxStyleFamily::Char;
1920 eFamily = SfxStyleFamily::Para;
1924 eFamily = SfxStyleFamily::Frame;
1952 pWriter = xmlNewTextWriterFilename(
"nodes.xml", 0);
1953 xmlTextWriterSetIndent(pWriter,1);
1954 (void)xmlTextWriterSetIndentString(pWriter, BAD_CAST(
" "));
1955 (void)xmlTextWriterStartDocument(pWriter,
nullptr,
nullptr,
nullptr);
1958 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwDoc"));
1959 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
1979 pModel->dumpAsXml(pWriter);
1981 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"mbModified"));
1982 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"value"), BAD_CAST(OString::boolean(
getIDocumentState().IsModified()).getStr()));
1983 (void)xmlTextWriterEndElement(pWriter);
1985 (void)xmlTextWriterEndElement(pWriter);
1988 (void)xmlTextWriterEndDocument(pWriter);
1989 xmlFreeTextWriter(pWriter);
1995 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwDBData"));
1997 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"sDataSource"), BAD_CAST(
sDataSource.toUtf8().getStr()));
1998 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"sCommand"), BAD_CAST(
sCommand.toUtf8().getStr()));
1999 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nCommandType"), BAD_CAST(OString::number(
nCommandType).getStr()));
2001 (void)xmlTextWriterEndElement(pWriter);
2006 std::set<Color> aDocColors;
2009 for (sal_uInt16 nAttrib : pAttribs)
2013 auto pColorItem =
static_cast<const SvxColorItem*
>(pItem);
2014 Color aColor( pColorItem->GetValue() );
2016 aDocColors.insert(aColor);
2035 if ( pTextFormatColls )
2037 for (
auto pTextFormatColl : *pTextFormatColls )
2039 if ( pTextFormatColl->IsDefault() ||
2040 ! pTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
2047 if ( !pParentTextFormatColl )
2068 : m_PosIndex( m_Array.
get<0>() )
2069 , m_TypeAndNameIndex( m_Array.
get<1>() )
2081 std::make_tuple(
x->GetName(),
x->Which(),
x) );
2082 return m_Array.project<0>( it );
2085SwFrameFormats::ByTypeAndName::const_iterator
2091std::pair<SwFrameFormats::ByTypeAndName::const_iterator, SwFrameFormats::ByTypeAndName::const_iterator>
2096 return { it, itEnd };
2111 const int _offset = keepDefault ? 1 : 0;
2122 SAL_WARN_IF(
x->m_ffList !=
nullptr,
"sw.core",
"Inserting already assigned item");
2123 assert(
x->m_ffList ==
nullptr);
2131 SAL_WARN_IF(
x->m_ffList !=
this,
"sw.core",
"Removing invalid / unassigned item");
2133 assert(
x == *ret );
2135 x->m_ffList =
nullptr;
2148 (*position)->m_ffList =
nullptr;
2154 return (
x.m_ffList ==
this);
2164 std::pair<iterator,bool> res =
m_PosIndex.push_front(
x );
const OUString & GetValue() const
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const =0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetSecondaryPool() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
void SetPoolDefaultItem(const SfxPoolItem &)
const WhichRangesContainer & GetRanges() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void Differentiate(const SfxItemSet &rSet)
void InvalidateItem(sal_uInt16 nWhich)
T & StaticWhichCast(TypedWhichId< T > nId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void Remove(const sal_uInt16 nPos, const sal_uInt16 nLen=1)
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetTextLeft() const
SwAttrPool * GetPool() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
const SwFormatCollConditions & GetCondColls() const
SwFormatColl * GetFormatColl() const
bool HasSwAttrSet() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual bool SetAttr(const SfxPoolItem &)
made virtual
const SwAttrSet * GetpSwAttrSet() const
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
virtual sal_uInt16 ResetAllAttr()
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId,...
void CopyPageDescHeaderFooterImpl(bool bCpyHeader, const SwFrameFormat &rSrcFormat, SwFrameFormat &rDestFormat)
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark=false, bool bExactRange=false, SwRootFrame const *pLayout=nullptr)
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
bool mbIsAutoFormatRedline
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
SwFormat * MakeFrameFormat_(const OUString &, SwFormat *, bool, bool)
void CopyFormatArr(const SwFormatsBase &rSourceArr, SwFormatsBase const &rDestArr, FNCopyFormat fnCopyFormat, SwFormat &rDfltFormat)
std::unique_ptr< SwFrameFormats > mpTableFrameFormatTable
SwTableBoxFormat * MakeTableBoxFormat()
SwConditionTextFormatColl * MakeCondTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
void EnsureNumberFormatter()
size_t GetTableFrameFormatCount(bool bUsed) const
const std::unique_ptr< ::SwContentControlManager > m_pContentControlManager
void DelCharFormat(size_t nFormat, bool bBroadcast=false)
Delete the formats.
std::unique_ptr< SwGrfFormatColl > mpDfltGrfFormatColl
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
SwFrameFormat * MakeFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom, bool bBroadcast=false, bool bAuto=true)
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
IDocumentState const & getIDocumentState() const
SwFormat * MakeTextFormatColl_(const OUString &, SwFormat *, bool, bool)
SwFormat * CopyFormat(const SwFormat &rFormat, const SwFormatsBase &rFormatArr, FNCopyFormat fnCopyFormat, const SwFormat &rDfltFormat)
Copy the formats to itself.
void SetTextFormatCollByAutoFormat(const SwPosition &rPos, sal_uInt16 nPoolId, const SfxItemSet *pSet)
const SwCharFormat * GetDfltCharFormat() const
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
const std::unique_ptr< ::sw::UndoManager > m_pUndoManager
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
void UpdateRsid(const SwPaM &rRg, sal_Int32 nLen)
Set the rsid of the next nLen symbols of rRg to the current session number.
void dumpAsXml(xmlTextWriterPtr=nullptr) const
Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by...
SwTableLineFormat * MakeTableLineFormat()
SvNumberFormatter * mpNumberFormatter
SwNumRule * FindNumRulePtr(const OUString &rName) const
SwTableFormat * MakeTableFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
SwGrfFormatColl * CopyGrfColl(const SwGrfFormatColl &rColl)
copy the graphic nodes
std::unique_ptr< SwNodes > m_pNodes
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
const SwNumRuleTable & GetNumRuleTable() const
void RenameFormat(SwFormat &rFormat, const OUString &sNewName, bool bBroadcast=false)
std::unique_ptr< SwCharFormats > mpCharFormatTable
SwNumRule * GetOutlineNumRule() const
const SwCharFormats * GetCharFormats() const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
std::unique_ptr< SwFrameFormats > mpFrameFormatTable
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
std::unique_ptr< SwFrameFormats > mpSpzFrameFormatTable
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
std::unique_ptr< SwTextFormatColl > mpDfltTextFormatColl
SwCharFormat * CopyCharFormat(const SwCharFormat &)
copy the char format
SwFrameFormat * CopyFrameFormat(const SwFrameFormat &)
copy the frame format
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
const SwTextFormatColls * GetTextFormatColls() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
const std::unique_ptr< ::sw::mark::MarkManager > mpMarkManager
std::unique_ptr< SwNumRuleTable > mpNumRuleTable
const SwFrameFormats * GetFrameFormats() const
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
SwGrfFormatColl * MakeGrfFormatColl(const OUString &rFormatName, SwGrfFormatColl *pDerivedFrom)
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
void DelTextFormatColl(size_t nFormat, bool bBroadcast=false)
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
bool UpdateParRsid(SwTextNode *pTextNode, sal_uInt32 nVal=0)
SwTextFormatColl * MakeTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
Create the FormatCollections.
const SwAttrPool & GetAttrPool() const
void ResetAttrAtFormat(const sal_uInt16 nWhichId, SwFormat &rChangedFormat)
void DelTableFrameFormat(SwTableFormat *pFormat)
std::unique_ptr< SwCharFormat > mpDfltCharFormat
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
std::unique_ptr< SwFrameFormat > mpDfltFrameFormat
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
const SwFrameFormat * GetDfltFrameFormat() const
std::set< Color > GetDocColors()
SwFormat * MakeCharFormat_(const OUString &, SwFormat *, bool, bool)
const SwFrameFormats * GetSpzFrameFormats() const
SwFrameFormat & GetTableFrameFormat(size_t nFormat, bool bUsed) const
SwDrawFrameFormat * MakeDrawFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
const std::unique_ptr< ::sw::DocumentSettingManager > m_pDocumentSettingManager
void ReplaceStyles(const SwDoc &rSource, bool bIncludePageStyles=true)
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter <bResetListAttrs>.
void CopyFooter(const SwFrameFormat &rSrcFormat, SwFrameFormat &rDestFormat)
Copy footer (with contents) from SrcFormat to DestFormat.
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
::sw::UndoManager & GetUndoManager()
void CopyHeader(const SwFrameFormat &rSrcFormat, SwFrameFormat &rDestFormat)
Copy header (with contents) from SrcFormat to DestFormat (can also be copied into other document).
void SetFormatItemByAutoFormat(const SwPaM &rPam, const SfxItemSet &)
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
SwFrameFormat * FindFrameFormatByName(const OUString &rName) const
std::unique_ptr< SwGrfFormatColls > mpGrfFormatCollTable
void MoveLeftMargin(const SwPaM &rPam, bool bRight, bool bModulus, SwRootFrame const *pLayout=nullptr)
Adjust left margin via object bar (similar to adjustment of numerations).
void dumpAsXml(xmlTextWriterPtr pWriter) const
Content, content of frame (header, footer, fly).
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
void RegisterToPageDesc(SwPageDesc &)
SwPageDesc * GetPageDesc()
void Add(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, SwNodeOffset nNodeIdx)
Marks a node in the document model.
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
Merge GetRedlineMergeFlag() const
SwContentNode * GetContentNode()
const SwEndNode * EndOfSectionNode() const
void ForEach(FnForEach_SwNodes fnForEach, void *pArgs=nullptr)
static SwStartNode * MakeEmptySection(SwNode &rWhere, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
void Copy_(const SwNodeRange &rRg, SwNode &rInsPos, bool bNewFrames=true) const
const SwNumFormat & Get(sal_uInt16 i) const
void SetInvalidRule(bool bFlag)
const OUString & GetName() const
SwNumRule & CopyNumRule(SwDoc &, const SwNumRule &)
A kind of copy-constructor to make sure the num formats are attached to the correctCharFormats of a d...
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
sal_uInt16 GetPoolHelpId() const
void StashFrameFormat(const SwFrameFormat &rFormat, bool bHeader, bool bLeft, bool bFirst)
Remember original header/footer formats even when they are hidden by "sharing".
const OUString & GetName() const
void SetPoolHlpFileId(sal_uInt8 const nId)
void SetFollow(const SwPageDesc *pNew)
SwFrameFormat & GetMaster()
bool IsHeaderShared() const
const SvxNumberType & GetNumType() const
bool IsFirstShared() const
bool IsFooterShared() const
SwFrameFormat & GetFirstLeft()
SwFrameFormat & GetFirstMaster()
void SetPoolFormatId(sal_uInt16 const nId)
void SetPoolHelpId(sal_uInt16 const nId)
bool GetLandscape() const
void SetNumType(const SvxNumberType &rNew)
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
SwFrameFormat & GetLeft()
const SwPageDesc * GetFollow() const
void WriteUseOn(UseOnPage const eNew)
const SwPageFootnoteInfo & GetFootnoteInfo() const
UseOnPage ReadUseOn() const
void SetLandscape(bool bNew)
const SwFrameFormat * GetStashedFrameFormat(bool bHeader, bool bLeft, bool bFirst) const
Used to restore hidden header/footer formats.
SwPageDescsBase::size_type size_type
void dumpAsXml(xmlTextWriterPtr pWriter) const
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData gets copied, the pointer is therefore not taken over by the RedLineObject.
void dumpAsXml(xmlTextWriterPtr pWriter) const
The root element of a Writer document layout.
bool HasMergedParas() const
Starts a section of nodes in the document model.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const sal_Int32 * End() const
sal_Int32 GetStart() const
const SwFormatINetFormat & GetINetFormat() const
static bool changeAnchor(SwFrameFormat *pShape, SdrObject *pObj)
Sets the anchor of the associated textframe of the given shape, and returns true on success.
static void syncFlyFrameAttr(SwFrameFormat &rShape, SfxItemSet const &rSet, SdrObject *pObj)
Similar to syncProperty(), but used by the internal API (e.g. for UI purposes).
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
Is the frame format a text box?
Represents the style of a paragraph.
bool IsAssignedToListLevelOfOutlineStyle() const
SwTextFormatColl & GetNextTextFormatColl() const
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
void SetNextTextFormatColl(SwTextFormatColl &rNext)
Inline implementations.
int GetAssignedOutlineStyleLevel() const
Represents the visualization of a paragraph.
SwTextNode const * GetTextNodeForParaProps() const
SwTextNode is a paragraph in the document model.
bool GetParaAttr(SfxItemSet &rSet, sal_Int32 nStt, sal_Int32 nEnd, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true, const bool bMergeIndentValuesOfNumRule=false, SwRootFrame const *pLayout=nullptr) const
Query the attributes of textnode over the range.
void FormatToTextAttr(SwTextNode *pNd)
Convey attributes of an AttrSet (AutoFormat) to SwpHintsArray.
::sw::ListLevelIndents AreListLevelIndentsApplicable() const
Determines, if the list level indent attributes can be applied to the paragraph.
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, ::sw::GetTextAttrMode const eMode=::sw::GetTextAttrMode::Default) const
get the innermost text attribute covering position nIndex.
const OUString & GetText() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
bool DontExpandFormat(sal_Int32 nContentIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
SwTextFormatColl * GetTextColl() const
Typing one or more characters to a single paragraph.
std::vector< SwTextFormatColl * >::const_iterator const_iterator
std::vector< SwNumRule * >::size_type size_type
const_reverse_iterator rend() const
const_iterator begin() const
const_reverse_iterator rbegin() const
static bool lcl_RstTextAttr(SwNode *pNd, void *pArgs)
@params pArgs contains the document's ChrFormatTable Is need for selections at the beginning/end and ...
void CopyFlyInFlyImpl(const SwNodeRange &rRg, SwPaM const *const pCopiedPaM, SwNode &rStartIdx, const bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
bool UndoWasEnabled() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
struct _xmlTextWriter * xmlTextWriterPtr
static void SetTextFormatCollNext(SwTextFormatColl *pTextColl, const SwTextFormatColl *pDel)
static bool lcl_RstAttr(SwNode *pNd, void *pArgs)
static bool lcl_SetTextFormatColl(SwNode *pNode, void *pArgs)
static bool lcl_SetNewDefTabStops(SwTwips nOldWidth, SwTwips nNewWidth, SvxTabStopItem &rChgTabStop)
constexpr TypedWhichId< SfxStringItem > RES_PARATR_LIST_ID(RES_PARATR_LIST_BEGIN)
bool isTXTATR(const sal_uInt16 nWhich)
bool isCHRATR(const sal_uInt16 nWhich)
constexpr sal_uInt16 RES_CHRATR_END(46)
bool isPARATR_LIST(const sal_uInt16 nWhich)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr sal_uInt16 RES_UNKNOWNATR_END(160)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
bool isDrawingLayerAttribute(const sal_uInt16 nWhich)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_RESTARTVALUE(85)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr sal_uInt16 RES_PARATR_LIST_BEGIN(RES_PARATR_END)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SvxRsidItem > RES_CHRATR_RSID(39)
constexpr sal_uInt16 RES_PARATR_LIST_END(88)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
bool isFRMATR(const sal_uInt16 nWhich)
bool isBOXATR(const sal_uInt16 nWhich)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(163)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_TXTATR_UNKNOWN_CONTAINER(54)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISCOUNTED(86)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISRESTART(84)
constexpr TypedWhichId< SvxRsidItem > RES_PARATR_RSID(80)
bool isPARATR(const sal_uInt16 nWhich)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(161)
bool isGRFATR(const sal_uInt16 nWhich)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
Reference< XComponentContext > getProcessComponentContext()
bool HasOutlineStyleToBeWrittenAsNormalListStyle(SwDoc &rDoc)
method to check, if the outline style has to written as a normal list style
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNode const &rPos)
void CopyBookmarks(const SwPaM &rPam, const SwPosition &rCpyPam)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNode const &rNode)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
void dumpAsXml(xmlTextWriterPtr pWriter) const
Marks a position in the document model.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
sal_Int32 GetContentIndex() const
Parameters for _Rst and lcl_SetTextFormatColl.
SwRootFrame const *const pLayout
SwFormatColl * pFormatColl
bool bExactRange
From the attributes included in the range, delete only the ones which have exactly same range....
const SfxItemSet * pDelSet
std::pair< sal_uInt16, sal_uInt16 > WhichPair
NF_EVALDATEFORMAT_FORMAT_INTL