hwpfilter/qa/cppunit/test_hwpfilter.cxx | 4 hwpfilter/source/formula.cxx | 122 - hwpfilter/source/hwpreader.cxx | 2116 ++++++++++++++++---------------- 3 files changed, 1121 insertions(+), 1121 deletions(-)
New commits: commit 11c66ea0f49417a30aae1ff250f7f18ec797753e Author: Noel Grandin <[email protected]> AuthorDate: Thu May 9 11:28:01 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu May 9 13:29:23 2024 +0200 loplugin:ostr in hwpfilter Change-Id: If99a50251332e89e09ad97bb74178c4651cde44e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167377 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/hwpfilter/qa/cppunit/test_hwpfilter.cxx b/hwpfilter/qa/cppunit/test_hwpfilter.cxx index 2bb942aba5a0..632db0c910b9 100644 --- a/hwpfilter/qa/cppunit/test_hwpfilter.cxx +++ b/hwpfilter/qa/cppunit/test_hwpfilter.cxx @@ -41,10 +41,10 @@ namespace const OUString &rURL, const OUString &, SfxFilterFlags, SotClipboardFormatId, unsigned int) { - uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance("com.sun.comp.hwpimport.HwpImportFilter"), + uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance(u"com.sun.comp.hwpimport.HwpImportFilter"_ustr), uno::UNO_QUERY_THROW); - return xFilter->filter({ comphelper::makePropertyValue("URL", rURL) }); + return xFilter->filter({ comphelper::makePropertyValue(u"URL"_ustr, rURL) }); } void HwpFilterTest::test() diff --git a/hwpfilter/source/formula.cxx b/hwpfilter/source/formula.cxx index 84982dcd9aae..f6fd509d9a67 100644 --- a/hwpfilter/source/formula.cxx +++ b/hwpfilter/source/formula.cxx @@ -50,10 +50,10 @@ void Formula::makeMathML(Node *res) inds; fprintf(stderr,"<math:math xmlns:math=\"http://www.w3.org/1998/Math/MathML\"> "); #else - padd("xmlns:math", "CDATA", "http://www.w3.org/1998/Math/MathML"); - rstartEl("math:math", mxList); + padd(u"xmlns:math"_ustr, u"CDATA"_ustr, u"http://www.w3.org/1998/Math/MathML"_ustr); + rstartEl(u"math:math"_ustr, mxList); mxList->clear(); - rstartEl("math:semantics", mxList); + rstartEl(u"math:semantics"_ustr, mxList); #endif if( tmp->child ) makeLines( tmp->child ); @@ -65,8 +65,8 @@ void Formula::makeMathML(Node *res) inde; fprintf(stderr,"</math:math> "); #else - rendEl("math:semantics"); - rendEl("math:math"); + rendEl(u"math:semantics"_ustr); + rendEl(u"math:math"_ustr); #endif } @@ -91,14 +91,14 @@ void Formula::makeLine(Node *res) #if OSL_DEBUG_LEVEL >= 2 inds; fprintf(stderr,"<math:mrow> "); #else - rstartEl("math:mrow", mxList); + rstartEl(u"math:mrow"_ustr, mxList); #endif if( res->child ) makeExprList( res->child ); #if OSL_DEBUG_LEVEL >= 2 inde; fprintf(stderr,"</math:mrow> "); #else - rendEl("math:mrow"); + rendEl(u"math:mrow"_ustr); #endif } @@ -130,7 +130,7 @@ void Formula::makeExpr(Node *res) inds; fprintf(stderr,"<math:mrow> "); #else - rstartEl("math:mrow", mxList); + rstartEl(u"math:mrow"_ustr, mxList); #endif } @@ -140,7 +140,7 @@ void Formula::makeExpr(Node *res) #if OSL_DEBUG_LEVEL >= 2 inde; fprintf(stderr,"</math:mrow> "); #else - rendEl("math:mrow"); + rendEl(u"math:mrow"_ustr); #endif } break; @@ -193,18 +193,18 @@ void Formula::makeIdentifier(Node *res) fprintf(stderr,"<math:mi>%s</math:mi> ",tmp->value.get()); indo; #else - rstartEl("math:mi", mxList); + rstartEl(u"math:mi"_ustr, mxList); rchars(OUString::createFromAscii(tmp->value.get())); - rendEl("math:mi"); + rendEl(u"math:mi"_ustr); #endif break; case ID_STRING : { #if OSL_DEBUG_LEVEL >= 2 #else - rstartEl("math:mi", mxList); + rstartEl(u"math:mi"_ustr, mxList); reucstr(tmp->value.get(), strlen(tmp->value.get())); - rendEl("math:mi"); + rendEl(u"math:mi"_ustr); #endif } break; @@ -215,9 +215,9 @@ void Formula::makeIdentifier(Node *res) getMathMLEntity(tmp->value.get()).c_str()); indo; #else - rstartEl("math:mi", mxList); + rstartEl(u"math:mi"_ustr, mxList); runistr(fromHcharStringToOUString(getMathMLEntity(tmp->value.get()))); - rendEl("math:mi"); + rendEl(u"math:mi"_ustr); #endif break; case ID_NUMBER : @@ -226,9 +226,9 @@ void Formula::makeIdentifier(Node *res) fprintf(stderr,"<math:mn>%s</math:mn> ",tmp->value.get()); indo; #else - rstartEl("math:mn", mxList); + rstartEl(u"math:mn"_ustr, mxList); rchars(OUString::createFromAscii(tmp->value.get())); - rendEl("math:mn"); + rendEl(u"math:mn"_ustr); #endif break; case ID_OPERATOR : @@ -237,9 +237,9 @@ void Formula::makeIdentifier(Node *res) #if OSL_DEBUG_LEVEL >= 2 inds; fprintf(stderr,"<math:mo>%s</math:mo> ",tmp->value.get()); indo; #else - rstartEl("math:mo", mxList); + rstartEl(u"math:mo"_ustr, mxList); runistr(fromHcharStringToOUString(getMathMLEntity(tmp->value.get()))); - rendEl("math:mo"); + rendEl(u"math:mo"_ustr); #endif break; } @@ -277,11 +277,11 @@ void Formula::makeSubSup(Node *res) fprintf(stderr,"<math:msubsup> "); #else if( res->id == ID_SUBEXPR ) - rstartEl("math:msub", mxList); + rstartEl(u"math:msub"_ustr, mxList); else if( res->id == ID_SUPEXPR ) - rstartEl("math:msup", mxList); + rstartEl(u"math:msup"_ustr, mxList); else - rstartEl("math:msubsup", mxList); + rstartEl(u"math:msubsup"_ustr, mxList); #endif tmp = tmp->child; @@ -305,11 +305,11 @@ void Formula::makeSubSup(Node *res) fprintf(stderr,"</math:msubsup> "); #else if( res->id == ID_SUBEXPR ) - rendEl("math:msub"); + rendEl(u"math:msub"_ustr); else if( res->id == ID_SUPEXPR ) - rendEl("math:msup"); + rendEl(u"math:msup"_ustr); else - rendEl("math:msubsup"); + rendEl(u"math:msubsup"_ustr); #endif } @@ -322,7 +322,7 @@ void Formula::makeFraction(Node *res) inds; fprintf(stderr,"<math:mfrac> "); #else - rstartEl("math:mfrac", mxList); + rstartEl(u"math:mfrac"_ustr, mxList); #endif tmp = tmp->child; @@ -330,7 +330,7 @@ void Formula::makeFraction(Node *res) inds; fprintf(stderr,"<math:mrow> "); #else - rstartEl("math:mrow", mxList); + rstartEl(u"math:mrow"_ustr, mxList); #endif if( res->id == ID_FRACTIONEXPR ) @@ -344,8 +344,8 @@ void Formula::makeFraction(Node *res) inds; fprintf(stderr,"<math:mrow> "); #else - rendEl("math:mrow"); - rstartEl("math:mrow", mxList); + rendEl(u"math:mrow"_ustr); + rstartEl(u"math:mrow"_ustr, mxList); #endif if( res->id == ID_FRACTIONEXPR ) @@ -359,8 +359,8 @@ void Formula::makeFraction(Node *res) inde; fprintf(stderr,"</math:mfrac> "); #else - rendEl("math:mrow"); - rendEl("math:mfrac"); + rendEl(u"math:mrow"_ustr); + rendEl(u"math:mfrac"_ustr); #endif } @@ -380,12 +380,12 @@ void Formula::makeDecoration(Node *res) #else /* FIXME: no idea when 'accent' is true or false. */ if( isover ){ - padd("accent","CDATA","true"); - rstartEl("math:mover", mxList); + padd(u"accent"_ustr,u"CDATA"_ustr,u"true"_ustr); + rstartEl(u"math:mover"_ustr, mxList); } else{ - padd("accentunder","CDATA","true"); - rstartEl("math:munder", mxList); + padd(u"accentunder"_ustr,u"CDATA"_ustr,u"true"_ustr); + rstartEl(u"math:munder"_ustr, mxList); } mxList->clear(); #endif @@ -398,9 +398,9 @@ void Formula::makeDecoration(Node *res) getMathMLEntity(tmp->value.get()).c_str()); indo; #else - rstartEl("math:mo", mxList); + rstartEl(u"math:mo"_ustr, mxList); runistr(fromHcharStringToOUString(getMathMLEntity(tmp->value.get()))); - rendEl("math:mo"); + rendEl(u"math:mo"_ustr); #endif #if OSL_DEBUG_LEVEL >= 2 @@ -411,9 +411,9 @@ void Formula::makeDecoration(Node *res) fprintf(stderr,"</math:munder> "); #else if( isover ) - rendEl("math:mover"); + rendEl(u"math:mover"_ustr); else - rendEl("math:munder"); + rendEl(u"math:munder"_ustr); #endif } @@ -429,9 +429,9 @@ void Formula::makeRoot(Node *res) fprintf(stderr,"<math:mroot> "); #else if( tmp->id == ID_SQRTEXPR ) - rstartEl("math:msqrt", mxList); + rstartEl(u"math:msqrt"_ustr, mxList); else - rstartEl("math:mroot", mxList); + rstartEl(u"math:mroot"_ustr, mxList); #endif if( tmp->id == ID_SQRTEXPR ){ @@ -450,9 +450,9 @@ void Formula::makeRoot(Node *res) fprintf(stderr,"</math:mroot> "); #else if( tmp->id == ID_SQRTEXPR ) - rendEl("math:msqrt"); + rendEl(u"math:msqrt"_ustr); else - rendEl("math:mroot"); + rendEl(u"math:mroot"_ustr); #endif } void Formula::makeAccent(Node *res) @@ -475,14 +475,14 @@ void Formula::makeParenth(Node *res) indo; inds; fprintf(stderr,"<math:mrow> "); #else - rstartEl("math:mrow", mxList); - rstartEl("math:mo", mxList); + rstartEl(u"math:mrow"_ustr, mxList); + rstartEl(u"math:mo"_ustr, mxList); if( tmp->id == ID_PARENTH ) - rchars("("); + rchars(u"("_ustr); else - rchars("|"); - rendEl("math:mo"); - rstartEl("math:mrow", mxList); + rchars(u"|"_ustr); + rendEl(u"math:mo"_ustr); + rstartEl(u"math:mrow"_ustr, mxList); #endif if( tmp->child ) @@ -500,14 +500,14 @@ void Formula::makeParenth(Node *res) inde; fprintf(stderr,"</math:mrow> "); #else - rendEl("math:mrow"); - rstartEl("math:mo", mxList); + rendEl(u"math:mrow"_ustr); + rstartEl(u"math:mo"_ustr, mxList); if( tmp->id == ID_PARENTH ) - rchars(")"); + rchars(u")"_ustr); else - rchars("|"); - rendEl("math:mo"); - rendEl("math:mrow"); + rchars(u"|"_ustr); + rendEl(u"math:mo"_ustr); + rendEl(u"math:mrow"_ustr); #endif } @@ -520,11 +520,11 @@ void Formula::makeFence(Node *res) getMathMLEntity(tmp->value.get()).c_str(), getMathMLEntity(tmp->next->next->value.get()).c_str()); #else - padd("open", "CDATA", + padd(u"open"_ustr, u"CDATA"_ustr, OUString(reinterpret_cast<sal_Unicode const *>(getMathMLEntity(tmp->value.get()).c_str()))); - padd("close", "CDATA", + padd(u"close"_ustr, u"CDATA"_ustr, OUString(reinterpret_cast<sal_Unicode const *>(getMathMLEntity(tmp->next->next->value.get()).c_str()))); - rstartEl("math:mfenced", mxList); + rstartEl(u"math:mfenced"_ustr, mxList); mxList->clear(); #endif @@ -534,7 +534,7 @@ void Formula::makeFence(Node *res) inde; fprintf(stderr,"</math:mfenced> "); #else - rendEl("math:mfenced"); + rendEl(u"math:mfenced"_ustr); #endif } @@ -549,7 +549,7 @@ void Formula::makeBlock(Node *res) inds; fprintf(stderr,"<math:mrow> "); #else - rstartEl("math:mrow", mxList); + rstartEl(u"math:mrow"_ustr, mxList); #endif if( res->child ) @@ -559,7 +559,7 @@ void Formula::makeBlock(Node *res) inde; fprintf(stderr,"</math:mrow> "); #else - rendEl("math:mrow"); + rendEl(u"math:mrow"_ustr); #endif } diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 2400192bb959..63b5571b6fe2 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -120,27 +120,27 @@ bool HwpReader::importHStream(std::unique_ptr<HStream> stream) if (m_rxDocumentHandler.is()) m_rxDocumentHandler->startDocument(); - mxList->addAttribute("office:class", sXML_CDATA, "text"); - mxList->addAttribute("office:version", sXML_CDATA, "0.9"); - - mxList->addAttribute("xmlns:office", "CDATA", "http://openoffice.org/2000/office"); - mxList->addAttribute("xmlns:style", "CDATA", "http://openoffice.org/2000/style"); - mxList->addAttribute("xmlns:text", "CDATA", "http://openoffice.org/2000/text"); - mxList->addAttribute("xmlns:table", "CDATA", "http://openoffice.org/2000/table"); - mxList->addAttribute("xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing"); - mxList->addAttribute("xmlns:fo", "CDATA", "http://www.w3.org/1999/XSL/Format"); - mxList->addAttribute("xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink"); - mxList->addAttribute("xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"); - mxList->addAttribute("xmlns:meta", "CDATA", "http://openoffice.org/2000/meta"); - mxList->addAttribute("xmlns:number", "CDATA", "http://openoffice.org/2000/datastyle"); - mxList->addAttribute("xmlns:svg", "CDATA", "http://www.w3.org/2000/svg"); - mxList->addAttribute("xmlns:chart", "CDATA", "http://openoffice.org/2000/chart"); - mxList->addAttribute("xmlns:dr3d", "CDATA", "http://openoffice.org/2000/dr3d"); - mxList->addAttribute("xmlns:math", "CDATA", "http://www.w3.org/1998/Math/MathML"); - mxList->addAttribute("xmlns:form", "CDATA", "http://openoffice.org/2000/form"); - mxList->addAttribute("xmlns:script", "CDATA", "http://openoffice.org/2000/script"); - - startEl("office:document"); + mxList->addAttribute(u"office:class"_ustr, sXML_CDATA, u"text"_ustr); + mxList->addAttribute(u"office:version"_ustr, sXML_CDATA, u"0.9"_ustr); + + mxList->addAttribute(u"xmlns:office"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/office"_ustr); + mxList->addAttribute(u"xmlns:style"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/style"_ustr); + mxList->addAttribute(u"xmlns:text"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/text"_ustr); + mxList->addAttribute(u"xmlns:table"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/table"_ustr); + mxList->addAttribute(u"xmlns:draw"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/drawing"_ustr); + mxList->addAttribute(u"xmlns:fo"_ustr, u"CDATA"_ustr, u"http://www.w3.org/1999/XSL/Format"_ustr); + mxList->addAttribute(u"xmlns:xlink"_ustr, u"CDATA"_ustr, u"http://www.w3.org/1999/xlink"_ustr); + mxList->addAttribute(u"xmlns:dc"_ustr, u"CDATA"_ustr, u"http://purl.org/dc/elements/1.1/"_ustr); + mxList->addAttribute(u"xmlns:meta"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/meta"_ustr); + mxList->addAttribute(u"xmlns:number"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/datastyle"_ustr); + mxList->addAttribute(u"xmlns:svg"_ustr, u"CDATA"_ustr, u"http://www.w3.org/2000/svg"_ustr); + mxList->addAttribute(u"xmlns:chart"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/chart"_ustr); + mxList->addAttribute(u"xmlns:dr3d"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/dr3d"_ustr); + mxList->addAttribute(u"xmlns:math"_ustr, u"CDATA"_ustr, u"http://www.w3.org/1998/Math/MathML"_ustr); + mxList->addAttribute(u"xmlns:form"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/form"_ustr); + mxList->addAttribute(u"xmlns:script"_ustr, u"CDATA"_ustr, u"http://openoffice.org/2000/script"_ustr); + + startEl(u"office:document"_ustr); mxList->clear(); makeMeta(); @@ -149,7 +149,7 @@ bool HwpReader::importHStream(std::unique_ptr<HStream> stream) makeMasterStyles(); makeBody(); - endEl("office:document"); + endEl(u"office:document"_ustr); if (m_rxDocumentHandler.is()) m_rxDocumentHandler->endDocument(); @@ -186,12 +186,12 @@ sal_Bool HwpReader::filter(const Sequence< PropertyValue >& rDescriptor) */ void HwpReader::makeBody() { - startEl("office:body"); + startEl(u"office:body"_ustr); makeTextDecls(); HWPPara *hwppara = hwpfile.GetFirstPara(); d->bInBody = true; parsePara(hwppara); - endEl("office:body"); + endEl(u"office:body"_ustr); d->bInBody = false; } @@ -201,28 +201,28 @@ void HwpReader::makeBody() */ void HwpReader::makeTextDecls() { - startEl("text:sequence-decls"); - mxList->addAttribute("text:display-outline-level", sXML_CDATA, "0"); - mxList->addAttribute("text:name", sXML_CDATA, "Illustration"); - startEl("text:sequence-decl"); + startEl(u"text:sequence-decls"_ustr); + mxList->addAttribute(u"text:display-outline-level"_ustr, sXML_CDATA, u"0"_ustr); + mxList->addAttribute(u"text:name"_ustr, sXML_CDATA, u"Illustration"_ustr); + startEl(u"text:sequence-decl"_ustr); mxList->clear(); - endEl("text:sequence-decl"); - mxList->addAttribute("text:display-outline-level", sXML_CDATA, "0"); - mxList->addAttribute("text:name", sXML_CDATA, "Table"); - startEl("text:sequence-decl"); + endEl(u"text:sequence-decl"_ustr); + mxList->addAttribute(u"text:display-outline-level"_ustr, sXML_CDATA, u"0"_ustr); + mxList->addAttribute(u"text:name"_ustr, sXML_CDATA, u"Table"_ustr); + startEl(u"text:sequence-decl"_ustr); mxList->clear(); - endEl("text:sequence-decl"); - mxList->addAttribute("text:display-outline-level", sXML_CDATA, "0"); - mxList->addAttribute("text:name", sXML_CDATA, "Text"); - startEl("text:sequence-decl"); + endEl(u"text:sequence-decl"_ustr); + mxList->addAttribute(u"text:display-outline-level"_ustr, sXML_CDATA, u"0"_ustr); + mxList->addAttribute(u"text:name"_ustr, sXML_CDATA, u"Text"_ustr); + startEl(u"text:sequence-decl"_ustr); mxList->clear(); - endEl("text:sequence-decl"); - mxList->addAttribute("text:display-outline-level", sXML_CDATA, "0"); - mxList->addAttribute("text:name", sXML_CDATA, "Drawing"); - startEl("text:sequence-decl"); + endEl(u"text:sequence-decl"_ustr); + mxList->addAttribute(u"text:display-outline-level"_ustr, sXML_CDATA, u"0"_ustr); + mxList->addAttribute(u"text:name"_ustr, sXML_CDATA, u"Drawing"_ustr); + startEl(u"text:sequence-decl"_ustr); mxList->clear(); - endEl("text:sequence-decl"); - endEl("text:sequence-decls"); + endEl(u"text:sequence-decl"_ustr); + endEl(u"text:sequence-decls"_ustr); } @@ -234,27 +234,27 @@ void HwpReader::makeMeta() { HWPInfo& hwpinfo = hwpfile.GetHWPInfo(); - startEl("office:meta"); + startEl(u"office:meta"_ustr); if (hwpinfo.summary.title[0]) { - startEl("dc:title"); + startEl(u"dc:title"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.title))); - endEl("dc:title"); + endEl(u"dc:title"_ustr); } if (hwpinfo.summary.subject[0]) { - startEl("dc:subject"); + startEl(u"dc:subject"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.subject))); - endEl("dc:subject"); + endEl(u"dc:subject"_ustr); } if (hwpinfo.summary.author[0]) { - startEl("meta:initial-creator"); + startEl(u"meta:initial-creator"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.author))); - endEl("meta:initial-creator"); + endEl(u"meta:initial-creator"_ustr); } if (hwpinfo.summary.date[0]) @@ -316,47 +316,47 @@ void HwpReader::makeMeta() } o3tl::sprintf(d->buf,"%d-%02d-%02dT%02d:%02d:00",year,month,day,hour,minute); - startEl("meta:creation-date"); + startEl(u"meta:creation-date"_ustr); chars( OUString::createFromAscii(d->buf)); - endEl("meta:creation-date"); + endEl(u"meta:creation-date"_ustr); } if (hwpinfo.summary.keyword[0][0] || hwpinfo.summary.etc[0][0]) { - startEl("meta:keywords"); + startEl(u"meta:keywords"_ustr); if (hwpinfo.summary.keyword[0][0]) { - startEl("meta:keyword"); + startEl(u"meta:keyword"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.keyword[0]))); - endEl("meta:keyword"); + endEl(u"meta:keyword"_ustr); } if (hwpinfo.summary.keyword[1][0]) { - startEl("meta:keyword"); + startEl(u"meta:keyword"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.keyword[1]))); - endEl("meta:keyword"); + endEl(u"meta:keyword"_ustr); } if (hwpinfo.summary.etc[0][0]) { - startEl("meta:keyword"); + startEl(u"meta:keyword"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.etc[0]))); - endEl("meta:keyword"); + endEl(u"meta:keyword"_ustr); } if (hwpinfo.summary.etc[1][0]) { - startEl("meta:keyword"); + startEl(u"meta:keyword"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.etc[1]))); - endEl("meta:keyword"); + endEl(u"meta:keyword"_ustr); } if (hwpinfo.summary.etc[2][0]) { - startEl("meta:keyword"); + startEl(u"meta:keyword"_ustr); chars(hstr2OUString(reinterpret_cast<hchar *>(hwpinfo.summary.etc[2]))); - endEl("meta:keyword"); + endEl(u"meta:keyword"_ustr); } - endEl("meta:keywords"); + endEl(u"meta:keywords"_ustr); } - endEl("office:meta"); + endEl(u"office:meta"_ustr); } @@ -410,24 +410,24 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) if( prop->line_pstyle > 0 && prop->line_pstyle < 5 && prop->line_color <= 0xffffff) { - mxList->addAttribute( "draw:name", sXML_CDATA, "LineType" + OUString::number(hdo->index)); - mxList->addAttribute( "draw:style", sXML_CDATA, "round"); - mxList->addAttribute( "draw:dots1", sXML_CDATA, "1"); - mxList->addAttribute( "draw:dots1-length", sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].dots1 * WTMM(prop->line_width) ) + "cm"); + mxList->addAttribute( u"draw:name"_ustr, sXML_CDATA, "LineType" + OUString::number(hdo->index)); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"round"_ustr); + mxList->addAttribute( u"draw:dots1"_ustr, sXML_CDATA, u"1"_ustr); + mxList->addAttribute( u"draw:dots1-length"_ustr, sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].dots1 * WTMM(prop->line_width) ) + "cm"); if( prop->line_pstyle == 3 ) { - mxList->addAttribute( "draw:dots2", sXML_CDATA, "1"); - mxList->addAttribute( "draw:dots2-length", sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].dots2 * WTMM(prop->line_width) ) + "cm"); + mxList->addAttribute( u"draw:dots2"_ustr, sXML_CDATA, u"1"_ustr); + mxList->addAttribute( u"draw:dots2-length"_ustr, sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].dots2 * WTMM(prop->line_width) ) + "cm"); } else if( prop->line_pstyle == 4 ) { - mxList->addAttribute( "draw:dots2", sXML_CDATA, "2"); - mxList->addAttribute( "draw:dots2-length", sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].dots2 * WTMM(prop->line_width)) + "cm"); + mxList->addAttribute( u"draw:dots2"_ustr, sXML_CDATA, u"2"_ustr); + mxList->addAttribute( u"draw:dots2-length"_ustr, sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].dots2 * WTMM(prop->line_width)) + "cm"); } - mxList->addAttribute( "draw:distance", sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].distance * WTMM(prop->line_width)) + "cm"); - startEl("draw:stroke-dash"); + mxList->addAttribute( u"draw:distance"_ustr, sXML_CDATA, OUString::number( LineStyle[prop->line_pstyle].distance * WTMM(prop->line_width)) + "cm"); + startEl(u"draw:stroke-dash"_ustr); mxList->clear(); - endEl("draw:stroke-dash"); + endEl(u"draw:stroke-dash"_ustr); } if( hdo->type == HWPDO_LINE || hdo->type == HWPDO_ARC || hdo->type == HWPDO_FREEFORM || @@ -438,52 +438,52 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) !ArrowShape[prop->line_tstyle].bMade ) { ArrowShape[prop->line_tstyle].bMade = true; - mxList->addAttribute("draw:name", sXML_CDATA, + mxList->addAttribute(u"draw:name"_ustr, sXML_CDATA, OUString::createFromAscii(ArrowShape[prop->line_tstyle].name)); if( prop->line_tstyle == 1 ) { - mxList->addAttribute("svg:viewBox", sXML_CDATA, "0 0 20 30"); - mxList->addAttribute("svg:d", sXML_CDATA, "m10 0-10 30h20z"); + mxList->addAttribute(u"svg:viewBox"_ustr, sXML_CDATA, u"0 0 20 30"_ustr); + mxList->addAttribute(u"svg:d"_ustr, sXML_CDATA, u"m10 0-10 30h20z"_ustr); } else if( prop->line_tstyle == 2 ) { - mxList->addAttribute("svg:viewBox", sXML_CDATA, "0 0 1122 2243"); - mxList->addAttribute("svg:d", sXML_CDATA, "m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z"); + mxList->addAttribute(u"svg:viewBox"_ustr, sXML_CDATA, u"0 0 1122 2243"_ustr); + mxList->addAttribute(u"svg:d"_ustr, sXML_CDATA, u"m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z"_ustr); } else if( prop->line_tstyle == 3 ) { - mxList->addAttribute("svg:viewBox", sXML_CDATA, "0 0 30 30"); - mxList->addAttribute("svg:d", sXML_CDATA, "m0 0h30v30h-30z"); + mxList->addAttribute(u"svg:viewBox"_ustr, sXML_CDATA, u"0 0 30 30"_ustr); + mxList->addAttribute(u"svg:d"_ustr, sXML_CDATA, u"m0 0h30v30h-30z"_ustr); } - startEl("draw:marker"); + startEl(u"draw:marker"_ustr); mxList->clear(); - endEl("draw:marker"); + endEl(u"draw:marker"_ustr); } if (prop->line_hstyle > 0 && o3tl::make_unsigned(prop->line_hstyle) < std::size(ArrowShape) && !ArrowShape[prop->line_hstyle].bMade) { ArrowShape[prop->line_hstyle].bMade = true; - mxList->addAttribute("draw:name", sXML_CDATA, + mxList->addAttribute(u"draw:name"_ustr, sXML_CDATA, OUString::createFromAscii(ArrowShape[prop->line_hstyle].name)); if( prop->line_hstyle == 1 ) { - mxList->addAttribute("svg:viewBox", sXML_CDATA, "0 0 20 30"); - mxList->addAttribute("svg:d", sXML_CDATA, "m10 0-10 30h20z"); + mxList->addAttribute(u"svg:viewBox"_ustr, sXML_CDATA, u"0 0 20 30"_ustr); + mxList->addAttribute(u"svg:d"_ustr, sXML_CDATA, u"m10 0-10 30h20z"_ustr); } else if( prop->line_hstyle == 2 ) { - mxList->addAttribute("svg:viewBox", sXML_CDATA, "0 0 1122 2243"); - mxList->addAttribute("svg:d", sXML_CDATA, "m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z"); + mxList->addAttribute(u"svg:viewBox"_ustr, sXML_CDATA, u"0 0 1122 2243"_ustr); + mxList->addAttribute(u"svg:d"_ustr, sXML_CDATA, u"m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z"_ustr); } else if( prop->line_hstyle == 3 ) { - mxList->addAttribute("svg:viewBox", sXML_CDATA, "0 0 20 20"); - mxList->addAttribute("svg:d", sXML_CDATA, "m0 0h20v20h-20z"); + mxList->addAttribute(u"svg:viewBox"_ustr, sXML_CDATA, u"0 0 20 20"_ustr); + mxList->addAttribute(u"svg:d"_ustr, sXML_CDATA, u"m0 0h20v20h-20z"_ustr); } - startEl("draw:marker"); + startEl(u"draw:marker"_ustr); mxList->clear(); - endEl("draw:marker"); + endEl(u"draw:marker"_ustr); } } @@ -491,55 +491,55 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) { if( prop->flag >> 18 & 0x01 ) { - mxList->addAttribute( "draw:name", sXML_CDATA, "fillimage" + OUString::number(hdo->index)); + mxList->addAttribute( u"draw:name"_ustr, sXML_CDATA, "fillimage" + OUString::number(hdo->index)); EmPicture *emp = nullptr; if (prop->pictype && strlen(prop->szPatternFile) > 3) emp = hwpfile.GetEmPictureByName(prop->szPatternFile); if (!emp) { - mxList->addAttribute( "xlink:href", sXML_CDATA, + mxList->addAttribute( u"xlink:href"_ustr, sXML_CDATA, hstr2OUString(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(prop->szPatternFile).c_str())).c_str())); - mxList->addAttribute( "xlink:type", sXML_CDATA, "simple"); - mxList->addAttribute( "xlink:show", sXML_CDATA, "embed"); - mxList->addAttribute( "xlink:actuate", sXML_CDATA, "onLoad"); + mxList->addAttribute( u"xlink:type"_ustr, sXML_CDATA, u"simple"_ustr); + mxList->addAttribute( u"xlink:show"_ustr, sXML_CDATA, u"embed"_ustr); + mxList->addAttribute( u"xlink:actuate"_ustr, sXML_CDATA, u"onLoad"_ustr); } - startEl("draw:fill-image"); + startEl(u"draw:fill-image"_ustr); mxList->clear(); if (emp) { - startEl("office:binary-data"); + startEl(u"office:binary-data"_ustr); chars(base64_encode_string(emp->data.data(), emp->size)); - endEl("office:binary-data"); + endEl(u"office:binary-data"_ustr); } - endEl("draw:fill-image"); + endEl(u"draw:fill-image"_ustr); } /* If there is a gradient, when a bitmap file is present, this is the first. */ else if( prop->flag >> 16 & 0x01 ) /* existence gradient */ { - mxList->addAttribute( "draw:name", sXML_CDATA, "Grad" + OUString::number(hdo->index)); + mxList->addAttribute( u"draw:name"_ustr, sXML_CDATA, "Grad" + OUString::number(hdo->index)); switch( prop->gstyle ) { case 1 : if( prop->center_y == 50 ) - mxList->addAttribute( "draw:style", sXML_CDATA, "axial"); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"axial"_ustr); else - mxList->addAttribute( "draw:style", sXML_CDATA, "linear"); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"linear"_ustr); break; case 2: case 3: - mxList->addAttribute( "draw:style", sXML_CDATA, "radial"); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"radial"_ustr); break; case 4: - mxList->addAttribute( "draw:style", sXML_CDATA, "square"); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"square"_ustr); break; default: - mxList->addAttribute( "draw:style", sXML_CDATA, "linear"); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"linear"_ustr); break; } - mxList->addAttribute( "draw:cx", sXML_CDATA, OUString::number(prop->center_x) + "%"); - mxList->addAttribute( "draw:cy", sXML_CDATA, OUString::number(prop->center_y) + "%"); + mxList->addAttribute( u"draw:cx"_ustr, sXML_CDATA, OUString::number(prop->center_x) + "%"); + mxList->addAttribute( u"draw:cy"_ustr, sXML_CDATA, OUString::number(prop->center_y) + "%"); HWPInfo& hwpinfo = hwpfile.GetHWPInfo(); int default_color = 0xffffff; @@ -560,61 +560,61 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) { if( prop->center_y == 100 ) { - mxList->addAttribute( "draw:start-color", sXML_CDATA, rgb2str( prop->tocolor )); - mxList->addAttribute( "draw:end-color", sXML_CDATA, rgb2str( prop->fromcolor )); + mxList->addAttribute( u"draw:start-color"_ustr, sXML_CDATA, rgb2str( prop->tocolor )); + mxList->addAttribute( u"draw:end-color"_ustr, sXML_CDATA, rgb2str( prop->fromcolor )); } else { - mxList->addAttribute( "draw:start-color", sXML_CDATA, rgb2str( prop->fromcolor )); - mxList->addAttribute( "draw:end-color", sXML_CDATA, rgb2str( prop->tocolor )); + mxList->addAttribute( u"draw:start-color"_ustr, sXML_CDATA, rgb2str( prop->fromcolor )); + mxList->addAttribute( u"draw:end-color"_ustr, sXML_CDATA, rgb2str( prop->tocolor )); } } else { - mxList->addAttribute( "draw:start-color", sXML_CDATA,rgb2str( prop->tocolor )); - mxList->addAttribute( "draw:end-color", sXML_CDATA,rgb2str( prop->fromcolor )); + mxList->addAttribute( u"draw:start-color"_ustr, sXML_CDATA,rgb2str( prop->tocolor )); + mxList->addAttribute( u"draw:end-color"_ustr, sXML_CDATA,rgb2str( prop->fromcolor )); } if( prop->angle > 0 && ( prop->gstyle == 1 || prop->gstyle == 4)) { auto normangle = prop->angle % 360; int angle = 1800 - normangle * 10; - mxList->addAttribute( "draw:angle", sXML_CDATA, OUString::number(angle)); + mxList->addAttribute( u"draw:angle"_ustr, sXML_CDATA, OUString::number(angle)); } - startEl("draw:gradient"); + startEl(u"draw:gradient"_ustr); mxList->clear(); - endEl("draw:gradient"); + endEl(u"draw:gradient"_ustr); } /* hatch */ else if( prop->pattern_type >> 24 & 0x01 ) { int type = prop->pattern_type & 0xffffff; - mxList->addAttribute( "draw:name", sXML_CDATA, "Hatch" + OUString::number(hdo->index)); + mxList->addAttribute( u"draw:name"_ustr, sXML_CDATA, "Hatch" + OUString::number(hdo->index)); if( type < 4 ) - mxList->addAttribute( "draw:style", sXML_CDATA, "single" ); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"single"_ustr ); else - mxList->addAttribute( "draw:style", sXML_CDATA, "double" ); - mxList->addAttribute( "draw:color", sXML_CDATA, rgb2str( static_cast<int32_t>(prop->pattern_color) )); - mxList->addAttribute( "draw:distance", sXML_CDATA, "0.12cm"); + mxList->addAttribute( u"draw:style"_ustr, sXML_CDATA, u"double"_ustr ); + mxList->addAttribute( u"draw:color"_ustr, sXML_CDATA, rgb2str( static_cast<int32_t>(prop->pattern_color) )); + mxList->addAttribute( u"draw:distance"_ustr, sXML_CDATA, u"0.12cm"_ustr); switch( type ) { case 0 : case 4 : - mxList->addAttribute( "draw:rotation", sXML_CDATA, "0"); + mxList->addAttribute( u"draw:rotation"_ustr, sXML_CDATA, u"0"_ustr); break; case 1 : - mxList->addAttribute( "draw:rotation", sXML_CDATA, "900"); + mxList->addAttribute( u"draw:rotation"_ustr, sXML_CDATA, u"900"_ustr); break; case 2 : - mxList->addAttribute( "draw:rotation", sXML_CDATA, "1350"); + mxList->addAttribute( u"draw:rotation"_ustr, sXML_CDATA, u"1350"_ustr); break; case 3 : case 5 : - mxList->addAttribute( "draw:rotation", sXML_CDATA, "450"); + mxList->addAttribute( u"draw:rotation"_ustr, sXML_CDATA, u"450"_ustr); break; } - startEl("draw:hatch"); + startEl(u"draw:hatch"_ustr); mxList->clear(); - endEl("draw:hatch"); + endEl(u"draw:hatch"_ustr); } } hdo = hdo->next.get(); @@ -626,7 +626,7 @@ void HwpReader::makeStyles() { HWPStyle& hwpstyle = hwpfile.GetHWPStyle(); - startEl("office:styles"); + startEl(u"office:styles"_ustr); int i; for (i = 0; i < hwpfile.getFBoxStyleCount(); i++) @@ -637,107 +637,107 @@ void HwpReader::makeStyles() } } - mxList->addAttribute("style:name", sXML_CDATA, "Standard"); - mxList->addAttribute("style:family", sXML_CDATA, "paragraph"); - mxList->addAttribute("style:class", sXML_CDATA, "text"); - startEl("style:style"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, u"Standard"_ustr); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA, u"paragraph"_ustr); + mxList->addAttribute(u"style:class"_ustr, sXML_CDATA, u"text"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - mxList->addAttribute("fo:line-height", sXML_CDATA, "160%"); - mxList->addAttribute("fo:text-align", sXML_CDATA, "justify"); - startEl("style:properties"); + mxList->addAttribute(u"fo:line-height"_ustr, sXML_CDATA, u"160%"_ustr); + mxList->addAttribute(u"fo:text-align"_ustr, sXML_CDATA, u"justify"_ustr); + startEl(u"style:properties"_ustr); mxList->clear(); - startEl("style:tab-stops"); + startEl(u"style:tab-stops"_ustr); for( i = 1 ; i < 40 ; i++) { - mxList->addAttribute("style:position", sXML_CDATA, + mxList->addAttribute(u"style:position"_ustr, sXML_CDATA, OUString::number( WTI(1000 * i)) + "inch"); - startEl("style:tab-stop"); + startEl(u"style:tab-stop"_ustr); mxList->clear(); - endEl("style:tab-stop"); + endEl(u"style:tab-stop"_ustr); } - endEl("style:tab-stops"); - endEl("style:properties"); + endEl(u"style:tab-stops"_ustr); + endEl(u"style:properties"_ustr); - endEl("style:style"); + endEl(u"style:style"_ustr); for (int ii = 0; ii < hwpstyle.Num(); ii++) { unsigned char *stylename = reinterpret_cast<unsigned char *>(hwpstyle.GetName(ii)); - mxList->addAttribute("style:name", sXML_CDATA, hstr2OUString(kstr2hstr(stylename).c_str())); - mxList->addAttribute("style:family", sXML_CDATA, "paragraph"); - mxList->addAttribute("style:parent-style-name", sXML_CDATA, "Standard"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, hstr2OUString(kstr2hstr(stylename).c_str())); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA, u"paragraph"_ustr); + mxList->addAttribute(u"style:parent-style-name"_ustr, sXML_CDATA, u"Standard"_ustr); - startEl("style:style"); + startEl(u"style:style"_ustr); mxList->clear(); parseCharShape(hwpstyle.GetCharShape(ii)); parseParaShape(hwpstyle.GetParaShape(ii)); - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); + endEl(u"style:properties"_ustr); - endEl("style:style"); + endEl(u"style:style"_ustr); } { - mxList->addAttribute( "style:name", sXML_CDATA, "Header"); - mxList->addAttribute( "style:family", sXML_CDATA, "paragraph"); - mxList->addAttribute( "style:parent-style-name", sXML_CDATA, "Standard"); - mxList->addAttribute( "style:class", sXML_CDATA, "extra"); - startEl("style:style"); + mxList->addAttribute( u"style:name"_ustr, sXML_CDATA, u"Header"_ustr); + mxList->addAttribute( u"style:family"_ustr, sXML_CDATA, u"paragraph"_ustr); + mxList->addAttribute( u"style:parent-style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + mxList->addAttribute( u"style:class"_ustr, sXML_CDATA, u"extra"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - endEl("style:style"); + endEl(u"style:style"_ustr); } { - mxList->addAttribute( "style:name", sXML_CDATA, "Footer"); - mxList->addAttribute( "style:family", sXML_CDATA, "paragraph"); - mxList->addAttribute( "style:parent-style-name", sXML_CDATA, "Standard"); - mxList->addAttribute( "style:class", sXML_CDATA, "extra"); - startEl("style:style"); + mxList->addAttribute( u"style:name"_ustr, sXML_CDATA, u"Footer"_ustr); + mxList->addAttribute( u"style:family"_ustr, sXML_CDATA, u"paragraph"_ustr); + mxList->addAttribute( u"style:parent-style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + mxList->addAttribute( u"style:class"_ustr, sXML_CDATA, u"extra"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - endEl("style:style"); + endEl(u"style:style"_ustr); } if( hwpfile.linenumber > 0) { - mxList->addAttribute( "style:name", sXML_CDATA, "Horizontal Line"); - mxList->addAttribute( "style:family", sXML_CDATA, "paragraph"); - mxList->addAttribute( "style:parent-style-name", sXML_CDATA, "Standard"); - mxList->addAttribute( "style:class", sXML_CDATA, "html"); - startEl("style:style"); + mxList->addAttribute( u"style:name"_ustr, sXML_CDATA, u"Horizontal Line"_ustr); + mxList->addAttribute( u"style:family"_ustr, sXML_CDATA, u"paragraph"_ustr); + mxList->addAttribute( u"style:parent-style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + mxList->addAttribute( u"style:class"_ustr, sXML_CDATA, u"html"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - mxList->addAttribute( "fo:font-size", sXML_CDATA, "6pt"); - mxList->addAttribute( "fo:margin-top", sXML_CDATA, "0cm"); - mxList->addAttribute( "fo:margin-bottom", sXML_CDATA, "0cm"); - mxList->addAttribute( "style:border-line-width-bottom", sXML_CDATA, "0.02cm 0.035cm 0.002cm"); - mxList->addAttribute( "fo:padding", sXML_CDATA, "0cm"); - mxList->addAttribute( "fo:border-bottom", sXML_CDATA, "0.039cm double #808080"); - mxList->addAttribute( "text:number-lines", sXML_CDATA, "false"); - mxList->addAttribute( "text:line-number", sXML_CDATA, "0"); - mxList->addAttribute("fo:line-height", sXML_CDATA, "100%"); - startEl("style:properties"); + mxList->addAttribute( u"fo:font-size"_ustr, sXML_CDATA, u"6pt"_ustr); + mxList->addAttribute( u"fo:margin-top"_ustr, sXML_CDATA, u"0cm"_ustr); + mxList->addAttribute( u"fo:margin-bottom"_ustr, sXML_CDATA, u"0cm"_ustr); + mxList->addAttribute( u"style:border-line-width-bottom"_ustr, sXML_CDATA, u"0.02cm 0.035cm 0.002cm"_ustr); + mxList->addAttribute( u"fo:padding"_ustr, sXML_CDATA, u"0cm"_ustr); + mxList->addAttribute( u"fo:border-bottom"_ustr, sXML_CDATA, u"0.039cm double #808080"_ustr); + mxList->addAttribute( u"text:number-lines"_ustr, sXML_CDATA, u"false"_ustr); + mxList->addAttribute( u"text:line-number"_ustr, sXML_CDATA, u"0"_ustr); + mxList->addAttribute(u"fo:line-height"_ustr, sXML_CDATA, u"100%"_ustr); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); } HWPInfo& hwpinfo = hwpfile.GetHWPInfo(); - mxList->addAttribute("text:num-suffix", sXML_CDATA, ")"); - mxList->addAttribute("text:num-format", sXML_CDATA, "1"); + mxList->addAttribute(u"text:num-suffix"_ustr, sXML_CDATA, u")"_ustr); + mxList->addAttribute(u"text:num-format"_ustr, sXML_CDATA, u"1"_ustr); if( hwpinfo.beginfnnum != 1) - mxList->addAttribute("text:offset", sXML_CDATA, OUString::number(hwpinfo.beginfnnum - 1)); - startEl("text:footnotes-configuration"); + mxList->addAttribute(u"text:offset"_ustr, sXML_CDATA, OUString::number(hwpinfo.beginfnnum - 1)); + startEl(u"text:footnotes-configuration"_ustr); mxList->clear(); - endEl("text:footnotes-configuration"); + endEl(u"text:footnotes-configuration"_ustr); - endEl("office:styles"); + endEl(u"office:styles"_ustr); } @@ -750,7 +750,7 @@ void HwpReader::makeAutoStyles() { int i; - startEl("office:automatic-styles"); + startEl(u"office:automatic-styles"_ustr); for (i = 0; i < hwpfile.getParaShapeCount(); i++) makePStyle(hwpfile.getParaShape(i)); @@ -800,46 +800,46 @@ void HwpReader::makeAutoStyles() continue; if( i == 3 && !bIsRight ) continue; - mxList->addAttribute("style:name", sXML_CDATA, "PNPara" + OUString::number(i)); - mxList->addAttribute("style:family", sXML_CDATA, "paragraph"); - mxList->addAttribute("style:parent-style-name", sXML_CDATA, "Standard"); - startEl("style:style"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "PNPara" + OUString::number(i)); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA, u"paragraph"_ustr); + mxList->addAttribute(u"style:parent-style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); if( i == 1 ) - mxList->addAttribute("fo:text-align", sXML_CDATA, "start"); + mxList->addAttribute(u"fo:text-align"_ustr, sXML_CDATA, u"start"_ustr); else if ( i == 2 ) - mxList->addAttribute("fo:text-align", sXML_CDATA, "center"); + mxList->addAttribute(u"fo:text-align"_ustr, sXML_CDATA, u"center"_ustr); else if ( i == 3 ) - mxList->addAttribute("fo:text-align", sXML_CDATA, "end"); - startEl("style:properties"); + mxList->addAttribute(u"fo:text-align"_ustr, sXML_CDATA, u"end"_ustr); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); - mxList->addAttribute("style:name", sXML_CDATA, "PNBox" + OUString::number(i)); - mxList->addAttribute("style:family", sXML_CDATA, "graphics"); - startEl("style:style"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "PNBox" + OUString::number(i)); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA, u"graphics"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - mxList->addAttribute("fo:margin-top", sXML_CDATA, "0cm"); - mxList->addAttribute("fo:margin-bottom", sXML_CDATA, "0cm"); - mxList->addAttribute("style:wrap", sXML_CDATA, "run-through"); - mxList->addAttribute("style:vertical-pos", sXML_CDATA, "from-top"); - mxList->addAttribute("style:vertical-rel", sXML_CDATA, "paragraph"); + mxList->addAttribute(u"fo:margin-top"_ustr, sXML_CDATA, u"0cm"_ustr); + mxList->addAttribute(u"fo:margin-bottom"_ustr, sXML_CDATA, u"0cm"_ustr); + mxList->addAttribute(u"style:wrap"_ustr, sXML_CDATA, u"run-through"_ustr); + mxList->addAttribute(u"style:vertical-pos"_ustr, sXML_CDATA, u"from-top"_ustr); + mxList->addAttribute(u"style:vertical-rel"_ustr, sXML_CDATA, u"paragraph"_ustr); if( i == 1 ) - mxList->addAttribute("style:horizontal-pos", sXML_CDATA, "left"); + mxList->addAttribute(u"style:horizontal-pos"_ustr, sXML_CDATA, u"left"_ustr); else if ( i == 2 ) - mxList->addAttribute("style:horizontal-pos", sXML_CDATA, "center"); + mxList->addAttribute(u"style:horizontal-pos"_ustr, sXML_CDATA, u"center"_ustr); else if ( i == 3 ) - mxList->addAttribute("style:horizontal-pos", sXML_CDATA, "right"); - mxList->addAttribute("style:horizontal-rel", sXML_CDATA, "paragraph"); - mxList->addAttribute("fo:padding", sXML_CDATA, "0cm"); - mxList->addAttribute("stylefamily", sXML_CDATA, "graphics"); - startEl("style:properties"); + mxList->addAttribute(u"style:horizontal-pos"_ustr, sXML_CDATA, u"right"_ustr); + mxList->addAttribute(u"style:horizontal-rel"_ustr, sXML_CDATA, u"paragraph"_ustr); + mxList->addAttribute(u"fo:padding"_ustr, sXML_CDATA, u"0cm"_ustr); + mxList->addAttribute(u"stylefamily"_ustr, sXML_CDATA, u"graphics"_ustr); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); } for (i = 0; i < hwpfile.getDateFormatCount(); i++) @@ -847,7 +847,7 @@ void HwpReader::makeAutoStyles() makePageStyle(); - endEl("office:automatic-styles"); + endEl(u"office:automatic-styles"_ustr); } namespace { @@ -879,7 +879,7 @@ struct PageSetting void HwpReader::makeMasterStyles() { - startEl("office:master-styles"); + startEl(u"office:master-styles"_ustr); int i; int nMax = hwpfile.getMaxSettedPage(); @@ -967,15 +967,15 @@ void HwpReader::makeMasterStyles() for( i = 1; i <= nMax ; i++ ) { if( i == 1 ) - mxList->addAttribute("style:name", sXML_CDATA, "Standard"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, u"Standard"_ustr); else - mxList->addAttribute("style:name", sXML_CDATA, "p" + OUString::number(i)); - mxList->addAttribute("style:page-master-name", sXML_CDATA, + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "p" + OUString::number(i)); + mxList->addAttribute(u"style:page-master-name"_ustr, sXML_CDATA, "pm" + OUString::number(hwpfile.GetPageMasterNum(i))); if( i < nMax ) - mxList->addAttribute("style:next-style-name", sXML_CDATA, "p" + OUString::number(i + 1)); - mxList->addAttribute("draw:style-name", sXML_CDATA, "master" + OUString::number(i)); - startEl("style:master-page"); + mxList->addAttribute(u"style:next-style-name"_ustr, sXML_CDATA, "p" + OUString::number(i + 1)); + mxList->addAttribute(u"draw:style-name"_ustr, sXML_CDATA, "master" + OUString::number(i)); + startEl(u"style:master-page"_ustr); mxList->clear(); if( aSet[i].bIsSet ) /* If you've changed the current setting */ @@ -1026,28 +1026,28 @@ void HwpReader::makeMasterStyles() } else /* If the previous settings doesn't exist, set to the default settings */ { - startEl("style:header"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:header"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); - endEl("text:p"); - endEl("style:header"); + endEl(u"text:p"_ustr); + endEl(u"style:header"_ustr); - startEl("style:footer"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:footer"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); - endEl("text:p"); - endEl("style:footer"); + endEl(u"text:p"_ustr); + endEl(u"style:footer"_ustr); - endEl("style:master-page"); + endEl(u"style:master-page"_ustr); continue; } // header if( pPage->header ) { - startEl("style:header"); + startEl(u"style:header"_ustr); if( pPage->pagenumber && pPage->pagenumber->where < 4 ) { d->bInHeader = true; @@ -1057,11 +1057,11 @@ void HwpReader::makeMasterStyles() parsePara(pPage->header->plist.front().get()); d->bInHeader = false; d->pPn = nullptr; - endEl("style:header"); + endEl(u"style:header"_ustr); } if( pPage->header_even ) { - startEl("style:header"); + startEl(u"style:header"_ustr); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) { @@ -1074,14 +1074,14 @@ void HwpReader::makeMasterStyles() d->bInHeader = false; d->pPn = nullptr; d->nPnPos = 0; - endEl("style:header"); + endEl(u"style:header"_ustr); } /* Will be the default. */ else if (pPage->header_odd) { - startEl("style:header"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:header"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) @@ -1092,12 +1092,12 @@ void HwpReader::makeMasterStyles() d->pPn = nullptr; d->nPnPos = 0; } - endEl("text:p"); - endEl("style:header"); + endEl(u"text:p"_ustr); + endEl(u"style:header"_ustr); } if( pPage->header_odd ) { - startEl("style:header-left"); + startEl(u"style:header-left"_ustr); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) { @@ -1110,14 +1110,14 @@ void HwpReader::makeMasterStyles() d->bInHeader = false; d->pPn = nullptr; d->nPnPos = 0; - endEl("style:header-left"); + endEl(u"style:header-left"_ustr); } /* Will be the default. */ else if (pPage->header_even) { - startEl("style:header-left"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:header-left"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) @@ -1128,14 +1128,14 @@ void HwpReader::makeMasterStyles() d->pPn = nullptr; d->nPnPos = 0; } - endEl("text:p"); - endEl("style:header-left"); + endEl(u"text:p"_ustr); + endEl(u"style:header-left"_ustr); } if( !pPage->header && !pPage->header_even && !pPage->header_odd ) { - startEl("style:header"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:header"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); if( pPage->pagenumber && (pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) @@ -1144,13 +1144,13 @@ void HwpReader::makeMasterStyles() makeShowPageNum(); d->pPn = nullptr; } - endEl("text:p"); - endEl("style:header"); + endEl(u"text:p"_ustr); + endEl(u"style:header"_ustr); } // footer if( pPage->footer ) { - startEl("style:footer"); + startEl(u"style:footer"_ustr); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1161,11 +1161,11 @@ void HwpReader::makeMasterStyles() parsePara(pPage->footer->plist.front().get()); d->bInHeader = false; d->pPn = nullptr; - endEl("style:footer"); + endEl(u"style:footer"_ustr); } if( pPage->footer_even ) { - startEl("style:footer"); + startEl(u"style:footer"_ustr); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1178,14 +1178,14 @@ void HwpReader::makeMasterStyles() d->bInHeader = false; d->pPn = nullptr; d->nPnPos = 0; - endEl("style:footer"); + endEl(u"style:footer"_ustr); } /* Will be the default. */ else if (pPage->footer_odd) { - startEl("style:footer"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:footer"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) @@ -1196,12 +1196,12 @@ void HwpReader::makeMasterStyles() d->pPn = nullptr; d->nPnPos = 0; } - endEl("text:p"); - endEl("style:footer"); + endEl(u"text:p"_ustr); + endEl(u"style:footer"_ustr); } if( pPage->footer_odd ) { - startEl("style:footer-left"); + startEl(u"style:footer-left"_ustr); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1214,14 +1214,14 @@ void HwpReader::makeMasterStyles() d->bInHeader = false; d->pPn = nullptr; d->nPnPos = 0; - endEl("style:footer-left"); + endEl(u"style:footer-left"_ustr); } /* Will be the default. */ else if (pPage->footer_even) { - startEl("style:footer-left"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:footer-left"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) @@ -1232,14 +1232,14 @@ void HwpReader::makeMasterStyles() d->pPn = nullptr; d->nPnPos = 0; } - endEl("text:p"); - endEl("style:footer-left"); + endEl(u"text:p"_ustr); + endEl(u"style:footer-left"_ustr); } if( !pPage->footer && !pPage->footer_even && !pPage->footer_odd ) { - startEl("style:footer"); - mxList->addAttribute("text:style-name", sXML_CDATA, "Standard"); - startEl("text:p"); + startEl(u"style:footer"_ustr); + mxList->addAttribute(u"text:style-name"_ustr, sXML_CDATA, u"Standard"_ustr); + startEl(u"text:p"_ustr); mxList->clear(); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) @@ -1248,13 +1248,13 @@ void HwpReader::makeMasterStyles() makeShowPageNum(); d->pPn = nullptr; } - endEl("text:p"); - endEl("style:footer"); + endEl(u"text:p"_ustr); + endEl(u"style:footer"_ustr); } - endEl("style:master-page"); + endEl(u"style:master-page"_ustr); } - endEl("office:master-styles"); + endEl(u"office:master-styles"_ustr); } @@ -1269,63 +1269,63 @@ void HwpReader::parseCharShape(CharShape const * cshape) { HWPFont& hwpfont = hwpfile.GetHWPFont(); - mxList->addAttribute("fo:font-size", sXML_CDATA, OUString::number(cshape->size / 25) + "pt"); - mxList->addAttribute("style:font-size-asian", sXML_CDATA, OUString::number(cshape->size / 25) + "pt"); + mxList->addAttribute(u"fo:font-size"_ustr, sXML_CDATA, OUString::number(cshape->size / 25) + "pt"); + mxList->addAttribute(u"style:font-size-asian"_ustr, sXML_CDATA, OUString::number(cshape->size / 25) + "pt"); ::std::string const tmp = hstr2ksstr(kstr2hstr( reinterpret_cast<unsigned char const *>(hwpfont.GetFontName(0, cshape->font))).c_str()); double fRatio = 1.0; int size = getRepFamilyName(tmp.c_str(), d->buf, fRatio); - mxList->addAttribute("fo:font-family", sXML_CDATA, + mxList->addAttribute(u"fo:font-family"_ustr, sXML_CDATA, OUString(d->buf, size, RTL_TEXTENCODING_EUC_KR)); - mxList->addAttribute("style:font-family-asian", sXML_CDATA, + mxList->addAttribute(u"style:font-family-asian"_ustr, sXML_CDATA, OUString(d->buf, size, RTL_TEXTENCODING_EUC_KR)); - mxList->addAttribute("style:text-scale", sXML_CDATA, + mxList->addAttribute(u"style:text-scale"_ustr, sXML_CDATA, OUString::number(static_cast<int>(cshape->ratio * fRatio)) + "%"); double sspace = (cshape->size / 25) * cshape->space / 100.; if (sspace != 0.) { - mxList->addAttribute("fo:letter-spacing", sXML_CDATA, + mxList->addAttribute(u"fo:letter-spacing"_ustr, sXML_CDATA, OUString::number(sspace) + "pt"); } if (cshape->color[1] != 0) - mxList->addAttribute("fo:color", sXML_CDATA, + mxList->addAttribute(u"fo:color"_ustr, sXML_CDATA, hcolor2str(cshape->color[1], 100, true)); if (cshape->shade != 0) - mxList->addAttribute("style:text-background-color", sXML_CDATA, + mxList->addAttribute(u"style:text-background-color"_ustr, sXML_CDATA, hcolor2str(cshape->color[0], cshape->shade)); if (cshape->attr & 0x01) { - mxList->addAttribute("fo:font-style", sXML_CDATA, "italic"); - mxList->addAttribute("style:font-style-asian", sXML_CDATA, "italic"); + mxList->addAttribute(u"fo:font-style"_ustr, sXML_CDATA, u"italic"_ustr); + mxList->addAttribute(u"style:font-style-asian"_ustr, sXML_CDATA, u"italic"_ustr); } else{ - mxList->addAttribute("fo:font-style", sXML_CDATA, "normal"); - mxList->addAttribute("style:font-style-asian", sXML_CDATA, "normal"); + mxList->addAttribute(u"fo:font-style"_ustr, sXML_CDATA, u"normal"_ustr); + mxList->addAttribute(u"style:font-style-asian"_ustr, sXML_CDATA, u"normal"_ustr); } if (cshape->attr >> 1 & 0x01) { - mxList->addAttribute("fo:font-weight", sXML_CDATA, "bold"); - mxList->addAttribute("style:font-weight-asian", sXML_CDATA, "bold"); + mxList->addAttribute(u"fo:font-weight"_ustr, sXML_CDATA, u"bold"_ustr); + mxList->addAttribute(u"style:font-weight-asian"_ustr, sXML_CDATA, u"bold"_ustr); } else{ - mxList->addAttribute("fo:font-weight", sXML_CDATA, "normal"); - mxList->addAttribute("style:font-weight-asian", sXML_CDATA, "normal"); + mxList->addAttribute(u"fo:font-weight"_ustr, sXML_CDATA, u"normal"_ustr); + mxList->addAttribute(u"style:font-weight-asian"_ustr, sXML_CDATA, u"normal"_ustr); } if (cshape->attr >> 2 & 0x01) - mxList->addAttribute("style:text-underline", sXML_CDATA, "single"); + mxList->addAttribute(u"style:text-underline"_ustr, sXML_CDATA, u"single"_ustr); if (cshape->attr >> 3 & 0x01) - mxList->addAttribute("style:text-outline", sXML_CDATA, "true"); + mxList->addAttribute(u"style:text-outline"_ustr, sXML_CDATA, u"true"_ustr); if (cshape->attr >> 4 & 0x01) - mxList->addAttribute("fo:text-shadow", sXML_CDATA, "1pt 1pt"); + mxList->addAttribute(u"fo:text-shadow"_ustr, sXML_CDATA, u"1pt 1pt"_ustr); if (cshape->attr >> 5 & 0x01) - mxList->addAttribute("style:text-position", sXML_CDATA, "super 58%"); + mxList->addAttribute(u"style:text-position"_ustr, sXML_CDATA, u"super 58%"_ustr); if (cshape->attr >> 6 & 0x01) - mxList->addAttribute("style:text-position", sXML_CDATA, "sub 58%"); + mxList->addAttribute(u"style:text-position"_ustr, sXML_CDATA, u"sub 58%"_ustr); } @@ -1341,22 +1341,22 @@ void HwpReader::parseParaShape(ParaShape const * pshape) { if (pshape->left_margin != 0) - mxList->addAttribute("fo:margin-left", sXML_CDATA, OUString::number + mxList->addAttribute(u"fo:margin-left"_ustr, sXML_CDATA, OUString::number (WTI(pshape->left_margin )) + "inch"); if (pshape->right_margin != 0) - mxList->addAttribute("fo:margin-right", sXML_CDATA, OUString::number + mxList->addAttribute(u"fo:margin-right"_ustr, sXML_CDATA, OUString::number (WTI(pshape->right_margin)) + "inch"); if (pshape->pspacing_prev != 0) - mxList->addAttribute("fo:margin-top", sXML_CDATA, OUString::number + mxList->addAttribute(u"fo:margin-top"_ustr, sXML_CDATA, OUString::number (WTI(pshape->pspacing_prev)) + "inch"); if (pshape->pspacing_next != 0) - mxList->addAttribute("fo:margin-bottom", sXML_CDATA, OUString::number + mxList->addAttribute(u"fo:margin-bottom"_ustr, sXML_CDATA, OUString::number (WTI(pshape->pspacing_next)) + "inch"); if (pshape->indent != 0) - mxList->addAttribute("fo:text-indent", sXML_CDATA, OUString::number + mxList->addAttribute(u"fo:text-indent"_ustr, sXML_CDATA, OUString::number (WTI(pshape->indent)) + "inch"); if (pshape->lspacing != 0) - mxList->addAttribute("fo:line-height", sXML_CDATA, OUString::number(pshape->lspacing) + "%"); + mxList->addAttribute(u"fo:line-height"_ustr, sXML_CDATA, OUString::number(pshape->lspacing) + "%"); const char* align = nullptr; @@ -1379,20 +1379,20 @@ void HwpReader::parseParaShape(ParaShape const * pshape) } if (align) - mxList->addAttribute("fo:text-align", sXML_CDATA, OUString::createFromAscii(align)); + mxList->addAttribute(u"fo:text-align"_ustr, sXML_CDATA, OUString::createFromAscii(align)); if (pshape->outline) - mxList->addAttribute("fo:border", sXML_CDATA, "0.002cm solid #000000"); + mxList->addAttribute(u"fo:border"_ustr, sXML_CDATA, u"0.002cm solid #000000"_ustr); if( pshape->shade > 0 ) { - mxList->addAttribute("fo:background-color", sXML_CDATA, + mxList->addAttribute(u"fo:background-color"_ustr, sXML_CDATA, hcolor2str(0, pshape->shade)); } if( pshape->pagebreak & 0x02 || pshape->pagebreak & 0x04) - mxList->addAttribute("fo:break-before", sXML_CDATA, "page"); + mxList->addAttribute(u"fo:break-before"_ustr, sXML_CDATA, u"page"_ustr); else if( pshape->pagebreak & 0x01 ) - mxList->addAttribute("fo:break-before", sXML_CDATA, "column"); + mxList->addAttribute(u"fo:break-before"_ustr, sXML_CDATA, u"column"_ustr); } @@ -1403,20 +1403,20 @@ void HwpReader::parseParaShape(ParaShape const * pshape) void HwpReader::makePStyle(ParaShape const * pshape) { int nscount = pshape->tabs[MAXTABS -1].type; - mxList->addAttribute("style:name", sXML_CDATA, "P" + OUString::number(pshape->index)); - mxList->addAttribute("style:family", sXML_CDATA, "paragraph"); - startEl("style:style"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "P" + OUString::number(pshape->index)); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA, u"paragraph"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); parseParaShape(pshape); if (pshape->cshape) parseCharShape(pshape->cshape.get()); - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); if( nscount ) { unsigned char tf = 0; - startEl("style:tab-stops"); + startEl(u"style:tab-stops"_ustr); int tab_margin = pshape->left_margin + pshape->indent; if( tab_margin < 0 ) @@ -1427,7 +1427,7 @@ void HwpReader::makePStyle(ParaShape const * pshape) break; if( pshape->tabs[i].position <= tab_margin ) continue; - mxList->addAttribute("style:position", sXML_CDATA, + mxList->addAttribute(u"style:position"_ustr, sXML_CDATA, OUString::number(WTMM(pshape->tabs[i].position - tab_margin )) + "mm"); if( pshape->tabs[i].type ) { @@ -1435,35 +1435,35 @@ void HwpReader::makePStyle(ParaShape const * pshape) switch(pshape->tabs[i].type) { case 1 : - mxList->addAttribute("style:type", sXML_CDATA, "right"); + mxList->addAttribute(u"style:type"_ustr, sXML_CDATA, u"right"_ustr); break; case 2: - mxList->addAttribute("style:type", sXML_CDATA, "center"); + mxList->addAttribute(u"style:type"_ustr, sXML_CDATA, u"center"_ustr); break; case 3: - mxList->addAttribute("style:type", sXML_CDATA, "char"); - mxList->addAttribute("style:char", sXML_CDATA, "."); + mxList->addAttribute(u"style:type"_ustr, sXML_CDATA, u"char"_ustr); + mxList->addAttribute(u"style:char"_ustr, sXML_CDATA, u"."_ustr); break; } } if( pshape->tabs[i].dot_continue ) { tf = 1; - mxList->addAttribute("style:leader-char", sXML_CDATA, "."); + mxList->addAttribute(u"style:leader-char"_ustr, sXML_CDATA, u"."_ustr); } - startEl("style:tab-stop"); + startEl(u"style:tab-stop"_ustr); mxList->clear(); - endEl("style:tab-stop"); + endEl(u"style:tab-stop"_ustr); if( (pshape->tabs[i].position != 1000 * i ) || tf ) { if( !--nscount ) break; } } - endEl("style:tab-stops"); + endEl(u"style:tab-stops"_ustr); } - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); } @@ -1483,8 +1483,8 @@ void HwpReader::makePageStyle() } for( int i = 0 ; i < pmCount ; i++ ){ - mxList->addAttribute("style:name", sXML_CDATA, "pm" + OUString::number(i + 1)); - startEl("style:page-master"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "pm" + OUString::number(i + 1)); + startEl(u"style:page-master"_ustr); mxList->clear(); @@ -1493,73 +1493,73 @@ void HwpReader::makePageStyle() case 3: // A4 if( hwpinfo.paper.paper_direction ) { - mxList->addAttribute("fo:page-height",sXML_CDATA, "210mm"); - mxList->addAttribute("fo:page-width",sXML_CDATA, "297mm"); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"210mm"_ustr); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"297mm"_ustr); } else { - mxList->addAttribute("fo:page-width",sXML_CDATA, "210mm"); - mxList->addAttribute("fo:page-height",sXML_CDATA, "297mm"); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"210mm"_ustr); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"297mm"_ustr); } break; case 4: // 80 column if( hwpinfo.paper.paper_direction ) { - mxList->addAttribute("fo:page-height",sXML_CDATA, "8.5inch"); - mxList->addAttribute("fo:page-width",sXML_CDATA, "11inch"); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"8.5inch"_ustr); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"11inch"_ustr); } else { - mxList->addAttribute("fo:page-width",sXML_CDATA, "8.5inch"); - mxList->addAttribute("fo:page-height",sXML_CDATA, "11inch"); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"8.5inch"_ustr); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"11inch"_ustr); } break; case 5: // B5 if( hwpinfo.paper.paper_direction ) { - mxList->addAttribute("fo:page-height",sXML_CDATA, "176mm"); - mxList->addAttribute("fo:page-width",sXML_CDATA, "250mm"); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"176mm"_ustr); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"250mm"_ustr); } else { - mxList->addAttribute("fo:page-width",sXML_CDATA, "176mm"); - mxList->addAttribute("fo:page-height",sXML_CDATA, "250mm"); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"176mm"_ustr); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"250mm"_ustr); } break; case 6: // B4 if( hwpinfo.paper.paper_direction ) { - mxList->addAttribute("fo:page-height",sXML_CDATA, "250mm"); - mxList->addAttribute("fo:page-width",sXML_CDATA, "353mm"); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"250mm"_ustr); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"353mm"_ustr); } else { - mxList->addAttribute("fo:page-width",sXML_CDATA, "250mm"); - mxList->addAttribute("fo:page-height",sXML_CDATA, "353mm"); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"250mm"_ustr); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"353mm"_ustr); } break; case 7: if( hwpinfo.paper.paper_direction ) { - mxList->addAttribute("fo:page-height",sXML_CDATA, "8.5inch"); - mxList->addAttribute("fo:page-width",sXML_CDATA, "14inch"); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"8.5inch"_ustr); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"14inch"_ustr); } else { - mxList->addAttribute("fo:page-width",sXML_CDATA, "8.5inch"); - mxList->addAttribute("fo:page-height",sXML_CDATA, "14inch"); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"8.5inch"_ustr); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"14inch"_ustr); } break; case 8: if( hwpinfo.paper.paper_direction ) { - mxList->addAttribute("fo:page-height",sXML_CDATA, "297mm"); - mxList->addAttribute("fo:page-width",sXML_CDATA, "420mm"); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"297mm"_ustr); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"420mm"_ustr); } else { - mxList->addAttribute("fo:page-width",sXML_CDATA, "297mm"); - mxList->addAttribute("fo:page-height",sXML_CDATA, "420mm"); + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, u"297mm"_ustr); + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, u"420mm"_ustr); } break; case 0: @@ -1568,72 +1568,72 @@ void HwpReader::makePageStyle() default: if( hwpinfo.paper.paper_direction ) { - mxList->addAttribute("fo:page-width",sXML_CDATA, + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.paper_height)) + "inch"); - mxList->addAttribute("fo:page-height",sXML_CDATA, + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.paper_width)) + "inch"); } else { - mxList->addAttribute("fo:page-width",sXML_CDATA, + mxList->addAttribute(u"fo:page-width"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.paper_width)) + "inch"); - mxList->addAttribute("fo:page-height",sXML_CDATA, + mxList->addAttribute(u"fo:page-height"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.paper_height)) + "inch"); } break; } - mxList->addAttribute("style:print-orientation",sXML_CDATA, + mxList->addAttribute(u"style:print-orientation"_ustr,sXML_CDATA, OUString::createFromAscii(hwpinfo.paper.paper_direction ? "landscape" : "portrait")); if( hwpinfo.beginpagenum != 1) - mxList->addAttribute("style:first-page-number",sXML_CDATA, OUString::number(hwpinfo.beginpagenum)); + mxList->addAttribute(u"style:first-page-number"_ustr,sXML_CDATA, OUString::number(hwpinfo.beginpagenum)); if( hwpinfo.borderline ){ - mxList->addAttribute("fo:margin-left",sXML_CDATA, + mxList->addAttribute(u"fo:margin-left"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.left_margin - hwpinfo.bordermargin[0] + hwpinfo.paper.gutter_length)) + "inch"); - mxList->addAttribute("fo:margin-right",sXML_CDATA, + mxList->addAttribute(u"fo:margin-right"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.right_margin - hwpinfo.bordermargin[1])) + "inch"); - mxList->addAttribute("fo:margin-top",sXML_CDATA, + mxList->addAttribute(u"fo:margin-top"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.top_margin - hwpinfo.bordermargin[2])) + "inch"); - mxList->addAttribute("fo:margin-bottom",sXML_CDATA, + mxList->addAttribute(u"fo:margin-bottom"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.bottom_margin - hwpinfo.bordermargin[3])) + "inch"); } else{ - mxList->addAttribute("fo:margin-left",sXML_CDATA, + mxList->addAttribute(u"fo:margin-left"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.left_margin + hwpinfo.paper.gutter_length)) + "inch"); - mxList->addAttribute("fo:margin-right",sXML_CDATA, + mxList->addAttribute(u"fo:margin-right"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.right_margin)) + "inch"); - mxList->addAttribute("fo:margin-top",sXML_CDATA, + mxList->addAttribute(u"fo:margin-top"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.top_margin)) + "inch"); - mxList->addAttribute("fo:margin-bottom",sXML_CDATA, + mxList->addAttribute(u"fo:margin-bottom"_ustr,sXML_CDATA, OUString::number(WTI(hwpinfo.paper.bottom_margin)) + "inch"); } switch( hwpinfo.borderline ) { case 1: - mxList->addAttribute("fo:border", sXML_CDATA,"0.002cm solid #000000"); + mxList->addAttribute(u"fo:border"_ustr, sXML_CDATA,u"0.002cm solid #000000"_ustr); break; case 3: - mxList->addAttribute("fo:border", sXML_CDATA,"0.002cm dotted #000000"); + mxList->addAttribute(u"fo:border"_ustr, sXML_CDATA,u"0.002cm dotted #000000"_ustr); break; case 2: - mxList->addAttribute("fo:border", sXML_CDATA,"0.035cm solid #000000"); + mxList->addAttribute(u"fo:border"_ustr, sXML_CDATA,u"0.035cm solid #000000"_ustr); break; case 4: - mxList->addAttribute("style:border-line-width", sXML_CDATA,"0.002cm 0.035cm 0.002cm"); - mxList->addAttribute("fo:border", sXML_CDATA,"0.039cm double #000000"); + mxList->addAttribute(u"style:border-line-width"_ustr, sXML_CDATA,u"0.002cm 0.035cm 0.002cm"_ustr); + mxList->addAttribute(u"fo:border"_ustr, sXML_CDATA,u"0.039cm double #000000"_ustr); break; } - mxList->addAttribute("fo:padding-left", sXML_CDATA, + mxList->addAttribute(u"fo:padding-left"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.bordermargin[0])) + "inch"); - mxList->addAttribute("fo:padding-right", sXML_CDATA, + mxList->addAttribute(u"fo:padding-right"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.bordermargin[1])) + "inch"); - mxList->addAttribute("fo:padding-top", sXML_CDATA, + mxList->addAttribute(u"fo:padding-top"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.bordermargin[2])) + "inch"); - mxList->addAttribute("fo:padding-bottom", sXML_CDATA, + mxList->addAttribute(u"fo:padding-bottom"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.bordermargin[3])) + "inch"); /* background color */ @@ -1641,14 +1641,14 @@ void HwpReader::makePageStyle() { if( hwpinfo.back_info.color[0] > 0 || hwpinfo.back_info.color[1] > 0 || hwpinfo.back_info.color[2] > 0 ){ - mxList->addAttribute("fo:background-color", sXML_CDATA, + mxList->addAttribute(u"fo:background-color"_ustr, sXML_CDATA, rgb2str(hwpinfo.back_info.color[0], hwpinfo.back_info.color[1], hwpinfo.back_info.color[2])); } } - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); /* background image */ @@ -1659,144 +1659,144 @@ void HwpReader::makePageStyle() mxList->addAttribute("xlink:href", sXML_CDATA, hstr2OUString(kstr2hstr(reinterpret_cast<uchar const *>(urltowin(hwpinfo.back_info.filename).c_str())).c_str())); #else - mxList->addAttribute("xlink:href", sXML_CDATA, + mxList->addAttribute(u"xlink:href"_ustr, sXML_CDATA, hstr2OUString(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(hwpinfo.back_info.filename).c_str())).c_str())); #endif - mxList->addAttribute("xlink:type", sXML_CDATA, "simple"); - mxList->addAttribute("xlink:actuate", sXML_CDATA, "onLoad"); + mxList->addAttribute(u"xlink:type"_ustr, sXML_CDATA, u"simple"_ustr); + mxList->addAttribute(u"xlink:actuate"_ustr, sXML_CDATA, u"onLoad"_ustr); } if( hwpinfo.back_info.flag >= 2) - mxList->addAttribute("style:repeat", sXML_CDATA, "stretch"); + mxList->addAttribute(u"style:repeat"_ustr, sXML_CDATA, u"stretch"_ustr); else if( hwpinfo.back_info.flag == 1 ){ - mxList->addAttribute("style:repeat", sXML_CDATA, "no-repeat"); - mxList->addAttribute("style:position", sXML_CDATA, "center"); + mxList->addAttribute(u"style:repeat"_ustr, sXML_CDATA, u"no-repeat"_ustr); + mxList->addAttribute(u"style:position"_ustr, sXML_CDATA, u"center"_ustr); } - startEl("style:background-image"); + startEl(u"style:background-image"_ustr); if( hwpinfo.back_info.type == 2 ){ - startEl("office:binary-data"); + startEl(u"office:binary-data"_ustr); mxList->clear(); chars(base64_encode_string(reinterpret_cast<unsigned char*>(hwpinfo.back_info.data.data()), hwpinfo.back_info.size)); - endEl("office:binary-data"); + endEl(u"office:binary-data"_ustr); } - endEl("style:background-image"); + endEl(u"style:background-image"_ustr); } makeColumns( hwpfile.GetColumnDef(i) ); - endEl("style:properties"); + endEl(u"style:properties"_ustr); /* header style */ - startEl("style:header-style"); - mxList->addAttribute("svg:height", sXML_CDATA, + startEl(u"style:header-style"_ustr); + mxList->addAttribute(u"svg:height"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.paper.header_length)) + "inch"); - mxList->addAttribute("fo:margin-bottom", sXML_CDATA, "0mm"); + mxList->addAttribute(u"fo:margin-bottom"_ustr, sXML_CDATA, u"0mm"_ustr); - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:header-style"); + endEl(u"style:properties"_ustr); + endEl(u"style:header-style"_ustr); /* footer style */ - startEl("style:footer-style"); - mxList->addAttribute("svg:height", sXML_CDATA, + startEl(u"style:footer-style"_ustr); + mxList->addAttribute(u"svg:height"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.paper.footer_length)) + "inch"); - mxList->addAttribute("fo:margin-top", sXML_CDATA, "0mm"); - startEl("style:properties"); + mxList->addAttribute(u"fo:margin-top"_ustr, sXML_CDATA, u"0mm"_ustr); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:footer-style"); + endEl(u"style:properties"_ustr); + endEl(u"style:footer-style"_ustr); /* Footnote style */ - startEl("style:page-layout-properties"); + startEl(u"style:page-layout-properties"_ustr); - mxList->addAttribute("style:distance-before-sep", sXML_CDATA, + mxList->addAttribute(u"style:distance-before-sep"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.splinetext)) + "inch"); - mxList->addAttribute("style:distance-after-sep", sXML_CDATA, + mxList->addAttribute(u"style:distance-after-sep"_ustr, sXML_CDATA, OUString::number(WTI(hwpinfo.splinefn)) + "inch"); - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); + endEl(u"style:properties"_ustr); if ( hwpinfo.fnlinetype == 2 ) - mxList->addAttribute("style:width", sXML_CDATA, "15cm"); + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, u"15cm"_ustr); else if ( hwpinfo.fnlinetype == 1) - mxList->addAttribute("style:width", sXML_CDATA, "2cm"); + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, u"2cm"_ustr); else if ( hwpinfo.fnlinetype == 3) - mxList->addAttribute("style:width", sXML_CDATA, "0cm"); + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, u"0cm"_ustr); else - mxList->addAttribute("style:width", sXML_CDATA, "5cm"); + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, u"5cm"_ustr); - startEl("style:footnote-sep"); + startEl(u"style:footnote-sep"_ustr); mxList->clear(); - endEl("style:footnote-sep"); + endEl(u"style:footnote-sep"_ustr); - endEl("style:page-layout-properties"); + endEl(u"style:page-layout-properties"_ustr); - endEl("style:page-master"); + endEl(u"style:page-master"_ustr); } } void HwpReader::makeColumns(ColumnDef const *coldef) { if( !coldef ) return; - mxList->addAttribute("fo:column-count", sXML_CDATA, OUString::number(coldef->ncols)); - startEl("style:columns"); + mxList->addAttribute(u"fo:column-count"_ustr, sXML_CDATA, OUString::number(coldef->ncols)); + startEl(u"style:columns"_ustr); mxList->clear(); if( coldef->separator != 0 ) { switch( coldef->separator ) { case 1: /* thin line */ - mxList->addAttribute("style:width", sXML_CDATA, "0.02mm"); + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, u"0.02mm"_ustr); [[fallthrough]]; case 3: /* dotted line */ - mxList->addAttribute("style:style", sXML_CDATA, "dotted"); - mxList->addAttribute("style:width", sXML_CDATA, "0.02mm"); + mxList->addAttribute(u"style:style"_ustr, sXML_CDATA, u"dotted"_ustr); + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, u"0.02mm"_ustr); break; case 2: /* thick line */ case 4: /* double line */ - mxList->addAttribute("style:width", sXML_CDATA, "0.35mm"); + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, u"0.35mm"_ustr); break; case 0: /* None */ default: - mxList->addAttribute("style:style", sXML_CDATA, "none"); + mxList->addAttribute(u"style:style"_ustr, sXML_CDATA, u"none"_ustr); break; } - startEl("style:column-sep"); + startEl(u"style:column-sep"_ustr); mxList->clear(); - endEl("style:column-sep"); + endEl(u"style:column-sep"_ustr); } double spacing = WTI(coldef->spacing)/ 2. ; for(int ii = 0 ; ii < coldef->ncols ; ii++) { if( ii == 0 ) - mxList->addAttribute("fo:margin-left", sXML_CDATA, "0mm"); + mxList->addAttribute(u"fo:margin-left"_ustr, sXML_CDATA, u"0mm"_ustr); else - mxList->addAttribute("fo:margin-left", sXML_CDATA, + mxList->addAttribute(u"fo:margin-left"_ustr, sXML_CDATA, OUString::number( spacing) + "inch"); if( ii == ( coldef->ncols -1) ) - mxList->addAttribute("fo:margin-right", sXML_CDATA,"0mm"); + mxList->addAttribute(u"fo:margin-right"_ustr, sXML_CDATA,u"0mm"_ustr); else - mxList->addAttribute("fo:margin-right", sXML_CDATA, + mxList->addAttribute(u"fo:margin-right"_ustr, sXML_CDATA, OUString::number( spacing) + "inch"); - startEl("style:column"); + startEl(u"style:column"_ustr); mxList->clear(); - endEl("style:column"); + endEl(u"style:column"_ustr); } - endEl("style:columns"); + endEl(u"style:columns"_ustr); } void HwpReader::makeTStyle(CharShape const * cshape) { - mxList->addAttribute("style:name", sXML_CDATA, "T" + OUString::number(cshape->index)); - mxList->addAttribute("style:family", sXML_CDATA, "text"); - startEl("style:style"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "T" + OUString::number(cshape->index)); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA, u"text"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); parseCharShape(cshape); - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); } @@ -1805,68 +1805,68 @@ void HwpReader::makeTableStyle(Table *tbl) // table TxtBox *hbox = tbl->box; - mxList->addAttribute("style:name", sXML_CDATA, "Table" + OUString::number(hbox->style.boxnum)); - mxList->addAttribute("style:family", sXML_CDATA,"table"); - startEl("style:style"); + mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "Table" + OUString::number(hbox->style.boxnum)); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA,u"table"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - mxList->addAttribute("style:width", sXML_CDATA, + mxList->addAttribute(u"style:width"_ustr, sXML_CDATA, OUString::number(WTMM(hbox->box_xs)) + "mm"); - mxList->addAttribute("table:align", sXML_CDATA,"left"); - mxList->addAttribute("fo:keep-with-next", sXML_CDATA,"false"); - startEl("style:properties"); + mxList->addAttribute(u"table:align"_ustr, sXML_CDATA,u"left"_ustr); + mxList->addAttribute(u"fo:keep-with-next"_ustr, sXML_CDATA,u"false"_ustr); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); // column for (size_t i = 0 ; i < tbl->columns.nCount -1 ; i++) { mxList->addAttribute( - "style:name", sXML_CDATA, + u"style:name"_ustr, sXML_CDATA, "Table" + OUString::number(hbox->style.boxnum) + "." + OUStringChar(static_cast<char>('A'+i))); - mxList->addAttribute("style:family", sXML_CDATA,"table-column"); - startEl("style:style"); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA,u"table-column"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - mxList->addAttribute("style:column-width", sXML_CDATA, + mxList->addAttribute(u"style:column-width"_ustr, sXML_CDATA, OUString::number(WTMM(tbl->columns.data[i+1] - tbl->columns.data[i])) + "mm"); - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); } // row for (size_t i = 0 ; i < tbl->rows.nCount -1 ; i++) { mxList->addAttribute( - "style:name", sXML_CDATA, + u"style:name"_ustr, sXML_CDATA, "Table" + OUString::number(hbox->style.boxnum) + ".row" + OUString::number(i + 1)); - mxList->addAttribute("style:family", sXML_CDATA,"table-row"); - startEl("style:style"); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA,u"table-row"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); - mxList->addAttribute("style:row-height", sXML_CDATA, + mxList->addAttribute(u"style:row-height"_ustr, sXML_CDATA, OUString::number(WTMM(tbl->rows.data[i+1] - tbl->rows.data[i])) + "mm"); - startEl("style:properties"); + startEl(u"style:properties"_ustr); mxList->clear(); - endEl("style:properties"); - endEl("style:style"); + endEl(u"style:properties"_ustr); + endEl(u"style:style"_ustr); } // cell for (auto const& tcell : tbl->cells) { mxList->addAttribute( - "style:name", sXML_CDATA, + u"style:name"_ustr, sXML_CDATA, "Table" + OUString::number(hbox->style.boxnum) + "." + OUStringChar(char('A'+ tcell->nColumnIndex)) + OUString::number(tcell->nRowIndex +1)); - mxList->addAttribute("style:family", sXML_CDATA,"table-cell"); - startEl("style:style"); + mxList->addAttribute(u"style:family"_ustr, sXML_CDATA,u"table-cell"_ustr); + startEl(u"style:style"_ustr); mxList->clear(); Cell *cl = tcell->pCell; if( cl->ver_align == 1 ) - mxList->addAttribute("fo:vertical-align", sXML_CDATA,"middle"); -e ... etc. - the rest is truncated
