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 const 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 !isType<SdrObject>(pObj.get()) )
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
508 if( bFlyFormat || bDrawFormat )
513 ((RndStdIds::FLY_AT_PARA == rAnchor.
GetAnchorId()) ||
514 (RndStdIds::FLY_AT_FLY == rAnchor.
GetAnchorId()) ||
515 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId()) ||
516 ((RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId()) && bAsCharAlso)))
520 aRetval.insert(
SwPosFlyFrame(*pAnchorNode, pFly, aRetval.size()));
541 if ( pAnchoredObj->DynCastFlyFrame() != nullptr )
542 pFly = &(pAnchoredObj->GetFrameFormat());
543 else if ( bDrawAlso )
544 pFly = &(pAnchoredObj->GetFrameFormat());
549 if ((RndStdIds::FLY_AT_PARA != rAnchor.
GetAnchorId()) &&
550 (RndStdIds::FLY_AT_FLY != rAnchor.
GetAnchorId()) &&
554 if ( !pContentFrame )
560 while ( !pContentFrame && pPrv )
598 if (pOldItem !=
nullptr)
599 rNewSet.
Put( *pOldItem );
602 pOldItem = rOldSet.
GetItem( nWhich );
603 if (pOldItem !=
nullptr)
606 if (pNewItem !=
nullptr)
608 if (*pOldItem != *pNewItem)
609 rNewSet.
Put( *pOldItem );
612 OSL_FAIL(
"What am I doing here?");
616 OSL_FAIL(
"What am I doing here?");
625 SwLabelType const eType, std::u16string_view rText, std::u16string_view rSeparator,
626 const OUString& rNumberingSeparator,
627 const bool bBefore,
const sal_uInt16 nId,
const SwNodeOffset nNdIdx,
628 const OUString& rCharacterStyle,
637 "FieldType index out of bounds." );
644 for(
auto i = pTextFormatCollTable->
size();
i; )
648 pColl = (*pTextFormatCollTable)[
i];
652 OSL_ENSURE( pColl,
"no text collection found" );
673 OSL_ENSURE( pSttNd,
"No StartNode in InsertLabel." );
707 OSL_ENSURE( pOldFormat,
"Couldn't find the Fly's Format." );
712 const OUString sTitle( pOldFlyFrameFormat
713 ? pOldFlyFrameFormat->GetObjTitle()
715 const OUString sDescription( pOldFlyFrameFormat
716 ? pOldFlyFrameFormat->GetObjDescription()
725 std::unique_ptr<SfxItemSet> pNewSet = pNewFormat->
GetAttrSet().
Clone();
743 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
744 GetItemState(
RES_BOX,
true, &pItem ))
745 pNewSet->Put( *pItem );
746 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
750 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
752 pNewSet->Put( *pItem );
753 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
769 std::unique_ptr<SwFormatFrameSize> aFrameSize(pOldFormat->
GetFrameSize().
Clone());
771 pNewSet->Put( std::move(aFrameSize) );
786 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
789 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
794 assert(pHint &&
"Missing Hint.");
797 "Missing FlyInCnt-Hint." );
799 "Wrong TextFlyCnt-Hint." );
808 pNewSet->ClearItem();
813 sal_Int16 eVert = bBefore ? text::VertOrientation::BOTTOM : text::VertOrientation::TOP;
830 aFrameSize->SetWidthPercent(isMath ? 0 : 100);
832 pNewSet->Put( std::move(aFrameSize) );
850 pNewSet->Put( aAnch );
853 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
863 if ( pOldFlyFrameFormat )
865 pOldFlyFrameFormat->SetObjTitle( sTitle );
866 pOldFlyFrameFormat->SetObjDescription( sDescription );
872 OSL_ENSURE(
false,
"unknown LabelType?");
874 OSL_ENSURE( pNew,
"No Label inserted" );
878 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
881 if( bOrderNumberingFirst )
883 aText = rNumberingSeparator;
888 if( !bOrderNumberingFirst )
891 sal_Int32 nIdx = aText.getLength();
896 const sal_Int32 nSepIdx = aText.getLength();
907 if( bOrderNumberingFirst )
911 if(!rCharacterStyle.isEmpty())
938 rDoc.
GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
954 SwLabelType const eType, OUString
const& rText, OUString
const& rSeparator,
955 OUString
const& rNumberingSeparator,
956 bool const bBefore, sal_uInt16
const nId,
SwNodeOffset const nNdIdx,
957 OUString
const& rCharacterStyle,
960 std::unique_ptr<SwUndoInsertLabel> pUndo;
964 eType, rText, rSeparator, rNumberingSeparator,
965 bBefore,
nId, rCharacterStyle, bCpyBrd,
this ));
969 eType, rText, rSeparator, rNumberingSeparator, bBefore,
970 nId, nNdIdx, rCharacterStyle, bCpyBrd);
987 OUString
const& rText,
988 const OUString& rSeparator,
989 const OUString& rNumberSeparator,
990 const sal_uInt16 nId,
991 const OUString& rCharacterStyle,
999 "FieldType index out of bounds" );
1006 for(
auto i = pTextFormatCollTable->
size();
i; )
1010 pColl = (*pTextFormatCollTable)[
i];
1014 OSL_ENSURE( pColl,
"no text collection found" );
1043 std::unique_ptr<SfxItemSet> pNewSet = pOldFormat->
GetAttrSet().
Clone(
false );
1052 pNewSet->Put( aProtect );
1064 aOpaque.SetValue(
true );
1065 pNewSet->Put( aOpaque );
1073 pNewSet->Put( pOldFormat->
GetAnchor() );
1078 pNewSet->Put( aFrameSize );
1104 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
1107 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
1112 assert(pHint &&
"Missing Hint.");
1114#if OSL_DEBUG_LEVEL > 0
1116 "Missing FlyInCnt-Hint." );
1118 GetFrameFormat() ==
static_cast<SwFrameFormat*
>(pOldFormat),
1119 "Wrong TextFlyCnt-Hint." );
1126 pNewSet->ClearItem();
1142 pNewSet->Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
1143 pNewSet->Put(
SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) );
1151 pNewSet->Put( aAnch );
1155 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
1168 OSL_ENSURE( pNew,
"No Label inserted" );
1173 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
1177 if( bOrderNumberingFirst )
1179 aText = rNumberSeparator;
1184 if( !bOrderNumberingFirst )
1187 sal_Int32 nIdx = aText.getLength();
1188 aText += rSeparator;
1189 const sal_Int32 nSepIdx = aText.getLength();
1200 if( bOrderNumberingFirst )
1204 if ( !rCharacterStyle.isEmpty() )
1215 pNew->
InsertItem( aCharFormat, 0, nSepIdx + 1,
1226 OUString
const& rText,
1227 OUString
const& rSeparator,
1228 OUString
const& rNumberSeparator,
1229 sal_uInt16
const nId,
1230 OUString
const& rCharacterStyle,
1238 "InsertDrawLabel(): not a DrawFrameFormat" );
1244 std::unique_ptr<SwUndoInsertLabel> pUndo;
1250 nId, rCharacterStyle,
false,
this ));
1255 rText, rSeparator, rNumberSeparator,
nId, rCharacterStyle, rSdrObj);
1269static void lcl_collectUsedNums(std::vector<unsigned int>& rSetFlags, sal_Int32 nNmLen, std::u16string_view rName, std::u16string_view rCmpName)
1274 const sal_Int32 nNum =
o3tl::toInt32(rName.substr(nNmLen)) - 1;
1276 rSetFlags.push_back(nNum);
1290 assert(pSub &&
"IsGroupObject is implemented as GetSubList != nullptr");
1303 int first_available_number(std::vector<unsigned int>& numbers)
1305 std::sort(numbers.begin(), numbers.end());
1306 auto last = std::unique(numbers.begin(), numbers.end());
1307 numbers.erase(last, numbers.end());
1309 for (
size_t i = 0;
i < numbers.size(); ++
i)
1311 if (numbers[i] != i)
1315 return numbers.size();
1324 OUString
newName =
"MailMergeFly"
1330 if (!rPrefix.empty())
1336 OUString aPrefix =
SwResId(STR_MARK_COPY).replaceFirst(
"%1", rPrefix);
1340 aTmp = aPrefix + OUString::number(nCnt);
1351 sal_Int32 nNmLen =
aName.getLength();
1355 std::vector<unsigned int> aUsedNums;
1356 aUsedNums.reserve(rFormats.
size());
1376 return aName + OUString::number(nNum);
1432 if (rFormat.
GetName() == rName)
1436 OUString
sName( rName );
1446 pTyp = STR_GRAPHIC_DEFNAME;
1449 pTyp = STR_OBJECT_DEFNAME;
1462 sal_Int32
n, nFlyNum = 0, nGrfNum = 0, nOLENum = 0;
1464 const OUString sFlyNm(
SwResId(STR_FRAME_DEFNAME));
1465 const OUString sGrfNm(
SwResId(STR_GRAPHIC_DEFNAME));
1466 const OUString sOLENm(
SwResId(STR_OBJECT_DEFNAME));
1474 bool bContainsAtPageObjWithContentAnchor =
false;
1481 const OUString& aNm = pFlyFormat->
GetName();
1482 if ( !aNm.isEmpty() )
1484 sal_Int32 *pNum =
nullptr;
1486 if ( aNm.startsWith(sGrfNm) )
1488 nLen = sGrfNm.getLength();
1491 else if( aNm.startsWith(sFlyNm) )
1493 nLen = sFlyNm.getLength();
1496 else if( aNm.startsWith(sOLENm) )
1498 nLen = sOLENm.getLength();
1504 const sal_Int32 nNewLen =
o3tl::toInt32(aNm.subView( nLen ));
1505 if (*pNum < nNewLen)
1511 aArr.push_back( pFlyFormat );
1514 if ( !bContainsAtPageObjWithContentAnchor )
1517 if ( (RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) &&
1520 bContainsAtPageObjWithContentAnchor =
true;
1526 for(
n =
aArr.size();
n; )
1528 pFlyFormat =
aArr[ --
n ];
1535 pFlyFormat->
SetFormatName( sGrfNm + OUString::number( ++nGrfNum ));
1538 pFlyFormat->
SetFormatName( sOLENm + OUString::number( ++nOLENum ));
1541 pFlyFormat->
SetFormatName( sFlyNm + OUString::number( ++nFlyNum ));
1573 const SwNode* pNd = &rIdx;
1578#if OSL_DEBUG_LEVEL > 0
1579 std::vector<const SwFrameFormat*> checkFormats;
1582 const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
1583 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1584 checkFormats.push_back( pFormat );
1589 for (
size_t i = 0;
i < rFlys.size(); ++
i)
1593 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1595#if OSL_DEBUG_LEVEL > 0
1596 auto checkPos = std::find(
1597 checkFormats.begin(), checkFormats.end(), pFormat );
1598 assert( checkPos != checkFormats.end());
1599 checkFormats.erase( checkPos );
1602 if ((RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) ||
1616 OSL_ENSURE(
mbInReading,
"Found a FlySection but not a Format!");
1626 const Point* pPt )
const
1637 if ( nRet == SvxFrameDirection::Unknown )
1647 if( SvxFrameDirection::Environment == pItem->GetValue() )
1651 if ((RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId()) &&
1657 pFlyFormat =
nullptr;
1660 pFlyFormat =
nullptr;
1672 nRet = pItem->GetValue();
1680 return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir;
1691 if(rShell.GetLayout())
1692 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)
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
const SwFrameFormats * GetSpzFrameFormats() const
bool IsInMailMerge() const
::sw::DocumentSettingManager & GetDocumentSettingManager()
SdrObject * CloneSdrObj(const SdrObject &, bool bMoveWithinDoc=false, bool bInsInPage=true)
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.
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)