Defines | Typedefs | Functions | Variables

pp_Revision.cpp File Reference

#include "pp_Revision.h"
#include "pp_AttrProp.h"
#include "pd_Style.h"
#include "pd_Document.h"
#include "ut_debugmsg.h"
#include "ut_misc.h"
#include "ut_std_map.h"
#include <sstream>

Defines

#define DEBUG_MERGEALL   false

Typedefs

typedef std::map< std::pair
< UT_uint32, PP_RevisionType >
, const PP_Revision * > 
revidx_t

Functions

static revidx_t toIndex (const PP_RevisionAttr &ra)
static std::string mergeAPStrings (const std::string &a, const std::string &b)
const char * UT_getAttribute (const PP_AttrProp *pAP, const char *name, const char *def)
std::string UT_getLatestAttribute (const PP_AttrProp *pAP, const char *name, const char *def)
 Like UT_getAttribute(name,atts,def) but check for a revision attribute and if found first look for the most recent value of atts in the revision.

Variables

static const PP_Revision s_del (0, PP_REVISION_DELETION,(gchar *) 0,(gchar *) 0)
static const PP_Revision s_add (0, PP_REVISION_ADDITION,(gchar *) 0,(gchar *) 0)

Define Documentation

#define DEBUG_MERGEALL   false

Typedef Documentation

typedef std::map< std::pair< UT_uint32, PP_RevisionType >, const PP_Revision* > revidx_t

Function Documentation

static std::string mergeAPStrings ( const std::string &  a,
const std::string &  b 
) [static]
static revidx_t toIndex ( const PP_RevisionAttr ra  )  [static]
const char* UT_getAttribute ( const PP_AttrProp pAP,
const char *  name,
const char *  def 
)
std::string UT_getLatestAttribute ( const PP_AttrProp pAP,
const char *  name,
const char *  def 
)

Like UT_getAttribute(name,atts,def) but check for a revision attribute and if found first look for the most recent value of atts in the revision.

References PP_AttrProp::getAttribute(), PP_RevisionAttr::getNthRevision(), PP_RevisionAttr::getRevisionsCount(), and UT_getAttribute().


Variable Documentation

const PP_Revision s_add(0, PP_REVISION_ADDITION,(gchar *) 0,(gchar *) 0) [static]
const PP_Revision s_del(0, PP_REVISION_DELETION,(gchar *) 0,(gchar *) 0) [static]

return highest revision associated with this revision attribute that has ID at most equal to id; the returned PP_Revision can be used to determine whether this text should be displayed or hidden in revision with the original id

Parameters:
UT_uint32 id : the id of this revision
PP_Revision ** ppR: location where to store pointer to one of the special revisions in case return value is NULL
Returns:
: pointer to PP_Revision, or NULL if the revision attribute should be ignored for the present level

Referenced by PP_RevisionAttr::getGreatestLesserOrEqualRevision().