LibreOffice Module sw (master) 1
|
An SwTextAttr container, stores all directly formatted text portions for a text node. More...
#include <ndhints.hxx>
Public Member Functions | |
SwpHints (const SwTextNode &rParent) | |
size_t | Count () const |
bool | Contains (const SwTextAttr *pHt) const |
SwTextAttr * | Get (size_t nPos) const |
SwTextAttr * | GetWithoutResorting (size_t nPos) const |
int | GetLastPosSortedByEnd (sal_Int32 nEndPos) const |
SwTextAttr * | GetSortedByEnd (size_t nPos) const |
size_t | GetFirstPosSortedByWhichAndStart (sal_uInt16 nWhich) const |
SwTextAttr * | GetSortedByWhichAndStart (size_t nPos) const |
void | SortIfNeedBe () const |
Trigger the sorting if necessary. More... | |
SwTextAttr * | Cut (const size_t nPosInStart) |
bool | CanBeDeleted () const |
void | Register (SwRegHistory *pHist) |
register a History, which receives all attribute changes (for Undo) More... | |
void | DeRegister () |
deregister the currently registered History More... | |
SwRegHistory * | GetHistory () const |
bool | TryInsertHint (SwTextAttr *const pHint, SwTextNode &rNode, const SetAttrMode nMode=SetAttrMode::DEFAULT) |
try to insert the hint More... | |
bool | HasFootnote () const |
bool | IsInSplitNode () const |
bool | CalcHiddenParaField () const |
void | StartPosChanged () const |
void | EndPosChanged () const |
Private Member Functions | |
void | NoteInHistory (SwTextAttr *pAttr, const bool bNew=false) |
records a new attribute in m_pHistory. More... | |
void | CalcFlags () |
void | DeleteAtPos (size_t nPos) |
void | Delete (SwTextAttr const *pTextHt) |
Delete the given Hint. The Hint must actually be in the array! More... | |
void | SetInSplitNode (bool bInSplit) |
void | SetCalcHiddenParaField () const |
void | SetHiddenByParaField (const bool bNew) const |
bool | IsHiddenByParaField () const |
void | InsertNesting (SwTextAttrNesting &rNewHint) |
Insert nesting hint into the hints array. More... | |
bool | TryInsertNesting (SwTextNode &rNode, SwTextAttrNesting &rNewHint) |
The following hints correspond to well-formed XML elements in ODF: RES_TXTATR_INETFMT, RES_TXTATR_CJK_RUBY, RES_TXTATR_META, RES_TXTATR_METAFIELD, RES_TXTATR_CONTENTCONTROL. More... | |
void | BuildPortions (SwTextNode &rNode, SwTextAttr &rNewHint, const SetAttrMode nMode) |
bool | MergePortions (SwTextNode &rNode) |
void | Insert (SwTextAttr *pHt) |
SW_DLLPUBLIC void | Resort () const |
SW_DLLPUBLIC void | ResortStartMap () const |
SW_DLLPUBLIC void | ResortEndMap () const |
SW_DLLPUBLIC void | ResortWhichMap () const |
size_t | GetIndexOf (const SwTextAttr *pHt) const |
bool | Check (bool) const |
Private Attributes | |
const SwTextNode & | m_rParent |
std::vector< SwTextAttr * > | m_HintsByStart |
std::vector< SwTextAttr * > | m_HintsByEnd |
std::vector< SwTextAttr * > | m_HintsByWhichAndStart |
SwRegHistory * | m_pHistory |
for Undo More... | |
bool | m_bInSplitNode: 1 |
true: the Node is in Split and Frames are moved More... | |
bool | m_bCalcHiddenParaField: 1 |
bool | m_bHiddenByParaField: 1 |
bool | m_bFootnote: 1 |
footnotes More... | |
bool | m_bDDEFields: 1 |
the TextNode has DDE fields More... | |
bool | m_bStartMapNeedsSorting: 1 |
bool | m_bEndMapNeedsSorting: 1 |
bool | m_bWhichMapNeedsSorting: 1 |
Static Private Attributes | |
static const size_t | MAX_HINTS = SAL_MAX_SIZE-1 |
Friends | |
class | SwTextNode |
Delete methods may only be called by the TextNode! Because the TextNode also guarantees removal of the Character for attributes without an end. More... | |
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition at line 67 of file ndhints.hxx.
SwpHints::SwpHints | ( | const SwTextNode & | rParent | ) |
Definition at line 92 of file thints.cxx.
References m_rParent.
|
private |
Definition at line 635 of file thints.cxx.
References aCharAutoFormatSetRange, IStyleAccess::AUTO_STYLE_CHAR, CHECK_NOTMERGED, SfxItemIter::ClearItem(), SfxPoolItem::Clone(), SfxItemSet::Count(), Count(), Delete(), SwTextNode::DestroyAttr(), DONTREPLACE, SwTextAttr::End(), Get(), SwTextAttr::GetAttr(), IStyleAccess::getAutomaticStyle(), SwFormatCharFormat::GetCharFormat(), SwTextAttr::GetCharFormat(), SfxItemIter::GetCurItem(), SwNode::GetDoc(), SwTextAttr::GetEnd(), SwNode::getIDocumentStyleAccess(), CharFormat::GetItem(), SfxItemSet::GetItemState(), SwTextAttr::GetStart(), SwContentNode::GetSwAttrSet(), GetWithoutResorting(), SwContentNode::HasSwAttrSet(), i, Insert(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SwDoc::IsInReading(), SwDoc::IsInXMLImport(), CharFormat::IsItemIncluded(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::lower_bound(), MakeTextAttr(), SfxItemIter::NextItem(), NoteInHistory(), SfxItemSet::Put(), RES_TXTATR_AUTOFMT(), RES_TXTATR_CHARFMT(), SwTextAttr::SetStart(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::upper_bound(), SfxPoolItem::Which(), and SwTextAttr::Which().
Referenced by TryInsertHint().
|
private |
Definition at line 2628 of file thints.cxx.
References Count(), Dde, Get(), SwFormatField::GetField(), SwTextAttr::GetFormatField(), SwField::GetTyp(), m_bDDEFields, m_bFootnote, nPos, RES_TXTATR_FIELD(), RES_TXTATR_FTN(), SwFieldType::Which(), and SwTextAttr::Which().
Referenced by DeleteAtPos(), and TryInsertHint().
bool SwpHints::CalcHiddenParaField | ( | ) | const |
Definition at line 2657 of file thints.cxx.
References Count(), SwDoc::FieldCanHideParaWeight(), SwDoc::FieldHidesPara(), Get(), SwNode::GetDoc(), SwFormatField::GetField(), SwTextAttr::GetFormatField(), SwField::GetTyp(), m_bCalcHiddenParaField, m_bHiddenByParaField, m_rParent, nPos, RES_TXTATR_FIELD(), SetHiddenByParaField(), SwFieldType::Which(), and SwTextAttr::Which().
Referenced by IsHiddenByParaField().
|
inline |
Definition at line 192 of file ndhints.hxx.
References m_HintsByStart.
|
private |
Definition at line 188 of file ndhints.cxx.
References CHECK_ERR, ComparePosition(), CompareSwpHtStart(), COMPLETE_STRING, Count(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), SwTextAttr::End(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::find(), SwTextAttr::GetAnyEnd(), SwTextAttr::GetAutoFormat(), SwTextAttr::GetStart(), SwFormatAutoFormat::GetStyleHandle(), SwTextAttr::HasDummyChar(), i, o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), isCHRATR(), SwTextAttr::IsFormatIgnoreEnd(), SwTextAttr::IsFormatIgnoreStart(), SwTextAttr::IsNesting(), m_HintsByEnd, m_HintsByStart, OverlapBefore, OverlapBehind, RES_CHRATR_RSID(), RES_TXTATR_AUTOFMT(), RES_TXTATR_CHARFMT(), and SwTextAttr::Which().
bool SwpHints::Contains | ( | const SwTextAttr * | pHt | ) | const |
Definition at line 169 of file ndhints.cxx.
References m_HintsByStart.
Referenced by lcl_CopyHint().
|
inline |
Definition at line 142 of file ndhints.hxx.
References m_HintsByStart.
Referenced by SwHTMLParser::AddParSpace(), SwHTMLParser::AppendTextNode(), BuildPortions(), CalcFlags(), CalcHiddenParaField(), Check(), SwNodes::ChgNode(), SwHistory::CopyAttr(), SwWW8ImplReader::CoreLoad(), sw::DocumentContentOperationsManager::DeleteRangeImplImpl(), SwTextNode::dumpAsXml(), AttributeOutputBase::GenerateBookmarksForSequenceField(), SwUnoCursorHelper::getCursorPropertyValue(), SwDoc::GetCurTOXMark(), GetFrwrdTextHint(), SwEditShell::GetItemWithPaM(), SwWW8AttrIter::HasTextItem(), SwCallLink::ImplDestroy(), SwTableBox::IsValidNumTextNd(), lcl_ChangeFootnoteRef(), lcl_CheckSortNumber(), lcl_CreatePortions(), lcl_dbg_out(), lcl_ExportHints(), lcl_GetTextAttrs(), lcl_SearchAttr(), lcl_SearchBackward(), lcl_SearchForward(), sw::MergedAttrIterReverse::MergedAttrIterReverse(), MergePortions(), ModelToViewHelper::ModelToViewHelper(), SwHTMLWriter::OutHeaderAttrs(), OutHTML_SwTextNode(), sw::DocumentContentOperationsManager::Overwrite(), sw::MergedAttrIterReverse::PrevAttr(), SwNodes::RemoveNode(), SwDontExpandItem::RestoreDontExpandItems(), SwLanguageIterator::SearchNextChg(), SwAttrIter::SeekFwd(), SwScriptInfo::selectHiddenTextProperty(), SwDoc::SelectNextRubyChars(), sw::DocumentFieldsManager::SetFieldsDirty(), TryInsertHint(), TryInsertNesting(), SwUndoTableMerge::UndoImpl(), and SwTOXBaseSection::UpdatePageNum_().
|
inline |
Definition at line 185 of file ndhints.hxx.
References DeleteAtPos(), and m_HintsByStart.
Referenced by sw::DocumentContentOperationsManager::DeleteRangeImplImpl(), and TryInsertHint().
|
private |
Delete the given Hint. The Hint must actually be in the array!
delete the hint precondition: pTextHt must be in this array
Definition at line 3429 of file thints.cxx.
References DeleteAtPos(), GetIndexOf(), and nPos.
Referenced by BuildPortions(), SwTextNode::CopyText(), MergePortions(), and TryInsertNesting().
|
private |
Definition at line 3369 of file thints.cxx.
References CalcFlags(), CHECK_NOTMERGED, SwTextField::ChgTextNode(), Dde, SwDDEFieldType::DecRefCnt(), SwDoc::FieldCanHideParaWeight(), Get(), SwNode::GetDoc(), SwFormatField::GetField(), SwTextAttr::GetFormatField(), SwNode::GetNodes(), SwTextField::GetpTextNode(), SwField::GetTyp(), SwNodes::IsDocNodes(), m_bCalcHiddenParaField, m_bEndMapNeedsSorting, m_bHiddenByParaField, m_bStartMapNeedsSorting, m_bWhichMapNeedsSorting, m_HintsByEnd, m_HintsByStart, m_HintsByWhichAndStart, SwTextAttr::m_pHints, m_rParent, NoteInHistory(), nPos, REMOVED, RES_TXTATR_ANNOTATION(), RES_TXTATR_FIELD(), ResortEndMap(), ResortStartMap(), ResortWhichMap(), SwFieldType::Which(), and SwTextAttr::Which().
Referenced by Cut(), Delete(), and MergePortions().
|
inline |
deregister the currently registered History
Definition at line 197 of file ndhints.hxx.
References Register().
Referenced by SwDoc::DeleteFormatRefMark(), SwDoc::DeleteTOXMark(), SwRegHistory::InsertItems(), sw::DocumentContentOperationsManager::lcl_RstTextAttr(), SwUndoDelete::SaveContent(), and SwUndoTableNumFormat::SwUndoTableNumFormat().
|
inline |
Definition at line 213 of file ndhints.hxx.
References m_bEndMapNeedsSorting, m_bStartMapNeedsSorting, and m_bWhichMapNeedsSorting.
Referenced by SwTextAttrEnd::SetEnd(), SwTextRefMark::SetEnd(), and SwTextTOXMark::SetEnd().
|
inline |
Definition at line 144 of file ndhints.hxx.
References m_bStartMapNeedsSorting, m_HintsByStart, nPos, and ResortStartMap().
Referenced by SwHTMLParser::AddParSpace(), SwHTMLParser::AppendTextNode(), BuildPortions(), CalcFlags(), CalcHiddenParaField(), SwNodes::ChgNode(), SwHistory::CopyAttr(), SwWW8ImplReader::CoreLoad(), DeleteAtPos(), sw::DocumentContentOperationsManager::DeleteRangeImplImpl(), SwTextNode::dumpAsXml(), AttributeOutputBase::GenerateBookmarksForSequenceField(), GetBkwrdTextHint(), SwCursorShell::GetContentAtPos(), SwUnoCursorHelper::getCursorPropertyValue(), SwDoc::GetCurTOXMark(), GetFrwrdTextHint(), SwEditShell::GetItemWithPaM(), SwWW8AttrIter::HasTextItem(), SwCallLink::ImplDestroy(), SwTransferable::isComplex(), SwTableBox::IsValidNumTextNd(), lcl_ChangeFootnoteRef(), lcl_CheckSortNumber(), lcl_dbg_out(), lcl_ExportHints(), lcl_SearchForward(), MergePortions(), ModelToViewHelper::ModelToViewHelper(), sw::MergedAttrIter::NextAttr(), SwHTMLWriter::OutHeaderAttrs(), OutHTML_SwTextNode(), SwNodes::RemoveNode(), SwDontExpandItem::RestoreDontExpandItems(), SwLanguageIterator::SearchNextChg(), SwAttrIter::SeekFwd(), SwAttrIter::SeekStartAndChgAttrIter(), SwScriptInfo::selectHiddenTextProperty(), SwDoc::SelectNextRubyChars(), sw::DocumentFieldsManager::SetFieldsDirty(), TryInsertHint(), and SwTOXBaseSection::UpdatePageNum_().
size_t SwpHints::GetFirstPosSortedByWhichAndStart | ( | sal_uInt16 | nWhich | ) | const |
Definition at line 458 of file ndhints.cxx.
References m_bWhichMapNeedsSorting, m_HintsByWhichAndStart, and ResortWhichMap().
Referenced by lcl_GetTextAttrs().
|
inline |
Definition at line 198 of file ndhints.hxx.
References m_pHistory.
Referenced by SwTextNode::InsertHint().
|
private |
Definition at line 476 of file ndhints.cxx.
References CompareSwpHtStart(), m_bStartMapNeedsSorting, m_HintsByStart, and ResortStartMap().
Referenced by Delete().
int SwpHints::GetLastPosSortedByEnd | ( | sal_Int32 | nEndPos | ) | const |
Definition at line 468 of file ndhints.cxx.
References m_bEndMapNeedsSorting, m_HintsByEnd, and ResortEndMap().
|
inline |
Definition at line 158 of file ndhints.hxx.
References m_bEndMapNeedsSorting, m_HintsByEnd, nPos, and ResortEndMap().
Referenced by lcl_CreatePortions(), lcl_ExportHints(), lcl_SearchBackward(), sw::MergedAttrIterByEnd::NextAttr(), sw::MergedAttrIterReverse::PrevAttr(), SwAttrIter::SeekFwd(), and TryInsertNesting().
|
inline |
Definition at line 167 of file ndhints.hxx.
References m_bWhichMapNeedsSorting, m_HintsByWhichAndStart, nPos, and ResortWhichMap().
Referenced by lcl_GetTextAttrs().
|
inline |
Definition at line 152 of file ndhints.hxx.
References m_HintsByStart, and nPos.
Referenced by BuildPortions().
|
inline |
Definition at line 205 of file ndhints.hxx.
References m_bFootnote.
|
private |
Definition at line 145 of file ndhints.cxx.
References CompareSwpHtStart(), m_bEndMapNeedsSorting, m_bStartMapNeedsSorting, m_bWhichMapNeedsSorting, m_HintsByEnd, m_HintsByStart, m_HintsByWhichAndStart, SwTextAttr::m_pHints, ResortEndMap(), ResortStartMap(), and ResortWhichMap().
Referenced by BuildPortions(), InsertNesting(), and TryInsertHint().
|
private |
Insert nesting hint into the hints array.
Also calls NoteInHistory.
rNewHint | the hint to be inserted (must not overlap existing!) |
Definition at line 301 of file thints.cxx.
References Insert(), and NoteInHistory().
Referenced by TryInsertNesting().
|
inlineprivate |
Definition at line 112 of file ndhints.hxx.
References CalcHiddenParaField(), m_bCalcHiddenParaField, and m_bHiddenByParaField.
|
inline |
Definition at line 206 of file ndhints.hxx.
References m_bInSplitNode.
Referenced by SwTextFlyCnt::SetAnchor().
|
private |
Definition at line 2715 of file thints.cxx.
References COMPLETE_STRING, Count(), Delete(), DeleteAtPos(), SwTextAttr::Destroy(), SwTextNode::DestroyAttr(), Get(), SwDoc::GetAttrPool(), SwTextAttr::GetAutoFormat(), SwNode::GetDoc(), SwTextAttr::GetEnd(), SwTextAttr::GetStart(), SwFormatAutoFormat::GetStyleHandle(), i, SwTextAttr::IsFormatIgnoreEnd(), SwTextAttr::IsFormatIgnoreStart(), lcl_Compare_Attributes(), NoteInHistory(), RES_CHRATR_RSID(), RES_TXTATR_AUTOFMT(), RES_TXTATR_CHARFMT(), Resort(), SwTextAttr::SetEnd(), SwTextAttr::SetFormatIgnoreEnd(), SwTextAttr::SetFormatIgnoreStart(), and SwTextAttr::Which().
Referenced by TryInsertHint().
|
private |
records a new attribute in m_pHistory.
Definition at line 2694 of file thints.cxx.
References SwRegHistory::AddHint(), and m_pHistory.
Referenced by BuildPortions(), DeleteAtPos(), InsertNesting(), MergePortions(), and TryInsertHint().
|
inline |
register a History, which receives all attribute changes (for Undo)
Definition at line 195 of file ndhints.hxx.
References m_pHistory.
Referenced by SwDoc::DeleteFormatRefMark(), SwDoc::DeleteTOXMark(), DeRegister(), SwRegHistory::InsertItems(), and sw::DocumentContentOperationsManager::lcl_RstTextAttr().
|
private |
Definition at line 406 of file ndhints.cxx.
References CompareSwpHtStart(), m_bEndMapNeedsSorting, m_bStartMapNeedsSorting, m_bWhichMapNeedsSorting, m_HintsByEnd, m_HintsByStart, and m_HintsByWhichAndStart.
Referenced by MergePortions().
|
private |
Definition at line 438 of file ndhints.cxx.
References m_bEndMapNeedsSorting, and m_HintsByEnd.
Referenced by DeleteAtPos(), GetLastPosSortedByEnd(), GetSortedByEnd(), Insert(), and SortIfNeedBe().
|
private |
Definition at line 428 of file ndhints.cxx.
References CompareSwpHtStart(), m_bStartMapNeedsSorting, and m_HintsByStart.
Referenced by DeleteAtPos(), Get(), GetIndexOf(), Insert(), and SortIfNeedBe().
|
private |
Definition at line 448 of file ndhints.cxx.
References m_bWhichMapNeedsSorting, and m_HintsByWhichAndStart.
Referenced by DeleteAtPos(), GetFirstPosSortedByWhichAndStart(), GetSortedByWhichAndStart(), Insert(), and SortIfNeedBe().
|
inlineprivate |
Definition at line 110 of file ndhints.hxx.
References m_bCalcHiddenParaField.
|
inlineprivate |
Definition at line 111 of file ndhints.hxx.
References m_bHiddenByParaField.
Referenced by CalcHiddenParaField().
|
inlineprivate |
Definition at line 109 of file ndhints.hxx.
References m_bInSplitNode.
Referenced by SwTextNode::SplitContentNode().
|
inline |
Trigger the sorting if necessary.
Definition at line 176 of file ndhints.hxx.
References m_bEndMapNeedsSorting, m_bStartMapNeedsSorting, m_bWhichMapNeedsSorting, ResortEndMap(), ResortStartMap(), and ResortWhichMap().
Referenced by sw::MergedAttrIterReverse::MergedAttrIterReverse(), sw::MergedAttrIterReverse::PrevAttr(), and SwTextRefMark::UpdateFieldContent().
|
inline |
Definition at line 212 of file ndhints.hxx.
References m_bEndMapNeedsSorting, m_bStartMapNeedsSorting, and m_bWhichMapNeedsSorting.
Referenced by SwTextAttr::SetStart().
bool SwpHints::TryInsertHint | ( | SwTextAttr *const | pHint, |
SwTextNode & | rNode, | ||
const SetAttrMode | nMode = SetAttrMode::DEFAULT |
||
) |
try to insert the hint
Definition at line 3037 of file thints.cxx.
References Before, Behind, BuildPortions(), CalcFlags(), CHECK, SwTextField::ChgTextNode(), SwField::ChgTyp(), CollideEnd, CollideStart, ComparePosition(), Count(), Cut(), Database, DbNextSet, DbNumSet, Dde, SwTextNode::DestroyAttr(), DONTEXPAND, Get(), SwTextAttr::GetAttr(), SwDoc::GetAttrPool(), SwTextAttr::GetAutoFormat(), SwFormatCharFormat::GetCharFormat(), SwTextAttr::GetCharFormat(), SwNode::GetDoc(), SwDoc::GetDocShell(), SwTextAttr::GetEnd(), SwFormatField::GetField(), SwTextAttr::GetFormatField(), SwDoc::getIDocumentFieldsAccess(), CharFormat::GetItem(), SwFormat::GetItemState(), SwNode::GetNodes(), SwTextField::GetpTextNode(), SwTextAttr::GetStart(), SwFormatAutoFormat::GetStyleHandle(), SwField::GetTyp(), nsSwGetSetExpType::GSE_SEQ, HiddenPara, HiddenText, IDocumentFieldsAccess::InsDeletedFieldType(), IDocumentFieldsAccess::InsDelFieldInFieldLst(), Insert(), INSERTED, IDocumentFieldsAccess::InsertFieldType(), SwNodes::IsDocNodes(), SwDoc::IsInReading(), SwDoc::IsInXMLImport(), SwTextAttr::IsNesting(), IDocumentFieldsAccess::IsNewFieldLst(), SwTextAttr::IsOverlapAllowedAttr(), lcl_CheckSortNumber(), MAX_HINTS, MergePortions(), n, NOHINTADJUST, NoteInHistory(), Outside, OverlapBefore, OverlapBehind, Postit, SwFormatField::RegisterToFieldType(), RES_CHRATR_HIDDEN(), RES_CHRATR_RSID(), RES_TXTATR_ANNOTATION(), RES_TXTATR_AUTOFMT(), RES_TXTATR_CHARFMT(), RES_TXTATR_CJK_RUBY(), RES_TXTATR_CONTENTCONTROL(), RES_TXTATR_FIELD(), RES_TXTATR_FTN(), RES_TXTATR_INETFMT(), RES_TXTATR_INPUTFIELD(), RES_TXTATR_META(), RES_TXTATR_METAFIELD(), RES_TXTATR_REFMARK(), RES_TXTATR_TOXMARK(), SwTextNode::SetCalcHiddenCharFlags(), SwTextAttr::SetDontExpand(), SwTextAttr::SetEnd(), SetExp, SwSetExpFieldType::SetSeqRefNo(), SwTextAttr::SetStart(), SwTextNode::TriggerNodeUpdate(), TryInsertNesting(), User, SwFieldType::Which(), and SwTextAttr::Which().
|
private |
The following hints correspond to well-formed XML elements in ODF: RES_TXTATR_INETFMT, RES_TXTATR_CJK_RUBY, RES_TXTATR_META, RES_TXTATR_METAFIELD, RES_TXTATR_CONTENTCONTROL.
The writer core must ensure that these do not overlap; if they did, the document would not be storable as ODF.
Also, a Hyperlink must not be nested within another Hyperlink, and a Ruby must not be nested within another Ruby.
The ODF export in xmloff will only put a hyperlink into a ruby, never a ruby into a hyperlink.
Unfortunately the UNO API for Hyperlink and Ruby consists of the properties Hyperlink* and Ruby* of the css.text.CharacterProperties service. In other words, they are treated as formatting attributes, not as content entities. Furthermore, for API users it is not possible to easily test whether a certain range would be overlapping with other nested attributes, and most importantly, which ones, so we can hardly refuse to insert these in cases of overlap.
It is possible to split Hyperlink and Ruby into multiple portions, such that the result is properly nested.
meta and meta-field must not be split, because they have xml:id.
content controls should not split, either.
These constraints result in the following design:
RES_TXTATR_INETFMT: always succeeds inserts n attributes split at RES_TXTATR_CJK_RUBY, RES_TXTATR_META, RES_TXTATR_METAFIELD may replace existing RES_TXTATR_INETFMT at overlap RES_TXTATR_CJK_RUBY: always succeeds inserts n attributes split at RES_TXTATR_META, RES_TXTATR_METAFIELD may replace existing RES_TXTATR_CJK_RUBY at overlap may split existing overlapping RES_TXTATR_INETFMT RES_TXTATR_META: may fail if overlapping existing RES_TXTATR_META/RES_TXTATR_METAFIELD may split existing overlapping RES_TXTATR_INETFMT or RES_TXTATR_CJK_RUBY inserts 1 attribute RES_TXTATR_METAFIELD: may fail if overlapping existing RES_TXTATR_META/RES_TXTATR_METAFIELD may split existing overlapping RES_TXTATR_INETFMT or RES_TXTATR_CJK_RUBY inserts 1 attribute
The nesting is expressed by the position of the hints. RES_TXTATR_META and RES_TXTATR_METAFIELD have a CH_TXTATR, and there can only be one such hint starting and ending at a given position. Only RES_TXTATR_INETFMT and RES_TXTATR_CJK_RUBY lack a CH_TXTATR. The interpretation given is that RES_TXTATR_CJK_RUBY is always around a RES_TXTATR_INETFMT at the same start and end position (which corresponds with the UNO API). Both of these are always around a nesting hint with CH_TXTATR at the same start and end position (if they should be inside, then the start should be after the CH_TXTATR). It would probably be a bad idea to add another nesting hint without CH_TXTATR; on the other hand, it would be difficult adding a CH_TXTATR to RES_TXTATR_INETFMT and RES_TXTATR_CJK_RUBY, due to the overwriting and splitting of existing hints that is necessary for backward compatibility.
@param rNode the text node @param rHint the hint to be inserted @returns true iff hint was successfully inserted
Definition at line 378 of file thints.cxx.
References sw::CalcBreaks(), ComparePosition(), Count(), Delete(), SwTextNode::DestroyAttr(), Equal, SwNode::GetDoc(), SwTextAttr::GetEnd(), SwTextAttrEnd::GetEnd(), SwNode::GetIndex(), GetSortedByEnd(), SwTextAttr::GetStart(), SwTextAttr::HasDummyChar(), i, InsertNesting(), Inside, isNestedAny(), SwTextAttr::IsNesting(), isOverlap(), isSelfNestable(), isSplittable(), lcl_DoSplitImpl(), lcl_DoSplitNew(), MakeTextAttrNesting(), MAX_HINTS, Outside, OverlapBefore, OverlapBehind, RES_TXTATR_CJK_RUBY(), RES_TXTATR_CONTENTCONTROL(), RES_TXTATR_INETFMT(), RES_TXTATR_INPUTFIELD(), RES_TXTATR_META(), RES_TXTATR_METAFIELD(), SAL_INFO, SAL_WARN_IF, splitPolicy(), TextAttrDelete(), TryInsertNesting(), and SwTextAttr::Which().
Referenced by TryInsertHint(), and TryInsertNesting().
|
friend |
Delete methods may only be called by the TextNode! Because the TextNode also guarantees removal of the Character for attributes without an end.
Definition at line 104 of file ndhints.hxx.
|
mutableprivate |
Definition at line 85 of file ndhints.hxx.
Referenced by CalcHiddenParaField(), DeleteAtPos(), IsHiddenByParaField(), and SetCalcHiddenParaField().
|
private |
|
mutableprivate |
Definition at line 93 of file ndhints.hxx.
Referenced by DeleteAtPos(), EndPosChanged(), GetLastPosSortedByEnd(), GetSortedByEnd(), Insert(), Resort(), ResortEndMap(), SortIfNeedBe(), and StartPosChanged().
|
private |
|
mutableprivate |
Definition at line 88 of file ndhints.hxx.
Referenced by CalcHiddenParaField(), DeleteAtPos(), IsHiddenByParaField(), and SetHiddenByParaField().
|
private |
true: the Node is in Split and Frames are moved
Definition at line 83 of file ndhints.hxx.
Referenced by IsInSplitNode(), and SetInSplitNode().
|
mutableprivate |
Definition at line 92 of file ndhints.hxx.
Referenced by DeleteAtPos(), EndPosChanged(), Get(), GetIndexOf(), Insert(), Resort(), ResortStartMap(), SortIfNeedBe(), and StartPosChanged().
|
mutableprivate |
Definition at line 94 of file ndhints.hxx.
Referenced by DeleteAtPos(), EndPosChanged(), GetFirstPosSortedByWhichAndStart(), GetSortedByWhichAndStart(), Insert(), Resort(), ResortWhichMap(), SortIfNeedBe(), and StartPosChanged().
|
private |
Definition at line 77 of file ndhints.hxx.
Referenced by Check(), DeleteAtPos(), GetLastPosSortedByEnd(), GetSortedByEnd(), Insert(), Resort(), and ResortEndMap().
|
private |
Definition at line 76 of file ndhints.hxx.
Referenced by CanBeDeleted(), Check(), Contains(), Count(), Cut(), DeleteAtPos(), Get(), GetIndexOf(), GetWithoutResorting(), Insert(), Resort(), and ResortStartMap().
|
private |
Definition at line 78 of file ndhints.hxx.
Referenced by DeleteAtPos(), GetFirstPosSortedByWhichAndStart(), GetSortedByWhichAndStart(), Insert(), Resort(), and ResortWhichMap().
|
private |
for Undo
Definition at line 80 of file ndhints.hxx.
Referenced by GetHistory(), NoteInHistory(), and Register().
|
private |
Definition at line 70 of file ndhints.hxx.
Referenced by CalcHiddenParaField(), and DeleteAtPos().
|
staticprivate |
Definition at line 74 of file ndhints.hxx.
Referenced by TryInsertHint(), and TryInsertNesting().