Skip to content

Commit 6594db2

Browse files
committed
Cosmetic change for HTML DOM
1 parent 6c8acda commit 6594db2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

crengine/src/docxfmt.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,7 @@ bool ImportDocXDocument( LVStreamRef stream, ldomDocument * doc, LVDocViewCallba
23012301
ldomDocumentWriter writer(doc);
23022302
docXMLreader docReader(&writer);
23032303

2304+
#ifdef DOCX_FB2_DOM_STRUCTURE
23042305
writer.OnStart(NULL);
23052306
writer.OnTagOpen(NULL, L"?xml");
23062307
writer.OnAttribute(NULL, L"version", L"1.0");
@@ -2316,6 +2317,16 @@ bool ImportDocXDocument( LVStreamRef stream, ldomDocument * doc, LVDocViewCallba
23162317
writer.OnTagClose(NULL, L"book-title");
23172318
writer.OnTagClose(NULL, L"title-info");
23182319
writer.OnTagClose(NULL, L"description");
2320+
#else
2321+
writer.OnStart(NULL);
2322+
writer.OnTagOpen(NULL, L"?xml");
2323+
writer.OnAttribute(NULL, L"version", L"1.0");
2324+
writer.OnAttribute(NULL, L"encoding", L"utf-8");
2325+
writer.OnEncoding(L"utf-8", NULL);
2326+
writer.OnTagBody();
2327+
writer.OnTagClose(NULL, L"?xml");
2328+
writer.OnTagOpenNoAttr(NULL, L"html");
2329+
#endif
23192330

23202331
#ifdef DOCX_FB2_DOM_STRUCTURE
23212332
//Two options when dealing with titles: (FB2|HTML)
@@ -2337,7 +2348,11 @@ bool ImportDocXDocument( LVStreamRef stream, ldomDocument * doc, LVDocViewCallba
23372348
if(importContext.m_endNoteCount > 0) {
23382349
parseFootnotes(writer, importContext, docx_el_endnotes);
23392350
}
2351+
#ifdef DOCX_FB2_DOM_STRUCTURE
23402352
writer.OnTagClose(NULL, L"FictionBook");
2353+
#else
2354+
writer.OnTagClose(NULL, L"html");
2355+
#endif
23412356
writer.OnStop();
23422357

23432358
if ( progressCallback ) {

0 commit comments

Comments
 (0)