30#include <osl/diagnose.h>
36#include <com/sun/star/beans/XPropertySet.hpp>
37#include <com/sun/star/embed/XEmbeddedObject.hpp>
96#define DEF_FLY_WIDTH 2268
100 bool bResult =
false;
117 pPg = pNewPage.get();
123 if( bMoveWithinDoc && SdrInventor::FmForm == pObj->GetObjInventor() )
126 uno::Reference< awt::XControlModel >
xModel =
static_cast<SdrUnoObj*
>(pObj.get())->GetUnoControlModel();
128 uno::Reference< beans::XPropertySet > xSet(
xModel, uno::UNO_QUERY);
129 static constexpr OUStringLiteral
sName(
u"Name");
131 aVal = xSet->getPropertyValue(
sName );
135 xSet->setPropertyValue(
sName, aVal );
137 else if( bInsInPage )
142 if (
dynamic_cast<const SwFlyDrawObj*
>( pObj.get() ) ==
nullptr &&
144 pObj->GetObjIdentifier() != SdrObjKind::NewFrame )
151 pObj->SetLayer( nLayerIdForClone );
201 ( RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId() &&
203 ( RndStdIds::FLY_AT_PAGE == pAnchor->
GetAnchorId() &&
209 if (pAnchor && (RndStdIds::FLY_AT_FLY == pAnchor->
GetAnchorId()))
213 eAnchorId = RndStdIds::FLY_AT_FLY;
224 if ( RndStdIds::FLY_AT_PAGE != eAnchorId || !pAnchor || aAnch.
GetPageNum() == 0)
234 if ( RndStdIds::FLY_AS_CHAR == eAnchorId )
239 OSL_ENSURE(pTextNode!=
nullptr,
"There should be a SwTextNode!");
241 if (pTextNode !=
nullptr)
245 if (!pTextNode->
InsertItem(aFormat, nStt, nStt))
281 std::make_unique<SwUndoInsLayFormat>( pFormat, nNodeIdx, nCntIdx ));
294 if ( !pAnchorPos && (RndStdIds::FLY_AT_PAGE != eAnchorType) )
300 if ( RndStdIds::FLY_AT_PAGE != pAnch->
GetAnchorId() )
312 sal_uInt16 nCollId = o3tl::narrowing<sal_uInt16>(
324 assert(!bCalledFromShell || pAnchorNode);
335 eAnchorType, pFlySet, pFrameFormat );
358 OSL_ENSURE( rContent.
GetContentIdx(),
"No content prepared." );
363 std::optional<SwPosition> oPos( std::in_place,
aIndex );
365 if( pSelBoxes && !pSelBoxes->
empty() )
373 GetSttNd()->FindTableNode());
396 rTable.
MakeCopy(*
this, *oPos, *pSelBoxes);
404 OSL_ENSURE(
aIndex.GetNode().GetTextNode(),
405 "a TextNode should be here" );
426 if( rTmp.HasMark() &&
427 *rTmp.GetPoint() != *rTmp.GetMark() )
439 if( rTmp.HasMark() &&
440 *rTmp.GetPoint() != *rTmp.GetMark() )
466 const SwPaM* pTmp = pPam;
469 auto [pPaMStart, pPaMEnd] = pTmp->
StartEnd();
470 const SwNodeOffset nPamStartIndex = pPaMStart->GetNodeIndex();
471 const SwNodeOffset nPamEndIndex = pPaMEnd->GetNodeIndex();
472 if (RndStdIds::FLY_AT_PARA == rFlyFormatAnchor.
GetAnchorId())
473 bOk = (nPamStartIndex < nFlyIndex && nPamEndIndex > nFlyIndex) ||
474 (((nPamStartIndex == nFlyIndex) && (pPaMStart->GetContentIndex() == 0)) &&
475 (nPamEndIndex > nFlyIndex));
479 const sal_Int32 nPamEndContentIndex = pPaMEnd->GetContentIndex();
480 bOk = (nPamStartIndex < nFlyIndex &&
481 (( nPamEndIndex > nFlyIndex )||
482 ((nPamEndIndex == nFlyIndex) &&
483 (nPamEndContentIndex > nFlyContentIndex))) )
485 (((nPamStartIndex == nFlyIndex) &&
486 (pPaMStart->GetContentIndex() <= nFlyContentIndex)) &&
487 ((nPamEndIndex > nFlyIndex) ||
488 (nPamEndContentIndex > nFlyContentIndex )));
494 }
while( pPam != pTmp );
499 bool bAsCharAlso )
const
515 if( bFlyFormat || bDrawFormat )
525 if (pContentNodeIndex && pContentNodeIndex->
GetIndex() == pDirectFly->
GetIndex())
527 aRetval.insert(
SwPosFlyFrame(*pAnchorNode, pFly, aRetval.size()));
532 if ( (RndStdIds::FLY_AT_PARA == rAnchor.
GetAnchorId()) ||
533 (RndStdIds::FLY_AT_FLY == rAnchor.
GetAnchorId()) ||
534 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId()) ||
535 ((RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId()) && bAsCharAlso) )
539 aRetval.insert(
SwPosFlyFrame(*pAnchorNode, pFly, aRetval.size()));
560 if ( pAnchoredObj->DynCastFlyFrame() != nullptr )
561 pFly = &(pAnchoredObj->GetFrameFormat());
562 else if ( bDrawAlso )
563 pFly = &(pAnchoredObj->GetFrameFormat());
568 if ((RndStdIds::FLY_AT_PARA != rAnchor.
GetAnchorId()) &&
569 (RndStdIds::FLY_AT_FLY != rAnchor.
GetAnchorId()) &&
573 if ( !pContentFrame )
579 while ( !pContentFrame && pPrv )
617 if (pOldItem !=
nullptr)
618 rNewSet.
Put( *pOldItem );
621 pOldItem = rOldSet.
GetItem( nWhich );
622 if (pOldItem !=
nullptr)
625 if (pNewItem !=
nullptr)
627 if (*pOldItem != *pNewItem)
628 rNewSet.
Put( *pOldItem );
631 OSL_FAIL(
"What am I doing here?");
635 OSL_FAIL(
"What am I doing here?");
644 SwLabelType const eType, std::u16string_view rText, std::u16string_view rSeparator,
645 const OUString& rNumberingSeparator,
646 const bool bBefore,
const sal_uInt16 nId,
const SwNodeOffset nNdIdx,
647 const OUString& rCharacterStyle,
656 "FieldType index out of bounds." );
663 for(
auto i = pTextFormatCollTable->
size();
i; )
667 pColl = (*pTextFormatCollTable)[
i];
671 OSL_ENSURE( pColl,
"no text collection found" );
692 OSL_ENSURE( pSttNd,
"No StartNode in InsertLabel." );
726 OSL_ENSURE( pOldFormat,
"Couldn't find the Fly's Format." );
731 const OUString sTitle( pOldFlyFrameFormat
732 ? pOldFlyFrameFormat->GetObjTitle()
734 const OUString sDescription( pOldFlyFrameFormat
735 ? pOldFlyFrameFormat->GetObjDescription()
744 std::unique_ptr<SfxItemSet> pNewSet = pNewFormat->
GetAttrSet().
Clone();
762 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
763 GetItemState(
RES_BOX,
true, &pItem ))
764 pNewSet->Put( *pItem );
765 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
769 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
771 pNewSet->Put( *pItem );
772 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
788 std::unique_ptr<SwFormatFrameSize> aFrameSize(pOldFormat->
GetFrameSize().
Clone());
790 pNewSet->Put( std::move(aFrameSize) );
805 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
808 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
813 assert(pHint &&
"Missing Hint.");
816 "Missing FlyInCnt-Hint." );
818 "Wrong TextFlyCnt-Hint." );
827 pNewSet->ClearItem();
832 sal_Int16 eVert = bBefore ? text::VertOrientation::BOTTOM : text::VertOrientation::TOP;
849 aFrameSize->SetWidthPercent(isMath ? 0 : 100);
851 pNewSet->Put( std::move(aFrameSize) );
869 pNewSet->Put( aAnch );
872 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
882 if ( pOldFlyFrameFormat )
884 pOldFlyFrameFormat->SetObjTitle( sTitle );
885 pOldFlyFrameFormat->SetObjDescription( sDescription );
891 OSL_ENSURE(
false,
"unknown LabelType?");
893 OSL_ENSURE( pNew,
"No Label inserted" );
897 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
900 if( bOrderNumberingFirst )
902 aText = rNumberingSeparator;
907 if( !bOrderNumberingFirst )
910 sal_Int32 nIdx = aText.getLength();
915 const sal_Int32 nSepIdx = aText.getLength();
926 if( bOrderNumberingFirst )
930 if(!rCharacterStyle.isEmpty())
957 rDoc.
GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
973 SwLabelType const eType, OUString
const& rText, OUString
const& rSeparator,
974 OUString
const& rNumberingSeparator,
975 bool const bBefore, sal_uInt16
const nId,
SwNodeOffset const nNdIdx,
976 OUString
const& rCharacterStyle,
979 std::unique_ptr<SwUndoInsertLabel> pUndo;
983 eType, rText, rSeparator, rNumberingSeparator,
984 bBefore,
nId, rCharacterStyle, bCpyBrd,
this ));
988 eType, rText, rSeparator, rNumberingSeparator, bBefore,
989 nId, nNdIdx, rCharacterStyle, bCpyBrd);
1006 OUString
const& rText,
1007 const OUString& rSeparator,
1008 const OUString& rNumberSeparator,
1009 const sal_uInt16 nId,
1010 const OUString& rCharacterStyle,
1018 "FieldType index out of bounds" );
1025 for(
auto i = pTextFormatCollTable->
size();
i; )
1029 pColl = (*pTextFormatCollTable)[
i];
1033 OSL_ENSURE( pColl,
"no text collection found" );
1062 std::unique_ptr<SfxItemSet> pNewSet = pOldFormat->
GetAttrSet().
Clone(
false );
1071 pNewSet->Put( aProtect );
1083 aOpaque.SetValue(
true );
1084 pNewSet->Put( aOpaque );
1092 pNewSet->Put( pOldFormat->
GetAnchor() );
1097 pNewSet->Put( aFrameSize );
1123 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
1126 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
1131 assert(pHint &&
"Missing Hint.");
1133#if OSL_DEBUG_LEVEL > 0
1135 "Missing FlyInCnt-Hint." );
1137 GetFrameFormat() ==
static_cast<SwFrameFormat*
>(pOldFormat),
1138 "Wrong TextFlyCnt-Hint." );
1145 pNewSet->ClearItem();
1161 pNewSet->Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
1162 pNewSet->Put(
SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) );
1170 pNewSet->Put( aAnch );
1174 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
1187 OSL_ENSURE( pNew,
"No Label inserted" );
1192 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
1196 if( bOrderNumberingFirst )
1198 aText = rNumberSeparator;
1203 if( !bOrderNumberingFirst )
1206 sal_Int32 nIdx = aText.getLength();
1207 aText += rSeparator;
1208 const sal_Int32 nSepIdx = aText.getLength();
1219 if( bOrderNumberingFirst )
1223 if ( !rCharacterStyle.isEmpty() )
1234 pNew->
InsertItem( aCharFormat, 0, nSepIdx + 1,
1245 OUString
const& rText,
1246 OUString
const& rSeparator,
1247 OUString
const& rNumberSeparator,
1248 sal_uInt16
const nId,
1249 OUString
const& rCharacterStyle,
1257 "InsertDrawLabel(): not a DrawFrameFormat" );
1263 std::unique_ptr<SwUndoInsertLabel> pUndo;
1269 nId, rCharacterStyle,
false,
this ));
1274 rText, rSeparator, rNumberSeparator,
nId, rCharacterStyle, rSdrObj);
1288static void lcl_collectUsedNums(std::vector<unsigned int>& rSetFlags, sal_Int32 nNmLen, std::u16string_view rName, std::u16string_view rCmpName)
1293 const sal_Int32 nNum =
o3tl::toInt32(rName.substr(nNmLen)) - 1;
1295 rSetFlags.push_back(nNum);
1309 assert(pSub &&
"IsGroupObject is implemented as GetSubList != nullptr");
1322 int first_available_number(std::vector<unsigned int>& numbers)
1324 std::sort(numbers.begin(), numbers.end());
1325 auto last = std::unique(numbers.begin(), numbers.end());
1326 numbers.erase(last, numbers.end());
1328 for (
size_t i = 0;
i < numbers.size(); ++
i)
1330 if (numbers[i] != i)
1334 return numbers.size();
1343 OUString
newName =
"MailMergeFly"
1349 if (!rPrefix.empty())
1355 OUString aPrefix =
SwResId(STR_MARK_COPY).replaceFirst(
"%1", rPrefix);
1359 aTmp = aPrefix + OUString::number(nCnt);
1370 sal_Int32 nNmLen =
aName.getLength();
1372 std::vector<unsigned int> aUsedNums;
1377 if (
eType != pFlyFormat->Which())
1381 const SdrObject *pObj = pFlyFormat->FindSdrObject();
1386 OUString
sName = pFlyFormat->GetName();
1391 auto nNum = first_available_number(aUsedNums) + 1;
1392 return aName + OUString::number(nNum);
1448 if (rFormat.
GetName() == rName)
1452 OUString
sName( rName );
1462 pTyp = STR_GRAPHIC_DEFNAME;
1465 pTyp = STR_OBJECT_DEFNAME;
1478 sal_Int32
n, nFlyNum = 0, nGrfNum = 0, nOLENum = 0;
1480 const OUString sFlyNm(
SwResId(STR_FRAME_DEFNAME));
1481 const OUString sGrfNm(
SwResId(STR_GRAPHIC_DEFNAME));
1482 const OUString sOLENm(
SwResId(STR_OBJECT_DEFNAME));
1490 bool bContainsAtPageObjWithContentAnchor =
false;
1497 const OUString& aNm = pFlyFormat->
GetName();
1498 if ( !aNm.isEmpty() )
1500 sal_Int32 *pNum =
nullptr;
1502 if ( aNm.startsWith(sGrfNm) )
1504 nLen = sGrfNm.getLength();
1507 else if( aNm.startsWith(sFlyNm) )
1509 nLen = sFlyNm.getLength();
1512 else if( aNm.startsWith(sOLENm) )
1514 nLen = sOLENm.getLength();
1520 const sal_Int32 nNewLen =
o3tl::toInt32(aNm.subView( nLen ));
1521 if (*pNum < nNewLen)
1527 aArr.push_back( pFlyFormat );
1530 if ( !bContainsAtPageObjWithContentAnchor )
1533 if ( (RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) &&
1536 bContainsAtPageObjWithContentAnchor =
true;
1542 for(
n =
aArr.size();
n; )
1544 pFlyFormat =
aArr[ --
n ];
1551 pFlyFormat->
SetFormatName( sGrfNm + OUString::number( ++nGrfNum ));
1554 pFlyFormat->
SetFormatName( sOLENm + OUString::number( ++nOLENum ));
1557 pFlyFormat->
SetFormatName( sFlyNm + OUString::number( ++nFlyNum ));
1589 const SwNode* pNd = &rIdx;
1594#if OSL_DEBUG_LEVEL > 0
1595 std::vector<const SwFrameFormat*> checkFormats;
1598 const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
1599 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1600 checkFormats.push_back( pFormat );
1605 for (
size_t i = 0;
i < rFlys.size(); ++
i)
1609 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1611#if OSL_DEBUG_LEVEL > 0
1612 auto checkPos = std::find(
1613 checkFormats.begin(), checkFormats.end(), pFormat );
1614 assert( checkPos != checkFormats.end());
1615 checkFormats.erase( checkPos );
1618 if ((RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) ||
1632 OSL_ENSURE(
mbInReading,
"Found a FlySection but not a Format!");
1642 const Point* pPt )
const
1653 if ( nRet == SvxFrameDirection::Unknown )
1663 if( SvxFrameDirection::Environment == pItem->GetValue() )
1667 if ((RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId()) &&
1673 pFlyFormat =
nullptr;
1676 pFlyFormat =
nullptr;
1688 nRet = pItem->GetValue();
1696 return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir;
1707 if(rShell.GetLayout())
1708 aAllLayouts.
insert(rShell.GetLayout());
@ IsMoveToFly
MakeFlyAndMove.
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
virtual bool MoveNodeRange(SwNodeRange &, SwNode &, SwMoveFlags)=0
virtual SdrLayerID GetInvisibleLayerIdByVisibleOne(SdrLayerID _nVisibleLayerId)=0
method to determine, if the corresponding invisible layer ID for a visible one.
virtual SwDrawModel * GetOrCreateDrawModel()=0
virtual SdrLayerID GetHellId() const =0
virtual SdrLayerID GetInvisibleHellId() const =0
virtual SdrLayerID GetHeavenId() const =0
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual SdrLayerID GetInvisibleHeavenId() const =0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void SetRedlineMove(bool bFlag)=0
virtual void SetModified()=0
Must be called manually at changes of format.
virtual SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)=0
Return required automatic format.
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void InsertObjectThenMakeNameUnique(SdrObject *pObj)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
bool IsResizeProtect() const
bool IsMoveProtect() const
virtual SdrObjList * GetSubList() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual const OUString & GetName() const
bool IsGroupObject() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const=0
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) 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 * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
static sal_uInt16 IsMath(const SvGlobalName &rName)
void SetSizeProtect(bool bNew)
void SetContentProtect(bool bNew)
void SetPosProtect(bool bNew)
void SetHeight(tools::Long n)
void SetWidth(tools::Long n)
wrapper class for the positioning of Writer fly frames and drawing objects
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const override
const SvxFormatKeepItem & GetKeep(bool=true) const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Marks a character position inside a document model content node (SwContentNode)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
virtual bool SetAttr(const SfxPoolItem &)
made virtual
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt) const
determines the text direction for a certain position.
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
SwFlyFrameFormat * InsertDrawLabel(const OUString &rText, const OUString &rSeparator, const OUString &rNumberSeparator, const sal_uInt16 nId, const OUString &rCharacterStyle, SdrObject &rObj)
void SetFlyName(SwFlyFrameFormat &rFormat, const OUString &rName)
OUString GetUniqueOLEName() const
const SwFootnoteInfo & GetFootnoteInfo() const
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
IDocumentState const & getIDocumentState() const
SwFlyFrameFormat * InsertLabel(const SwLabelType eType, const OUString &rText, const OUString &rSeparator, const OUString &rNumberingSeparator, const bool bBefore, const sal_uInt16 nId, const SwNodeOffset nIdx, const OUString &rCharacterStyle, const bool bCpyBrd)
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
OUString GetUniqueGrfName(std::u16string_view rPrefix=std::u16string_view()) const
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
SwCharFormat * FindCharFormatByName(const OUString &rName) const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
OUString GetUniqueShapeName() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
SwFlyFrameFormat * MakeFlySection_(const SwPosition &rAnchPos, const SwContentNode &rNode, RndStdIds eRequestId, const SfxItemSet *pFlyAttrSet, SwFrameFormat *)
void SetContainsAtPageObjWithContentAnchor(const bool bFlag)
rtl::Reference< SdrObject > CloneSdrObj(const SdrObject &, bool bMoveWithinDoc=false, bool bInsInPage=true)
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
OUString GetUniqueDrawObjectName() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
const SwTextFormatColl * GetDfltTextFormatColl() const
SwPosFlyFrames GetAllFlyFormats(const SwPaM *, bool bDrawAlso, bool bAsCharAlso=false) const
Returns positions of all FlyFrames in the document.
void SetAllUniqueFlyNames()
const SwAttrPool & GetAttrPool() const
bool IsInVerticalText(const SwPosition &rPos) const
OUString GetUniqueFrameName() const
SwFlyFrameFormat * MakeFlyAndMove(const SwPaM &rPam, const SfxItemSet &rSet, const SwSelBoxes *pSelBoxes, SwFrameFormat *pParent)
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
bool IsInMailMerge() const
::sw::DocumentSettingManager & GetDocumentSettingManager()
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt=nullptr) const
bool IsInHeaderFooter(const SwNode &) const
virtual rtl::Reference< SdrPage > AllocPage(bool bMasterPage) override
Create a new page (SdPage) and return a pointer to it back.
Instances of SwFields and those derived from it occur 0 to n times.
virtual OUString GetName() const
Only in derived classes.
Content, content of frame (header, footer, fly).
const SwNodeIndex * GetContentIdx() const
const SwContentNode * GetNode() const
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
virtual Size GetTwipSize() const =0
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
const SwStartNode * FindFooterStartNode() const
bool IsNoTextNode() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
const SwStartNode * FindHeaderStartNode() const
const SwStartNode * FindFlyStartNode() const
const SwPageDesc * FindPageDesc(SwNodeOffset *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
SwNoTextNode * GetNoTextNode()
SwNodeType GetNodeType() const
std::vector< SwFrameFormat * > const & GetAnchoredFlys() const
const SwEndNode * EndOfSectionNode() const
SwTextNode * MakeTextNode(SwNode &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
SwStartNode * MakeTextSection(const SwNode &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
void SectionDown(SwNodeRange *pRange, SwStartNodeType=SwNormalStartNode)
create a start/end section pair
const SwOLEObj & GetOLEObj() const
svt::EmbeddedObjectRef & GetObject()
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
const SwPosition * GetPoint() const
SwFrameFormat & GetMaster()
A page of the document layout.
const SwSortedObjs * GetSortedObjs() const
SwContentFrame * FindFirstBodyContent()
For querying current flys in document.
class for collecting anchored objects
Starts a section of nodes in the document model.
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableFormat * GetFrameFormat()
SwTableSortBoxes & GetTabSortBoxes()
bool MakeCopy(SwDoc &, const SwPosition &, const SwSelBoxes &, bool bCpyName=false, const OUString &rStyleName="") const
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const SwFormatFlyCnt & GetFlyCnt() const
Represents the style of a paragraph.
Represents the visualization of a paragraph.
SwTextNode * GetTextNodeFirst()
SwTextNode is a paragraph in the document model.
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
OUString InsertText(const OUString &rStr, const SwContentIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
void SetFlys(SwFrameFormat &rOldFly, SfxItemSet const &rChgSet, SwFrameFormat &rNewFly)
void SetDrawObj(SdrLayerID nLayerId)
void SetNodePos(SwNodeOffset nNd)
std::pair< const_iterator, bool > insert(Value &&x)
ring_container GetRingContainer()
TOOLS_DLLPUBLIC OString DateTimeToOString(const DateTime &rDateTime)
virtual OUString GetName() const override
static void lcl_collectUsedNums(std::vector< unsigned int > &rSetFlags, sal_Int32 nNmLen, std::u16string_view rName, std::u16string_view rCmpName)
static void lcl_CpyAttr(SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWhich)
static SwFlyFrameFormat * lcl_InsertLabel(SwDoc &rDoc, SwTextFormatColls *const pTextFormatCollTable, SwUndoInsertLabel *const pUndo, SwLabelType const eType, std::u16string_view rText, std::u16string_view rSeparator, const OUString &rNumberingSeparator, const bool bBefore, const sal_uInt16 nId, const SwNodeOffset nNdIdx, const OUString &rCharacterStyle, const bool bCpyBrd)
static OUString lcl_GetUniqueFlyName(const SwDoc &rDoc, TranslateId pDefStrId, sal_uInt16 eType, std::u16string_view rPrefix=std::u16string_view(), SwNodeType nNdTyp=SwNodeType::NONE)
static SwFlyFrameFormat * lcl_InsertDrawLabel(SwDoc &rDoc, SwTextFormatColls *const pTextFormatCollTable, SwUndoInsertLabel *const pUndo, SwDrawFrameFormat *const pOldFormat, OUString const &rText, const OUString &rSeparator, const OUString &rNumberSeparator, const sal_uInt16 nId, const OUString &rCharacterStyle, SdrObject &rSdrObj)
static bool lcl_TstFlyRange(const SwPaM *pPam, const SwFormatAnchor &rFlyFormatAnchor)
static bool lcl_IsItemSet(const SwContentNode &rNode, sal_uInt16 which)
std::deque< AttacherIndex_Impl > aIndex
std::set< SwPosFlyFrame, SwPosFlyFrameCmp > SwPosFlyFrames
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(116)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(106)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr sal_uInt16 RES_FMT_END(167)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr sal_uInt16 RES_FMT_BEGIN(RES_UNKNOWNATR_END)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
OUString newName(std::u16string_view aNewPrefix, std::u16string_view aOldPrefix, std::u16string_view old_Name)
constexpr OUStringLiteral last
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
@ RES_POOLCOLL_TEXT
Text body.
@ RES_POOLCOLL_LABEL
Subgroup labels.
@ RES_POOLCOLL_FRAME
Other stuff.
@ RES_POOLFRM_FRAME
Frame.
Marks a position in the document model.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
Reference< XModel > xModel
OUString SwResId(TranslateId aId)