@@ -2842,10 +2842,6 @@ void TextPage::addWord(TextRawWord *word) {
2842
2842
2843
2843
void TextPage::addAttributTypeReadingOrder (xmlNodePtr node, char *tmp,
2844
2844
IWord *word) {
2845
- if (parameters->getCharReadingOrderAttr () == gFalse ) {
2846
- return ;
2847
- }
2848
-
2849
2845
int nbLeft = 0 ;
2850
2846
int nbRight = 0 ;
2851
2847
@@ -4935,15 +4931,12 @@ void TextPage::dumpInReadingOrder(GBool useBlocks, GBool fullFontName) {
4935
4931
snprintf (tmp, sizeof (tmp), ATTR_NUMFORMAT, listeImages[i]->getHeightImage ());
4936
4932
xmlNewProp (node, (const xmlChar *) ATTR_HEIGHT, (const xmlChar *) tmp);
4937
4933
4938
- std::string rotation = std::to_string (listeImages[i]->getRotation ());
4939
- xmlNewProp (node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)rotation.c_str ());
4940
- // if (listeImages[i]->getRotation() > 0){
4941
- // xmlNewProp(node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sTRUE);
4942
- // }
4943
- // else{
4944
- // xmlNewProp(node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sFALSE);
4945
- // }
4946
-
4934
+ if (listeImages[i]->getRotation () > 0 ){
4935
+ xmlNewProp (node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sTRUE );
4936
+ }
4937
+ else {
4938
+ xmlNewProp (node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sFALSE );
4939
+ }
4947
4940
// if (listeImages[i]->isImageInline()) {
4948
4941
// xmlNewProp(node, (const xmlChar *) ATTR_INLINE, (const xmlChar *) sTRUE);
4949
4942
// }
@@ -5792,15 +5785,12 @@ void TextPage::dump(GBool useBlocks, GBool fullFontName) {
5792
5785
snprintf (tmp, sizeof (tmp), ATTR_NUMFORMAT, listeImages[i]->getHeightImage ());
5793
5786
xmlNewProp (node, (const xmlChar *) ATTR_HEIGHT, (const xmlChar *) tmp);
5794
5787
5795
- std::string rotation = std::to_string (listeImages[i]->getRotation ());
5796
- xmlNewProp (node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)rotation.c_str ());
5797
- // if (listeImages[i]->getRotation() > 0){
5798
- // xmlNewProp(node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sTRUE);
5799
- // }
5800
- // else{
5801
- // xmlNewProp(node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sFALSE);
5802
- // }
5803
-
5788
+ if (listeImages[i]->getRotation () > 0 ){
5789
+ xmlNewProp (node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sTRUE );
5790
+ }
5791
+ else {
5792
+ xmlNewProp (node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)sFALSE );
5793
+ }
5804
5794
// if (listeImages[i]->isImageInline()) {
5805
5795
// xmlNewProp(node, (const xmlChar *) ATTR_INLINE, (const xmlChar *) sTRUE);
5806
5796
// }
@@ -5847,14 +5837,11 @@ void TextPage::dump(GBool useBlocks, GBool fullFontName) {
5847
5837
snprintf (tmp, sizeof (tmp), ATTR_NUMFORMAT, svg_ymax - svg_ymin);
5848
5838
xmlNewProp (node, (const xmlChar *) ATTR_HEIGHT, (const xmlChar *) tmp);
5849
5839
5850
- std::string rotation = std::to_string (r);
5851
- xmlNewProp (node,(const xmlChar*)ATTR_ROTATION,(const xmlChar*)rotation.c_str ());
5852
- // if (r > 0) {
5853
- // xmlNewProp(node, (const xmlChar *) ATTR_ROTATION, (const xmlChar *) sTRUE);
5854
- // } else {
5855
- // xmlNewProp(node, (const xmlChar *) ATTR_ROTATION, (const xmlChar *) sFALSE);
5856
- // }
5857
-
5840
+ if (r > 0 ) {
5841
+ xmlNewProp (node, (const xmlChar *) ATTR_ROTATION, (const xmlChar *) sTRUE );
5842
+ } else {
5843
+ xmlNewProp (node, (const xmlChar *) ATTR_ROTATION, (const xmlChar *) sFALSE );
5844
+ }
5858
5845
// if (listeImages[i]->isImageInline()) {
5859
5846
// xmlNewProp(node, (const xmlChar *) ATTR_INLINE, (const xmlChar *) sTRUE);
5860
5847
// }
@@ -7309,10 +7296,8 @@ XmlAltoOutputDev::XmlAltoOutputDev(GString *fileName, GString *fileNamePdf,
7309
7296
xmlAddChild (nodeOCRProcessingStep, nodeProcessingDate);
7310
7297
time_t t;
7311
7298
time (&t);
7312
- char tstamp[sizeof " YYYY-MM-DDTHH:MM:SSZ" ];
7313
- strftime (tstamp, sizeof tstamp, " %FT%TZ" , gmtime (&t));
7314
7299
xmlNodeSetContent (nodeProcessingDate, (const xmlChar *) xmlEncodeEntitiesReentrant (
7315
- nodeProcessingDate->doc , (const xmlChar *) tstamp ));
7300
+ nodeProcessingDate->doc , (const xmlChar *) ctime (&t) ));
7316
7301
7317
7302
xmlNodePtr nodeProcessingSoftware = xmlNewNode (NULL , (const xmlChar *) TAG_PROCESSINGSOFTWARE);
7318
7303
nodeProcessingSoftware->type = XML_ELEMENT_NODE;
@@ -7527,7 +7512,7 @@ void XmlAltoOutputDev::addStyles() {
7527
7512
xmlNewProp (textStyleNode, (const xmlChar *) ATTR_FONTWIDTH, (const xmlChar *) tmp);
7528
7513
7529
7514
sprintf (tmp, " %s" , fontStyleInfo->getFontColor ()->getCString ());
7530
- xmlNewProp (textStyleNode, (const xmlChar *) ATTR_FONTCOLOR, (const xmlChar *) ( tmp+ 1 ) );
7515
+ xmlNewProp (textStyleNode, (const xmlChar *) ATTR_FONTCOLOR, (const xmlChar *) tmp);
7531
7516
7532
7517
delete fontStyleInfo->getFontColor ();
7533
7518
@@ -7556,8 +7541,7 @@ void XmlAltoOutputDev::addStyles() {
7556
7541
}
7557
7542
7558
7543
sprintf (tmp, " %s" , fontStyle->getCString ());
7559
- if ( strcmp (tmp, " " ) )
7560
- xmlNewProp (textStyleNode, (const xmlChar *) ATTR_FONTSTYLE, (const xmlChar *) tmp);
7544
+ xmlNewProp (textStyleNode, (const xmlChar *) ATTR_FONTSTYLE, (const xmlChar *) tmp);
7561
7545
7562
7546
delete fontStyle;
7563
7547
0 commit comments