summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorKorrawit Pruegsanusak <detective.conan.1412@gmail.com>2011-06-12 16:40:20 +0700
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-06-12 16:44:43 -0500
commit655d930476045a2de7f3ead4768bb75df8cf7c82 (patch)
tree9f240c0f4ef720b1899d5797ac1fcdffe5be2f40 /hwpfilter
parent0fa6dbcdab49b79852c451c173867fac0d8f213a (diff)
Code cleanup
* Remove dead code * Fix comment typos Released under LGPLv3+/MPL
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hinfo.cpp16
-rw-r--r--hwpfilter/source/hpara.cpp5
-rw-r--r--hwpfilter/source/hwpfile.cpp8
-rw-r--r--hwpfilter/source/hwpreader.cxx56
4 files changed, 6 insertions, 79 deletions
diff --git a/hwpfilter/source/hinfo.cpp b/hwpfilter/source/hinfo.cpp
index e8768d0c9ea9..fb57e49d6de3 100644
--- a/hwpfilter/source/hinfo.cpp
+++ b/hwpfilter/source/hinfo.cpp
@@ -34,8 +34,6 @@
// Info Block
-//int ParaShape::count = 0;
-//int CharShape::count = 0;
static bool HWPReadInfoBlock(void *ptr, int len, HWPFile & hwpf)
{
@@ -47,7 +45,7 @@ static bool HWPReadInfoBlock(void *ptr, int len, HWPFile & hwpf)
}
-// Document Infomation
+// Document Information
HWPInfo::HWPInfo(void)
{
@@ -161,8 +159,6 @@ bool HWPSummary::Read(HWPFile & hwpf)
}
-//
-
bool ParaShape::Read(HWPFile & hwpf)
{
pagebreak = 0;
@@ -195,18 +191,8 @@ bool ParaShape::Read(HWPFile & hwpf)
}
-/*
-CharShape::~CharShape()
-{
-}
-ParaShape::~ParaShape()
-{
-}
-
-*/
bool CharShape::Read(HWPFile & hwpf)
{
-//index = ++count;
size = (short) hwpf.Read2b();
hwpf.Read1b(font, NLanguage);
hwpf.Read1b(ratio, NLanguage);
diff --git a/hwpfilter/source/hpara.cpp b/hwpfilter/source/hpara.cpp
index f781a311223d..06a5786d90ea 100644
--- a/hwpfilter/source/hpara.cpp
+++ b/hwpfilter/source/hpara.cpp
@@ -94,7 +94,7 @@ int HWPPara::Read(HWPFile & hwpf, unsigned char flag)
unsigned char same_cshape;
register int ii;
scflag = flag;
-// Paragraph Infomation
+// Paragraph Information
hwpf.Read1b(&reuse_shape, 1);
hwpf.Read2b(&nch, 1);
hwpf.Read2b(&nline, 1);
@@ -213,7 +213,7 @@ HBox *HWPPara::readHBox(HWPFile & hwpf)
if (hwpf.State() != HWP_NoError)
return 0;
-//hbox = new HBox(hh);
+
if (hh > 31 || hh == CH_END_PARA)
hbox = new HBox(hh);
else if (IS_SP_SKIP_BLOCK(hh))
@@ -313,7 +313,6 @@ HBox *HWPPara::readHBox(HWPFile & hwpf)
}
}
return hbox;
-//return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/hwpfile.cpp b/hwpfilter/source/hwpfile.cpp
index 088fcc5883ec..5d8b5f09e910 100644
--- a/hwpfilter/source/hwpfile.cpp
+++ b/hwpfilter/source/hwpfile.cpp
@@ -117,18 +117,12 @@ int HWPFile::ReadHwpFile(HStream & stream)
{
if (Open(stream) != HWP_NoError)
return State();
-// printf("HWPFile::ReadHwpFile\n");
InfoRead();
-// printf("HWPFile::InfoRead Done.\n");
FontRead();
-// printf("HWPFile::FontRead Done.\n");
StyleRead();
-// printf("HWPFile::StyleRead Done.\n");
AddColumnInfo();
ParaListRead();
-// printf("HWPFile::ParaListRead Done.\n");
TagsRead();
- //printf("HWPFile::TagsRead Done. State: %d\n", State());
return State();
}
@@ -326,7 +320,6 @@ bool HWPFile::TagsRead(void)
tag = Read4b();
size = Read4b();
if (size <= 0 && tag > 0){
- //return false;
continue;
}
@@ -402,7 +395,6 @@ bool HWPFile::TagsRead(void)
SkipBlock(size);
}
}
-// return false;
}
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 3ffc6a5c679e..cdf36c923274 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -35,10 +35,9 @@
#include "hwpreader.hxx"
#include <math.h>
-//#ifndef UDK100
#include "formula.h"
#include "cspline.h"
-//#endif
+
extern int getRepFamilyName(const char* , char *, double &ratio);
#include <iostream>
@@ -421,17 +420,6 @@ void HwpReader::makeMeta()
}
rendEl(ascii("meta:keywords"));
}
-/*
- padd(ascii("meta:name"), sXML_CDATA, ascii("BBSID"));
- rstartEl(ascii("meta:user-defined"), rList);
- pList->clear();
- rchars((hconv(hwpinfo->summary.etc[2], gstr)));
- rendEl(ascii("meta:user-defined"));
-
- rstartEl(ascii("dc:language"), rList);
- rchars(ascii("C"));
- rendEl(ascii("dc:language"));
-*/
rendEl(ascii("office:meta"));
}
@@ -900,8 +888,6 @@ void HwpReader::makeAutoStyles()
makeFStyle(hwpfile.getFBoxStyle(i));
}
-// sal_Bool bIsLeft = sal_True, bIsMiddle = sal_True, bIsRight = sal_True;
-
sal_Bool bIsLeft = sal_False, bIsMiddle = sal_False, bIsRight = sal_False;
for( i = 0 ; i < hwpfile.getPageNumberCount() ; i++ )
{
@@ -2094,16 +2080,8 @@ void HwpReader::makeDrawStyle( HWPDrawingObject * hdo, FBoxStyle * fstyle)
switch (fstyle->txtflow)
{
case 0:
-//padd(ascii("style:wrap"), sXML_CDATA, ascii("none"));
break;
case 1:
- /*
- padd(ascii("style:run-through"), sXML_CDATA, ascii("foreground"));
- padd(ascii("style:wrap"), sXML_CDATA, ascii("parallel"));
- padd(ascii("style:number-wrapped-paragraphs"), sXML_CDATA, ascii("no-limit"));
- padd(ascii("style:wrap-contour"), sXML_CDATA, ascii("true"));
- padd(ascii("style:wrap-contour-mode"), sXML_CDATA, ascii("full"));
- */
padd(ascii("style:wrap"), sXML_CDATA, ascii("run-through"));
break;
case 2:
@@ -2762,7 +2740,6 @@ char *HwpReader::getPStyleName(int index, char *_buf)
}
-//void HwpReader::makeChars(char *str, int size)
void HwpReader::makeChars(hchar *str, int size)
{
if (size)
@@ -3370,7 +3347,7 @@ void HwpReader::makeDateFormat(DateCode * hbox)
pList->clear();
bool add_zero = false;
- int zero_check = 0/*, i=0*/;
+ int zero_check = 0;
hbox->format[DATE_SIZE -1] = 0;
hchar *fmt = hbox->format[0] ? hbox->format : defaultform;
@@ -3489,16 +3466,7 @@ void HwpReader::makeDateFormat(DateCode * hbox)
pList->clear();
rendEl(ascii("number:am-pm"));
break;
- case '~': // Chiness Locale
-/*
-if( fmt[1] == 0 ) break;
-fmt++;
-if( *fmt == '6' ){
- rstartEl(ascii("number:day-of-week"), rList);
- pList->clear();
- rendEl(ascii("number:day-of-week"));
-}
-*/
+ case '~': // Chinese Locale
break;
default:
sbuf[0] = *fmt;
@@ -4766,26 +4734,8 @@ void HwpReader::makeAutoNum(AutoNum * hbox)
rendEl(ascii("text:page-number"));
break;
case FNNUM_AUTO:
-/*
-padd(ascii("text:ref-name"), sXML_CDATA,
- ascii(Int2Str(hbox->number + 1, "ftn%d", buf)));
-rstartEl(ascii("text:footnote-ref"), rList);
-pList->clear();
-//rchars(ascii(Int2Str(hbox->number + 1, "%d", buf)));
-rchars(ascii(""));
-rendEl(ascii("text:footnote-ref"));
-*/
break;
case ENNUM_AUTO:
-/*
-padd(ascii("text:ref-name"), sXML_CDATA,
- ascii(Int2Str(hbox->number + 1, "edn%d", buf)));
-rstartEl(ascii("text:endnote-ref"), rList);
-pList->clear();
-//rchars(ascii(Int2Str(hbox->number + 1, "%d", buf)));
-rchars(ascii(""));
-rendEl(ascii("text:endnote-ref"));
-*/
break;
case EQUNUM_AUTO:
case PICNUM_AUTO: