#include <pp_AttrProp.h>
Public Types | |
typedef std::unordered_map < std::string, std::string > | attributes_t |
typedef std::unordered_map < std::string, std::string > | properties_t |
Public Member Functions | |
PP_AttrProp () | |
This is the sole explicit constructor of class PP_AttrProp. | |
virtual | ~PP_AttrProp () |
This is the sole explicit destructor of class PP_AttrProp. | |
bool | setAttributes (const PP_PropertyVector &attributes) |
bool | setProperties (const PP_PropertyVector &properties) |
PP_PropertyVector | getAttributes () const |
PP_PropertyVector | getProperties () const |
bool | setAttribute (const gchar *szName, const gchar *szValue) |
bool | setProperty (const std::string &name, const std::string &value) |
bool | getNthAttribute (int ndx, const gchar *&szName, const gchar *&szValue) const |
bool | getNthProperty (int ndx, const gchar *&szName, const gchar *&szValue) const |
bool | getAttribute (const std::string &name, const gchar *&szValue) const |
bool | getProperty (const std::string &name, const gchar *&szValue) const |
std::unique_ptr< PP_PropertyType > | getPropertyType (const gchar *szName, tProperty_type Type) const |
bool | hasProperties (void) const |
Returns whether or not the AP has any properties. | |
bool | hasAttributes (void) const |
Returns whether or not the AP has any attributes. | |
size_t | getPropertyCount (void) const |
size_t | getAttributeCount (void) const |
bool | areAlreadyPresent (const PP_PropertyVector &attributes, const PP_PropertyVector &properties) const |
Returns whether or not the given attributes and properties are identically present in [this] AP. | |
bool | areAnyOfTheseNamesPresent (const PP_PropertyVector &attributes, const PP_PropertyVector &properties) const |
bool | isExactMatch (const PP_AttrProp &pMatch) const |
bool | isEquivalent (const PP_AttrProp *pAP2) const |
bool | isEquivalent (const PP_PropertyVector &attrs, const PP_PropertyVector &props) const |
PP_AttrProp * | cloneWithReplacements (const PP_PropertyVector &attributes, const PP_PropertyVector &properties, bool bClearProps) const |
PP_AttrProp * | cloneWithElimination (const PP_PropertyVector &attributes, const PP_PropertyVector &properties) const |
PP_AttrProp * | cloneWithEliminationIfEqual (const PP_PropertyVector &attributes, const PP_PropertyVector &properties) const |
void | markReadOnly (void) |
UT_uint32 | getCheckSum (void) const |
PP_AttrProp & | operator= (const PP_AttrProp &Other) |
UT_uint32 | getIndex (void) const |
void | setIndex (UT_uint32 i) |
PT_AttrPropIndex | getRevisedIndex () const |
PP_RevisionState & | getRevisionState () const |
void | setRevisedIndex (PT_AttrPropIndex i, UT_uint32 iId, bool bShow, bool bMark, bool bHidden) const |
bool | getRevisionHidden () const |
void | prune () |
This method clears both empty attributes and empty properties from [this] AP. | |
bool | explodeStyle (const PD_Document *pDoc, bool bOverwrite=false) |
This function transfers attributes and properties defined in style into the AP. | |
void | miniDump (const PD_Document *pDoc) const |
Static Public Member Functions | |
static PP_AttrProp * | createExactly (const PP_PropertyVector &attributes, const PP_PropertyVector &properties) |
Protected Member Functions | |
void | _computeCheckSum (void) |
void | _clearEmptyProperties () |
This function will remove all properties that are set to "". | |
void | _clearEmptyAttributes () |
This function will remove all attributes that are equal to "". | |
Protected Attributes | |
attributes_t | m_attributes |
properties_t | m_properties |
bool | m_bIsReadOnly |
UT_uint32 | m_checkSum |
UT_uint32 | m_index |
PT_AttrPropIndex | m_iRevisedIndex |
PP_RevisionState | m_RevisionState |
bool | m_bRevisionHidden |
typedef std::unordered_map<std::string, std::string> PP_AttrProp::attributes_t |
typedef std::unordered_map<std::string, std::string> PP_AttrProp::properties_t |
PP_AttrProp::PP_AttrProp | ( | ) |
This is the sole explicit constructor of class PP_AttrProp.
Referenced by cloneWithReplacements(), and createExactly().
PP_AttrProp::~PP_AttrProp | ( | ) | [virtual] |
This is the sole explicit destructor of class PP_AttrProp.
void PP_AttrProp::_clearEmptyAttributes | ( | ) | [protected] |
This function will remove all attributes that are equal to "".
References m_attributes, m_bIsReadOnly, and UT_return_if_fail.
Referenced by prune().
void PP_AttrProp::_clearEmptyProperties | ( | ) | [protected] |
This function will remove all properties that are set to "".
References m_bIsReadOnly, m_properties, and UT_return_if_fail.
Referenced by prune().
void PP_AttrProp::_computeCheckSum | ( | void | ) | [protected] |
Compute the checksum by which we speed AP equivalence testing. (?)To the best of my knowledge, collision is still possible. (?)TODO: Document the algorithm/process here, and answer remaining questions about this chunk of code.
This checksum isn't persisted so changing it for future version is safe.
References ascii_strdown(), gchar, hashcodeBytesAP(), m_attributes, m_checkSum, and m_properties.
Referenced by markReadOnly().
bool PP_AttrProp::areAlreadyPresent | ( | const PP_PropertyVector & | attributes, | |
const PP_PropertyVector & | properties | |||
) | const |
Returns whether or not the given attributes and properties are identically present in [this] AP.
This method compares the given attributes and properties with those already present. It compares the given items as inseparable pairs - if the attribute or property is present in name but contains a different value, that does not count and false is returned.
References ASSERT_PV_SIZE, gchar, getAttribute(), getProperty(), and hasProperties().
Referenced by PD_Style::addAttributes(), and pt_VarSet::mergeAP().
bool PP_AttrProp::areAnyOfTheseNamesPresent | ( | const PP_PropertyVector & | attributes, | |
const PP_PropertyVector & | properties | |||
) | const |
Find out if any attribute- or property-name is present. This is like areAlreadyPresent(), but we don't care about the values, and it returns true after the first discovery regardless of whether or not any other of the given names are present.
References ASSERT_PV_SIZE, gchar, getAttribute(), and getProperty().
Referenced by pt_PieceTable::_realInsertSpan(), and pt_VarSet::mergeAP().
PP_AttrProp * PP_AttrProp::cloneWithElimination | ( | const PP_PropertyVector & | attributes, | |
const PP_PropertyVector & | properties | |||
) | const |
Create a new AttrProp based upon the given one, removing the items given regardless of their value. See also PP_AttrProp::cloneWithEliminationIfEqual, which does similarly but only removes the items given if their value is equal to the value given.
References ASSERT_PV_SIZE, gchar, getNthAttribute(), getNthProperty(), PT_PROPS_ATTRIBUTE_NAME, and UT_return_val_if_fail.
Referenced by pt_PieceTable::_realInsertSpan(), and pt_VarSet::mergeAP().
PP_AttrProp * PP_AttrProp::cloneWithEliminationIfEqual | ( | const PP_PropertyVector & | attributes, | |
const PP_PropertyVector & | properties | |||
) | const |
Create a new AttrProp based upon the given one, removing the items given if their value is equal to that given. See also PP_AttrProp::cloneWithElimination, which does similarly but removes the items given regardless of whether or not their value is equal to the value given.
References ASSERT_PV_SIZE, gchar, getNthAttribute(), getNthProperty(), and PT_PROPS_ATTRIBUTE_NAME.
Referenced by pt_VarSet::mergeAP().
PP_AttrProp * PP_AttrProp::cloneWithReplacements | ( | const PP_PropertyVector & | attributes, | |
const PP_PropertyVector & | properties, | |||
bool | bClearProps | |||
) | const |
Create a new AttrProp based upon the given one, adding or replacing the items given.
References gchar, getNthAttribute(), getNthProperty(), PP_AttrProp(), PT_PROPS_ATTRIBUTE_NAME, UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.
Referenced by PD_Style::addAttributes(), PD_Style::addProperties(), PD_Style::addProperty(), pt_PieceTable::appendLastStruxFmt(), pt_PieceTable::appendStruxFmt(), pt_PieceTable::changeLastStruxFmtNoUndo(), pt_VarSet::mergeAP(), PD_DocumentRDFMutation::PD_DocumentRDFMutation(), and FL_DocLayout::relocateFrame().
PP_AttrProp * PP_AttrProp::createExactly | ( | const PP_PropertyVector & | attributes, | |
const PP_PropertyVector & | properties | |||
) | [static] |
Create a new AttrProp with exactly the attributes/properties given.
References PP_AttrProp().
Referenced by FV_View::insertFootnote(), and pt_VarSet::mergeAP().
bool PP_AttrProp::explodeStyle | ( | const PD_Document * | pDoc, | |
bool | bOverwrite = false | |||
) |
This function transfers attributes and properties defined in style into the AP.
bOverwrite | indicates what happens if the property/attribute is already present. If false \ (default) the style definition is ignored; if true the style value overrides the present value. |
References gchar, PD_Style::getAllAttributes(), PD_Style::getAllProperties(), getAttribute(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), getProperty(), PD_Document::getStyle(), PT_STYLE_ATTRIBUTE_NAME, setAttribute(), setProperty(), and UT_return_val_if_fail.
Referenced by PD_Document::explodeRevisions(), and PP_RevisionAttr::pruneForCumulativeResult().
bool PP_AttrProp::getAttribute | ( | const std::string & | name, | |
const gchar *& | szValue | |||
) | const |
This method finds the attribute indicated by name
szName | (the name of the attribute the value of which to find) and assigns its value to | |
szValue | (the value found of the attribute requested) or returns false if the attributes as a whole or the attribute requested are not found. It returns |
WARNING: Be sure to check the return value before trying to work with szValue.
References m_attributes.
Referenced by ODe_Styles::_addStyle(), ODe_Text_Listener::_blockIsPlainParagraph(), s_RTF_ListenerGetProps::_check_revs_for_color(), s_RTF_ListenerGetProps::_check_revs_for_font(), fl_FrameLayout::_createFrameContainer(), pt_PieceTable::_deleteHdrFtrsFromSectionStruxIfPresent(), fl_BlockLayout::_doInsertFieldRun(), ODe_AbiDocListener::_endAnnotation(), pt_PieceTable::_fixHdrFtrReferences(), PD_Style::_getAttributeExpand(), ODe_AbiDocListener::_getObjectKey(), IE_Exp_HTML_Listener::_getObjectKey(), _getStyle(), IE_Exp_HTML_XHTMLWriter::_handleAwmlStyle(), s_XSL_FO_Listener::_handleBookmark(), s_WML_Listener::_handleBookmark(), s_DocBook_Listener::_handleBookmark(), s_XSL_FO_Listener::_handleEmbedded(), s_WML_Listener::_handleEmbedded(), s_DocBook_Listener::_handleEmbedded(), s_XSL_FO_Listener::_handleField(), s_WML_Listener::_handleField(), s_DocBook_Listener::_handleField(), s_DocBook_Listener::_handleFootnote(), s_XSL_FO_Listener::_handleFrame(), s_DocBook_Listener::_handleHdrFtr(), s_XSL_FO_Listener::_handleHyperlink(), s_WML_Listener::_handleHyperlink(), s_DocBook_Listener::_handleHyperlink(), s_XSL_FO_Listener::_handleImage(), s_WML_Listener::_handleImage(), s_LaTeX_Listener::_handleImage(), IE_Exp_HTML_Listener::_handleImage(), s_DocBook_Listener::_handleImage(), s_XSL_FO_Listener::_handleMath(), s_WML_Listener::_handleMath(), s_DocBook_Listener::_handleMath(), PP_Revision::_handleNestedRevAttr(), s_XSL_FO_Listener::_handlePositionedImage(), s_DocBook_Listener::_handlePositionedImage(), PD_Document::_importFile(), PL_Psion_Listener::_insertImage(), IE_Exp_HTML_Listener::_insertPosImage(), ODe_Main_Listener::_isHeaderFooterSection(), fp_TextRun::_lookupProperties(), fp_FieldRun::_lookupProperties(), fp_EndOfParagraphRun::_lookupProperties(), fp_MathRun::_lookupProperties(), fp_EmbedRun::_lookupProperties(), fp_DirectionMarkerRun::_lookupProperties(), fl_DocSectionLayout::_lookupProperties(), fl_EndnoteLayout::_lookupProperties(), fl_AnnotationLayout::_lookupProperties(), fl_FootnoteLayout::_lookupProperties(), fl_BlockLayout::_lookupProperties(), ODe_AbiDocListener::_openAnnotation(), s_XSL_FO_Listener::_openBlock(), OO_Listener::_openBlock(), ODe_AbiDocListener::_openBookmark(), IE_Exp_HTML_Listener::_openBookmark(), ODe_AbiDocListener::_openField(), IE_Exp_HTML_Listener::_openField(), s_RTF_ListenerWriteDoc::_openFrame(), ODe_Main_Listener::_openHeaderFooterSection(), ODe_Text_Listener::_openODListItem(), s_WML_Listener::_openParagraph(), PL_Psion_Listener::_openParagraph(), s_LaTeX_Listener::_openParagraph(), s_DocBook_Listener::_openParagraph(), ODe_Text_Listener::_openParagraphDelayed(), s_WML_Listener::_openSection(), s_DocBook_Listener::_openSection(), s_RTF_ListenerWriteDoc::_openSpan(), s_DocBook_Listener::_openSpan(), s_RTF_ListenerWriteDoc::_openTag(), s_HRText_Listener::_openTag(), s_AbiWord_1_Listener::_openTag(), pt_PieceTable::_realChangeStruxFmt(), s_RTF_ListenerWriteDoc::_rtf_open_section(), fp_HyperlinkRun::_setTitleFromAPAttribute(), pt_PieceTable::_translateRevisionAttribute(), IE_Exp_RTF::_write_parafmt(), IE_Exp_RTF::_write_rtf_header(), s_RTF_ListenerWriteDoc::_writeAnnotation(), s_RTF_ListenerWriteDoc::_writeBookmark(), s_RTF_ListenerWriteDoc::_writeHyperlink(), s_RTF_ListenerWriteDoc::_writeImageInRTF(), PD_Document::acceptAllRevisions(), PD_Document::acceptRejectRevision(), PD_Document::addAuthorAttributeIfBlank(), PD_DocumentRDF::addXMLIDsForBlockAndTableCellForPosition(), PD_DocumentRDF::addXMLIDsForObjects(), areAlreadyPresent(), areAnyOfTheseNamesPresent(), fl_SectionLayout::bl_doclistener_insertSection(), fp_FieldEndnoteRefRun::calculateValue(), fp_FieldEndnoteAnchorRun::calculateValue(), fp_FieldFootnoteAnchorRun::calculateValue(), fp_FieldFootnoteRefRun::calculateValue(), fl_DocListener::change(), PD_Document::changeDocPropeties(), pt_PieceTable::changeSpanFmt(), pt_PieceTable::changeStruxFmt(), ODe_Text_Listener::closeBookmark(), FV_View::convertPositionedToInLine(), fl_CellLayout::createCellContainer(), FG_Graphic::createFromChangeRecord(), FG_Graphic::createFromStrux(), Defun1(), pt_PieceTable::deleteHdrFtrStrux(), pt_PieceTable::deleteSpan(), dlgEditLatexEquation(), fl_BlockLayout::doclistener_insertSection(), fl_DocSectionLayout::doMarginChangeOnly(), PD_DocumentRDF::dumpObjectMarkersFromDocument(), PD_Document::explodeRevisions(), explodeStyle(), ODe_Style_Style::fetchAttributesFromAbiBlock(), ODe_ListLevelStyle::fetchAttributesFromAbiBlock(), ODe_Style_Style::CellProps::fetchAttributesFromAbiProps(), ODe_Style_PageLayout::fetchAttributesFromAbiSection(), ODe_Style_MasterPage::fetchAttributesFromAbiSection(), ODe_Style_Style::fetchAttributesFromAbiSpan(), ODe_Style_Style::fetchAttributesFromAbiStyle(), fl_BlockLayout::fl_BlockLayout(), fp_FieldEndnoteAnchorRun::fp_FieldEndnoteAnchorRun(), fp_FieldEndnoteRefRun::fp_FieldEndnoteRefRun(), fp_FieldFootnoteAnchorRun::fp_FieldFootnoteAnchorRun(), fp_FieldFootnoteRefRun::fp_FieldFootnoteRefRun(), PD_Style::getAttribute(), OXML_ObjectWithAttrProp::getAttribute(), s_RTF_AttrPropAdapter_AP::getAttribute(), fl_ContainerLayout::getAttribute(), PD_Style::getAttributeExpand(), PD_Document::getAttrProp(), fl_ContainerLayout::getLevelInList(), fl_BlockLayout::getListAttributesVector(), s_AbiWord_1_Listener::getObjectKey(), PD_DocumentRDF::getObjectsInScopeOfTypesForRange(), FV_FrameEdit::getPNGImage(), PD_Document::getSpanAttrProp(), pf_Frag::getXMLID(), ODe_Style_PageLayout::hasPageLayoutInfo(), ODe_Text_Listener::insertInlinedImage(), ODe_Text_Listener::insertPositionedImage(), pt_PieceTable::insertSpan(), isEquivalent(), FV_View::isNumberedHeadingHere(), GR_LasemMathManager::loadEmbedData(), GR_GOChartManager::loadEmbedData(), fp_Run::lookupProperties(), OO_StylesWriter::map(), pt_VarSet::mergeAP(), FV_VisualInlineImage::mouseRelease(), ODe_TOC_Listener::openBlock(), ODe_Text_Listener::openBookmark(), ODe_Note_Listener::openEndnote(), ODe_Note_Listener::openFootnote(), ODe_Text_Listener::openFrame(), ODe_Text_Listener::openHyperlink(), OO_WriterImpl::openHyperlink(), ODe_Text_Listener::openSpan(), PP_Revision::operator==(), PD_Bookmark::PD_Bookmark(), pf_Frag_Object::pf_Frag_Object(), ODe_AbiDocListener::populate(), IE_Exp_OpenXML_Listener::populate(), OO_Listener::populate(), s_LaTeX_Listener::populate(), IE_Exp_HTML_BookmarkListener::populate(), IE_Exp_HTML_Listener::populate(), ODe_AbiDocListener::populateStrux(), TOC_Listener::populateStrux(), s_XSL_FO_Listener::populateStrux(), s_RTF_ListenerWriteDoc::populateStrux(), PL_Psion_Listener::populateStrux(), IE_Exp_OpenXML_Listener::populateStrux(), s_LaTeX_Listener::populateStrux(), s_KWord_1_Listener::populateStrux(), IE_Exp_HTML_HeaderFooterListener::populateStrux(), s_HRText_Listener::populateStrux(), fl_ShadowListener::populateStrux(), fl_DocListener::populateStrux(), PD_DocumentRDF::priv_addRelevantIDsForPosition(), PP_RevisionAttr::pruneForCumulativeResult(), PD_Document::purgeRevisionTable(), PD_XMLIDCreator::rebuildCache(), PD_Document::rejectAllHigherRevisions(), s_doFormatImageDlg(), FV_View::saveSelectedImage(), RDFAnchor::setup(), fl_BlockLayout::StartList(), IE_Exp_HTML_StyleListener::styleCheck(), fl_DocSectionLayout::updateDocSection(), UT_getAttribute(), UT_getAttributeTyped(), UT_getLatestAttribute(), and x_getStyle().
size_t PP_AttrProp::getAttributeCount | ( | void | ) | const |
Returns the number of attributes in this PP_AttrProp.
References m_attributes.
Referenced by PD_Document::_acceptRejectRevision(), ABI_Collab_Export::_mapPropsAtts(), s_AbiWord_1_Listener::_openTag(), PP_Revision::_refreshString(), PD_Style::getAttributeCount(), isEquivalent(), PP_Revision::onlyContainsAbiwordChangeTrackingMarkup(), PP_Revision::operator==(), IE_Exp_OpenXML_Listener::populate(), IE_Exp_OpenXML_Listener::populateStrux(), and TFTEST_MAIN().
PP_PropertyVector PP_AttrProp::getAttributes | ( | ) | const |
References m_attributes.
Referenced by PP_Revision::_handleNestedRevAttr(), pt_PieceTable::_insertFmtMarkFragWithNotify(), FV_View::cmdInsertCol(), FV_View::cmdInsertRow(), FV_View::cmdSplitCells(), PD_Document::explodeRevisions(), OXML_ObjectWithAttrProp::getAttributes(), IE_Exp_DocRangeListener::IE_Exp_DocRangeListener(), FV_View::insertFootnote(), IE_Imp_PasteListener::populate(), IE_Exp_DocRangeListener::populate(), IE_Imp_PasteListener::populateStrux(), IE_Exp_DocRangeListener::populateStrux(), PP_RevisionAttr::pruneForCumulativeResult(), FL_DocLayout::relocateFrame(), FV_View::resetCharFormat(), TFTEST_MAIN(), and FV_View::toggleCase().
UT_uint32 PP_AttrProp::getCheckSum | ( | void | ) | const |
This is an accessor method that gets the checksum of [this] AP, by which we speed equivalence testing. The speedup occurs when we bypass full-testing in the case of checksum mismatch when we know for sure that the APs are not equivalent. Because collisions still occur, we do the full-testing if the checksums do match.
m_checkSum | The unsigned 32-bit integer which serves as the AP's checksum. |
References m_checkSum.
Referenced by compareAP(), compareAPBinary(), pp_TableAttrProp::findMatch(), and TFTEST_MAIN().
UT_uint32 PP_AttrProp::getIndex | ( | void | ) | const |
References m_index.
Referenced by pp_TableAttrProp::findMatch().
bool PP_AttrProp::getNthAttribute | ( | int | ndx, | |
const gchar *& | szName, | |||
const gchar *& | szValue | |||
) | const |
This method finds the Nth attribute where N is
ndx | The number in order of the attribute to be found and assigns that attribute's name and value to | |
szName | The name of the attribute found | |
szValue | The value of the attribute found respectively. The method returns |
WARNING: Always check the return value before trying to work with szValue!
References m_attributes.
Referenced by PD_Document::_acceptRejectRevision(), ABI_Collab_Export::_mapPropsAtts(), s_AbiWord_1_Listener::_openTag(), PP_Revision::_refreshString(), fp_HyperlinkRun::_setTargetFromAPAttribute(), cloneWithElimination(), cloneWithEliminationIfEqual(), cloneWithReplacements(), PD_Style::getNthAttribute(), isEquivalent(), miniDump(), PP_Revision::onlyContainsAbiwordChangeTrackingMarkup(), operator=(), PP_Revision::operator==(), s_RTF_ListenerWriteDoc::populate(), IE_Exp_OpenXML_Listener::populate(), s_AbiWord_1_Listener::populate(), and IE_Exp_OpenXML_Listener::populateStrux().
bool PP_AttrProp::getNthProperty | ( | int | ndx, | |
const gchar *& | szName, | |||
const gchar *& | szValue | |||
) | const |
This method finds the Nth property where N is
ndx | The number in order of the property to be found and assigns that property's name and value to | |
szName | The name of the property found | |
szValue | The value of the property found respectively. The method returns |
WARNING: Always check the return value before trying to work with szValue!
References m_properties.
Referenced by PD_Document::_acceptRejectRevision(), PD_Document::_buildAuthorProps(), s_AbiWord_1_Listener::_handleAuthors(), ABI_Collab_Export::_mapPropsAtts(), s_RTF_ListenerWriteDoc::_openFrame(), s_RTF_ListenerWriteDoc::_openTag(), s_AbiWord_1_Listener::_openTag(), PP_Revision::_refreshString(), PD_DocumentRDF::apDumpModel(), PD_DocumentRDF::apGetAllSubjects(), PD_DocumentRDF::apGetSubjects(), PD_DocumentRDFMutation::apRemove(), PD_Document::changeDocPropeties(), cloneWithElimination(), cloneWithEliminationIfEqual(), cloneWithReplacements(), PD_Style::getNthProperty(), OXML_ObjectWithAttrProp::getNthProperty(), PD_DocumentRDFMutation::handleAddAndRemove(), XAP_PaletteProperties_Level::initWithAP:levelName:, isEquivalent(), GOComponentView::loadBuffer(), miniDump(), PD_RDFModelIterator::moveToNextSubject(), operator=(), PP_Revision::operator==(), IE_Exp_OpenXML_Listener::populate(), IE_Exp_OpenXML_Listener::populateStrux(), FV_View::resetCharFormat(), PD_RDFModelIterator::setup_pocol(), and PD_RDFModelFromStartEndPos::StatementIterator::setup_pocol().
PP_PropertyVector PP_AttrProp::getProperties | ( | ) | const |
This method retrieves the entirety of [this] AP's "props", and returns it as a PP_PropertyVector
References m_properties.
Referenced by PP_Revision::_handleNestedRevAttr(), pt_PieceTable::_insertFmtMarkFragWithNotify(), FV_View::cmdInsertCol(), FV_View::cmdInsertRow(), FV_View::cmdSplitCells(), PD_DocumentRDFMutation::commit(), PD_Document::explodeRevisions(), OXML_ObjectWithAttrProp::getProperties(), FV_View::insertFootnote(), FV_FrameEdit::mouseRelease(), IE_Imp_PasteListener::populate(), IE_Exp_DocRangeListener::populate(), IE_Imp_PasteListener::populateStrux(), IE_Exp_DocRangeListener::populateStrux(), PP_RevisionAttr::pruneForCumulativeResult(), FL_DocLayout::relocateFrame(), FV_View::resetCharFormat(), FL_DocLayout::setDocViewPageSize(), TFTEST_MAIN(), and FV_View::toggleCase().
bool PP_AttrProp::getProperty | ( | const std::string & | name, | |
const gchar *& | szValue | |||
) | const |
This method finds the property indicated by name
szName | (the name of the property the value of which to find) and assigns its value to | |
szValue | (the value found of the property requested) or returns false if the properties as a whole or the property requested are not found. It returns |
WARNING: Be sure to check the return value before trying to work with szValue.
References m_properties.
Referenced by WordPerfect_Listener::_closeSpan(), s_WML_Listener::_closeSpan(), s_HRText_Listener::_closeSpan(), s_DocBook_Listener::_closeSpan(), AP_Dialog_Paragraph::_createPreviewFromGC(), s_WML_Listener::_emitTOC(), s_RTF_ListenerWriteDoc::_fillCellProps(), s_RTF_ListenerWriteDoc::_fillTableProps(), fp_MathRun::_getLayoutPropFromObject(), fp_EmbedRun::_getLayoutPropFromObject(), fl_ContainerLayout::_getPropertiesAP(), PD_Style::_getPropertyExpand(), IE_Exp_HTML_Listener::_handleAnnotationData(), Text_Listener::_handleDirMarker(), s_DocBook_Listener::_handleDocument(), s_XSL_FO_Listener::_handleEmbedded(), s_WML_Listener::_handleEmbedded(), s_DocBook_Listener::_handleEmbedded(), s_XSL_FO_Listener::_handleImage(), s_WML_Listener::_handleImage(), s_LaTeX_Listener::_handleImage(), IE_Exp_HTML_Listener::_handleImage(), s_DocBook_Listener::_handleImage(), s_XSL_FO_Listener::_handleMath(), s_WML_Listener::_handleMath(), s_DocBook_Listener::_handleMath(), s_XSL_FO_Listener::_handlePositionedImage(), s_DocBook_Listener::_handlePositionedImage(), s_DocBook_Listener::_handleTOC(), ODe_AbiDocListener::_insertMath(), IE_Exp_HTML_Listener::_insertTOC(), fl_TableLayout::_lookupMarginProperties(), fl_FrameLayout::_lookupMarginProperties(), fp_ImageRun::_lookupProperties(), fp_MathRun::_lookupProperties(), fp_EmbedRun::_lookupProperties(), fl_TOCLayout::_lookupProperties(), fl_CellLayout::_lookupProperties(), fl_TableLayout::_lookupProperties(), fl_DocSectionLayout::_lookupProperties(), fl_FrameLayout::_lookupProperties(), fl_AnnotationLayout::_lookupProperties(), FL_DocLayout::_lookupProperties(), fl_BlockLayout::_lookupProperties(), s_XSL_FO_Listener::_openBlock(), WordPerfect_Listener::_openBlock(), Passepartout_Listener::_openBlock(), s_KWord_1_Listener::_openBlock(), IE_Exp_HTML_Listener::_openBlock(), Passepartout_Listener::_openFont(), s_RTF_ListenerWriteDoc::_openFrame(), IE_Exp_HTML_Listener::_openFrame(), IE_Exp_HTML_Listener::_openList(), ODe_Frame_Listener::_openODTextbox(), s_WML_Listener::_openParagraph(), s_LaTeX_Listener::_openParagraph(), ODe_Text_Listener::_openParagraphDelayed(), s_LaTeX_Listener::_openSection(), IE_Exp_HTML_Listener::_openSection(), s_XSL_FO_Listener::_openSpan(), WordPerfect_Listener::_openSpan(), s_WML_Listener::_openSpan(), s_LaTeX_Listener::_openSpan(), s_KWord_1_Listener::_openSpan(), IE_Exp_HTML_Listener::_openSpan(), s_HRText_Listener::_openSpan(), s_DocBook_Listener::_openSpan(), s_HRText_Listener::_openTag(), s_AbiWord_1_Listener::_openTag(), IE_Exp_HTML_Listener::_openTextbox(), fp_MathRun::_updatePropValuesIfNeeded(), fp_EmbedRun::_updatePropValuesIfNeeded(), IE_Exp_RTF::_write_parafmt(), IE_Exp_RTF::_write_rtf_header(), s_RTF_ListenerWriteDoc::_writeImageInRTF(), s_RTF_ListenerWriteDoc::_writeTOC(), PD_DocumentRDFMutation::apAdd(), PD_DocumentRDF::apContains(), PD_DocumentRDF::apGetArcsOut(), PD_DocumentRDF::apGetObjects(), areAlreadyPresent(), areAnyOfTheseNamesPresent(), ODe_ListLevelStyle::calculateListMargins(), fl_DocListener::change(), PD_Document::changeDocPropeties(), FV_View::cmdCharDelete(), FV_View::convertPositionedToInLine(), Defun1(), Defun_EV_GetMenuItemState_Fn(), dlgEditLatexEquation(), fl_DocSectionLayout::doclistener_changeStrux(), fl_BlockLayout::doclistener_insertBlock(), explodeStyle(), ODe_Numbered_ListLevelStyle::fetchAttributesFromAbiBlock(), ODe_Bullet_ListLevelStyle::fetchAttributesFromAbiBlock(), ODe_Style_Style::GraphicProps::fetchAttributesFromAbiProps(), ODe_Style_Style::CellProps::fetchAttributesFromAbiProps(), ODe_Style_Style::TableProps::fetchAttributesFromAbiProps(), ODe_Style_Style::TextProps::fetchAttributesFromAbiProps(), ODe_Style_Style::ParagraphProps::fetchAttributesFromAbiProps(), ODe_Style_Style::SectionProps::fetchAttributesFromAbiProps(), ODe_Style_PageLayout::fetchAttributesFromAbiSection(), AP_Dialog_Lists::fillDialogFromBlock(), FV_View::FV_View(), FG_GraphicVector::generateImage(), FG_GraphicRaster::generateImage(), FV_View::getCellFormat(), ie_PartTable::getCellProp(), FG_GraphicVector::getHeightProp(), FG_GraphicRaster::getHeightProp(), pp_Author::getProperty(), PD_Style::getProperty(), OXML_ObjectWithAttrProp::getProperty(), PD_Style::getPropertyExpand(), getPropertySize(), ie_PartTable::getTableProp(), FG_GraphicVector::getWidthProp(), FG_GraphicRaster::getWidthProp(), PD_DocumentRDFMutation::handleAddAndRemove(), ODe_Style_PageLayout::hasPageLayoutInfo(), ODe_Style_Style::hasParagraphStyleProps(), PP_RevisionAttr::hasProperty(), ODe_Style_Style::hasSectionInfo(), ODe_Style_Style::hasTableStyleProps(), ODe_Style_Style::hasTextStyleProps(), ODe_Text_Listener::insertInlinedImage(), ODe_Text_Listener::insertPositionedImage(), isEquivalent(), ODe_Table_Cell::loadAbiProps(), fl_ContainerLayout::lookupFoldedLevel(), OO_StylesWriter::map(), FV_VisualInlineImage::mouseRelease(), AP_TopRuler::mouseRelease(), AP_LeftRuler::mouseRelease(), ODe_Text_Listener::openAnnotation(), ODe_Text_Listener::openFrame(), ODe_Frame_Listener::openFrame(), ODe_Table_Listener::openTable(), ODe_Text_Listener::openTOC(), ODe_HeadingSearcher_Listener::openTOC(), PP_Revision::operator==(), Passepartout_Listener::Passepartout_Listener(), IE_Exp_OpenXML_Listener::populate(), Text_Listener::populateStrux(), s_RTF_ListenerWriteDoc::populateStrux(), IE_Exp_OpenXML_Listener::populateStrux(), PP_evalProperty(), FV_View::queryCharFormat(), s_doLangDlg(), s_evalProperty(), FV_FrameEdit::setDragType(), ODe_Style_List::setLevelStyle(), fl_DocSectionLayout::setPaperColor(), AP_Dialog_FormatTOC::setPropFromDoc(), Text_Listener::Text_Listener(), RDFModel_SPARQLLimited::update(), updateCharacterLayout(), and updateParagraphLayout().
size_t PP_AttrProp::getPropertyCount | ( | void | ) | const |
Returns the number of properties in this PP_AttrProp.
References m_properties.
Referenced by PD_Document::_acceptRejectRevision(), PD_Document::_buildAuthorProps(), s_AbiWord_1_Listener::_handleAuthors(), ABI_Collab_Export::_mapPropsAtts(), s_AbiWord_1_Listener::_openTag(), PP_Revision::_refreshString(), PD_DocumentRDF::apDumpModel(), PD_DocumentRDF::apGetAllSubjects(), PD_DocumentRDF::apGetSubjects(), PD_DocumentRDFMutation::apRemove(), PD_Style::getPropertyCount(), OXML_ObjectWithAttrProp::getPropertyCount(), PD_DocumentRDFMutation::handleAddAndRemove(), XAP_PaletteProperties_Level::initWithAP:levelName:, isEquivalent(), PD_RDFModelIterator::moveToNextSubject(), PP_Revision::onlyContainsAbiwordChangeTrackingMarkup(), PD_RDFModelIterator::operator++(), PD_RDFModelFromStartEndPos::StatementIterator::operator++(), PP_Revision::operator==(), IE_Exp_OpenXML_Listener::populate(), IE_Exp_OpenXML_Listener::populateStrux(), and TFTEST_MAIN().
std::unique_ptr< PP_PropertyType > PP_AttrProp::getPropertyType | ( | const gchar * | szName, | |
tProperty_type | Type | |||
) | const |
(?)TODO: PLEASE DOCUMENT ME!
References PP_PropertyType::createPropertyType(), and m_properties.
Referenced by PD_Style::getPropertyType(), and PP_evalPropertyType().
PT_AttrPropIndex PP_AttrProp::getRevisedIndex | ( | ) | const [inline] |
Referenced by PD_Document::getAttrProp(), PD_Document::getSpanAttrProp(), miniDump(), and fl_ShadowListener::populateStrux().
bool PP_AttrProp::getRevisionHidden | ( | ) | const [inline] |
Referenced by PD_Document::getAttrProp(), and PD_Document::getSpanAttrProp().
PP_RevisionState& PP_AttrProp::getRevisionState | ( | ) | const [inline] |
Referenced by PD_Document::getAttrProp(), PD_Document::getSpanAttrProp(), and fl_ShadowListener::populateStrux().
bool PP_AttrProp::hasAttributes | ( | void | ) | const |
Returns whether or not the AP has any attributes.
This method checks [this] AP for the presence of any attribute. If there is any attribute at all in the AP, m_pAttributes->size() returns positive and so does this method. Otherwise, this method returns false. Beware that no sanity checking is done to make sure that whatever is in there (being counted by size()) is anything more legible than uninitialized memory.
References m_attributes.
Referenced by PP_RevisionAttr::addRevision(), FV_View::resetCharFormat(), TFTEST_MAIN(), and PP_Revision::toString().
bool PP_AttrProp::hasProperties | ( | void | ) | const |
Returns whether or not the AP has any properties.
This method checks [this] AP for the "props" attribute. The "props" attribute is a special attribute that contains properties. If the "props" attribute is absent, the method returns false. If the "props" attribute is present but empty (m_pProperties->size() == 0), it returns false. If the "props" attribute is present and has something in it, (m_pProperties->size() > 0), it returns true, but beware that no sanity checking is done to make sure that whatever is in there is anything more legible than uninitialized memory.
References m_properties.
Referenced by PP_RevisionAttr::addRevision(), areAlreadyPresent(), PD_DocumentRDFMutation::commit(), pt_VarSet::mergeAP(), FV_View::resetCharFormat(), AbiCollabSessionManager::startSession(), TFTEST_MAIN(), and PP_Revision::toString().
bool PP_AttrProp::isEquivalent | ( | const PP_AttrProp * | pAP2 | ) | const |
This method checks if [this] AP and the given AP are functionally equivalent. In contrast to is isExactMatch this function will return true if the attrs and props are same even if they are in different order; it is computationally much more involved than isExactMatch(). On that note, it may be worth looking into putting some more explicit collision guarantees into the checksum computation algorithm, such to take advantage of those checksums here. IOW, make it such to be trusted that if checksums match, APs are equivalent (but not necessarily exact matches).
TRUE | if equivalent to given AP (regardless of order), FALSE otherwise. |
References gchar, getAttribute(), getAttributeCount(), getNthAttribute(), getNthProperty(), getProperty(), getPropertyCount(), PT_PROPS_ATTRIBUTE_NAME, PT_REVISION_ATTRIBUTE_NAME, and UT_return_val_if_fail.
Referenced by PD_Document::areDocumentFormatsEqual(), PD_Document::areDocumentStylesheetsEqual(), pt_VarSet::mergeAP(), and pf_Frag::operator==().
bool PP_AttrProp::isEquivalent | ( | const PP_PropertyVector & | attrs, | |
const PP_PropertyVector & | props | |||
) | const |
This method does the same as PP_AttrProp::isEquivalent(const PP_AttrProp *) except that instead of being passed another AP to be compared to, it is passed sets of attributes and properties which only virtually comprise another AP.
TRUE | if equivalent (regardless of order) to given Attrs and Props, FALSE otherwise. |
References gchar, getAttribute(), getAttributeCount(), getProperty(), getPropertyCount(), PT_PROPS_ATTRIBUTE_NAME, and PT_REVISION_ATTRIBUTE_NAME.
bool PP_AttrProp::isExactMatch | ( | const PP_AttrProp & | pMatch | ) | const |
Checks to see if the given AP is identical to itself ([this]). It also contains some useful points of instrumentation for benchmarking table and usage characteristics.
References m_attributes, m_checkSum, and m_properties.
Referenced by pp_TableAttrProp::findMatch().
void PP_AttrProp::markReadOnly | ( | void | ) |
After the construction of a new AP, use this method to mark it read-only. It returns if the AP is already read-only; otherwise it marks [this] AP as read-only and then computes its checksum in order to speed subsequent equivalence testing. There is no return value.
References _computeCheckSum(), m_bIsReadOnly, and UT_return_if_fail.
Referenced by pt_PieceTable::_realInsertSpan(), PD_Style::addAttributes(), PD_Style::addProperties(), PD_Style::addProperty(), pt_PieceTable::appendLastStruxFmt(), pt_PieceTable::appendStruxFmt(), pt_PieceTable::changeLastStruxFmtNoUndo(), PD_DocumentRDFMutation::commit(), pp_TableAttrProp::createAP(), PD_Document::explodeRevisions(), pt_VarSet::mergeAP(), PD_DocumentRDF::setAP(), pt_VarSet::storeAP(), and TFTEST_MAIN().
void PP_AttrProp::miniDump | ( | const PD_Document * | pDoc | ) | const |
This is a debugging tool which serves to dump in readable form (as UT_DEBUGMSGs) the contents of [this] AP.
References gchar, PD_Document::getAttrProp(), getNthAttribute(), getNthProperty(), getRevisedIndex(), m_iRevisedIndex, miniDump(), UT_DEBUGMSG, and UT_UNUSED.
Referenced by FV_View::getAttrPropForPoint(), fp_Run::lookupProperties(), miniDump(), and FV_View::toggleCase().
PP_AttrProp & PP_AttrProp::operator= | ( | const PP_AttrProp & | Other | ) |
References gchar, getNthAttribute(), getNthProperty(), m_attributes, m_bIsReadOnly, m_properties, setAttribute(), setProperty(), szName, and UT_ASSERT.
void PP_AttrProp::prune | ( | ) |
This method clears both empty attributes and empty properties from [this] AP.
References _clearEmptyAttributes(), and _clearEmptyProperties().
Referenced by PP_Revision::_handleNestedRevAttr(), PD_DocumentRDFMutation::commit(), PD_Document::explodeRevisions(), PP_RevisionAttr::pruneForCumulativeResult(), and PD_DocumentRDF::setAP().
bool PP_AttrProp::setAttribute | ( | const gchar * | szName, | |
const gchar * | szValue | |||
) |
Sets given attribute in this PP_AttrProp bundle. Deals correctly with setting the PT_PROPS_ATTRIBUTE_NAME property: intercepts this call and appends properties instead.
Because all mutations of attributes go through here, it is always the case that the props attribute is correctly handled.
References ascii_strdown(), UT_UTF8String::decodeURL(), gchar, m_attributes, PT_PROPS_ATTRIBUTE_NAME, PT_XID_ATTRIBUTE_NAME, setProperty(), UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_ensureValidXML(), UT_return_val_if_fail, and UT_UTF8String::utf8_str().
Referenced by PP_Revision::_handleNestedRevAttr(), pt_PieceTable::_realDeleteSpan(), PD_Document::addAuthorAttributeIfBlank(), explodeStyle(), operator=(), PP_Revision::PP_Revision(), PP_RevisionAttr::pruneForCumulativeResult(), OXML_ObjectWithAttrProp::setAttribute(), and setAttributes().
bool PP_AttrProp::setAttributes | ( | const PP_PropertyVector & | attributes | ) |
Sets attributes as given in the PP_PropertyVector, read as (attribute, value) pairs.
attributes | A PP_PropertyVector, read in (attribute, value) form. |
References setAttribute().
Referenced by ABI_Collab_Import::_import(), PD_Document::changeDocPropeties(), PD_DocumentRDFMutation::commit(), pt_PieceTable::createAndSendDocPropCR(), pp_TableAttrProp::createAP(), PD_Document::explodeRevisions(), OXML_ObjectWithAttrProp::setAttributes(), IE_Imp_AbiWord_1::startElement(), pt_VarSet::storeAP(), and TFTEST_MAIN().
void PP_AttrProp::setIndex | ( | UT_uint32 | i | ) |
References m_index.
Referenced by pp_TableAttrProp::addAP(), and pp_TableAttrProp::createAP().
bool PP_AttrProp::setProperties | ( | const PP_PropertyVector & | properties | ) |
Sets properties as given in the PP_PropertyVector, read as (property, value) pairs.
pVector | A PP_PropertyVector, read in (properties, value) form. |
References setProperty().
Referenced by PP_Revision::_handleNestedRevAttr(), ABI_Collab_Import::_import(), PP_RevisionAttr::addRevision(), PD_Document::changeDocPropeties(), PD_DocumentRDFMutation::commit(), pt_PieceTable::createAndSendDocPropCR(), pp_TableAttrProp::createAP(), PD_Document::explodeRevisions(), PD_DocumentRDFMutation::handleCollabEvent(), PP_Revision::PP_Revision(), PP_RevisionAttr::pruneForCumulativeResult(), OXML_ObjectWithAttrProp::setProperties(), and TFTEST_MAIN().
bool PP_AttrProp::setProperty | ( | const std::string & | name, | |
const std::string & | value | |||
) |
This method inserts a new pair of property name and value into [this] APs set of properties, creating "props" if it does not already exist and overwriting the value of any property of the same name with the newly passed value. (?)It appears as though we replace the entire pair, rather than only the value. (?)Is there a reason for this?
References m_bIsReadOnly, m_properties, UT_ensureValidXML(), and UT_return_val_if_fail.
Referenced by FV_View::_charInsert(), AccountHandler::_handlePacket(), PD_DocumentRDFMutation::apAdd(), PD_DocumentRDFMutation::apRemove(), PD_Document::changeDocPropeties(), explodeStyle(), PD_DocumentRDFMutation::handleAddAndRemove(), PD_Document::insertSpan(), operator=(), PP_Revision::PP_Revision(), FV_View::resetCharFormat(), setAttribute(), setProperties(), OXML_ObjectWithAttrProp::setProperty(), AbiCollabSessionManager::startSession(), RDFModel_XMLIDLimited::update(), and RDFModel_SPARQLLimited::update().
void PP_AttrProp::setRevisedIndex | ( | PT_AttrPropIndex | i, | |
UT_uint32 | iId, | |||
bool | bShow, | |||
bool | bMark, | |||
bool | bHidden | |||
) | const [inline] |
References PP_RevisionState::m_iId.
Referenced by PD_Document::explodeRevisions().
attributes_t PP_AttrProp::m_attributes [protected] |
bool PP_AttrProp::m_bIsReadOnly [protected] |
Referenced by _clearEmptyAttributes(), _clearEmptyProperties(), markReadOnly(), operator=(), and setProperty().
bool PP_AttrProp::m_bRevisionHidden [mutable, protected] |
UT_uint32 PP_AttrProp::m_checkSum [protected] |
Referenced by _computeCheckSum(), getCheckSum(), and isExactMatch().
UT_uint32 PP_AttrProp::m_index [protected] |
Referenced by getIndex(), and setIndex().
PT_AttrPropIndex PP_AttrProp::m_iRevisedIndex [mutable, protected] |
Referenced by miniDump().
properties_t PP_AttrProp::m_properties [protected] |
PP_RevisionState PP_AttrProp::m_RevisionState [mutable, protected] |