diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 12:01:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 14:22:26 +0200 |
commit | 0bab51d8ad35a31685002118cdac20657b57137a (patch) | |
tree | 922baa224e9456ae453619ef27f146631d8d3afb | |
parent | ab8958d8557fde1a73289324bd3eb264846e0c46 (diff) |
use rtl::Reference in HwpReader
instead of storing both a raw pointer and an uno::Reference
Change-Id: I02dd356d9693116f98ad2b96951570b3ba448b14
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 652 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.hxx | 3 |
2 files changed, 326 insertions, 329 deletions
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 02348731913b..f353bd7ea6ef 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -42,7 +42,7 @@ #define rstartEl(x,y) do { if (m_rxDocumentHandler.is()) m_rxDocumentHandler->startElement(x,y); } while(false) #define rendEl(x) do { if (m_rxDocumentHandler.is()) m_rxDocumentHandler->endElement(x); } while(false) #define rchars(x) do { if (m_rxDocumentHandler.is()) m_rxDocumentHandler->characters(x); } while(false) -#define padd(x,y,z) pList->addAttribute(x,y,z) +#define padd(x,y,z) mxList->addAttribute(x,y,z) #define Double2Str(x) OUString::number((double)(x)) #define WTI(x) ((double)(x) / 1800.) // unit => inch #define WTMM(x) ((double)(x) / 1800. * 25.4) // unit => mm @@ -54,14 +54,14 @@ #define sXML_CDATA "CDATA" #define STARTP padd( "text:style-name", "CDATA", ascii(getPStyleName(((ParaShape &)para->GetParaShape()).index,buf))); \ - rstartEl( "text:p",rList ); \ - pList->clear(); \ + rstartEl( "text:p",mxList.get() ); \ + mxList->clear(); \ pstart = true #define STARTT \ curr = para->GetCharShape(n > 0 ? n-1 : 0)->index; \ padd( "text:style-name", "CDATA" , ascii( getTStyleName(curr, buf) ) ); \ - rstartEl( "text:span",rList ); \ - pList->clear(); \ + rstartEl( "text:span",mxList.get() ); \ + mxList->clear(); \ tstart = true #define ENDP \ rendEl("text:p"); \ @@ -107,15 +107,13 @@ struct HwpReaderPrivate HwpReader::HwpReader() { - pList = new AttributeListImpl; - rList = static_cast<XAttributeList *>(pList); + mxList = new AttributeListImpl; d = new HwpReaderPrivate; } HwpReader::~HwpReader() { - rList = nullptr; delete d; } @@ -188,8 +186,8 @@ sal_Bool HwpReader::filter(const Sequence< PropertyValue >& rDescriptor) throw(R padd("xmlns:form", "CDATA", "http://openoffice.org/2000/form"); padd("xmlns:script", "CDATA", "http://openoffice.org/2000/script"); - rstartEl("office:document", rList); - pList->clear(); + rstartEl("office:document", mxList.get()); + mxList->clear(); makeMeta(); makeStyles(); @@ -210,7 +208,7 @@ sal_Bool HwpReader::filter(const Sequence< PropertyValue >& rDescriptor) throw(R */ void HwpReader::makeBody() { - rstartEl("office:body", rList); + rstartEl("office:body", mxList.get()); makeTextDecls(); HWPPara *hwppara = hwpfile.GetFirstPara(); d->bInBody = true; @@ -225,26 +223,26 @@ void HwpReader::makeBody() */ void HwpReader::makeTextDecls() { - rstartEl("text:sequence-decls", rList); + rstartEl("text:sequence-decls", mxList.get()); padd("text:display-outline-level", sXML_CDATA, "0"); padd("text:name", sXML_CDATA, "Illustration"); - rstartEl("text:sequence-decl", rList); - pList->clear(); + rstartEl("text:sequence-decl", mxList.get()); + mxList->clear(); rendEl("text:sequence-decl"); padd("text:display-outline-level", sXML_CDATA, "0"); padd("text:name", sXML_CDATA, "Table"); - rstartEl("text:sequence-decl", rList); - pList->clear(); + rstartEl("text:sequence-decl", mxList.get()); + mxList->clear(); rendEl("text:sequence-decl"); padd("text:display-outline-level", sXML_CDATA, "0"); padd("text:name", sXML_CDATA, "Text"); - rstartEl("text:sequence-decl", rList); - pList->clear(); + rstartEl("text:sequence-decl", mxList.get()); + mxList->clear(); rendEl("text:sequence-decl"); padd("text:display-outline-level", sXML_CDATA, "0"); padd("text:name", sXML_CDATA, "Drawing"); - rstartEl("text:sequence-decl", rList); - pList->clear(); + rstartEl("text:sequence-decl", mxList.get()); + mxList->clear(); rendEl("text:sequence-decl"); rendEl("text:sequence-decls"); } @@ -259,25 +257,25 @@ void HwpReader::makeMeta() { HWPInfo& hwpinfo = hwpfile.GetHWPInfo(); - rstartEl("office:meta", rList); + rstartEl("office:meta", mxList.get()); if (hwpinfo.summary.title[0]) { - rstartEl("dc:title", rList); + rstartEl("dc:title", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.title))); rendEl("dc:title"); } if (hwpinfo.summary.subject[0]) { - rstartEl("dc:subject", rList); + rstartEl("dc:subject", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.subject))); rendEl("dc:subject"); } if (hwpinfo.summary.author[0]) { - rstartEl("meta:initial-creator", rList); + rstartEl("meta:initial-creator", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.author))); rendEl("meta:initial-creator"); } @@ -341,41 +339,41 @@ void HwpReader::makeMeta() } sprintf(buf,"%d-%02d-%02dT%02d:%02d:00",year,month,day,hour,minute); - rstartEl( "meta:creation-date", rList ); + rstartEl( "meta:creation-date", mxList.get() ); rchars( ascii(buf)); rendEl( "meta:creation-date" ); } if (hwpinfo.summary.keyword[0][0] || hwpinfo.summary.etc[0][0]) { - rstartEl("meta:keywords", rList); + rstartEl("meta:keywords", mxList.get()); if (hwpinfo.summary.keyword[0][0]) { - rstartEl("meta:keyword", rList); + rstartEl("meta:keyword", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.keyword[0]))); rendEl("meta:keyword"); } if (hwpinfo.summary.keyword[1][0]) { - rstartEl("meta:keyword", rList); + rstartEl("meta:keyword", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.keyword[1]))); rendEl("meta:keyword"); } if (hwpinfo.summary.etc[0][0]) { - rstartEl("meta:keyword", rList); + rstartEl("meta:keyword", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.etc[0]))); rendEl("meta:keyword"); } if (hwpinfo.summary.etc[1][0]) { - rstartEl("meta:keyword", rList); + rstartEl("meta:keyword", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.etc[1]))); rendEl("meta:keyword"); } if (hwpinfo.summary.etc[2][0]) { - rstartEl("meta:keyword", rList); + rstartEl("meta:keyword", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(hwpinfo.summary.etc[2]))); rendEl("meta:keyword"); } @@ -450,8 +448,8 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) padd( "draw:dots2-length", sXML_CDATA, Double2Str( LineStyle[prop->line_pstyle].dots2 * WTMM(prop->line_width)) + "cm"); } padd( "draw:distance", sXML_CDATA, Double2Str( LineStyle[prop->line_pstyle].distance * WTMM(prop->line_width)) + "cm"); - rstartEl( "draw:stroke-dash", rList); - pList->clear(); + rstartEl( "draw:stroke-dash", mxList.get()); + mxList->clear(); rendEl( "draw:stroke-dash" ); } @@ -478,8 +476,8 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) padd("svg:viewBox", sXML_CDATA, "0 0 30 30"); padd("svg:d", sXML_CDATA, "m0 0h30v30h-30z"); } - rstartEl("draw:marker", rList); - pList->clear(); + rstartEl("draw:marker", mxList.get()); + mxList->clear(); rendEl("draw:marker"); } if( prop->line_hstyle && !ArrowShape[prop->line_hstyle].bMade) @@ -502,8 +500,8 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) padd("svg:viewBox", sXML_CDATA, "0 0 20 20"); padd("svg:d", sXML_CDATA, "m0 0h20v20h-20z"); } - rstartEl("draw:marker", rList); - pList->clear(); + rstartEl("draw:marker", mxList.get()); + mxList->clear(); rendEl("draw:marker"); } } @@ -567,8 +565,8 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) padd( "xlink:show", sXML_CDATA, "embed"); padd( "xlink:actuate", sXML_CDATA, "onLoad"); - rstartEl( "draw:fill-image", rList); - pList->clear(); + rstartEl( "draw:fill-image", mxList.get()); + mxList->clear(); rendEl( "draw:fill-image"); } /* If there is a gradient, when a bitmap file is present, this is the first. */ @@ -649,8 +647,8 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) padd( "draw:angle", sXML_CDATA, ascii(Int2Str( angle, "%d", buf))); } - rstartEl( "draw:gradient", rList ); - pList->clear(); + rstartEl( "draw:gradient", mxList.get() ); + mxList->clear(); rendEl( "draw:gradient"); } /* hatch */ @@ -686,8 +684,8 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) padd( "draw:rotation", sXML_CDATA, "450"); break; } - rstartEl( "draw:hatch", rList); - pList->clear(); + rstartEl( "draw:hatch", mxList.get()); + mxList->clear(); rendEl( "draw:hatch"); } } @@ -700,7 +698,7 @@ void HwpReader::makeStyles() { HWPStyle& hwpstyle = hwpfile.GetHWPStyle(); - rstartEl("office:styles", rList); + rstartEl("office:styles", mxList.get()); int i; for (i = 0; i < hwpfile.getFBoxStyleCount(); i++) @@ -714,21 +712,21 @@ void HwpReader::makeStyles() padd("style:name", sXML_CDATA, "Standard"); padd("style:family", sXML_CDATA, "paragraph"); padd("style:class", sXML_CDATA, "text"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); padd("fo:line-height", sXML_CDATA, "160%"); padd("fo:text-align", sXML_CDATA, "justify"); - rstartEl("style:properties", rList); - pList->clear(); - rstartEl("style:tab-stops", rList); + rstartEl("style:properties", mxList.get()); + mxList->clear(); + rstartEl("style:tab-stops", mxList.get()); for( i = 1 ; i < 40 ; i++) { padd("style:position", sXML_CDATA, Double2Str( WTI(1000 * i)) + "inch"); - rstartEl("style:tab-stop", rList); - pList->clear(); + rstartEl("style:tab-stop", mxList.get()); + mxList->clear(); rendEl("style:tab-stop"); } rendEl("style:tab-stops"); @@ -743,15 +741,15 @@ void HwpReader::makeStyles() padd("style:family", sXML_CDATA, "paragraph"); padd("style:parent-style-name", sXML_CDATA, "Standard"); - rstartEl("style:style", rList); + rstartEl("style:style", mxList.get()); - pList->clear(); + mxList->clear(); parseCharShape(hwpstyle.GetCharShape(ii)); parseParaShape(hwpstyle.GetParaShape(ii)); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); @@ -762,8 +760,8 @@ void HwpReader::makeStyles() padd( "style:family", sXML_CDATA, "paragraph"); padd( "style:parent-style-name", sXML_CDATA, "Standard"); padd( "style:class", sXML_CDATA, "extra"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); rendEl("style:style"); } @@ -772,8 +770,8 @@ void HwpReader::makeStyles() padd( "style:family", sXML_CDATA, "paragraph"); padd( "style:parent-style-name", sXML_CDATA, "Standard"); padd( "style:class", sXML_CDATA, "extra"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); rendEl("style:style"); } @@ -784,8 +782,8 @@ void HwpReader::makeStyles() padd( "style:family", sXML_CDATA, "paragraph"); padd( "style:parent-style-name", sXML_CDATA, "Standard"); padd( "style:class", sXML_CDATA, "html"); - rstartEl( "style:style", rList); - pList->clear(); + rstartEl( "style:style", mxList.get()); + mxList->clear(); padd( "fo:font-size", sXML_CDATA, "6pt"); padd( "fo:margin-top", sXML_CDATA, "0cm"); padd( "fo:margin-bottom", sXML_CDATA, "0cm"); @@ -795,8 +793,8 @@ void HwpReader::makeStyles() padd( "text:number-lines", sXML_CDATA, "false"); padd( "text:line-number", sXML_CDATA, "0"); padd("fo:line-height", sXML_CDATA, "100%"); - rstartEl( "style:properties", rList); - pList->clear(); + rstartEl( "style:properties", mxList.get()); + mxList->clear(); rendEl( "style:properties"); rendEl( "style:style"); } @@ -807,8 +805,8 @@ void HwpReader::makeStyles() padd("text:num-format", sXML_CDATA, "1"); if( hwpinfo.beginfnnum != 1) padd("text:offset", sXML_CDATA, ascii(Int2Str(hwpinfo.beginfnnum -1, "%d", buf))); - rstartEl("text:footnotes-configuration", rList); - pList->clear(); + rstartEl("text:footnotes-configuration", mxList.get()); + mxList->clear(); rendEl("text:footnotes-configuration"); rendEl("office:styles"); @@ -824,7 +822,7 @@ void HwpReader::makeAutoStyles() { int i; - rstartEl("office:automatic-styles", rList); + rstartEl("office:automatic-styles", mxList.get()); for (i = 0; i < hwpfile.getParaShapeCount(); i++) makePStyle(hwpfile.getParaShape(i)); @@ -878,23 +876,23 @@ void HwpReader::makeAutoStyles() ascii(Int2Str(i,"PNPara%d", buf))); padd("style:family", sXML_CDATA, "paragraph"); padd("style:parent-style-name", sXML_CDATA, "Standard"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); if( i == 1 ) padd("fo:text-align", sXML_CDATA, "start"); else if ( i == 2 ) padd("fo:text-align", sXML_CDATA, "center"); else if ( i == 3 ) padd("fo:text-align", sXML_CDATA, "end"); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl( "style:properties"); rendEl( "style:style"); padd("style:name", sXML_CDATA, ascii(Int2Str(i,"PNBox%d",buf))); padd("style:family", sXML_CDATA, "graphics"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); padd("fo:margin-top", sXML_CDATA, "0cm"); padd("fo:margin-bottom", sXML_CDATA, "0cm"); @@ -911,8 +909,8 @@ void HwpReader::makeAutoStyles() padd("style:horizontal-rel", sXML_CDATA, "paragraph"); padd("fo:padding", sXML_CDATA, "0cm"); padd("stylefamily", sXML_CDATA, "graphics"); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); } @@ -951,7 +949,7 @@ struct PageSetting void HwpReader::makeMasterStyles() { - rstartEl("office:master-styles", rList); + rstartEl("office:master-styles", mxList.get()); int i; int nMax = hwpfile.getMaxSettedPage(); @@ -1044,8 +1042,8 @@ void HwpReader::makeMasterStyles() ascii(Int2Str(i+1, "p%d", buf))); padd("draw:style-name", sXML_CDATA, ascii(Int2Str(i, "master%d", buf))); - rstartEl("style:master-page", rList); - pList->clear(); + rstartEl("style:master-page", mxList.get()); + mxList->clear(); if( aSet[i].bIsSet ) /* If you've changed the current setting */ { @@ -1095,17 +1093,17 @@ void HwpReader::makeMasterStyles() } else /* If the previous settings doesn't exist, set to the default settings */ { - rstartEl("style:header", rList); + rstartEl("style:header", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); rendEl("text:p"); rendEl("style:header"); - rstartEl("style:footer", rList); + rstartEl("style:footer", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); rendEl("text:p"); rendEl("style:footer"); @@ -1116,7 +1114,7 @@ void HwpReader::makeMasterStyles() // header if( pPage->header ) { - rstartEl("style:header", rList); + rstartEl("style:header", mxList.get()); if( pPage->pagenumber && pPage->pagenumber->where < 4 ) { d->bInHeader = true; @@ -1129,7 +1127,7 @@ void HwpReader::makeMasterStyles() } if( pPage->header_even ) { - rstartEl("style:header", rList); + rstartEl("style:header", mxList.get()); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) { @@ -1146,10 +1144,10 @@ void HwpReader::makeMasterStyles() /* Will be the default. */ else if( pPage->header_odd && !pPage->header_even ) { - rstartEl("style:header", rList); + rstartEl("style:header", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) { @@ -1164,7 +1162,7 @@ void HwpReader::makeMasterStyles() } if( pPage->header_odd ) { - rstartEl("style:header-left", rList); + rstartEl("style:header-left", mxList.get()); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) { @@ -1181,10 +1179,10 @@ void HwpReader::makeMasterStyles() /* Will be the default. */ else if( pPage->header_even && !pPage->header_odd ) { - rstartEl("style:header-left", rList); + rstartEl("style:header-left", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); if( pPage->pagenumber && ( pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) { @@ -1199,10 +1197,10 @@ void HwpReader::makeMasterStyles() } if( !pPage->header && !pPage->header_even && !pPage->header_odd ) { - rstartEl("style:header", rList); + rstartEl("style:header", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); if( pPage->pagenumber && (pPage->pagenumber->where < 4 || pPage->pagenumber->where == 7 ) ) { @@ -1216,7 +1214,7 @@ void HwpReader::makeMasterStyles() // footer if( pPage->footer ) { - rstartEl("style:footer", rList); + rstartEl("style:footer", mxList.get()); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1230,7 +1228,7 @@ void HwpReader::makeMasterStyles() } if( pPage->footer_even ) { - rstartEl("style:footer", rList); + rstartEl("style:footer", mxList.get()); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1247,10 +1245,10 @@ void HwpReader::makeMasterStyles() /* Will be the default. */ else if( pPage->footer_odd && !pPage->footer_even ) { - rstartEl("style:footer", rList); + rstartEl("style:footer", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1265,7 +1263,7 @@ void HwpReader::makeMasterStyles() } if( pPage->footer_odd ) { - rstartEl("style:footer-left", rList); + rstartEl("style:footer-left", mxList.get()); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1282,10 +1280,10 @@ void HwpReader::makeMasterStyles() /* Will be the default. */ else if( pPage->footer_even && !pPage->footer_odd ) { - rstartEl("style:footer-left", rList); + rstartEl("style:footer-left", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1300,10 +1298,10 @@ void HwpReader::makeMasterStyles() } if( !pPage->footer && !pPage->footer_even && !pPage->footer_odd ) { - rstartEl("style:footer", rList); + rstartEl("style:footer", mxList.get()); padd("text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); if( pPage->pagenumber && pPage->pagenumber->where >= 4 && pPage->pagenumber->where != 7 ) { @@ -1476,17 +1474,17 @@ void HwpReader::makePStyle(ParaShape * pshape) padd("style:name", sXML_CDATA, ascii(Int2Str(pshape->index, "P%d", buf))); padd("style:family", sXML_CDATA, "paragraph"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); parseParaShape(pshape); parseCharShape(pshape->cshape); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); if( nscount ) { unsigned char tf = 0; - rstartEl("style:tab-stops",rList); + rstartEl("style:tab-stops",mxList.get()); int tab_margin = pshape->left_margin + pshape->indent; if( tab_margin < 0 ) @@ -1521,8 +1519,8 @@ void HwpReader::makePStyle(ParaShape * pshape) tf = 1; padd("style:leader-char", sXML_CDATA, "."); } - rstartEl( "style:tab-stop", rList); - pList->clear(); + rstartEl( "style:tab-stop", mxList.get()); + mxList->clear(); rendEl( "style:tab-stop" ); if( (pshape->tabs[i].position != 1000 * i ) || tf ) @@ -1548,8 +1546,8 @@ void HwpReader::makePageStyle() for( int i = 0 ; i < pmCount ; i++ ){ padd("style:name", sXML_CDATA, ascii(Int2Str(i + 1, "pm%d", buf))); - rstartEl("style:page-master",rList); - pList->clear(); + rstartEl("style:page-master",mxList.get()); + mxList->clear(); switch( hwpinfo.paper.paper_kind ) @@ -1712,8 +1710,8 @@ void HwpReader::makePageStyle() } } - rstartEl("style:properties",rList); - pList->clear(); + rstartEl("style:properties",mxList.get()); + mxList->clear(); /* background image */ if( hwpinfo.back_info.isset && hwpinfo.back_info.type > 0 ) @@ -1735,11 +1733,11 @@ void HwpReader::makePageStyle() padd("style:repeat", sXML_CDATA, "no-repeat"); padd("style:position", sXML_CDATA, "center"); } - rstartEl("style:background-image",rList); + rstartEl("style:background-image",mxList.get()); if( hwpinfo.back_info.type == 2 ){ - rstartEl("office:binary-data", rList); - pList->clear(); + rstartEl("office:binary-data", mxList.get()); + mxList->clear(); std::shared_ptr<char> pStr(base64_encode_string(reinterpret_cast<unsigned char *>(hwpinfo.back_info.data), hwpinfo.back_info.size ), Free<char>()); rchars(ascii(pStr.get())); rendEl("office:binary-data"); @@ -1752,35 +1750,35 @@ void HwpReader::makePageStyle() rendEl("style:properties"); /* header style */ - rstartEl("style:header-style", rList); + rstartEl("style:header-style", mxList.get()); padd("svg:height", sXML_CDATA, Double2Str(WTI(hwpinfo.paper.header_length)) + "inch"); padd("fo:margin-bottom", sXML_CDATA, "0mm"); - rstartEl("style:properties",rList); - pList->clear(); + rstartEl("style:properties",mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:header-style"); /* footer style */ - rstartEl("style:footer-style", rList); + rstartEl("style:footer-style", mxList.get()); padd("svg:height", sXML_CDATA, Double2Str(WTI(hwpinfo.paper.footer_length)) + "inch"); padd("fo:margin-top", sXML_CDATA, "0mm"); - rstartEl("style:properties",rList); - pList->clear(); + rstartEl("style:properties",mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:footer-style"); /* Footnote style, but it fell in the dtd, the specification has been defined. REALKING */ - rstartEl("style:footnote-layout", rList); + rstartEl("style:footnote-layout", mxList.get()); padd("style:distance-before-sep", sXML_CDATA, Double2Str(WTI(hwpinfo.splinetext)) + "inch"); padd("style:distance-after-sep", sXML_CDATA, Double2Str(WTI(hwpinfo.splinefn)) + "inch"); - rstartEl("style:properties",rList); - pList->clear(); + rstartEl("style:properties",mxList.get()); + mxList->clear(); rendEl("style:properties"); if ( hwpinfo.fnlinetype == 2 ) padd("style:width", sXML_CDATA, "15cm"); @@ -1791,8 +1789,8 @@ void HwpReader::makePageStyle() else padd("style:width", sXML_CDATA, "5cm"); - rstartEl("style:footnote-sep",rList); - pList->clear(); + rstartEl("style:footnote-sep",mxList.get()); + mxList->clear(); rendEl("style:footnote-sep"); rendEl("style:footnote-layout"); @@ -1805,8 +1803,8 @@ void HwpReader::makeColumns(ColumnDef *coldef) { if( !coldef ) return; padd("fo:column-count", sXML_CDATA, ascii(Int2Str(coldef->ncols, "%d", buf))); - rstartEl("style:columns",rList); - pList->clear(); + rstartEl("style:columns",mxList.get()); + mxList->clear(); if( coldef->separator != 0 ) { switch( coldef->separator ) @@ -1827,8 +1825,8 @@ void HwpReader::makeColumns(ColumnDef *coldef) padd("style:style", sXML_CDATA, "none"); break; } - rstartEl("style:column-sep",rList); - pList->clear(); + rstartEl("style:column-sep",mxList.get()); + mxList->clear(); rendEl("style:column-sep"); } double spacing = WTI(coldef->spacing)/ 2. ; @@ -1844,8 +1842,8 @@ void HwpReader::makeColumns(ColumnDef *coldef) else padd("fo:margin-right", sXML_CDATA, Double2Str( spacing) + "inch"); - rstartEl("style:column",rList); - pList->clear(); + rstartEl("style:column",mxList.get()); + mxList->clear(); rendEl("style:column"); } rendEl("style:columns"); @@ -1856,11 +1854,11 @@ void HwpReader::makeTStyle(CharShape * cshape) padd("style:name", sXML_CDATA, ascii(Int2Str(cshape->index, "T%d", buf))); padd("style:family", sXML_CDATA, "text"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); parseCharShape(cshape); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); } @@ -1874,14 +1872,14 @@ void HwpReader::makeTableStyle(Table *tbl) padd("style:name", sXML_CDATA, ascii(Int2Str(hbox->style.boxnum, "Table%d", buf))); padd("style:family", sXML_CDATA,"table"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); padd("style:width", sXML_CDATA, Double2Str(WTMM(hbox->box_xs)) + "mm"); padd("table:align", sXML_CDATA,"left"); padd("fo:keep-with-next", sXML_CDATA,"false"); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); @@ -1891,12 +1889,12 @@ void HwpReader::makeTableStyle(Table *tbl) sprintf(buf,"Table%d.%c",hbox->style.boxnum, static_cast<char>('A'+i)); padd("style:name", sXML_CDATA, ascii( buf )); padd("style:family", sXML_CDATA,"table-column"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); padd("style:column-width", sXML_CDATA, Double2Str(WTMM(tbl->columns.data[i+1] - tbl->columns.data[i])) + "mm"); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); } @@ -1907,12 +1905,12 @@ void HwpReader::makeTableStyle(Table *tbl) sprintf(buf,"Table%d.row%" SAL_PRI_SIZET "u",hbox->style.boxnum, i + 1); padd("style:name", sXML_CDATA, ascii( buf )); padd("style:family", sXML_CDATA,"table-row"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); padd("style:row-height", sXML_CDATA, Double2Str(WTMM(tbl->rows.data[i+1] - tbl->rows.data[i])) + "mm"); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); } @@ -1924,8 +1922,8 @@ void HwpReader::makeTableStyle(Table *tbl) sprintf(buf,"Table%d.%c%d",hbox->style.boxnum, 'A'+ tcell->nColumnIndex, tcell->nRowIndex +1); padd("style:name", sXML_CDATA, ascii( buf )); padd("style:family", sXML_CDATA,"table-cell"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); Cell *cl = tcell->pCell; if( cl->ver_align == 1 ) padd("fo:vertical-align", sXML_CDATA,"middle"); @@ -2012,8 +2010,8 @@ void HwpReader::makeTableStyle(Table *tbl) ascii(hcolor2str(sal::static_int_cast<uchar>(cl->color), sal::static_int_cast<uchar>(cl->shade), buf))); - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); @@ -2029,8 +2027,8 @@ void HwpReader::makeDrawStyle( HWPDrawingObject * hdo, FBoxStyle * fstyle) ascii(Int2Str(hdo->index, "Draw%d", buf))); padd("style:family", sXML_CDATA, "graphics"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); switch (fstyle->txtflow) { @@ -2196,8 +2194,8 @@ void HwpReader::makeDrawStyle( HWPDrawingObject * hdo, FBoxStyle * fstyle) padd("style:vertical-rel", sXML_CDATA, "baseline"); } - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); @@ -2215,8 +2213,8 @@ void HwpReader::makeCaptionStyle(FBoxStyle * fstyle) padd("style:name", sXML_CDATA, ascii(Int2Str(fstyle->boxnum, "CapBox%d", buf))); padd("style:family", sXML_CDATA, "graphics"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); padd("fo:margin-left", sXML_CDATA, "0cm"); padd("fo:margin-right", sXML_CDATA, "0cm"); padd("fo:margin-top", sXML_CDATA, "0cm"); @@ -2283,8 +2281,8 @@ void HwpReader::makeCaptionStyle(FBoxStyle * fstyle) padd("style:horizontal-rel", sXML_CDATA, "page-content"); } } - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); if( fstyle->boxtype == 'G' ) @@ -2299,8 +2297,8 @@ void HwpReader::makeCaptionStyle(FBoxStyle * fstyle) } padd("style:family", sXML_CDATA, "graphics"); - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); padd("fo:margin-left", sXML_CDATA, "0cm"); padd("fo:margin-right", sXML_CDATA, "0cm"); @@ -2415,8 +2413,8 @@ void HwpReader::makeCaptionStyle(FBoxStyle * fstyle) sal::static_int_cast<uchar>(cell->color), sal::static_int_cast<uchar>(cell->shade), buf))); } - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); } @@ -2456,8 +2454,8 @@ void HwpReader::makeFStyle(FBoxStyle * fstyle) break; } - rstartEl("style:style", rList); - pList->clear(); + rstartEl("style:style", mxList.get()); + mxList->clear(); if ( fstyle->boxtype == 'T') { @@ -2676,8 +2674,8 @@ void HwpReader::makeFStyle(FBoxStyle * fstyle) padd("draw:color-mode", sXML_CDATA, "mono"); } - rstartEl("style:properties", rList); - pList->clear(); + rstartEl("style:properties", mxList.get()); + mxList->clear(); rendEl("style:properties"); rendEl("style:style"); } @@ -2716,8 +2714,8 @@ void HwpReader::make_text_p0(HWPPara * para, bool bParaStart) { padd("text:style-name", sXML_CDATA, ascii(getPStyleName(para->GetParaShape().index, buf))); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); } if( d->bFirstPara && d->bInBody ) { @@ -2728,8 +2726,8 @@ void HwpReader::make_text_p0(HWPPara * para, bool bParaStart) // U+C758 HANGUL SYLLABLE YI, U+CC98 HANGUL SYLLABLE CEO, // U+C74C HANGUL SYLLABLE EUM: "Begin of Document" padd("text:name", sXML_CDATA, OUString(buf, strlen(buf), RTL_TEXTENCODING_UTF8)); - rstartEl("text:bookmark", rList); - pList->clear(); + rstartEl("text:bookmark", mxList.get()); + mxList->clear(); rendEl("text:bookmark"); d->bFirstPara = false; } @@ -2740,8 +2738,8 @@ void HwpReader::make_text_p0(HWPPara * para, bool bParaStart) } padd("text:style-name", sXML_CDATA, ascii(getTStyleName(para->cshape.index, buf))); - rstartEl("text:span", rList); - pList->clear(); + rstartEl("text:span", mxList.get()); + mxList->clear(); for (n = 0; n < para->nch && para->hhstr[n]->hh; n += para->hhstr[n]->WSize()) @@ -2749,7 +2747,7 @@ void HwpReader::make_text_p0(HWPPara * para, bool bParaStart) if (para->hhstr[n]->hh == CH_SPACE && !firstspace) { makeChars(str); - rstartEl("text:s", rList); + rstartEl("text:s", mxList.get()); rendEl("text:s"); } else if (para->hhstr[n]->hh == CH_END_PARA) @@ -2791,8 +2789,8 @@ void HwpReader::make_text_p1(HWPPara * para,bool bParaStart) { padd("text:style-name", sXML_CDATA, ascii(getPStyleName(para->GetParaShape().index, buf))); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); } if( d->bFirstPara && d->bInBody ) { @@ -2804,8 +2802,8 @@ void HwpReader::make_text_p1(HWPPara * para,bool bParaStart) // U+C758 HANGUL SYLLABLE YI, U+CC98 HANGUL SYLLABLE CEO, // U+C74C HANGUL SYLLABLE EUM: "Begin of Document" padd("text:name", sXML_CDATA, OUString(buf, strlen(buf), RTL_TEXTENCODING_UTF8)); - rstartEl("text:bookmark", rList); - pList->clear(); + rstartEl("text:bookmark", mxList.get()); + mxList->clear(); rendEl("text:bookmark"); d->bFirstPara = false; } @@ -2816,8 +2814,8 @@ void HwpReader::make_text_p1(HWPPara * para,bool bParaStart) } padd("text:style-name", sXML_CDATA, ascii(getTStyleName(curr, buf))); - rstartEl("text:span", rList); - pList->clear(); + rstartEl("text:span", mxList.get()); + mxList->clear(); for (n = 0; n < para->nch && para->hhstr[n]->hh; n += para->hhstr[n]->WSize()) @@ -2829,13 +2827,13 @@ void HwpReader::make_text_p1(HWPPara * para,bool bParaStart) curr = para->GetCharShape(n)->index; padd("text:style-name", sXML_CDATA, ascii(getTStyleName(curr, buf))); - rstartEl("text:span", rList); - pList->clear(); + rstartEl("text:span", mxList.get()); + mxList->clear(); } if (para->hhstr[n]->hh == CH_SPACE && !firstspace) { makeChars(str); - rstartEl("text:s", rList); + rstartEl("text:s", mxList.get()); rendEl("text:s"); } else if (para->hhstr[n]->hh == CH_END_PARA) @@ -2888,8 +2886,8 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) // U+C758 HANGUL SYLLABLE YI, U+CC98 HANGUL SYLLABLE CEO, // U+C74C HANGUL SYLLABLE EUM: "Begin of Document" padd("text:name", sXML_CDATA, OUString(buf, strlen(buf), RTL_TEXTENCODING_UTF8)); - rstartEl("text:bookmark", rList); - pList->clear(); + rstartEl("text:bookmark", mxList.get()); + mxList->clear(); rendEl("text:bookmark"); d->bFirstPara = false; } @@ -2923,8 +2921,8 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) if( !pstart ) {STARTP;} if( !tstart ) {STARTT;} makeChars(str); - rstartEl("text:s", rList); - pList->clear(); + rstartEl("text:s", mxList.get()); + mxList->clear(); rendEl("text:s"); } else if ( para->hhstr[n]->hh >= CH_SPACE ) @@ -3142,8 +3140,8 @@ void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox) padd("text:placeholder-type", sXML_CDATA, "text"); if( field ) padd("text:description", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(field))); - rstartEl( "text:placeholder", rList); - pList->clear(); + rstartEl( "text:placeholder", mxList.get()); + mxList->clear(); rchars( reinterpret_cast<sal_Unicode const *>(rStr.c_str()) ); rendEl( "text:placeholder" ); } @@ -3152,25 +3150,25 @@ void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox) { if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "title") { - rstartEl( "text:title", rList ); + rstartEl( "text:title", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:title" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "subject") { - rstartEl( "text:subject", rList ); + rstartEl( "text:subject", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:subject" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "author") { - rstartEl( "text:author-name", rList ); + rstartEl( "text:author-name", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:author-name" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "keywords") { - rstartEl( "text:keywords", rList ); + rstartEl( "text:keywords", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:keywords" ); } @@ -3180,61 +3178,61 @@ void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox) { if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "User") { - rstartEl( "text:sender-lastname", rList ); + rstartEl( "text:sender-lastname", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-lastname" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Company") { - rstartEl( "text:sender-company", rList ); + rstartEl( "text:sender-company", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-company" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Position") { - rstartEl( "text:sender-title", rList ); + rstartEl( "text:sender-title", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-title" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Division") { - rstartEl( "text:sender-position", rList ); + rstartEl( "text:sender-position", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-position" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Fax") { - rstartEl( "text:sender-fax", rList ); + rstartEl( "text:sender-fax", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-fax" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Pager") { - rstartEl( "text:phone-private", rList ); + rstartEl( "text:phone-private", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:phone-private" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "E-mail") { - rstartEl( "text:sender-email", rList ); + rstartEl( "text:sender-email", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-email" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Zipcode(office)") { - rstartEl( "text:sender-postal-code", rList ); + rstartEl( "text:sender-postal-code", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-postal-code" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Phone(office)") { - rstartEl( "text:sender-phone-work", rList ); + rstartEl( "text:sender-phone-work", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-phone-work" ); } else if (OUString(reinterpret_cast<sal_Unicode const *>(hconv(hbox->str3))) == "Address(office)") { - rstartEl( "text:sender-street", rList ); + rstartEl( "text:sender-street", mxList.get() ); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:sender-street" ); } @@ -3245,8 +3243,8 @@ void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox) if( hbox->m_pDate ) padd("style:data-style-name", sXML_CDATA, ascii(Int2Str(hbox->m_pDate->key, "N%d", buf))); - rstartEl( "text:creation-date", rList ); - pList->clear(); + rstartEl( "text:creation-date", mxList.get() ); + mxList->clear(); rchars( reinterpret_cast<sal_Unicode const *>(hconv(hbox->str2)) ); rendEl( "text:creation-date" ); } @@ -3262,22 +3260,22 @@ void HwpReader::makeBookmark(Bookmark * hbox) if (hbox->type == 0) { padd("text:name", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(hbox->id))); - rstartEl("text:bookmark", rList); - pList->clear(); + rstartEl("text:bookmark", mxList.get()); + mxList->clear(); rendEl("text:bookmark"); } else if (hbox->type == 1) /* Block bookmarks days begin and end there if */ { padd("text:name", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(hbox->id))); - rstartEl("text:bookmark-start", rList); - pList->clear(); + rstartEl("text:bookmark-start", mxList.get()); + mxList->clear(); rendEl("text:bookmark-start"); } else if (hbox->type == 2) { padd("text:name", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(hbox->id))); - rstartEl("text:bookmark-end", rList); - pList->clear(); + rstartEl("text:bookmark-end", mxList.get()); + mxList->clear(); rendEl("text:bookmark-end"); } } @@ -3291,8 +3289,8 @@ void HwpReader::makeDateFormat(DateCode * hbox) padd("number:language", sXML_CDATA,"ko"); padd("number:country", sXML_CDATA,"KR"); - rstartEl("number:date-style", rList); - pList->clear(); + rstartEl("number:date-style", mxList.get()); + mxList->clear(); bool add_zero = false; int zero_check = 0; @@ -3317,67 +3315,67 @@ void HwpReader::makeDateFormat(DateCode * hbox) break; case '1': padd("number:style", sXML_CDATA, "long"); - rstartEl("number:year", rList); - pList->clear(); + rstartEl("number:year", mxList.get()); + mxList->clear(); rendEl("number:year"); break; case '!': - rstartEl("number:year", rList); - pList->clear(); + rstartEl("number:year", mxList.get()); + mxList->clear(); rendEl("number:year"); break; case '2': if( add_zero ) padd("number:style", sXML_CDATA, "long"); - rstartEl("number:month", rList); - pList->clear(); + rstartEl("number:month", mxList.get()); + mxList->clear(); rendEl("number:month"); break; case '@': padd("number:textual", sXML_CDATA, "true"); - rstartEl("number:month", rList); - pList->clear(); + rstartEl("number:month", mxList.get()); + mxList->clear(); rendEl("number:month"); break; case '*': padd("number:textual", sXML_CDATA, "true"); padd("number:style", sXML_CDATA, "long"); - rstartEl("number:month", rList); - pList->clear(); + rstartEl("number:month", mxList.get()); + mxList->clear(); rendEl("number:month"); break; case '3': if( add_zero ) padd("number:style", sXML_CDATA, "long"); - rstartEl("number:day", rList); - pList->clear(); + rstartEl("number:day", mxList.get()); + mxList->clear(); rendEl("number:day"); break; case '#': if( add_zero ) padd("number:style", sXML_CDATA, "long"); - rstartEl("number:day", rList); - pList->clear(); + rstartEl("number:day", mxList.get()); + mxList->clear(); rendEl("number:day"); switch( hbox->date[DateCode::DAY] % 10) { case 1: - rstartEl("number:text", rList); + rstartEl("number:text", mxList.get()); rchars("st"); rendEl("number:text"); break; case 2: - rstartEl("number:text", rList); + rstartEl("number:text", mxList.get()); rchars("nd"); rendEl("number:text"); break; case 3: - rstartEl("number:text", rList); + rstartEl("number:text", mxList.get()); rchars("rd"); rendEl("number:text"); break; default: - rstartEl("number:text", rList); + rstartEl("number:text", mxList.get()); rchars("th"); rendEl("number:text"); break; @@ -3387,16 +3385,16 @@ void HwpReader::makeDateFormat(DateCode * hbox) case '$': if( add_zero ) padd("number:style", sXML_CDATA, "long"); - rstartEl("number:hours", rList); - pList->clear(); + rstartEl("number:hours", mxList.get()); + mxList->clear(); rendEl("number:hours"); break; case '5': case '%': if( add_zero ) padd("number:style", sXML_CDATA, "long"); - rstartEl("number:minutes", rList); - pList->clear(); + rstartEl("number:minutes", mxList.get()); + mxList->clear(); rendEl("number:minutes"); break; case '_': @@ -3404,15 +3402,15 @@ void HwpReader::makeDateFormat(DateCode * hbox) SAL_FALLTHROUGH; case '6': case '^': - rstartEl("number:day-of-week", rList); - pList->clear(); + rstartEl("number:day-of-week", mxList.get()); + mxList->clear(); rendEl("number:day-of-week"); break; case '7': case '&': case '+': - rstartEl("number:am-pm", rList); - pList->clear(); + rstartEl("number:am-pm", mxList.get()); + mxList->clear(); rendEl("number:am-pm"); break; case '~': // Chinese Locale @@ -3421,13 +3419,13 @@ void HwpReader::makeDateFormat(DateCode * hbox) hchar sbuf[2]; sbuf[0] = *fmt; sbuf[1] = 0; - rstartEl("number:text", rList); + rstartEl("number:text", mxList.get()); rchars(reinterpret_cast<sal_Unicode const *>(hconv(sbuf))); rendEl("number:text"); break; } } - pList->clear(); + mxList->clear(); rendEl("number:date-style"); } @@ -3436,8 +3434,8 @@ void HwpReader::makeDateCode(DateCode * hbox) { padd("style:data-style-name", sXML_CDATA, ascii(Int2Str(hbox->key, "N%d", buf))); - rstartEl( "text:date", rList ); - pList->clear(); + rstartEl( "text:date", mxList.get() ); + mxList->clear(); hchar_string const boxstr = hbox->GetString(); rchars(reinterpret_cast<sal_Unicode const *>(hconv(boxstr.c_str()))); rendEl( "text:date" ); @@ -3446,7 +3444,7 @@ void HwpReader::makeDateCode(DateCode * hbox) void HwpReader::makeTab(Tab * ) /*hbox */ { - rstartEl("text:tab-stop", rList); + rstartEl("text:tab-stop", mxList.get()); rendEl("text:tab-stop"); } @@ -3457,8 +3455,8 @@ void HwpReader::makeTable(TxtBox * hbox) ascii(Int2Str(hbox->style.boxnum, "Table%d", buf))); padd("table:style-name", sXML_CDATA, ascii(Int2Str(hbox->style.boxnum, "Table%d", buf))); - rstartEl("table:table", rList); - pList->clear(); + rstartEl("table:table", mxList.get()); + mxList->clear(); Table *tbl = hbox->m_pTable; // column @@ -3466,8 +3464,8 @@ void HwpReader::makeTable(TxtBox * hbox) { sprintf(buf,"Table%d.%c",hbox->style.boxnum, static_cast<char>('A'+i)); padd("table:style-name", sXML_CDATA, ascii( buf )); - rstartEl("table:table-column", rList); - pList->clear(); + rstartEl("table:table-column", mxList.get()); + mxList->clear(); rendEl("table:table-column"); } @@ -3486,8 +3484,8 @@ void HwpReader::makeTable(TxtBox * hbox) // row sprintf(buf,"Table%d.row%d",hbox->style.boxnum, tcell->nRowIndex + 1); padd("table:style-name", sXML_CDATA, ascii( buf )); - rstartEl("table:table-row", rList); - pList->clear(); + rstartEl("table:table-row", mxList.get()); + mxList->clear(); j = tcell->nRowIndex; } @@ -3502,8 +3500,8 @@ void HwpReader::makeTable(TxtBox * hbox) padd("table:value-type", sXML_CDATA,"string"); if( tcell->pCell->protect ) padd("table:protected", sXML_CDATA,"true"); - rstartEl("table:table-cell", rList); - pList->clear(); + rstartEl("table:table-cell", mxList.get()); + mxList->clear(); parsePara(hbox->plists[tcell->pCell->key].front()); rendEl("table:table-cell"); } @@ -3556,15 +3554,15 @@ void HwpReader::makeTextBox(TxtBox * hbox) Double2Str(WTMM(( hbox->box_xs + hbox->cap_xs) )) + "mm"); padd("fo:min-height", sXML_CDATA, Double2Str(WTMM(( hbox->box_ys + hbox->cap_ys) )) + "mm"); - rstartEl("draw:text-box", rList); - pList->clear(); + rstartEl("draw:text-box", mxList.get()); + mxList->clear(); if( hbox->cap_pos % 2 ) /* The caption is on the top */ { parsePara(hbox->caption.front()); } padd( "text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); } else{ padd("draw:z-index", sXML_CDATA, @@ -3623,8 +3621,8 @@ void HwpReader::makeTextBox(TxtBox * hbox) if( hbox->type != EQU_TYPE ) { - rstartEl("draw:text-box", rList); - pList->clear(); + rstartEl("draw:text-box", mxList.get()); + mxList->clear(); /* If captions are present and it is on the top */ if( hbox->style.cap_len > 0 && (hbox->cap_pos % 2) && hbox->type == TBL_TYPE ) { @@ -3657,8 +3655,8 @@ void HwpReader::makeTextBox(TxtBox * hbox) } else // is Formula { - rstartEl("draw:object", rList); - pList->clear(); + rstartEl("draw:object", mxList.get()); + mxList->clear(); makeFormula(hbox); rendEl("draw:object"); } @@ -3712,7 +3710,7 @@ void HwpReader::makeFormula(TxtBox * hbox) Formula *form = new Formula(mybuf); form->setDocumentHandler(m_rxDocumentHandler); - form->setAttributeListImpl(pList); + form->setAttributeListImpl(mxList.get()); form->parse(); delete form; @@ -3759,8 +3757,8 @@ void HwpReader::makeHyperText(TxtBox * hbox) padd("xlink:href", sXML_CDATA, OUString(tmp.c_str(), tmp.size()+1, RTL_TEXTENCODING_EUC_KR)); } - rstartEl("draw:a", rList); - pList->clear(); + rstartEl("draw:a", mxList.get()); + mxList->clear(); makeTextBox(hbox); rendEl("draw:a"); } @@ -3815,15 +3813,15 @@ void HwpReader::makePicture(Picture * hbox) Double2Str(WTMM( hbox->box_xs + hbox->style.margin[1][0] + hbox->style.margin[1][1] )) + "mm"); padd("fo:min-height", sXML_CDATA, Double2Str(WTMM( hbox->box_ys + hbox->style.margin[1][2] + hbox->style.margin[1][3] + hbox->cap_ys )) + "mm"); - rstartEl("draw:text-box", rList); - pList->clear(); + rstartEl("draw:text-box", mxList.get()); + mxList->clear(); if( hbox->cap_pos % 2 ) /* Caption is on the top */ { parsePara(hbox->caption.front()); } padd( "text:style-name", sXML_CDATA, "Standard"); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); } if( hbox->ishyper ) { @@ -3841,8 +3839,8 @@ void HwpReader::makePicture(Picture * hbox) padd("xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hbox->follow + 5)).c_str())).c_str()))); #endif - rstartEl("draw:a", rList); - pList->clear(); + rstartEl("draw:a", mxList.get()); + mxList->clear(); } padd("draw:style-name", sXML_CDATA, ascii(Int2Str(hbox->style.boxnum, "G%d", buf))); @@ -3902,14 +3900,14 @@ void HwpReader::makePicture(Picture * hbox) } if( hbox->pictype == PICTYPE_OLE ) - rstartEl("draw:object-ole", rList); + rstartEl("draw:object-ole", mxList.get()); else - rstartEl("draw:image", rList); - pList->clear(); + rstartEl("draw:image", mxList.get()); + mxList->clear(); if (hbox->pictype == PICTYPE_EMBED || hbox->pictype == PICTYPE_OLE) { - rstartEl("office:binary-data", rList); - pList->clear(); + rstartEl("office:binary-data", mxList.get()); + mxList->clear(); if( hbox->pictype == PICTYPE_EMBED ){ EmPicture *emp = hwpfile.GetEmPicture(hbox); if( emp ) @@ -4019,8 +4017,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) if (drawobj->type == HWPDO_CONTAINER) { - rstartEl("draw:g", rList); - pList->clear(); + rstartEl("draw:g", mxList.get()); + mxList->clear(); makePictureDRAW(drawobj->child, hbox); rendEl("draw:g"); } @@ -4131,8 +4129,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) Double2Str (WTMM(y + b + drawobj->offset2.y + drawobj->extent.h)) + "mm"); } - rstartEl("draw:line", rList); - pList->clear(); + rstartEl("draw:line", mxList.get()); + mxList->clear(); rendEl("draw:line"); break; case HWPDO_RECT: /* rectangle - the starting position, vertical/horizontal */ @@ -4162,8 +4160,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) Double2Str (WTMM( value / 2)) + "mm"); } - rstartEl("draw:rect", rList); - pList->clear(); + rstartEl("draw:rect", mxList.get()); + mxList->clear(); if( (drawobj->property.flag & HWPDO_FLAG_AS_TEXTBOX) && drawobj->property.pPara ) // As Textbox { @@ -4210,8 +4208,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) padd("draw:end-angle", sXML_CDATA, Double2Str(end_angle)); } } - rstartEl("draw:ellipse", rList); - pList->clear(); + rstartEl("draw:ellipse", mxList.get()); + mxList->clear(); if( drawobj->property.flag >> 19 & 0x01 && drawobj->property.pPara ) // As Textbox { @@ -4320,8 +4318,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) padd("draw:end-angle", sXML_CDATA, "180"); } } - rstartEl("draw:ellipse", rList); - pList->clear(); + rstartEl("draw:ellipse", mxList.get()); + mxList->clear(); if( drawobj->property.flag >> 19 & 0x01 && drawobj->property.pPara ) // As Textbox { @@ -4437,8 +4435,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) padd("svg:d", sXML_CDATA, oustr); - rstartEl("draw:path", rList); - pList->clear(); + rstartEl("draw:path", mxList.get()); + mxList->clear(); // As Textbox if( drawobj->property.flag >> 19 & 0x01 && drawobj->property.pPara ) { @@ -4500,8 +4498,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) if(bIsPolygon) { - rstartEl("draw:polygon", rList); - pList->clear(); + rstartEl("draw:polygon", mxList.get()); + mxList->clear(); if( drawobj->property.flag >> 19 & 0x01 && // As Textbox drawobj->property.pPara ) @@ -4518,8 +4516,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) } else { - rstartEl("draw:polyline", rList); - pList->clear(); + rstartEl("draw:polyline", mxList.get()); + mxList->clear(); if( drawobj->property.flag >> 19 & 0x01 && // As Textbox drawobj->property.pPara ) @@ -4563,8 +4561,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) Double2Str (WTMM( value / 2)) + "mm"); } - rstartEl("draw:text-box", rList); - pList->clear(); + rstartEl("draw:text-box", mxList.get()); + mxList->clear(); HWPPara *pPara = drawobj->u.textbox.h; //parsePara(pPara); @@ -4578,7 +4576,7 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) break; } } - pList->clear(); + mxList->clear(); drawobj = drawobj->next; } } @@ -4590,8 +4588,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) void HwpReader::makeLine(Line * ) { padd("text:style-name", sXML_CDATA, "Horizontal Line"); - rstartEl( "text:p", rList); - pList->clear(); + rstartEl( "text:p", mxList.get()); + mxList->clear(); } @@ -4607,8 +4605,8 @@ void HwpReader::makeHidden(Hidden * hbox) padd("text:condition", sXML_CDATA, ""); padd("text:string-value", sXML_CDATA, ""); - rstartEl("text:hidden-text", rList); - pList->clear(); + rstartEl("text:hidden-text", mxList.get()); + mxList->clear(); HWPPara *para = hbox->plist.front(); while (para) @@ -4638,15 +4636,15 @@ void HwpReader::makeFootnote(Footnote * hbox) { padd("text:id", sXML_CDATA, ascii(Int2Str(hbox->number, "edn%d", buf))); - rstartEl("text:endnote", rList); - pList->clear(); + rstartEl("text:endnote", mxList.get()); + mxList->clear(); padd("text:label", sXML_CDATA, ascii(Int2Str(hbox->number, "%d", buf))); - rstartEl("text:endnote-citation", rList); - pList->clear(); + rstartEl("text:endnote-citation", mxList.get()); + mxList->clear(); rchars(ascii(Int2Str(hbox->number, "%d", buf))); rendEl("text:endnote-citation"); - rstartEl("text:endnote-body", rList); + rstartEl("text:endnote-body", mxList.get()); parsePara(hbox->plist.front()); rendEl("text:endnote-body"); rendEl("text:endnote"); @@ -4655,15 +4653,15 @@ void HwpReader::makeFootnote(Footnote * hbox) { padd("text:id", sXML_CDATA, ascii(Int2Str(hbox->number, "ftn%d", buf))); - rstartEl("text:footnote", rList); - pList->clear(); + rstartEl("text:footnote", mxList.get()); + mxList->clear(); padd("text:label", sXML_CDATA, ascii(Int2Str(hbox->number, "%d", buf))); - rstartEl("text:footnote-citation", rList); - pList->clear(); + rstartEl("text:footnote-citation", mxList.get()); + mxList->clear(); rchars(ascii(Int2Str(hbox->number, "%d", buf))); rendEl("text:footnote-citation"); - rstartEl("text:footnote-body", rList); + rstartEl("text:footnote-body", mxList.get()); parsePara(hbox->plist.front()); rendEl("text:footnote-body"); rendEl("text:footnote"); @@ -4679,7 +4677,7 @@ void HwpReader::makeAutoNum(AutoNum * hbox) switch (hbox->type) { case PGNUM_AUTO: - rstartEl("text:page-number", rList); + rstartEl("text:page-number", mxList.get()); rchars(ascii(Int2Str(hbox->number, "%d", buf))); rendEl("text:page-number"); break; @@ -4693,7 +4691,7 @@ void HwpReader::makeAutoNum(AutoNum * hbox) ascii(Int2Str(hbox->number, "refIllustration%d", buf))); padd("text:name",sXML_CDATA, "Illustration"); padd("style:num-format",sXML_CDATA, "1"); - rstartEl("text:sequence", rList); + rstartEl("text:sequence", mxList.get()); rchars(ascii(Int2Str(hbox->number, "%d", buf))); rendEl("text:sequence"); break; @@ -4702,7 +4700,7 @@ void HwpReader::makeAutoNum(AutoNum * hbox) ascii(Int2Str(hbox->number, "refTable%d", buf))); padd("text:name",sXML_CDATA, "Table"); padd("style:num-format",sXML_CDATA, "1"); - rstartEl("text:sequence", rList); + rstartEl("text:sequence", mxList.get()); rchars(ascii(Int2Str(hbox->number, "%d", buf))); rendEl("text:sequence"); break; @@ -4736,13 +4734,13 @@ void HwpReader::makeShowPageNum() padd("svg:y", sXML_CDATA, "0cm"); padd("svg:width", sXML_CDATA, "2.0cm"); padd("fo:min-height", sXML_CDATA, "0.5cm"); - rstartEl("draw:text-box", rList); - pList->clear(); + rstartEl("draw:text-box", mxList.get()); + mxList->clear(); padd("text:style-name", sXML_CDATA, ascii(Int2Str(nPos, "PNPara%d", buf))); - rstartEl("text:p", rList); - pList->clear(); + rstartEl("text:p", mxList.get()); + mxList->clear(); if( hbox->shape > 2 ) rchars("- "); if( hbox->shape % 3 == 0 ) @@ -4752,8 +4750,8 @@ void HwpReader::makeShowPageNum() else padd("style:num-format", sXML_CDATA, "i"); padd("text:select-page", sXML_CDATA, "current"); - rstartEl("text:page-number", rList); - pList->clear(); + rstartEl("text:page-number", mxList.get()); + mxList->clear(); rchars("2"); rendEl("text:page-number"); if( hbox->shape > 2 ) @@ -4792,8 +4790,8 @@ void HwpReader::parsePara(HWPPara * para) { padd("text:style-name", sXML_CDATA, ascii(getPStyleName(para->GetParaShape().index, buf))); - rstartEl( "text:p",rList); - pList->clear(); + rstartEl( "text:p",mxList.get()); + mxList->clear(); } if( d->bFirstPara && d->bInBody ) { @@ -4806,8 +4804,8 @@ void HwpReader::parsePara(HWPPara * para) // U+C758 HANGUL SYLLABLE YI, U+CC98 HANGUL SYLLABLE CEO, // U+C74C HANGUL SYLLABLE EUM: "Begin of Document" padd("text:name", sXML_CDATA, OUString(buf, strlen(buf), RTL_TEXTENCODING_UTF8)); - rstartEl("text:bookmark", rList); - pList->clear(); + rstartEl("text:bookmark", mxList.get()); + mxList->clear(); rendEl("text:bookmark"); d->bFirstPara = false; } diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx index fa0a2430e1e1..87ad9000721d 100644 --- a/hwpfilter/source/hwpreader.hxx +++ b/hwpfilter/source/hwpreader.hxx @@ -90,8 +90,7 @@ public: } private: Reference< XDocumentHandler > m_rxDocumentHandler; - Reference< XAttributeList > rList; - AttributeListImpl *pList; + rtl::Reference<AttributeListImpl> mxList; HWPFile hwpfile; HwpReaderPrivate *d; private: |