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>
121 std::vector<sal_uInt16> aClearWhichIds;
125 aListAttrSet.Set(*pAttrSetOfNode);
126 if ( aListAttrSet.Count() )
128 aSavedAttrsSet.Put(aListAttrSet);
133 aClearWhichIds.push_back( pItem->
Which() );
142 for (sal_uInt16 aSavId : aSavIds)
144 if (SfxItemState::SET == pAttrSetOfNode->
GetItemState(aSavId,
false, &pItem))
161 aSavedAttrsSet.Put(*pItem);
162 aClearWhichIds.push_back(aSavId);
169 const bool bKeepAttributes =
171 if ( bKeepAttributes )
185 OSL_ENSURE( !bKeepAttributes,
186 "<lcl_RstAttr(..)> - certain attributes are kept, but not needed." );
193 ( aSavedAttrsSet.GetItemState( pItem->
Which(),
false ) != SfxItemState::SET ) )
208 if (bKeepAttributes && aSavedAttrsSet.Count())
212 pNode->
SetAttr(aSavedAttrsSet);
229 pHst = &pUndo->GetHistory();
234 pStt, pEnd, pHst,
nullptr, pLayout );
245 const bool bSendDataChangedEvents,
261 sal_Int32 nMkPos, nPtPos = rSt.
GetIndex();
269 nPtPos = *pURLAttr->
End();
280 if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
282 nMkPos = aBndry.startPos;
283 nPtPos = aBndry.endPos;
299 std::optional< SwDataChanged > oDataChanged;
300 if ( bSendDataChangedEvents )
302 oDataChanged.emplace( *pPam );
309 if( !rAttrs.
empty() )
313 pHst = &pUndo->GetHistory();
319 pStt, pEnd, pHst,
nullptr, pLayout);
327 for(
auto it = rAttrs.
rbegin(); it != rAttrs.
rend(); ++it )
332 if( aDelSet.Count() )
357 if( pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetContentNode()->Len() )
380 if( aTmpStt < aTmpEnd )
398 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 );
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 );
620 if( pTmpItem && pTmpItem->
Count() )
626 SwTwips nNewWidth = (*pTmpItem)[ 0 ].GetTabPos(),
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;
927 rFormatName, pDerivedFrom );
935 std::make_unique<SwUndoCondTextFormatCollCreate>(pFormatColl, pDerivedFrom,
941 SfxHintId::StyleSheetCreated);
961 OSL_ENSURE( nFormatColl,
"Remove of Coll 0." );
970 SfxHintId::StyleSheetErased);
974 std::unique_ptr<SwUndoTextFormatCollDelete> pUndo;
999 OSL_ENSURE( SIZE_MAX != nFormat,
"Collection not found," );
1007 if( pCNd ==
nullptr)
1035 bool bChangeOfListStyleAtParagraph(
true );
1039 if ( pNumRuleAtParagraph )
1043 if ( rNumRuleItemAtParagraphStyle.
GetValue() ==
1044 pNumRuleAtParagraph->
GetName() )
1046 bChangeOfListStyleAtParagraph =
false;
1051 if ( bChangeOfListStyleAtParagraph )
1053 std::unique_ptr< SwRegHistory > pRegH;
1086 const bool bResetListAttrs,
1096 std::unique_ptr<SwUndoFormatColl> pUndo(
new SwUndoFormatColl( rRg, pFormat,
1099 pHst = pUndo->GetHistory();
1104 pStt, pEnd, pHst,
nullptr, pLayout);
1126 FNCopyFormat fnCopyFormat,
const SwFormat& rDfltFormat )
1142 fnCopyFormat, rDfltFormat );
1146 SwFormat* pNewFormat = (this->*fnCopyFormat)( rFormat.
GetName(), pParent,
false, true );
1218 if(
this != rColl.
GetDoc() )
1224 const OUString& rName = pItem->
GetValue();
1225 if( !rName.isEmpty() )
1271 FNCopyFormat fnCopyFormat,
1289 (this->*fnCopyFormat)( pSrc->
GetName(), &rDfltFormat,
false, true );
1319 aTmpAttrSet.
Put( aPageDesc );
1378 std::unique_ptr<SfxPoolItem> pNewItem(pItem->
Clone());
1382 pOldFormat = pNewItem->StaticWhichCast(
RES_HEADER).GetHeaderFormat();
1384 pOldFormat = pNewItem->StaticWhichCast(
RES_FOOTER).GetFooterFormat();
1396 if( pContent->GetContentIdx() )
1404 const SwNode& rCSttNd = pContent->GetContentIdx()->GetNode();
1407 rSrcNds.
Copy_( aRg, aTmpIdx );
1420 pNewItem->StaticWhichCast(
RES_HEADER).RegisterToFormat(*pNewFormat);
1422 pNewItem->StaticWhichCast(
RES_FOOTER).RegisterToFormat(*pNewFormat);
1429 bool bNotifyLayout =
false;
1437 bNotifyLayout =
true;
1459 bNotifyLayout =
true;
1529 if( bNotifyLayout && pTmpRoot )
1532 aLayout->AllCheckPageDescs();
1547 for (
bool bFirst : {
true,
false })
1548 for (
bool bLeft : {
true,
false })
1549 for (
bool bHeader : {
true,
false })
1551 if (!bLeft && !bFirst)
1576 if (bIncludePageStyles)
1624 SAL_WARN(
"sw.core",
"Found unknown auto SwNumRule during reset!" );
1647 pHistory = &pUndo->GetHistory();
1652 const sal_Int32 nDefDist = rTabItem.
Count() ? rTabItem[0].GetTabPos() : 1134;
1655 while( aIdx <= rEnd.nNode )
1670 if ( nListLevel >= 0 )
1672 const SwNumFormat& rFormat = pRule->
Get(o3tl::narrowing<sal_uInt16>(nListLevel));
1684 nNext = ( nNext / nDefDist ) * nDefDist;
1721 pFormat->
SetName(
"TableBox" + OUString::number(
reinterpret_cast<sal_IntPtr
>(pFormat)));
1729 pFormat->
SetName(
"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);
1978 pModel->dumpAsXml(pWriter);
1980 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"mbModified"));
1981 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"value"), BAD_CAST(OString::boolean(
getIDocumentState().IsModified()).getStr()));
1982 (void)xmlTextWriterEndElement(pWriter);
1984 (void)xmlTextWriterEndElement(pWriter);
1987 (void)xmlTextWriterEndDocument(pWriter);
1988 xmlFreeTextWriter(pWriter);
1994 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwDBData"));
1996 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"sDataSource"), BAD_CAST(
sDataSource.toUtf8().getStr()));
1997 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"sCommand"), BAD_CAST(
sCommand.toUtf8().getStr()));
1998 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nCommandType"), BAD_CAST(OString::number(
nCommandType).getStr()));
2000 (void)xmlTextWriterEndElement(pWriter);
2005 std::set<Color> aDocColors;
2008 for (sal_uInt16 nAttrib : pAttribs)
2012 auto pColorItem =
static_cast<const SvxColorItem*
>(pItem);
2013 Color aColor( pColorItem->GetValue() );
2015 aDocColors.insert(aColor);
2034 if ( pTextFormatColls )
2036 for (
auto pTextFormatColl : *pTextFormatColls )
2038 if ( pTextFormatColl->IsDefault() ||
2039 ! pTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
2046 if ( !pParentTextFormatColl )
2067 : m_PosIndex( m_Array.
get<0>() )
2068 , m_TypeAndNameIndex( m_Array.
get<1>() )
2080 std::make_tuple(
x->GetName(),
x->Which(),
x) );
2081 return m_Array.project<0>( it );
2084SwFrameFormats::ByTypeAndName::const_iterator
2090std::pair<SwFrameFormats::ByTypeAndName::const_iterator, SwFrameFormats::ByTypeAndName::const_iterator>
2095 return { it, itEnd };
2110 const int _offset = keepDefault ? 1 : 0;
2121 SAL_WARN_IF(
x->m_ffList !=
nullptr,
"sw.core",
"Inserting already assigned item");
2122 assert(
x->m_ffList ==
nullptr);
2130 SAL_WARN_IF(
x->m_ffList !=
this,
"sw.core",
"Removing invalid / unassigned item");
2132 assert(
x == *ret );
2134 x->m_ffList =
nullptr;
2147 (*position)->m_ffList =
nullptr;
2153 return (
x.m_ffList ==
this);
2163 std::pair<iterator,bool> res =
m_PosIndex.push_front(
x );
struct _xmlTextWriter * xmlTextWriterPtr
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.
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
virtual void DelAllUndoObj()=0
Delete all Undo actions.
virtual void ClearRedo()=0
Delete all Redo actions.
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 SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetTextLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void Remove(const sal_uInt16 nPos, const sal_uInt16 nLen=1)
SwAttrPool * GetPool() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
const SwModify * GetRegisteredIn() const
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
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 character position inside a document model node.
SwIndex & Assign(SwIndexReg *, sal_Int32)
sal_Int32 GetIndex() const
bool IsModifyLocked() const
void Add(SwClient *pDepend)
SwClient * Remove(SwClient *pDepend)
bool HasWriterListeners() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
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)
void Copy_(const SwNodeRange &rRg, const SwNodeIndex &rInsPos, bool bNewFrames=true) const
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
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.
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.
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, enum GetTextAttrMode const eMode=DEFAULT) const
get the innermost text attribute covering position nIndex.
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.
bool DontExpandFormat(const SwIndex &rIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
bool AreListLevelIndentsApplicable() const
Determines, if the list level indent attributes can be applied to the paragraph.
const OUString & GetText() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
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
virtual void CallSwClientNotify(const SfxHint &rHint) const override
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, const SwNodeIndex &rStartIdx, const bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
bool UndoWasEnabled() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
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< SwFormatHeader > RES_HEADER(96)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
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_FRMATR_END(133)
constexpr sal_uInt16 RES_CHRATR_END(46)
bool isPARATR_LIST(const sal_uInt16 nWhich)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
bool isDrawingLayerAttribute(const sal_uInt16 nWhich)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(155)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_RESTARTVALUE(85)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
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< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(157)
constexpr sal_uInt16 RES_UNKNOWNATR_END(154)
constexpr TypedWhichId< SvxRsidItem > RES_CHRATR_RSID(39)
constexpr sal_uInt16 RES_PARATR_LIST_END(88)
bool isFRMATR(const sal_uInt16 nWhich)
bool isBOXATR(const sal_uInt16 nWhich)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_TXTATR_UNKNOWN_CONTAINER(54)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISCOUNTED(86)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(160)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISRESTART(84)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxRsidItem > RES_PARATR_RSID(80)
bool isPARATR(const sal_uInt16 nWhich)
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< SvxBrushItem > RES_BACKGROUND(105)
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)
void CopyBookmarks(const SwPaM &rPam, const SwPosition &rCpyPam)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNodeIndex const &rPos)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
void dumpAsXml(xmlTextWriterPtr pWriter) const
Marks a position in the document model.
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