From 27be81819064cb96d98c881f45d6e3fbdf7a33d0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 15 Sep 2016 12:43:01 +0200 Subject: loplugin:singlevalfields in l10ntools..sax and ignore URE headers in the plugin Change-Id: I939df744c1173cf0f67d515f6c3fb4ac4cb25588 --- sax/source/expatwrap/xml2utf.cxx | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'sax/source') diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx index 0c3e96564ab7..361e02fc99b0 100644 --- a/sax/source/expatwrap/xml2utf.cxx +++ b/sax/source/expatwrap/xml2utf.cxx @@ -92,7 +92,7 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence &seq , sal_In // do the encoding if( m_pText2Unicode && m_pUnicode2Text && - m_pText2Unicode->canContinue() && m_pUnicode2Text->canContinue() ) { + m_pText2Unicode->canContinue() ) { Sequence seqUnicode = m_pText2Unicode->convert( seq ); seq = m_pUnicode2Text->convert( seqUnicode.getConstArray(), seqUnicode.getLength() ); @@ -447,16 +447,16 @@ Sequence Text2UnicodeConverter::convert( const Sequence & Unicode2TextConverter::Unicode2TextConverter( rtl_TextEncoding encoding ) { - init( encoding ); + m_convUnicode2Text = rtl_createUnicodeToTextConverter( encoding ); + m_contextUnicode2Text = rtl_createUnicodeToTextContext( m_convUnicode2Text ); + m_rtlEncoding = encoding; } Unicode2TextConverter::~Unicode2TextConverter() { - if( m_bInitialized ) { - rtl_destroyUnicodeToTextContext( m_convUnicode2Text , m_contextUnicode2Text ); - rtl_destroyUnicodeToTextConverter( m_convUnicode2Text ); - } + rtl_destroyUnicodeToTextContext( m_convUnicode2Text , m_contextUnicode2Text ); + rtl_destroyUnicodeToTextConverter( m_convUnicode2Text ); } @@ -536,17 +536,6 @@ Sequence Unicode2TextConverter::convert(const sal_Unicode *puSource , return seqText; } -void Unicode2TextConverter::init( rtl_TextEncoding encoding ) -{ - m_bCanContinue = true; - m_bInitialized = true; - - m_convUnicode2Text = rtl_createUnicodeToTextConverter( encoding ); - m_contextUnicode2Text = rtl_createUnicodeToTextContext( m_convUnicode2Text ); - m_rtlEncoding = encoding; -}; - - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit