30 #include <osl/diagnose.h>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/embed/XEmbeddedObject.hpp>
38 #include <drawdoc.hxx>
83 #include <strings.hrc>
89 #include <string_view>
94 #define DEF_FLY_WIDTH 2268 // Default width for FlyFrames (2268 == 4cm)
115 pPg = pNewPage.get();
121 if( bMoveWithinDoc && SdrInventor::FmForm == pObj->GetObjInventor() )
124 uno::Reference< awt::XControlModel >
xModel =
static_cast<SdrUnoObj*
>(pObj)->GetUnoControlModel();
126 uno::Reference< beans::XPropertySet > xSet(xModel, uno::UNO_QUERY);
127 static const OUStringLiteral
sName(
u"Name");
129 aVal = xSet->getPropertyValue( sName );
133 xSet->setPropertyValue( sName, aVal );
135 else if( bInsInPage )
140 if ( dynamic_cast<const SwFlyDrawObj*>( pObj) ==
nullptr &&
141 dynamic_cast<const SwVirtFlyDrawObj*>( pObj) ==
nullptr &&
149 pObj->SetLayer( nLayerIdForClone );
185 reinterpret_cast<const SfxPoolItem**>(&pAnchor) );
201 ( RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId() &&
203 ( RndStdIds::FLY_AT_PAGE == pAnchor->
GetAnchorId() &&
209 if (pAnchor && (RndStdIds::FLY_AT_FLY == pAnchor->
GetAnchorId()))
212 aAnch.SetAnchor( &aPos );
213 eAnchorId = RndStdIds::FLY_AT_FLY;
217 if( eRequestId != aAnch.GetAnchorId() &&
220 aAnch.SetType( eRequestId );
223 eAnchorId = aAnch.GetAnchorId();
224 if ( RndStdIds::FLY_AT_PAGE != eAnchorId || !pAnchor || aAnch.
GetPageNum() == 0)
226 aAnch.SetAnchor( &rAnchPos );
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))
260 if(
MINFLY > aSize.Width() )
262 aFormatSize.
SetWidth( aSize.Width() );
281 std::make_unique<SwUndoInsLayFormat>( pFormat, nNodeIdx, nCntIdx ));
294 if ( !pAnchorPos && (RndStdIds::FLY_AT_PAGE != eAnchorType) )
297 if( (pFlySet && SfxItemState::SET == pFlySet->
GetItemState(
298 RES_ANCHOR,
false, reinterpret_cast<const SfxPoolItem**>(&pAnch) )) ||
299 ( pFrameFormat && SfxItemState::SET == pFrameFormat->
GetItemState(
300 RES_ANCHOR,
true, reinterpret_cast<const SfxPoolItem**>(&pAnch) )) )
302 if ( RndStdIds::FLY_AT_PAGE != pAnch->
GetAnchorId() )
314 sal_uInt16 nCollId =
static_cast<sal_uInt16
>(
326 assert(!bCalledFromShell || pAnchorNode);
338 eAnchorType, pFlySet, pFrameFormat );
361 OSL_ENSURE( rContent.
GetContentIdx(),
"No content prepared." );
370 if( pSelBoxes && !pSelBoxes->
empty() )
378 GetSttNd()->FindTableNode());
393 if( aRg.aEnd.GetNode().IsEndNode() )
401 rTable.
MakeCopy(*
this, aPos, *pSelBoxes);
409 OSL_ENSURE( aIndex.GetNode().GetTextNode(),
410 "a TextNode should be here" );
431 if( rTmp.HasMark() &&
432 *rTmp.GetPoint() != *rTmp.GetMark() )
444 if( rTmp.HasMark() &&
445 *rTmp.GetPoint() != *rTmp.GetMark() )
472 const SwPaM* pTmp = pPam;
477 const sal_uInt32 nPamStartIndex = pPaMStart->
nNode.
GetIndex();
479 if (RndStdIds::FLY_AT_PARA == nAnchorId)
480 bOk = (nPamStartIndex < nFlyIndex && nPamEndIndex > nFlyIndex) ||
481 (((nPamStartIndex == nFlyIndex) && (pPaMStart->
nContent.
GetIndex() == 0)) &&
482 (nPamEndIndex > nFlyIndex));
487 bOk = (nPamStartIndex < nFlyIndex &&
488 (( nPamEndIndex > nFlyIndex )||
489 ((nPamEndIndex == nFlyIndex) &&
490 (nPamEndContentIndex > nFlyContentIndex))) )
492 (((nPamStartIndex == nFlyIndex) &&
494 ((nPamEndIndex > nFlyIndex) ||
495 (nPamEndContentIndex > nFlyContentIndex )));
501 }
while( pPam != pTmp );
506 bool bAsCharAlso )
const
515 if( bFlyFormat || bDrawFormat )
520 ((RndStdIds::FLY_AT_PARA == rAnchor.
GetAnchorId()) ||
521 (RndStdIds::FLY_AT_FLY == rAnchor.
GetAnchorId()) ||
522 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId()) ||
523 ((RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId()) && bAsCharAlso)))
528 aRetval.insert(std::make_shared<SwPosFlyFrame>(pAPos->
nNode, pFly, aRetval.size()));
549 if ( dynamic_cast<const SwFlyFrame*>( pAnchoredObj) !=
nullptr )
550 pFly = &(pAnchoredObj->GetFrameFormat());
551 else if ( bDrawAlso )
552 pFly = &(pAnchoredObj->GetFrameFormat());
557 if ((RndStdIds::FLY_AT_PARA != rAnchor.
GetAnchorId()) &&
558 (RndStdIds::FLY_AT_FLY != rAnchor.
GetAnchorId()) &&
562 if ( !pContentFrame )
568 while ( !pContentFrame && pPrv )
577 ? *
static_cast<SwTextFrame const*
>(pContentFrame)->GetTextNodeFirst()
579 aRetval.insert(std::make_shared<SwPosFlyFrame>(aIdx, pFly, aRetval.size()));
606 if (pOldItem !=
nullptr)
607 rNewSet.
Put( *pOldItem );
610 pOldItem = rOldSet.
GetItem( nWhich );
611 if (pOldItem !=
nullptr)
614 if (pNewItem !=
nullptr)
616 if (*pOldItem != *pNewItem)
617 rNewSet.
Put( *pOldItem );
620 OSL_FAIL(
"What am I doing here?");
624 OSL_FAIL(
"What am I doing here?");
633 SwLabelType const eType, std::u16string_view rText, std::u16string_view rSeparator,
634 const OUString& rNumberingSeparator,
635 const bool bBefore,
const sal_uInt16 nId,
const sal_uLong nNdIdx,
636 const OUString& rCharacterStyle,
645 "FieldType index out of bounds." );
652 for(
auto i = pTextFormatCollTable->
size();
i; )
654 if( (*pTextFormatCollTable)[ --
i ]->GetName()==pType->GetName() )
656 pColl = (*pTextFormatCollTable)[
i];
660 OSL_ENSURE( pColl,
"no text collection found" );
681 OSL_ENSURE( pSttNd,
"No StartNode in InsertLabel." );
715 OSL_ENSURE( pOldFormat,
"Couldn't find the Fly's Format." );
720 const OUString sTitle( pOldFlyFrameFormat
721 ? pOldFlyFrameFormat->GetObjTitle()
723 const OUString sDescription( pOldFlyFrameFormat
724 ? pOldFlyFrameFormat->GetObjDescription()
733 std::unique_ptr<SfxItemSet> pNewSet = pNewFormat->
GetAttrSet().
Clone();
751 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
752 GetItemState(
RES_BOX,
true, &pItem ))
753 pNewSet->Put( *pItem );
754 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
758 if( SfxItemState::SET == pOldFormat->
GetAttrSet().
760 pNewSet->Put( *pItem );
761 else if( SfxItemState::SET == pNewFormat->
GetAttrSet().
777 std::unique_ptr<SwFormatFrameSize> aFrameSize(pOldFormat->
GetFrameSize().
Clone());
779 pNewSet->Put( std::move(aFrameSize) );
794 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
798 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
803 assert(pHint &&
"Missing Hint.");
806 "Missing FlyInCnt-Hint." );
808 "Wrong TextFlyCnt-Hint." );
817 pNewSet->ClearItem();
822 sal_Int16 eVert = bBefore ? text::VertOrientation::BOTTOM : text::VertOrientation::TOP;
839 aFrameSize->SetWidthPercent(isMath ? 0 : 100);
841 pNewSet->Put( std::move(aFrameSize) );
859 pNewSet->Put( aAnch );
862 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
872 if ( pOldFlyFrameFormat )
874 pOldFlyFrameFormat->SetObjTitle( sTitle );
875 pOldFlyFrameFormat->SetObjDescription( sDescription );
881 OSL_ENSURE(
false,
"unknown LabelType?");
883 OSL_ENSURE( pNew,
"No Label inserted" );
887 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
890 if( bOrderNumberingFirst )
892 aText = rNumberingSeparator;
896 aText += pType->GetName();
897 if( !bOrderNumberingFirst )
900 sal_Int32 nIdx = aText.getLength();
905 const sal_Int32 nSepIdx = aText.getLength();
916 if( bOrderNumberingFirst )
920 if(!rCharacterStyle.isEmpty())
947 rDoc.
GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
963 SwLabelType const eType, OUString
const& rText, OUString
const& rSeparator,
964 OUString
const& rNumberingSeparator,
965 bool const bBefore, sal_uInt16
const nId,
sal_uLong const nNdIdx,
966 OUString
const& rCharacterStyle,
969 std::unique_ptr<SwUndoInsertLabel> pUndo;
973 eType, rText, rSeparator, rNumberingSeparator,
974 bBefore, nId, rCharacterStyle, bCpyBrd,
this ));
978 eType, rText, rSeparator, rNumberingSeparator, bBefore,
979 nId, nNdIdx, rCharacterStyle, bCpyBrd);
996 OUString
const& rText,
997 const OUString& rSeparator,
998 const OUString& rNumberSeparator,
999 const sal_uInt16 nId,
1000 const OUString& rCharacterStyle,
1008 "FieldType index out of bounds" );
1015 for(
auto i = pTextFormatCollTable->
size();
i; )
1017 if( (*pTextFormatCollTable)[ --
i ]->GetName()==pType->GetName() )
1019 pColl = (*pTextFormatCollTable)[
i];
1023 OSL_ENSURE( pColl,
"no text collection found" );
1052 std::unique_ptr<SfxItemSet> pNewSet = pOldFormat->
GetAttrSet().
Clone(
false );
1061 pNewSet->Put( aProtect );
1073 aOpaque.SetValue(
true );
1074 pNewSet->Put( aOpaque );
1082 pNewSet->Put( pOldFormat->
GetAnchor() );
1087 pNewSet->Put( aFrameSize );
1113 if ( RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId() )
1117 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
1122 assert(pHint &&
"Missing Hint.");
1124 #if OSL_DEBUG_LEVEL > 0
1126 "Missing FlyInCnt-Hint." );
1128 GetFrameFormat() ==
static_cast<SwFrameFormat*
>(pOldFormat),
1129 "Wrong TextFlyCnt-Hint." );
1136 pNewSet->ClearItem();
1152 pNewSet->Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
1153 pNewSet->Put(
SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) );
1161 pNewSet->Put( aAnch );
1165 pUndo->
SetFlys( *pOldFormat, *pNewSet, *pNewFormat );
1178 OSL_ENSURE( pNew,
"No Label inserted" );
1183 bool bOrderNumberingFirst =
SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst();
1187 if( bOrderNumberingFirst )
1189 aText = rNumberSeparator;
1193 aText += pType->GetName();
1194 if( !bOrderNumberingFirst )
1197 sal_Int32 nIdx = aText.getLength();
1198 aText += rSeparator;
1199 const sal_Int32 nSepIdx = aText.getLength();
1204 pNew->InsertText( aText, aIdx );
1210 if( bOrderNumberingFirst )
1213 pNew->InsertItem( aFormat, nIdx, nIdx );
1214 if ( !rCharacterStyle.isEmpty() )
1225 pNew->InsertItem( aCharFormat, 0, nSepIdx + 1,
1236 OUString
const& rText,
1237 OUString
const& rSeparator,
1238 OUString
const& rNumberSeparator,
1239 sal_uInt16
const nId,
1240 OUString
const& rCharacterStyle,
1248 "InsertDrawLabel(): not a DrawFrameFormat" );
1254 std::unique_ptr<SwUndoInsertLabel> pUndo;
1260 nId, rCharacterStyle,
false,
this ));
1265 rText, rSeparator, rNumberSeparator, nId, rCharacterStyle, rSdrObj);
1279 static void lcl_collectUsedNums(std::vector<unsigned int>& rSetFlags, sal_Int32 nNmLen,
const OUString& rName, std::u16string_view rCmpName)
1281 if (rName.startsWith(rCmpName))
1284 const sal_Int32 nNum = rName.copy(nNmLen).toInt32() - 1;
1286 rSetFlags.push_back(nNum);
1300 assert(pSub &&
"IsGroupObject is implemented as GetSubList != nullptr");
1301 const size_t nCount = pSub->GetObjCount();
1302 for (
size_t i = 0;
i < nCount; ++
i)
1313 int first_available_number(std::vector<unsigned int>& numbers)
1315 std::sort(numbers.begin(), numbers.end());
1316 auto last = std::unique(numbers.begin(), numbers.end());
1317 numbers.erase(last, numbers.end());
1319 for (
size_t i = 0;
i < numbers.size(); ++
i)
1321 if (numbers[i] != i)
1325 return numbers.size();
1334 OUString
newName =
"MailMergeFly"
1341 sal_Int32 nNmLen = aName.getLength();
1345 std::vector<unsigned int> aUsedNums;
1346 aUsedNums.reserve(rFormats.
size());
1351 if (eType != pFlyFormat->
Which())
1366 return aName + OUString::number(nNum);
1397 for(
auto it = range.first; it != range.second; it++ )
1412 return static_cast<const SwFlyFrameFormat*>(pFlyFormat);
1423 OUString
sName( rName );
1426 const char* pTyp = STR_FRAME_DEFNAME;
1433 pTyp = STR_GRAPHIC_DEFNAME;
1436 pTyp = STR_OBJECT_DEFNAME;
1443 rFormat.
SetName( sName,
true );
1449 sal_Int32
n, nFlyNum = 0, nGrfNum = 0, nOLENum = 0;
1451 const OUString sFlyNm(
SwResId(STR_FRAME_DEFNAME));
1452 const OUString sGrfNm(
SwResId(STR_GRAPHIC_DEFNAME));
1453 const OUString sOLENm(
SwResId(STR_OBJECT_DEFNAME));
1461 bool bContainsAtPageObjWithContentAnchor =
false;
1468 const OUString& aNm = pFlyFormat->
GetName();
1469 if ( !aNm.isEmpty() )
1471 sal_Int32 *pNum =
nullptr;
1473 if ( aNm.startsWith(sGrfNm) )
1475 nLen = sGrfNm.getLength();
1478 else if( aNm.startsWith(sFlyNm) )
1480 nLen = sFlyNm.getLength();
1483 else if( aNm.startsWith(sOLENm) )
1485 nLen = sOLENm.getLength();
1491 const sal_Int32 nNewLen = aNm.copy( nLen ).toInt32();
1492 if (*pNum < nNewLen)
1501 if ( !bContainsAtPageObjWithContentAnchor )
1504 if ( (RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) &&
1507 bContainsAtPageObjWithContentAnchor =
true;
1513 for( n = aArr.
size(); n; )
1515 pFlyFormat = aArr[ --n ];
1522 pFlyFormat->
SetName( sGrfNm + OUString::number( ++nGrfNum ));
1525 pFlyFormat->
SetName( sOLENm + OUString::number( ++nOLENum ));
1528 pFlyFormat->
SetName( sFlyNm + OUString::number( ++nFlyNum ));
1565 #if OSL_DEBUG_LEVEL > 0
1566 std::vector<const SwFrameFormat*> checkFormats;
1569 const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
1570 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1571 checkFormats.push_back( pFormat );
1574 std::vector<SwFrameFormat*>
const*
const pFlys(pFlyNd->
GetAnchoredFlys());
1576 for (
size_t i = 0; pFlys &&
i < pFlys->size(); ++
i)
1580 if( pIdx && pFlyNd == &pIdx->
GetNode() )
1582 #if OSL_DEBUG_LEVEL > 0
1583 auto checkPos = std::find(
1584 checkFormats.begin(), checkFormats.end(), pFormat );
1585 assert( checkPos != checkFormats.end());
1586 checkFormats.erase( checkPos );
1589 if ((RndStdIds::FLY_AT_PAGE == rAnchor.
GetAnchorId()) ||
1603 OSL_ENSURE(
mbInReading,
"Found a FlySection but not a Format!");
1613 const Point* pPt )
const
1624 if ( nRet == SvxFrameDirection::Unknown )
1634 if( SvxFrameDirection::Environment == pItem->GetValue() )
1638 if ((RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId()) &&
1645 pFlyFormat =
nullptr;
1648 pFlyFormat =
nullptr;
1660 nRet = pItem->GetValue();
1668 return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir;
1679 if(rShell.GetLayout())
1680 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 rtl::Reference< SdrPage > AllocPage(bool bMasterPage) override
Create a new page (SdPage) and return a pointer to it back.
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
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
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)
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)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
SwNodeType GetNodeType() const
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
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
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 sal_uInt16 RES_FMT_END(161)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
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.