]> git.lyx.org Git - lyx.git/blobdiff - src/support/unicode.C
remove unused stuff
[lyx.git] / src / support / unicode.C
index f5518b4f0beb6a1bf159f3e58e6d6c58158ee1d1..fcb47ca56d8c3b45d5deb621ac58438e72018385 100644 (file)
@@ -39,6 +39,15 @@ static const iconv_t invalid_cd = (iconv_t)(-1);
 
 struct IconvProcessor::Private {
        Private(): cd(invalid_cd) {}
+       ~Private()
+       {
+               if (cd != invalid_cd) {
+                       if (iconv_close(cd) == -1) {
+                               lyxerr << "Error returned from iconv_close("
+                                      << errno << ")" << endl;
+                       }
+               }
+       }
        iconv_t cd;
 };
 
@@ -50,16 +59,27 @@ IconvProcessor::IconvProcessor(char const * tocode,
 }
 
 
-IconvProcessor::~IconvProcessor()
+IconvProcessor::IconvProcessor(IconvProcessor const & other)
+       : tocode_(other.tocode_), fromcode_(other.fromcode_),
+         pimpl_(new IconvProcessor::Private)
 {
-       if (iconv_close(pimpl_->cd) == -1) {
-               lyxerr << "Error returned from iconv_close("
-                       << errno << ")" << endl;
-       }
-       delete pimpl_;
 }
 
 
+IconvProcessor & IconvProcessor::operator=(IconvProcessor const & other)
+{
+       if (&other == this)
+               return *this;
+       tocode_ = other.tocode_;
+       fromcode_ = other.fromcode_;
+       pimpl_.reset(new Private);
+       return *this;
+}
+
+
+IconvProcessor::~IconvProcessor() {}
+
+
 bool IconvProcessor::init()
 {
        if (pimpl_->cd != invalid_cd)