3737 <viewdata key="" value=""/>
3838 ...
3939 </bookmark>
40+ <bookmark ... >
41+ <viewdata key="" value=""/>
42+ <viewdata key="" value=""/>
43+ <viewdata key="" value=""/>
44+ <viewdata key="" value=""/>
45+ ...
46+ </bookmark>
4047 </file>
4148 <lastfile filename=""/>
4249</bookmarks>
@@ -66,7 +73,6 @@ static void clearXML() {
6673 #else
6774 snprintf (xmlfilename, 1024 , BOOKMARK_XML_BASE, FZScreen::basePath ().c_str (), BOOKMARK_XML);
6875 #endif
69-
7076
7177 doc->SaveFile (xmlfilename);
7278}
@@ -92,6 +98,7 @@ static void loadXML() {
9298
9399 if (doc->Error ()) {
94100 // probably file not found, create an empty one
101+ printf (" doc Error\n " );
95102 clearXML ();
96103 }
97104
@@ -128,14 +135,27 @@ static void saveXML() {
128135
129136static XMLNode* fileNode (string& filename) {
130137 #ifdef DEBUG
131- printf (" fileNode\n " );
138+ printf (" fileNode(%s) \n " , filename. c_str () );
132139 #endif
133140
141+ #ifdef DEBUG
142+ printf (" fileNode - pre load xml\n " );
143+ #endif
134144 if (doc == 0 )
135145 loadXML ();
146+
147+ #ifdef DEBUG
148+ printf (" fileNode - post load xml\n " );
149+ #endif
136150 XMLElement* file = root->FirstChildElement (" file" );
151+ #ifdef DEBUG
152+ printf (" fileNode - file ass. xml\n " );
153+ #endif
137154 while (file) {
138155 const char * name = file->Attribute (" filename" );
156+ #ifdef DEBUG
157+ printf (" fileNode - %s\n " , name);
158+ #endif
139159 if (name != 0 ) {
140160 if (strncmp (filename.c_str (), name, 1024 ) == 0 )
141161 return file;
@@ -258,6 +278,9 @@ static void addBookmarkProto(string& filename, BKBookmark& b, XMLNode* file) {
258278 // bookmark->SetAttribute("zoomvalue", b.zoom);
259279 // bookmark.SetAttribute("thumbnail", );
260280 map<string, int >::iterator it (b.viewData .begin ());
281+ #ifdef DEBUG
282+ printf (" addBookmarkProto: title: %s page: %i\n " , b.title .c_str (), b.page );
283+ #endif
261284 while (it != b.viewData .end ()) {
262285 XMLElement *vd = doc->NewElement (" viewdata" );
263286 vd->SetAttribute (" key" , (*it).first .c_str ());
0 commit comments