pdf/plugin_impl/marker_entry_impl.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "marker_entry_impl.h"
00028 #include "log.h"
00029
00030 namespace pdf
00031 {
00032
00033 MarkerEntry* marker_entry_new(unsigned int uds_private_size)
00034 {
00035 unsigned int marker_entry_size = sizeof(MarkerEntry) + uds_private_size;
00036 char* p = new char[marker_entry_size];
00037 memset(p, 0, marker_entry_size);
00038
00039 MarkerEntry* marker_entry = reinterpret_cast<MarkerEntry *>(p);
00040 marker_entry->type = MARKER_UDS_PRIVATE;
00041 return marker_entry;
00042 }
00043
00044 void marker_entry_free_recursive(MarkerEntry* self)
00045 {
00046 if (self->first_child)
00047 {
00048 marker_entry_free_recursive(self->first_child);
00049 self->first_child = 0;
00050 }
00051
00052 if (self->sibling)
00053 {
00054 marker_entry_free_recursive(self->sibling);
00055 self->sibling = 0;
00056 }
00057
00058 if (self->anchor)
00059 {
00060 StringImpl* p = static_cast<StringImpl *>(self->anchor);
00061 delete p;
00062 self->anchor = 0;
00063 }
00064
00065 if (self->text)
00066 {
00067 StringImpl* p = static_cast<StringImpl *>(self->text);
00068 delete p;
00069 self->text = 0;
00070 }
00071 }
00072
00073 }