for(SwPaM& rCurrentPaM : pPaM->GetRingContainer())
{ // #i27615# if the cursor is in front of the numbering label // the attributes to get are those from the numbering format. if (rCurrentPaM.IsInFrontOfLabel())
{
SwTextNode const*const pTextNd = sw::GetParaPropsNode(*GetLayout(),
rCurrentPaM.GetPoint()->GetNode());
if (pTextNd)
{
SwNumRule * pNumRule = pTextNd->GetNumRule();
if (pNumRule)
{ int nListLevel = pTextNd->GetActualListLevel();
if (nListLevel < 0)
nListLevel = 0;
if (nListLevel >= MAXLEVEL)
nListLevel = MAXLEVEL - 1;
// at first node the node enter his values into the GetSet (Initial) // all additional nodes are additional merged to GetSet for( SwNodeOffset n = nSttNd; n <= nEndNd; ++n )
{
SwNode* pNd = GetDoc()->GetNodes()[ n ]; switch( pNd->GetNodeType() )
{ case SwNodeType::Text:
{ const sal_Int32 nStt = (n == nSttNd) ? nSttCnt : 0; const sal_Int32 nEnd = (n == nEndNd)
? nEndCnt
: pNd->GetTextNode()->GetText().getLength();
static_cast<SwTextNode*>(pNd)->GetParaAttr(*pSet, nStt, nEnd, false, true,
bMergeIndentValuesOfNumRule,
GetLayout());
} break; case SwNodeType::Grf: case SwNodeType::Ole: static_cast<SwContentNode*>(pNd)->GetAttr( *pSet ); break;
void SwEditShell::GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const
{ // number of nodes the function has explored so far
sal_uInt16 numberOfLookup = 0;
for(SwPaM& rCurrentPaM : pPaM->GetRingContainer())
{ // for all the point and mark (selections)
// get the start and the end node of the current selection
SwNodeOffset nSttNd = rCurrentPaM.GetMark()->GetNodeIndex(),
nEndNd = rCurrentPaM.GetPoint()->GetNodeIndex();
// reverse start and end if there number aren't sorted correctly if( nSttNd > nEndNd )
std::swap(nSttNd, nEndNd);
// for all the nodes in the current selection // get the node (paragraph) attributes // and merge them in rSet for( SwNodeOffset n = nSttNd; n <= nEndNd; ++n )
{ // get the node
SwNode* pNd = GetDoc()->GetNodes()[ n ];
if (GetLayout()->HasMergedParas()
&& pNd->GetRedlineMergeFlag() == SwNode::Merge::Hidden)
{ continue;
}
if( pNd->IsTextNode() )
{ // get the node (paragraph) attributes
sw::GetAttrMerged(*pSet, *pNd->GetTextNode(), GetLayout());
SwTextFormatColl* SwEditShell::GetPaMTextFormatColl( SwPaM* pPaM ) const
{ // number of nodes the function have explored so far
sal_uInt16 numberOfLookup = 0;
for(SwPaM& rCurrentPaM : pPaM->GetRingContainer())
{ // for all the point and mark (selections)
// get the start and the end node of the current selection
SwNodeOffset nSttNd = rCurrentPaM.Start()->GetNodeIndex(),
nEndNd = rCurrentPaM.End()->GetNodeIndex();
// for all the nodes in the current Point and Mark for( SwNodeOffset n = nSttNd; n <= nEndNd; ++n )
{ // get the node
SwNode* pNd = GetDoc()->GetNodes()[ n ];
++numberOfLookup;
// if the maximum number of node that can be inspected has been reached if (numberOfLookup >= getMaxLookup()) return nullptr;
if( pNd->IsTextNode() )
{
SwTextNode *const pTextNode(sw::GetParaPropsNode(*GetLayout(), *pNd)); // if it's a text node get its named paragraph format
SwTextFormatColl *const pFormat = pTextNode->GetTextColl();
// if the paragraph format exist stop here and return it if( pFormat != nullptr ) return pFormat;
}
}
}
// if none of the selected node contain a named paragraph format return nullptr;
}
std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell::GetItemWithPaM( sal_uInt16 nWhich )
{
assert(isCHRATR(nWhich)); // sw_redlinehide: only thing that works
std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> vItem; for(SwPaM& rCurrentPaM : GetCursor()->GetRingContainer())
{ // for all the point and mark (selections)
// get the start and the end node of the current selection
SwNodeOffset nSttNd = rCurrentPaM.Start()->GetNodeIndex(),
nEndNd = rCurrentPaM.End()->GetNodeIndex();
sal_Int32 nSttCnt = rCurrentPaM.Start()->GetContentIndex();
sal_Int32 nEndCnt = rCurrentPaM.End()->GetContentIndex();
const SfxPoolItem* pItem = nullptr;
// for all the nodes in the current selection for( SwNodeOffset n = nSttNd; n <= nEndNd; ++n )
{
SwNode* pNd = GetDoc()->GetNodes()[ n ]; if( pNd->IsTextNode() )
{
SwTextNode* pTextNd = static_cast< SwTextNode* >( pNd ); const sal_Int32 nStt = (n == nSttNd) ? nSttCnt : 0; const sal_Int32 nEnd = (n == nEndNd)
? nEndCnt : pTextNd->GetText().getLength();
SwTextFrame const* pFrame; const SwScriptInfo *const pScriptInfo =
SwScriptInfo::GetScriptInfo(*pTextNd, &pFrame);
TextFrameIndex const iStt(pScriptInfo
? pFrame->MapModelToView(pTextNd, nStt)
: TextFrameIndex(-1/*invalid, do not use*/));
sal_uInt8 nScript = pScriptInfo
? pScriptInfo->ScriptType(iStt)
: css::i18n::ScriptType::WEAK;
nWhich = GetWhichOfScript( nWhich, nScript );
bool SwEditShell::GetCurFootnote( SwFormatFootnote* pFillFootnote )
{ // The cursor must be positioned on the current footnotes anchor:
SwPaM* pCursor = GetCursor();
SwTextNode* pTextNd = pCursor->GetPointNode().GetTextNode(); if( !pTextNd ) returnfalse;
SwTextAttr *const pFootnote = pTextNd->GetTextAttrForCharAt(
pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); if( pFootnote && pFillFootnote )
{ // Transfer data from the attribute const SwFormatFootnote &rFootnote = static_cast<SwTextFootnote*>(pFootnote)->GetFootnote();
pFillFootnote->SetNumber( rFootnote );
pFillFootnote->SetEndNote( rFootnote.IsEndNote() );
} return nullptr != pFootnote;
}
/// Give a List of all footnotes and their beginning texts
size_t SwEditShell::GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes )
{
rList.Clear();
/// Adjust left margin via object bar (similar to adjustment of numerations). bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const
{ bool bRet = true;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.