You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2020/12/28 17:47:38 UTC

[openoffice] branch AOO419 updated: i126369 - Finish off hwpfilter

This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch AOO419
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO419 by this push:
     new 974bb40  i126369 - Finish off hwpfilter
974bb40 is described below

commit 974bb40af7071ffd64f336916b5acd98ca268e45
Author: mseidel <ms...@apache.org>
AuthorDate: Mon Dec 28 18:43:54 2020 +0100

    i126369 - Finish off hwpfilter
    
    The Hangul Word Processor filter was disabled from OpenOffice in
    r1677190 due to security concerns. While some extra buffer controls
    could  have been made and the filter restored, the truth is a much
    bigger effort is required to catch up with this format. Files created
    with later editions of Hangul, including Hangul Wordian, Hangul 2002,
    Hangul 2005 and Hangul 2007 cannot be opened with the existing filter.
    Existing users can apparently download a free viewer and convert their
    document to RTF or doc.
    
    Drop completely the code. while here also drop remnants of wpd support
    that we dropped since 3.4.1. Having less code is sometimes better.
    
    Adapted from:
    https://github.com/apache/openoffice/commit/7c12a1727a73ea1bc2b961e6886a8842366150da
---
 main/LICENSE                                     |   21 -
 main/configure.ac                                |   20 -
 main/hwpfilter/inc/makefile.mk                   |   43 -
 main/hwpfilter/inc/pch/precompiled_hwpfilter.cxx |   25 -
 main/hwpfilter/inc/pch/precompiled_hwpfilter.hxx |   28 -
 main/hwpfilter/prj/build.lst                     |    5 -
 main/hwpfilter/prj/d.lst                         |    5 -
 main/hwpfilter/source/attributes.cxx             |  164 -
 main/hwpfilter/source/attributes.hxx             |   70 -
 main/hwpfilter/source/cspline.cpp                |  169 -
 main/hwpfilter/source/cspline.h                  |   32 -
 main/hwpfilter/source/datecode.h                 |   53 -
 main/hwpfilter/source/drawdef.h                  |  258 --
 main/hwpfilter/source/drawing.h                  |  812 ----
 main/hwpfilter/source/fontmap.cpp                |  170 -
 main/hwpfilter/source/formula.cpp                |  685 ---
 main/hwpfilter/source/formula.h                  |   98 -
 main/hwpfilter/source/grammar.cpp                | 1471 -------
 main/hwpfilter/source/grammar.h                  |   61 -
 main/hwpfilter/source/hbox.cpp                   |  701 ---
 main/hwpfilter/source/hbox.h                     | 1039 -----
 main/hwpfilter/source/hcode.cpp                  | 1492 -------
 main/hwpfilter/source/hcode.h                    |   80 -
 main/hwpfilter/source/hfont.cpp                  |  103 -
 main/hwpfilter/source/hfont.h                    |   73 -
 main/hwpfilter/source/hgzip.cpp                  |  333 --
 main/hwpfilter/source/hgzip.h                    |  110 -
 main/hwpfilter/source/hinfo.cpp                  |  217 -
 main/hwpfilter/source/hinfo.h                    |  260 --
 main/hwpfilter/source/hiodev.cpp                 |  361 --
 main/hwpfilter/source/hiodev.h                   |  167 -
 main/hwpfilter/source/hpara.cpp                  |  320 --
 main/hwpfilter/source/hpara.h                    |  178 -
 main/hwpfilter/source/hstream.cpp                |   76 -
 main/hwpfilter/source/hstream.h                  |   62 -
 main/hwpfilter/source/hstyle.cpp                 |  152 -
 main/hwpfilter/source/hstyle.h                   |   57 -
 main/hwpfilter/source/htags.cpp                  |  158 -
 main/hwpfilter/source/htags.h                    |   85 -
 main/hwpfilter/source/hutil.cpp                  |   97 -
 main/hwpfilter/source/hutil.h                    |   43 -
 main/hwpfilter/source/hwp.component              |   30 -
 main/hwpfilter/source/hwpeq.cpp                  |  762 ----
 main/hwpfilter/source/hwpeq.h                    |   40 -
 main/hwpfilter/source/hwpfile.cpp                |  676 ---
 main/hwpfilter/source/hwpfile.h                  |  308 --
 main/hwpfilter/source/hwplib.h                   |  245 --
 main/hwpfilter/source/hwpread.cpp                |  831 ----
 main/hwpfilter/source/hwpreader.cxx              | 4938 ----------------------
 main/hwpfilter/source/hwpreader.hxx              |  373 --
 main/hwpfilter/source/ksc5601.h                  |  861 ----
 main/hwpfilter/source/lexer.cpp                  | 2434 -----------
 main/hwpfilter/source/list.hxx                   |  279 --
 main/hwpfilter/source/makefile.mk                |  100 -
 main/hwpfilter/source/mapping.h                  |  396 --
 main/hwpfilter/source/mzstring.cpp               |  310 --
 main/hwpfilter/source/mzstring.h                 |  183 -
 main/hwpfilter/source/nodes.h                    |  103 -
 main/hwpfilter/source/precompile.h               |   40 -
 main/hwpfilter/source/solver.cpp                 |  179 -
 main/hwpfilter/source/solver.h                   |   46 -
 main/rat-excludes                                |   11 +-
 main/scp2/source/writer/registryitem_writer.scp  |   18 -
 main/sysui/desktop/macosx/Info.plist             |    3 -
 main/toolkit/src2xml/include.lst                 |    5 -
 65 files changed, 1 insertion(+), 23524 deletions(-)

diff --git a/main/LICENSE b/main/LICENSE
index 0663214..6c2496e 100644
--- a/main/LICENSE
+++ b/main/LICENSE
@@ -754,27 +754,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 ____
 
-For main/hwpfilter/source/ksc5601.h:
-- MIT license
-
-Copyright (c) 1999-2000  Free Software Foundation, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-FREE SOFTWARE FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-____
-
 For main/soltools/mkdepend/*:
 - MIT license
 
diff --git a/main/configure.ac b/main/configure.ac
index 366fb69..57129a0 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -430,9 +430,6 @@ AC_ARG_WITH(system-jpeg,
 AC_ARG_WITH(system-expat,
 [  --with-system-expat     Use expat already on system
 ],,)
-AC_ARG_WITH(system-libwpd,
-[  --with-system-libwpd    Use libwpd already on system
-],,)
 AC_ARG_WITH(system-libxml,
 [  --with-system-libxml    Use libxml already on system
 ],,)
@@ -3770,23 +3767,6 @@ fi
 AC_SUBST(SYSTEM_EXPAT)
 
 dnl ===================================================================
-dnl Check for system libwpd
-dnl ===================================================================
-AC_MSG_CHECKING([which libwpd to use])
-if test -n "$with_system_libwpd" -o -n "$with_system_libs" && \
-        test "$with_system_libwpd" != "no"; then
-    AC_MSG_RESULT([external])
-    SYSTEM_LIBWPD=YES
-    PKG_CHECK_MODULES( LIBWPD, libwpd-0.8 )
-else
-    AC_MSG_RESULT([no])
-    SYSTEM_LIBWPD=
-fi
-AC_SUBST(SYSTEM_LIBWPD)
-AC_SUBST(LIBWPD_CFLAGS)
-AC_SUBST(LIBWPD_LIBS)
-
-dnl ===================================================================
 dnl Check for system cppunit
 dnl ===================================================================
 WITH_CPPUNIT=
diff --git a/main/hwpfilter/inc/makefile.mk b/main/hwpfilter/inc/makefile.mk
deleted file mode 100644
index c3ff078..0000000
--- a/main/hwpfilter/inc/makefile.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-#**************************************************************
-#  
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#  
-#    http://www.apache.org/licenses/LICENSE-2.0
-#  
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#  
-#**************************************************************
-
-
-PRJ=..
-
-PRJNAME=hwpfilter
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :  settings.mk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE :  target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
-	$(SLO)$/precompiled.pch \
-	$(SLO)$/precompiled_ex.pch
-	
-.ENDIF			# "$(ENABLE_PCH)"!=""
-
diff --git a/main/hwpfilter/inc/pch/precompiled_hwpfilter.cxx b/main/hwpfilter/inc/pch/precompiled_hwpfilter.cxx
deleted file mode 100644
index b6f021c..0000000
--- a/main/hwpfilter/inc/pch/precompiled_hwpfilter.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#include "precompiled_hwpfilter.hxx"
-
diff --git a/main/hwpfilter/inc/pch/precompiled_hwpfilter.hxx b/main/hwpfilter/inc/pch/precompiled_hwpfilter.hxx
deleted file mode 100644
index 73872a9..0000000
--- a/main/hwpfilter/inc/pch/precompiled_hwpfilter.hxx
+++ /dev/null
@@ -1,28 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:45.139559
-
-#ifdef PRECOMPILED_HEADERS
-#endif
-
diff --git a/main/hwpfilter/prj/build.lst b/main/hwpfilter/prj/build.lst
deleted file mode 100644
index 514602f..0000000
--- a/main/hwpfilter/prj/build.lst
+++ /dev/null
@@ -1,5 +0,0 @@
-hw	hwpfilter	:	offuh cppuhelper comphelper ZLIB:zlib LIBXSLT:libxslt NULL
-hw	hwpfilter							usr1	-	all	hw_mkout NULL
-hw	hwpfilter\prj						get		-	all	hw_prj NULL
-hw	hwpfilter\inc						nmake	-	all	hw_inc NULL
-hw	hwpfilter\source					nmake	-	all	hw_source hw_inc NULL
diff --git a/main/hwpfilter/prj/d.lst b/main/hwpfilter/prj/d.lst
deleted file mode 100644
index 0848b21..0000000
--- a/main/hwpfilter/prj/d.lst
+++ /dev/null
@@ -1,5 +0,0 @@
-..\%__SRC%\bin\hwp.dll %_DEST%\bin%_EXT%\hwp.dll
-..\%__SRC%\lib\ihwp*.lib %_DEST%\bin%_EXT%\ihwp*.lib
-..\%__SRC%\lib\libhwp.so %_DEST%\lib%_EXT%\libhwp.so
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\misc\hwp.component %_DEST%\xml%_EXT%\hwp.component
diff --git a/main/hwpfilter/source/attributes.cxx b/main/hwpfilter/source/attributes.cxx
deleted file mode 100644
index 504080d..0000000
--- a/main/hwpfilter/source/attributes.cxx
+++ /dev/null
@@ -1,164 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_hwpfilter.hxx"
-
-#include <assert.h>
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-#include "attributes.hxx"
-
-//using namespace ::std;
-
-struct TagAttribute
-{
-    TagAttribute(){}
-    TagAttribute( const OUString &rName, const OUString &rType , const OUString &rValue )
-    {
-        sName     = rName;
-        sType     = rType;
-        sValue    = rValue;
-    }
-
-    OUString sName;
-    OUString sType;
-    OUString sValue;
-};
-
-struct AttributeListImpl_impl
-{
-    AttributeListImpl_impl()
-    {
-// performance improvement during adding
-        vecAttribute.reserve(20);
-    }
-    std::vector<struct TagAttribute> vecAttribute;
-};
-
-sal_Int16 SAL_CALL AttributeListImpl::getLength(void) throw (RuntimeException)
-{
-    return (sal_Int16)m_pImpl->vecAttribute.size();
-}
-
-
-AttributeListImpl::AttributeListImpl( const AttributeListImpl &r ) :
-cppu::WeakImplHelper1<com::sun::star::xml::sax::XAttributeList>( r )
-{
-    m_pImpl = new AttributeListImpl_impl;
-    *m_pImpl = *(r.m_pImpl);
-}
-
-
-OUString AttributeListImpl::getNameByIndex(sal_Int16 i) throw (RuntimeException)
-{
-    sal_uInt32 i2 = sal::static_int_cast<sal_Int16>(i);
-    if( i >= 0 &&  i2 < m_pImpl->vecAttribute.size() )
-    {
-        return m_pImpl->vecAttribute[i].sName;
-    }
-    return OUString();
-}
-
-
-OUString AttributeListImpl::getTypeByIndex(sal_Int16 i) throw (RuntimeException)
-{
-    sal_uInt32 i2 = sal::static_int_cast<sal_Int16>(i);
-    if( i >= 0 &&  i2 < m_pImpl->vecAttribute.size() )
-    {
-        return m_pImpl->vecAttribute[i].sType;
-    }
-    return OUString();
-}
-
-
-OUString AttributeListImpl::getValueByIndex(sal_Int16 i) throw (RuntimeException)
-{
-    sal_uInt32 i2 = sal::static_int_cast<sal_Int16>(i);
-    if( i >= 0 &&  i2 < m_pImpl->vecAttribute.size() )
-    {
-        return m_pImpl->vecAttribute[i].sValue;
-    }
-    return OUString();
-
-}
-
-
-OUString AttributeListImpl::getTypeByName( const OUString& sName ) throw (RuntimeException)
-{
-    std::vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
-
-    for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ )
-    {
-        if( (*ii).sName == sName )
-        {
-            return (*ii).sType;
-        }
-    }
-    return OUString();
-}
-
-
-OUString AttributeListImpl::getValueByName(const OUString& sName) throw (RuntimeException)
-{
-    std::vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
-
-    for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ )
-    {
-        if( (*ii).sName == sName )
-        {
-            return (*ii).sValue;
-        }
-    }
-    return OUString();
-}
-
-
-AttributeListImpl::AttributeListImpl()
-{
-    m_pImpl = new AttributeListImpl_impl;
-}
-
-
-AttributeListImpl::~AttributeListImpl()
-{
-    delete m_pImpl;
-}
-
-
-void AttributeListImpl::addAttribute(   const OUString &sName ,
-const OUString &sType ,
-const OUString &sValue )
-{
-    m_pImpl->vecAttribute.push_back( TagAttribute( sName , sType , sValue ) );
-}
-
-
-void AttributeListImpl::clear()
-{
-    std::vector<struct TagAttribute> dummy;
-    m_pImpl->vecAttribute.swap( dummy );
-
-    assert( ! getLength() );
-}
diff --git a/main/hwpfilter/source/attributes.hxx b/main/hwpfilter/source/attributes.hxx
deleted file mode 100644
index 4b49b9b..0000000
--- a/main/hwpfilter/source/attributes.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-
-#ifndef _CONFIGMGR_MISC_ATTRIBUTES_HXX_
-#define _CONFIGMGR_MISC_ATTRIBUTES_HXX_
-
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-/*----------------------------------------
-*
-* 	Attributlist implementation
-*
-*----------------------------------------*/
-
-using namespace ::cppu;
-using namespace ::rtl;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::uno;
-
-struct AttributeListImpl_impl;
-class AttributeListImpl : public WeakImplHelper1< XAttributeList >
-{
-protected:
-	~AttributeListImpl();
-
-public:
-	AttributeListImpl();
-	AttributeListImpl( const AttributeListImpl & );
-	
-public:
-    virtual sal_Int16 SAL_CALL getLength(void) throw (RuntimeException);
-    virtual OUString  SAL_CALL getNameByIndex(sal_Int16 i) throw (RuntimeException);
-    virtual OUString  SAL_CALL getTypeByIndex(sal_Int16 i) throw (RuntimeException);
-    virtual OUString  SAL_CALL getTypeByName(const OUString& aName) throw (RuntimeException);
-    virtual OUString  SAL_CALL getValueByIndex(sal_Int16 i) throw (RuntimeException);
-    virtual OUString  SAL_CALL getValueByName(const OUString& aName) throw (RuntimeException);
-
-public:
-	void addAttribute( const OUString &sName , const OUString &sType , const OUString &sValue );
-	void clear();
-
-private:
-	struct AttributeListImpl_impl *m_pImpl;
-};
-
-#endif // _CONFIGMGR_MISC_ATTRIBUTES_HXX_
-
-
diff --git a/main/hwpfilter/source/cspline.cpp b/main/hwpfilter/source/cspline.cpp
deleted file mode 100644
index 8aab00f..0000000
--- a/main/hwpfilter/source/cspline.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-// Natural, Clamped, or Periodic Cubic Splines
-//
-// Input:  A list of N+1 points (x_i,a_i), 0 <= i <= N, which are sampled
-// from a function, a_i = f(x_i).  The function f is unknown.  Boundary
-// conditions are
-//   (1) Natural splines:  f"(x_0) = f"(x_N) = 0
-//   (2) Clamped splines:  f'(x_0) and f'(x_N) are user-specified.
-//   (3) Periodic splines:  f(x_0) = f(x_N) [in which case a_N = a_0 is
-//       required in the input], f'(x_0) = f'(x_N), and f"(x_0) = f"(x_N).
-//
-// Output: b_i, c_i, d_i, 0 <= i <= N-1, which are coefficients for the cubic
-// spline S_i(x) = a_i + b_i(x-x_i) + c_i(x-x_i)^2 + d_i(x-x_i)^3 for
-// x_i <= x < x_{i+1}.
-//
-// The natural and clamped algorithms were implemented from
-//
-//    Numerical Analysis, 3rd edition
-//    Richard L. Burden and J. Douglas Faires
-//    Prindle, Weber & Schmidt
-//    Boston, 1985, pp. 122-124.
-//
-// The algorithm sets up a tridiagonal linear system of equations in the
-// c_i values.  This can be solved in O(N) time.
-//
-// The periodic spline algorithm was implemented from my own derivation.  The
-// linear system of equations is not tridiagonal.  For now I use a standard
-// linear solver that does not take advantage of the sparseness of the
-// matrix.  Therefore for very large N, you may have to worry about memory
-// usage.
-
-#include "solver.h"
-//-----------------------------------------------------------------------------
-void NaturalSpline (int N, double* x, double* a, double*& b, double*& c,
-    double*& d)
-{
-  const double oneThird = 1.0/3.0;
-
-  int i;
-  double* h = new double[N];
-  double* hdiff = new double[N];
-  double* alpha = new double[N];
-
-  for (i = 0; i < N; i++){
-    h[i] = x[i+1]-x[i];
-  }
-
-  for (i = 1; i < N; i++)
-    hdiff[i] = x[i+1]-x[i-1];
-
-  for (i = 1; i < N; i++)
-  {
-    double numer = 3.0*(a[i+1]*h[i-1]-a[i]*hdiff[i]+a[i-1]*h[i]);
-    double denom = h[i-1]*h[i];
-    alpha[i] = numer/denom;
-  }
-
-  double* ell = new double[N+1];
-  double* mu = new double[N];
-  double* z = new double[N+1];
-  double recip;
-
-  ell[0] = 1.0;
-  mu[0] = 0.0;
-  z[0] = 0.0;
-
-  for (i = 1; i < N; i++)
-  {
-    ell[i] = 2.0*hdiff[i]-h[i-1]*mu[i-1];
-    recip = 1.0/ell[i];
-    mu[i] = recip*h[i];
-    z[i] = recip*(alpha[i]-h[i-1]*z[i-1]);
-  }
-  ell[N] = 1.0;
-  z[N] = 0.0;
-
-  b = new double[N];
-  c = new double[N+1];
-  d = new double[N];
-
-  c[N] = 0.0;
-
-  for (i = N-1; i >= 0; i--)
-  {
-    c[i] = z[i]-mu[i]*c[i+1];
-    recip = 1.0/h[i];
-    b[i] = recip*(a[i+1]-a[i])-h[i]*(c[i+1]+2.0*c[i])*oneThird;
-    d[i] = oneThird*recip*(c[i+1]-c[i]);
-  }
-
-  delete[] h;
-  delete[] hdiff;
-  delete[] alpha;
-  delete[] ell;
-  delete[] mu;
-  delete[] z;
-}
-
-void PeriodicSpline (int N, double* x, double* a, double*& b, double*& c,
-    double*& d)
-{
-  double* h = new double[N];
-  int i;
-  for (i = 0; i < N; i++)
-    h[i] = x[i+1]-x[i];
-
-  mgcLinearSystemD sys;
-  double** mat = sys.NewMatrix(N+1);  // guaranteed to be zeroed memory
-  c = sys.NewVector(N+1);   // guaranteed to be zeroed memory
-
-  // c[0] - c[N] = 0
-  mat[0][0] = +1.0f;
-  mat[0][N] = -1.0f;
-
-  // h[i-1]*c[i-1]+2*(h[i-1]+h[i])*c[i]+h[i]*c[i+1] =
-  //   3*{(a[i+1]-a[i])/h[i] - (a[i]-a[i-1])/h[i-1]}
-  for (i = 1; i <= N-1; i++)
-  {
-    mat[i][i-1] = h[i-1];
-    mat[i][i  ] = 2.0f*(h[i-1]+h[i]);
-    mat[i][i+1] = h[i];
-    c[i] = 3.0f*((a[i+1]-a[i])/h[i] - (a[i]-a[i-1])/h[i-1]);
-  }
-
-  // "wrap around equation" for periodicity
-  // h[N-1]*c[N-1]+2*(h[N-1]+h[0])*c[0]+h[0]*c[1] =
-  //   3*{(a[1]-a[0])/h[0] - (a[0]-a[N-1])/h[N-1]}
-  mat[N][N-1] = h[N-1];
-  mat[N][0  ] = 2.0f*(h[N-1]+h[0]);
-  mat[N][1  ] = h[0];
-  c[N] = 3.0f*((a[1]-a[0])/h[0] - (a[0]-a[N-1])/h[N-1]);
-
-  // solve for c[0] through c[N]
-  sys.Solve(N+1,mat,c);
-
-  const double oneThird = 1.0/3.0;
-  b = new double[N];
-  d = new double[N];
-  for (i = 0; i < N; i++)
-  {
-    b[i] = (a[i+1]-a[i])/h[i] - oneThird*(c[i+1]+2.0f*c[i])*h[i];
-    d[i] = oneThird*(c[i+1]-c[i])/h[i];
-  }
-
-  delete[] h;
-  sys.DeleteMatrix(N+1,mat);
-}
diff --git a/main/hwpfilter/source/cspline.h b/main/hwpfilter/source/cspline.h
deleted file mode 100644
index ddb182a..0000000
--- a/main/hwpfilter/source/cspline.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#ifndef _CSPLINE_H_
-#define _CSPLINE_H_
-
-void NaturalSpline (int N, double* x, double* a, double*& b, double*& c,
-    double*& d);
-void PeriodicSpline (int N, double* x, double* a, double*& b, double*& c,
-    double*& d);
-
-#endif /* _CSPLINE_H_ */
diff --git a/main/hwpfilter/source/datecode.h b/main/hwpfilter/source/datecode.h
deleted file mode 100644
index e4fca7a..0000000
--- a/main/hwpfilter/source/datecode.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#ifndef __DATECODE_H__
-#define __DATACODE_H__
-
-static hchar defaultform[] =
-{
-    '1', 0x9165, 32, '2', 0xB6A9, 32, '3', 0xB7A9, 0
-};
-#ifdef _DATECODE_WEEK_DEFINES_
-static hchar kor_week[] =
-{
-    0xB7A9, 0xB6A9, 0xD1C1, 0xAE81, 0xA1A2, 0x8B71, 0xC9A1
-};
-static hchar china_week[] =
-{
-    0x4CC8, 0x4BE4, 0x525A, 0x48D8, 0x45AB, 0x4270, 0x50B4
-};
-static char eng_week[] = { "SunMonTueWedThuFriSat" };
-static char eng_mon[] = { "JanFebMarAprMayJunJulAugSepOctNovDec" };
-static const char *en_mon[] =
-{
-    "January", "February", "March", "April", "May", "June", "July",
-    "August", "September", "October", "November", "December"
-};
-static const char *en_week[] =
-{
-    "Sunday", "Monday", "Tuesday", "Wednesday",
-    "Thursday", "Friday", "Saturday"
-};
-#endif //_DATECODE_WEEK_DEFINES_
-#endif
diff --git a/main/hwpfilter/source/drawdef.h b/main/hwpfilter/source/drawdef.h
deleted file mode 100644
index 3f7ba1e..0000000
--- a/main/hwpfilter/source/drawdef.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* NAME $Id: drawdef.h,v 1.5 2008-04-10 11:58:04 rt Exp $
- *
- * HISTORY
- *        frog - Jan 11, 1999: Created.
- */
-
-#ifndef _DRAWDEF_H_
-#define _DRAWDEF_H_
-
-#include "hwplib.h"
-
-class HWPPara;
-
-/**
- * Constant for drawing objects
- */
-enum objtype
-{
-    HWPDO_CONTAINER,
-    HWPDO_LINE,
-    HWPDO_RECT,
-    HWPDO_ELLIPSE,
-    HWPDO_ARC,
-    HWPDO_FREEFORM,
-    HWPDO_TEXTBOX,
-    HWPDO_CURVE,
-    HWPDO_ADVANCED_ELLIPSE,
-    HWPDO_ADVANCED_ARC,
-    HWPDO_CLOSED_FREEFORM,
-    HWPDO_NITEMS
-};
-
-#define HWPDO_PAT_TYPE_BITS 0xFF000000
-#define HWPDO_PAT_STYLE_BITS    0x00FFFFFF
-
-#define HWPDO_PAT_SOLID     0x00000000
-#define HWPDO_PAT_WIN_HATCHED   0x01000000
-#define HWPDO_PAT_BITMAP    0x02000000
-
-#define HWPDO_COLOR_NONE    0x10000000
-
-#define HWPDO_FLAG_ROUND_CORNER 0x00000001
-#define HWPDO_FLAG_DRAW_PIE 0x00000002
-#define HWPDO_FLAG_SEMICIRCLE   0x00000004
-#define HWPDO_FLAG_SCALE_BITMAP 0x00000008
-
-#define HWPDO_FLAG_LOCAL_BITS   0x0000ffff
-#define HWPDO_FLAG_PROPERTY_BITS 0x00ff0000
-
-#define HWPDO_FLAG_GRADATION    0x00010000
-#define HWPDO_FLAG_ROTATION 0x00020000
-#define HWPDO_FLAG_BITMAP   0x00040000
-#define HWPDO_FLAG_AS_TEXTBOX   0x00080000
-#define HWPDO_FLAG_WATERMARK   0x00100000
-
-/**
- * @short Basic properties for drawing objects
- *
- * The order of pstyle, hstyle and tstyle is important.
- * @see LineObject
- */
-struct BAREHWPDOProperty
-{
-    int line_pstyle;
-    int line_hstyle;
-    int line_tstyle;
-    DWORD line_color;
-    hunit line_width;
-    DWORD fill_color;
-    uint pattern_type;
-    DWORD pattern_color;
-    hunit hmargin;
-    hunit vmargin;
-    uint flag;
-};
-
-/**
- * @short Gradation properties for drawing object
- */
-struct GradationProperty
-{
-    int fromcolor;
-    int tocolor;
-    int gstyle;
-    int angle;
-    int center_x;
-    int center_y;
-    int nstep;
-};
-
-/**
- * @short Bitmap properties for drawing object
- */
-struct BitmapProperty
-{
-    ZZPoint offset1;
-    ZZPoint offset2;
-    char szPatternFile[260 + 1];
-    char pictype;
-};
-
-/**
- * @short Rotation properties for drawing object
- */
-struct RotationProperty
-{
-    int rot_originx;
-    int rot_originy;
-    ZZParall parall;
-};
-
-/**
- * @short All properties for drawing object
- */
-struct HWPDOProperty
-{
-    int line_pstyle; /* 선 중간 모양 */
-    int line_hstyle; /* 끝 화살표 모양 */
-    int line_tstyle; /* 시작 모양 */
-    DWORD line_color;
-    hunit line_width;
-    DWORD fill_color;
-    uint pattern_type;
-    DWORD pattern_color;
-    hunit hmargin;
-    hunit vmargin;
-    uint flag;
-
-	 /* Lotation properties */
-    int rot_originx;
-    int rot_originy;
-    ZZParall parall;
-
-	 /* Gradation properties */
-
-    int fromcolor;
-    int tocolor;
-    int gstyle;
-    int angle;
-    int center_x;
-    int center_y;
-    int nstep;
-
-	 /* Watermark */
-	 int luminance;
-	 int contrast;
-	 int greyscale;
-
-	 /* As TextBox */
-    HWPPara *pPara;
-
-
-    ZZPoint offset1;
-    ZZPoint offset2;
-    char szPatternFile[260 + 1];
-    char pictype;
-};
-
-/**
- * @short Line Object
- */
-struct HWPDOLine
-{
-    uint flip;
-};
-
-/**
- * @short Polygon or Polyline Object
- */
-struct HWPDOFreeForm
-{
-    int npt;
-    ZZPoint *pt;
-};
-
-/**
- * @short Textbox Object
- */
-struct HWPDOTextBox
-{
-    HWPPara *h;
-};
-
-/**
- * @short Arc Object
- */
-struct HWPDOArc
-{
-    ZZPoint radial[2];
-};
-
-/**
- * @short Common header for drawing object
- */
-struct HWPDrawingObject
-{
-/**
- * type of drawing object
- */
-    int type;
-/**
- * offset from origin of current group
- */
-    ZZPoint offset;
-/**
- * offset from origin of drawing object
- */
-    ZZPoint offset2;
-    ZZSize extent;
-/**
- * rectangle with consideration of line width
- */
-    ZZRect vrect;
-    HWPDOProperty property;
-    union
-    {
-        HWPDOLine line_arc;
-        HWPDOFreeForm freeform;
-        HWPDOTextBox textbox;
-/**
- * extended from hwpw96
- */
-        HWPDOArc arc;
-    }
-    u;
-    struct HWPDrawingObject *next;
-/**
- * This exists for container object
- */
-    struct HWPDrawingObject *child;
-    int index;
-    HWPDrawingObject();
-    ~HWPDrawingObject();
-};
-#endif                                            /* _DRAWDEF_H_ */
diff --git a/main/hwpfilter/source/drawing.h b/main/hwpfilter/source/drawing.h
deleted file mode 100644
index f36fab1..0000000
--- a/main/hwpfilter/source/drawing.h
+++ /dev/null
@@ -1,812 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#ifndef _DRAWING_H_
-#define _DRAWING_H_
-
-/* NAME
- *
- * NOTES
- *
- * HISTORY
- *   frog - Jan 11, 1999: Created.
- *   frog - Nov 20, 2000: remove display function, only needed loading object from binary
- */
-#include "precompile.h"
-
-#include <math.h>
-
-#include <comphelper/newarray.hxx>
-
-#include "hwplib.h"
-#include "hwpfile.h"
-#include "hiodev.h"
-#include "hbox.h"
-#include "drawdef.h"
-
-enum
-{
-    OBJFUNC_LOAD,
-    OBJFUNC_FREE,
-    OBJFUNC_DISPLAY,
-    OBJFUNC_NITEM
-};
-
-enum
-{
-    BEGIN_GRADATION = 0, LINEAR, RADIAL, CONICAL, SQUARE,
-    END_GRADATION, BITMAP_PATTERN
-};
-
-#define OBJRET_FILE_OK           0
-#define OBJRET_FILE_ERROR       (-1)
-#define OBJRET_FILE_NO_PRIVATE_BLOCK    (-2)
-#define OBJRET_FILE_NO_PRIVATE_BLOCK_2  (-3)
-
-typedef int (*HWPDOFuncType) (int, HWPDrawingObject *, int, void *, int);
-
-#define HWPDOFunc(hdo, cmd, argp, argv) \
-    (HWPDOFuncTbl[(hdo)->type]((hdo)->type, (hdo), (cmd), (argp), (argv)))
-#define HWPDOFunc2(type, cmd, argp, argv) \
-    (HWPDOFuncTbl[(type)]((type), NULL, (cmd), (argp), (argv)))
-
-static int HWPDOLineFunc(int, HWPDrawingObject *, int, void *, int);
-static int HWPDORectFunc(int, HWPDrawingObject *, int, void *, int);
-static int HWPDOEllipseFunc(int, HWPDrawingObject *, int, void *, int);
-static int HWPDOArcFunc(int, HWPDrawingObject *, int, void *, int);
-static int HWPDOFreeFormFunc(int, HWPDrawingObject *, int, void *, int);
-static int HWPDOTextBoxFunc(int, HWPDrawingObject *, int, void *, int);
-static int HWPDOEllipse2Func(int, HWPDrawingObject *, int, void *, int);
-static int HWPDOArc2Func(int, HWPDrawingObject *, int, void *, int);
-static int HWPDOContainerFunc(int, HWPDrawingObject *, int, void *, int);
-static HWPPara *LoadParaList();
-
-HWPDOFuncType HWPDOFuncTbl[] =
-{
-    HWPDOContainerFunc,
-    HWPDOLineFunc,
-    HWPDORectFunc,
-    HWPDOEllipseFunc,
-    HWPDOArcFunc,
-    HWPDOFreeFormFunc,
-    HWPDOTextBoxFunc,
-    HWPDOFreeFormFunc,
-    HWPDOEllipse2Func,
-    HWPDOArc2Func,
-    HWPDOFreeFormFunc,
-};
-
-static HMemIODev *hmem = 0;
-
-static int count = 0;
-
-inline bool HAVE_FCOLOR(HWPDrawingObject * hdo)
-{
-    return hdo->property.fill_color != HWPDO_COLOR_NONE;
-}
-
-
-inline bool HAVE_PATTERN(HWPDrawingObject * hdo)
-{
-    return (hdo->property.pattern_type & HWPDO_PAT_TYPE_BITS)
-        != HWPDO_PAT_SOLID && hdo->property.pattern_color != HWPDO_COLOR_NONE;
-}
-
-
-inline bool HAVE_GRADATION(HWPDrawingObject * hdo)
-{
-    return hdo->property.gstyle > BEGIN_GRADATION &&
-        hdo->property.gstyle < END_GRADATION &&
-        hdo->property.fromcolor != HWPDO_COLOR_NONE &&
-        hdo->property.tocolor != HWPDO_COLOR_NONE;
-}
-
-
-inline bool HAVE_BITMAP_PATTERN(HWPDrawingObject * hdo)
-{
-    return hdo->property.gstyle == BITMAP_PATTERN &&
-        hdo->property.szPatternFile[0];
-}
-
-
-inline bool HAS_PAT(HWPDrawingObject * hdo)
-{
-    return HAVE_FCOLOR(hdo) || HAVE_PATTERN(hdo) ||
-        HAVE_GRADATION(hdo) || HAVE_BITMAP_PATTERN(hdo);
-}
-
-
-static void SetHdoParallRgn(HWPDrawingObject * hdo, int width, int height)
-{
-    hdo->property.parall.pt[0].x = 0;
-    hdo->property.parall.pt[0].y = 0;
-    hdo->property.parall.pt[1].x = width;
-    hdo->property.parall.pt[1].y = 0;
-    hdo->property.parall.pt[2].x = width;
-    hdo->property.parall.pt[2].y = height;
-}
-
-
-static bool SkipPrivateBlock(int type)
-{
-    int n;
-
-    if (type == OBJRET_FILE_NO_PRIVATE_BLOCK)
-    {
-        n = hmem->read4b();
-        if (hmem->state() || hmem->skipBlock(n) != n)
-            return false;
-    }
-    n = hmem->read4b();
-    if (hmem->state())
-        return false;
-    return hmem->skipBlock(n) == n;
-}
-
-
-static int SizeExpected;
-static int SizeRead;
-
-static int ReadSizeField(int size)
-{
-    SizeExpected = size;
-    SizeRead = hmem->read4b();
-    if (hmem->state())
-        return -1;
-    return SizeRead;
-}
-
-
-static bool SkipUnusedField(void)
-{
-    return (SizeExpected < SizeRead) ?
-        hmem->skipBlock(SizeRead - SizeExpected) != 0 : true;
-}
-
-
-#define HDOFILE_HEADER_SIZE (2*4+16)              // 16=sizeof(ZZRect)
-#define HDOFILE_COMMON_SIZE (7*4+16+44)
-
-#define HDOFILE_HAS_NEXT    0x01
-#define HDOFILE_HAS_CHILD   0x02
-
-/**
- * 공통 헤더를 읽어드린다.
- * 개체종류/연결정보/상대위치/개체크기/절대위치/차지영역/기본속성/회전속성/그라데이션/비트맵패턴
- */
-static bool LoadCommonHeader(HWPDrawingObject * hdo, WORD * link_info)
-{
-    uint size, property_size, common_size;
-
-	 if( !hmem )
-		 return FALSE;
-    size = hmem->read4b();
-    if (hmem->state())
-    {
-        return FALSE;
-    }
-    if (size < HDOFILE_COMMON_SIZE)
-    {
-        return FALSE;
-    }
-
-    common_size = HDOFILE_COMMON_SIZE;
-    property_size = 44;
-    hdo->type = hmem->read2b();
-    *link_info = sal::static_int_cast<WORD>(hmem->read2b());
-    hdo->offset.x = hmem->read4b();
-    hdo->offset.y = hmem->read4b();
-    hdo->extent.w = hmem->read4b();
-    hdo->extent.h = hmem->read4b();
-    hdo->offset2.x = hmem->read4b();
-    hdo->offset2.y = hmem->read4b();
-
-    if (hmem->state())
-        return FALSE;
-
-    hdo->vrect.x = hmem->read4b();
-    hdo->vrect.y = hmem->read4b();
-    hdo->vrect.w = hmem->read4b();
-    hdo->vrect.h = hmem->read4b();
-
-// read bare property 44 bytes
-    hdo->property.line_pstyle = hmem->read4b();
-    hdo->property.line_hstyle = hmem->read4b();
-    hdo->property.line_tstyle = hmem->read4b();
-    hdo->property.line_color = hmem->read4b();
-    hdo->property.line_width = (hunit) hmem->read4b();
-    hdo->property.fill_color = hmem->read4b();
-    hdo->property.pattern_type = hmem->read4b();
-    hdo->property.pattern_color = hmem->read4b();
-    hdo->property.hmargin = (hunit) hmem->read4b();
-    hdo->property.vmargin = (hunit) hmem->read4b();
-    hdo->property.flag = hmem->read4b();
-// read ratation property 32 bytes
-    if ((size >= common_size + 32)
-        && (hdo->property.flag & HWPDO_FLAG_ROTATION))
-    {
-        hdo->property.rot_originx = hmem->read4b();
-        hdo->property.rot_originy = hmem->read4b();
-        for (int ii = 0; ii < 3; ii++)
-        {
-            hdo->property.parall.pt[ii].x = hmem->read4b();
-            hdo->property.parall.pt[ii].y = hmem->read4b();
-        }
-        common_size += 32;
-    }
-    else
-        SetHdoParallRgn(hdo, hdo->extent.w, hdo->extent.h);
-
-// read gradient property 28 bytes
-    if ((size >= common_size + 28) &&
-        (hdo->property.flag & HWPDO_FLAG_GRADATION))
-    {
-        hdo->property.fromcolor = hmem->read4b();
-        hdo->property.tocolor = hmem->read4b();
-        hdo->property.gstyle = hmem->read4b();
-        hdo->property.angle = hmem->read4b();
-        hdo->property.center_x = hmem->read4b();
-        hdo->property.center_y = hmem->read4b();
-        hdo->property.nstep = hmem->read4b();
-        common_size += 28;
-    }
-
-// read bitmap property 278 bytes
-    if ((size >= common_size + 278) && \
-        (hdo->property.flag & HWPDO_FLAG_BITMAP))
-    {
-        hdo->property.offset1.x = hmem->read4b();
-        hdo->property.offset1.y = hmem->read4b();
-        hdo->property.offset2.x = hmem->read4b();
-        hdo->property.offset2.y = hmem->read4b();
-        if (!hmem->readBlock(hdo->property.szPatternFile, 261))
-            return FALSE;
-        hdo->property.pictype = sal::static_int_cast<char>(hmem->read1b());
-        common_size += 278;
-    }
-	 if( ( size >= common_size + 3 ) && ( hdo->property.flag & HWPDO_FLAG_WATERMARK ) )
-	 //if( ( size >= common_size ) && ( hdo->property.flag >> 20 & 0x01 ) )
-	 {
-		  if( size - common_size >= 5 )
-			  hmem->skipBlock( 2 );
-		 hdo->property.luminance = hmem->read1b();
-		 hdo->property.contrast = hmem->read1b();
-		 hdo->property.greyscale = hmem->read1b();
-		 common_size += 5;
-	 }
-	else{
-		 hdo->property.luminance = 0;
-		 hdo->property.contrast = 0;
-		 hdo->property.greyscale = 0;
-	}
-	 hdo->property.pPara = 0L;
-
-	 if( ( size > common_size ) && (hdo->property.flag & HWPDO_FLAG_AS_TEXTBOX) )
-	 {
-		  hmem->skipBlock(8);
-		  hdo->property.pPara = LoadParaList();
-		  if( hdo->property.pPara )
-				return TRUE;
-		  else
-				return FALSE;
-	 }
-
-	 if( size <= common_size )
-		  return TRUE;
-	 return hmem->skipBlock(size - common_size ) != 0;
-}
-
-
-static HWPDrawingObject *LoadDrawingObject(void)
-{
-    HWPDrawingObject *hdo, *head, *prev;
-    int res;
-
-    WORD link_info;
-
-    head = prev = NULL;
-    do
-    {
-        if ((hdo = new HWPDrawingObject) == NULL)
-        {
-            goto error;
-        }
-        if (!LoadCommonHeader(hdo, &link_info))
-        {
-            goto error;
-        }
-        if (hdo->type < 0 || hdo->type >= HWPDO_NITEMS)
-        {
-            hdo->type = HWPDO_RECT;
-            if (!SkipPrivateBlock(OBJRET_FILE_NO_PRIVATE_BLOCK))
-            {
-                goto error;
-            }
-        }
-        else
-        {
-            switch (res = HWPDOFunc(hdo, OBJFUNC_LOAD, NULL, 0))
-            {
-                case OBJRET_FILE_ERROR:
-                    goto error;
-                case OBJRET_FILE_OK:
-                    break;
-                case OBJRET_FILE_NO_PRIVATE_BLOCK:
-                case OBJRET_FILE_NO_PRIVATE_BLOCK_2:
-                    if (!SkipPrivateBlock(res))
-                        goto error;
-                    break;
-            }
-        }
-        if (link_info & HDOFILE_HAS_CHILD)
-        {
-            hdo->child = LoadDrawingObject();
-            if (hdo->child == NULL)
-            {
-                goto error;
-            }
-        }
-        if (prev == NULL)
-            head = hdo;
-        else
-            prev->next = hdo;
-        prev = hdo;
-    }
-    while (link_info & HDOFILE_HAS_NEXT);
-
-    return head;
-    error:
-// drawing object can be list.
-// hdo = current item, head = list;
-
-    if (hdo != NULL)
-    {
-        HWPDOFunc(hdo, OBJFUNC_FREE, NULL, 0);
-        delete hdo;
-    }
-    if( prev )
-    {
-        prev->next = NULL;
-        return head;
-    }
-    else
-        return 0;
-}
-
-
-static bool LoadDrawingObjectBlock(Picture * pic)
-{
-    int size = hmem->read4b();
-
-    if (hmem->state() || size < HDOFILE_HEADER_SIZE)
-        return false;
-
-    pic->picinfo.picdraw.zorder = hmem->read4b();
-    pic->picinfo.picdraw.mbrcnt = hmem->read4b();
-    pic->picinfo.picdraw.vrect.x = hmem->read4b();
-    pic->picinfo.picdraw.vrect.y = hmem->read4b();
-    pic->picinfo.picdraw.vrect.w = hmem->read4b();
-    pic->picinfo.picdraw.vrect.h = hmem->read4b();
-
-    if (size > HDOFILE_HEADER_SIZE &&
-        !hmem->skipBlock(size - HDOFILE_HEADER_SIZE))
-        return false;
-
-    pic->picinfo.picdraw.hdo = LoadDrawingObject();
-    if (pic->picinfo.picdraw.hdo == 0)
-        return false;
-    return true;
-}
-
-
-// object manipulation function
-
-static int
-HWPDODefaultFunc(int , HWPDrawingObject * , int cmd, void *, int)
-{
-    if (cmd == OBJFUNC_LOAD)
-        return OBJRET_FILE_NO_PRIVATE_BLOCK;
-    return true;
-}
-
-
-// arrow polygon
-
-/* os 06.09.2005: unused function
-static void
-calcArrowPolygonPts(long lWidth, ZZPoint * arrowPt,
-ZZPoint * boxPt, int x1, int y1, int x2, int y2)
-{
-    long lLength = lWidth;
-    int dx, dy;
-
-#if 0
-    if (gc->lineWidth > ONE_MILI)
-        lWidth = lLength = DRPX2(gc->lineWidth) * 2;
-    else
-        lWidth = lLength = DRPX2(ARROW_WIDTH);
-#endif
-
-    dx = x1 - x2;
-    dy = y1 - y2;
-
-    if (dx == 0)
-    {
-        arrowPt[0].x = x1;
-        boxPt[3].x = boxPt[0].x = arrowPt[1].x = x1 + lWidth;
-        boxPt[2].x = boxPt[1].x = arrowPt[2].x = x1 - lWidth;
-        if (y1 > y2)
-        {
-            boxPt[2].y = boxPt[3].y = y1 + lLength * 2 / 3;
-            arrowPt[0].y = y1 + lLength * 3 / 2;
-            boxPt[0].y = boxPt[1].y = arrowPt[1].y = arrowPt[2].y = y1 - lLength;
-        }
-        else
-        {
-            boxPt[0].y = boxPt[1].y = y1 - lLength * 2 / 3;
-            arrowPt[0].y = y1 - lLength * 3 / 2;
-            boxPt[2].y = boxPt[3].y = arrowPt[1].y = arrowPt[2].y = y1 + lLength;
-        }
-        return;
-    }
-
-    double rSlope, rRadians;
-    long DX1, DY1, DX2, DY2;
-
-    rSlope = (double) dy / (double) dx;
-    rRadians = atan(rSlope);
-    DX1 = (long) (lLength * cos(rRadians) + 0.5);
-    DY1 = (long) (lLength * sin(rRadians) + 0.5);
-    DX2 = (long) (lWidth * sin(rRadians) + 0.5);
-    DY2 = (long) (lWidth * cos(rRadians) + 0.5);
-
-    if (dx > 0)
-    {
-        arrowPt[0].x = (int) (x1 + cos(rRadians) * lLength * 3 / 2);
-        arrowPt[0].y = (int) (y1 + sin(rRadians) * lLength * 3 / 2);
-        boxPt[0].x = arrowPt[1].x = x1 - DX1 - DX2;
-        boxPt[0].y = arrowPt[1].y = y1 - DY1 + DY2;
-        boxPt[1].x = arrowPt[2].x = x1 - DX1 + DX2;
-        boxPt[1].y = arrowPt[2].y = y1 - DY1 - DY2;
-        boxPt[2].x = arrowPt[0].x - DX1 + DX2;
-        boxPt[2].y = arrowPt[0].y - DY1 - DY2;
-        boxPt[3].x = arrowPt[0].x - DX1 - DX2;
-        boxPt[3].y = arrowPt[0].y - DY1 + DY2;
-    }
-    else
-    {
-        arrowPt[0].x = (int) (x1 - cos(rRadians) * lLength * 3 / 2);
-        arrowPt[0].y = (int) (y1 - sin(rRadians) * lLength * 3 / 2);
-        boxPt[0].x = arrowPt[1].x = x1 + DX1 - DX2;
-        boxPt[0].y = arrowPt[1].y = y1 + DY1 + DY2;
-        boxPt[1].x = arrowPt[2].x = x1 + DX1 + DX2;
-        boxPt[1].y = arrowPt[2].y = y1 + DY1 - DY2;
-        boxPt[3].x = arrowPt[0].x + DX1 - DX2;
-        boxPt[3].y = arrowPt[0].y + DY1 + DY2;
-        boxPt[2].x = arrowPt[0].x + DX1 + DX2;
-        boxPt[2].y = arrowPt[0].y + DY1 - DY2;
-    }
-}
-*/
-
-static int
-HWPDOLineFunc(int type, HWPDrawingObject * hdo, int cmd, void *argp, int argv)
-{
-    switch (cmd)
-    {
-        case OBJFUNC_LOAD:
-            if (ReadSizeField(4) < 4)
-                return OBJRET_FILE_ERROR;
-            hdo->u.line_arc.flip = hmem->read4b();
-            if (hmem->state())
-                return OBJRET_FILE_ERROR;
-            if (!SkipUnusedField())
-                return OBJRET_FILE_ERROR;
-            return OBJRET_FILE_NO_PRIVATE_BLOCK_2;
-        default:
-            return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-    }
-    return true;
-}
-
-
-// rectangle
-
-static int
-HWPDORectFunc(int type, HWPDrawingObject * hdo, int cmd, void *argp, int argv)
-{
-	return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-}
-
-
-// ellipse
-
-static int
-HWPDOEllipseFunc(int type, HWPDrawingObject * hdo,
-int cmd, void *argp, int argv)
-{
-    return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-}
-
-#define WTMM(x)     ((double)(x) / 1800. * 25.4)
-static int
-HWPDOEllipse2Func(int type, HWPDrawingObject * hdo,
-int cmd, void *argp, int argv)
-{
-    switch (cmd)
-    {
-        case OBJFUNC_LOAD:
-            if (ReadSizeField(16) < 16)
-                return OBJRET_FILE_ERROR;
-            hdo->u.arc.radial[0].x = hmem->read4b();
-            hdo->u.arc.radial[0].y = hmem->read4b();
-            hdo->u.arc.radial[1].x = hmem->read4b();
-            hdo->u.arc.radial[1].y = hmem->read4b();
-
-            if (ReadSizeField(0) < 0)
-                return OBJRET_FILE_ERROR;
-            break;
-        default:
-            return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-    }
-    return true;
-}
-
-
-// arc
-
-static int
-HWPDOArcFunc(int type, HWPDrawingObject * hdo, int cmd, void *argp, int argv)
-{
-// TRACE("arc");
-    switch (cmd)
-    {
-        case OBJFUNC_LOAD:
-            if (ReadSizeField(4) < 4)
-                return OBJRET_FILE_ERROR;
-            hdo->u.line_arc.flip = hmem->read4b();
-            if (hmem->state())
-                return OBJRET_FILE_ERROR;
-            if (!SkipUnusedField())
-                return OBJRET_FILE_ERROR;
-            break;
-        default:
-            return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-    }
-    return true;
-}
-
-
-static int
-HWPDOArc2Func(int type, HWPDrawingObject * hdo, int cmd, void *argp, int argv)
-{
-// TRACE("arc2");
-    switch (cmd)
-    {
-        case OBJFUNC_LOAD:
-            return OBJRET_FILE_NO_PRIVATE_BLOCK;
-        default:
-            return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-    }
-    return true;
-}
-
-
-// freeform
-
-#define SPLINE_NSTEP    100
-#define SPLINE_UNIT 20
-#define SPLINE_UNIT2    40
-#define SPLINE_UNIT3    60
-
-/* os 06.09.2005: unused function
-static int getBlend(int alpha)
-{
-    static bool first = true;
-    static char isCached[SPLINE_NSTEP];
-    static int blend[SPLINE_NSTEP];
-    double ntheta;
-
-    if (first)
-    {
-        memset(isCached, 0, sizeof(char) * SPLINE_NSTEP);
-
-        first = FALSE;
-    }
-    if ((alpha < -SPLINE_UNIT2) || (alpha > SPLINE_UNIT2))
-        return 0;
-
-    if (!isCached[alpha + SPLINE_UNIT2])
-    {
-        isCached[alpha + SPLINE_UNIT2] = TRUE;
-        ntheta = (double) alpha / SPLINE_UNIT;
-
-        if ((alpha < -SPLINE_UNIT) || (alpha > SPLINE_UNIT))
-        {
-            ntheta = (ntheta > 1) ? (2 - ntheta) : (2 + ntheta);
-            blend[alpha + SPLINE_UNIT2] =
-                (int) (1000 * ntheta * ntheta * ntheta / 6.);
-        }
-        else if (alpha <= 0)
-            blend[alpha + SPLINE_UNIT2] =
-                    (int) (1000 *
-                    (4 - 6 * ntheta * ntheta -
-                    3 * ntheta * ntheta * ntheta) / 6);
-        else
-            blend[alpha + SPLINE_UNIT2] =
-                (int) (1000 *
-                (4 - 6 * ntheta * ntheta +
-                3 * ntheta * ntheta * ntheta) / 6);
-    }
-    return blend[alpha + SPLINE_UNIT2];
-}
-*/
-
-
-static int
-HWPDOFreeFormFunc(int type, HWPDrawingObject * hdo,
-int cmd, void *argp, int argv)
-{
-    switch (cmd)
-    {
-        case OBJFUNC_LOAD:
-        {
-            hdo->u.freeform.pt = 0;
-            if (ReadSizeField(4) < 4)
-                return OBJRET_FILE_ERROR;
-            hdo->u.freeform.npt = hmem->read4b();
-            if (hmem->state())
-                return OBJRET_FILE_ERROR;
-            if (!SkipUnusedField())
-                return OBJRET_FILE_ERROR;
-
-            int size = hdo->u.freeform.npt * sizeof(ZZPoint);
-
-            if (ReadSizeField(size) < size)
-                return OBJRET_FILE_ERROR;
-            if (hdo->u.freeform.npt)
-            {
-                hdo->u.freeform.pt =
-                    ::comphelper::newArray_null<ZZPoint>(hdo->u.freeform.npt);
-                if (hdo->u.freeform.pt == NULL)
-                {
-                    hdo->u.freeform.npt = 0;
-                    return OBJRET_FILE_ERROR;
-                }
-                for (int ii = 0; ii < hdo->u.freeform.npt; ii++)
-                {
-                    hdo->u.freeform.pt[ii].x = hmem->read4b();
-                    hdo->u.freeform.pt[ii].y = hmem->read4b();
-                    if (hmem->state())
-                    {
-                        delete[]hdo->u.freeform.pt;
-                        hdo->u.freeform.npt = 0;
-                        return OBJRET_FILE_ERROR;
-                    }
-                }
-            }
-            if (!SkipUnusedField())
-                return OBJRET_FILE_ERROR;
-            return OBJRET_FILE_OK;
-        }
-        case OBJFUNC_FREE:
-            if (hdo->u.freeform.pt)
-                delete[]hdo->u.freeform.pt;
-            break;
-        default:
-            return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-    }
-    return true;
-}
-
-
-// text box
-
-static void FreeParaList(HWPPara * para)
-{
-    if (para->Next())
-        FreeParaList(para->Next());
-    delete para;
-}
-
-
-static HWPPara *LoadParaList()
-{
-    if (!hmem)
-        return 0;
-
-    HWPFile *hwpf = GetCurrentDoc();
-    HIODev *hio = hwpf->SetIODevice(hmem);
-
-    LinkedList < HWPPara > plist;
-
-    hwpf->ReadParaList(plist);
-    hwpf->SetIODevice(hio);
-
-    return plist.count()? plist.first() : 0;
-}
-
-
-static int
-HWPDOTextBoxFunc(int type, HWPDrawingObject * hdo,
-int cmd, void *argp, int argv)
-{
-// TRACE("textbox");
-//    hunit sx, sy, xs, ys;
-
-    switch (cmd)
-    {
-        case OBJFUNC_LOAD:
-            if (ReadSizeField(0) < 0 || !SkipUnusedField())
-                return OBJRET_FILE_ERROR;
-            if (ReadSizeField(0) < 0)
-                return OBJRET_FILE_ERROR;
-            hdo->u.textbox.h = LoadParaList();
-            return hdo->u.textbox.h ? OBJRET_FILE_OK : OBJRET_FILE_ERROR;
-        case OBJFUNC_FREE:
-            if (hdo->u.textbox.h)
-            {
-                FreeParaList(hdo->u.textbox.h);
-                hdo->u.textbox.h = NULL;
-            }
-            break;
-        default:
-            return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-    }
-    return true;
-}
-
-
-static int
-HWPDOContainerFunc(int type, HWPDrawingObject * hdo,
-int cmd, void *argp, int argv)
-{
-    return HWPDODefaultFunc(type, hdo, cmd, argp, argv);
-}
-
-
-/* HWPDrawObject 멤버 함수 */
-
-HWPDrawingObject::HWPDrawingObject()
-{
-    memset(this, 0, sizeof(HWPDrawingObject));
-    index = ++count;
-}
-
-
-HWPDrawingObject::~HWPDrawingObject()
-{
-#if 0
-    if (hdo->property.pictype == PICTYP_EMBED)
-        RemoveEmbeddedPic(hdo->property.szPatternFile);
-    hdo->property.szPatternFile[0] = 0;
-#endif
-    if (child)
-        delete child;
-
-    if (next)
-        delete next;
-
-    HWPDOFunc(this, OBJFUNC_FREE, NULL, 0);
-}
-#endif
diff --git a/main/hwpfilter/source/fontmap.cpp b/main/hwpfilter/source/fontmap.cpp
deleted file mode 100644
index f71f98a..0000000
--- a/main/hwpfilter/source/fontmap.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#include <stdio.h>
-#ifdef SOLARIS
-#include <strings.h>
-#else
-#include <string.h>
-#endif
-
-// #i42367# prevent MS compiler from using system locale for parsing
-#ifdef _MSC_VER
-#pragma setlocale("C")
-#endif
-
-
-struct FontEntry
-{
-    const char *familyname;
-    int key;
-	 double ratio;
-};
-/**
- * ratio\xb4\xc2 \xc7\xd1\xb1\xdb 70%, \xbc\xfd\xc0\xda 10% \xbf\xb5\xb9\xae 20%\xc0\xc7 \xba\xf1\xc0\xb2\xb7\xce \xb1\xb8\xbc\xba\xb5\xc7\xbe\xfa\xb4\xd9\xb4\xc2 \xb0\xa1\xc1\xa4\xc7\xcf\xbf\xa1 \xc1\xa4\xc7\xd8\xc1\xf8\xb4\xd9.
- */
-const struct FontEntry FontMapTab[] =
-{
-    {"\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xbb\xf9\xb9\xb0",1, 0.97},
-    {"\xc7\xca\xb1\xe2",0, 0.97},
-    {"\xbd\xc3\xbd\xba\xc5\xdb",1, 0.84},
-    {"\xbd\xc3\xbd\xba\xc5\xdb \xbe\xe0\xc0\xda",1, 0.84},
-    {"\xbd\xc3\xbd\xba\xc5\xdb \xb0\xa3\xc0\xda",1, 0.84},
-    {"HY\xb5\xd5\xb1\xd9 \xb0\xed\xb5\xf1",2, 0.97},
-    {"\xbf\xbe\xc7\xd1\xb1\xdb",0, 0.97},
-    {"\xb0\xa1\xb4\xc2\xb0\xf8\xc7\xd1",0, 0.72},
-    {"\xc1\xdf\xb0\xa3\xb0\xf8\xc7\xd1",0, 0.72},
-    {"\xb1\xbd\xc0\xba\xb0\xf8\xc7\xd1",0, 0.72},
-    {"\xb0\xa1\xb4\xc2\xc7\xd1",0, 0.72},
-    {"\xc1\xdf\xb0\xa3\xc7\xd1",0, 0.72},
-    {"\xb1\xbd\xc0\xba\xc7\xd1",0, 0.72},
-    {"\xc8\xde\xb8\xd5\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xc8\xde\xb8\xd5\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xb0\xa1\xb4\xc2\xbe\xc8\xbb\xf3\xbc\xf6\xc3\xbc",0, 0.55},
-    {"\xc1\xdf\xb0\xa3\xbe\xc8\xbb\xf3\xbc\xf6\xc3\xbc",0, 0.637},
-    {"\xb1\xbd\xc0\xba\xbe\xc8\xbb\xf3\xbc\xf6\xc3\xbc",0, 0.63},
-    {"\xc8\xde\xb8\xd5\xb0\xa1\xb4\xc2\xbb\xf9\xc3\xbc",0, 0.666},
-    {"\xc8\xde\xb8\xd5\xc1\xdf\xb0\xa3\xbb\xf9\xc3\xbc",0, 0.685},
-    {"\xc8\xde\xb8\xd5\xb1\xbd\xc0\xba\xbb\xf9\xc3\xbc",0, 0.727},
-    {"\xc8\xde\xb8\xd5\xb0\xa1\xb4\xc2\xc6\xd4\xc3\xbc",0, 0.666},
-    {"\xc8\xde\xb8\xd5\xc1\xdf\xb0\xa3\xc6\xd4\xc3\xbc",0, 0.685},
-    {"\xc8\xde\xb8\xd5\xb1\xbd\xc0\xba\xc6\xd4\xc3\xbc",0, 0.727},
-    {"\xc8\xde\xb8\xd5\xbf\xbe\xc3\xbc",3, 0.97},
-    {"\xc7\xd1\xbe\xe7\xbd\xc5\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xc7\xd1\xbe\xe7\xb0\xdf\xb8\xed\xc1\xb6",1, 0.97},
-    {"\xc7\xd1\xbe\xe7\xc1\xdf\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xc7\xd1\xbe\xe7\xb0\xdf\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xc7\xd1\xbe\xe7\xb1\xd7\xb7\xa1\xc7\xc8",0, 0.97},
-    {"\xc7\xd1\xbe\xe7\xb1\xc3\xbc\xad",3, 0.97},
-    {"\xb9\xae\xc8\xad\xb9\xd9\xc5\xc1",0, 0.97},
-    {"\xb9\xae\xc8\xad\xb9\xd9\xc5\xc1\xc1\xa6\xb8\xf1",1, 0.97},
-    {"\xb9\xae\xc8\xad\xb5\xb8\xbf\xf2",1, 0.97},
-    {"\xb9\xae\xc8\xad\xb5\xb8\xbf\xf2\xc1\xa6\xb8\xf1",0, 0.97},
-    {"\xb9\xae\xc8\xad\xbe\xb2\xb1\xe2",0, 0.97},
-    {"\xb9\xae\xc8\xad\xbe\xb2\xb1\xe2\xc8\xea\xb8\xb2",0, 0.97},
-    {"\xc6\xe6\xc8\xea\xb8\xb2",0, 0.97},
-    {"\xba\xb9\xbc\xfe\xbe\xc6",0, 0.827},
-    {"\xbf\xc1\xbc\xf6\xbc\xf6",0, 0.97},
-    {"\xbf\xc0\xc0\xcc",0, 0.97},
-    {"\xb0\xa1\xc1\xf6",0, 0.97},
-    {"\xb0\xad\xb3\xb6\xc4\xe1",2, 0.97},
-    {"\xb5\xfe\xb1\xe2",3, 0.97},
-    {"\xc5\xb8\xc0\xcc\xc7\xc1",0, 0.987},
-    {"\xc5\xc2 \xb3\xaa\xb9\xab",1, 0.97},
-    {"\xc5\xc2 \xc7\xec\xb5\xe5\xb6\xf3\xc0\xce",0, 0.97},
-    {"\xc5\xc2 \xb0\xa1\xb4\xc2 \xc7\xec\xb5\xe5\xb6\xf3\xc0\xce",0, 0.97},
-    {"\xc5\xc2 \xc7\xec\xb5\xe5\xb6\xf3\xc0\xceT",0, 0.97},
-    {"\xc5\xc2 \xb0\xa1\xb4\xc2 \xc7\xec\xb5\xe5\xb6\xf3\xc0\xceT",0, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xb4\xd9\xbf\xee\xb8\xed\xc1\xb6M",0, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xba\xbb\xb8\xf1\xb0\xa2M",0, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xbc\xd2\xbd\xbd",1, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xb8\xc5\xc8\xad",1, 0.987},
-    {"\xbe\xe7\xc0\xe7 \xc6\xb0\xc6\xb0",0, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xc2\xfc\xbd\xa1",1, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xb5\xd1\xb1\xe2",0, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xbb\xfe\xb3\xda",1, 0.97},
-    {"\xbe\xe7\xc0\xe7 \xbf\xcd\xb4\xe7",1, 0.97},
-    {"\xbd\xc5\xb8\xed \xbc\xbc\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xbd\xc5\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xbd\xc5\xbd\xc5\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xc1\xdf\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xc5\xc2\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xb0\xdf\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xbd\xc5\xb9\xae\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xbc\xf8\xb8\xed\xc1\xb6",0, 0.97},
-    {"\xbd\xc5\xb8\xed \xbc\xbc\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xbd\xc5\xb8\xed \xc1\xdf\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xbd\xc5\xb8\xed \xc5\xc2\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xbd\xc5\xb8\xed \xb0\xdf\xb0\xed\xb5\xf1",1, 0.97},
-    {"\xbd\xc5\xb8\xed \xbc\xbc\xb3\xaa\xb7\xe7",2, 0.97},
-    {"\xbd\xc5\xb8\xed \xb5\xf0\xb3\xaa\xb7\xe7",2, 0.97},
-    {"\xbd\xc5\xb8\xed \xbd\xc5\xb1\xd7\xb7\xa1\xc7\xc8",2, 0.97},
-    {"\xbd\xc5\xb8\xed \xc5\xc2\xb1\xd7\xb7\xa1\xc7\xc8",2, 0.97},
-    {"\xbd\xc5\xb8\xed \xb1\xc3\xbc\xad",3, 0.97}
-};
-
-#define FONTCOUNT 4
-#ifndef WIN32
-#if defined(LINUX)
-const char* RepFontTab[] =
-{
-    "\xb9\xe9\xb9\xac \xb9\xd9\xc5\xc1",                                     /* 0 */
-    "\xb9\xe9\xb9\xac \xb5\xb8\xbf\xf2",                                      /* 1 */
-    "\xb9\xe9\xb9\xac \xb1\xbc\xb8\xb2",                                      /* 2 */
-    "\xb9\xe9\xb9\xac \xc7\xec\xb5\xe5\xb6\xf3\xc0\xce"                                      /* 3 */
-};
-#else
-const char* RepFontTab[] =
-{
-    "Batang",                                     /* 0 */
-    "Dotum",                                      /* 1 */
-    "Gulim",                                      /* 2 */
-    "Gungso"                                      /* 3 */
-};
-#endif
-#else
-char* RepFontTab[] =
-{
-    "\xb9\xd9\xc5\xc1",                                       /* 0 */
-    "\xb5\xb8\xbf\xf2",                                       /* 1 */
-    "\xb1\xbc\xb8\xb2",                                       /* 2 */
-    "\xb1\xc3\xbc\xad"                                        /* 3 */
-};
-#endif
-
-int getRepFamilyName(const char* orig, char *buf, double &ratio)
-{
-    int i;
-    int size = sizeof(FontMapTab)/sizeof(FontEntry);
-    for( i = 0 ; i < size ; i++)
-    {
-        if( !strcmp(orig, FontMapTab[i].familyname) ){
-				ratio = FontMapTab[i].ratio;
-            return strlen( strcpy(buf,RepFontTab[FontMapTab[i].key]) );
-		  }
-    }
-	 ratio = FontMapTab[0].ratio;
-    return strlen( strcpy(buf, RepFontTab[0] ) );
-}
diff --git a/main/hwpfilter/source/formula.cpp b/main/hwpfilter/source/formula.cpp
deleted file mode 100644
index 2aeb96b..0000000
--- a/main/hwpfilter/source/formula.cpp
+++ /dev/null
@@ -1,685 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#include "formula.h"
-
-#include "mzstring.h"
-#include "nodes.h"
-#include "mapping.h"
-#include "hwpeq.h"
-#include <iostream>
-
-extern LinkedList<Node> nodelist;
-
-#ifndef DEBUG
-
-#include "hcode.h"
-
-#define ascii(x)  OUString::createFromAscii(x)
-#define rstartEl(x,y)   rDocumentHandler->startElement(x,y)
-#define rendEl(x)    rDocumentHandler->endElement(x)
-#define rchars(x) rDocumentHandler->characters(ascii(x))
-#define runistr(x) rDocumentHandler->characters(OUString(x))
-#define reucstr(x,y) rDocumentHandler->characters(OUString(x,y, RTL_TEXTENCODING_EUC_KR))
-#define padd(x,y,z)  pList->addAttribute(x,y,z)
-#else
-static int indent = 0;
-#define inds indent++; for(int i = 0 ; i < indent ; i++) fprintf(stderr," ")
-#define inde for(int i = 0 ; i < indent ; i++) fprintf(stderr," "); indent--
-#define indo indent--;
-#endif
-
-extern Node *mainParse(const char *);
-
-
-void Formula::makeMathML(Node *res)
-{
-	 Node *tmp = res;
-	 if( !tmp ) return;
-#ifdef DEBUG
-	 inds;
-	 fprintf(stderr,"<math:math xmlns:math=\"http://www.w3.org/1998/Math/MathML\">\n");
-#else
-	 padd(ascii("xmlns:math"), ascii("CDATA"), ascii("http://www.w3.org/1998/Math/MathML"));
-	 rstartEl(ascii("math:math"), rList);
-	 pList->clear();
-	 rstartEl(ascii("math:semantics"), rList);
-#endif
-	 if( tmp->child )
-		  makeLines( tmp->child );
-
-#ifdef DEBUG
-	 inds;
-	 fprintf(stderr,"<math:semantics/>\n");
-	 indo;
-	 inde;
-	 fprintf(stderr,"</math:math>\n");
-#else
-	 rendEl(ascii("math:semantics"));
-	 rendEl(ascii("math:math"));
-#endif
-}
-
-void Formula::makeLines(Node *res)
-{
-	 Node *tmp = res;
-	 if( !tmp ) return;
-
-	 if( tmp->child ){
-		  if( tmp->child->id == ID_LINES )
-				makeLines( tmp->child );
-		  else
-				makeLine( tmp->child );
-	 }
-	 if( tmp->next )
-		  makeLine( tmp->next );
-}
-
-void Formula::makeLine(Node *res)
-{
-  if( !res ) return;
-#ifdef DEBUG
-	 inds; fprintf(stderr,"<math:mrow>\n");
-#else
-	 rstartEl(ascii("math:mrow"), rList);
-#endif
-	 if( res->child )
-		 makeExprList( res->child );
-#ifdef DEBUG
-	 inde; fprintf(stderr,"</math:mrow>\n");
-#else
-	 rendEl(ascii("math:mrow"));
-#endif
-}
-
-void Formula::makeExprList(Node *res)
-{
-   if( !res ) return;
-	Node *tmp = res->child;
-	if( !tmp ) return ;
-
-	if( tmp->id == ID_EXPRLIST ){
-		 Node *next = tmp->next;
-		 makeExprList( tmp ) ;
-		 if( next )
-			  makeExpr( next );
-	}
-	else
-		 makeExpr( tmp );
-}
-	
-void Formula::makeExpr(Node *res)
-{
-  if( !res ) return;
-	Node *tmp = res->child;
-	if( !tmp ) return;
-	switch( tmp->id ) {
-		case ID_PRIMARYEXPR:
-			 if( tmp->next ){
-#ifdef DEBUG
-				 inds; 
-				 fprintf(stderr,"<math:mrow>\n");
-#else
-				 rstartEl(ascii("math:mrow"), rList);
-#endif
-			 }
-
-			 makePrimary(tmp);
-
-			 if( tmp->next ){
-#ifdef DEBUG
-				 inde; fprintf(stderr,"</math:mrow>\n");
-#else
-				 rendEl(ascii("math:mrow"));
-#endif
-			 }
-			break;
-	 	case ID_SUBEXPR:
-	 	case ID_SUPEXPR:
-	 	case ID_SUBSUPEXPR:
-		 	makeSubSup(tmp);
-		 	break;
-	 	case ID_FRACTIONEXPR:
-	 	case ID_OVER:
-		 	makeFraction(tmp);
-		 	break;
-	 	case ID_DECORATIONEXPR:
-		 	makeDecoration(tmp);
-		 	break;
-	 	case ID_SQRTEXPR:
-	 	case ID_ROOTEXPR:
-		 	makeRoot(tmp);
-		 	break;
-	 	case ID_ARROWEXPR:
-		 	makeArrow(tmp);
-		 	break;
-	 	case ID_ACCENTEXPR:
-		 	makeAccent(tmp);
-		 	break;
-	 	case ID_PARENTH:
-	 	case ID_ABS:
-		 	makeParenth(tmp);
-		 	break;
-	 	case ID_FENCE:
-		 	makeFence(tmp);
-		 	break;
-	 	case ID_BLOCK:
-		 	makeBlock(tmp);
-	 	case ID_BEGIN:
-		 	makeBegin(tmp);
-	 	case ID_END:
-		 	makeEnd(tmp);
-		 	break;
-	}
-}
-
-void Formula::makeIdentifier(Node *res)
-{
-	 Node *tmp = res;
-  if( !tmp ) return;
-  if( !tmp->value ) return;
-	 switch( tmp->id ){
-	 case ID_CHARACTER :
-#ifdef DEBUG
-		  inds;
-		  fprintf(stderr,"<math:mi>%s</math:mi>\n",tmp->value);
-		  indo;
-#else
-		  rstartEl(ascii("math:mi"), rList);
-		  rchars(tmp->value);
-		  rendEl(ascii("math:mi"));
-#endif
-		  break;
-	 case ID_STRING :
-		  {
-#ifdef DEBUG
-#else
-				rstartEl(ascii("math:mi"), rList);
-				reucstr(tmp->value, strlen(tmp->value));
-				rendEl(ascii("math:mi"));
-#endif
-		  }
-		  break;
-	 case ID_IDENTIFIER :
-#ifdef DEBUG
-		  inds;
-          fprintf(stderr,"<math:mi>%s</math:mi>\n",
-                  getMathMLEntity(tmp->value).c_str());
-		  indo;
-#else
-		  rstartEl(ascii("math:mi"), rList);
-          runistr(getMathMLEntity(tmp->value).c_str());
-		  rendEl(ascii("math:mi"));
-#endif
-		  break;
-	 case ID_NUMBER :
-#ifdef DEBUG
-		  inds;
-		  fprintf(stderr,"<math:mn>%s</math:mn>\n",tmp->value);
-		  indo;
-#else
-		  rstartEl(ascii("math:mn"), rList);
-		  rchars(tmp->value);
-		  rendEl(ascii("math:mn"));
-#endif
-		  break;
-	 case ID_OPERATOR :
-	 case ID_DELIMETER :
-		{
-#ifdef DEBUG
-		  inds; fprintf(stderr,"<math:mo>%s</math:mo>\n",tmp->value); indo;
-#else
-		  rstartEl(ascii("math:mo"), rList);
-          runistr(getMathMLEntity(tmp->value).c_str());
-		  rendEl(ascii("math:mo"));
-#endif
-		  break;
-		}
-	 }
-}
-void Formula::makePrimary(Node *res)
-{
-	 Node *tmp = res;
-	 if( !tmp ) return ;
-	 if( tmp->child ){
-		  if( tmp->child->id == ID_PRIMARYEXPR ){
-				makePrimary(tmp->child);
-		  }
-		  else{
-				makeIdentifier(tmp->child);
-		  }
-	 }
-	 if( tmp->next ){
-		  makeIdentifier(tmp->next);
-	 }
-}
-
-void Formula::makeSubSup(Node *res)
-{
-	 Node *tmp = res;
-	 if( !tmp ) return;
-
-#ifdef DEBUG
-	 inds;
-	 if( res->id == ID_SUBEXPR )
-		  fprintf(stderr,"<math:msub>\n");
-	 else if( res->id == ID_SUPEXPR )
-		  fprintf(stderr,"<math:msup>\n");
-	 else
-		  fprintf(stderr,"<math:msubsup>\n");
-#else
-	 if( res->id == ID_SUBEXPR )
-		  rstartEl(ascii("math:msub"), rList);
-	 else if( res->id == ID_SUPEXPR )
-		  rstartEl(ascii("math:msup"), rList);
-	 else
-		  rstartEl(ascii("math:msubsup"), rList);
-#endif
-
-	 tmp = tmp->child;
-	 if( res->id == ID_SUBSUPEXPR ) {
-		  makeExpr(tmp);
-		  makeBlock(tmp->next);
-		  makeBlock(tmp->next->next);
-	 }
-	 else{
-		  makeExpr(tmp);
-		  makeExpr(tmp->next);
-	 }
-
-#ifdef DEBUG
-	 inde;
-	 if( res->id == ID_SUBEXPR )
-		  fprintf(stderr,"</math:msub>\n");
-	 else if( res->id == ID_SUPEXPR )
-		  fprintf(stderr,"</math:msup>\n");
-	 else
-		  fprintf(stderr,"</math:msubsup>\n");
-#else
-	 if( res->id == ID_SUBEXPR )
-		  rendEl(ascii("math:msub"));
-	 else if( res->id == ID_SUPEXPR )
-		  rendEl(ascii("math:msup"));
-	 else
-		  rendEl(ascii("math:msubsup"));
-#endif
-}
-
-void Formula::makeFraction(Node *res)
-{
-	 Node *tmp = res;
-	 if( !tmp ) return;
-
-#ifdef DEBUG
-	 inds;
-	 fprintf(stderr,"<math:mfrac>\n");
-#else
-	 rstartEl(ascii("math:mfrac"), rList);
-#endif
-
-	 tmp = tmp->child;
-#ifdef DEBUG
-	 inds;
-	 fprintf(stderr,"<math:mrow>\n");
-#else
-	 rstartEl(ascii("math:mrow"), rList);
-#endif
-
-	 if( res->id == ID_FRACTIONEXPR )
-		  makeBlock(tmp);
-	 else
-		  makeExprList(tmp);
-
-#ifdef DEBUG
-	 inde;
-	 fprintf(stderr,"</math:mrow>\n");
-	 inds;
-	 fprintf(stderr,"<math:mrow>\n");
-#else
-	 rendEl(ascii("math:mrow"));
-	 rstartEl(ascii("math:mrow"), rList);
-#endif
-
-	 if( res->id == ID_FRACTIONEXPR )
-		  makeBlock(tmp->next);
-	 else
-		  makeExprList(tmp->next);
-
-#ifdef DEBUG
-	 inde;
-	 fprintf(stderr,"</math:mrow>\n");
-	 inde;
-	 fprintf(stderr,"</math:mfrac>\n");
-#else
-	 rendEl(ascii("math:mrow"));
-	 rendEl(ascii("math:mfrac"));
-#endif
-}
-
-void Formula::makeDecoration(Node *res)
-{
-	 int isover = 1;
-	 Node *tmp = res->child;
-	 if( !tmp ) return;
-	 if( !strncmp(tmp->value,"under", 5) )
-		  isover = 0;
-#ifdef DEBUG
-	 inds;
-	 if( isover )
-		  fprintf(stderr,"<math:mover>\n");
-	 else
-		  fprintf(stderr,"<math:munder>\n");
-#else
-	 /* accent는 언제 true이고, 언제, false인지 모르겠다. */
-	 if( isover ){
-		  padd(ascii("accent"),ascii("CDATA"),ascii("true"));
-		  rstartEl(ascii("math:mover"), rList);
-	 }
-	 else{
-		  padd(ascii("accentunder"),ascii("CDATA"),ascii("true"));
-		  rstartEl(ascii("math:munder"), rList);
-	 }
-	 pList->clear();
-#endif
-
-	 makeBlock(tmp->next);
-
-#ifdef DEBUG
-	 inds;
-     fprintf(stderr,"<math:mo>%s</math:mo>\n",
-             getMathMLEntity(tmp->value).c_str());
-	 indo;
-#else
-	 rstartEl(ascii("math:mo"), rList);
-     runistr(getMathMLEntity(tmp->value).c_str());
-	 rendEl(ascii("math:mo"));
-#endif
-
-#ifdef DEBUG
-	 inde;
-	 if( isover )
-		  fprintf(stderr,"</math:mover>\n");
-	 else
-		  fprintf(stderr,"</math:munder>\n");
-#else
-	 if( isover )
-		  rendEl(ascii("math:mover"));
-	 else
-		  rendEl(ascii("math:munder"));
-#endif
-}
-
-void Formula::makeRoot(Node *res)
-{
-	 Node *tmp = res;
-	 if( !tmp ) return;
-#ifdef DEBUG
-	 inds;
-	 if( tmp->id == ID_SQRTEXPR )
-		  fprintf(stderr,"<math:msqrt>\n");
-	 else
-		  fprintf(stderr,"<math:mroot>\n");
-#else
-	 if( tmp->id == ID_SQRTEXPR )
-		  rstartEl(ascii("math:msqrt"), rList);
-	 else
-		  rstartEl(ascii("math:mroot"), rList);
-#endif
-
-	 if( tmp->id == ID_SQRTEXPR ){
-		  makeBlock(tmp->child);
-	 }
-	 else{
-		  makeBracket(tmp->child);
-		  makeBlock(tmp->child->next);
-	 }
-
-#ifdef DEBUG
-	 inde;
-	 if( tmp->id == ID_SQRTEXPR )
-		  fprintf(stderr,"</math:msqrt>\n");
-	 else
-		  fprintf(stderr,"</math:mroot>\n");
-#else
-	 if( tmp->id == ID_SQRTEXPR )
-		  rendEl(ascii("math:msqrt"));
-	 else
-		  rendEl(ascii("math:mroot"));
-#endif
-}
-// DVO: add space to avoid warning
-void Formula::makeArrow(Node * /*res*/)
-{
-}
-void Formula::makeAccent(Node *res)
-{
-	 makeDecoration( res );
-}
-void Formula::makeParenth(Node *res)
-{
-	 Node *tmp = res;
-	 if( !tmp ) return;
-#ifdef DEBUG
-	 inds;
-	 fprintf(stderr,"<math:mrow>\n");
-	 inds;
-	 if( tmp->id == ID_PARENTH ){
-		  fprintf(stderr,"<math:mo>(</math:mo>\n");
-	 }
-	 else
-		  fprintf(stderr,"<math:mo>|</math:mo>\n");
-	 indo; inds;
-	 fprintf(stderr,"<math:mrow>\n");
-#else
-	 rstartEl(ascii("math:mrow"), rList);
-	 rstartEl(ascii("math:mo"), rList);
-	 if( tmp->id == ID_PARENTH )
-		  rchars("(");
-	 else
-		  rchars("|");
-	 rendEl(ascii("math:mo"));
-	 rstartEl(ascii("math:mrow"), rList);
-#endif
-
-	 if( tmp->child )
-		  makeExprList(tmp->child);
-
-#ifdef DEBUG
-	 inde;
-	 fprintf(stderr,"</math:mrow>\n");
-	 inds;
-	 if( tmp->id == ID_PARENTH )
-		  fprintf(stderr,"<math:mo>)</math:mo>\n");
-	 else
-		  fprintf(stderr,"<math:mo>|</math:mo>\n");
-	 indo;
-	 inde;
-	 fprintf(stderr,"</math:mrow>\n");
-#else
-	 rendEl(ascii("math:mrow"));
-	 rstartEl(ascii("math:mo"), rList);
-	 if( tmp->id == ID_PARENTH )
-		  rchars(")");
-	 else
-		  rchars("|");
-	 rendEl(ascii("math:mo"));
-	 rendEl(ascii("math:mrow"));
-#endif
-}
-
-void Formula::makeFence(Node *res)
-{
-	 Node *tmp = res->child;
-#ifdef DEBUG
-	 inds;
-     fprintf(stderr,"<math:mfenced open=\"%s\" close=\"%s\">\n",
-                getMathMLEntity(tmp->value).c_str(),
-                getMathMLEntity(tmp->next->next->value).c_str());
-#else
-     padd(ascii("open"), ascii("CDATA"),
-             OUString(getMathMLEntity(tmp->value).c_str()) );
-     padd(ascii("close"), ascii("CDATA"),
-             OUString(getMathMLEntity(tmp->next->next->value).c_str()) );
-	 rstartEl(ascii("math:mfenced"), rList);
-	 pList->clear();
-#endif
-
-	 makeExprList(tmp->next);
-
-#ifdef DEBUG
-	 inde;
-	 fprintf(stderr,"</math:mfenced>\n");
-#else
-	 rendEl(ascii("math:mfenced"));
-#endif
-}
-
-void Formula::makeBracket(Node *res)
-{
-	 makeBlock(res);
-}
-
-void Formula::makeBlock(Node *res)
-{
-#ifdef DEBUG
-	 inds;
-	 fprintf(stderr,"<math:mrow>\n");
-#else
-	 rstartEl(ascii("math:mrow"), rList);
-#endif
-
-	 if( res->child )
-		  makeExprList(res->child);
-
-#ifdef DEBUG
-	 inde;
-	 fprintf(stderr,"</math:mrow>\n");
-#else
-	 rendEl(ascii("math:mrow"));
-#endif
-}
-
-// DVO: add space to avoid warning
-void Formula::makeBegin(Node * /*res*/)
-{
-}
-
-// DVO: add space to avoid warning
-void Formula::makeEnd(Node * /*res*/)
-{
-}
-
-int Formula::parse()
-{
-	 Node *res = 0L;
-	 if( !eq ) return 0;
-	 if( isHwpEQ ){
-		  MzString a;
-		 // fprintf(stderr,"\n\n[BEFORE]\n[%s]\n",eq);
-		  eq2latex(a,eq);
-
-          int idx=a.find(sal::static_int_cast<char>(0xff));
-		  while(idx){
-				//printf("idx = [%d]\n",idx);
-				a.replace(idx,0x20);
-                if((idx = a.find(sal::static_int_cast<char>(0xff),idx+1)) < 0)
-					 break;
-		  }
-
-		  char *buf = (char *)malloc(a.length()+1);
-		  bool bStart = false;
-		  int i, j;
-		  for( i = 0, j=0 ; i < a.length() ; i++){ // rtrim and ltrim 32 10 13
-				if( bStart ){
-					 buf[j++] = a[i];
-				}
-				else{
-					 if( a[i] != 32 && a[i] != 10 && a[i] != 13){
-						  bStart = true;
-						  buf[j++] = a[i];
-					 }
-				}
-		  }
-		  buf[j] = 0;
-		  for( i = j-1 ; i >= 0 ; i++ ){
-				if( buf[i] == 32 || buf[i] == 10 || buf[i] == 13 ){
-					 buf[i] = 0;
-				}
-				else
-					 break;
-		  }
-		 // fprintf(stderr,"\n\n[RESULT]\n[%s]\n",a.c_str());
-		  if( strlen(buf) > 0 ) 
-				res = mainParse( a.c_str() );
-		  else
-				res = 0L;
-		  free(buf);
-	 }
-	 else{
-		  res = mainParse( eq );
-	 }
-
-	 if( res ){
-		  makeMathML( res );
-	 }
-	 Node *tmpNode;
-	 int count = nodelist.count();
-	 for( int i = 0 ; i < count ; i++ ){
-		  tmpNode = nodelist.remove(0);
-		  delete tmpNode;
-	 }
-
-	 return 0;
-}
-
-void Formula::trim()
-{
-	 int len = strlen(eq);
-	 char *buf = (char *)malloc(len+1);
-	 bool bStart = false;
-	 int i, j;
-	 for( i = 0, j=0 ; i < len ; i++){ // rtrim and ltrim 32 10 13
-		  if( bStart ){
-				buf[j++] = eq[i];
-		  }
-		  else{
-				if( eq[i] != 32 && eq[i] != 10 && eq[i] != 13){
-					 bStart = true;
-					 buf[j++] = eq[i];
-				}
-		  }
-	 }
-	 buf[j] = 0;
-	 for( i = j-1 ; i >= 0 ; i++ ){
-		  if( buf[i] == 32 || buf[i] == 10 || buf[i] == 13 ){
-				buf[i] = 0;
-		  }
-		  else
-				break;
-	 }
-	 if( strlen(buf) > 0 )
-		  strcpy(eq, buf);
-	 else
-		  eq = 0L;
-	 free(buf);
-}
diff --git a/main/hwpfilter/source/formula.h b/main/hwpfilter/source/formula.h
deleted file mode 100644
index 01ad1b6..0000000
--- a/main/hwpfilter/source/formula.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#ifndef __FORMULA_H__
-#define __FORMULA_H__
-
-// DVO: remove DEBUG dependency
-// #ifndef DEBUG
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include "attributes.hxx"
-// DVO: remove DEBUG dependency
-// #endif
-
-class Node;
-
-// DVO: remove DEBUG dependency
-// #ifndef DEBUG
-using namespace ::com::sun::star::xml::sax;
-// #endif
-
-
-class Formula{
-public:
-	 Formula(char *_eq, int _ishwpeq = 1) {
-		  eq = _eq;
-		  isHwpEQ = _ishwpeq;
-		  trim();
-	 }
-	 virtual ~Formula(){ }
-
-// DVO: remove DEBUG dependency
-// #ifndef DEBUG
-	 void setDocumentHandler(Reference < XDocumentHandler > xHandler ){
-		  rDocumentHandler = xHandler;
-	 }
-	 void setAttributeListImpl( AttributeListImpl *p ){
-		  pList = p;
-		  rList = (XAttributeList *) pList;
-	 }
-// DVO: remove DEBUG dependency
-// #endif
-	 int parse();
-private:
-	 void trim();
-	 void makeMathML(Node *res);
-	 void makeLines(Node *res);
-	 void makeLine(Node *res);
-	 void makeExprList(Node *res);
-	 void makeExpr(Node *res);
-	 void makePrimary(Node *res);
-	 void makeIdentifier(Node *res);
-	 void makeSubSup(Node *res);
-	 void makeFraction(Node *res);
-	 void makeDecoration(Node *res);
-	 void makeFunction(Node *res);
-	 void makeRoot(Node *res);
-	 void makeArrow(Node *res);
-	 void makeAccent(Node *res);
-	 void makeParenth(Node *res);
-	 void makeFence(Node *res);
-	 void makeBracket(Node *res);
-	 void makeBlock(Node *res);
-	 void makeBegin(Node *res);
-	 void makeEnd(Node *res);
-
-private:
-// DVO: remove DEBUG dependency
-// #ifndef DEBUG
-	 Reference< XDocumentHandler >   rDocumentHandler;
-	 Reference< XAttributeList > rList;
-	 AttributeListImpl *pList;
-// DVO: remove DEBUG dependency
-// #endif
-	 char *eq;
-	 int isHwpEQ;
-};
-
-#endif
diff --git a/main/hwpfilter/source/grammar.cpp b/main/hwpfilter/source/grammar.cpp
deleted file mode 100644
index 37b3dc8..0000000
--- a/main/hwpfilter/source/grammar.cpp
+++ /dev/null
@@ -1,1471 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-
-/*  A Bison parser, made from grammar.y
-    by GNU Bison version 1.28  */
-
-#define YYBISON 1  /* Identify Bison output.  */
-
-#ifndef YYDEBUG 
-#define YYDEBUG 0
-#endif
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 0
-#endif
-
-#define	ACCENT	257
-#define	SMALL_GREEK	258
-#define	CAPITAL_GREEK	259
-#define	BINARY_OPERATOR	260
-#define	RELATION_OPERATOR	261
-#define	ARROW	262
-#define	GENERAL_IDEN	263
-#define	GENERAL_OPER	264
-#define	BIG_SYMBOL	265
-#define	FUNCTION	266
-#define	ROOT	267
-#define	FRACTION	268
-#define	SUBSUP	269
-#define	EQOVER	270
-#define	DELIMETER	271
-#define	LARGE_DELIM	272
-#define	DECORATION	273
-#define	SPACE_SYMBOL	274
-#define	CHARACTER	275
-#define	STRING	276
-#define	OPERATOR	277
-#define	EQBEGIN	278
-#define	EQEND	279
-#define	EQLEFT	280
-#define	EQRIGHT	281
-#define	NEWLINE	282
-#define	LEFT_DELIM	283
-#define	RIGHT_DELIM	284
-#define	DIGIT	285
-
-#line 1 "grammar.y"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "nodes.h"
-
-LinkedList<Node> nodelist;
-
-Node *mainParse(const char *_code);
-void yyerror(const char *);
-int yylex();
-void initFlex( const char *s );
-void viewResult(Node *res);
-
-Node *top=0L;
-
-int Node::count = 0;
-
-#define allocValue(x,y) \
-x = (char *)malloc( strlen(y) +1 ); \
-strcpy(x,y)
-
-#define allocChar(x,y) \
-x = (char *)malloc(2); \
-sprintf(x,"%c",y)
-#ifdef PARSE_DEBUG
-#define debug printf
-#else
-int debug(const char *format, ...);
-#endif
-
-
-#line 35 "grammar.y"
-typedef union {
-	char *dval;
-	char *str;
-	Node *ptr;
-} YYSTYPE;
-#include <stdio.h>
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define	YYFINAL		102
-#define	YYFLAG		-32768
-#define	YYNTBASE	43
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 285 ? yytranslate[x] : 66)
-
-static const char yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,    33,
-    37,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,    36,
-     2,    40,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-    34,     2,    38,    42,    41,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,    35,    32,    39,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    27,    28,    29,    30,    31
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = {     0,
-     0,     2,     4,     6,     8,    10,    12,    14,    16,    18,
-    20,    22,    24,    26,    28,    30,    32,    34,    36,    39,
-    42,    45,    48,    51,    54,    58,    60,    63,    66,    69,
-    72,    75,    79,    81,    85,    89,    92,    96,    99,   103,
-   106,   110,   114,   120,   124,   130,   132,   135,   137,   140,
-   143,   147,   150,   154,   157,   159,   161,   165,   167,   169,
-   172,   174,   176,   178,   180,   182,   184,   186,   188,   190,
-   192,   194
-};
-
-static const short yyrhs[] = {     4,
-     0,     9,     0,    10,     0,     5,     0,    11,     0,    12,
-     0,    20,     0,    21,     0,     7,     0,     6,     0,    23,
-     0,    17,     0,    18,     0,     8,     0,    32,     0,    31,
-     0,    22,     0,    43,     0,    44,    43,     0,    26,    33,
-     0,    26,    34,     0,    26,    35,     0,    26,    36,     0,
-    26,    32,     0,    26,    32,    32,     0,    29,     0,    27,
-    37,     0,    27,    38,     0,    27,    39,     0,    27,    40,
-     0,    27,    32,     0,    27,    32,    32,     0,    30,     0,
-    45,    64,    46,     0,    33,    64,    37,     0,    33,    37,
-     0,    35,    64,    39,     0,    35,    39,     0,    34,    64,
-    38,     0,    34,    38,     0,    65,    41,    65,     0,    65,
-    42,    65,     0,    65,    41,    49,    42,    49,     0,    14,
-    49,    49,     0,    35,    64,    16,    64,    39,     0,     3,
-     0,    54,    49,     0,    19,     0,    56,    49,     0,    13,
-    49,     0,    13,    50,    49,     0,    24,    49,     0,    24,
-    49,    49,     0,    25,    49,     0,    62,     0,    63,     0,
-    62,    28,    63,     0,    64,     0,    65,     0,    64,    65,
-     0,    49,     0,    48,     0,    47,     0,    51,     0,    52,
-     0,    53,     0,    57,     0,    58,     0,    55,     0,    44,
-     0,    59,     0,    60,     0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
-    59,    61,    62,    63,    64,    65,    66,    67,    68,    69,
-    70,    71,    72,    73,    74,    75,    76,    79,    81,    84,
-    86,    87,    88,    89,    90,    91,    94,    96,    97,    98,
-    99,   100,   101,   104,   108,   110,   113,   115,   118,   120,
-   123,   125,   126,   129,   133,   138,   142,   145,   149,   153,
-   155,   158,   160,   163,   168,   172,   174,   177,   181,   183,
-   186,   188,   189,   190,   191,   192,   193,   194,   195,   196,
-   197,   198
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = {   "$","error","$undefined.","ACCENT",
-"SMALL_GREEK","CAPITAL_GREEK","BINARY_OPERATOR","RELATION_OPERATOR","ARROW",
-"GENERAL_IDEN","GENERAL_OPER","BIG_SYMBOL","FUNCTION","ROOT","FRACTION","SUBSUP",
-"EQOVER","DELIMETER","LARGE_DELIM","DECORATION","SPACE_SYMBOL","CHARACTER","STRING",
-"OPERATOR","EQBEGIN","EQEND","EQLEFT","EQRIGHT","NEWLINE","LEFT_DELIM","RIGHT_DELIM",
-"DIGIT","'|'","'('","'['","'{'","'<'","')'","']'","'}'","'>'","'_'","'^'","Identifier",
-"PrimaryExpr","EQLeft","EQRight","Fence","Parenth","Block","Bracket","SubSupExpr",
-"FractionExpr","OverExpr","Accent","AccentExpr","Decoration","DecorationExpr",
-"RootExpr","BeginExpr","EndExpr","MathML","Lines","Line","ExprList","Expr", NULL
-};
-#endif
-
-static const short yyr1[] = {     0,
-    43,    43,    43,    43,    43,    43,    43,    43,    43,    43,
-    43,    43,    43,    43,    43,    43,    43,    44,    44,    45,
-    45,    45,    45,    45,    45,    45,    46,    46,    46,    46,
-    46,    46,    46,    47,    48,    48,    49,    49,    50,    50,
-    51,    51,    51,    52,    53,    54,    55,    56,    57,    58,
-    58,    59,    59,    60,    61,    62,    62,    63,    64,    64,
-    65,    65,    65,    65,    65,    65,    65,    65,    65,    65,
-    65,    65
-};
-
-static const short yyr2[] = {     0,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     1,     1,     1,     1,     2,     2,
-     2,     2,     2,     2,     3,     1,     2,     2,     2,     2,
-     2,     3,     1,     3,     3,     2,     3,     2,     3,     2,
-     3,     3,     5,     3,     5,     1,     2,     1,     2,     2,
-     3,     2,     3,     2,     1,     1,     3,     1,     1,     2,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1
-};
-
-static const short yydefact[] = {     0,
-    46,     1,     4,    10,     9,    14,     2,     3,     5,     6,
-     0,     0,    12,    13,    48,     7,     8,    17,    11,     0,
-     0,     0,    26,    16,    15,     0,     0,    18,    70,     0,
-    63,    62,    61,    64,    65,    66,     0,    69,     0,    67,
-    68,    71,    72,    55,    56,    58,    59,     0,     0,    50,
-     0,     0,    52,    54,    24,    20,    21,    22,    23,    36,
-     0,    38,     0,    19,     0,    47,    49,     0,    60,     0,
-     0,    40,     0,     0,    51,    44,    53,    25,    35,     0,
-    37,     0,    33,    34,    57,    61,    41,    42,    39,     0,
-    31,    27,    28,    29,    30,     0,    45,    32,    43,     0,
-     0,     0
-};
-
-static const short yydefgoto[] = {    28,
-    29,    30,    84,    31,    32,    33,    51,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,   100,    44,    45,
-    46,    47
-};
-
-static const short yypact[] = {   393,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-   -30,   -19,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -19,
-   -19,    -3,-32768,-32768,-32768,   290,   107,-32768,   425,   393,
--32768,-32768,-32768,-32768,-32768,-32768,   -19,-32768,   -19,-32768,
--32768,-32768,-32768,   -20,-32768,   393,   -21,   218,   107,-32768,
-   -19,   -19,   -19,-32768,   -15,-32768,-32768,-32768,-32768,-32768,
-   325,-32768,    70,-32768,   360,-32768,-32768,   393,   -21,   393,
-   393,-32768,   254,   144,-32768,-32768,-32768,-32768,-32768,   393,
--32768,   -25,-32768,-32768,-32768,   -31,   -21,   -21,-32768,   181,
-   -14,-32768,-32768,-32768,-32768,   -19,-32768,-32768,-32768,    22,
-    23,-32768
-};
-
-static const short yypgoto[] = {    -2,
--32768,-32768,-32768,-32768,-32768,   -11,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -33,
-   -24,   -27
-};
-
-
-#define	YYLAST		457
-
-
-static const short yytable[] = {    50,
-    52,    61,    63,    48,    49,    65,    91,    68,    53,    54,
-    96,    92,    93,    94,    95,    49,    78,    98,    69,    70,
-    71,   101,   102,    73,    74,    66,    64,    67,    55,    56,
-    57,    58,    59,    69,    85,    69,     0,    69,     0,    75,
-    76,    77,    87,    88,     0,    69,    69,     0,     0,     0,
-     0,     0,     0,     0,     0,    90,     0,     0,    86,     0,
-     0,     0,    69,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     1,     2,     3,     4,     5,     6,     7,     8,
-     9,    10,    11,    12,    99,    80,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,     0,     0,    23,     0,
-    24,    25,    26,     0,    27,     0,     0,     0,    81,     1,
-     2,     3,     4,     5,     6,     7,     8,     9,    10,    11,
-    12,     0,     0,    13,    14,    15,    16,    17,    18,    19,
-    20,    21,    22,     0,     0,    23,     0,    24,    25,    26,
-     0,    27,     0,     0,     0,    62,     1,     2,     3,     4,
-     5,     6,     7,     8,     9,    10,    11,    12,     0,     0,
-    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-     0,     0,    23,     0,    24,    25,    26,     0,    27,     0,
-     0,     0,    81,     1,     2,     3,     4,     5,     6,     7,
-     8,     9,    10,    11,    12,     0,     0,    13,    14,    15,
-    16,    17,    18,    19,    20,    21,    22,     0,     0,    23,
-     0,    24,    25,    26,     0,    27,     0,     0,     0,    97,
-     1,     2,     3,     4,     5,     6,     7,     8,     9,    10,
-    11,    12,     0,     0,    13,    14,    15,    16,    17,    18,
-    19,    20,    21,    22,     0,     0,    23,     0,    24,    25,
-    26,     0,    27,     0,     0,    72,     1,     2,     3,     4,
-     5,     6,     7,     8,     9,    10,    11,    12,     0,     0,
-    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-     0,     0,    23,     0,    24,    25,    26,     0,    27,     0,
-     0,    89,     1,     2,     3,     4,     5,     6,     7,     8,
-     9,    10,    11,    12,     0,     0,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,     0,     0,    23,     0,
-    24,    25,    26,     0,    27,     0,    60,     1,     2,     3,
-     4,     5,     6,     7,     8,     9,    10,    11,    12,     0,
-     0,    13,    14,    15,    16,    17,    18,    19,    20,    21,
-    22,     0,     0,    23,     0,    24,    25,    26,     0,    27,
-     0,    79,     1,     2,     3,     4,     5,     6,     7,     8,
-     9,    10,    11,    12,     0,     0,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    82,     0,    23,    83,
-    24,    25,    26,     0,    27,     1,     2,     3,     4,     5,
-     6,     7,     8,     9,    10,    11,    12,     0,     0,    13,
-    14,    15,    16,    17,    18,    19,    20,    21,    22,     0,
-     0,    23,     0,    24,    25,    26,     0,    27,     2,     3,
-     4,     5,     6,     7,     8,     9,    10,     0,     0,     0,
-     0,    13,    14,     0,    16,    17,    18,    19,     0,     0,
-     0,     0,     0,     0,     0,    24,    25
-};
-
-static const short yycheck[] = {    11,
-    12,    26,    27,    34,    35,    30,    32,    28,    20,    21,
-    42,    37,    38,    39,    40,    35,    32,    32,    46,    41,
-    42,     0,     0,    48,    49,    37,    29,    39,    32,    33,
-    34,    35,    36,    61,    68,    63,    -1,    65,    -1,    51,
-    52,    53,    70,    71,    -1,    73,    74,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    80,    -1,    -1,    70,    -1,
-    -1,    -1,    90,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,     3,     4,     5,     6,     7,     8,     9,    10,
-    11,    12,    13,    14,    96,    16,    17,    18,    19,    20,
-    21,    22,    23,    24,    25,    26,    -1,    -1,    29,    -1,
-    31,    32,    33,    -1,    35,    -1,    -1,    -1,    39,     3,
-     4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
-    14,    -1,    -1,    17,    18,    19,    20,    21,    22,    23,
-    24,    25,    26,    -1,    -1,    29,    -1,    31,    32,    33,
-    -1,    35,    -1,    -1,    -1,    39,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    -1,    -1,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    -1,    -1,    29,    -1,    31,    32,    33,    -1,    35,    -1,
-    -1,    -1,    39,     3,     4,     5,     6,     7,     8,     9,
-    10,    11,    12,    13,    14,    -1,    -1,    17,    18,    19,
-    20,    21,    22,    23,    24,    25,    26,    -1,    -1,    29,
-    -1,    31,    32,    33,    -1,    35,    -1,    -1,    -1,    39,
-     3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
-    13,    14,    -1,    -1,    17,    18,    19,    20,    21,    22,
-    23,    24,    25,    26,    -1,    -1,    29,    -1,    31,    32,
-    33,    -1,    35,    -1,    -1,    38,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    -1,    -1,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    -1,    -1,    29,    -1,    31,    32,    33,    -1,    35,    -1,
-    -1,    38,     3,     4,     5,     6,     7,     8,     9,    10,
-    11,    12,    13,    14,    -1,    -1,    17,    18,    19,    20,
-    21,    22,    23,    24,    25,    26,    -1,    -1,    29,    -1,
-    31,    32,    33,    -1,    35,    -1,    37,     3,     4,     5,
-     6,     7,     8,     9,    10,    11,    12,    13,    14,    -1,
-    -1,    17,    18,    19,    20,    21,    22,    23,    24,    25,
-    26,    -1,    -1,    29,    -1,    31,    32,    33,    -1,    35,
-    -1,    37,     3,     4,     5,     6,     7,     8,     9,    10,
-    11,    12,    13,    14,    -1,    -1,    17,    18,    19,    20,
-    21,    22,    23,    24,    25,    26,    27,    -1,    29,    30,
-    31,    32,    33,    -1,    35,     3,     4,     5,     6,     7,
-     8,     9,    10,    11,    12,    13,    14,    -1,    -1,    17,
-    18,    19,    20,    21,    22,    23,    24,    25,    26,    -1,
-    -1,    29,    -1,    31,    32,    33,    -1,    35,     4,     5,
-     6,     7,     8,     9,    10,    11,    12,    -1,    -1,    -1,
-    -1,    17,    18,    -1,    20,    21,    22,    23,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    31,    32
-};
-/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/lib/bison.simple"
-/* This file comes from bison-1.28.  */
-
-/* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include <sal/alloca.h>
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C.  */
-/* This used to test MSDOS, but that is a bad idea
-   since that symbol is in the user namespace.  */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
-	 instead, just don't use alloca.  */
-#include <malloc.h>
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
-   So I turned it off.   rms, 2 May 1997.  */
-/* #include <malloc.h>  */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
-
-/* Note: there must be only one dollar sign in this file.
-   It is replaced by the list of actions, each action
-   as one case of the switch.  */
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
-#define YYEOF		0
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT 	goto yyabortlab
-#define YYERROR		goto yyerrlab1
-/* Like YYERROR except do call yyerror.
-   This remains here temporarily to ease the
-   transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-#define YYFAIL		goto yyerrlab
-#define YYRECOVERING()  (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    { yychar = (token), yylval = (value);			\
-      yychar1 = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
-while (0)
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-#ifndef YYPURE
-#define YYLEX		yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int	yychar;			/*  the lookahead symbol		*/
-YYSTYPE	yylval;			/*  the semantic value of the		*/
-				/*  lookahead symbol			*/
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc;			/*  location data for the lookahead	*/
-				/*  symbol				*/
-#endif
-
-int yynerrs;			/*  number of parse errors so far       */
-#endif  /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug;			/*  nonzero means print parse trace	*/
-/* Since this is uninitialized, it does not stop multiple parsers
-   from coexisting.  */
-#endif
-
-/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
-
-#ifndef	YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/*  YYMAXDEPTH is the maximum size the stacks can grow to
-    (effective only if the built-in stack extension method is used).  */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Define __yy_memcpy.  Note that the size argument
-   should be passed with type unsigned int, because that is what the non-GCC
-   definitions require.  With GCC, __builtin_memcpy takes an arg
-   of type size_t, but it can handle unsigned int.  */
-
-#if defined __GNUC__ 
-#if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
-#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
-#endif
-#else               /* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (to, from, count)
-     char *to;
-     char *from;
-     unsigned int count;
-{
-  register char *f = from;
-  register char *t = to;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (char *to, char *from, unsigned int count)
-{
-  register char *t = to;
-  register char *f = from;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#endif
-#endif
-
-#line 217 "/usr/lib/bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
-   into yyparse.  The argument should have type void *.
-   It should actually point to an object.
-   Grammar actions can access the variable by casting it
-   to the proper pointer type.  */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
-yyparse(YYPARSE_PARAM_ARG)
-     YYPARSE_PARAM_DECL
-{
-  register int yystate;
-  register int yyn;
-  register short *yyssp;
-  register YYSTYPE *yyvsp;
-  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
-  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
-
-  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
-  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
-
-  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
-  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
-  YYLTYPE *yyls = yylsa;
-  YYLTYPE *yylsp;
-
-#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-#endif
-
-  int yystacksize = YYINITDEPTH;
-  int yyfree_stacks = 0;
-
-#ifdef YYPURE
-  int yychar;
-  YYSTYPE yylval;
-  int yynerrs;
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylloc;
-#endif
-#endif
-
-  YYSTYPE yyval;		/*  the variable used to return		*/
-  yyval.dval = 0;
-				/*  semantic values from the action	*/
-				/*  routines				*/
-
-  int yylen;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Starting parse\n");
-#endif
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss - 1;
-  yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
-  yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in  yystate  .  */
-/* In all cases, when you get here, the value and location stacks
-   have just been pushed. so pushing a state here evens the stacks.  */
-yynewstate:
-
-  *++yyssp = sal::static_int_cast<short>(yystate);
-
-  if (yyssp >= yyss + yystacksize - 1)
-    {
-      /* Give user a chance to reallocate the stack */
-      /* Use copies of these so that the &'s don't force the real ones into memory. */
-      YYSTYPE *yyvs1 = yyvs;
-      short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
-      YYLTYPE *yyls1 = yyls;
-#endif
-
-      /* Get the current used size of the three stacks, in elements.  */
-      int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      /* Each stack pointer address is followed by the size of
-	 the data in use in that stack, in bytes.  */
-#ifdef YYLSP_NEEDED
-      /* This used to be a conditional around just the two extra args,
-	 but that might be undefined if yyoverflow is a macro.  */
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yyls1, size * sizeof (*yylsp),
-		 &yystacksize);
-#else
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yystacksize);
-#endif
-
-      yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
-      yyls = yyls1;
-#endif
-#else /* no yyoverflow */
-      /* Extend the stack our own way.  */
-      if (yystacksize >= YYMAXDEPTH)
-	{
-	  yyerror("parser stack overflow");
-	  if (yyfree_stacks)
-	    {
-	      free (yyss);
-	      free (yyvs);
-#ifdef YYLSP_NEEDED
-	      free (yyls);
-#endif
-	    }
-	  return 2;
-	}
-      yystacksize *= 2;
-      if (yystacksize > YYMAXDEPTH)
-	yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
-      yyfree_stacks = 1;
-#endif
-      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
-      __yy_memcpy ((char *)yyss, (char *)yyss1,
-		   size * (unsigned int) sizeof (*yyssp));
-      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
-      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
-		   size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
-      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
-      __yy_memcpy ((char *)yyls, (char *)yyls1,
-		   size * (unsigned int) sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + size - 1;
-      yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
-      yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
-      if (yyssp >= yyss + yystacksize - 1)
-	YYABORT;
-    }
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
-  goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* yychar is either YYEMPTY or YYEOF
-     or a valid token in external form.  */
-
-  if (yychar == YYEMPTY)
-    {
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Reading a token: ");
-#endif
-      yychar = YYLEX;
-    }
-
-  /* Convert token to internal form (in yychar1) for indexing tables with */
-
-  if (yychar <= 0)		/* This means end of input. */
-    {
-      yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Now at end of input.\n");
-#endif
-    }
-  else
-    {
-      yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
-      if (yydebug)
-	{
-	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
-	  /* Give the individual parser a way to print the precise meaning
-	     of a token, for further debugging info.  */
-#ifdef YYPRINT
-	  YYPRINT (stderr, yychar, yylval);
-#endif
-	  fprintf (stderr, ")\n");
-	}
-#endif
-    }
-
-  yyn += yychar1;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
-    goto yydefault;
-
-  yyn = yytable[yyn];
-
-  /* yyn is what to do for this token type in this state.
-     Negative => reduce, -yyn is rule number.
-     Positive => shift, yyn is new state.
-       New state is final state => don't bother to shift,
-       just return success.
-     0, or most negative number => error.  */
-
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrlab;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the lookahead token.  */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  /* count tokens shifted since error; after three, turn off error status.  */
-  if (yyerrstatus) yyerrstatus--;
-
-  yystate = yyn;
-  goto yynewstate;
-
-/* Do the default action for the current state.  */
-yydefault:
-
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-
-/* Do a reduction.  yyn is the number of a rule to reduce with.  */
-yyreduce:
-  yylen = yyr2[yyn];
-  if (yylen > 0)
-    yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      int i;
-
-      fprintf (stderr, "Reducing via rule %d (line %d), ",
-	       yyn, yyrline[yyn]);
-
-      /* Print the symbols being reduced, and their result.  */
-      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
-	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
-      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
-    }
-#endif
-
-
-  switch (yyn) {
-
-case 1:
-#line 60 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 2:
-#line 61 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 3:
-#line 62 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 4:
-#line 63 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 5:
-#line 64 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 6:
-#line 65 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 7:
-#line 66 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 8:
-#line 67 "grammar.y"
-{ yyval.ptr = new Node(ID_CHARACTER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 9:
-#line 68 "grammar.y"
-{ yyval.ptr = new Node(ID_OPERATOR); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 10:
-#line 69 "grammar.y"
-{ yyval.ptr = new Node(ID_OPERATOR); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 11:
-#line 70 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 12:
-#line 71 "grammar.y"
-{ yyval.ptr = new Node(ID_DELIMETER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 13:
-#line 72 "grammar.y"
-{ yyval.ptr = new Node(ID_DELIMETER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 14:
-#line 73 "grammar.y"
-{ yyval.ptr = new Node(ID_IDENTIFIER); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Identifier : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 15:
-#line 74 "grammar.y"
-{ yyval.ptr = new Node(ID_CHARACTER); allocChar(yyval.ptr->value , '|'); debug("Identifier : '|'\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 16:
-#line 75 "grammar.y"
-{ yyval.ptr = new Node(ID_NUMBER); allocValue(yyval.ptr->value , yyvsp[0].dval); debug("Number : %s\n",yyvsp[0].dval); nodelist.insert(yyval.ptr); ;
-    break;}
-case 17:
-#line 76 "grammar.y"
-{ yyval.ptr = new Node(ID_STRING); allocValue(yyval.ptr->value , yyvsp[0].str); debug("String : %s\n",yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 18:
-#line 80 "grammar.y"
-{ yyval.ptr = new Node(ID_PRIMARYEXPR); yyval.ptr->child = yyvsp[0].ptr; debug("PrimaryExpr\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 19:
-#line 81 "grammar.y"
-{ yyval.ptr = new Node(ID_PRIMARYEXPR); yyval.ptr->child = yyvsp[-1].ptr; yyval.ptr->next = yyvsp[0].ptr; debug("PrimaryExpr : PrimaryExpr Identifier\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 20:
-#line 85 "grammar.y"
-{ yyval.ptr = new Node(ID_LEFT); allocChar(yyval.ptr->value , '('); debug("EQLeft \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 21:
-#line 86 "grammar.y"
-{ yyval.ptr = new Node(ID_LEFT); allocChar(yyval.ptr->value , '['); debug("EQLeft \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 22:
-#line 87 "grammar.y"
-{   yyval.ptr = new Node(ID_LEFT); allocChar(yyval.ptr->value , '{'); debug("EQLeft \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 23:
-#line 88 "grammar.y"
-{   yyval.ptr = new Node(ID_LEFT); allocChar(yyval.ptr->value , '<'); debug("EQLeft \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 24:
-#line 89 "grammar.y"
-{ yyval.ptr = new Node(ID_LEFT); allocChar(yyval.ptr->value , '|'); debug("EQLeft \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 25:
-#line 90 "grammar.y"
-{ yyval.ptr = new Node(ID_LEFT); allocValue(yyval.ptr->value , "||"); debug("EQLeft \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 26:
-#line 91 "grammar.y"
-{ yyval.ptr = new Node(ID_LEFT); allocValue(yyval.ptr->value , yyvsp[0].str); debug("EQLeft \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 27:
-#line 95 "grammar.y"
-{ yyval.ptr = new Node(ID_RIGHT); allocChar(yyval.ptr->value , ')'); debug("EQRight \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 28:
-#line 96 "grammar.y"
-{ yyval.ptr = new Node(ID_RIGHT); allocChar(yyval.ptr->value , ']'); debug("EQRight \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 29:
-#line 97 "grammar.y"
-{ yyval.ptr = new Node(ID_RIGHT); allocChar(yyval.ptr->value , '}'); debug("EQRight \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 30:
-#line 98 "grammar.y"
-{ yyval.ptr = new Node(ID_RIGHT); allocChar(yyval.ptr->value , '>'); debug("EQRight \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 31:
-#line 99 "grammar.y"
-{ yyval.ptr = new Node(ID_RIGHT); allocChar(yyval.ptr->value , '|'); debug("EQRight \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 32:
-#line 100 "grammar.y"
-{ yyval.ptr = new Node(ID_RIGHT); allocValue(yyval.ptr->value , "||"); debug("EQRight \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 33:
-#line 101 "grammar.y"
-{ yyval.ptr = new Node(ID_RIGHT); allocValue(yyval.ptr->value , yyvsp[0].str); debug("EQRight \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 34:
-#line 105 "grammar.y"
-{ yyval.ptr = new Node(ID_FENCE); yyval.ptr->child=yyvsp[-2].ptr; yyvsp[-2].ptr->next=yyvsp[-1].ptr; yyvsp[-1].ptr->next=yyvsp[0].ptr; debug("Fence \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 35:
-#line 109 "grammar.y"
-{ yyval.ptr = new Node(ID_PARENTH); yyval.ptr->child = yyvsp[-1].ptr; debug("Parenth: '(' ExprList ')' \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 36:
-#line 110 "grammar.y"
-{ yyval.ptr = new Node(ID_PARENTH); debug("Parenth: '(' ')' \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 37:
-#line 114 "grammar.y"
-{ yyval.ptr = new Node(ID_BLOCK); yyval.ptr->child = yyvsp[-1].ptr; debug("Block: '{' ExprList '}' \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 38:
-#line 115 "grammar.y"
-{ yyval.ptr = new Node(ID_BLOCK); debug("Block: '{' '}' \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 39:
-#line 119 "grammar.y"
-{ yyval.ptr = new Node(ID_BRACKET); yyval.ptr->child = yyvsp[-1].ptr; debug("Bracket \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 40:
-#line 120 "grammar.y"
-{ yyval.ptr = new Node(ID_BRACKET); debug("Bracket \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 41:
-#line 124 "grammar.y"
-{ yyval.ptr = new Node(ID_SUBEXPR); yyval.ptr->child = yyvsp[-2].ptr; yyvsp[-2].ptr->next = yyvsp[0].ptr; debug("SubSupExpr : ID_SUBEXPR\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 42:
-#line 125 "grammar.y"
-{ yyval.ptr = new Node(ID_SUPEXPR); yyval.ptr->child = yyvsp[-2].ptr; yyvsp[-2].ptr->next = yyvsp[0].ptr; debug("SubSupExpr : ID_SUPEXPR\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 43:
-#line 126 "grammar.y"
-{ yyval.ptr = new Node(ID_SUBSUPEXPR); yyval.ptr->child=yyvsp[-4].ptr; yyvsp[-4].ptr->next=yyvsp[-2].ptr; yyvsp[-2].ptr->next=yyvsp[0].ptr; debug("SubSupExpr : ID_SUBSUPEXPR\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 44:
-#line 130 "grammar.y"
-{ yyval.ptr = new Node(ID_FRACTIONEXPR); yyval.ptr->child = yyvsp[-1].ptr; yyvsp[-1].ptr->next = yyvsp[0].ptr; debug("FractionExpr : %s\n",yyvsp[-2].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 45:
-#line 134 "grammar.y"
-{ yyval.ptr = new Node(ID_OVER); yyval.ptr->child = yyvsp[-3].ptr; yyvsp[-3].ptr->next = yyvsp[-1].ptr; debug("OverExpr\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 46:
-#line 139 "grammar.y"
-{ yyval.ptr = new Node(ID_ACCENTEXPR); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Accent : %s\n", yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 47:
-#line 143 "grammar.y"
-{ yyval.ptr = new Node(ID_ACCENTEXPR); yyval.ptr->child=yyvsp[-1].ptr; yyvsp[-1].ptr->next = yyvsp[0].ptr; debug("AccentExpr \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 48:
-#line 146 "grammar.y"
-{ yyval.ptr = new Node(ID_DECORATIONEXPR); allocValue(yyval.ptr->value , yyvsp[0].str); debug("Decoration : %s\n", yyvsp[0].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 49:
-#line 150 "grammar.y"
-{ yyval.ptr = new Node(ID_DECORATIONEXPR); yyval.ptr->child = yyvsp[-1].ptr; yyvsp[-1].ptr->next = yyvsp[0].ptr; debug("DecorationExpr \n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 50:
-#line 154 "grammar.y"
-{ yyval.ptr = new Node(ID_SQRTEXPR); yyval.ptr->child = yyvsp[0].ptr; debug("RootExpr : %s\n", yyvsp[-1].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 51:
-#line 155 "grammar.y"
-{ yyval.ptr = new Node(ID_ROOTEXPR); yyval.ptr->child = yyvsp[-1].ptr; yyvsp[-1].ptr->next= yyvsp[0].ptr; debug("RootExpr : %s\n", yyvsp[-2].str); nodelist.insert(yyval.ptr); ;
-    break;}
-case 52:
-#line 159 "grammar.y"
-{ yyval.ptr = new Node(ID_BEGIN); yyval.ptr->child = yyvsp[0].ptr; nodelist.insert(yyval.ptr);  debug("BeginExpr\n"); ;
-    break;}
-case 53:
-#line 160 "grammar.y"
-{ yyval.ptr = new Node(ID_BEGIN); yyval.ptr->child = yyvsp[-1].ptr; yyvsp[-1].ptr->next= yyvsp[0].ptr; nodelist.insert(yyval.ptr); debug("BeginExpr\n"); ;
-    break;}
-case 54:
-#line 164 "grammar.y"
-{ yyval.ptr = new Node(ID_END); yyval.ptr->child = yyvsp[0].ptr; nodelist.insert(yyval.ptr); debug("EndExpr\n"); ;
-    break;}
-case 55:
-#line 169 "grammar.y"
-{ yyval.ptr = new Node(ID_MATHML); yyval.ptr->child = yyvsp[0].ptr; nodelist.insert(yyval.ptr); top = yyval.ptr; debug("MathML\n"); ;
-    break;}
-case 56:
-#line 173 "grammar.y"
-{ yyval.ptr = new Node(ID_LINES); yyval.ptr->child = yyvsp[0].ptr; nodelist.insert(yyval.ptr); debug("Lines\n"); ;
-    break;}
-case 57:
-#line 174 "grammar.y"
-{ yyval.ptr = new Node(ID_LINES); yyval.ptr->child = yyvsp[-2].ptr; yyvsp[-2].ptr->next = yyvsp[0].ptr; nodelist.insert(yyval.ptr); debug("Lines\n"); ;
-    break;}
-case 58:
-#line 178 "grammar.y"
-{ yyval.ptr = new Node(ID_LINE); yyval.ptr->child = yyvsp[0].ptr; nodelist.insert(yyval.ptr); debug("Line\n"); ;
-    break;}
-case 59:
-#line 182 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPRLIST); yyval.ptr->child = yyvsp[0].ptr; debug("ExprList : Expr\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 60:
-#line 183 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPRLIST); yyval.ptr->child = yyvsp[-1].ptr; yyvsp[-1].ptr->next = yyvsp[0].ptr;  debug("ExprList : ExprList Expr\n"); nodelist.insert(yyval.ptr); ;
-    break;}
-case 61:
-#line 187 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : Block\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 62:
-#line 188 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : Parenth\n");  nodelist.insert(yyval.ptr);;
-    break;}
-case 63:
-#line 189 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : Fence\n");  nodelist.insert(yyval.ptr);;
-    break;}
-case 64:
-#line 190 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : SubSupExpr\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 65:
-#line 191 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : FractionExpr\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 66:
-#line 192 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : OverExpr\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 67:
-#line 193 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : DecorationExpr\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 68:
-#line 194 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : RootExpr\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 69:
-#line 195 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : AccentExpr\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 70:
-#line 196 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : PrimaryExpr\n"); nodelist.insert(yyval.ptr);;
-    break;}
-case 71:
-#line 197 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : BeginExpr\n");  nodelist.insert(yyval.ptr);;
-    break;}
-case 72:
-#line 198 "grammar.y"
-{ yyval.ptr = new Node(ID_EXPR); yyval.ptr->child = yyvsp[0].ptr; debug("Expr : EndExpr\n");  nodelist.insert(yyval.ptr);;
-    break;}
-}
-   /* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/lib/bison.simple"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-#ifdef YYLSP_NEEDED
-  yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-  *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
-  yylsp++;
-  if (yylen == 0)
-    {
-      yylsp->first_line = yylloc.first_line;
-      yylsp->first_column = yylloc.first_column;
-      yylsp->last_line = (yylsp-1)->last_line;
-      yylsp->last_column = (yylsp-1)->last_column;
-      yylsp->text = 0;
-    }
-  else
-    {
-      yylsp->last_line = (yylsp+yylen-1)->last_line;
-      yylsp->last_column = (yylsp+yylen-1)->last_column;
-    }
-#endif
-
-  /* Now "shift" the result of the reduction.
-     Determine what state that goes to,
-     based on the state we popped back to
-     and the rule number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
-  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTBASE];
-
-  goto yynewstate;
-
-yyerrlab:   /* here on detecting error */
-
-  if (! yyerrstatus)
-    /* If not already recovering from an error, report this error.  */
-    {
-      ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (yyn > YYFLAG && yyn < YYLAST)
-	{
-	  int size = 0;
-	  char *msg;
-	  int x, count;
-
-	  count = 0;
-	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-	  for (x = (yyn < 0 ? -yyn : 0);
-	       x < (sizeof(yytname) / sizeof(char *)); x++)
-	    if (yycheck[x + yyn] == x)
-	      size += strlen(yytname[x]) + 15, count++;
-	  msg = (char *) malloc(size + 15);
-	  if (msg != 0)
-	    {
-	      strcpy(msg, "parse error");
-
-	      if (count < 5)
-		{
-		  count = 0;
-		  for (x = (yyn < 0 ? -yyn : 0);
-		       x < (sizeof(yytname) / sizeof(char *)); x++)
-		    if (yycheck[x + yyn] == x)
-		      {
-			strcat(msg, count == 0 ? ", expecting `" : " or `");
-			strcat(msg, yytname[x]);
-			strcat(msg, "'");
-			count++;
-		      }
-		}
-	      yyerror(msg);
-	      free(msg);
-	    }
-	  else
-	    yyerror ("parse error; also virtual memory exceeded");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror("parse error");
-    }
-
-  goto yyerrlab1;
-yyerrlab1:   /* here on error raised explicitly by an action */
-
-  if (yyerrstatus == 3)
-    {
-      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
-
-      /* return failure if at end of input */
-      if (yychar == YYEOF)
-	YYABORT;
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
-      yychar = YYEMPTY;
-    }
-
-  /* Else will try to reuse lookahead token
-     after shifting the error token.  */
-
-  yyerrstatus = 3;		/* Each real token shifted decrements this */
-
-  goto yyerrhandle;
-
-yyerrdefault:  /* current state does not do anything special for the error token. */
-
-#if 0
-  /* This is wrong; only states that explicitly want error tokens
-     should shift them.  */
-  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
-  if (yyn) goto yydefault;
-#endif
-
-yyerrpop:   /* pop the current state because it cannot handle the error token */
-
-  if (yyssp == yyss) YYABORT;
-  yyvsp--;
-  yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
-  yylsp--;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "Error: state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-yyerrhandle:
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yyerrdefault;
-
-  yyn += YYTERROR;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
-    goto yyerrdefault;
-
-  yyn = yytable[yyn];
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrpop;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrpop;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting error token, ");
-#endif
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  yystate = yyn;
-  goto yynewstate;
-
- yyacceptlab:
-  /* YYACCEPT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 0;
-
- yyabortlab:
-  /* YYABORT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 1;
-}
-#line 202 "grammar.y"
-
-
-Node *mainParse(const char *_code)
-{
-	initFlex( _code );
-	top = 0L;
-	yyparse();
-	if( top )
-		return top;
-	else
-		return 0L;
-}
-
-void yyerror(const char * /*err*/)
-{
-//	printf("REALKING ERR[%s]\n",err);
-	// if error, delete all nodes.
-	Node *pNode = 0L;
-	int ncount = nodelist.count();
-	for( int i = 0 ; i < ncount ; i++){
-		pNode = nodelist.remove(0);
-		delete pNode;
-	}
-	top = 0L;
-}
-
-#ifndef PARSE_DEBUG
-int debug(const char * /*format*/, ...)
-{
-	return 0;
-}
-#endif
-
diff --git a/main/hwpfilter/source/grammar.h b/main/hwpfilter/source/grammar.h
deleted file mode 100644
index 218a442..0000000
--- a/main/hwpfilter/source/grammar.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-typedef union {
-	char *dval;
-	char *str;
-	Node *ptr;
-} YYSTYPE;
-#define	ACCENT	257
-#define	SMALL_GREEK	258
-#define	CAPITAL_GREEK	259
-#define	BINARY_OPERATOR	260
-#define	RELATION_OPERATOR	261
-#define	ARROW	262
-#define	GENERAL_IDEN	263
-#define	GENERAL_OPER	264
-#define	BIG_SYMBOL	265
-#define	FUNCTION	266
-#define	ROOT	267
-#define	FRACTION	268
-#define	SUBSUP	269
-#define	EQOVER	270
-#define	DELIMETER	271
-#define	LARGE_DELIM	272
-#define	DECORATION	273
-#define	SPACE_SYMBOL	274
-#define	CHARACTER	275
-#define	STRING	276
-#define	OPERATOR	277
-#define	EQBEGIN	278
-#define	EQEND	279
-#define	EQLEFT	280
-#define	EQRIGHT	281
-#define	NEWLINE	282
-#define	LEFT_DELIM	283
-#define	RIGHT_DELIM	284
-#define	DIGIT	285
-
-#ifndef _WIN32
-extern YYSTYPE yylval;
-#endif
diff --git a/main/hwpfilter/source/hbox.cpp b/main/hwpfilter/source/hbox.cpp
deleted file mode 100644
index 4846e04..0000000
--- a/main/hwpfilter/source/hbox.cpp
+++ /dev/null
@@ -1,701 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#include "precompile.h"
-
-#include <ctype.h>
-
-#include "hwpfile.h"
-#include "hbox.h"
-#include "hpara.h"
-#include "hutil.h"
-#include "htags.h"
-#include "drawdef.h"
-#include "hcode.h"
-
-int HBox::boxCount = 0;
-
-HBox::HBox(hchar hch)
-{
-    hh = hch;
-    boxCount++;
-}
-
-
-HBox::~HBox()
-{
-    boxCount--;
-}
-
-
-int HBox::WSize(void)
-{
-    static int wsize[32] =
-    {
-        1, 4, 4, 4, 4, 4, 4, 42,                  /* dateform */
-        48, 4, 4, 4, 4, 1, 4, 4,                  /* hidden */
-        4, 4, 4, 4, 4, 4, 12, 5,                  /* chcompose */
-        3, 3, 123, 4, 32, 4, 2, 2
-    };
-
-    if (hh < 32)
-        return wsize[hh];
-    else
-        return 1;
-}
-
-
-hchar_string HBox::GetString()
-{
-    hchar_string ret;
-    ret.push_back(hh);
-    return ret;
-}
-
-
-hunit HBox::Height(CharShape *csty)
-{
-    return( csty->size );
-}
-
-
-// skip block
-SkipBlock::SkipBlock(hchar hch):HBox(hch)
-{
-    data_block = 0;
-}
-
-
-SkipBlock::~SkipBlock(void)
-{
-    delete[]data_block;
-}
-
-
-// FieldCode [5]
-FieldCode::FieldCode(void) : HBox(CH_FIELD)
-{
-    str1 = 0;
-    str2 = 0;
-    str3 = 0;
-    bin = 0;
-    reserved1 = new char[4];
-    reserved2 = new char[22];
-	 m_pDate = 0L;
-}
-
-
-FieldCode::~FieldCode(void)
-{
-    delete[] str1;
-    delete[] str2;
-    delete[] str3;
-    delete[] bin;
-    delete[] reserved1;
-    delete[] reserved2;
-	 if( m_pDate )
-		  delete m_pDate;
-}
-
-
-// book mark(6)
-Bookmark::Bookmark(void):HBox(CH_BOOKMARK)
-{
-}
-
-
-Bookmark::~Bookmark(void)
-{
-}
-
-
-// date format(7)
-DateFormat::DateFormat(void):HBox(CH_DATE_FORM)
-{
-}
-
-
-// date code(8)
-
-DateCode::DateCode(void):HBox(CH_DATE_CODE)
-{
-}
-
-
-#define _DATECODE_WEEK_DEFINES_
-#include "datecode.h"
-
-hchar_string DateCode::GetString()
-{
-    hchar_string ret;
-    hchar *fmt;
-    int i, num;
-    const char *form;
-    char cbuf[256];
-    bool is_pm, add_zero;
-
-    add_zero = false;
-    format[DATE_SIZE - 1] = 0;
-    fmt = format[0] ? format : defaultform;
-
-    for (; *fmt && ((int) ret.size() < DATE_SIZE); fmt++)
-    {
-        form = (add_zero) ? "%02d" : "%d";
-
-        add_zero = false;
-        is_pm = (date[HOUR] >= 12);
-        *cbuf = 0;
-        num = -1;
-
-        switch (*fmt)
-        {
-            case '0':
-                add_zero = true;
-                break;
-            case '1':
-                num = date[YEAR];
-                form = "%04d";
-                break;
-            case '!':
-                num = date[YEAR] % 100;
-                break;
-            case '2':
-                num = date[MONTH];
-                break;
-            case '@':
-                memcpy(cbuf, eng_mon + (date[MONTH] - 1) * 3, 3);
-                cbuf[3] = '.';
-                cbuf[4] = 0;
-                break;
-            case '*':
-                strcpy(cbuf, en_mon[date[MONTH] - 1]);
-                break;
-            case '3':                             /* 'D' is day of korean */
-                num = date[DAY];
-                break;
-            case '#':
-                num = date[DAY];
-                switch (date[DAY] % 10)
-                {
-                    case 1:
-                        form = "%dst";
-                        break;
-                    case 2:
-                        form = "%dnd";
-                        break;
-                    case 3:
-                        form = "%drd";
-                        break;
-                    default:
-                        form = "%dth";
-                        break;
-                }
-                break;
-            case '4':
-                num = date[HOUR] - ((date[HOUR] > 12) ? 12 : 0);
-                break;
-            case '$':
-                num = date[HOUR];
-                break;
-            case '5':
-            case '%':
-                num = date[MIN];
-                break;
-            case '6':
-                ret.push_back(kor_week[date[WEEK]]);
-                break;
-            case '^':
-                memcpy(cbuf, eng_week + date[WEEK] * 3, 3);
-                cbuf[3] = '.';
-                cbuf[4] = 0;
-                break;
-            case '_':
-                strcpy(cbuf, en_week[date[WEEK]]);
-                break;
-            case '7':
-                ret.push_back(0xB5A1);
-                ret.push_back((is_pm) ? 0xD281 : 0xB8E5);
-                break;
-            case '&':
-                strcpy(cbuf, (is_pm) ? "p.m." : "a.m.");
-                break;
-            case '+':
-                strcpy(cbuf, (is_pm) ? "P.M." : "A.M.");
-                break;
-            case '8':                             // 2.5 feature
-            case '9':
-#if 0
-// LATER
-                mkcurfilename(cbuf, *fmt);
-                for (i = 0; cbuf[i] != 0 && slen > 1; i++)
-                {                                 //for hangle filename
-                    if (cbuf[i] & 0x80 && cbuf[i + 1] != 0)
-                    {
-                        *d++ = (cbuf[i] << 8) | cbuf[i + 1];
-                        i++;
-                    }
-                    else
-                        *d++ = cbuf[i];
-                    slen--;
-                }
-#endif
-                cbuf[0] = 0;
-                break;
-            case '~':                             // 3.0b feature
-                if (fmt[1] == 0)
-                    break;
-                fmt++;
-                if (*fmt == '6')
-                {
-                    ret.push_back(china_week[date[WEEK]]);
-                    break;
-                }
-                break;
-            default:
-                if (*fmt == '\\' && *++fmt == 0)
-                    goto done;
-                ret.push_back(*fmt);
-        }
-        if (num != -1)
-            sprintf(cbuf, form, num);
-        for (i = 0; 0 != cbuf[i]; i++)
-        {
-            ret.push_back(*(cbuf + i));
-        }
-    }
-    done:
-    return ret;
-}
-
-
-// tab(9)
-
-Tab::Tab(void):HBox(CH_TAB)
-{
-}
-
-
-// floating box
-FBox::FBox(hchar hch):HBox(hch)
-{
-    prev = next = 0;
-	 zorder = 0;
-}
-
-
-FBox::~FBox()
-{
-}
-
-
-// tbox(10) TABLE BOX MATH BUTTON HYPERTEXT
-
-TxtBox::TxtBox(void):FBox(CH_TEXT_BOX), cell(0), plists(0)
-{
-}
-
-
-TxtBox::~TxtBox(void)
-{
-    delete[]cell;
-
-    for (int ii = 0; ii < nCell; ++ii)
-    {
-        LinkedListIterator < HWPPara > it(&plists[ii]);
-        for (; it.current(); it++)
-            delete it.current();
-    }
-
-    LinkedListIterator < HWPPara > it(&caption);
-    for (; it.current(); it++)
-        delete it.current();
-
-    delete[]plists;
-}
-
-
-hunit TxtBox::Height(CharShape * csty)
-{
-    return (style.anchor_type == CHAR_ANCHOR) ? box_ys : csty->size;
-}
-
-
-// picture(11)
-
-Picture::Picture(void):FBox(CH_PICTURE)
-{
-    follow = 0;
-    ishyper = false;
-}
-
-
-Picture::~Picture(void)
-{
-    delete[]follow;
-    if( pictype == PICTYPE_DRAW && picinfo.picdraw.hdo )
-        delete (HWPDrawingObject *) picinfo.picdraw.hdo;
-
-    LinkedListIterator < HWPPara > it(&caption);
-    for (; it.current(); it++)
-        delete it.current();
-}
-
-
-int Picture::Type()
-{
-    return pictype;
-}
-
-
-hunit Picture::Height(CharShape * sty)
-{
-    return (style.anchor_type == CHAR_ANCHOR) ? box_ys : sty->size;
-}
-
-
-// line(14)
-// hidden(15)
-Hidden::~Hidden(void)
-{
-    LinkedListIterator < HWPPara > it(&plist);
-    for (; it.current(); it++)
-        delete it.current();
-}
-
-
-// header/footer(16)
-HeaderFooter::~HeaderFooter(void)
-{
-    LinkedListIterator < HWPPara > it(&plist);
-    for (; it.current(); it++)
-        delete it.current();
-}
-
-
-// footnote(17)
-Footnote::~Footnote(void)
-{
-    LinkedListIterator < HWPPara > it(&plist);
-    for (; it.current(); it++)
-        delete it.current();
-}
-
-
-// auto number(18)
-// new number(19)
-// show page number (20)
-// 홀수쪽시작/감추기 (21)
-
-// mail merge(22)
-hchar_string MailMerge::GetString()
-{
-    return hchar_string();
-}
-
-
-// character compositon(23)
-// hyphen(24)
-// toc mark(25)
-// index mark(26)
-// outline(28)
-
-#define OL_HANGL_JASO   0
-#define OL_HANGL_KANATA 1
-
-static hchar olHanglJaso(int num, int type)
-{
-    static unsigned char han_init[] =
-        "\x88\x90\x94\x9c\xa0\xa4\xac\xb4\xb8\xc0\xc4\xc8\xcc\xd0";
-    static unsigned char jung[] = { 3, 5, 7, 11, 13, 19, 20, 26, 27, 29, 30 };
-    static unsigned char jung2[] = { 3, 7, 13, 20, 27, 29, 30 };
-
-    hchar hh = 0;
-    int j;
-
-    if (type == OL_HANGL_JASO)
-    {
-        num = num % (14 + (sizeof(jung) / sizeof(char)));
-
-        if (num < 14)
-            hh = (han_init[num] << 8) | 'A';
-        else
-            hh = (jung[num - 14] << 5) | 0x8401;
-    }
-    else
-    {
-        if (num < 14)
-            hh = (han_init[num] << 8) | 'a';
-        else
-        {
-            j = (num / 14) % (sizeof(jung2) / sizeof(char));
-
-            num = num % 14;
-            hh = (han_init[num] << 8) | (jung2[j] << 5) | 1;
-        }
-    }
-    return hh;
-}
-
-
-static hchar *GetOutlineStyleChars(int style)
-{
-    static hchar out_bul_style_entry[5][8] =      // extern
-    {
-        {                                         // 0 OLSTY_BULLET1
-            0x2f18, 0x2f12, 0x2f08, 0x2f02, 0x2f06, 0x2f00, 0x2043, 0x0000
-        },
-        {                                         // 1
-            0x2f18, 0x2f12, 0x2f06, 0x2f00, 0x2f36, 0x2f30, 0x2043, 0x0000
-        },
-        {                                         // 2
-            0x2f26, 0x2f20, 0x2f06, 0x2f00, 0x2f16, 0x2f10, 0x2043, 0x0000
-        },
-        {                                         // 3
-            0x2f18, 0x2f16, 0x2f12, 0x2f10, 0x2f06, 0x2f00, 0x2043, 0x0000
-        },
-        {                                         //
-            0xAC61, 0xB677, 0xB861, 0xB8F7, 0xB781, 0x0000
-        },
-    };
-    if (style >= OLSTY_BULLET1 && style <= OLSTY_BULLET5)
-        return out_bul_style_entry[style - OLSTY_BULLET1];
-    return NULL;
-}
-
-
-static void getOutlineNumStr(int style, int level, int num, hchar * hstr)
-{
-    enum
-    {
-        U_ROM = 0x01, L_ROM = 0x02, U_ENG = 0x04, L_ENG = 0x08,
-        HAN = 0x10, NUM = 0x20, L_BR = 0x40, R_BR = 0x80
-    };
-    static unsigned char type_tbl[][MAX_OUTLINE_LEVEL] =
-    {
-        {
-            U_ROM, HAN, NUM, HAN | R_BR, L_BR | NUM | R_BR,
-            L_BR | HAN | R_BR, L_ROM | R_BR
-        },
-        {
-            U_ROM, U_ENG, NUM, L_ENG | R_BR, L_BR | NUM | R_BR,
-            L_BR | L_ENG | R_BR, L_ROM | R_BR
-        },
-        {
-            NUM, HAN, L_BR | NUM | R_BR, L_BR | HAN | R_BR, NUM |
-            R_BR, HAN | R_BR, L_ENG
-        }
-    };
-    char fmt = type_tbl[style - OLSTY_NUMSIG1][level];
-    char buf[80], *ptr;
-
-    if (num < 1)
-        num = 1;
-    if (fmt & L_BR)
-        *hstr++ = '(';
-    if (fmt & NUM)
-    {
-        sprintf(buf, "%d", num);
-        str2hstr(buf, hstr);
-        hstr += strlen(buf);
-    }
-    else if (fmt & (U_ROM | L_ROM))
-    {
-        num2roman(num, buf);
-        if (fmt & U_ROM)
-        {
-            ptr = buf;
-            while (*ptr)
-            {
-                *ptr = sal::static_int_cast<char>(toupper(*ptr));
-                ptr++;
-            }
-        }
-        str2hstr(buf, hstr);
-        hstr += strlen(buf);
-    }
-    else
-    {
-        num = (num - 1) % 26;
-        if (fmt & U_ENG)
-            *hstr++ = sal::static_int_cast<hchar>('A' + num);
-        else if (fmt & L_ENG)
-            *hstr++ = sal::static_int_cast<hchar>('a' + num);
-        else if (fmt & HAN)
-            *hstr++ = olHanglJaso(num, OL_HANGL_KANATA);
-    }
-    *hstr++ = (fmt & R_BR) ? ')' : '.';
-    *hstr = 0;
-}
-
-
-enum
-{ OUTLINE_ON, OUTLINE_NUM };
-
-/*  level 은 0부터 시작. 즉 1.1.1. 의 레벨은 2이다.
-    number는 값이 그대로 들어가 있다. 즉, 1.2.1에는 1,2,1이 들어가 있다.
-    style 은 1부터 값이 들어가 있다. hbox.h에 정의된 데로..
- */
-hchar_string Outline::GetUnicode() const
-{
-    int levelnum;
-    hchar *p;
-	 hchar buffer[255];
-
-    buffer[0] = 0;
-    if (kind == OUTLINE_NUM)
-    {
-        switch (shape)
-        {
-            case OLSTY_NUMS1:
-            case OLSTY_NUMS2:
-            {
-                char cur_num_str[10], buf[80];
-                int i;
-
-                buf[0] = 0;
-                for (i = 0; i <= level; i++)
-                {
-                    levelnum = ((number[i] < 1) ? 1 : number[i]);
-                    if (shape == OLSTY_NUMS2 && i && i == level)
-                        sprintf(cur_num_str, "%d%c", levelnum, 0);
-                    else
-                        sprintf(cur_num_str, "%d%c", levelnum, '.');
-                    strcat(buf, cur_num_str);
-                }
-                str2hstr(buf, buffer);
-					 return hstr2ucsstr(buffer);
-            }
-            case OLSTY_NUMSIG1:
-            case OLSTY_NUMSIG2:
-            case OLSTY_NUMSIG3:
-				{
-                getOutlineNumStr(shape, level, number[level], buffer);
-                     return hstr2ucsstr(buffer);
-				}
-            case OLSTY_BULLET1:
-            case OLSTY_BULLET2:
-            case OLSTY_BULLET3:
-            case OLSTY_BULLET4:
-            case OLSTY_BULLET5:
-				{
-                p = GetOutlineStyleChars(shape);
-                buffer[0] = p[level];
-                buffer[1] = 0;
-                     return hstr2ucsstr(buffer);
-				}
-            case OLSTY_USER:
-            case OLSTY_BULUSER:
-				{
-						char dest[80];
-                    int l = 0;
-					int i = level;
-					if( deco[i][0] ){
-						buffer[l++] = deco[i][0];
-					}
-/*  level 은 0부터 시작. 즉 1.1.1. 의 레벨은 2이다.
-    number는 값이 그대로 들어가 있다. 즉, 1.2.1에는 1,2,1이 들어가 있다.
-    style 은 1부터 값이 들어가 있다. hbox.h에 정의된 데로..
- */
-					switch( user_shape[i] )
-					{
-						case 0:
-							buffer[l++] = '1' + number[i] - 1;
-							break;
-                        case 1: /* 대문자로마 */
-                        case 2: /* 소문자로마 */
-							num2roman(number[i], dest);
-							if( user_shape[i] == 1 ){
-								char *ptr = dest;
-								while( *ptr )
-								{
-                                    *ptr = sal::static_int_cast<char>(toupper(*ptr));
-									ptr++;
-								}
-							}
-							str2hstr(dest, buffer + l);
-							l += strlen(dest);
-							break;
-						case 3:
-							buffer[l++] = 'A' + number[i] -1;
-							break;
-						case 4:
-							buffer[l++] = 'a' + number[i] -1;
-							break;
-						case 5:
-							buffer[l++] = olHanglJaso(number[i] -1, OL_HANGL_KANATA);
-							break;
-						case 6:
-							buffer[l++] = olHanglJaso(number[i] -1, OL_HANGL_JASO);
-							break;
-                        case 7: /* 한자 숫자 : 일반 숫자로 표현 */
-							buffer[l++] = '1' + number[i] -1;
-							break;
-                        case 8: /* 원숫자 */
-							buffer[l++] = 0x2e00 + number[i];
-							break;
-                        case 9: /* 원 알파벳 소문자 */
-							buffer[l++] = 0x2c20 + number[i];
-							break;
-                        case 10: /* 원 가나다 */
-							buffer[l++] = 0x2c50 + number[i] -1;
-							break;
-                        case 11: /* 원 ㄱ ㄴ */
-							buffer[l++] = 0x2c40 + number[i] -1;
-							break;
-                        case 12: /* 이어진 숫자. */
-						{
-							 char cur_num_str[10],buf[80];
-							 int j;
-							 buf[0] = 0;
-							 for (j = 0; j <= level; j++)
-							 {
-								  levelnum = ((number[j] < 1) ? 1 : number[j]);
-								  if ((j && j == level) || (j == level && deco[i][1]))
-										sprintf(cur_num_str, "%d%c", levelnum, 0);
-								  else
-										sprintf(cur_num_str, "%d%c", levelnum, '.');
-								  strcat(buf, cur_num_str);
-							 }
-							 str2hstr(buf, buffer + l);
-							 l += strlen(buf);
-							break;
-						}
-						default:
-							buffer[l++] = user_shape[i];
-							break;
-					}
-					if( deco[i][1] ){
-						buffer[l++] = deco[i][1];
-					}
-					buffer[l] = 0;
-                    return hstr2ucsstr(buffer);
-				}
-        }
-    }
-    return hstr2ucsstr(buffer);
-}
-
-
-/* 묶음 빈칸(30) */
-/* 고정폭 빈칸(31) */
-
diff --git a/main/hwpfilter/source/hbox.h b/main/hwpfilter/source/hbox.h
deleted file mode 100644
index 30a59ff..0000000
--- a/main/hwpfilter/source/hbox.h
+++ /dev/null
@@ -1,1039 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hbox.h,v 1.6 2008-06-04 09:56:30 vg Exp $ */
-
-#ifndef _HBOX_H_
-#define _HBOX_H_
-
-#include "list.hxx"
-
-#include "hwplib.h"
-#include "hwpfile.h"
-#include "hinfo.h"
-#include "hpara.h"
-
-/**
- * The HBox class is the base class for all date classes in hwp document.
- * For example, there are special character, table, image, etc.
- * It has one character. The ascii code value of special characters are smaller than 32. General character is greater than 32.
- *
- * @short Base class for characters
- */
-struct HBox
-{
-    public:
-        hchar hh;
-
-/**
- * Construct a HBox object with parameter hch.
- * @param hch 16bit character being able to have Korean character.
- */
-        HBox( hchar hch );
-        virtual ~HBox();
-/**
- * @returns The Size of HBox object
- */
-        virtual int   WSize();
-/**
- * @returns The Height of HBox object as hunit value.
- */
-        virtual hunit Height(CharShape *csty);
-/**
- * Read properties from HIODevice object like stream, file, memory.
- *
- * @param hwpf HWPFile Object having all information for a hwp file.
- * @returns True if reading from stream is successful.
- */
-        virtual int   Read(HWPFile &hwpf);
-
-        virtual hchar_string GetString();
-    private:
-        static int boxCount;
-};
-
-/**
- * @short Class for saving data to be skipped.
- */
-struct SkipBlock: public HBox
-{
-    ulong data_block_len;
-    hchar dummy;
-    char  *data_block;
-
-    SkipBlock(hchar);
-    virtual ~SkipBlock();
-    virtual int Read(HWPFile &hwpf);
-};
-struct DateCode;
-struct FieldCode : public HBox
-{
-    uchar type[2];                    /* 2/0 - 계산식, 3/0-문서요약, 3/1-개인정보, 3/2-만든날짜, 4/0-누름틀 */
-    char *reserved1;
-    unsigned short location_info;     /* 0 - 끝코드, 1 - 시작코드 */
-    char *reserved2;
-    hchar *str1;
-    hchar *str2;
-    hchar *str3;
-    char *bin;
-
-	 DateCode *m_pDate;
-
-    FieldCode();
-    virtual ~FieldCode();
-    virtual int Read(HWPFile &hwpf);
-};
-/**
- * Kind of BOOKMARK
- */
-enum
-{
-    BM_MARK,
-    BM_BEGIN,
-    BM_END
-};
-
-#define BMK_COMMENT_LEN 15
-
-/**
- * @short Class for BOOKMARK
- */
-struct Bookmark: public HBox
-{
-    hchar         dummy;
-    hchar         id[BMK_COMMENT_LEN + 1];
-    unsigned short    type;
-
-    Bookmark();
-    virtual ~Bookmark();
-    virtual int Read(HWPFile &hwpf);
-};
-
-// date format(7)
-const int DATE_SIZE = 40;
-
-/**
- * @short Class for saving date format made by user
- */
-struct DateFormat: public HBox
-{
-    hchar format[DATE_SIZE];
-    hchar dummy;
-
-    DateFormat();
-    virtual int Read(HWPFile &hwpf);
-};
-
-/**
- * @short Class for current date and time with specified format.
- */
-struct DateCode: public HBox
-{
-    enum
-    {
-        YEAR, MONTH, WEEK, DAY, HOUR, MIN
-    };
-
-    hchar format[DATE_SIZE];
-/**
- * year/month/week/day/hour/minute
- */
-    short date[6];
-    hchar dummy;
-    unsigned char key;
-
-    DateCode();
-    virtual int Read(HWPFile &hwpf);
-
-    virtual hchar_string GetString();
-};
-
-/**
- * @short Tab object
- */
-struct Tab: public HBox
-{
-    hunit width;
-    unsigned short leader;
-    hchar dummy;
-
-    Tab();
-    virtual int Read(HWPFile &hwpf);
-};
-
-// tbox(10) TABLE BOX MATH BUTTON HYPERTEXT
-
-enum ttype { TBL_TYPE, TXT_TYPE, EQU_TYPE, BUTTON_TYPE, HYPERTEXT_TYPE };
-enum                                              /* TxtBox->margin[n][?] */
-{
-    OUT_M, IN_M, CELL_M
-};
-enum                                              /* TxtBox->margin[?][n] */
-{
-    L_M, R_M, T_M, B_M
-};
-enum anchor { CHAR_ANCHOR, PARA_ANCHOR, PAGE_ANCHOR, PAPER_ANCHOR };
-enum { TF_OCCUPY_SPACE, TF_TRANSPARENT,TF_ARROUND_TEXT };
-enum
-{
-    CAP_OUT_BOT,  CAP_OUT_TOP,  CAP_IN_BOT,    CAP_IN_TOP,
-    CAP_LEFT_BOT, CAP_LEFT_TOP, CAP_RIGHT_BOT, CAP_RIGHT_TOP,
-    EQU_CAP_POS
-};
-
-/**
- * Definitions for frame's common 'option' member.
- */
-#define DRAW_FRAME      1                         /* <-> no frame, bit 0 */
-#define NORMAL_PIC      2                         /* <-> reverse,  bit 1 */
-#define FIT_TO_COLUMN   4                         /* fig_xs is columnlen */
-#define UNKNOWN_FILE    8                         /* need check reverse for pcx mono */
-#define HYPERTEXT_FLAG  16
-#define UNKNOWN_SIZE    32
-#define FOPT_TEMP_BIT   0x00010000                /* temporary starts from 16th bits */
-
-struct CellLine
-{
-    unsigned char key;
-    unsigned char top;                            // 0 - 라인없음, 1-single, 2-thick, 3-double
-    unsigned char bottom;
-    unsigned char left;
-    unsigned char right;
-    short color;                                  // cell color
-    unsigned char shade;                          // <100%
-};
-/**
- * A cell has four properties to specify the position for itself in hwp.
- * @li xpos -  distance between left border of cell and left border of table
- * @li ypos -  distance between top border of cell and top border of table
- * @li width -  distance between left border of cell and right border of cell
- * @li height -  distance between top border of cell and bottom border of table
- * This is differ from the format of other office in fact cell has two properties
- * - rowindex and column index.
- *
- * @short Cell object
- */
-struct Cell                                       // Cell
-{
-    unsigned char key;                            // Index value of border style
-    short     p;
-    short     color;                              // cell color
-    short     x, y;                               // [x,y] cell pos
-    short     w, h;                               // [x,y] cell size
-    short     txthigh, cellhigh;                  // used maximum
-    unsigned char flag, changed, used;            // unused(file)
-    unsigned char ver_align;                      // vertical align  {1=center}
-    unsigned char linetype[4];                    // [left,right,top,bottom]
-    unsigned char shade;                          // <100%
-    unsigned char diagonal;                       // { 0=none,\=1,/=2,X=3}
-    unsigned char protect;
-
-    void  Read( HWPFile &hwpf );
-};
-
-/**
- * @short Style for floating object
- */
-struct FBoxStyle
-{
-/**
- * Anchor type : paragraph , page, char
- */
-    unsigned char anchor_type;
-/**
- * Kind of wrap
- */
-    unsigned char txtflow;                        /* 그림피함. 0-2(자리차지,투명,어울림) */
-/**
- * Horizontal alignment
- */
-    short     xpos;                               // left, right, center, xx
-/**
- * Vertical alignment
- */
-    short     ypos;                               // page top, bottom, yy
-/**
- * Every margin of border
- * [0-2][] : out/in/cell margin
- * [][0-3] : left/right/top/bottom
- */
-    short     margin[3][4];                       // out : left, right, top, bottom
-/**
- * Index of floating object
- */
-    short     boxnum;                             /* 스타오피스에서 스타일 이름으로 사용될 숫자 */
-/**
- * Type of floating object : line, txtbox, image, table, equalizer and button
- */
-    unsigned char boxtype;                        // (L)ine, t(X)tbox, Picture - (G)
-    short     cap_len; /* 캡션의 길이 */
-
-    void *cell;
-
-};
-
-/**
- * This object is for floating object like table, image, line and so on.
- *
- * @short floating object
- */
-struct FBox: public HBox
-{
-	int	zorder;
-    short     option;                             // draw frame
-    hchar     ctrl_ch;
-    FBoxStyle style;
-
-    short     box_xs, box_ys;
-    short     cap_xs, cap_ys ;
-    short     xs, ys;                             // ys = fig_ys + cap_ys + margin
-// xs = fig_xs + cap_xs + margin
-    short     cap_margin;
-    char      xpos_type, ypos_type;
-    unsigned char smart_linesp;
-
-/*  이 자료는 tbox나 pic에서는 파일에 기록하지 않고 실행시만 있으며,
-    line에서는 파일에 기록한다.
- */
-    short     boundsy, boundey;
-    unsigned char boundx, draw;
-
-/**
- * Physical x,y position.
- */
-    short     pgx, pgy;                           // physical xpos, ypos
-    short     pgno, showpg;                       // pageno where code is
-
-    FBox      *prev, *next;
-
-    FBox( hchar hch );
-    virtual ~FBox();
-};
-
-struct Table;
-/**
- * The TxtBox class saves object properties about table, textbox, equalizer or button
- */
-struct TxtBox: public FBox
-{
-    hchar     reserved[2];
-    hchar     dummy;
-
-    short     dummy1;                             // to not change structure size */
-    short     cap_len;
-    short     next;
-    short     dummy2;                             // to not change structure size */
-    unsigned char reserved1;
-/**
- * caption position
- */
-    short     cap_pos;                            // caption pos
-    short     num;                                // numbering
-
-    short     dummy3;
-    short     baseline;                           //(for equ)
-
-/**
- * The value of type indicates as the below: zero is table, one is
- * textbox, two is equalizer and three is button.
- */
-    short     type;                               // 0-table, 1-textbox, 2-수식, 3-button
-/**
- * nCell is greater than one only for table, otherwise it is 1.
- */
-    short     nCell;                              //:=1    offset 80
-/**
- * If value of protect is 1, size of cell cann't change.
- */
-    short     protect;                            //1=size lock
-
-    Cell      *cell;
-	 Table *m_pTable;
-/**
- * Paragraph list
- */
-    LinkedList<HWPPara> *plists;
-/**
- * Caption
- */
-    LinkedList<HWPPara> caption;
-
-    TxtBox();
-    virtual ~TxtBox();
-
-/**
- * @returns Count of cell.
- */
-    virtual int NCell()   { return nCell; }
-/**
- * This is one of table, text-box, equalizer and button
- * @returns Type of this object.
- */
-    virtual int Type()    { return type;  }
-
-    virtual int Read(HWPFile &hwpf);
-
-    virtual hunit  Height(CharShape *csty);
-};
-
-#define ALLOWED_GAP 5
-#define INIT_SIZE 20
-#define ADD_AMOUNT 10
-
-struct Columns
-{
-	 int *data;
-     size_t nCount;
-     size_t nTotal;
-	 Columns(){
-		  nCount = 0;
-		  nTotal = INIT_SIZE;
-		  data = new int[nTotal];
-	 }
-	 ~Columns(){ delete[] data; }
-
-	 void AddColumnsSize(){
-		  int *tmp = data;
-          if (nTotal + ADD_AMOUNT < nTotal) // overflow
-          {
-              throw ::std::bad_alloc();
-          }
-		  data = new int[nTotal + ADD_AMOUNT];
-          for (size_t i = 0 ; i < nTotal ; i++)
-				data[i] = tmp[i];
-		  nTotal += ADD_AMOUNT;
-		  delete[] tmp;
-	 }
-
-	 void insert(int pos){
-		  if( nCount == 0 ){
-				data[nCount++] = pos;
-				return;
-		  }
-          for (size_t i = 0 ; i < nCount; i++ ) {
-				if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
-					 return;  // Already exist;
-				if( pos < data[i] ){
-					 if( nCount == nTotal )
-						  AddColumnsSize();
-                     for (size_t j = nCount ; j > i ; j--)
-						  data[j] = data[j-1];
-					 data[i] = pos;
-					 nCount++;
-					 return;
-				}
-		  }
-		  // last postion.
-		  if( nCount == nTotal )
-				AddColumnsSize();
-		  data[nCount++] = pos;
-	 }
-
-	 int getIndex(int pos)
-	 {
-		  if( pos == 0 )
-				return 0;
-          for (size_t i = 0 ; i < nCount; i++) {
-				if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
-					 return i;
-		  }
-		  return -1;
-	 }
-};
-
-struct Rows
-{
-	 int *data;
-     size_t nCount;
-     size_t nTotal;
-	 Rows(){
-		  nCount = 0;
-		  nTotal = INIT_SIZE;
-		  data = new int[nTotal];
-	 }
-	 ~Rows(){ delete[] data; }
-
-	 void AddRowsSize(){
-		  int *tmp = data;
-          if (nTotal + ADD_AMOUNT < nTotal) // overflow
-          {
-              throw ::std::bad_alloc();
-          }
-		  data = new int[nTotal + ADD_AMOUNT];
-          for (size_t i = 0 ; i < nTotal ; i++)
-				data[i] = tmp[i];
-		  nTotal += ADD_AMOUNT;
-		  delete[] tmp;
-	 }
-
-	 void insert(int pos){
-		  if( nCount == 0 ){
-				data[nCount++] = pos;
-				return;
-		  }
-          for (size_t i = 0 ; i < nCount; i++) {
-				if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
-					 return;  // Already exist;
-				if( pos < data[i] ){
-					 if( nCount == nTotal )
-						  AddRowsSize();
-                     for (size_t j = nCount ; j > i ; j--)
-						  data[j] = data[j-1];
-					 data[i] = pos;
-					 nCount++;
-					 return;
-				}
-		  }
-		  // last postion.
-		  if( nCount == nTotal )
-				AddRowsSize();
-		  data[nCount++] = pos;
-	 }
-
-	 int getIndex(int pos)
-	 {
-		  if( pos == 0 )
-				return 0;
-          for (size_t i = 0 ; i < nCount; i++) {
-				if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
-					 return i;
-		  }
-		  return -1;
-	 }
-};
-
-struct TCell
-{
-	 int nColumnIndex;
-	 int nRowIndex;
-	 int nColumnSpan;
-	 int nRowSpan;
-	 Cell *pCell;
-};
-
-struct Table
-{
-	 Table(){};
-	 ~Table(){
-		  LinkedListIterator<TCell> it(&cells);
-		  for( ; it.current(); it++)
-				delete it.current();
-	 };
-	 Columns columns;
-	 Rows rows;
-    LinkedList<TCell> cells;
-	 TxtBox *box;
-};
-
-/* picture (11) 그림, OLE그림, 삽입그림, 그리기 */
-enum pictype
-{
-    PICTYPE_FILE, PICTYPE_OLE, PICTYPE_EMBED,
-    PICTYPE_DRAW, PICTYPE_UNKNOWN
-};
-/**
- * @short External image file
- */
-struct PicDefFile
-{
-    char path[256];
-    void *img;
-    bool skipfind;
-};
-
-/**
- * @short Embeded image file
- */
-struct PicDefEmbed
-{
-    char  embname[16];
-};
-
-/**
- * @short Win32 ole object
- */
-struct PicDefOle
-{
-    char  embname[16];
-    void  *hwpole;
-};
-
-/**
- * @short Drawing object of hwp
- */
-struct PicDefDraw
-{
-    void      *hdo;
-    uint      zorder;
-    ZZRect    vrect;
-    int       mbrcnt;
-};
-
-/**
- * @short For using common case
- */
-struct PicDefUnknown
-{
-    char  path[256];
-};
-
-typedef union
-{
-    PicDefFile        picfile;
-    PicDefEmbed       picembed;
-    PicDefOle     picole;
-    PicDefDraw        picdraw;
-    PicDefUnknown     picun;
-} PicDef;
-
-#define PIC_INFO_LEN    348
-/**
- * There are four kinds of image.
- * @li External image
- * @li Embeded image
- * @li Win32 ole object
- * @li Drawing object of hwp
- *
- * @short Image object
- */
-struct Picture: public FBox
-{
-    hchar     reserved[2];
-    hchar     dummy;
-/**
- * follow_block_size is the size information of the Drawing object of hwp.
- * It's value is greater than 0 if the pictype is PICTYPE_DRAW.
- */
-    ulong     follow_block_size;                  /* 추가정보 길이. */
-    short     dummy1;                             // to not change structure size */
-    short     dummy2;                             // to not change structure size */
-    uchar     reserved1;
-/**
- * Position of caption
- */
-    short     cap_pos;                            // caption pos
-/**
- * Index of current Picture object
- */
-    short     num;                                // numbering
-
-/**
- * Type of this object
- * It is one of external/ole/embeded/drawing picture
- */
-    uchar     pictype;
-    hunit     skip[2];
-/**
- * Ratio of magnification or reduction.
- */
-    hunit     scale[2];
-    PicDef    picinfo;
-    char      reserved3[9];
-
-    LinkedList<HWPPara> caption;
-/**
- * It's for the Drawing object
- */
-    unsigned char *follow;                        /* 그림종류가 drawing일때, 추가정보. */
-
-    bool ishyper;
-
-    Picture();
-    virtual ~Picture();
-
-    virtual int   Type    ();
-    virtual int   Read    (HWPFile &hwpf);
-
-    virtual hunit  Height (CharShape *sty);
-};
-
-// line (14)
-/**
- * @short Line
- */
-struct Line: public FBox
-{
-    hchar     reserved[2];
-    hchar     dummy;
-
-    char      reserved2[8];
-
-    short     sx, sy, ex, ey;
-    short     width, shade, color;
-
-    Line();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// hidden(15)
-/**
- * @short Hidden section
- */
-struct Hidden: public HBox
-{
-    hchar     reserved[2];
-    hchar     dummy;
-
-    unsigned char info[8];                        // h, next, dummy
-    LinkedList<HWPPara> plist;
-
-    Hidden();
-    virtual ~Hidden();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-/**
- * @short Header or footer
- */
-struct HeaderFooter: public HBox
-{
-    hchar     reserved[2];
-    hchar     dummy;
-
-    unsigned char info[8];
-/**
- * Header or footer
- */
-    unsigned char type;
-    unsigned char where;
-    unsigned char linenumber;
-
-	 unsigned int m_nPageNumber;
-
-/**
- * Paragraph list of header or footer
- */
-    LinkedList<HWPPara> plist;
-
-    HeaderFooter();
-    virtual ~HeaderFooter();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-/**
- * Both footnote and endnote are comment. Footnote is located at the end of paragraph; endnote is located at the end of page. The Footnote class represents footnote and endnote.
- * @short Footnote or endnote
- */
-struct Footnote: public HBox
-{
-    hchar     reserved[2];
-    hchar     dummy;
-
-    unsigned char  info[8];
-/**
- * The number of current footnote/endnote
- */
-    unsigned short number;
-/**
- * Set the type of Footnote either footnote or endnote.
- */
-    unsigned short type;
-/**
- * The width of the Footnote object.
- */
-    hunit     width;
-/**
- * Paragraph list of Footnote objects
- */
-    LinkedList<HWPPara> plist;
-
-    Footnote();
-    virtual ~Footnote();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// auto number(18)
-/**
- * Kind of auto input number
- */
-enum
-{
-    PGNUM_AUTO,
-    FNNUM_AUTO,
-    ENNUM_AUTO,
-    PICNUM_AUTO,
-    TBLNUM_AUTO,
-    EQUNUM_AUTO
-};
-
-/**
- * @short Input current index of page,comment,table and picture.
- */
-struct AutoNum: public HBox
-{
-    unsigned short type;
-    unsigned short number;
-    hchar      dummy;
-
-    AutoNum();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-/**
- * @short Input new number as current index of page,comment,table and picture.
- */
-struct NewNum: public HBox
-{
-    unsigned short type;
-    unsigned short number;
-    hchar      dummy;
-
-    NewNum();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// page numger(20)
-/**
- * @short Input page index in footer or header
- */
-struct ShowPageNum: public HBox
-{
-/**
- * Location of page number to be inserted.
- */
-    unsigned short where;
-	 unsigned int m_nPageNumber;
-/**
- * Shape of page number to be inserted.
- */
-    unsigned short shape;
-    hchar      dummy;
-
-    ShowPageNum();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-/* 홀수쪽시작 (21) */
-#define HIDE_HD         1                         /* bit 0 */
-#define HIDE_FT         2                         /* bit 1 */
-#define HIDE_PGNUM      4                         /* bit 2 */
-#define HIDE_FRAME      8                         /* bit 3 */
-/**
- * Controls the display of page number, header, footer and border.
- */
-struct PageNumCtrl: public HBox
-{
-/**
- * object type
- */
-    unsigned short kind;
-/**
- * control command.
- */
-    unsigned short what;
-    hchar      dummy;
-
-    PageNumCtrl();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// mail merge(22)
-/**
- * Generates the mailing list automatically using address book and mail body format.
- * @short Generates mailing list
- */
-struct MailMerge: public HBox
-{
-    unsigned char field_name[20];
-    hchar     dummy;
-
-    MailMerge();
-
-    virtual int Read(HWPFile &hwpf);
-    virtual hchar_string GetString();
-};
-
-// char compositon(23)
-/**
- * The compose struct displays characters at position. The maximum character count for composition is three.
- * @short Composition several characters
- */
-struct Compose: public HBox
-{
-    hchar     compose[3];
-    hchar     dummy;
-
-    Compose();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// hyphen(24)
-/**
- * @short Hyphen
- */
-struct Hyphen: public HBox
-{
-/**
- * Width of hyphen
- */
-    hchar     width;
-    hchar     dummy;
-
-    Hyphen();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// toc mark(25)
-/**
- * The TocMark class is for making the content of a table.
- * When you set TocMark on current position, hwp makes it as toc automatically.
- * @short Table of contents
- */
-struct TocMark: public HBox
-{
-    hchar     kind;
-    hchar     dummy;
-
-    TocMark();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// index mark(26)
-/**
- * IndexMark marks the table of search.
- * If you set IndexMark at current position, hwp make it as search index.
- * @short Table of search
- */
-struct IndexMark: public HBox
-{
-    hchar     keyword1[60];
-    hchar     keyword2[60];
-    unsigned short pgno;
-    hchar     dummy;
-
-    IndexMark();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-// outline(28)
-#define MAX_OUTLINE_LEVEL   7
-
-enum
-{
-    OLSTY_USER = 0,
-    OLSTY_NUMS1 = 1,
-    OLSTY_NUMS2 = 2,
-    OLSTY_NUMSIG1 = 3,
-    OLSTY_NUMSIG2 = 4,
-    OLSTY_NUMSIG3 = 5,
-    OLSTY_BULUSER = 128,
-    OLSTY_BULLET1 = 129,
-    OLSTY_BULLET2 = 130,
-    OLSTY_BULLET3 = 131,
-    OLSTY_BULLET4 = 132,
-    OLSTY_BULLET5 = 133
-};
-
-// value is in style->userchar[level];
-enum
-{
-    UDO_NUM,
-    UDO_UROM,
-    UDO_LROM,
-    UDO_UENG,
-    UDO_LENG,
-    UDO_SYLL,
-    UDO_JAMO,
-    UDO_HANJA,
-    UDO_SP_CNUM,
-    UDO_SP_CLENG,
-    UDO_SP_CSYLL,
-    UDO_SP_CJAMO,
-    N_UDO
-};
-/**
- * Number and format of title.
- * @short Number and format of title
- */
-class Outline: public HBox
-{
-    public:
-/**
- * kind of numbering format
- */
-        unsigned short kind;
-        unsigned char  shape;
-/**
- * level of number, Ex) The level of 1.3.2.4 is four
- */
-        unsigned char  level;
-/**
- * value of level
- */
-        unsigned short number[MAX_OUTLINE_LEVEL];
-/**
- * shape of level
- */
-        hchar     user_shape[MAX_OUTLINE_LEVEL];
-/**
- * decoration charactor for the level type
- */
-        hchar     deco[MAX_OUTLINE_LEVEL][2];     /* 사용자 정의시 앞뒤 문자 */
-        hchar     dummy;
-
-        Outline();
-
-        virtual int   Read(HWPFile &hwpf);
-        hchar_string GetUnicode() const;
-};
-
-/* 묶음 빈칸(30) */
-/**
- * The Special space to be treated non-space when a string is
- * cut at the end of line
- * @short Special space
- */
-struct KeepSpace: public HBox
-{
-    hchar dummy;
-
-    KeepSpace();
-
-    virtual int Read(HWPFile &hwpf);
-};
-
-/* 고정폭 빈칸(31) */
-/**
- * @short Space with always same width not relation with fonts.
- */
-struct FixedSpace: public HBox
-{
-    hchar     dummy;
-
-    FixedSpace();
-
-    virtual int Read(HWPFile &hwpf);
-};
-#endif                                            /* _HBOX_H_ */
diff --git a/main/hwpfilter/source/hcode.cpp b/main/hwpfilter/source/hcode.cpp
deleted file mode 100644
index d5807c5..0000000
--- a/main/hwpfilter/source/hcode.cpp
+++ /dev/null
@@ -1,1492 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/**
- * Rule :
- * Hangule johap code => unicode
- * Hanja johap code => ks code => unicode
- * Special johap code => ks code => unicode
- */
-#include "precompile.h"
-#include <sal/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#ifdef WIN32
-#include <float.h>
-#define isnan _isnan
-#endif
-#include "hcode.h"
-#include "ksc5601.h"
-
-#define PI 3.14159265358979323846
-
-static hchar jaso2ks(hchar hh);
-
-// ccvHH2ASC    code convert HWP20 to ASC(KSSM)
-
-#define HCA_HALFCH      0x3000
-#define HCA_KSS         0x3400
-#define HCA_TG          0x37C0
-#define none            0x3401                    /* 2.0 null code - space */
-#define noneha          0x00A0
-#define noneks          0xA1A1
-#define none1x          0x2402
-
-#define UNI_HANGUL_FIRST        0xac00
-#define UNI_COMP_JAMO_FIRST	  0x3131
-
-#define NUM_CHOSEONG            19
-#define NUM_JOONGSEONG          21
-#define NUM_JONGSEONG           28
-
-
-#define IDX_INVALID     0xFF
-
-/**
- * kssm code table matching with ks index
- */
-static hchar ksTbl[2350] =
-{
-    0x8861, 0x8862, 0x8865, 0x8868, 0x8869, 0x886A, 0x886B, 0x8871,
-    0x8873, 0x8874, 0x8875, 0x8876, 0x8877, 0x8878, 0x8879, 0x887B,
-    0x887C, 0x887D, 0x8881, 0x8882, 0x8885, 0x8889, 0x8891, 0x8893,
-    0x8895, 0x8896, 0x8897, 0x88A1, 0x88A2, 0x88A5, 0x88A9, 0x88B5,
-    0x88B7, 0x88C1, 0x88C5, 0x88C9, 0x88E1, 0x88E2, 0x88E5, 0x88E8,
-    0x88E9, 0x88EB, 0x88F1, 0x88F3, 0x88F5, 0x88F6, 0x88F7, 0x88F8,
-    0x88FB, 0x88FC, 0x88FD, 0x8941, 0x8945, 0x8949, 0x8951, 0x8953,
-    0x8955, 0x8956, 0x8957, 0x8961, 0x8962, 0x8963, 0x8965, 0x8968,
-    0x8969, 0x8971, 0x8973, 0x8975, 0x8976, 0x8977, 0x897B, 0x8981,
-    0x8985, 0x8989, 0x8993, 0x8995, 0x89A1, 0x89A2, 0x89A5, 0x89A8,
-    0x89A9, 0x89AB, 0x89AD, 0x89B0, 0x89B1, 0x89B3, 0x89B5, 0x89B7,
-    0x89B8, 0x89C1, 0x89C2, 0x89C5, 0x89C9, 0x89CB, 0x89D1, 0x89D3,
-    0x89D5, 0x89D7, 0x89E1, 0x89E5, 0x89E9, 0x89F3, 0x89F6, 0x89F7,
-    0x8A41, 0x8A42, 0x8A45, 0x8A49, 0x8A51, 0x8A53, 0x8A55, 0x8A57,
-    0x8A61, 0x8A65, 0x8A69, 0x8A73, 0x8A75, 0x8A81, 0x8A82, 0x8A85,
-    0x8A88, 0x8A89, 0x8A8A, 0x8A8B, 0x8A90, 0x8A91, 0x8A93, 0x8A95,
-    0x8A97, 0x8A98, 0x8AA1, 0x8AA2, 0x8AA5, 0x8AA9, 0x8AB6, 0x8AB7,
-    0x8AC1, 0x8AD5, 0x8AE1, 0x8AE2, 0x8AE5, 0x8AE9, 0x8AF1, 0x8AF3,
-    0x8AF5, 0x8B41, 0x8B45, 0x8B49, 0x8B61, 0x8B62, 0x8B65, 0x8B68,
-    0x8B69, 0x8B6A, 0x8B71, 0x8B73, 0x8B75, 0x8B77, 0x8B81, 0x8BA1,
-    0x8BA2, 0x8BA5, 0x8BA8, 0x8BA9, 0x8BAB, 0x8BB1, 0x8BB3, 0x8BB5,
-    0x8BB7, 0x8BB8, 0x8BBC, 0x8C61, 0x8C62, 0x8C63, 0x8C65, 0x8C69,
-    0x8C6B, 0x8C71, 0x8C73, 0x8C75, 0x8C76, 0x8C77, 0x8C7B, 0x8C81,
-    0x8C82, 0x8C85, 0x8C89, 0x8C91, 0x8C93, 0x8C95, 0x8C96, 0x8C97,
-    0x8CA1, 0x8CA2, 0x8CA9, 0x8CE1, 0x8CE2, 0x8CE3, 0x8CE5, 0x8CE9,
-    0x8CF1, 0x8CF3, 0x8CF5, 0x8CF6, 0x8CF7, 0x8D41, 0x8D42, 0x8D45,
-    0x8D51, 0x8D55, 0x8D57, 0x8D61, 0x8D65, 0x8D69, 0x8D75, 0x8D76,
-    0x8D7B, 0x8D81, 0x8DA1, 0x8DA2, 0x8DA5, 0x8DA7, 0x8DA9, 0x8DB1,
-    0x8DB3, 0x8DB5, 0x8DB7, 0x8DB8, 0x8DB9, 0x8DC1, 0x8DC2, 0x8DC9,
-    0x8DD6, 0x8DD7, 0x8DE1, 0x8DE2, 0x8DF7, 0x8E41, 0x8E45, 0x8E49,
-    0x8E51, 0x8E53, 0x8E57, 0x8E61, 0x8E81, 0x8E82, 0x8E85, 0x8E89,
-    0x8E90, 0x8E91, 0x8E93, 0x8E95, 0x8E97, 0x8E98, 0x8EA1, 0x8EA9,
-    0x8EB6, 0x8EB7, 0x8EC1, 0x8EC2, 0x8EC5, 0x8EC9, 0x8ED1, 0x8ED3,
-    0x8ED6, 0x8EE1, 0x8EE5, 0x8EE9, 0x8EF1, 0x8EF3, 0x8F41, 0x8F61,
-    0x8F62, 0x8F65, 0x8F67, 0x8F69, 0x8F6B, 0x8F70, 0x8F71, 0x8F73,
-    0x8F75, 0x8F77, 0x8F7B, 0x8FA1, 0x8FA2, 0x8FA5, 0x8FA9, 0x8FB1,
-    0x8FB3, 0x8FB5, 0x8FB7, 0x9061, 0x9062, 0x9063, 0x9065, 0x9068,
-    0x9069, 0x906A, 0x906B, 0x9071, 0x9073, 0x9075, 0x9076, 0x9077,
-    0x9078, 0x9079, 0x907B, 0x907D, 0x9081, 0x9082, 0x9085, 0x9089,
-    0x9091, 0x9093, 0x9095, 0x9096, 0x9097, 0x90A1, 0x90A2, 0x90A5,
-    0x90A9, 0x90B1, 0x90B7, 0x90E1, 0x90E2, 0x90E4, 0x90E5, 0x90E9,
-    0x90EB, 0x90EC, 0x90F1, 0x90F3, 0x90F5, 0x90F6, 0x90F7, 0x90FD,
-    0x9141, 0x9142, 0x9145, 0x9149, 0x9151, 0x9153, 0x9155, 0x9156,
-    0x9157, 0x9161, 0x9162, 0x9165, 0x9169, 0x9171, 0x9173, 0x9176,
-    0x9177, 0x917A, 0x9181, 0x9185, 0x91A1, 0x91A2, 0x91A5, 0x91A9,
-    0x91AB, 0x91B1, 0x91B3, 0x91B5, 0x91B7, 0x91BC, 0x91BD, 0x91C1,
-    0x91C5, 0x91C9, 0x91D6, 0x9241, 0x9245, 0x9249, 0x9251, 0x9253,
-    0x9255, 0x9261, 0x9262, 0x9265, 0x9269, 0x9273, 0x9275, 0x9277,
-    0x9281, 0x9282, 0x9285, 0x9288, 0x9289, 0x9291, 0x9293, 0x9295,
-    0x9297, 0x92A1, 0x92B6, 0x92C1, 0x92E1, 0x92E5, 0x92E9, 0x92F1,
-    0x92F3, 0x9341, 0x9342, 0x9349, 0x9351, 0x9353, 0x9357, 0x9361,
-    0x9362, 0x9365, 0x9369, 0x936A, 0x936B, 0x9371, 0x9373, 0x9375,
-    0x9377, 0x9378, 0x937C, 0x9381, 0x9385, 0x9389, 0x93A1, 0x93A2,
-    0x93A5, 0x93A9, 0x93AF, 0x93B1, 0x93B3, 0x93B5, 0x93B7, 0x93BC,
-    0x9461, 0x9462, 0x9463, 0x9465, 0x9468, 0x9469, 0x946A, 0x946B,
-    0x946C, 0x9470, 0x9471, 0x9473, 0x9475, 0x9476, 0x9477, 0x9478,
-    0x9479, 0x947D, 0x9481, 0x9482, 0x9485, 0x9489, 0x9491, 0x9493,
-    0x9495, 0x9496, 0x9497, 0x94A1, 0x94E1, 0x94E2, 0x94E3, 0x94E5,
-    0x94E8, 0x94E9, 0x94EB, 0x94EC, 0x94F1, 0x94F3, 0x94F5, 0x94F7,
-    0x94F9, 0x94FC, 0x9541, 0x9542, 0x9545, 0x9549, 0x9551, 0x9553,
-    0x9555, 0x9556, 0x9557, 0x9561, 0x9565, 0x9569, 0x9576, 0x9577,
-    0x9581, 0x9585, 0x95A1, 0x95A2, 0x95A5, 0x95A8, 0x95A9, 0x95AB,
-    0x95AD, 0x95B1, 0x95B3, 0x95B5, 0x95B7, 0x95B9, 0x95BB, 0x95C1,
-    0x95C5, 0x95C9, 0x95E1, 0x95F6, 0x9641, 0x9645, 0x9649, 0x9651,
-    0x9653, 0x9655, 0x9661, 0x9681, 0x9682, 0x9685, 0x9689, 0x9691,
-    0x9693, 0x9695, 0x9697, 0x96A1, 0x96B6, 0x96C1, 0x96D7, 0x96E1,
-    0x96E5, 0x96E9, 0x96F3, 0x96F5, 0x96F7, 0x9741, 0x9745, 0x9749,
-    0x9751, 0x9757, 0x9761, 0x9762, 0x9765, 0x9768, 0x9769, 0x976B,
-    0x9771, 0x9773, 0x9775, 0x9777, 0x9781, 0x97A1, 0x97A2, 0x97A5,
-    0x97A8, 0x97A9, 0x97B1, 0x97B3, 0x97B5, 0x97B6, 0x97B7, 0x97B8,
-    0x9861, 0x9862, 0x9865, 0x9869, 0x9871, 0x9873, 0x9875, 0x9876,
-    0x9877, 0x987D, 0x9881, 0x9882, 0x9885, 0x9889, 0x9891, 0x9893,
-    0x9895, 0x9896, 0x9897, 0x98E1, 0x98E2, 0x98E5, 0x98E9, 0x98EB,
-    0x98EC, 0x98F1, 0x98F3, 0x98F5, 0x98F6, 0x98F7, 0x98FD, 0x9941,
-    0x9942, 0x9945, 0x9949, 0x9951, 0x9953, 0x9955, 0x9956, 0x9957,
-    0x9961, 0x9976, 0x99A1, 0x99A2, 0x99A5, 0x99A9, 0x99B7, 0x99C1,
-    0x99C9, 0x99E1, 0x9A41, 0x9A45, 0x9A81, 0x9A82, 0x9A85, 0x9A89,
-    0x9A90, 0x9A91, 0x9A97, 0x9AC1, 0x9AE1, 0x9AE5, 0x9AE9, 0x9AF1,
-    0x9AF3, 0x9AF7, 0x9B61, 0x9B62, 0x9B65, 0x9B68, 0x9B69, 0x9B71,
-    0x9B73, 0x9B75, 0x9B81, 0x9B85, 0x9B89, 0x9B91, 0x9B93, 0x9BA1,
-    0x9BA5, 0x9BA9, 0x9BB1, 0x9BB3, 0x9BB5, 0x9BB7, 0x9C61, 0x9C62,
-    0x9C65, 0x9C69, 0x9C71, 0x9C73, 0x9C75, 0x9C76, 0x9C77, 0x9C78,
-    0x9C7C, 0x9C7D, 0x9C81, 0x9C82, 0x9C85, 0x9C89, 0x9C91, 0x9C93,
-    0x9C95, 0x9C96, 0x9C97, 0x9CA1, 0x9CA2, 0x9CA5, 0x9CB5, 0x9CB7,
-    0x9CE1, 0x9CE2, 0x9CE5, 0x9CE9, 0x9CF1, 0x9CF3, 0x9CF5, 0x9CF6,
-    0x9CF7, 0x9CFD, 0x9D41, 0x9D42, 0x9D45, 0x9D49, 0x9D51, 0x9D53,
-    0x9D55, 0x9D57, 0x9D61, 0x9D62, 0x9D65, 0x9D69, 0x9D71, 0x9D73,
-    0x9D75, 0x9D76, 0x9D77, 0x9D81, 0x9D85, 0x9D93, 0x9D95, 0x9DA1,
-    0x9DA2, 0x9DA5, 0x9DA9, 0x9DB1, 0x9DB3, 0x9DB5, 0x9DB7, 0x9DC1,
-    0x9DC5, 0x9DD7, 0x9DF6, 0x9E41, 0x9E45, 0x9E49, 0x9E51, 0x9E53,
-    0x9E55, 0x9E57, 0x9E61, 0x9E65, 0x9E69, 0x9E73, 0x9E75, 0x9E77,
-    0x9E81, 0x9E82, 0x9E85, 0x9E89, 0x9E91, 0x9E93, 0x9E95, 0x9E97,
-    0x9EA1, 0x9EB6, 0x9EC1, 0x9EE1, 0x9EE2, 0x9EE5, 0x9EE9, 0x9EF1,
-    0x9EF5, 0x9EF7, 0x9F41, 0x9F42, 0x9F45, 0x9F49, 0x9F51, 0x9F53,
-    0x9F55, 0x9F57, 0x9F61, 0x9F62, 0x9F65, 0x9F69, 0x9F71, 0x9F73,
-    0x9F75, 0x9F77, 0x9F78, 0x9F7B, 0x9F7C, 0x9FA1, 0x9FA2, 0x9FA5,
-    0x9FA9, 0x9FB1, 0x9FB3, 0x9FB5, 0x9FB7, 0xA061, 0xA062, 0xA065,
-    0xA067, 0xA068, 0xA069, 0xA06A, 0xA06B, 0xA071, 0xA073, 0xA075,
-    0xA077, 0xA078, 0xA07B, 0xA07D, 0xA081, 0xA082, 0xA085, 0xA089,
-    0xA091, 0xA093, 0xA095, 0xA096, 0xA097, 0xA098, 0xA0A1, 0xA0A2,
-    0xA0A9, 0xA0B7, 0xA0E1, 0xA0E2, 0xA0E5, 0xA0E9, 0xA0EB, 0xA0F1,
-    0xA0F3, 0xA0F5, 0xA0F7, 0xA0F8, 0xA0FD, 0xA141, 0xA142, 0xA145,
-    0xA149, 0xA151, 0xA153, 0xA155, 0xA156, 0xA157, 0xA161, 0xA162,
-    0xA165, 0xA169, 0xA175, 0xA176, 0xA177, 0xA179, 0xA181, 0xA1A1,
-    0xA1A2, 0xA1A4, 0xA1A5, 0xA1A9, 0xA1AB, 0xA1B1, 0xA1B3, 0xA1B5,
-    0xA1B7, 0xA1C1, 0xA1C5, 0xA1D6, 0xA1D7, 0xA241, 0xA245, 0xA249,
-    0xA253, 0xA255, 0xA257, 0xA261, 0xA265, 0xA269, 0xA273, 0xA275,
-    0xA281, 0xA282, 0xA283, 0xA285, 0xA288, 0xA289, 0xA28A, 0xA28B,
-    0xA291, 0xA293, 0xA295, 0xA297, 0xA29B, 0xA29D, 0xA2A1, 0xA2A5,
-    0xA2A9, 0xA2B3, 0xA2B5, 0xA2C1, 0xA2E1, 0xA2E5, 0xA2E9, 0xA341,
-    0xA345, 0xA349, 0xA351, 0xA355, 0xA361, 0xA365, 0xA369, 0xA371,
-    0xA375, 0xA3A1, 0xA3A2, 0xA3A5, 0xA3A8, 0xA3A9, 0xA3AB, 0xA3B1,
-    0xA3B3, 0xA3B5, 0xA3B6, 0xA3B7, 0xA3B9, 0xA3BB, 0xA461, 0xA462,
-    0xA463, 0xA464, 0xA465, 0xA468, 0xA469, 0xA46A, 0xA46B, 0xA46C,
-    0xA471, 0xA473, 0xA475, 0xA477, 0xA47B, 0xA481, 0xA482, 0xA485,
-    0xA489, 0xA491, 0xA493, 0xA495, 0xA496, 0xA497, 0xA49B, 0xA4A1,
-    0xA4A2, 0xA4A5, 0xA4B3, 0xA4E1, 0xA4E2, 0xA4E5, 0xA4E8, 0xA4E9,
-    0xA4EB, 0xA4F1, 0xA4F3, 0xA4F5, 0xA4F7, 0xA4F8, 0xA541, 0xA542,
-    0xA545, 0xA548, 0xA549, 0xA551, 0xA553, 0xA555, 0xA556, 0xA557,
-    0xA561, 0xA562, 0xA565, 0xA569, 0xA573, 0xA575, 0xA576, 0xA577,
-    0xA57B, 0xA581, 0xA585, 0xA5A1, 0xA5A2, 0xA5A3, 0xA5A5, 0xA5A9,
-    0xA5B1, 0xA5B3, 0xA5B5, 0xA5B7, 0xA5C1, 0xA5C5, 0xA5D6, 0xA5E1,
-    0xA5F6, 0xA641, 0xA642, 0xA645, 0xA649, 0xA651, 0xA653, 0xA661,
-    0xA665, 0xA681, 0xA682, 0xA685, 0xA688, 0xA689, 0xA68A, 0xA68B,
-    0xA691, 0xA693, 0xA695, 0xA697, 0xA69B, 0xA69C, 0xA6A1, 0xA6A9,
-    0xA6B6, 0xA6C1, 0xA6E1, 0xA6E2, 0xA6E5, 0xA6E9, 0xA6F7, 0xA741,
-    0xA745, 0xA749, 0xA751, 0xA755, 0xA757, 0xA761, 0xA762, 0xA765,
-    0xA769, 0xA771, 0xA773, 0xA775, 0xA7A1, 0xA7A2, 0xA7A5, 0xA7A9,
-    0xA7AB, 0xA7B1, 0xA7B3, 0xA7B5, 0xA7B7, 0xA7B8, 0xA7B9, 0xA861,
-    0xA862, 0xA865, 0xA869, 0xA86B, 0xA871, 0xA873, 0xA875, 0xA876,
-    0xA877, 0xA87D, 0xA881, 0xA882, 0xA885, 0xA889, 0xA891, 0xA893,
-    0xA895, 0xA896, 0xA897, 0xA8A1, 0xA8A2, 0xA8B1, 0xA8E1, 0xA8E2,
-    0xA8E5, 0xA8E8, 0xA8E9, 0xA8F1, 0xA8F5, 0xA8F6, 0xA8F7, 0xA941,
-    0xA957, 0xA961, 0xA962, 0xA971, 0xA973, 0xA975, 0xA976, 0xA977,
-    0xA9A1, 0xA9A2, 0xA9A5, 0xA9A9, 0xA9B1, 0xA9B3, 0xA9B7, 0xAA41,
-    0xAA61, 0xAA77, 0xAA81, 0xAA82, 0xAA85, 0xAA89, 0xAA91, 0xAA95,
-    0xAA97, 0xAB41, 0xAB57, 0xAB61, 0xAB65, 0xAB69, 0xAB71, 0xAB73,
-    0xABA1, 0xABA2, 0xABA5, 0xABA9, 0xABB1, 0xABB3, 0xABB5, 0xABB7,
-    0xAC61, 0xAC62, 0xAC64, 0xAC65, 0xAC68, 0xAC69, 0xAC6A, 0xAC6B,
-    0xAC71, 0xAC73, 0xAC75, 0xAC76, 0xAC77, 0xAC7B, 0xAC81, 0xAC82,
-    0xAC85, 0xAC89, 0xAC91, 0xAC93, 0xAC95, 0xAC96, 0xAC97, 0xACA1,
-    0xACA2, 0xACA5, 0xACA9, 0xACB1, 0xACB3, 0xACB5, 0xACB7, 0xACC1,
-    0xACC5, 0xACC9, 0xACD1, 0xACD7, 0xACE1, 0xACE2, 0xACE3, 0xACE4,
-    0xACE5, 0xACE8, 0xACE9, 0xACEB, 0xACEC, 0xACF1, 0xACF3, 0xACF5,
-    0xACF6, 0xACF7, 0xACFC, 0xAD41, 0xAD42, 0xAD45, 0xAD49, 0xAD51,
-    0xAD53, 0xAD55, 0xAD56, 0xAD57, 0xAD61, 0xAD62, 0xAD65, 0xAD69,
-    0xAD71, 0xAD73, 0xAD75, 0xAD76, 0xAD77, 0xAD81, 0xAD85, 0xAD89,
-    0xAD97, 0xADA1, 0xADA2, 0xADA3, 0xADA5, 0xADA9, 0xADAB, 0xADB1,
-    0xADB3, 0xADB5, 0xADB7, 0xADBB, 0xADC1, 0xADC2, 0xADC5, 0xADC9,
-    0xADD7, 0xADE1, 0xADE5, 0xADE9, 0xADF1, 0xADF5, 0xADF6, 0xAE41,
-    0xAE45, 0xAE49, 0xAE51, 0xAE53, 0xAE55, 0xAE61, 0xAE62, 0xAE65,
-    0xAE69, 0xAE71, 0xAE73, 0xAE75, 0xAE77, 0xAE81, 0xAE82, 0xAE85,
-    0xAE88, 0xAE89, 0xAE91, 0xAE93, 0xAE95, 0xAE97, 0xAE99, 0xAE9B,
-    0xAE9C, 0xAEA1, 0xAEB6, 0xAEC1, 0xAEC2, 0xAEC5, 0xAEC9, 0xAED1,
-    0xAED7, 0xAEE1, 0xAEE2, 0xAEE5, 0xAEE9, 0xAEF1, 0xAEF3, 0xAEF5,
-    0xAEF7, 0xAF41, 0xAF42, 0xAF49, 0xAF51, 0xAF55, 0xAF57, 0xAF61,
-    0xAF62, 0xAF65, 0xAF69, 0xAF6A, 0xAF71, 0xAF73, 0xAF75, 0xAF77,
-    0xAFA1, 0xAFA2, 0xAFA5, 0xAFA8, 0xAFA9, 0xAFB0, 0xAFB1, 0xAFB3,
-    0xAFB5, 0xAFB7, 0xAFBC, 0xB061, 0xB062, 0xB064, 0xB065, 0xB069,
-    0xB071, 0xB073, 0xB076, 0xB077, 0xB07D, 0xB081, 0xB082, 0xB085,
-    0xB089, 0xB091, 0xB093, 0xB096, 0xB097, 0xB0B7, 0xB0E1, 0xB0E2,
-    0xB0E5, 0xB0E9, 0xB0EB, 0xB0F1, 0xB0F3, 0xB0F6, 0xB0F7, 0xB141,
-    0xB145, 0xB149, 0xB185, 0xB1A1, 0xB1A2, 0xB1A5, 0xB1A8, 0xB1A9,
-    0xB1AB, 0xB1B1, 0xB1B3, 0xB1B7, 0xB1C1, 0xB1C2, 0xB1C5, 0xB1D6,
-    0xB1E1, 0xB1F6, 0xB241, 0xB245, 0xB249, 0xB251, 0xB253, 0xB261,
-    0xB281, 0xB282, 0xB285, 0xB289, 0xB291, 0xB293, 0xB297, 0xB2A1,
-    0xB2B6, 0xB2C1, 0xB2E1, 0xB2E5, 0xB357, 0xB361, 0xB362, 0xB365,
-    0xB369, 0xB36B, 0xB370, 0xB371, 0xB373, 0xB381, 0xB385, 0xB389,
-    0xB391, 0xB3A1, 0xB3A2, 0xB3A5, 0xB3A9, 0xB3B1, 0xB3B3, 0xB3B5,
-    0xB3B7, 0xB461, 0xB462, 0xB465, 0xB466, 0xB467, 0xB469, 0xB46A,
-    0xB46B, 0xB470, 0xB471, 0xB473, 0xB475, 0xB476, 0xB477, 0xB47B,
-    0xB47C, 0xB481, 0xB482, 0xB485, 0xB489, 0xB491, 0xB493, 0xB495,
-    0xB496, 0xB497, 0xB4A1, 0xB4A2, 0xB4A5, 0xB4A9, 0xB4AC, 0xB4B1,
-    0xB4B3, 0xB4B5, 0xB4B7, 0xB4BB, 0xB4BD, 0xB4C1, 0xB4C5, 0xB4C9,
-    0xB4D3, 0xB4E1, 0xB4E2, 0xB4E5, 0xB4E6, 0xB4E8, 0xB4E9, 0xB4EA,
-    0xB4EB, 0xB4F1, 0xB4F3, 0xB4F4, 0xB4F5, 0xB4F6, 0xB4F7, 0xB4F8,
-    0xB4FA, 0xB4FC, 0xB541, 0xB542, 0xB545, 0xB549, 0xB551, 0xB553,
-    0xB555, 0xB557, 0xB561, 0xB562, 0xB563, 0xB565, 0xB569, 0xB56B,
-    0xB56C, 0xB571, 0xB573, 0xB574, 0xB575, 0xB576, 0xB577, 0xB57B,
-    0xB57C, 0xB57D, 0xB581, 0xB585, 0xB589, 0xB591, 0xB593, 0xB595,
-    0xB596, 0xB5A1, 0xB5A2, 0xB5A5, 0xB5A9, 0xB5AA, 0xB5AB, 0xB5AD,
-    0xB5B0, 0xB5B1, 0xB5B3, 0xB5B5, 0xB5B7, 0xB5B9, 0xB5C1, 0xB5C2,
-    0xB5C5, 0xB5C9, 0xB5D1, 0xB5D3, 0xB5D5, 0xB5D6, 0xB5D7, 0xB5E1,
-    0xB5E2, 0xB5E5, 0xB5F1, 0xB5F5, 0xB5F7, 0xB641, 0xB642, 0xB645,
-    0xB649, 0xB651, 0xB653, 0xB655, 0xB657, 0xB661, 0xB662, 0xB665,
-    0xB669, 0xB671, 0xB673, 0xB675, 0xB677, 0xB681, 0xB682, 0xB685,
-    0xB689, 0xB68A, 0xB68B, 0xB691, 0xB693, 0xB695, 0xB697, 0xB6A1,
-    0xB6A2, 0xB6A5, 0xB6A9, 0xB6B1, 0xB6B3, 0xB6B6, 0xB6B7, 0xB6C1,
-    0xB6C2, 0xB6C5, 0xB6C9, 0xB6D1, 0xB6D3, 0xB6D7, 0xB6E1, 0xB6E2,
-    0xB6E5, 0xB6E9, 0xB6F1, 0xB6F3, 0xB6F5, 0xB6F7, 0xB741, 0xB742,
-    0xB745, 0xB749, 0xB751, 0xB753, 0xB755, 0xB757, 0xB759, 0xB761,
-    0xB762, 0xB765, 0xB769, 0xB76F, 0xB771, 0xB773, 0xB775, 0xB777,
-    0xB778, 0xB779, 0xB77A, 0xB77B, 0xB77C, 0xB77D, 0xB781, 0xB785,
-    0xB789, 0xB791, 0xB795, 0xB7A1, 0xB7A2, 0xB7A5, 0xB7A9, 0xB7AA,
-    0xB7AB, 0xB7B0, 0xB7B1, 0xB7B3, 0xB7B5, 0xB7B6, 0xB7B7, 0xB7B8,
-    0xB7BC, 0xB861, 0xB862, 0xB865, 0xB867, 0xB868, 0xB869, 0xB86B,
-    0xB871, 0xB873, 0xB875, 0xB876, 0xB877, 0xB878, 0xB881, 0xB882,
-    0xB885, 0xB889, 0xB891, 0xB893, 0xB895, 0xB896, 0xB897, 0xB8A1,
-    0xB8A2, 0xB8A5, 0xB8A7, 0xB8A9, 0xB8B1, 0xB8B7, 0xB8C1, 0xB8C5,
-    0xB8C9, 0xB8E1, 0xB8E2, 0xB8E5, 0xB8E9, 0xB8EB, 0xB8F1, 0xB8F3,
-    0xB8F5, 0xB8F7, 0xB8F8, 0xB941, 0xB942, 0xB945, 0xB949, 0xB951,
-    0xB953, 0xB955, 0xB957, 0xB961, 0xB965, 0xB969, 0xB971, 0xB973,
-    0xB976, 0xB977, 0xB981, 0xB9A1, 0xB9A2, 0xB9A5, 0xB9A9, 0xB9AB,
-    0xB9B1, 0xB9B3, 0xB9B5, 0xB9B7, 0xB9B8, 0xB9B9, 0xB9BD, 0xB9C1,
-    0xB9C2, 0xB9C9, 0xB9D3, 0xB9D5, 0xB9D7, 0xB9E1, 0xB9F6, 0xB9F7,
-    0xBA41, 0xBA45, 0xBA49, 0xBA51, 0xBA53, 0xBA55, 0xBA57, 0xBA61,
-    0xBA62, 0xBA65, 0xBA77, 0xBA81, 0xBA82, 0xBA85, 0xBA89, 0xBA8A,
-    0xBA8B, 0xBA91, 0xBA93, 0xBA95, 0xBA97, 0xBAA1, 0xBAB6, 0xBAC1,
-    0xBAE1, 0xBAE2, 0xBAE5, 0xBAE9, 0xBAF1, 0xBAF3, 0xBAF5, 0xBB41,
-    0xBB45, 0xBB49, 0xBB51, 0xBB61, 0xBB62, 0xBB65, 0xBB69, 0xBB71,
-    0xBB73, 0xBB75, 0xBB77, 0xBBA1, 0xBBA2, 0xBBA5, 0xBBA8, 0xBBA9,
-    0xBBAB, 0xBBB1, 0xBBB3, 0xBBB5, 0xBBB7, 0xBBB8, 0xBBBB, 0xBBBC,
-    0xBC61, 0xBC62, 0xBC65, 0xBC67, 0xBC69, 0xBC6C, 0xBC71, 0xBC73,
-    0xBC75, 0xBC76, 0xBC77, 0xBC81, 0xBC82, 0xBC85, 0xBC89, 0xBC91,
-    0xBC93, 0xBC95, 0xBC96, 0xBC97, 0xBCA1, 0xBCA5, 0xBCB7, 0xBCE1,
-    0xBCE2, 0xBCE5, 0xBCE9, 0xBCF1, 0xBCF3, 0xBCF5, 0xBCF6, 0xBCF7,
-    0xBD41, 0xBD57, 0xBD61, 0xBD76, 0xBDA1, 0xBDA2, 0xBDA5, 0xBDA9,
-    0xBDB1, 0xBDB3, 0xBDB5, 0xBDB7, 0xBDB9, 0xBDC1, 0xBDC2, 0xBDC9,
-    0xBDD6, 0xBDE1, 0xBDF6, 0xBE41, 0xBE45, 0xBE49, 0xBE51, 0xBE53,
-    0xBE77, 0xBE81, 0xBE82, 0xBE85, 0xBE89, 0xBE91, 0xBE93, 0xBE97,
-    0xBEA1, 0xBEB6, 0xBEB7, 0xBEE1, 0xBF41, 0xBF61, 0xBF71, 0xBF75,
-    0xBF77, 0xBFA1, 0xBFA2, 0xBFA5, 0xBFA9, 0xBFB1, 0xBFB3, 0xBFB7,
-    0xBFB8, 0xBFBD, 0xC061, 0xC062, 0xC065, 0xC067, 0xC069, 0xC071,
-    0xC073, 0xC075, 0xC076, 0xC077, 0xC078, 0xC081, 0xC082, 0xC085,
-    0xC089, 0xC091, 0xC093, 0xC095, 0xC096, 0xC097, 0xC0A1, 0xC0A5,
-    0xC0A7, 0xC0A9, 0xC0B1, 0xC0B7, 0xC0E1, 0xC0E2, 0xC0E5, 0xC0E9,
-    0xC0F1, 0xC0F3, 0xC0F5, 0xC0F6, 0xC0F7, 0xC141, 0xC142, 0xC145,
-    0xC149, 0xC151, 0xC153, 0xC155, 0xC157, 0xC161, 0xC165, 0xC176,
-    0xC181, 0xC185, 0xC197, 0xC1A1, 0xC1A2, 0xC1A5, 0xC1A9, 0xC1B1,
-    0xC1B3, 0xC1B5, 0xC1B7, 0xC1C1, 0xC1C5, 0xC1C9, 0xC1D7, 0xC241,
-    0xC245, 0xC249, 0xC251, 0xC253, 0xC255, 0xC257, 0xC261, 0xC271,
-    0xC281, 0xC282, 0xC285, 0xC289, 0xC291, 0xC293, 0xC295, 0xC297,
-    0xC2A1, 0xC2B6, 0xC2C1, 0xC2C5, 0xC2E1, 0xC2E5, 0xC2E9, 0xC2F1,
-    0xC2F3, 0xC2F5, 0xC2F7, 0xC341, 0xC345, 0xC349, 0xC351, 0xC357,
-    0xC361, 0xC362, 0xC365, 0xC369, 0xC371, 0xC373, 0xC375, 0xC377,
-    0xC3A1, 0xC3A2, 0xC3A5, 0xC3A8, 0xC3A9, 0xC3AA, 0xC3B1, 0xC3B3,
-    0xC3B5, 0xC3B7, 0xC461, 0xC462, 0xC465, 0xC469, 0xC471, 0xC473,
-    0xC475, 0xC477, 0xC481, 0xC482, 0xC485, 0xC489, 0xC491, 0xC493,
-    0xC495, 0xC496, 0xC497, 0xC4A1, 0xC4A2, 0xC4B7, 0xC4E1, 0xC4E2,
-    0xC4E5, 0xC4E8, 0xC4E9, 0xC4F1, 0xC4F3, 0xC4F5, 0xC4F6, 0xC4F7,
-    0xC541, 0xC542, 0xC545, 0xC549, 0xC551, 0xC553, 0xC555, 0xC557,
-    0xC561, 0xC565, 0xC569, 0xC571, 0xC573, 0xC575, 0xC576, 0xC577,
-    0xC581, 0xC5A1, 0xC5A2, 0xC5A5, 0xC5A9, 0xC5B1, 0xC5B3, 0xC5B5,
-    0xC5B7, 0xC5C1, 0xC5C2, 0xC5C5, 0xC5C9, 0xC5D1, 0xC5D7, 0xC5E1,
-    0xC5F7, 0xC641, 0xC649, 0xC661, 0xC681, 0xC682, 0xC685, 0xC689,
-    0xC691, 0xC693, 0xC695, 0xC697, 0xC6A1, 0xC6A5, 0xC6A9, 0xC6B7,
-    0xC6C1, 0xC6D7, 0xC6E1, 0xC6E2, 0xC6E5, 0xC6E9, 0xC6F1, 0xC6F3,
-    0xC6F5, 0xC6F7, 0xC741, 0xC745, 0xC749, 0xC751, 0xC761, 0xC762,
-    0xC765, 0xC769, 0xC771, 0xC773, 0xC777, 0xC7A1, 0xC7A2, 0xC7A5,
-    0xC7A9, 0xC7B1, 0xC7B3, 0xC7B5, 0xC7B7, 0xC861, 0xC862, 0xC865,
-    0xC869, 0xC86A, 0xC871, 0xC873, 0xC875, 0xC876, 0xC877, 0xC881,
-    0xC882, 0xC885, 0xC889, 0xC891, 0xC893, 0xC895, 0xC896, 0xC897,
-    0xC8A1, 0xC8B7, 0xC8E1, 0xC8E2, 0xC8E5, 0xC8E9, 0xC8EB, 0xC8F1,
-    0xC8F3, 0xC8F5, 0xC8F6, 0xC8F7, 0xC941, 0xC942, 0xC945, 0xC949,
-    0xC951, 0xC953, 0xC955, 0xC957, 0xC961, 0xC965, 0xC976, 0xC981,
-    0xC985, 0xC9A1, 0xC9A2, 0xC9A5, 0xC9A9, 0xC9B1, 0xC9B3, 0xC9B5,
-    0xC9B7, 0xC9BC, 0xC9C1, 0xC9C5, 0xC9E1, 0xCA41, 0xCA45, 0xCA55,
-    0xCA57, 0xCA61, 0xCA81, 0xCA82, 0xCA85, 0xCA89, 0xCA91, 0xCA93,
-    0xCA95, 0xCA97, 0xCAA1, 0xCAB6, 0xCAC1, 0xCAE1, 0xCAE2, 0xCAE5,
-    0xCAE9, 0xCAF1, 0xCAF3, 0xCAF7, 0xCB41, 0xCB45, 0xCB49, 0xCB51,
-    0xCB57, 0xCB61, 0xCB62, 0xCB65, 0xCB68, 0xCB69, 0xCB6B, 0xCB71,
-    0xCB73, 0xCB75, 0xCB81, 0xCB85, 0xCB89, 0xCB91, 0xCB93, 0xCBA1,
-    0xCBA2, 0xCBA5, 0xCBA9, 0xCBB1, 0xCBB3, 0xCBB5, 0xCBB7, 0xCC61,
-    0xCC62, 0xCC63, 0xCC65, 0xCC69, 0xCC6B, 0xCC71, 0xCC73, 0xCC75,
-    0xCC76, 0xCC77, 0xCC7B, 0xCC81, 0xCC82, 0xCC85, 0xCC89, 0xCC91,
-    0xCC93, 0xCC95, 0xCC96, 0xCC97, 0xCCA1, 0xCCA2, 0xCCE1, 0xCCE2,
-    0xCCE5, 0xCCE9, 0xCCF1, 0xCCF3, 0xCCF5, 0xCCF6, 0xCCF7, 0xCD41,
-    0xCD42, 0xCD45, 0xCD49, 0xCD51, 0xCD53, 0xCD55, 0xCD57, 0xCD61,
-    0xCD65, 0xCD69, 0xCD71, 0xCD73, 0xCD76, 0xCD77, 0xCD81, 0xCD89,
-    0xCD93, 0xCD95, 0xCDA1, 0xCDA2, 0xCDA5, 0xCDA9, 0xCDB1, 0xCDB3,
-    0xCDB5, 0xCDB7, 0xCDC1, 0xCDD7, 0xCE41, 0xCE45, 0xCE61, 0xCE65,
-    0xCE69, 0xCE73, 0xCE75, 0xCE81, 0xCE82, 0xCE85, 0xCE88, 0xCE89,
-    0xCE8B, 0xCE91, 0xCE93, 0xCE95, 0xCE97, 0xCEA1, 0xCEB7, 0xCEE1,
-    0xCEE5, 0xCEE9, 0xCEF1, 0xCEF5, 0xCF41, 0xCF45, 0xCF49, 0xCF51,
-    0xCF55, 0xCF57, 0xCF61, 0xCF65, 0xCF69, 0xCF71, 0xCF73, 0xCF75,
-    0xCFA1, 0xCFA2, 0xCFA5, 0xCFA9, 0xCFB1, 0xCFB3, 0xCFB5, 0xCFB7,
-    0xD061, 0xD062, 0xD065, 0xD069, 0xD06E, 0xD071, 0xD073, 0xD075,
-    0xD077, 0xD081, 0xD082, 0xD085, 0xD089, 0xD091, 0xD093, 0xD095,
-    0xD096, 0xD097, 0xD0A1, 0xD0B7, 0xD0E1, 0xD0E2, 0xD0E5, 0xD0E9,
-    0xD0EB, 0xD0F1, 0xD0F3, 0xD0F5, 0xD0F7, 0xD141, 0xD142, 0xD145,
-    0xD149, 0xD151, 0xD153, 0xD155, 0xD157, 0xD161, 0xD162, 0xD165,
-    0xD169, 0xD171, 0xD173, 0xD175, 0xD176, 0xD177, 0xD181, 0xD185,
-    0xD189, 0xD193, 0xD1A1, 0xD1A2, 0xD1A5, 0xD1A9, 0xD1AE, 0xD1B1,
-    0xD1B3, 0xD1B5, 0xD1B7, 0xD1BB, 0xD1C1, 0xD1C2, 0xD1C5, 0xD1C9,
-    0xD1D5, 0xD1D7, 0xD1E1, 0xD1E2, 0xD1E5, 0xD1F5, 0xD1F7, 0xD241,
-    0xD242, 0xD245, 0xD249, 0xD253, 0xD255, 0xD257, 0xD261, 0xD265,
-    0xD269, 0xD273, 0xD275, 0xD281, 0xD282, 0xD285, 0xD289, 0xD28E,
-    0xD291, 0xD295, 0xD297, 0xD2A1, 0xD2A5, 0xD2A9, 0xD2B1, 0xD2B7,
-    0xD2C1, 0xD2C2, 0xD2C5, 0xD2C9, 0xD2D7, 0xD2E1, 0xD2E2, 0xD2E5,
-    0xD2E9, 0xD2F1, 0xD2F3, 0xD2F5, 0xD2F7, 0xD341, 0xD342, 0xD345,
-    0xD349, 0xD351, 0xD355, 0xD357, 0xD361, 0xD362, 0xD365, 0xD367,
-    0xD368, 0xD369, 0xD36A, 0xD371, 0xD373, 0xD375, 0xD377, 0xD37B,
-    0xD381, 0xD385, 0xD389, 0xD391, 0xD393, 0xD397, 0xD3A1, 0xD3A2,
-    0xD3A5, 0xD3A9, 0xD3B1, 0xD3B3, 0xD3B5, 0xD3B7
-};
-
-/**
- * ks symbols
- */
-static unsigned tblhhtg_ks[] =
-{
-    0xC7D1, 0xB1DB, 0xB0FA, 0xC4C4, 0xC7BB, 0xC5CD, noneks, noneks,
-    0xA2B1, 0xA3DF, 0xA2D5, 0xA6B1, 0xA1B8, 0xA1B9, 0xA3DF, 0xA1DA,
-    0xA2C6, 0xA2CC, 0xA2CB, noneks, noneks, 0xA6BE, 0xA6B9, 0xA6C1,
-    0xA6C2, 0xA6B4, 0xA6AD, 0xA6AF, 0xA6B0, 0xA6C3, 0xA6C4, noneks,
-    0xA6AE, 0xA6B0, 0xA2D7, 0xA1E1, 0xA1D6, noneks, 0xA6BC, 0xA6B7,
-    0xA6B1, 0xA6AE, 0xA6B5, 0xA6B3, 0xA6B2, 0xA6AC, 0xA6B6, 0xA6BA,
-    0xA6BF, 0xA6B8, 0xA6BD, 0xA6C5, 0xA6C6, 0xA6C8, 0xA6C7, 0xA6C0,
-    0xA6BB, noneks, noneks, noneks, 0xA1E1, 0xA1E1, 0xA1E1, 0xA1E1
-};
-
-/**
- * kssm symbols
- */
-static unsigned hhtg_tg[] =
-{
-    0xD065, 0x8B69, 0x89C1, 0xC4F1, 0xCF41, 0xC8E1, 0xD3C5, 0xD931,
-    0xD931, 0xD481, 0xD482, 0xD488, 0xD48A, 0xD48F, 0xD493, 0xD494,
-    0xD4B0, 0xD4B1, 0xD4B2, 0xD931, 0xD931, 0xD4B5, 0xD4B6, 0xD4B7,
-    0xD4B8, 0xD4B9, 0xD4BA, 0xD4BB, 0xD4BC, 0xD4BD, 0xD4BE, 0xD496,
-    0xD497, 0xD49C, 0xD4A9, 0xD4AF, 0xD4F4, 0xD4F5, 0xD4C6, 0xD4C7,
-    0xD4C8, 0xD4C9, 0xD4CA, 0xD4CB, 0xD4CC, 0xD4CD, 0xD4CE, 0xD4CF,
-    0xD4D0, 0xD4D1, 0xD4D2, 0xD4D3, 0xD4D4, 0xD4D5, 0xD4D6, 0xD4D7,
-    0xD4D8, 0xD4F7, 0xD4FA, 0xD4FE, 0xD4DC, 0xD4DD, 0xD4DE, 0xD4DF
-};
-
-/* os: unused 
-static unsigned compatible_jamo[] =
-{
-	 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
-	 0x8008, 0x8009, 0x800a, 0x800b, 0x800c, 0x800d, 0x800e, 0x800f,
-	 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017,
-	 0x8018, 0x8019, 0x801a, 0x801b, 0x801c, 0x801d, 0x0000, 0x0000,
-	 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	 0x0000, 0x0000, 0x0000, 0x0000, 0x8441, 0x840d, 0x840e, 0x8410,
-	 0x8411, 0x8415, 0x8417, 0x841c, 0x8800, 0x8409, 0x8805, 0x8806,
-	 0x8808, 0x880b, 0x801e, 0x801f, 0x880e, 0x880f, 0x8400, 0x8814,
-	 0x8406, 0x8817, 0x8401, 0x8818, 0x8402, 0x8403, 0x8404, 0x8407,
-	 0x8c0e, 0x8408, 0x8c14, 0x8c15, 0x9000, 0x8405, 0x9005, 0x9014,
-	 0x9015, 0x8621, 0x8701, 0x9400, 0x8721, 0x87c1, 0x87e1
-};*/
-
-#define LINEBASE    0x3013
-
-// ?
-static char LineCharDir(hchar ch)
-{
-    static char index2dir[] = { 10, 11, 9, 14, 15, 13, 6, 7, 5, 3, 12 };
-
-    return (LINEBASE <= ch && ch < LINEBASE + 11 * 7) ?
-        index2dir[(ch - LINEBASE) % 11] : 0;
-}
-
-
-/**
- * Convert hwp's special character to ks
- */
-static hchar s_hh2ks(hchar hh)
-{
-    hchar i, idx = hh >> 8;
-
-    if (hh == 0x81 || hh == 0x82)
-        return '\"';
-    else if (hh == 0x83 || hh == 0x84)
-        return '\'';
-    if (idx == 0x1F)
-    {
-        idx = 170;
-        i = hh & 0xff;
-        if (i >= 0x60)
-        {
-            idx++;
-            i -= 0x60;
-        }
-        return (idx << 8) | (i + 160);
-    }
-    if ((idx == 0x1F && (hh & 0xff) >= 0xC0) || (hh == 0x1F00))
-        return 0;
-    if (idx < 0x34 || idx >= 0x38)
-        return 0x2020;
-    if (hh >= HCA_TG)
-    {
-        return sal::static_int_cast<hchar>((tblhhtg_ks[hh - HCA_TG]));
-    }
-    hh -= HCA_KSS;
-    idx = hh / 0x60 + 161;
-    i = hh % 0x60 + 160;
-    if (idx == 170)
-        idx += 2;
-    return (idx << 8) | i;
-}
-
-
-/**
- * Convert hwp's special character to kssm
- */
-static hchar s_hh2kssm(hchar hh)
-{
-    hchar i, idx = hh >> 8;
-
-    if ((idx < 0x34 || idx >= 0x38) && idx != 0x1F)
-        return 0;
-    if (hh >= HCA_TG)
-        return sal::static_int_cast<hchar>((hhtg_tg[hh - HCA_TG]));
-    if (idx == 0x1F)
-        hh = hh - 0x1F00 + 0x360;
-    else
-    {
-        hh -= HCA_KSS;
-        if (hh >= 0x360)
-            hh += 0xC0;
-    }
-    idx = hh / 0xC0 + 217;
-    i = hh % 0xC0;
-    if (i >= 95)
-        i -= 2;
-    i += 48;
-    if (i >= 127)
-        i += 18;
-    return (idx << 8) | i;
-}
-
-
-static hchar lineCharConv(hchar ch)
-{
-    int flag;
-
-    switch (ch)
-    {
-        case 0x3060 + '\'' - 31:
-        case 0x3060 + '\"' - 31:
-            ch--;
-
-        case 0x3060 + '\'' - 32:
-        case 0x3060 + '\"' - 32:
-        case 0x3060 + '{' - 32:
-        case 0x3060 + '[' - 32:
-        case 0x3060 + ']' - 32:
-        case 0x3060 + '}' - 32:
-            return ch - (0x3060 - 32);
-    }
-    flag = LineCharDir(ch);
-    switch (flag)
-    {
-        case 3:
-            return '-';
-        case 12:
-            return '|';
-        default:
-            return '+';
-    }
-}
-
-
-static int KsSearch(hchar c)
-{
-    int lo, hi, mid;
-    hchar c2;
-
-    lo = mid = 0;
-    hi = 2350 - 1;
-
-    while (lo <= hi)
-    {
-        mid = (lo + hi) >> 1;
-        c2 = ksTbl[mid];
-        if (c == c2)
-            break;
-        if (c < c2)
-            hi = mid - 1;
-        else
-            lo = mid + 1;
-    }
-    return mid;
-}
-
-
-static hchar cdkssm2ks_han(hchar kssm)
-{
-    unsigned int index;
-    unsigned char lo, hi;
-
-/* "한" */
-    if (kssm == 0xd3c5)
-        return 0xc7d1;
-
-    index = KsSearch(kssm);
-    if (kssm != ksTbl[index])
-        return jaso2ks(kssm);
-    hi = sal::static_int_cast<char>(index / (0xFE - 0xA1 + 1) + 0xB0);
-    lo = sal::static_int_cast<unsigned char>(index % (0xFE - 0xA1 + 1) + 0xA1);
-    return lo | (hi << 8);
-}
-
-
-#define IsHangul(c) ((c) & 0x8000)
-#define IsHanja(c)  (((c) & 0x4000)==0x4000)
-#define IsJapan(c)  (((c) > 0x1f00 && (c) < 0x1fb7))
-
-static const hchar jaso_hh_code[] =
-{
-    34881, 35905, 33860, 36929, 33862, 33863, 37953, 38977, 40001, 33866,
-    33867,
-    33868, 33869, 33870, 33871, 33872, 41025, 42049, 43073, 33876, 44097,
-    45121,
-    46145, 47169, 48193, 49217, 50241, 51265, 52289, 53313, 33889, 33921,
-    33953,
-    33985, 34017, 34113, 34145, 34177, 34209, 34241, 34273, 34369, 34401,
-    34433,
-    34465, 34497, 34529, 34625, 34657, 34689, 34721
-};
-
-/* os: unused 
-static int is_jaso(hchar hh)
-{
-    unsigned int i;
-
-    for (i = 0; i < sizeof(jaso_hh_code) / sizeof(jaso_hh_code[0]); i++)
-        if (hh == jaso_hh_code[i])
-            return 1;
-    return 0;
-}*/
-
-
-static hchar jaso2ks(hchar hh)
-{
-    unsigned int i;
-
-    for (i = 0; i < sizeof(jaso_hh_code) / sizeof(jaso_hh_code[0]); i++)
-        if (hh == jaso_hh_code[i])
-    {
-        return sal::static_int_cast<hchar>(0xa4a1 + i);
-    }
-    return 0;
-}
-
-
-//1 00011 00 001 00011
-static hchar choseong_to_unicode[] =
-{
-	0x111e,  0,  0x1100, 0x1101, 0x1102, 0x1103, 0x1104, 0x1105,
-	0x1106, 0x1107, 0x1108, 0x1109, 0x110a, 0x110b, 0x110c, 0x110d,
-	0x110e, 0x110f, 0x1110, 0x1111, 0x1112, 0x1120, 0x1121, 0x1127,
-	0x112b, 0x112d, 0x112f, 0x1132, 0x1136, 0x1140, 0x114c, 0x1158
-};
-/* 중성이 0과 1인 곳에는 다른 코드들이 들어가 있다. 이부분에 대한 법칙을 뽑아라. */
-static hchar joongseong_to_unicode[] =
-{
-	0, 		0, 	0, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165,
-	0, 		0, 0x1166, 0x1167, 0x1168, 0x1169, 0x116a, 0x116b,
-	0, 	0x1188, 0x116c, 0x116d, 0x116e, 0x116f, 0x1170, 0x1171,
-	0x1191, 0x1194, 0x1172, 0x1173, 0x1174, 0x1175, 0x119e, 0x11a1
-};
-
-static hchar jongseong_to_unicode[] =
-{
-	0x11d9,	0  , 0x11a8, 0x11a9, 0x11aa, 0x11ab, 0x11ac, 0x11ad,
-	0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2, 0x11b3, 0x11b4, 0x11b5,
-	0x11b6, 0x11b7, 0x11e6, 0x11b8, 0x11b9, 0x11ba, 0x11bb, 0x11bc,
-	0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x11eb, 0x11f0
-};
-
-/* 중성이 0과 1인곳 */
-/* 처음 32개는 자모, 나머지 32개는 조합으로 구성.
- * 0x8000 ~ 0xa413까지 32개 나오고, 0x0400더한 0x8400에서 다시 32개 나오는 식으로 진행된다.
- * 자모영역은 일반 테이블로 나머지는 구조체 매핑테이블로 만든다.
- */
-/* 308개.. 1152개에서 308개를 제외한 나머지 844개는 자모조합이다. */
-static hchar jamo_to_unicode[] =
-{
-	0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138,
-	0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f, 0x3140,
-	0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148,
-	0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x3172, 0x3173,
-
-	0x3176, 0x317a, 0x317c, 0x317d, 0x317e, 0x3185, 0x3178, 0x317f,
- 	0x3181, 0x316d, 0x11c3, 0x11c4, 0x1113, 0x1114, 0x1115, 0x1116,
-	0x11c7, 0x11c8, 0x11c9, 0x11ca, 0x11cb, 0x11cc, 0x11cd, 0x11ce,
-	0x11cf, 0x11d0, 0x11d1, 0x11d2, 0x11d3, 0x11d4, 0x11d5, 0x11d6,
-
-	0x11d7, 0x11d8, 0x111b, 0x11da, 0x11db, 0x11dc, 0x11dd, 0x11de,
-	0x11df, 0x11e0, 0x11e1, 0x11e2, 0x111f, 0x11e3, 0x1122, 0x1123,
-	0x1124, 0x1125, 0x1126, 0x1128, 0x1129, 0x112a, 0x11e5, 0x112c,
-	0x112e, 0x1130, 0x1131, 0x1133, 0x1134, 0x1135, 0x1137, 0x1138,
-
-	0x1139, 0x113a, 0x113b, 0x113c, 0x113d, 0x113e, 0x113f, 0x1141,
-	0x11ed, 0x1142, 0x1143, 0x1144, 0x1145, 0x1146, 0x1147, 0x1148,
-	0x1149, 0x11ef, 0x114a, 0x114b, 0x11f1, 0x11f2, 0x114d, 0x114e,
-	0x114f, 0x1150, 0x1151, 0x1152, 0x1153, 0x1154, 0x1155, 0x1156,
-
-	0x1157, 0x11f5, 0x11f6, 0x11f7, 0x11f8, 0x11f9, 0x1176, 0x1177,
-	0x1178, 0x1179, 0x117a, 0x117b, 0x117c, 0x117d, 0x117e, 0x117f,
-	0x1180, 0x1181, 0x1182, 0x1183, 0x1184, 0x1185, 0x1186, 0x1187,
-	0x1189, 0x118a, 0x118b, 0x118c, 0x118d, 0x118e, 0x118f, 0x1190,
-
-	0x1192, 0x1193, 0x1195, 0x1196, 0x1197, 0x1198, 0x1199, 0x119a,
-	0x119b, 0x119c, 0x119d, 0x119f, 0x11a0, 0x11a2, 0x11a8, 0x11a9,
-	0x11aa, 0x11ab, 0x11ac, 0x11ad, 0x11ae, 0x1104, 0x11af, 0x11b0,
-	0x11b1, 0x11b2, 0x11b3, 0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8,
-
-	0x1108, 0x11b9, 0x11ba, 0x11bb, 0x11bc, 0x11bd, 0x3149, 0x11be,
-	0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x111e, 0x1120, 0x1127, 0x11e7,
-	0x11e8, 0x11ea, 0x1136, 0x1158, 0x11e6, 0x11eb, 0x11f0, 0x11d9,
-	0x11c3, 0x11c4, 0x11c5, 0x1114, 0x11c6, 0x1116, 0x11c7, 0x11c8,
-
-	0x11c9, 0x11ca, 0x11cb, 0x3169, 0x11cd, 0x11ce, 0x11cf, 0x1119,
-	0x11d1, 0x11d2, 0x11d3, 0x11d4, 0x11d5, 0x11d6, 0x11d7, 0x11d8,
-	0x111b, 0x11da, 0x11db, 0x11dc, 0x11dd, 0x11de, 0x11df, 0x11e0,
-	0x11e1, 0x11e2, 0x111f, 0x11e3, 0x1122, 0x1123, 0x1124, 0x1125,
-
-	0x1126, 0x1128, 0x1129, 0x11e4, 0x11e5, 0x112c, 0x112e, 0x1130,
-	0x1131, 0x1133, 0x1134, 0x1135, 0x1137, 0x1138, 0x1139, 0x113a,
-	0x113b, 0x113c, 0x113d, 0x113e, 0x113f, 0x11ec, 0x11ed, 0x1142,
-	0x1143, 0x1144, 0x1145, 0x1146, 0x1147, 0x1148, 0x1149, 0x11ef,
-
-	0x114a, 0x114b, 0x11f1, 0x11f2, 0x114d, 0x114e, 0x114f, 0x1150,
-	0x1151, 0x1152, 0x1153, 0x1154, 0x1155, 0x1156, 0x1157, 0x11f5,
-	0x11f6, 0x11f7, 0x11f8, 0x11f9
-};
-
-struct JamoComp{
-	int size;
-	hchar v1;
-	hchar v2;
-	hchar v3;
-};
-/* 704 + 12 = 706 개  */
-static JamoComp jamocomp1_to_unicode[] =
-{
-	{3, 0x1100, 0x1161, 0x11e7}, {3, 0x1100, 0x1161, 0x3167},
-	{3, 0x1100, 0x1161, 0x11dd}, {3, 0x1100, 0x1161, 0x11e2},
-	{3, 0x1100, 0x1161, 0x11e5}, {3, 0x1100, 0x1161, 0x11f1},
-	{3, 0x1100, 0x1163, 0x11e2}, {3, 0x1100, 0x1163, 0x11f9},
-	{3, 0x1100, 0x1165, 0x11e7}, {3, 0x1100, 0x1165, 0x11c7},
-	{3, 0x1100, 0x1165, 0x11dd}, {3, 0x1100, 0x1165, 0x11e2},
-
-	{3, 0x1100, 0x1165, 0x11e3}, {3, 0x1100, 0x1167, 0x11e7},
-	{3, 0x1100, 0x1167, 0x11f1}, {3, 0x1100, 0x1167, 0x11f9},
-	{3, 0x1100, 0x1169, 0x11d6}, {3, 0x1100, 0x1169, 0x11dd},
-	{3, 0x1100, 0x1169, 0x11e2}, {3, 0x1100, 0x1169, 0x11f1},
-	{3, 0x1100, 0x1169, 0x11f7}, {3, 0x1100, 0x1169, 0x11f8},
-	{3, 0x1100, 0x116a, 0x11f9}, {3, 0x1100, 0x116d, 0x11e2},
-	{3, 0x1100, 0x116e, 0x11c7}, {3, 0x1100, 0x116e, 0x11cd},
-	{3, 0x1100, 0x116e, 0x11da}, {3, 0x1100, 0x116e, 0x11dd},
-
-	{3, 0x1100, 0x116e, 0x11e2}, {3, 0x1100, 0x116e, 0x11f6},
-	{3, 0x1100, 0x116e, 0x11f9}, {3, 0x1100, 0x116f, 0x11c7},
-	{3, 0x1100, 0x116f, 0x11f9}, {3, 0x1100, 0x1172, 0x11e2},
-	{3, 0x1100, 0x1172, 0x11f9}, {3, 0x1100, 0x1173, 0x11c7},
-	{3, 0x1100, 0x1173, 0x11dd}, {3, 0x1100, 0x1173, 0x11df},
-	{3, 0x1100, 0x1173, 0x11e2}, {3, 0x1100, 0x1173, 0x11f9},
-	{3, 0x1100, 0x1174, 0x11f9}, {3, 0x1100, 0x1175, 0x11e7},
-	{3, 0x1100, 0x1175, 0x11cd}, {3, 0x1100, 0x1175, 0x11e2},
-
-	{3, 0x1100, 0x1175, 0x11f9}, {3, 0x1100, 0x1191, 0x11f9},
-	{3, 0x1100, 0x119e, 0x11e7}, {3, 0x1100, 0x119e, 0x11d3},
-	{3, 0x1100, 0x119e, 0x11d5}, {3, 0x1100, 0x119e, 0x11e3},
-	{3, 0x1100, 0x11a1, 0x11f1}, {2, 0x1100, 0x1176, 0x0000},
-	{2, 0x1100, 0x1178, 0x0000}, {2, 0x1100, 0x117c, 0x0000},
-	{3, 0x1100, 0x117c, 0x11ab}, {3, 0x1100, 0x117c, 0x11af},
-	{3, 0x1100, 0x117c, 0x11b7}, {2, 0x1100, 0x1189, 0x0000},
-	{3, 0x1100, 0x1189, 0x11ab}, {3, 0x1100, 0x1189, 0x11bc},
-
-	{2, 0x1100, 0x118b, 0x0000}, {3, 0x1100, 0x118b, 0x11ab},
-	{2, 0x1100, 0x118c, 0x0000}, {2, 0x1100, 0x118d, 0x0000},
-	{2, 0x1100, 0x1192, 0x0000}, {3, 0x1100, 0x1192, 0x11bc},
-	{2, 0x1100, 0x1195, 0x0000}, {2, 0x1100, 0x1196, 0x0000},
-	{2, 0x1100, 0x1198, 0x0000}, {2, 0x1100, 0x119b, 0x0000},
-	{2, 0x1100, 0x119c, 0x0000}, {2, 0x1100, 0x119d, 0x0000},
-	{2, 0x1100, 0x119f, 0x0000}, {3, 0x1100, 0x119f, 0x11bc},
-	{3, 0x1101, 0x1163, 0x11e2}, {3, 0x1101, 0x1165, 0x11ec},
-
-	{3, 0x1101, 0x1165, 0x11ed}, {3, 0x1101, 0x116e, 0x11e2},
-	{3, 0x1101, 0x1172, 0x11e2}, {3, 0x1101, 0x1175, 0x11e2},
-	{3, 0x1101, 0x1175, 0x11f9}, {3, 0x1101, 0x1191, 0x11bc},
-	{2, 0x1101, 0x1176, 0x0000}, {2, 0x1101, 0x117b, 0x0000},
-	{2, 0x1101, 0x1189, 0x0000}, {2, 0x1101, 0x118c, 0x0000},
-	{2, 0x1101, 0x1198, 0x0000}, {3, 0x1102, 0x1161, 0x11e7},
-	{3, 0x1102, 0x1161, 0x11c4}, {3, 0x1102, 0x1161, 0x11da},
-	{3, 0x1102, 0x1161, 0x11dd}, {3, 0x1102, 0x1161, 0x11e2},
-
-	{3, 0x1102, 0x1161, 0x11f9}, {3, 0x1102, 0x1165, 0x11db},
-	{3, 0x1102, 0x1165, 0x11dd}, {3, 0x1102, 0x1165, 0x11e3},
-	{3, 0x1102, 0x1167, 0x11c5}, {3, 0x1102, 0x1167, 0x11c7},
-	{3, 0x1102, 0x1167, 0x11f9}, {3, 0x1102, 0x1169, 0x11e2},
-	{3, 0x1102, 0x1169, 0x11e4}, {3, 0x1102, 0x1169, 0x11f3},
-	{3, 0x1102, 0x116e, 0x11c6}, {3, 0x1102, 0x116e, 0x11c7},
-	{3, 0x1102, 0x116e, 0x11c8}, {3, 0x1102, 0x116e, 0x11dd},
-	{3, 0x1102, 0x116e, 0x11e2}, {3, 0x1102, 0x116e, 0x11f5},
-
-	{3, 0x1102, 0x1172, 0x11e2}, {3, 0x1102, 0x1173, 0x11c3},
-	{3, 0x1102, 0x1175, 0x11c3}, {3, 0x1102, 0x1175, 0x11dd},
-	{3, 0x1102, 0x1175, 0x11e2}, {3, 0x1102, 0x119e, 0x11d7},
-	{2, 0x1102, 0x1176, 0x0000}, {2, 0x1102, 0x117c, 0x0000},
-	{3, 0x1102, 0x117c, 0x11a8}, {2, 0x1102, 0x118c, 0x0000},
-	{2, 0x1102, 0x1196, 0x0000}, {2, 0x1102, 0x1197, 0x0000},
-	{2, 0x1102, 0x1198, 0x0000}, {2, 0x1102, 0x119b, 0x0000},
-	{3, 0x1103, 0x1161, 0x11e7}, {3, 0x1103, 0x1161, 0x11c7},
-
-	{3, 0x1103, 0x1161, 0x1119}, {3, 0x1103, 0x1161, 0x11db},
-	{3, 0x1103, 0x1161, 0x11dd}, {3, 0x1103, 0x1161, 0x11e2},
-	{3, 0x1103, 0x1161, 0x11f1}, {3, 0x1103, 0x1161, 0x11f9},
-	{3, 0x1103, 0x1163, 0x11e2}, {3, 0x1103, 0x1163, 0x11f1},
-	{3, 0x1103, 0x1165, 0x11dd}, {3, 0x1103, 0x1167, 0x11f9},
-	{3, 0x1103, 0x1169, 0x11e7}, {3, 0x1103, 0x1169, 0x11d6},
-	{3, 0x1103, 0x1169, 0x11e2}, {3, 0x1103, 0x1169, 0x11f1},
-	{3, 0x1103, 0x116d, 0x11e2}, {3, 0x1103, 0x116e, 0x11ce},
-
-	{3, 0x1103, 0x116e, 0x1119}, {3, 0x1103, 0x116e, 0x11da},
-	{3, 0x1103, 0x116e, 0x11e2}, {3, 0x1103, 0x1172, 0x11e2},
-	{3, 0x1103, 0x1173, 0x11cd}, {3, 0x1103, 0x1173, 0x11ce},
-	{3, 0x1103, 0x1173, 0x11e2}, {3, 0x1103, 0x1173, 0x11e3},
-	{3, 0x1103, 0x1173, 0x11f1}, {3, 0x1103, 0x1174, 0x11f9},
-	{3, 0x1103, 0x1175, 0x11f9}, {3, 0x1103, 0x119e, 0x11e7},
-	{3, 0x1103, 0x119e, 0x11e8}, {3, 0x1103, 0x119e, 0x11ea},
-	{3, 0x1103, 0x119e, 0x11c3}, {3, 0x1103, 0x119e, 0x11cc},
-
-	{3, 0x1103, 0x119e, 0x11e3}, {3, 0x1103, 0x119e, 0x11e9},
-	{2, 0x1103, 0x1176, 0x0000}, {2, 0x1103, 0x1178, 0x0000},
-	{2, 0x1103, 0x117c, 0x0000}, {3, 0x1103, 0x117c, 0x11b7},
-	{2, 0x1103, 0x1189, 0x0000}, {3, 0x1103, 0x1189, 0x11ab},
-	{2, 0x1103, 0x118c, 0x0000}, {2, 0x1103, 0x1195, 0x0000},
-	{2, 0x1103, 0x1196, 0x0000}, {2, 0x1103, 0x1198, 0x0000},
-	{2, 0x1103, 0x1199, 0x0000}, {3, 0x1103, 0x1199, 0x11ab},
-	{3, 0x1103, 0x1199, 0x11bc}, {3, 0x1104, 0x1161, 0x11d8},
-
-	{3, 0x1104, 0x1161, 0x11e2}, {3, 0x1104, 0x1161, 0x11f9},
-	{3, 0x1104, 0x1163, 0x11e2}, {3, 0x1104, 0x1169, 0x11e2},
-	{3, 0x1104, 0x1169, 0x11f9}, {3, 0x1104, 0x116d, 0x11e2},
-	{3, 0x1104, 0x116e, 0x11e2}, {3, 0x1104, 0x116e, 0x11f9},
-	{3, 0x1104, 0x1172, 0x11e2}, {3, 0x1104, 0x1173, 0x11e2},
-	{3, 0x1104, 0x1175, 0x11f9}, {2, 0x1104, 0x117b, 0x0000},
-	{2, 0x1104, 0x118c, 0x0000}, {2, 0x1104, 0x1198, 0x0000},
-	{3, 0x1105, 0x1161, 0x11e7}, {3, 0x1105, 0x1161, 0x11dd},
-
-	{3, 0x1105, 0x1161, 0x11e2}, {3, 0x1105, 0x1161, 0x11f5},
-	{3, 0x1105, 0x1161, 0x11f9}, {3, 0x1105, 0x1163, 0x11e2},
-	{3, 0x1105, 0x1167, 0x11c7}, {3, 0x1105, 0x1167, 0x11e2},
-	{3, 0x1105, 0x1167, 0x11f9}, {3, 0x1105, 0x1169, 0x11dd},
-	{3, 0x1105, 0x1169, 0x11e2}, {3, 0x1105, 0x1169, 0x11f1},
-	{3, 0x1105, 0x116d, 0x11dd}, {3, 0x1105, 0x116d, 0x11e2},
-	{3, 0x1105, 0x116e, 0x11dd}, {3, 0x1105, 0x116e, 0x11e2},
-	{3, 0x1105, 0x1172, 0x11e2}, {3, 0x1105, 0x1173, 0x11dd},
-
-	{3, 0x1105, 0x1173, 0x11e2}, {3, 0x1105, 0x1175, 0x11dd},
-	{3, 0x1105, 0x1175, 0x11e2}, {3, 0x1105, 0x1175, 0x11f9},
-	{3, 0x1105, 0x119e, 0x11d7}, {3, 0x1105, 0x119e, 0x11dc},
-	{3, 0x1105, 0x119e, 0x11dd}, {2, 0x1105, 0x1176, 0x0000},
-
-/* -- 여기부터 숫자 안바꿈 즉, 3을 2로 바꾸어 주어야 함. */
-	{2, 0x1105, 0x1178, 0x0000}, {2, 0x1105, 0x117a, 0x0000},
-	{2, 0x1105, 0x117b, 0x0000}, {2, 0x1105, 0x1186, 0x0000},
-	{2, 0x1105, 0x1187, 0x0000}, {2, 0x1105, 0x118c, 0x0000},
-	{2, 0x1105, 0x1195, 0x0000}, {2, 0x1105, 0x1196, 0x0000},
-
-	{2, 0x1105, 0x1198, 0x0000}, {2, 0x1105, 0x1199, 0x0000},
-	{3, 0x1105, 0x1199, 0x11bc}, {2, 0x1105, 0x119b, 0x0000},
-	{2, 0x111a, 0x1163, 0x0000}, {3, 0x111a, 0x1163, 0x11bc},
-	{3, 0x1106, 0x1161, 0x11e8}, {3, 0x1106, 0x1161, 0x11c7},
-	{3, 0x1106, 0x1161, 0x11cd}, {3, 0x1106, 0x1161, 0x1119},
-	{3, 0x1106, 0x1161, 0x11d8}, {3, 0x1106, 0x1161, 0x11e2},
-	{3, 0x1106, 0x1163, 0x11e2}, {3, 0x1106, 0x1165, 0x11c6},
-	{3, 0x1106, 0x1165, 0x11f9}, {3, 0x1106, 0x1169, 0x11c6},
-
-	{3, 0x1106, 0x1169, 0x11dd}, {3, 0x1106, 0x1169, 0x11e2},
-	{3, 0x1106, 0x116d, 0x11e2}, {3, 0x1106, 0x116e, 0x11e7},
-	{3, 0x1106, 0x116e, 0x11c7}, {3, 0x1106, 0x116e, 0x11e2},
-	{3, 0x1106, 0x116e, 0x11ec}, {3, 0x1106, 0x116e, 0x11ed},
-	{3, 0x1106, 0x116e, 0x11f9}, {3, 0x1106, 0x116f, 0x11f9},
-	{3, 0x1106, 0x1173, 0x11e7}, {3, 0x1106, 0x1174, 0x11f9},
-	{3, 0x1106, 0x1175, 0x11e7}, {3, 0x1106, 0x1175, 0x11f6},
-	{3, 0x1106, 0x1175, 0x11f9}, {3, 0x1106, 0x119e, 0x11c3},
-
-	{2, 0x1106, 0x1176, 0x0000}, {2, 0x1106, 0x1178, 0x0000},
-	{2, 0x1106, 0x117c, 0x0000}, {3, 0x1106, 0x117c, 0x11af},
-	{2, 0x1106, 0x1182, 0x0000}, {2, 0x1106, 0x1183, 0x0000},
-	{2, 0x1106, 0x118c, 0x0000}, {2, 0x1106, 0x1196, 0x0000},
-	{3, 0x1106, 0x1196, 0x11b7}, {2, 0x1106, 0x1198, 0x0000},
-	{2, 0x1106, 0x119f, 0x0000}, {3, 0x1106, 0x119f, 0x11ab},
-	{3, 0x1106, 0x119f, 0x11bc}, {3, 0x1107, 0x1161, 0x11e7},
-	{3, 0x1107, 0x1161, 0x11c9}, {3, 0x1107, 0x1161, 0x11dd},
-
-	{3, 0x1107, 0x1161, 0x11e2}, {3, 0x1107, 0x1161, 0x11e3},
-	{3, 0x1107, 0x1161, 0x11f1}, {3, 0x1107, 0x1161, 0x11f6},
-	{3, 0x1107, 0x1161, 0x11f9}, {3, 0x1107, 0x1165, 0x11c7},
-	{3, 0x1107, 0x1167, 0x11f1}, {3, 0x1107, 0x1169, 0x11e7},
-	{3, 0x1107, 0x1169, 0x11dd}, {3, 0x1107, 0x1169, 0x11e2},
-	{3, 0x1107, 0x116d, 0x11e2}, {3, 0x1107, 0x116e, 0x11e7},
-	{3, 0x1107, 0x116e, 0x11c7}, {3, 0x1107, 0x116e, 0x1119},
-	{3, 0x1107, 0x116e, 0x11d1}, {3, 0x1107, 0x116e, 0x11d2},
-
-	{3, 0x1107, 0x116e, 0x11e2}, {3, 0x1107, 0x116e, 0x11ef},
-	{3, 0x1107, 0x116e, 0x11f9}, {3, 0x1107, 0x116f, 0x11f9},
-	{3, 0x1107, 0x1173, 0x11e7}, {3, 0x1107, 0x1173, 0x11c3},
-	{3, 0x1107, 0x1175, 0x11e7}, {3, 0x1107, 0x1175, 0x11e2},
-	{3, 0x1107, 0x1175, 0x11f1}, {3, 0x1107, 0x1175, 0x11f9},
-	{3, 0x1107, 0x119e, 0x11c3}, {3, 0x1107, 0x119e, 0x11d5},
-	{3, 0x1107, 0x119e, 0x11e3}, {3, 0x1107, 0x11a1, 0x11f1},
-	{2, 0x1107, 0x1176, 0x0000}, {2, 0x1107, 0x1177, 0x0000},
-
-	{2, 0x1107, 0x1178, 0x0000}, {2, 0x1107, 0x117c, 0x0000},
-	{3, 0x1107, 0x117c, 0x11a8}, {3, 0x1107, 0x117c, 0x11af},
-	{3, 0x1107, 0x117c, 0x11b7}, {3, 0x1107, 0x117c, 0x11bc},
-	{2, 0x1107, 0x1182, 0x0000}, {2, 0x1107, 0x118c, 0x0000},
-	{2, 0x1107, 0x1196, 0x0000}, {2, 0x1107, 0x1198, 0x0000},
-	{2, 0x1107, 0x119a, 0x0000}, {2, 0x1107, 0x119f, 0x0000},
-	{3, 0x1107, 0x119f, 0x11ab}, {3, 0x1107, 0x119f, 0x11bc},
-	{3, 0x1108, 0x1161, 0x11e2}, {3, 0x1108, 0x1167, 0x11f9},
-
-	{3, 0x1108, 0x1169, 0x11e2}, {3, 0x1108, 0x116e, 0x11e2},
-	{3, 0x1108, 0x1174, 0x11f9}, {3, 0x1108, 0x1175, 0x11f9},
-	{3, 0x1121, 0x116a, 0x11f9}, {3, 0x1121, 0x119e, 0x114d},
-	{2, 0x1121, 0x118c, 0x0000}, {2, 0x1121, 0x1198, 0x0000},
-	{3, 0x1109, 0x1161, 0x11ca}, {3, 0x1109, 0x1161, 0x11dd},
-	{3, 0x1109, 0x1161, 0x11e2}, {3, 0x1109, 0x1161, 0x11f1},
-	{3, 0x1109, 0x1161, 0x11f9}, {3, 0x1109, 0x1163, 0x11e2},
-	{3, 0x1109, 0x1163, 0x11f1}, {3, 0x1109, 0x1165, 0x11e7},
-
-	{3, 0x1109, 0x1165, 0x11c3}, {3, 0x1109, 0x1165, 0x11ec},
-	{3, 0x1109, 0x1165, 0x11ed}, {3, 0x1109, 0x1167, 0x11e7},
-	{3, 0x1109, 0x1167, 0x11d5}, {3, 0x1109, 0x1167, 0x11dd},
-	{3, 0x1109, 0x1167, 0x11e3}, {3, 0x1109, 0x1167, 0x11f1},
-	{3, 0x1109, 0x1167, 0x11f9}, {3, 0x1109, 0x1169, 0x11c7},
-	{3, 0x1109, 0x1169, 0x11e2}, {3, 0x1109, 0x116a, 0x11f9},
-	{3, 0x1109, 0x116b, 0x11f9}, {3, 0x1109, 0x116d, 0x11e2},
-	{3, 0x1109, 0x116d, 0x11f1}, {3, 0x1109, 0x116e, 0x11e7},
-
-	{3, 0x1109, 0x116e, 0x11e2}, {3, 0x1109, 0x116e, 0x11f9},
-	{3, 0x1109, 0x1172, 0x11e2}, {3, 0x1109, 0x1173, 0x11e2},
-	{3, 0x1109, 0x1173, 0x11e3}, {3, 0x1109, 0x1173, 0x11f1},
-	{3, 0x1109, 0x1174, 0x11f9}, {3, 0x1109, 0x1175, 0x11c7},
-	{3, 0x1109, 0x1175, 0x11ce}, {3, 0x1109, 0x1175, 0x11da},
-	{3, 0x1109, 0x1175, 0x11e2}, {3, 0x1109, 0x1175, 0x11f9},
-	{3, 0x1109, 0x1191, 0x11f9}, {3, 0x1109, 0x119e, 0x11ca},
-	{3, 0x1109, 0x119e, 0x11d6}, {3, 0x1109, 0x119e, 0x11f1},
-
-	{3, 0x1109, 0x119e, 0x11e3}, {3, 0x1109, 0x11a1, 0x11dd},
-	{3, 0x1109, 0x11a1, 0x11f1}, {2, 0x1109, 0x1176, 0x0000},
-	{2, 0x1109, 0x1177, 0x0000}, {2, 0x1109, 0x1178, 0x0000},
-	{2, 0x1109, 0x117c, 0x0000}, {3, 0x1109, 0x117c, 0x11a8},
-	{3, 0x1109, 0x117c, 0x11af}, {3, 0x1109, 0x117c, 0x11b7},
-	{3, 0x1109, 0x117c, 0x11bc}, {2, 0x1109, 0x117e, 0x0000},
-	{2, 0x1109, 0x1189, 0x0000}, {3, 0x1109, 0x1189, 0x11ab},
-	{2, 0x1109, 0x118c, 0x0000}, {2, 0x1109, 0x1190, 0x0000},
-
-	{2, 0x1109, 0x1192, 0x0000}, {3, 0x1109, 0x1192, 0x11bc}
-};
-
-//#define IS_OLD_HAN(x)	(((x) >= 0x8020 && (x) <= 0x83ff ) || ( (x) >= 0x8420 && (x) <= 0x843f )) // beside these, there are very much characters in the hangul.
-int hcharconv(hchar ch, hchar *dest, int codeType)
-{
-    unsigned int index;
-    unsigned char lo, hi;
-	 int res;
-	 //printf("hcharconv[%04x]\n",ch);
-    if (ch < 128){
-		 dest[0] = ch;
-        return 1;
-	 }
-    if (IsHangul(ch))
-    {
-		  hchar ch2 = ch;
-        if (codeType == KS)
-            ch = cdkssm2ks_han(ch);
-		  else if( codeType == UNICODE ){
-				if( ch2 == 0xd3c5 ){
-					dest[0] = 0xd55c;
-					return 1 ;
-				}
-				res = kssm_hangul_to_ucs2(ch, dest);
-			   //printf("hcharconv Hangul[%04x]\n",dest[0]);
-				return res;
-		  }
-		  dest[0] = ch;
-        return 1;
-    }
-      /* 한자는 0x4000부터 4888가지의 값을 가진다. */
-    else if (IsHanja(ch))
-    {
-        /*  4888이외의 수는 아래한글에서 정의한 확장한자이다. 이것에 대해서는
-            유니코드나 완성형코드로의 변환을 위한 매핑테이블어 없는 실정이다.
-         */
-        if ((index = ch - 0x4000) >= 4888)
-        {
-				if( codeType == UNICODE )
-					 dest[0]= 0x25A1;
-				else
-					 dest[0]= 0xA1E0;
-            return 1;
-        }
-        if (codeType == KS)
-        {
-            /*  한자코드는 상위코드와 하위코드로 나누어지며 하위코드는 0xA1 - 0xFE 까지의 값을 가진다.
-                즉 하위코드에 올수있는 가지수는 0xFE - 0xA1 +1 가지수이다.
-             */
-            hi = sal::static_int_cast<unsigned char>(index / (0xFE - 0xA1 + 1) + 0xCA);
-            lo = sal::static_int_cast<unsigned char>(index % (0xFE - 0xA1 + 1) + 0xA1);
-            ch = (hi << 8) | lo;
-        }
-		  else if(codeType == UNICODE){
-                hi = sal::static_int_cast<unsigned char>(index / (0xFE - 0xA1 + 1) + 0xCA);
-                lo = sal::static_int_cast<unsigned char>(index % (0xFE - 0xA1 + 1) + 0xA1);
-				ch = (hi << 8) | lo;
-				ch = ksc5601_han_to_ucs2(ch);
-		  }
-        else
-        {
-            hi = sal::static_int_cast<unsigned char>(index / (0x100 - 0x31 - 0x11 - 2) + 0xE0);
-            lo = sal::static_int_cast<unsigned char>(index % (0x100 - 0x31 - 0x11 - 2) + 0x31);
-            if (lo >= 0x7F)
-                lo += 0x12;
-            ch = (hi << 8) | lo;
-        }
-		  //printf("hcharconv Hanja[%04x]\n",ch);
-		  dest[0] = ch;
-        return 1;
-    }
-    if (LineCharDir(ch))
-    {
-		 dest[0] = lineCharConv(ch);
-        return 1;
-    }
-    else if (0x2f00 <= ch && ch <= 0x2f6f && (ch & 0x0f) < 9)
-    {
-// bullet
-        lo = sal::static_int_cast<unsigned char>(ch & 0x0f);
-
-        if( codeType != KSSM )
-        {
-            if (ch < 0x2f10) ch = 0xa1e0;
-            else if (ch < 0x2f20) ch = 0xa1db;
-            else if (ch < 0x2f30) ch = 0xa1de;
-            else if (ch < 0x2f40) ch = 0xa1e2;
-            else if (ch < 0x2f50) ch = 0xa1e4;
-            else if (ch < 0x2f60) ch = 0xa2b7;
-            else ch = 0xa2b9;
-
-            ch = (lo < 6) ? ch : ch + 1;
-				if( codeType == UNICODE)
-					 ch = ksc5601_sym_to_ucs2(ch);
-        }
-        else
-        {
-            if (ch < 0x2f10) ch = 0xd970;
-            else if (ch < 0x2f20) ch = 0xd96b;
-            else if (ch < 0x2f30) ch = 0xd96e;
-            else if (ch < 0x2f40) ch = 0xd972;
-            else if (ch < 0x2f50) ch = 0xd974;
-            else if (ch < 0x2f60) ch = 0xd9b7;
-            else ch = 0xd9b9;
-            ch = (lo < 6) ? ch : ch + 1;
-        }
-		  //printf("hcharconv Bullet[%04x]\n",ch);
-		  dest[0] = ch;
-        return 1 ;
-    }
-/**
- * 특수문자 코드
- * 아래한글에서는 0x3400부터 특수문자가 시작된다. 조합형은 0xA1A0
- */
-    else
-    {
-        if( codeType != KSSM )
-        {
-			   //printf("code[0x%04x]\n",ch);
-				hchar ch2 = ch;
-            ch = s_hh2ks(ch);
-				//printf("code ks[0x%04x]\n",ch);
-				if( codeType == UNICODE ){
-					 if (ch < 128){
-						 dest[0] = ch;
-						  return 1;
-					 }
-                     /* 한글과컴퓨터 : 0x37c0 ~ 0x37c5 */
-					 if( ch2 >= 0x37c0 && ch2 <= 0x37c5 ){
-						 if( ch2 == 0x37c0 ) dest[0] = 0xd55c;
-						 else if( ch2 == 0x37c1 ) dest[0] = 0xae00;
-						 else if( ch2 == 0x37c2 ) dest[0] = 0xacfc;
-						 else if( ch2 == 0x37c3 ) dest[0] = 0xcef4;
-						 else if( ch2 == 0x37c4 ) dest[0] = 0xd4e8;
-						 else if( ch2 == 0x37c5 ) dest[0] = 0xd130;
-						 return 1;
-					 }
-					 if( ch == 0x2020 ){
-						  switch( ch2 ){
-								case 0x309b :
-									 ch = 0xff62;
-									 break;
-								case 0x309d :
-									 ch = 0xff63;
-									 break;
-								default:
-									 ch = 0x25a1;
-									 break;
-						  }
-					 }
-					 else{
-						  ch = ksc5601_sym_to_ucs2(ch);
-					 }
-					 //printf("code ucs2[0x%04x]\n",ch);
-				}
-        }
-        else{
-            ch = s_hh2kssm(ch);
-		  }
-
-        if (ch == 0){ // not '?', but square mark
-				if( codeType == UNICODE )
-					 dest[0] =  0x25A1;
-				else
-					 dest[0] =  0xA1E0;
-				return 1;
-		  }
-		  //printf("hcharconv Special[%04x]\n",ch);
-		  dest[0] = ch;
-        return 1;
-    }
-}
-
-/* 한글일 경우. */
-int kssm_hangul_to_ucs2(hchar ch, hchar *dest)
-{
-    hchar choseong, joongseong, jongseong;
-
-    choseong = ((ch >> 10) & 0x1f);
-    joongseong = ((ch >> 5) & 0x1f);
-    jongseong = (ch & 0x1f) ;
-
-	 //printf("kssm_hangul_to_ucs2 : [%d,%d,%d]\n", choseong,joongseong,jongseong);
-
-     if( joongseong < 2 ){ /* 조합되지 않은 영역 중성=0,1 */
-         if( joongseong == 0 && ch < 0xa414 ){ /* 고어포함 자모 */
-			 int index = choseong * 32 + jongseong;
-			 dest[0] = jamo_to_unicode[index];
-			 return 1;
-		 }
-         else{ /* 고어포함 자모조합 : 테이블 미완성 */
-             unsigned int index = choseong * 32 + jongseong - 308;
-             if( index < sizeof(jamocomp1_to_unicode)/sizeof(jamocomp1_to_unicode[0])){
-				 dest[0] = jamocomp1_to_unicode[index].v1;
-				 dest[1] = jamocomp1_to_unicode[index].v2;
-				 dest[2] = jamocomp1_to_unicode[index].v3;
-				 return jamocomp1_to_unicode[index].size;
-			 }
-			 dest[0] = 0x25a1; // empty square.
-			 return 1;
-		 }
-	 }
-     else if ( choseong == 1 && jongseong == 1 ){ /* 모음 */
-		 dest[0] = joongseong_to_unicode[joongseong];
-		 return 1;
-	 }
-     else if ( joongseong == 2 && jongseong == 1 ){  /* 자음 */
-		 dest[0] = choseong_to_unicode[choseong];
-       return 1;
-    }
-	 else if( choseong > 20 || choseong == 0 ||
-			 joongseong == 17 || joongseong == 24 ||
-			 joongseong == 25 || joongseong > 29 ||
-			 jongseong == 0 || jongseong == 18 ||
-			 jongseong > 29 ||
-			 choseong == 1 || joongseong == 2  /* 완성되지 않은 한글 */
-             ) { /* 고어 */
-		 int count = 0;
-		 if( choseong != 1 ){
-			 dest[count] = choseong_to_unicode[choseong];
-			 count++;
-		 }
-		 if( joongseong > 2 ){
-			 dest[count] = joongseong_to_unicode[joongseong];
-			 count++;
-		 }
-		 if( jongseong != 1 ){
-			 dest[count] = jongseong_to_unicode[jongseong];
-			 count++;
-		 }
-		 return count;
-    }
-
-    choseong -= 2;
-    if( joongseong < 0x8 )
-		 joongseong -= 3;
-    else if( joongseong < 0x10 )
-		 joongseong -= 5;
-    else if( joongseong < 0x18 )
-		 joongseong -= 7;
-    else
-		 joongseong -= 9;
-
-    choseong *= (NUM_JOONGSEONG * NUM_JONGSEONG);
-    joongseong *= NUM_JONGSEONG;
-    jongseong -= jongseong > 0x12 ?  2 : 1;
-
-	 dest[0] = UNI_HANGUL_FIRST + choseong + joongseong + jongseong;
-    return 1;
-}
-
-hchar ksc5601_sym_to_ucs2 (hchar input)
-{
-    unsigned char ch = sal::static_int_cast<unsigned char>(input >> 8);
-    unsigned char ch2;
-    int idx;
-
-    ch2 = sal::static_int_cast<unsigned char>(input & 0xff);
-    idx = (ch - 0xA1) * 94 + (ch2 - 0xA1);
-    if (idx <= 1114 && idx >= 0){
-	hchar value = ksc5601_2uni_page21[idx];
-	return value ? value :  0x25a1;
-    }
-    return 0x25a1;
-}
-
-hchar ksc5601_han_to_ucs2 (hchar input)
-{
-    unsigned char ch = sal::static_int_cast<unsigned char>(input >> 8);
-    unsigned char ch2;
-    int idx;
-
-    ch2 = sal::static_int_cast<unsigned char>(input & 0xff);
-    idx = (ch - 0xA1) * 94 + (ch2 - 0xA1);
-    if (idx >= 3854){
-	// Hanja : row 42 - row 93 : 3854 = 94 * (42-1)
-	hchar value = ksc5601_2uni_page4a[idx - 3854];
-	return value ? value : '?';
-    }
-    return '?';
-}
-
-hchar_string hstr2ucsstr(hchar const* hstr)
-{
-    hchar_string ret;
-    hchar dest[3];
-    for( ; *hstr ; ){
-        int const res = hcharconv(*hstr++, dest, UNICODE);
-        for (int j = 0 ; j < res ; j++) {
-            ret.push_back(dest[j]);
-        }
-    }
-    return ret;
-}
-
-/**
- * 한컴스트링을 완성형스트링으로 변환한다
- */
-::std::string hstr2ksstr(hchar const* hstr)
-{
-    ::std::string ret;
-    int res, j;
-    int c;
-	 hchar dest[3];
-    for( ; *hstr ; )
-    {
-        res = hcharconv(*hstr++, dest, KS);
-		  for( j = 0 ; j < res ; j++ ){
-			  c = dest[j];
-			  if( c < 32 ) c = ' ';
-              else if( c < 256 )
-              {
-                  ret.push_back(sal::static_int_cast<char>(c));
-              }
-			  else
-			  {
-                  ret.push_back(sal::static_int_cast<char>((c >> 8 ) & 0xff));
-                  ret.push_back(sal::static_int_cast<char>(c & 0xff));
-			  }
-		  }
-    }
-    return ret;
-}
-
-
-/*
- * 한글에서 영문외의 문자까지 포함할 수 있는 kchar타입의 문자열을
- * 한글에서 사용하는 hchar타입의 문자열로 변환한다.
- */
-hchar_string kstr2hstr(unsigned char const* src)
-{
-    hchar_string ret;
-    for (unsigned int i = 0; src[i] != '\0' ; i++)
-    {
-        if ( src[i] < 127 )
-        {
-            ret.push_back(src[i]);
-        }
-        else
-        {
-            ret.push_back(src[i] << 8 | src[i+1]);
-            i++;
-        }
-    }
-    return ret;
-}
-
-
-/**
- * Transfer interger to string following format
- */
-char* Int2Str(int value, const char *format, char *buf)
-{
-    sprintf(buf,format,value);
-    return buf;
-}
-
-
-/* color인덱스 값과 음영값을 조합하여 스타오피스의 color로 변환 */
-char *hcolor2str(uchar color, uchar shade, char *buf, bool bIsChar)
-{
-    unsigned short red,green,blue;
-
-    switch( (int)color )
-    {
-        case 0 :                                  // black
-            red =  0xff * (100 - shade ) /100;
-            green =  0xff * (100 - shade ) /100;
-            blue =  0xff * (100 - shade ) /100;
-            break;
-        case 1:                                   // blue
-            red =  0xff * (100 - shade ) /100;
-            green =  0xff * (100 - shade ) /100;
-            blue = 0xff;
-            break;
-        case 2:                                   // green
-            red =  0xff * (100 - shade ) /100;
-				if( bIsChar )
-					 green = 0x80;
-				else
-					 green = 0xff;
-            blue =  0xff * (100 - shade ) /100;
-            break;
-        case 3:                                   // cyan
-            red =  0xff * (100 - shade ) /100;
-            green = 0xff;
-            blue = 0xff;
-            break;
-        case 4:                                   // red
-            red = 0xff;
-            green =  0xff * (100 - shade ) /100;
-            blue =  0xff * (100 - shade ) /100;
-            break;
-        case 5:                                   // magenta
-            red = 0xff;
-            green =  0xff * (100 - shade ) /100;
-            blue = 0xff;
-            break;
-        case 6:                                   //yellow
-            red = 0xff;
-            green = 0xff;
-            blue =  0xff * (100 - shade ) /100;
-            break;
-        case 7:                                   //white
-        default:
-            red = 0xff;
-            green = 0xff;
-            blue = 0xff;
-            break;
-    }
-
-    sprintf(buf,"#%02x%02x%02x", red, green, blue);
-    return buf;
-}
-
-
-::std::string urltounix(const char *src)
-{
-    ::std::string ret;
-    unsigned int i = 0;
-    if( src[0] == 'C' && src[1] == ':' && src[2] == '\\' ) // Home Dir
-    {
-        ret.append("file://");
-        ret.append(getenv("HOME"));
-        ret.push_back('/');
-        i = 3; // skip first 3
-    }
-    else if( src[0] == 'D' && src[1] == ':' && src[2] == '\\' ) // Root Dir
-    {
-        ret.append("file:///");
-        i = 3; // skip first 3
-    }
-    else if( !strncmp(src,"http",4)  ) // Start from "http"
-    {
-        // nothing special here, just copy
-    }
-	 else
-    {
-        unsigned int srclen = strlen(src);
-        if (3 < srclen)
-        {
-            char const*const ext = src + (srclen-3);
-#ifdef _WIN32
-            if (_strnicmp(ext,"HWP",3) && _strnicmp(ext,"HWT",3))
-#else
-            if (strcasecmp(ext,"HWP") && strcasecmp(ext,"HWT"))
-#endif
-            {
-                ret.append("http://");
-            }
-        }
-	 }
-     for (; i < strlen(src); i++)
-     {
-        if (src[i] == '\\') {
-            ret.push_back('/');
-        } else {
-            ret.push_back(src[i]);
-        }
-     }
-     return ret;
-}
-
-#ifdef _WIN32
-::std::string urltowin(const char *src)
-{
-    std::string ret;
-    if( !_strnicmp(src, "http", 4))
-	 {
-        // nothing special here, just copy
-    }
-	 else
-    {
-        unsigned int srclen = strlen(src);
-        if (3 < srclen)
-        {
-            char const*const ext = src + (srclen-3);
-            if (_strnicmp(ext,"HWP",3) && _strnicmp(ext,"HWT",3))
-            {
-                ret.append("http://");
-            }
-            else
-            {
-                ret.append(src); // no backslash conversion
-                return ret;
-            }
-        }
-	 }
-    for (unsigned int i = 0; i < strlen(src); i++)
-    {
-        if (src[i] == '\\') {
-            ret.push_back('/');
-        } else {
-            ret.push_back(src[i]);
-        }
-    }
-    return ret;
-}
-#endif
-
-char* base64_encode_string( const uchar *buf, unsigned int len )
-{
-    char basis_64[] =
-        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    char * out;
-    int inPos  = 0;
-    int outPos = 0;
-    int c1, c2, c3;
-    unsigned int i;
-
-    out=(char *)malloc( (len*4/3)+8 );
-
-/* Get three characters at a time and encode them. */
-    for (i=0; i < len/3; ++i)
-    {
-        c1 = buf[inPos++] & 0xFF;
-        c2 = buf[inPos++] & 0xFF;
-        c3 = buf[inPos++] & 0xFF;
-        out[outPos++] = basis_64[(c1 & 0xFC) >> 2];
-        out[outPos++] = basis_64[((c1 & 0x03) << 4) | ((c2 & 0xF0) >> 4)];
-        out[outPos++] = basis_64[((c2 & 0x0F) << 2) | ((c3 & 0xC0) >> 6)];
-        out[outPos++] = basis_64[c3 & 0x3F];
-    }
-
-/* Encode the remaining one or two characters. */
-
-    switch (len % 3)
-    {
-        case 0:
-            break;
-        case 1:
-            c1 = buf[inPos] & 0xFF;
-            out[outPos++] = basis_64[(c1 & 0xFC) >> 2];
-            out[outPos++] = basis_64[((c1 & 0x03) << 4)];
-            out[outPos++] = '=';
-            out[outPos++] = '=';
-            break;
-        case 2:
-            c1 = buf[inPos++] & 0xFF;
-            c2 = buf[inPos] & 0xFF;
-            out[outPos++] = basis_64[(c1 & 0xFC) >> 2];
-            out[outPos++] = basis_64[((c1 & 0x03) << 4) | ((c2 & 0xF0) >> 4)];
-            out[outPos++] = basis_64[((c2 & 0x0F) << 2)];
-            out[outPos++] = '=';
-            break;
-    }
-    out[outPos] = 0;
-    return out;
-}
-
-double calcAngle(int x1, int y1, int x2, int y2)
-{
-	 y1 = -y1;
-	 y2 = -y2;
-	 if( x2 == x1 ){
-		  if( y2 >= y1 )
-				return 0.;
-		  else
-				return 270.;
-	 }
-	 double angle;
-	 angle = (180 / PI) * atan( ( y2 - y1 ) * 1.0 / ( x2 - x1 ));
-     if( y2 >= y1 ){ /* 1,2사분면 */
-		  if( angle < 0. )
-				angle += 180.;
-	 }
-     else{ /* 3, 4 사분면 */
-		  if( angle > 0 )
-				angle += 180.;
-		  else
-				angle += 360.;
-	 }
-	 return angle;
-}
diff --git a/main/hwpfilter/source/hcode.h b/main/hwpfilter/source/hcode.h
deleted file mode 100644
index e675f0c..0000000
--- a/main/hwpfilter/source/hcode.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hcode.h,v 1.3 2008-04-10 12:03:17 rt Exp $ */
-
-#ifndef _HCODE_H_
-#define _HCODE_H_
-
-#include "hwplib.h"
-
-/**
- * Codetype of Korean
- * KSSM - Johap, KS - Wansung
- */
-enum { KSSM, KS, UNICODE };
-/**
- *   Transfer combination-code for internal using of hwp to ascii
- */
-DLLEXPORT int hcharconv(hchar ch, hchar *dest, int codeType) ;
-
-DLLEXPORT int   kssm_hangul_to_ucs2(hchar ch, hchar *dest) ;
-DLLEXPORT hchar ksc5601_han_to_ucs2 (hchar);
-DLLEXPORT hchar ksc5601_sym_to_ucs2 (hchar);
-DLLEXPORT hchar_string hstr2ucsstr(hchar const* hstr);
-/**
- * 한컴스트링을 완성형스트링으로 변환한다.
- */
-DLLEXPORT ::std::string hstr2ksstr(hchar const* hstr);
-
-/**
- * 한글을 포함할 수 있는 char형스트링을 한컴스트링으로 변환한다.
- */
-DLLEXPORT hchar_string kstr2hstr(uchar const* src);
-
-/**
- * hwp의 경로를 unix형태로 바꾼다.
- */
-DLLEXPORT ::std::string urltounix(const char *src);
-
-/**
- * hwp의 경로를 windows형태로 바꾼다.
- */
-#ifdef _WIN32
-DLLEXPORT ::std::string urltowin(const char *src);
-#endif
-/**
- *  Transfer interger to string following format
- */
-DLLEXPORT char* Int2Str(int value, const char *format, char *buf);
-
-/**
- * color인덱스 값과 음영값을 조합하여 스타오피스의 color로 변환
- */
-DLLEXPORT char *hcolor2str(uchar color, uchar shade, char *buf, bool bIsChar = false);
-
-DLLEXPORT char *base64_encode_string( const uchar *buf, unsigned int len );
-DLLEXPORT double calcAngle(int x1, int y1, int x2, int y2);
-
-
-#endif                                            /* _HCODE_H_ */
diff --git a/main/hwpfilter/source/hfont.cpp b/main/hwpfilter/source/hfont.cpp
deleted file mode 100644
index 701ed12..0000000
--- a/main/hwpfilter/source/hfont.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hfont.cpp,v 1.4 2008-06-04 09:56:49 vg Exp $ */
-
-#include "precompile.h"
-#include "hwplib.h"
-#include "hwpfile.h"
-#include "hfont.h"
-/* 이 함수는 HWP 파일을 해석하는 부분이다. */
-
-HWPFont::HWPFont(void)
-{
-    for (int ii = 0; ii < NLanguage; ii++)
-    {
-        nFonts[ii] = 0;
-        fontnames[ii] = NULL;
-    }
-}
-
-
-HWPFont::~HWPFont(void)
-{
-    for (int ii = 0; ii < NLanguage; ii++)
-    {
-        nFonts[ii] = 0;
-        delete[]fontnames[ii];
-    }
-}
-
-
-int HWPFont::AddFont(int lang, const char *font)
-{
-    int nfonts;
-
-    if (!(lang >= 0 && lang < NLanguage))
-        return 0;
-    nfonts = nFonts[lang];
-    if (MAXFONTS <= nfonts)
-        return 0;
-    strncpy(fontnames[lang] + FONTNAMELEN * nfonts, font, FONTNAMELEN - 1);
-    nFonts[lang]++;
-    return nfonts;
-}
-
-
-const char *HWPFont::GetFontName(int lang, int id)
-{
-    if (!(lang >= 0 && lang < NLanguage))
-        return 0;
-    if (id < 0 || nFonts[lang] <= id)
-        return 0;
-    return fontnames[lang] + id * FONTNAMELEN;
-}
-
-
-static char buffer[FONTNAMELEN];
-
-bool HWPFont::Read(HWPFile & hwpf)
-{
-    int lang = 0;
-    short nfonts = 0;
-
-//printf("HWPFont::Read : lang = %d\n",NLanguage);
-    for(lang = 0; lang < NLanguage; lang++)
-    {
-        hwpf.Read2b(&nfonts, 1);
-        if (!(nfonts > 0 && nfonts < MAXFONTS))
-        {
-            return !hwpf.SetState(HWP_InvalidFileFormat);
-        }
-        fontnames[lang] = new char[nfonts * FONTNAMELEN];
-
-        memset(fontnames[lang], 0, nfonts * FONTNAMELEN);
-        for (int jj = 0; jj < nfonts; jj++)
-        {
-            hwpf.ReadBlock(buffer, FONTNAMELEN);
-            AddFont(lang, buffer);
-        }
-    }
-
-    return !hwpf.State();
-}
diff --git a/main/hwpfilter/source/hfont.h b/main/hwpfilter/source/hfont.h
deleted file mode 100644
index 1327347..0000000
--- a/main/hwpfilter/source/hfont.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hfont.h,v 1.4 2008-06-04 09:57:04 vg Exp $ */
-
-#ifndef _HWPFONTS_H_
-#define _HWPFONTS_H_
-
-#include <stdlib.h>
-#include <string.h>
-
-#define MAXFONTS    256
-#define FONTNAMELEN 40
-
-class HWPFile;
-
-/**
- * The HWPFont class has the font list for the document when it's saved.
- * @short Font information
- */
-class DLLEXPORT HWPFont
-{
-    protected:
-/**
- * System font count for each language
- * NLanguage is 7 in common case.
- */
-        int   nFonts[NLanguage];
-/**
- * list of the font family name
- */
-        char  *fontnames[NLanguage];
-
-    public:
-        HWPFont(void);
-        ~HWPFont(void);
-
-/**
- * Adds a font into font list of a language
- * @param lang Language index
- * @param font Name of font family
- */
-        int       AddFont( int lang, const char *font );
-/**
- * @param lang Language index
- * @param id Index of font
- * @returns Font name
- */
-        const char    *GetFontName( int lang, int id );
-
-        bool Read( HWPFile &hwpf );
-};
-#endif                                            /* _HWPFONTS+H_ */
diff --git a/main/hwpfilter/source/hgzip.cpp b/main/hwpfilter/source/hgzip.cpp
deleted file mode 100644
index c93075d..0000000
--- a/main/hwpfilter/source/hgzip.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#include "precompile.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "hgzip.h"
-#include "hstream.h"
-
-#ifndef local
-#  define local static
-#endif
-
-#define Z_BUFSIZE   (1024 * 4)
-
-#define ALLOC(size) malloc(size)
-#define TRYFREE(p) {if (p) free(p);}
-
-#define ASCII_FLAG   0x01                         /* bit 0 set: file probably ascii text */
-#define HEAD_CRC     0x02                         /* bit 1 set: header CRC present */
-#define EXTRA_FIELD  0x04                         /* bit 2 set: extra field present */
-#define ORIG_NAME    0x08                         /* bit 3 set: original file name present */
-#define COMMENT      0x10                         /* bit 4 set: file comment present */
-#define RESERVED     0xE0                         /* bits 5..7: reserved */
-
-local int get_byte(gz_stream * s);
-local int destroy(gz_stream * s);
-local uLong getLong(gz_stream * s);
-
-/* ===========================================================================
-   Opens a gzip (.gz) file for reading or writing. The mode parameter
-   is as in fopen ("rb" or "wb"). The file is given either by file descriptor
-   or path name (if fd == -1).
-     gz_open return NULL if the file could not be opened or if there was
-   insufficient memory to allocate the (de)compression state; errno
-   can be checked to distinguish the two cases (if errno is zero, the
-   zlib error is Z_MEM_ERROR).
-*/
-gz_stream *gz_open(HStream & _stream)
-{
-    int err;
-    //int level = Z_DEFAULT_COMPRESSION;            /* compression level */
-
-//  char        *p = (char*)mode;
-    //char fmode[80];                               /* copy of mode, without the compression level */
-    //char *m = fmode;
-    gz_stream *s;
-
-    s = (gz_stream *) ALLOC(sizeof(gz_stream));
-    if (!s)
-        return Z_NULL;
-    s->stream.zalloc = (alloc_func) 0;
-    s->stream.zfree = (free_func) 0;
-    s->stream.opaque = (voidpf) 0;
-    s->stream.next_in = s->inbuf = Z_NULL;
-    s->stream.next_out = s->outbuf = Z_NULL;
-    s->stream.avail_in = s->stream.avail_out = 0;
-//s->_inputstream = NULL;
-    s->z_err = Z_OK;
-    s->z_eof = 0;
-    s->crc = crc32(0L, Z_NULL, 0);
-    s->msg = NULL;
-    s->transparent = 0;
-
-    s->mode = 'r';
-
-//realking
-    err = inflateInit2(&(s->stream), -MAX_WBITS);
-    s->stream.next_in = s->inbuf = (Byte *) ALLOC(Z_BUFSIZE);
-
-    if (err != Z_OK || s->inbuf == Z_NULL)
-    {
-        return destroy(s), (gz_stream *) Z_NULL;
-    }
-
-    s->stream.avail_out = Z_BUFSIZE;
-
-    errno = 0;
-    s->_inputstream = &_stream;
-
-    return (gz_stream *) s;
-}
-
-
-/* ===========================================================================
-     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
-   for end of file.
-   IN assertion: the stream s has been sucessfully opened for reading.
-*/
-local int get_byte(gz_stream * s)
-{
-    if (s->z_eof)
-        return EOF;
-    if (s->stream.avail_in == 0)
-    {
-        errno = 0;
-
-        s->stream.avail_in = s->_inputstream->readBytes(s->inbuf, Z_BUFSIZE);
-        if (s->stream.avail_in == 0)
-        {
-            s->z_eof = 1;
-            return EOF;
-        }
-        s->stream.next_in = s->inbuf;
-    }
-    s->stream.avail_in--;
-    return *(s->stream.next_in)++;
-}
-
-
-/* ===========================================================================
- * Cleanup then free the given gz_stream. Return a zlib error code.
- * Try freeing in the reverse order of allocations.
- */
-local int destroy(gz_stream * s)
-{
-    int err = Z_OK;
-
-    if (!s)
-        return Z_STREAM_ERROR;
-
-    TRYFREE(s->msg);
-
-    if (s->stream.state != NULL)
-    {
-        err = inflateEnd(&(s->stream));
-    }
-    if (s->z_err < 0)
-        err = s->z_err;
-
-    TRYFREE(s->inbuf);
-    TRYFREE(s->outbuf);
-    TRYFREE(s);
-    return err;
-}
-
-
-// typedef unsigned char  Byte
-// typedef Byte  FAR Bytef;
-/* ===========================================================================
-   Reads the given number of uncompressed bytes from the compressed file.
-   gz_read returns the number of bytes actually read (0 for end of file).
-*/
-int gz_read(gz_stream * file, voidp buf, unsigned len)
-{
-//printf("@@ gz_read : len : %d\t",len);
-    gz_stream *s = (gz_stream *) file;
-    Bytef *start = (Bytef *) buf;                 /* starting point for crc computation */
-    Byte *next_out;                               /* == stream.next_out but not forced far (for MSDOS) */
-    if (s == NULL)
-        return Z_STREAM_ERROR;
-
-    if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)
-        return -1;
-    if (s->z_err == Z_STREAM_END)
-        return 0;                                 /* EOF */
-
-    s->stream.next_out = next_out = (Bytef *) buf;
-    s->stream.avail_out = len;
-
-    while (s->stream.avail_out != 0)
-    {
-        if (s->transparent)
-        {
-/* Copy first the lookahead bytes: */
-            uInt n = s->stream.avail_in;
-
-            if (n > s->stream.avail_out)
-                n = s->stream.avail_out;
-            if (n > 0)
-            {
-                memcpy(s->stream.next_out, s->stream.next_in, n);
-                next_out += n;
-                s->stream.next_out = next_out;
-                s->stream.next_in += n;
-                s->stream.avail_out -= n;
-                s->stream.avail_in -= n;
-            }
-            if (s->stream.avail_out > 0)
-            {
-                s->stream.avail_out -=
-                    s->_inputstream->readBytes(next_out, s->stream.avail_out);
-            }
-            return (int) (len - s->stream.avail_out);
-        }
-        if (s->stream.avail_in == 0 && !s->z_eof)
-        {
-
-            errno = 0;
-            s->stream.avail_in = s->_inputstream->readBytes(s->inbuf, Z_BUFSIZE);
-            if (s->stream.avail_in == 0)
-            {
-                s->z_eof = 1;
-                break;
-            }
-            s->stream.next_in = s->inbuf;
-        }
-        s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
-
-        if (s->z_err == Z_STREAM_END)
-        {
-/* Check CRC and original size */
-            s->crc = crc32(s->crc, start, (uInt) (s->stream.next_out - start));
-            start = s->stream.next_out;
-
-            if (getLong(s) != s->crc || getLong(s) != s->stream.total_out)
-            {
-                s->z_err = Z_DATA_ERROR;
-            }
-            else if (s->z_err == Z_OK)
-            {
-                inflateReset(&(s->stream));
-                s->crc = crc32(0L, Z_NULL, 0);
-            }
-        }
-        if (s->z_err != Z_OK || s->z_eof)
-            break;
-    }
-    s->crc = crc32(s->crc, start, (uInt) (s->stream.next_out - start));
-    return (int) (len - s->stream.avail_out);
-}
-
-/* ===========================================================================
-     Flushes all pending output into the compressed file. The parameter
-   flush is as in the deflate() function.
-     gz_flush should be called only when strictly necessary because it can
-   degrade compression.
-*/
-int gz_flush(gz_stream * file, int flush)
-{
-    uInt len;
-    int done = 0;
-    gz_stream *s = (gz_stream *) file;
-
-    if (s == NULL || s->mode != 'w')
-        return Z_STREAM_ERROR;
-
-    s->stream.avail_in = 0;                       /* should be zero already anyway */
-
-    for (;;)
-    {
-        len = Z_BUFSIZE - s->stream.avail_out;
-        if (len != 0)
-        {
-/*
-      if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
-    s->z_err = Z_ERRNO;
-    return Z_ERRNO;
-      }
-      */
-            s->stream.next_out = s->outbuf;
-            s->stream.avail_out = Z_BUFSIZE;
-        }
-        if (done)
-            break;
-        s->z_err = deflate(&(s->stream), flush);
-
-/* deflate has finished flushing only when it hasn't used up
- * all the available space in the output buffer:
- */
-        done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
-
-        if (s->z_err != Z_OK && s->z_err != Z_STREAM_END)
-            break;
-    }
-    return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
-}
-
-
-/* ===========================================================================
-   Reads a long in LSB order from the given gz_stream. Sets
-*/
-local uLong getLong(gz_stream * s)
-{
-    uLong x = (uLong) get_byte(s);
-    int c;
-
-    x += ((uLong) get_byte(s)) << 8;
-    x += ((uLong) get_byte(s)) << 16;
-    c = get_byte(s);
-    if (c == EOF)
-        s->z_err = Z_DATA_ERROR;
-    x += ((uLong) c) << 24;
-    return x;
-}
-
-
-/* ===========================================================================
-   Flushes all pending output if necessary, closes the compressed file
-   and deallocates all the (de)compression state.
-*/
-int gz_close(gz_stream * file)
-{
-//  int err;
-    gz_stream *s = (gz_stream *) file;
-
-    if (s == NULL)
-        return Z_STREAM_ERROR;
-#if 0
-    if (s->mode == 'w')
-    {
-        err = gz_flush(file, Z_FINISH);
-        if (err != Z_OK)
-            return destroy(s);
-        putLong(s->file, s->crc);
-        putLong(s->file, s->stream.total_in);
-    }
-#endif
-    return destroy(s);
-}
diff --git a/main/hwpfilter/source/hgzip.h b/main/hwpfilter/source/hgzip.h
deleted file mode 100644
index 64ea2ae..0000000
--- a/main/hwpfilter/source/hgzip.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hgzip.h,v 1.5 2008-06-04 09:57:59 vg Exp $ */
-
-#ifndef _HWPGZIP_H_
-#define _HWPGZIP_H_
-
-// DVO: add zlib/ prefix
-#ifdef SYSTEM_ZLIB
-#include <zlib.h>
-#else
-#include "zlib/zlib.h"
-#endif
-
-class HStream;
-/**
- * @short Structure for using z_stream
- */
-struct gz_stream
-{
-    z_stream stream;
-/**
- * The error code of z_stream operation
- */
-    int      z_err;
-/**
- * EOF of the input file
- */
-    int      z_eof;
-/**
- * Stream
- */
-    HStream*     _inputstream;
-/**
- * Input buffer
- */
-    Byte     *inbuf;
-/**
- * Output buffer
- */
-    Byte     *outbuf;
-/**
- * Crc32 of uncompressed data
- */
-    uLong    crc;
-/**
- * Stream
- */
-    char     *msg;
-/**
- * It becomes one when the input file type is not gz file
- */
-    int      transparent;
-/**
- * 'w' or 'r'
- */
-    char     mode;
-};
-
-/**
- *  Opens a gzipped stream for reading.
- *    gz_open returns NULL if the stream could not be opened or if there was
- *  insufficient memory to allocate the (de)compression state; errno
- *  can be checked to distinguish the two cases (if errno is zero, the
- *  zlib error is Z_MEM_ERROR).
- * @param _stream Reference of stream object having binary data.
- */
-gz_stream   *gz_open    ( HStream& _stream );
-/**
- * Flushes all pending output if necessary, closes the compressed stream
- * and deallocates all the (de)compression state
- */
-int     gz_close    ( gz_stream *file );
-/**
- * Reads the given number of uncompressed bytes from the compressed stream
- * @param file Gzipped stream
- * @param buf Buffer to have the data to be read
- * @param len Length of data to be read
- * @returns The number of bytes actually read
- */
-int     gz_read     ( gz_stream *file, voidp  buf, unsigned len );
-/**
- * Flushes all pending output into the compressed file
- * gz_flush should be called only when strictly necessary because it can
- * degrade compression
- * @param flush Is as in the deflate() function
- */
-int     gz_flush    ( gz_stream *file, int flush );
-#endif                                            /* _HWPGZIP_H_ */
diff --git a/main/hwpfilter/source/hinfo.cpp b/main/hwpfilter/source/hinfo.cpp
deleted file mode 100644
index b444d8e..0000000
--- a/main/hwpfilter/source/hinfo.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hinfo.cpp,v 1.5 2008-06-04 09:58:52 vg Exp $ */
-
-#include    "precompile.h"
-
-#include    "hwplib.h"
-#include    "hinfo.h"
-#include    "hwpfile.h"
-
-// Info Block
-
-//int ParaShape::count = 0;
-//int CharShape::count = 0;
-
-static bool HWPReadInfoBlock(void *ptr, int len, HWPFile & hwpf)
-{
-    hwpf.info_block_len = len;
-    if (0 == len)
-        return true;
-    else
-        return hwpf.ReadBlock(ptr, len) ? true : false;
-}
-
-
-// Document Infomation
-
-HWPInfo::HWPInfo(void)
-{
-    info_block = 0;
-	 back_info.isset = false;
-}
-
-
-HWPInfo::~HWPInfo(void)
-{
-    if (info_block)
-        delete[]info_block;
-    info_block = 0;
-}
-
-
-/**
- * 문서정보를 읽어들이는 함수 ( 128 bytes )
- * 문서정보는 파일인식정보( 30 bytes ) 다음에 위치한 정보이다.
- */
-bool HWPInfo::Read(HWPFile & hwpf)
-{
-    hwpf.Read2b(&cur_col, 1);                     /* 문서를 저장할 당시의 커서가 위치한 문단번호 */
-    hwpf.Read2b(&cur_row, 1);                     /* 문단 칸 */
-
-    hwpf.Read1b(&paper.paper_kind, 1);            /* 용지 종류 */
-    hwpf.Read1b(&paper.paper_direction, 1);       /* 용지 방향 */
-
-// paper geometry information
-    paper.paper_height = (short) hwpf.Read2b();   /* 용지 길이 */
-    paper.paper_width = (short) hwpf.Read2b();    /* 용지 너비 */
-    paper.top_margin = (short) hwpf.Read2b();     /* 위쪽 여백 */
-    paper.bottom_margin = (short) hwpf.Read2b();  /* 아래쪽 여백 */
-    paper.left_margin = (short) hwpf.Read2b();    /* 왼쪽 여백 */
-    paper.right_margin = (short) hwpf.Read2b();   /* 오른쪽 여백 */
-    paper.header_length = (short) hwpf.Read2b();  /* 머리말 길이 */
-    paper.footer_length = (short) hwpf.Read2b();  /* 꼬리말 길이 */
-    paper.gutter_length = (short) hwpf.Read2b();  /* 제본여백 */
-    hwpf.Read2b(&readonly, 1);                    /* 예약 */
-    hwpf.Read1b(reserved1, 4);                    /* 예약 */
-    hwpf.Read1b(&chain_info.chain_page_no, 1);    /* 쪽 번호 연결 1-연결, 0-새로시작 (연결인쇄에서 사용) */
-    hwpf.Read1b(&chain_info.chain_footnote_no, 1);/* 각주번호 연결 1-연결 0-새로시작 */
-                                                  /* 연결인쇄할 파일의 이름 */
-    hwpf.Read1b(chain_info.chain_filename, CHAIN_MAX_PATH);
-
-    hwpf.Read1b(annotation, ANNOTATION_LEN);      /* 덧붙이는 말 ( 파일 저장할 때 덧붙이는 말에 지정한 내용 ) */
-    hwpf.Read2b(&encrypted, 1);                   /* 암호 여부 0-보통파일, 그외-암호걸린 파일 */
-//hwpf.Read1b(reserved2, 6);                      /* 아래 3개의값으로 바뀌었다. */
-    hwpf.Read2b(&beginpagenum,1);                 /* 페이지시작번호 */
-
-// footnote
-    hwpf.Read2b(&beginfnnum,1);                   /* 각주 시작번호 */
-    hwpf.Read2b(&countfn,1);                      /* 각주 갯수 */
-    splinetext = (short) hwpf.Read2b();
-    splinefn = (short) hwpf.Read2b();
-    spfnfn = (short) hwpf.Read2b();
-    hwpf.Read1b(&fnchar, 1);
-    hwpf.Read1b(&fnlinetype, 1);
-// border layout
-    for (int ii = 0; ii < 4; ++ii)
-        bordermargin[ii] = (short) hwpf.Read2b();
-    hwpf.Read2b(&borderline, 1);
-
-    hwpf.Read1b(&empty_line_hide, 1);
-    hwpf.Read1b(&table_move, 1);
-    hwpf.Read1b(&compressed, 1);
-
-    hwpf.Read1b(&reserved3, 1);
-
-    hwpf.Read2b(&info_block_len, 1);
-    if (hwpf.State())
-        return false;
-
-/* 문서 요약을 읽는다. */
-    if (!summary.Read(hwpf))
-        return false;
-    if (info_block_len > 0)
-    {
-        info_block = new unsigned char[info_block_len + 1];
-
-        if (0 == info_block ||
-            !HWPReadInfoBlock(info_block, info_block_len, hwpf))
-            return false;
-    }
-
-/* hwpf의 값을 재설정 한다. */
-    hwpf.compressed = compressed ? true : false;
-    hwpf.encrypted = encrypted ? true : false;
-    hwpf.info_block_len = info_block_len;
-    hwpf.SetCompressed(hwpf.compressed);
-
-    return (!hwpf.State());
-}
-
-
-// Document Summary
-
-bool HWPSummary::Read(HWPFile & hwpf)
-{
-    hwpf.Read2b(title, 56);
-    hwpf.Read2b(subject, 56);
-    hwpf.Read2b(author, 56);
-    hwpf.Read2b(date, 56);
-    hwpf.Read2b(keyword[0], 56);
-    hwpf.Read2b(keyword[1], 56);
-    hwpf.Read2b(etc[0], 56);
-    hwpf.Read2b(etc[1], 56);
-    hwpf.Read2b(etc[2], 56);
-
-    return (!hwpf.State());
-}
-
-
-//
-
-bool ParaShape::Read(HWPFile & hwpf)
-{
-	 pagebreak = 0;
-    left_margin = (short) hwpf.Read2b();
-    right_margin = (short) hwpf.Read2b();
-    indent = (short) hwpf.Read2b();
-    lspacing = (short) hwpf.Read2b();
-    pspacing_next = (short) hwpf.Read2b();
-
-    hwpf.Read1b(&condense, 1);
-    hwpf.Read1b(&arrange_type, 1);
-    for (int ii = 0; ii < MAXTABS; ii++)
-    {
-        hwpf.Read1b(&tabs[ii].type, 1);
-        hwpf.Read1b(&tabs[ii].dot_continue, 1);
-        tabs[ii].position = (short) hwpf.Read2b();
-    }
-    hwpf.Read1b(&coldef.ncols, 1);
-    hwpf.Read1b(&coldef.separator, 1);
-    coldef.spacing = (short) hwpf.Read2b();
-    coldef.columnlen = (short) hwpf.Read2b();
-    coldef.columnlen0 = (short) hwpf.Read2b();
-    hwpf.Read1b(&shade, 1);
-    hwpf.Read1b(&outline, 1);
-    hwpf.Read1b(&outline_continue, 1);
-    pspacing_prev = (short) hwpf.Read2b();
-
-    hwpf.Read1b(reserved, 2);
-    return (!hwpf.State());
-}
-
-
-/*
-CharShape::~CharShape()
-{
-}
-ParaShape::~ParaShape()
-{
-}
-
-*/
-bool CharShape::Read(HWPFile & hwpf)
-{
-//index = ++count;
-    size = (short) hwpf.Read2b();
-    hwpf.Read1b(font, NLanguage);
-    hwpf.Read1b(ratio, NLanguage);
-    hwpf.Read1b(space, NLanguage);
-    hwpf.Read1b(color, 2);
-    hwpf.Read1b(&shade, 1);
-    hwpf.Read1b(&attr, 1);
-    hwpf.Read1b(reserved, 4);
-
-    return (!hwpf.State());
-}
diff --git a/main/hwpfilter/source/hinfo.h b/main/hwpfilter/source/hinfo.h
deleted file mode 100644
index 96198d1..0000000
--- a/main/hwpfilter/source/hinfo.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hinfo.h,v 1.5 2008-06-04 09:59:14 vg Exp $ */
-
-#ifndef _HWPINFO_H_
-#define _HWPINFO_H_
-
-#include "hwplib.h"
-
-#define CHAIN_MAX_PATH  40
-#define ANNOTATION_LEN  24
-
-class HWPFile;
-class CTextOut;
-class CHTMLOut;
-
-/**
- * Information of page (phisical)
- */
-typedef struct
-{
-    unsigned char paper_kind;
-    unsigned char paper_direction;
-    hunit     paper_height;
-    hunit     paper_width;
-    hunit     top_margin;
-    hunit     bottom_margin;
-    hunit     left_margin;
-    hunit     right_margin;
-    hunit     header_length;
-    hunit     footer_length;
-    hunit     gutter_length;
-} PaperInfo;
-
-/* ?????? ??????, ???????? ???? */
-typedef struct
-{
-	 char type;  // 0- background color, 1 - external image, 2- embeded image
-	 char reserved1[8];
-     int luminance; /* ???? ( -100 ~ 100 ) */
-     int contrast; /* ???? ( -100 ~ 100 ) */
-     char effect; /* 0-????????, 1-????????????, 2-???? */
-	 char reserved2[8];
-	 char filename[260 + 1]; // filename
-	 unsigned char color[3]; //0 - red, 1 - green, 2 - blue
-     unsigned short flag; /* 0 - ????????, 1 - ????????, 2 - ??????, 3 - ???????? */
-     int range; /* 0-????, 1-????????, 3-??????, 4-?????? */
-	 char reserved3[27];
-	 int size;
-	 char *data;		// image data
-	 bool isset;
-} PaperBackInfo;
-
-/* ???????? ???? */
-/**
- * Information of printing for chained page
- */
-typedef struct
-{
-    unsigned char chain_page_no;
-    unsigned char chain_footnote_no;
-    unsigned char chain_filename[CHAIN_MAX_PATH];
-} DocChainInfo;
-
-/* ???? ???? */
-/**
- * Summary of document
- */
-struct HWPSummary
-{
-    unsigned short    title[56];
-    unsigned short    subject[56];
-    unsigned short    author[56];
-    unsigned short    date[56];
-    unsigned short    keyword[2][56];
-    unsigned short    etc[3][56];
-
-    bool Read(HWPFile &);
-};
-
-/**
-  HWPInfo class?? HWPFile?? ???? ?????? ???? ???? ??????????.
-  ?????? ???? ???? ????????(layout) ?????? ????????????
-  ????????, ???? ???? ?????? ???????? ????. \\
-
-  HWPInfo ???????? HWPFile?? #GetHWPInfo()# ?????? ???? ???? ?? ????.
-
-  @memo Hwp ???? ????
-*/
-/**
- * Contains the basic information of the hwp document:
- * margin, layout, paper and internal data.
- */
-class DLLEXPORT HWPInfo
-{
-    public:
-/**
- * The column index of a document that is saved at last
- */
-        short     cur_col;
-/**
- * The row index of a document that is saved at last
- */
-        short     cur_row;
-/**
- * Paper Information
- */
-        PaperInfo paper;
-
-		  PaperBackInfo back_info;
-/**
- * Sets the attribute of read-only or read/write.
- */
-        short     readonly;
-        unsigned char reserved1[4];
-/**
- * Information about document chain
- */
-        DocChainInfo  chain_info;
-        unsigned char annotation[ANNOTATION_LEN];
-        short     encrypted;
-// unsigned char	reserved2[6];
-        short     beginpagenum;                   /* ?????????? ???? */
-/**
- * Information about footnote
- */
-        short     beginfnnum;                     /* ???????????? */
-        short     countfn;                        /* ???? ???? */
-        hunit     splinetext, splinefn;
-        hunit     spfnfn;
-        unsigned char fnchar;
-        unsigned char fnlinetype;
-// layout info
-/**
- * Information about page layout
- */
-        hunit     bordermargin[4];
-        short     borderline;
-
-        unsigned char empty_line_hide;
-        unsigned char table_move;
-        unsigned char compressed;
-        unsigned char reserved3;
-        short     info_block_len;
-/* ?????????? 128 ?????????? */
-/**
- * Summary of document
- */
-        HWPSummary    summary;
-        unsigned char *info_block;
-
-        HWPInfo(void);
-        ~HWPInfo(void);
-
-        bool Read(HWPFile &hwpf);
-        bool Write(CTextOut &txtf);
-        bool Write(CHTMLOut &html);
-
-};
-
-/* ???? ???? ?????? */
-/**
- * @short Style of character
- */
-struct CharShape
-{
-/**
- * Index of character style
- */
-    int       index;                              /* ???????? ???????? ????. */
-/**
- * Font size
- */
-    hunit     size;
-    unsigned char font[NLanguage];
-    unsigned char ratio[NLanguage];
-    signed char   space[NLanguage];               /* ???? */
-    unsigned char color[2];
-    unsigned char shade;
-    unsigned char attr;
-    unsigned char reserved[4];
-
-    bool Read(HWPFile &);
-};
-
-/* ?? ?????? ???? ?????? */
-
-#define MAXTABS 40
-/**
- * @short Tab properties
- */
-typedef struct
-{
-    unsigned char type;
-    unsigned char dot_continue;
-    hunit     position;
-} TabSet;
-
-/**
- * @short Column properties
- */
-typedef struct
-{
-    unsigned char ncols;
-    unsigned char separator;
-    hunit     spacing;
-    hunit     columnlen, columnlen0;
-} ColumnDef;
-
-/**
- * @short Style of paragraph
- */
-struct ParaShape
-{
-/**
- * Index of paragraph style
- */
-    int       index;                              /* ???????? ???????? ???? */
-    hunit     left_margin;
-    hunit     right_margin;
-    hunit     indent;
-    hunit     lspacing;
-    hunit     pspacing_prev;
-    hunit     pspacing_next;
-    unsigned char condense;
-    unsigned char arrange_type;
-    TabSet    tabs[MAXTABS];
-    ColumnDef coldef;
-    unsigned char shade;
-    unsigned char outline;
-    unsigned char outline_continue;
-    unsigned char reserved[2];
-    CharShape *cshape;
-	 unsigned char pagebreak;
-
-    bool  Read(HWPFile &);
-//  virtual ~ParaShape();
-};
-#endif                                            /* _HWPINFO_H_ */
diff --git a/main/hwpfilter/source/hiodev.cpp b/main/hwpfilter/source/hiodev.cpp
deleted file mode 100644
index 3810f50..0000000
--- a/main/hwpfilter/source/hiodev.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hiodev.cpp,v 1.6 2008-04-10 12:05:38 rt Exp $ */
-
-#ifdef __GNUG__
-#pragma implementation "hiodev.h"
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-// DVO: add zlib/ prefix
-#ifdef SYSTEM_ZLIB
-#include <zlib.h>
-#else
-#include <zlib/zlib.h>
-#endif
-#ifdef WIN32
-# include <io.h>
-#else
-# include <unistd.h>
-#endif
-
-#include "hwplib.h"
-#include "hgzip.h"
-#include "hiodev.h"
-#include "hwpfile.h"
-#include "hstream.h"
-
-const int BUFSIZE = 1024;
-static uchar rBuf[BUFSIZE];
-
-// HIODev abstract class
-HIODev::HIODev()
-{
-    init();
-}
-
-
-HIODev::~HIODev()
-{
-}
-
-
-void HIODev::init()
-{
-    compressed = false;
-}
-
-
-int HIODev::read1b(void *ptr, int nmemb)
-{
-    uchar *p = (uchar *) ptr;
-    int ii;
-
-    if (state())
-        return -1;
-    for (ii = 0; ii < nmemb; ii++)
-    {
-        p[ii] = sal::static_int_cast<uchar>(read1b());
-        if (state())
-            break;
-    }
-    return ii;
-}
-
-
-int HIODev::read2b(void *ptr, int nmemb)
-{
-    ushort *p = (ushort *) ptr;
-    int ii;
-
-    if (state())
-        return -1;
-    for (ii = 0; ii < nmemb; ii++)
-    {
-        p[ii] = sal::static_int_cast<uchar>(read2b());
-        if (state())
-            break;
-    }
-    return ii;
-}
-
-
-int HIODev::read4b(void *ptr, int nmemb)
-{
-    ulong *p = (ulong *) ptr;
-    int ii;
-
-    if (state())
-        return -1;
-    for (ii = 0; ii < nmemb; ii++)
-    {
-        p[ii] = read4b();
-        if (state())
-            break;
-    }
-    return ii;
-}
-
-
-// hfileiodev class
-HStreamIODev::HStreamIODev(HStream & stream):_stream(stream)
-{
-    init();
-}
-
-
-HStreamIODev::~HStreamIODev()
-{
-    close();
-}
-
-
-void HStreamIODev::init()
-{
-    _gzfp = NULL;
-    compressed = false;
-}
-
-
-bool HStreamIODev::open()
-{
-    if (!(_stream.available()))
-        return false;
-    return true;
-}
-
-
-void HStreamIODev::flush(void)
-{
-    if (_gzfp)
-        gz_flush(_gzfp, Z_FINISH);
-}
-
-
-void HStreamIODev::close(void)
-{
-/* 플러시한 후 닫는다. */
-    this->flush();
-    if (_gzfp)
-        gz_close(_gzfp);                          /* gz_close() calls stream_closeInput() */
-    else
-        _stream.closeInput();
-    _gzfp = NULL;
-}
-
-
-int HStreamIODev::state(void) const
-{
-    return 0;
-}
-
-
-/* zlib 관련 부분 */
-bool HStreamIODev::setCompressed(bool flag)
-{
-    compressed = flag;
-    if (flag == true)
-        return 0 != (_gzfp = gz_open(_stream));
-    else if (_gzfp)
-    {
-        gz_flush(_gzfp, Z_FINISH);
-        gz_close(_gzfp);
-        _gzfp = 0;
-    }
-    return true;
-}
-
-
-// IO routines
-
-#define GZREAD(ptr,len) (_gzfp?gz_read(_gzfp,ptr,len):0)
-
-int HStreamIODev::read1b()
-{
-    int res = (compressed) ? GZREAD(rBuf, 1) : _stream.readBytes(rBuf, 1);
-
-    if (res <= 0)
-        return -1;
-    else
-        return (unsigned char) rBuf[0];
-}
-
-
-int HStreamIODev::read2b()
-{
-    int res = (compressed) ? GZREAD(rBuf, 2) : _stream.readBytes(rBuf, 2);
-
-    if (res <= 0)
-        return -1;
-    else
-        return ((unsigned char) rBuf[1] << 8 | (unsigned char) rBuf[0]);
-}
-
-
-long HStreamIODev::read4b()
-{
-    int res = (compressed) ? GZREAD(rBuf, 4) : _stream.readBytes(rBuf, 4);
-
-    if (res <= 0)
-        return -1;
-    else
-        return ((unsigned char) rBuf[3] << 24 | (unsigned char) rBuf[2] << 16 |
-            (unsigned char) rBuf[1] << 8 | (unsigned char) rBuf[0]);
-}
-
-
-int HStreamIODev::readBlock(void *ptr, int size)
-{
-    int count =
-        (compressed) ? GZREAD(ptr, size) : _stream.readBytes((byte *) ptr,
-
-        size);
-
-    return count;
-}
-
-
-int HStreamIODev::skipBlock(int size)
-{
-    if (compressed){
-		  if( size <= BUFSIZE )
-				return GZREAD(rBuf, size);
-		  else{
-				int remain = size;
-				while(remain){
-					 if( remain > BUFSIZE )
-						  remain -= GZREAD(rBuf, BUFSIZE);
-					 else{
-						  remain -= GZREAD(rBuf, remain);
-						  break;
-					 }
-				}
-				return size - remain;
-		  }
-	 }
-    return _stream.skipBytes(size);
-}
-
-
-HMemIODev::HMemIODev(char *s, int len)
-{
-    init();
-    ptr = (uchar *) s;
-    length = len;
-}
-
-
-HMemIODev::~HMemIODev()
-{
-    close();
-}
-
-
-void HMemIODev::init()
-{
-    ptr = 0;
-    length = 0;
-    pos = 0;
-}
-
-
-bool HMemIODev::open()
-{
-    return true;
-}
-
-
-void HMemIODev::flush(void)
-{
-}
-
-
-void HMemIODev::close(void)
-{
-}
-
-
-int HMemIODev::state(void) const
-{
-    if (pos <= length)
-        return 0;
-    else
-        return -1;
-}
-
-
-bool HMemIODev::setCompressed(bool )
-{
-    return false;
-}
-
-
-int HMemIODev::read1b()
-{
-    if (pos <= length)
-		 return ptr[pos++];
-	 else
-		 return 0;
-}
-
-
-int HMemIODev::read2b()
-{
-    pos += 2;
-    if (pos <= length)
-		 return ptr[pos - 1] << 8 | ptr[pos - 2];
-	 else
-		 return 0;
-}
-
-
-long HMemIODev::read4b()
-{
-    pos += 4;
-    if (pos <= length)
-		 return DWORD(ptr[pos - 1] << 24 | ptr[pos - 2] << 16 |
-        ptr[pos - 3] << 8 | ptr[pos - 4]);
-	 else
-		 return 0;
-}
-
-
-int HMemIODev::readBlock(void *p, int size)
-{
-    if (length < pos + size)
-        size = length - pos;
-    memcpy(p, ptr + pos, size);
-    pos += size;
-    return size;
-}
-
-
-int HMemIODev::skipBlock(int size)
-{
-    if (length < pos + size)
-        return 0;
-    pos += size;
-    return size;
-}
diff --git a/main/hwpfilter/source/hiodev.h b/main/hwpfilter/source/hiodev.h
deleted file mode 100644
index d3d23aa..0000000
--- a/main/hwpfilter/source/hiodev.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/**
- * hwpio.h
- * (C) 1999 Mizi Research, All rights are reserved
- *
- * $Id: hiodev.h,v 1.5 2008-04-10 12:05:55 rt Exp $
- */
-
-#ifndef _HIODEV_H_
-#define _HIODEV_H_
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <stdio.h>
-#include "hwplib.h"
-/**
- * @short Abstract IO class
- */
-class DLLEXPORT HIODev
-{
-    protected:
-        bool compressed;
-        virtual void init();
-    public:
-        HIODev();
-        virtual ~HIODev();
-
-        virtual bool open() = 0;
-        virtual void close() = 0;
-        virtual void flush() = 0;
-        virtual int  state() const = 0;
-/* gzip routine wrapper */
-        virtual bool setCompressed( bool ) = 0;
-
-        virtual int read1b() = 0;
-        virtual int read2b() = 0;
-        virtual long read4b() = 0;
-        virtual int readBlock( void *ptr, int size ) = 0;
-        virtual int skipBlock( int size ) = 0;
-
-        virtual int read1b( void *ptr, int nmemb );
-        virtual int read2b( void *ptr, int nmemb );
-        virtual int read4b( void *ptr, int nmemb );
-};
-
-struct gz_stream;
-
-/* 파일 입출력 장치 */
-
-/**
- * This controls the HStream given by constructor
- * @short Stream IO device
- */
-class HStreamIODev : public HIODev
-{
-    private:
-/* zlib으로 압축을 풀기 위한 자료 구조 */
-        gz_stream *_gzfp;
-        HStream& _stream;
-    public:
-        HStreamIODev(HStream& stream);
-        virtual ~HStreamIODev();
-/**
- * Check whether the stream is available
- */
-        virtual bool open();
-/**
- * Free stream object
- */
-        virtual void close();
-/**
- * If the stream is gzipped, flush the stream.
- */
-        virtual void flush();
-/**
- * Not implemented.
- */
-        virtual int  state() const;
-/**
- * Set whether the stream is compressed or not
- */
-        virtual bool setCompressed( bool );
-/**
- * Read one byte from stream
- */
-        using HIODev::read1b;
-        virtual int read1b();
-/**
- * Read 2 bytes from stream
- */
-        using HIODev::read2b;
-        virtual int read2b();
-/**
- * Read 4 bytes from stream
- */
-        using HIODev::read4b;
-        virtual long read4b();
-/**
- * Read some bytes from stream to given pointer as amount of size
- */
-        virtual int readBlock( void *ptr, int size );
-/**
- * Move current pointer of stream as amount of size
- */
-        virtual int skipBlock( int size );
-    protected:
-/**
- * Initialize this object
- */
-        virtual void init();
-};
-
-/* 메모리 입출력 장치 */
-/**
- * The HMemIODev class controls the Input/Output device.
- * @short Memory IO device
- */
-class HMemIODev : public HIODev
-{
-    uchar *ptr;
-    int pos, length;
-    public:
-        HMemIODev(char *s, int len);
-        virtual ~HMemIODev();
-
-        virtual bool open();
-        virtual void close();
-        virtual void flush();
-        virtual int  state() const;
-/* gzip routine wrapper */
-        virtual bool setCompressed( bool );
-        using HIODev::read1b;
-        virtual int read1b();
-        using HIODev::read2b;
-        virtual int read2b();
-        using HIODev::read4b;
-        virtual long read4b();
-        virtual int readBlock( void *ptr, int size );
-        virtual int skipBlock( int size );
-    protected:
-        virtual void init();
-};
-#endif                                            /* _HIODEV_H_*/
diff --git a/main/hwpfilter/source/hpara.cpp b/main/hwpfilter/source/hpara.cpp
deleted file mode 100644
index f6ba26c..0000000
--- a/main/hwpfilter/source/hpara.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hpara.cpp,v 1.6 2008-06-04 09:59:35 vg Exp $ */
-#define NOMINMAX
-#include "precompile.h"
-
-#include <comphelper/newarray.hxx>
-
-#include "hwplib.h"
-#include "hwpfile.h"
-#include "hpara.h"
-#include "hbox.h"
-#include "hutil.h"
-#include "hutil.h"
-
-bool LineInfo::Read(HWPFile & hwpf, HWPPara *pPara)
-{
-    pos = sal::static_int_cast<unsigned short>(hwpf.Read2b());
-    space_width = (short) hwpf.Read2b();
-    height = (short) hwpf.Read2b();
-// internal informations
-    pgy = (short) hwpf.Read2b();
-    sx = (short) hwpf.Read2b();
-    psx = (short) hwpf.Read2b();
-    pex = (short) hwpf.Read2b();
-    height_sp = 0;
-
-    if( pex >> 15 & 0x01 )
-    {
-		  if( pex & 0x01 )
-				hwpf.AddPage();
-        pPara->pshape.reserved[0] = sal::static_int_cast<unsigned char>(pex & 0x01);
-        pPara->pshape.reserved[1] = sal::static_int_cast<unsigned char>(pex & 0x02);
-    }
-
-    return (!hwpf.State());
-}
-
-
-HWPPara::HWPPara(void)
-{
-    _next = NULL;
-    linfo = NULL;
-    cshapep = NULL;
-    hhstr = NULL;
-    pno = 0;
-
-}
-
-
-HWPPara::~HWPPara(void)
-{
-    int ii;
-
-    if (linfo)
-        delete[]linfo;
-    if (cshapep)
-        delete[]cshapep;
-    if (hhstr)
-    {
-// virtual destructor
-/* C++ should also work on a null. */
-        for (ii = 0; ii < nch; ++ii)
-            delete hhstr[ii];
-
-        delete[]hhstr;
-    }
-
-}
-
-
-int HWPPara::Read(HWPFile & hwpf, unsigned char flag)
-{
-    unsigned char same_cshape;
-    register int ii;
-    scflag = flag;
-// Paragraph Infomation
-    hwpf.Read1b(&reuse_shape, 1);
-    hwpf.Read2b(&nch, 1);
-    hwpf.Read2b(&nline, 1);
-    hwpf.Read1b(&contain_cshape, 1);
-    hwpf.Read1b(&etcflag, 1);
-    hwpf.Read4b(&ctrlflag, 1);
-    hwpf.Read1b(&pstyno, 1);
-
-
-/* Paragraph representative character */
-    cshape.Read(hwpf);
-    if (nch > 0)
-        hwpf.AddCharShape(&cshape);
-
-/* Paragraph paragraph shape */
-    if (nch && !reuse_shape)
-    {
-        pshape.Read(hwpf);
-        pshape.cshape = &cshape;
-		  pshape.pagebreak = etcflag;
-    }
-
-    linfo = ::comphelper::newArray_null<LineInfo>(nline);
-    if (!linfo) { return false; }
-    for (ii = 0; ii < nline; ii++)
-    {
-        linfo[ii].Read(hwpf, this);
-    }
-	 if( etcflag & 0x04 ){
-		 hwpf.AddColumnInfo();
-	 }
-
-    if (nch && !reuse_shape){
-		 if( pshape.coldef.ncols > 1 ){
-			 hwpf.SetColumnDef( &pshape.coldef );
-		 }
-	 }
-
-
-    if( nline > 0 )
-    {
-        begin_ypos = linfo[0].pgy;
-    }
-    else
-    {
-        begin_ypos = 0;
-    }
-
-    if (contain_cshape)
-    {
-        cshapep = ::comphelper::newArray_null<CharShape>(nch);
-        if (!cshapep)
-        {
-            perror("Memory Allocation: cshape\n");
-            return false;
-        }
-
-        for (ii = 0; ii < nch; ii++)
-        {
-
-            hwpf.Read1b(&same_cshape, 1);
-            if (!same_cshape)
-            {
-                cshapep[ii].Read(hwpf);
-                if (nch > 1)
-                    hwpf.AddCharShape(&cshapep[ii]);
-            }
-            else if (ii == 0)
-                cshapep[ii] = cshape;
-            else
-                cshapep[ii] = cshapep[ii - 1];
-        }
-    }
-// read string
-    hhstr = ::comphelper::newArray_null<HBox *>(nch);
-    if (!hhstr) { return false; }
-    for (ii = 0; ii < nch; ii++)
-        hhstr[ii] = 0;
-    ii = 0;
-    while (ii < nch)
-    {
-        if (0 == (hhstr[ii] = readHBox(hwpf)))
-            return false;
-        if (hhstr[ii]->hh == CH_END_PARA)
-            break;
-		  if( hhstr[ii]->hh < CH_END_PARA )
-				pshape.reserved[0] = 0;
-        ii += hhstr[ii]->WSize();
-    }
-    return nch && !hwpf.State();
-}
-
-
-HWPPara *HWPPara::Next(void)
-{
-    return _next;
-}
-
-
-CharShape *HWPPara::GetCharShape(int pos)
-{
-    if (contain_cshape == 0)
-        return &cshape;
-    return cshapep + pos;
-}
-
-
-ParaShape *HWPPara::GetParaShape(void)
-{
-    return &pshape;
-}
-
-
-HBox *HWPPara::readHBox(HWPFile & hwpf)
-{
-    hchar hh = sal::static_int_cast<hchar>(hwpf.Read2b());
-    HBox *hbox = 0;
-
-    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))
-        hbox = new SkipBlock(hh);
-    else
-    {
-        switch (hh)
-        {
-            case CH_FIELD:                        // 5
-                hbox = new FieldCode;
-                break;
-            case CH_BOOKMARK:                     // 6
-                hbox = new Bookmark;
-                break;
-            case CH_DATE_FORM:                    // 7
-                hbox = new DateFormat;
-                break;
-            case CH_DATE_CODE:                    // 8
-                hbox = new DateCode;
-                break;
-            case CH_TAB:                          // 9
-                hbox = new Tab;
-                break;
-            case CH_TEXT_BOX:                     // 10
-                hbox = new TxtBox;
-                break;
-            case CH_PICTURE:                      // 11
-                hbox = new Picture;
-                break;
-            case CH_LINE:                         // 14
-                hbox = new Line;
-                break;
-            case CH_HIDDEN:                       // 15
-                hbox = new Hidden;
-                break;
-            case CH_HEADER_FOOTER:                // 16
-                hbox = new HeaderFooter;
-                break;
-            case CH_FOOTNOTE:                     // 17
-                hbox = new Footnote;
-                break;
-            case CH_AUTO_NUM:                     // 18
-                hbox = new AutoNum;
-                break;
-            case CH_NEW_NUM:                      // 19
-                hbox = new NewNum;
-                break;
-            case CH_SHOW_PAGE_NUM:                // 20
-                hbox = new ShowPageNum;
-                break;
-            case CH_PAGE_NUM_CTRL:                // 21
-                hbox = new PageNumCtrl;
-                break;
-            case CH_MAIL_MERGE:                   // 22
-                hbox = new MailMerge;
-                break;
-            case CH_COMPOSE:                      // 23
-                hbox = new Compose;
-                break;
-            case CH_HYPHEN:                       // 24
-                hbox = new Hyphen;
-                break;
-            case CH_TOC_MARK:                     // 25
-                hbox = new TocMark;
-                break;
-            case CH_INDEX_MARK:                   // 26
-                hbox = new IndexMark;
-                break;
-            case CH_OUTLINE:                      // 28
-                hbox = new Outline;
-                break;
-            case CH_KEEP_SPACE:                   // 30
-                hbox = new KeepSpace;
-                break;
-            case CH_FIXED_SPACE:                  // 31
-                hbox = new FixedSpace;
-                break;
-            default:
-                break;
-        }
-    }
-    if (!hbox || !hbox->Read(hwpf))
-    {
-        delete hbox;
-
-        return 0;
-    }
-    if( hh == CH_TEXT_BOX || hh == CH_PICTURE || hh == CH_LINE )
-    {
-        FBox *fbox = static_cast<FBox *>(hbox);
-        if( ( fbox->style.anchor_type == 1) && ( fbox->pgy >= begin_ypos) )
-        {
-            //strange construct to compile without warning
-            int nTemp = fbox->pgy;
-            nTemp -= begin_ypos;
-            fbox->pgy = sal::static_int_cast<short>(nTemp);
-        }
-    }
-    return hbox;
-//return 0;
-}
diff --git a/main/hwpfilter/source/hpara.h b/main/hwpfilter/source/hpara.h
deleted file mode 100644
index 436fb8e..0000000
--- a/main/hwpfilter/source/hpara.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-/* $Id: hpara.h,v 1.5 2008-06-04 09:59:48 vg Exp $ */
-
-#ifndef _HWPPARA_H_
-#define _HWPPARA_H_
-
-#include <hwplib.h>
-#include <hwpfile.h>
-#include <hinfo.h>
-
-struct HBox;
-
-/**
- * etc flag
- * 0 bit : Use page columns
- * 1 bit : Use page lows
- * 2 bit : Use section break
- * 3 bit : Block start
- * 4 bit : In Block
- * 5 bit : Block end
- * 6 bit : Preserve widow orphan
- * 7 bit : Reserved
- */
-enum
-{
-    PA_USER_COLUMN    =   1,
-    PA_USER_PAGE      =   2,                      /* p user_page definiton */
-    PA_SECTION_BREAK  =   4,
-    PA_BLOCK_BEGIN    =   8,
-    PA_IN_BLOCK       =   16,
-    PA_BLOCK_END      =   32,
-    PA_WIDOW_ORPHAN   =   64
-};
-
-class HWPPara;
-#define FIXED_SPACING_BIT (0x8000)
-
-struct LineInfo
-{
-/* 시작하는 글자의 위치 : 콘트롤은 여러 길이를 가진다 */
-/**
- * Starting character position
- */
-    unsigned short    pos;
-    hunit         space_width;
-    hunit         height;
-    hunit         pgy;                            /* internal */
-    hunit         sx;                             /* internal */
-    hunit         psx;                            /* internal */
-    hunit         pex;                            /* internal */
-// for formating
-    hunit         height_sp;
-    unsigned short    softbreak;                  // column, page, section
-
-    bool  Read(HWPFile &hwpf, HWPPara *para);
-};
-/**
- * It represents the paragraph.
- * @short Paragraph
- */
-class DLLEXPORT HWPPara
-{
-    private:
-        HWPPara       *_next;
-
-    public:
-// paragraph information
-/**
- * Zero is for the new paragraph style.
- */
-        unsigned char     reuse_shape;            /* 0이면 새모양 */
-        unsigned short    nch;
-        unsigned short    nline;
-
-// realking
-        hunit         begin_ypos;
-        unsigned char     scflag;
-
-/**
- * If the value is 0, all character of paragraph have same style given cshape
- */
-        unsigned char     contain_cshape;         /* 0이면 모든 글자가 대표 글자 모양 */
-        unsigned char     etcflag;
-/**
- * Checks the special characters in the paragraph
- */
-        unsigned long     ctrlflag;
-        unsigned char     pstyno;
-        CharShape     cshape;                     /* 글자가 모두 같은 모양일때	*/
-        ParaShape     pshape;                     /* reuse flag가 0이면		*/
-        int           pno;                        /* run-time only		*/
-
-        LineInfo      *linfo;
-        CharShape     *cshapep;
-/**
- * Box object list
- */
-        HBox          **hhstr;
-
-        HWPPara(void);
-        ~HWPPara(void);
-
-        int   Read(HWPFile &hwpf, unsigned char flag = 0);
-        int   Write(CTextOut &txtf);
-        int   Write(CHTMLOut &html);
-
-        void  SetNext(HWPPara *n) { _next = n; };
-
-/* layout을 위한 함수 */
-/**
- * Returns the character sytle of paragraph.
- */
-        CharShape *GetCharShape(int pos);
-/**
- * Returns the sytle of paragraph.
- */
-        ParaShape *GetParaShape(void);
-
-/**
- * Returns previous paragraph.
- */
-        HWPPara *Prev(void);
-/**
- * Returns next paragraph.
- */
-        HWPPara *Next(void);
-
-        int HomePos(int line) const;
-        int EndPos(int line) const;
-        int LineLen(int line) const;
-
-    private:
-        HBox *readHBox(HWPFile &);
-};
-
-// inline functions
-
-inline int HWPPara::HomePos(int line) const
-{
-    if( nline < line + 1 ) return nch;
-    return linfo[line].pos;
-}
-
-
-inline int HWPPara::EndPos(int line) const
-{
-    if( nline <= line + 1 ) return nch;
-    else return HomePos(line + 1);
-}
-
-
-inline int HWPPara::LineLen(int line) const
-{
-    return EndPos(line) - HomePos(line);
-}
-#endif                                            /* _HWPPARA_H_ */
diff --git a/main/hwpfilter/source/hstream.cpp b/main/hwpfilter/source/hstream.cpp
deleted file mode 100644
index 45b200d..0000000
--- a/main/hwpfilter/source/hstream.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/**************************************************************
- * 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * 
- *************************************************************/
-
-
-
-#include <string.h>
-#include <stdlib.h>
-#include "hstream.h"
-
-HStream::HStream() : size(0), pos(0)
-{
-    seq = 0;
-}
-
-
-HStream::~HStream()
-{
-    if( seq )
-        free( seq );
-}
-
-
-void HStream::addData( const byte *buf, int aToAdd)
-{
-    seq = (byte *)realloc( seq, size + aToAdd );
-    memcpy( seq + size, buf, aToAdd );
-    size += aToAdd;
-}
-
-
-int HStream::readBytes(byte * buf, int aToRead)
-{
-    if (aToRead >= (size - pos))
-        aToRead = size - pos;
-    for (int i = 0; i < aToRead; i++)
-        buf[i] = seq[pos++];
-    return aToRead;
-}
-
-
-int HStream::skipBytes(int aToSkip)
-{
-    if (aToSkip >= (size - pos))
-        aToSkip = size - pos;
-    pos += aToSkip;
... 14061 lines suppressed ...