summaryrefslogtreecommitdiffstats
path: root/hwpfilter/source/formula.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2012-07-24 11:36:17 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-24 11:37:41 +0200
commit5a243f140975167aa5c42c95b30edb1cdb1ea639 (patch)
treed0f3d0512c06692c7e818cf20288e2514e4c736b /hwpfilter/source/formula.cxx
parentmhu24: add comphelper::newArray_{null,ex} helpers (diff)
downloadcore-5a243f140975167aa5c42c95b30edb1cdb1ea639.tar.gz
core-5a243f140975167aa5c42c95b30edb1cdb1ea639.zip
hwpfilter: improve text import and error handling
Change-Id: Ib74b96200c9d57f55fc0d32b638601c64e7eb6fe
Diffstat (limited to 'hwpfilter/source/formula.cxx')
-rw-r--r--hwpfilter/source/formula.cxx25
1 files changed, 14 insertions, 11 deletions
diff --git a/hwpfilter/source/formula.cxx b/hwpfilter/source/formula.cxx
index 0e6b36dc5a76..03e6be282134 100644
--- a/hwpfilter/source/formula.cxx
+++ b/hwpfilter/source/formula.cxx
@@ -32,7 +32,6 @@ extern std::list<Node*> nodelist;
#include "hcode.h"
-static hchar entity[32];
#define ascii(x) OUString::createFromAscii(x)
#define rstartEl(x,y) do { if (m_rxDocumentHandler.is()) m_rxDocumentHandler->startElement(x,y); } while(0)
#define rendEl(x) do { if (m_rxDocumentHandler.is()) m_rxDocumentHandler->endElement(x); } while(0)
@@ -41,7 +40,6 @@ static hchar entity[32];
#define reucstr(x,y) do { if (m_rxDocumentHandler.is()) m_rxDocumentHandler->characters(OUString(x,y, RTL_TEXTENCODING_EUC_KR)); } while(0)
#define padd(x,y,z) pList->addAttribute(x,y,z)
#else
-static char entity[32];
static int indent = 0;
#define inds indent++; for(int i = 0 ; i < indent ; i++) fprintf(stderr," ")
#define inde for(int i = 0 ; i < indent ; i++) fprintf(stderr," "); indent--
@@ -222,11 +220,12 @@ void Formula::makeIdentifier(Node *res)
case ID_IDENTIFIER :
#ifdef DEBUG
inds;
- fprintf(stderr,"<math:mi>%s</math:mi>\n",getMathMLEntity(tmp->value, entity));
+ fprintf(stderr,"<math:mi>%s</math:mi>\n",
+ getMathMLEntity(tmp->value).c_str());
indo;
#else
rstartEl(ascii("math:mi"), rList);
- runistr(getMathMLEntity(tmp->value, entity));
+ runistr(getMathMLEntity(tmp->value).c_str());
rendEl(ascii("math:mi"));
#endif
break;
@@ -248,7 +247,7 @@ void Formula::makeIdentifier(Node *res)
inds; fprintf(stderr,"<math:mo>%s</math:mo>\n",tmp->value); indo;
#else
rstartEl(ascii("math:mo"), rList);
- runistr(getMathMLEntity(tmp->value,entity));
+ runistr(getMathMLEntity(tmp->value).c_str());
rendEl(ascii("math:mo"));
#endif
break;
@@ -404,11 +403,12 @@ void Formula::makeDecoration(Node *res)
#ifdef DEBUG
inds;
- fprintf(stderr,"<math:mo>%s</math:mo>\n", getMathMLEntity(tmp->value,entity));
+ fprintf(stderr,"<math:mo>%s</math:mo>\n",
+ getMathMLEntity(tmp->value).c_str());
indo;
#else
rstartEl(ascii("math:mo"), rList);
- runistr(getMathMLEntity(tmp->value,entity));
+ runistr(getMathMLEntity(tmp->value).c_str());
rendEl(ascii("math:mo"));
#endif
@@ -529,11 +529,14 @@ void Formula::makeFence(Node *res)
Node *tmp = res->child;
#ifdef DEBUG
inds;
- fprintf(stderr,"<math:mfenced open=\"%s\" close=\"%s\">\n",getMathMLEntity(tmp->value, entity),
- getMathMLEntity(tmp->next->next->value,entity));
+ fprintf(stderr,"<math:mfenced open=\"%s\" close=\"%s\">\n",
+ getMathMLEntity(tmp->value).c_str(),
+ getMathMLEntity(tmp->next->next->value).c_str());
#else
- padd(ascii("open"), ascii("CDATA"), OUString(getMathMLEntity(tmp->value,entity)) );
- padd(ascii("close"), ascii("CDATA"), OUString(getMathMLEntity(tmp->next->next->value,entity)) );
+ padd(ascii("open"), ascii("CDATA"),
+ OUString(getMathMLEntity(tmp->value).c_str()) );
+ padd(ascii("close"), ascii("CDATA"),
+ OUString(getMathMLEntity(tmp->next->next->value).c_str()) );
rstartEl(ascii("math:mfenced"), rList);
pList->clear();
#endif