Ejemplo n.º 1
0
logical sNotiz :: DBStored ( )
{
  PropertyHandle   *ph      = GetPropertyHandle();
  logical           del_opt = UNDEF;
BEGINSEQ
  if ( !ph->IsServer() )                            LEAVESEQ
  if ( !UserState1() )                              LEAVESEQ
  SetUserState1(NO);
  
  del_opt = ph->GPH("wiedervorlage")->IsEmpty();
  
  PropertyHandle   notizen_wv(ph->GetDBHandle(),"NotizWiedervorlage",PI_Write);
                                                    SDBCERR
  if ( notizen_wv.Get(ph->ExtractKey()) )
  {
    if ( !del_opt )                                 LEAVESEQ
    notizen_wv.Delete();
  }
  else
  {
    if ( del_opt )                                  LEAVESEQ
    notizen_wv.AddReference(*ph);
  }
RECOVER

ENDSEQ
  return(NO);
}
Ejemplo n.º 2
0
void ODragObject :: setData (ODS *pODS, QString qsText )
{
  QString                          dbpath,dictpath,s,xmlinstance;
  PropertyHandle                   *ph = NULL;
  int                               inst_id= 0;
  DatabaseHandle                   *dbh   = NULL;
  inst_id= pODS->InstGetObjID();
  ph = pODS->Handle();
  if(ph){
    ph->ExtractKey();
    dbh     = &ph->GetDBHandle();
    dbpath = SZ2QS(dbh->GetPath());
    dictpath = SZ2QS(dbh->GetDictionary().GetPath());
    pEncodedPropertyHandle = new PropertyHandle();
    pEncodedPropertyHandle->OpenHierarchy(ph); 
    pEncodedPropertyHandle->ExtractKey();
    ph->ExtractKey();
  }else{
    dbpath = SZ2QS("undefined");
    dbpath = SZ2QS("undefined");
    dbh    = NULL;
  }
  xmlinstance   = SZ2QS("<instance id=\"%i\" propertyhandle=\"%p\" applicationhandle=\"%p\" databasehandle=\"%p\" odragobject=\"%p\" databasepath=\"%s\" dictionarypath=\"%s\">\n%s\n</instance>");
  s.sprintf(QS2SZ(xmlinstance),inst_id,pEncodedPropertyHandle,QCoreApplication::instance(),dbh,this,QS2SZ(dbpath),QS2SZ(dictpath),QS2SZ(qsText));
  enc_xmlpropertyhandle.resize( s.length() );
  memcpy( enc_xmlpropertyhandle.data(), s.toLatin1(), s.length() );

  xmlinstance   = SZ2QS("%i\n%p\n%p\n%p\n%p\n%s\n%s");
  s.sprintf(QS2SZ(xmlinstance),inst_id,pEncodedPropertyHandle,QCoreApplication::instance(),dbh,this,QS2SZ(dbpath),QS2SZ(dictpath));
  enc_propertyhandle.resize( s.length() );
  memcpy( enc_propertyhandle.data(), s.toLatin1(), s.length() );



}