34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/embed/XEmbeddedObject.hpp>
37 #include <drawdoc.hxx>
82 #include <strings.hrc>
88 #include <string_view>
93 #define DEF_FLY_WIDTH 2268 // Default width for FlyFrames (2268 == 4cm)
119 if( bMoveWithinDoc && SdrInventor::FmForm == pObj->GetObjInventor() )
122 uno::Reference< awt::XControlModel >
xModel =
static_cast<SdrUnoObj*
>(pObj)->GetUnoControlModel();
124 uno::Reference< beans::XPropertySet > xSet(xModel, uno::UNO_QUERY);
125 const OUString
sName(
"Name");
127 aVal = xSet->getPropertyValue( sName );
131 xSet->setPropertyValue( sName, aVal );
133 else if( bInsInPage )
138 if ( dynamic_cast<const SwFlyDrawObj*>( pObj) ==
nullptr &&
139 dynamic_cast<const SwVirtFlyDrawObj*>( pObj) ==
nullptr &&
147 pObj->SetLayer( nLayerIdForClone );
183 reinterpret_cast<const SfxPoolItem**>(&pAnchor) );
199 ( RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId() &&
201 ( RndStdIds::FLY_AT_PAGE == pAnchor->
GetAnchorId() &&
207 if (pAnchor && (RndStdIds::FLY_AT_FLY == pAnchor->
GetAnchorId()))
210 aAnch.SetAnchor( &aPos );
211 eAnchorId = RndStdIds::FLY_AT_FLY;
215 if( eRequestId != aAnch.GetAnchorId() &&
218 aAnch.SetType( eRequestId );
221 eAnchorId = aAnch.GetAnchorId();
222 if ( RndStdIds::FLY_AT_PAGE != eAnchorId || !pAnchor || aAnch.
GetPageNum() == 0)
224 aAnch.SetAnchor( &rAnchPos );
232 if ( RndStdIds::FLY_AS_CHAR == eAnchorId )
237 OSL_ENSURE(pTextNode!=
nullptr,
"There should be a SwTextNode!");
239 if (pTextNode !=
nullptr)
243 if (!pTextNode->
InsertItem(aFormat, nStt, nStt))
258 if(
MINFLY > aSize.Width() )
260 aFormatSize.
SetWidth( aSize.Width() );
279 std::make_unique<SwUndoInsLayFormat>( pFormat, nNodeIdx, nCntIdx ));
292 if ( !pAnchorPos && (RndStdIds::FLY_AT_PAGE != eAnchorType) )
295 if( (pFlySet && SfxItemState::SET == pFlySet->
GetItemState(
296 RES_ANCHOR,
false, reinterpret_cast<const SfxPoolItem**>(&pAnch) )) ||
297 ( pFrameFormat && SfxItemState::SET == pFrameFormat->
GetItemState(
298 RES_ANCHOR,
true, reinterpret_cast<const SfxPoolItem**>(&pAnch) )) )
300 if ( RndStdIds::FLY_AT_PAGE != pAnch->
GetAnchorId() )
312 sal_uInt16 nCollId =
static_cast<sal_uInt16
>(
324 assert(!bCalledFromShell || pAnchorNode);
336 eAnchorType, pFlySet, pFrameFormat );
359 OSL_ENSURE( rContent.
GetContentIdx(),
"No content prepared." );
368 if( pSelBoxes && !pSelBoxes->
empty() )
376 GetSttNd()->FindTableNode());
391 if( aRg.aEnd.GetNode().IsEndNode() )
399 rTable.
MakeCopy(*
this, aPos, *pSelBoxes);
407 OSL_ENSURE( aIndex.GetNode().GetTextNode(),
408 "a TextNode should be here" );
429 if( rTmp.HasMark() &&
430 *rTmp.GetPoint() != *rTmp.GetMark() )
442 if( rTmp.HasMark() &&
443 *rTmp.GetPoint() != *rTmp.GetMark() )
470 const SwPaM* pTmp = pPam;
475 const sal_uInt32 nPamStartIndex = pPaMStart->
nNode.
GetIndex();
477 if (RndStdIds::FLY_AT_PARA == nAnchorId)
478 bOk = (nPamStartIndex < nFlyIndex && nPamEndIndex > nFlyIndex) ||
479 (((nPamStartIndex == nFlyIndex) && (pPaMStart->
nContent.
GetIndex() == 0)) &&
480 (nPamEndIndex > nFlyIndex));
485 bOk = (nPamStartIndex < nFlyIndex &&
486 (( nPamEndIndex > nFlyIndex )||
487 ((nPamEndIndex == nFlyIndex) &&
488 (nPamEndContentIndex > nFlyContentIndex))) )
490 (((nPamStartIndex == nFlyIndex) &&
492 ((nPamEndIndex > nFlyIndex) ||
493 (nPamEndContentIndex > nFlyContentIndex )));
499 }
while( pPam != pTmp );
504 bool bAsCharAlso )
const
513 if( bFlyFormat || bDrawFormat )
518 ((RndStdIds::FLY_AT_PARA == rAnchor.
GetAnchorId()) ||
519 (RndStdIds::FLY_AT_FLY == rAnchor.
GetAnchorId()) ||
520 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId()) ||
521 ((RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId()) && bAsCharAlso)))
526 aRetval.insert(std::make_shared<SwPosFlyFrame>(pAPos->
nNode, pFly, aRetval.size()));
547 if ( dynamic_cast<const SwFlyFrame*>( pAnchoredObj) !=
nullptr )
548 pFly = &(pAnchoredObj->GetFrameFormat());
549 else if ( bDrawAlso )
550 pFly = &(pAnchoredObj->GetFrameFormat());
555 if ((RndStdIds::FLY_AT_PARA != rAnchor.
GetAnchorId()) &&
556 (RndStdIds::FLY_AT_FLY != rAnchor.
GetAnchorId()) &&
560 if ( !pContentFrame )
566 while ( !pContentFrame && pPrv )
575 ? *
static_cast<SwTextFrame const*
>(pContentFrame)->GetTextNodeFirst()
577 aRetval.insert(std::make_shared<SwPosFlyFrame>(aIdx, pFly, aRetval.size()));
604 if (pOldItem !=
nullptr)
605 rNewSet.
Put( *pOldItem );
608 pOldItem = rOldSet.
GetItem( nWhich );
609 if (pOldItem !=
nullptr)
612 if (pNewItem !=
nullptr)
614 if (*pOldItem != *pNewItem)
615 rNewSet.
Put( *pOldItem );
618 OSL_FAIL(
"What am I doing here?");
622 OSL_FAIL(
"What am I doing here?");
631 SwLabelType const eType, std::u16string_view rText, std::u16string_view rSeparator,
632 const OUString& rNumberingSeparator,
633 const bool bBefore,
const sal_uInt16 nId,
const sal_uLong nNdIdx,
634 const OUString& rCharacterStyle,
643 "FieldType index out of bounds." );
650 for(
auto i = pTextFormatCollTable->
size();
i; )
652 if( (*pTextFormatCollTable)[ --
i ]->GetName()==pType->GetName() )
654 pColl = (*pTextFormatCollTable)[
i];
658 OSL_ENSURE( pColl,
"no text collection found" );
679 OSL_ENSURE( pSttNd,
"No StartNode in InsertLabel." );
713 OSL_ENSURE( pOldFormat,
"Couldn't find the Fly's Format." );
717 const bool bIsSwFlyFrameFormatInstance( dynamic_cast<SwFlyFrameFormat*>(pOldFormat) !=
nullptr );
718 const OUString sTitle( bIsSwFlyFrameFormatInstance
719 ? static_cast<SwFlyFrameFormat*>(pOldFormat)->GetObjTitle()
721 const OUString sDescription( bIsSwFlyFrameFormatInstance
722 ? static_cast<SwFlyFrameFormat*>(pOldFormat)->GetObjDescription()
731 std::unique_ptr<SfxItemSet> pNewSet = pNewFormat->
GetAttrSet().
Clone();
749 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
750 GetItemState(
RES_BOX,
true, &pItem ))
751 pNewSet->Put( *pItem );
752 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
756 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
758 pNewSet->Put( *pItem );
759 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
775 std::unique_ptr<SwFormatFrameSize> aFrameSize(pOldFormat->
GetFrameSize().
Clone());
777 pNewSet->Put( std::move(aFrameSize) );
792 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
796 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
801 assert(pHint &&
"Missing Hint.");
804 "Missing FlyInCnt-Hint." );
806 "Wrong TextFlyCnt-Hint." );
815 pNewSet->ClearItem();
820 sal_Int16 eVert = bBefore ? text::VertOrientation::BOTTOM : text::VertOrientation::TOP;
837 aFrameSize->SetWidthPercent(isMath ? 0 : 100);
839 pNewSet->Put( std::move(aFrameSize) );
857 pNewSet->Put( aAnch );
860 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
870 if ( bIsSwFlyFrameFormatInstance )
873 static_cast<SwFlyFrameFormat*
>(pOldFormat)->SetObjDescription( sDescription );
879 OSL_ENSURE(
false,
"unknown LabelType?");
881 OSL_ENSURE( pNew,
"No Label inserted" );
885 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
888 if( bOrderNumberingFirst )
890 aText = rNumberingSeparator;
894 aText += pType->GetName();
895 if( !bOrderNumberingFirst )
898 sal_Int32 nIdx = aText.getLength();
903 const sal_Int32 nSepIdx = aText.getLength();
914 if( bOrderNumberingFirst )
918 if(!rCharacterStyle.isEmpty())
945 rDoc.
GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
961 SwLabelType const eType, OUString
const& rText, OUString
const& rSeparator,
962 OUString
const& rNumberingSeparator,
963 bool const bBefore, sal_uInt16
const nId,
sal_uLong const nNdIdx,
964 OUString
const& rCharacterStyle,
967 std::unique_ptr<SwUndoInsertLabel> pUndo;
971 eType, rText, rSeparator, rNumberingSeparator,
972 bBefore, nId, rCharacterStyle, bCpyBrd,
this ));
976 eType, rText, rSeparator, rNumberingSeparator, bBefore,
977 nId, nNdIdx, rCharacterStyle, bCpyBrd);
994 OUString
const& rText,
995 const OUString& rSeparator,
996 const OUString& rNumberSeparator,
997 const sal_uInt16 nId,
998 const OUString& rCharacterStyle,
1006 "FieldType index out of bounds" );
1013 for(
auto i = pTextFormatCollTable->
size();
i; )
1015 if( (*pTextFormatCollTable)[ --
i ]->GetName()==pType->GetName() )
1017 pColl = (*pTextFormatCollTable)[
i];
1021 OSL_ENSURE( pColl,
"no text collection found" );
1050 std::unique_ptr<SfxItemSet> pNewSet = pOldFormat->
GetAttrSet().
Clone(
false );
1059 pNewSet->Put( aProtect );
1071 aOpaque.SetValue(
true );
1072 pNewSet->Put( aOpaque );
1080 pNewSet->Put( pOldFormat->
GetAnchor() );
1085 pNewSet->Put( aFrameSize );
1111 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
1115 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
1120 assert(pHint &&
"Missing Hint.");
1122 #if OSL_DEBUG_LEVEL > 0
1124 "Missing FlyInCnt-Hint." );
1126 GetFrameFormat() ==
static_cast<SwFrameFormat*
>(pOldFormat),
1127 "Wrong TextFlyCnt-Hint." );
1134 pNewSet->ClearItem();
1150 pNewSet->Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
1151 pNewSet->Put(
SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) );
1159 pNewSet->Put( aAnch );
1163 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
1176 OSL_ENSURE( pNew,
"No Label inserted" );
1181 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
1185 if( bOrderNumberingFirst )
1187 aText = rNumberSeparator;
1191 aText += pType->GetName();
1192 if( !bOrderNumberingFirst )
1195 sal_Int32 nIdx = aText.getLength();
1196 aText += rSeparator;
1197 const sal_Int32 nSepIdx = aText.getLength();
1202 pNew->InsertText( aText, aIdx );
1208 if( bOrderNumberingFirst )
1211 pNew->InsertItem( aFormat, nIdx, nIdx );
1212 if ( !rCharacterStyle.isEmpty() )
1223 pNew->InsertItem( aCharFormat, 0, nSepIdx + 1,
1234 OUString
const& rText,
1235 OUString
const& rSeparator,
1236 OUString
const& rNumberSeparator,
1237 sal_uInt16
const nId,
1238 OUString
const& rCharacterStyle,
1246 "InsertDrawLabel(): not a DrawFrameFormat" );
1252 std::unique_ptr<SwUndoInsertLabel> pUndo;
1258 nId, rCharacterStyle,
false,
this ));
1263 rText, rSeparator, rNumberSeparator, nId, rCharacterStyle, rSdrObj);
1277 static void lcl_collectUsedNums(std::vector<unsigned int>& rSetFlags, sal_Int32 nNmLen,
const OUString& rName, std::u16string_view rCmpName)
1279 if (rName.startsWith(rCmpName))
1282 const sal_Int32 nNum = rName.copy(nNmLen).toInt32() - 1;
1284 rSetFlags.push_back(nNum);
1298 assert(pSub &&
"IsGroupObject is implemented as GetSubList != nullptr");
1299 const size_t nCount = pSub->GetObjCount();
1300 for (
size_t i = 0;
i < nCount; ++
i)
1311 int first_available_number(std::vector<unsigned int>& numbers)
1313 std::sort(numbers.begin(), numbers.end());
1314 auto last = std::unique(numbers.begin(), numbers.end());
1315 numbers.erase(last, numbers.end());
1317 for (
size_t i = 0;
i < numbers.size(); ++
i)
1319 if (numbers[i] != i)
1323 return numbers.size();
1332 OUString
newName =
"MailMergeFly"
1339 sal_Int32 nNmLen = aName.getLength();
1343 std::vector<unsigned int> aUsedNums;
1344 aUsedNums.reserve(rFormats.
size());
1349 if (eType != pFlyFormat->
Which())
1364 return aName + OUString::number(nNum);
1395 for(
auto it = range.first; it != range.second; it++ )
1410 return static_cast<const SwFlyFrameFormat*>(pFlyFormat);
1421 OUString
sName( rName );
1424 const char* pTyp = STR_FRAME_DEFNAME;
1431 pTyp = STR_GRAPHIC_DEFNAME;
1434 pTyp = STR_OBJECT_DEFNAME;
1441 rFormat.
SetName( sName,
true );
1447 sal_Int32
n, nFlyNum = 0, nGrfNum = 0, nOLENum = 0;
1449 const OUString sFlyNm(
SwResId(STR_FRAME_DEFNAME));
1450 const OUString sGrfNm(
SwResId(STR_GRAPHIC_DEFNAME));
1451 const OUString sOLENm(
SwResId(STR_OBJECT_DEFNAME));
1459 bool bContainsAtPageObjWithContentAnchor =
false;
1466 const OUString& aNm = pFlyFormat->
GetName();
1467 if ( !aNm.isEmpty() )
1469 sal_Int32 *pNum =
nullptr;
1471 if ( aNm.startsWith(sGrfNm) )
1473 nLen = sGrfNm.getLength();
1476 else if( aNm.startsWith(sFlyNm) )
1478 nLen = sFlyNm.getLength();
1481 else if( aNm.startsWith(sOLENm) )
1483 nLen = sOLENm.getLength();
1489 const sal_Int32 nNewLen = aNm.copy( nLen ).toInt32();
1490 if (*pNum < nNewLen)
1499 if ( !bContainsAtPageObjWithContentAnchor )
1502 if ( (RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) &&
1505 bContainsAtPageObjWithContentAnchor =
true;
1511 for( n = aArr.
size(); n; )
1513 pFlyFormat = aArr[ --n ];
1520 pFlyFormat->
SetName( sGrfNm + OUString::number( ++nGrfNum ));
1523 pFlyFormat->
SetName( sOLENm + OUString::number( ++nOLENum ));
1526 pFlyFormat->
SetName( sFlyNm + OUString::number( ++nFlyNum ));
1563 #if OSL_DEBUG_LEVEL > 0
1564 std::vector<const SwFrameFormat*> checkFormats;
1567 const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
1568 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1569 checkFormats.push_back( pFormat );
1572 std::vector<SwFrameFormat*>
const*
const pFlys(pFlyNd->
GetAnchoredFlys());
1574 for (
size_t i = 0; pFlys &&
i < pFlys->size(); ++
i)
1578 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1580 #if OSL_DEBUG_LEVEL > 0
1581 auto checkPos = std::find(
1582 checkFormats.begin(), checkFormats.end(), pFormat );
1583 assert( checkPos != checkFormats.end());
1584 checkFormats.erase( checkPos );
1587 if ((RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) ||
1601 OSL_ENSURE(
mbInReading,
"Found a FlySection but not a Format!");
1611 const Point* pPt )
const
1622 if ( nRet == SvxFrameDirection::Unknown )
1632 if( SvxFrameDirection::Environment == pItem->GetValue() )
1636 if ((RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId()) &&
1643 pFlyFormat =
nullptr;
1646 pFlyFormat =
nullptr;
1658 nRet = pItem->GetValue();
1666 return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir;
1677 if(rShell.GetLayout())
1678 aAllLayouts.
insert(rShell.GetLayout());
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
Instances of SwFields and those derived from it occur 0 to n times.
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(100)
std::set< SwPosFlyFramePtr, SwPosFlyFrameCmp > SwPosFlyFrames
Represents the visualization of a paragraph.
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
OUString GetUniqueGrfName() const
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
bool IsInMailMerge() const
sal_uLong GetIndex() const
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
OUString GetUniqueOLEName() const
const SwStartNode * FindHeaderStartNode() const
Represents the style of a paragraph.
Marks a position in the document model.
virtual const tools::Rectangle & GetCurrentBoundRect() const
void SetNodePos(sal_uLong nNd)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
OUString GetUniqueDrawObjectName() const
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(98)
void reserve(size_type nSize)
SwCharFormat * FindCharFormatByName(std::u16string_view rName) const
void SetHeight(tools::Long n)
void setWidth(tools::Long nWidth)
const SwOLEObj & GetOLEObj() const
const SwStartNode * FindFooterStartNode() const
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(110)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
SdrObject * CloneSdrObj(const SdrObject &, bool bMoveWithinDoc=false, bool bInsInPage=true)
virtual Size GetTwipSize() const =0
virtual void SetModified()=0
Must be called manually at changes of format.
constexpr OUStringLiteral last
virtual SdrLayerID GetHeavenId() const =0
const SwPageDesc * FindPageDesc(size_t *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
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 sal_uLong nNdIdx, const OUString &rCharacterStyle, const bool bCpyBrd)
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
OUString GetUniqueFrameName() const
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
SwFlyFrameFormat * MakeFlySection_(const SwPosition &rAnchPos, const SwContentNode &rNode, RndStdIds eRequestId, const SfxItemSet *pFlyAttrSet, SwFrameFormat *)
OUString newName(std::u16string_view aNewPrefix, const OUString &aOldPrefix, std::u16string_view old_Name)
Content, content of frame (header, footer, fly).
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt=nullptr) const
IDocumentUndoRedo & GetIDocumentUndoRedo()
SwContentFrame * FindFirstBodyContent()
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
virtual SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)=0
Return required automatic format.
IDocumentContentOperations const & getIDocumentContentOperations() const
static void lcl_collectUsedNums(std::vector< unsigned int > &rSetFlags, sal_Int32 nNmLen, const OUString &rName, std::u16string_view rCmpName)
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)
virtual SdrObjList * GetSubList() const
SwTableFormat * GetFrameFormat()
const SwFrameFormats * GetSpzFrameFormats() const
SwPosFlyFrames GetAllFlyFormats(const SwPaM *, bool bDrawAlso, bool bAsCharAlso=false) const
Returns positions of all FlyFrames in the document.
Value in Var-direction gives minimum (can be exceeded but not be less).
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
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...
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
virtual SdrPage * AllocPage(bool bMasterPage) override
Create a new page (SdPage) and return a pointer to it back.
wrapper class for the positioning of Writer fly frames and drawing objects
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
SwNodeType GetNodeType() const
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
const SwTextFormatColl * GetDfltTextFormatColl() const
bool IsInVerticalText(const SwPosition &rPos) const
svt::EmbeddedObjectRef & GetObject()
sal_uLong GetIndex() const
virtual void DelAllUndoObj()=0
Delete all Undo actions.
virtual void DoUndo(bool const bDoUndo)=0
Enable/Disable Undo.
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
SwFlyFrameFormat * MakeFlyAndMove(const SwPaM &rPam, const SfxItemSet &rSet, const SwSelBoxes *pSelBoxes, SwFrameFormat *pParent)
std::vector< SwFrameFormat * > const * GetAnchoredFlys() const
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
const SwTable & GetTable() const
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
void SetFlyName(SwFlyFrameFormat &rFormat, const OUString &rName)
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
static sal_uInt16 IsMath(const SvGlobalName &rName)
virtual bool DoesUndo() const =0
Is Undo enabled?
void SetDrawObj(SdrLayerID nLayerId)
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const override
const SvxFormatKeepItem & GetKeep(bool=true) const
void SetContainsAtPageObjWithContentAnchor(const bool bFlag)
virtual SdrLayerID GetInvisibleHellId() const =0
static bool lcl_IsItemSet(const SwContentNode &rNode, sal_uInt16 which)
SwStartNode * MakeTextSection(const SwNodeIndex &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
SwTableSortBoxes & GetTabSortBoxes()
PaM is Point and Mark: a selection of the document model.
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
virtual void SetLayer(SdrLayerID nLayer)
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
virtual void ClearRedo()=0
Delete all Redo actions.
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
static OUString lcl_GetUniqueFlyName(const SwDoc &rDoc, const char *pDefStrId, sal_uInt16 eType)
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
void SectionDown(SwNodeRange *pRange, SwStartNodeType=SwNormalStartNode)
create a start/end section pair
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwSortedObjs * GetSortedObjs() const
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
SwIndex & Assign(SwIndexReg *, sal_Int32)
static bool lcl_TstFlyRange(const SwPaM *pPam, const SwPosition *pFlyPos, RndStdIds nAnchorId)
SwContentNode * GetContentNode()
SwNoTextNode * GetNoTextNode()
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
Marks a character position inside a document model node.
IDocumentState const & getIDocumentState() const
bool IsNoTextNode() const
bool IsGroupObject() const
Marks a node in the document model.
SwNodes & GetNodes()
Node is in which nodes-array/doc?
virtual const SwFieldTypes * GetFieldTypes() const =0
ring_container GetRingContainer()
bool IsResizeProtect() const
OUString SwResId(const char *pId)
void InsertObjectThenMakeNameUnique(SdrObject *pObj)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SwFlyFrameFormat * InsertLabel(const SwLabelType eType, const OUString &rText, const OUString &rSeparator, const OUString &rNumberingSeparator, const bool bBefore, const sal_uInt16 nId, const sal_uLong nIdx, const OUString &rCharacterStyle, const bool bCpyBrd)
void SetFlys(SwFrameFormat &rOldFly, SfxItemSet const &rChgSet, SwFrameFormat &rNewFly)
A page of the document layout.
virtual bool MoveNodeRange(SwNodeRange &, SwNodeIndex &, SwMoveFlags)=0
Frame cannot be moved in Var-direction.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwTable is one table in the document model, containing rows (which contain cells).
const SwPosition * Start() const
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
void SetWidth(tools::Long n)
void push_back(Value const &rVal)
virtual SdrLayerID GetHellId() const =0
virtual void SetRedlineMove(bool bFlag)=0
virtual SdrLayerID GetLayer() const
OUString GetUniqueShapeName() const
const SwNodeIndex * GetContentIdx() const
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt) const
determines the text direction for a certain position.
virtual SdrLayerID GetInvisibleLayerIdByVisibleOne(SdrLayerID _nVisibleLayerId)=0
method to determine, if the corresponding invisible layer ID for a visible one.
OUString InsertText(const OUString &rStr, const SwIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
SwFrameFormat & GetMaster()
sal_uLong EndOfSectionIndex() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
void SetSizeProtect(bool bNew)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
constexpr sal_uInt16 RES_FMT_BEGIN(RES_UNKNOWNATR_END)
SwFlyFrameFormat * InsertDrawLabel(const OUString &rText, const OUString &rSeparator, const OUString &rNumberSeparator, const sal_uInt16 nId, const OUString &rCharacterStyle, SdrObject &rObj)
virtual bool SetAttr(const SfxPoolItem &)
made virtual
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
void SetPosProtect(bool bNew)
std::deque< AttacherIndex_Impl > aIndex
constexpr sal_uInt16 RES_FMT_END(159)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SdrLayerID GetInvisibleHeavenId() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
sal_Int32 GetIndex() const
OString DateTimeToOString(const DateTime &rDateTime)
virtual SwDrawModel * GetOrCreateDrawModel()=0
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SwPosition * End() const
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
::sw::DocumentSettingManager & GetDocumentSettingManager()
bool MakeCopy(SwDoc &, const SwPosition &, const SwSelBoxes &, bool bCpyName=false) const
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(157)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(154)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
const SwStartNode * FindFlyStartNode() const
SwFootnoteIdxs & GetFootnoteIdxs()
Reference< XModel > xModel
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc...
void SetContentProtect(bool bNew)
Frame is variable in Var-direction.
std::pair< const_iterator, bool > insert(Value &&x)
static void lcl_CpyAttr(SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWhich)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
class for collecting anchored objects
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
const SwFootnoteInfo & GetFootnoteInfo() const
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
void SetAllUniqueFlyNames()
bool IsMoveProtect() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const SwAttrPool & GetAttrPool() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
const SwFormatFlyCnt & GetFlyCnt() const
Base class of the Writer document model elements.