本文整理汇总了C++中PP_AttrProp::setAttributes方法的典型用法代码示例。如果您正苦于以下问题:C++ PP_AttrProp::setAttributes方法的具体用法?C++ PP_AttrProp::setAttributes怎么用?C++ PP_AttrProp::setAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PP_AttrProp
的用法示例。
在下文中一共展示了PP_AttrProp::setAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*! Create a new AttrProp with exactly the attributes/properties given.
\return NULL on failure, the newly-created PP_AttrProp.
*/
PP_AttrProp * PP_AttrProp::createExactly(const gchar ** attributes,
const gchar ** properties) const
{
// first, create a new AttrProp using just the values given.
PP_AttrProp * papNew = new PP_AttrProp();
if (!papNew)
goto Failed;
if (!papNew->setAttributes(attributes) || !papNew->setProperties(properties))
goto Failed;
return papNew;
Failed:
DELETEP(papNew);
return NULL;
}
示例2: createAP
bool pp_TableAttrProp::createAP(const UT_GenericVector<const gchar*> * pVector,
UT_sint32 * pSubscript)
{
UT_sint32 subscript;
if (!createAP(&subscript))
return false;
PP_AttrProp * pAP = m_vecTable.getNthItem(subscript);
UT_return_val_if_fail (pAP, false);
if (!pAP->setAttributes(pVector))
return false;
pAP->markReadOnly();
m_vecTableSorted.addItemSorted(pAP,compareAP);
*pSubscript = subscript;
return true;
}
示例3: _import
//.........这里部分代码省略.........
{
const ChangeRecordSessionPacket* crp = static_cast<const ChangeRecordSessionPacket*>(&packet);
UT_DEBUGMSG(("It's safe to import this packet\n"));
UT_DEBUGMSG(("For CR number %d requested point %d adjustment %d \n", crp->getRev(), crp->getPos(), iImportAdjustment));
PT_DocPosition pos = static_cast<PT_DocPosition>(crp->getPos() + iImportAdjustment);
UT_ASSERT(pos <= getEndOfDoc());
if (!inGlob)
{
// store the last seen revision from this collaborator (it is immediately used by the export)
// NOTE: if this changerecord is part of a glob, then we don't do this; we'll have
// already set the revision of the glob itself as the last seen one
m_remoteRevs[pCollaborator] = crp->getRev();
}
// todo: remove these temp vars
PT_DocPosition iPos2 = 0;
// process the packet
switch(crp->getPXType())
{
case PX_ChangeRecord::PXT_GlobMarker:
{
UT_DEBUGMSG(("Found GLOB marker (ignoring)\n"));
return true;
}
case PX_ChangeRecord::PXT_InsertSpan:
{
const InsertSpan_ChangeRecordSessionPacket* icrsp = static_cast<const InsertSpan_ChangeRecordSessionPacket*>( crp );
UT_UCS4String UCSChars = const_cast<UT_UTF8String&>(icrsp->m_sText).ucs4_str(); // ugly, ucs4_str should be const func!
PP_AttrProp attrProp;
attrProp.setAttributes(const_cast<const gchar**>(icrsp->getAtts()));
attrProp.setProperties(const_cast<const gchar**>(icrsp->getProps()));
m_pDoc->insertSpan(pos,UCSChars.ucs4_str(),UCSChars.length(), &attrProp);
break;
}
case PX_ChangeRecord::PXT_DeleteSpan:
{
iPos2 = pos + crp->getLength();
PP_AttrProp *p_AttrProp_Before = NULL;
UT_uint32 icnt = 0;
m_pDoc->deleteSpan(pos,iPos2,p_AttrProp_Before,icnt,true);
break;
}
case PX_ChangeRecord::PXT_ChangeSpan:
{
const Props_ChangeRecordSessionPacket* pcrsp = static_cast<const Props_ChangeRecordSessionPacket*>( crp );
gchar** szAtts = pcrsp->getAtts();
gchar** szProps = pcrsp->getProps();
iPos2 = pos + pcrsp->getLength();
if((szProps == NULL) && (szAtts == NULL))
{
//
// This happens if we remove all formats
// we have to handle this seperately
//
// Get style of containing block
//
pf_Frag_Strux* sdh = NULL;
m_pDoc->getStruxOfTypeFromPosition(pos,PTX_Block,&sdh);
if(!sdh)
{
UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
return false;