daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Aug 12th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool    PP_AttrProp::getNthProperty(int ndx, const gchar *& szName, const gchar *& szValue) const
  2. {
  3.     if (!m_pProperties)
  4.         return false;
  5.  
  6.     if (static_cast<UT_uint32>(ndx) >= m_pProperties->size())
  7.     {
  8.         // UT_ASSERT_HARMLESS( UT_SHOULD_NOT_HAPPEN ); -- do not assert, some code in
  9.         // while loops relies on this
  10.         return false;
  11.     }
  12.    
  13.     int i = 0;
  14.     UT_GenericStringMap<PropertyPair*>::UT_Cursor c(m_pProperties);
  15.     const PropertyPair * val = NULL;
  16.  
  17.     for (val = c.first(); (c.is_valid() && (i < ndx)); val = c.next(), i++)
  18.     {
  19.       // noop
  20.     }
  21.  
  22.     if ( (i == ndx) && c.is_valid())
  23.         {
  24.           szName = c.key().c_str();
  25.           szValue = val->first;
  26.           return true;
  27.         }
  28.     return false;
  29. }
RAW Paste Data
Top