Kaydet (Commit) c110bfc8 authored tarafından Noel Grandin's avatar Noel Grandin

convert CallbackType to scoped enum

and drop unused INVALID constant

Change-Id: Ifbfaeb209ed75af99f8e531105b9f23541034648
Reviewed-on: https://gerrit.libreoffice.org/63890
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d112ffd5
...@@ -280,8 +280,6 @@ linguistic/source/defs.hxx:85 ...@@ -280,8 +280,6 @@ linguistic/source/defs.hxx:85
enum LinguDispatcher::DspType DSP_SPELL enum LinguDispatcher::DspType DSP_SPELL
reportdesign/source/ui/inc/ReportDefines.hxx:24 reportdesign/source/ui/inc/ReportDefines.hxx:24
enum rptui::DlgEdMode Test enum rptui::DlgEdMode Test
sax/source/fastparser/fastparser.cxx:80
enum (anonymous namespace)::CallbackType INVALID
sc/source/filter/excel/xiescher.cxx:460 sc/source/filter/excel/xiescher.cxx:460
enum (anonymous at /home/noel/libo2/sc/source/filter/excel/xiescher.cxx:460:17) eCreateFromOffice enum (anonymous at /home/noel/libo2/sc/source/filter/excel/xiescher.cxx:460:17) eCreateFromOffice
sc/source/filter/inc/decl.h:24 sc/source/filter/inc/decl.h:24
...@@ -390,10 +388,6 @@ sw/source/ui/fldui/fldref.cxx:767 ...@@ -390,10 +388,6 @@ sw/source/ui/fldui/fldref.cxx:767
enum FMT_REF_IDX FMT_REF_ONLYNUMBER_IDX enum FMT_REF_IDX FMT_REF_ONLYNUMBER_IDX
sw/source/ui/fldui/fldref.cxx:768 sw/source/ui/fldui/fldref.cxx:768
enum FMT_REF_IDX FMT_REF_ONLYCAPTION_IDX enum FMT_REF_IDX FMT_REF_ONLYCAPTION_IDX
sw/source/uibase/docvw/edtwin.cxx:1570
enum SwKeyState ColTopBig
sw/source/uibase/docvw/edtwin.cxx:1571
enum SwKeyState ColTopSmall
sw/source/uibase/utlui/content.cxx:824 sw/source/uibase/utlui/content.cxx:824
enum STR_CONTEXT_IDX IDX_STR_LINK_REGION enum STR_CONTEXT_IDX IDX_STR_LINK_REGION
sw/source/uibase/utlui/content.cxx:825 sw/source/uibase/utlui/content.cxx:825
......
...@@ -77,7 +77,7 @@ struct EventList ...@@ -77,7 +77,7 @@ struct EventList
bool mbIsAttributesEmpty; bool mbIsAttributesEmpty;
}; };
enum CallbackType { INVALID, START_ELEMENT, END_ELEMENT, CHARACTERS, PROCESSING_INSTRUCTION, DONE, EXCEPTION }; enum class CallbackType { START_ELEMENT, END_ELEMENT, CHARACTERS, PROCESSING_INSTRUCTION, DONE, EXCEPTION };
struct Event struct Event
{ {
...@@ -295,7 +295,7 @@ private: ...@@ -295,7 +295,7 @@ private:
catch (...) catch (...)
{ {
Entity &rEntity = mpParser->getEntity(); Entity &rEntity = mpParser->getEntity();
rEntity.getEvent( EXCEPTION ); rEntity.getEvent( CallbackType::EXCEPTION );
mpParser->produce( true ); mpParser->produce( true );
} }
} }
...@@ -985,22 +985,22 @@ bool FastSaxParserImpl::consume(EventList& rEventList) ...@@ -985,22 +985,22 @@ bool FastSaxParserImpl::consume(EventList& rEventList)
{ {
switch ((*aEventIt).maType) switch ((*aEventIt).maType)
{ {
case START_ELEMENT: case CallbackType::START_ELEMENT:
rEntity.startElement( &(*aEventIt) ); rEntity.startElement( &(*aEventIt) );
break; break;
case END_ELEMENT: case CallbackType::END_ELEMENT:
rEntity.endElement(); rEntity.endElement();
break; break;
case CHARACTERS: case CallbackType::CHARACTERS:
rEntity.characters( (*aEventIt).msChars ); rEntity.characters( (*aEventIt).msChars );
break; break;
case PROCESSING_INSTRUCTION: case CallbackType::PROCESSING_INSTRUCTION:
rEntity.processingInstruction( rEntity.processingInstruction(
(*aEventIt).msNamespace, (*aEventIt).msElementName ); // ( target, data ) (*aEventIt).msNamespace, (*aEventIt).msElementName ); // ( target, data )
break; break;
case DONE: case CallbackType::DONE:
return false; return false;
case EXCEPTION: case CallbackType::EXCEPTION:
rEntity.throwException( mxDocumentLocator, false ); rEntity.throwException( mxDocumentLocator, false );
SAL_FALLTHROUGH; // avoid unreachable code warning with some compilers SAL_FALLTHROUGH; // avoid unreachable code warning with some compilers
default: default:
...@@ -1094,7 +1094,7 @@ void FastSaxParserImpl::parse() ...@@ -1094,7 +1094,7 @@ void FastSaxParserImpl::parse()
rEntity.throwException( mxDocumentLocator, true ); rEntity.throwException( mxDocumentLocator, true );
} }
} while( nRead > 0 ); } while( nRead > 0 );
rEntity.getEvent( DONE ); rEntity.getEvent( CallbackType::DONE );
if( rEntity.mbEnableThreads ) if( rEntity.mbEnableThreads )
produce( true ); produce( true );
} }
...@@ -1117,7 +1117,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm ...@@ -1117,7 +1117,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
} }
// create attribute map and process namespace instructions // create attribute map and process namespace instructions
Event& rEvent = rEntity.getEvent( START_ELEMENT ); Event& rEvent = rEntity.getEvent( CallbackType::START_ELEMENT );
bool bIsAttributesEmpty = false; bool bIsAttributesEmpty = false;
if ( rEntity.mbEnableThreads ) if ( rEntity.mbEnableThreads )
bIsAttributesEmpty = rEntity.getEventList().mbIsAttributesEmpty; bIsAttributesEmpty = rEntity.getEventList().mbIsAttributesEmpty;
...@@ -1285,7 +1285,7 @@ void FastSaxParserImpl::callbackEndElement() ...@@ -1285,7 +1285,7 @@ void FastSaxParserImpl::callbackEndElement()
if( !rEntity.maNamespaceStack.empty() ) if( !rEntity.maNamespaceStack.empty() )
rEntity.maNamespaceStack.pop(); rEntity.maNamespaceStack.pop();
rEntity.getEvent( END_ELEMENT ); rEntity.getEvent( CallbackType::END_ELEMENT );
if (rEntity.mbEnableThreads) if (rEntity.mbEnableThreads)
produce(); produce();
else else
...@@ -1314,7 +1314,7 @@ void FastSaxParserImpl::sendPendingCharacters() ...@@ -1314,7 +1314,7 @@ void FastSaxParserImpl::sendPendingCharacters()
OUString sChars( pendingCharacters.data(), pendingCharacters.size(), RTL_TEXTENCODING_UTF8 ); OUString sChars( pendingCharacters.data(), pendingCharacters.size(), RTL_TEXTENCODING_UTF8 );
if (rEntity.mbEnableThreads) if (rEntity.mbEnableThreads)
{ {
Event& rEvent = rEntity.getEvent( CHARACTERS ); Event& rEvent = rEntity.getEvent( CallbackType::CHARACTERS );
rEvent.msChars = sChars; rEvent.msChars = sChars;
produce(); produce();
} }
...@@ -1328,7 +1328,7 @@ void FastSaxParserImpl::callbackProcessingInstruction( const xmlChar *target, co ...@@ -1328,7 +1328,7 @@ void FastSaxParserImpl::callbackProcessingInstruction( const xmlChar *target, co
if (!pendingCharacters.empty()) if (!pendingCharacters.empty())
sendPendingCharacters(); sendPendingCharacters();
Entity& rEntity = getEntity(); Entity& rEntity = getEntity();
Event& rEvent = rEntity.getEvent( PROCESSING_INSTRUCTION ); Event& rEvent = rEntity.getEvent( CallbackType::PROCESSING_INSTRUCTION );
// This event is very rare, so no need to waste extra space for this // This event is very rare, so no need to waste extra space for this
// Using namespace and element strings to be target and data in that order. // Using namespace and element strings to be target and data in that order.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment