these don't need to be fields on the class

Change-Id: I6f8bab0b9c286270f1e896629379762e38d448c5
Reviewed-on: https://gerrit.libreoffice.org/23120
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-03-10 16:40:36 +02:00
parent e7e1d50fc0
commit 7f1d68a798
2 changed files with 11 additions and 30 deletions

View File

@@ -34,19 +34,12 @@ using namespace com::sun::star::xml::sax;
using namespace com::sun::star; using namespace com::sun::star;
using namespace std; using namespace std;
static const OUString sNode( "node" );
static const OUString sName( "oor:name" );
static const OUString sUIName( "UIName" );
static const OUString sData( "Data" );
TypeDetectionImporter::TypeDetectionImporter() TypeDetectionImporter::TypeDetectionImporter()
: sRootNode( "oor:component-data" ),
sNode( "node" ),
sName( "oor:name" ),
sProp( "prop" ),
sValue( "value" ),
sUIName( "UIName" ),
sData( "Data" ),
sFilters( "Filters" ),
sTypes( "Types" ),
sFilterAdaptorService( "com.sun.star.comp.Writer.XmlFilterAdaptor" ),
sXSLTFilterService( "com.sun.star.documentconversion.XSLTFilter" )
{ {
} }
@@ -200,10 +193,10 @@ filter_info_impl* TypeDetectionImporter::createFilterForNode( Node * pNode )
if( pFilter->maFlags == 0 ) if( pFilter->maFlags == 0 )
bOk = false; bOk = false;
if( aFilterService != sFilterAdaptorService ) if( aFilterService != "com.sun.star.comp.Writer.XmlFilterAdaptor" )
bOk = false; bOk = false;
if( aAdapterService != sXSLTFilterService ) if( aAdapterService != "com.sun.star.documentconversion.XSLTFilter" )
bOk = false; bOk = false;
if( pFilter->maExtension.isEmpty() ) if( pFilter->maExtension.isEmpty() )
@@ -236,7 +229,7 @@ void SAL_CALL TypeDetectionImporter::startElement( const OUString& aName, const
if( maStack.empty() ) if( maStack.empty() )
{ {
// #109668# support legacy name as well on import // #109668# support legacy name as well on import
if( aName == sRootNode || aName == "oor:node" ) if( aName == "oor:component-data" || aName == "oor:node" )
{ {
eNewState = e_Root; eNewState = e_Root;
} }
@@ -247,11 +240,11 @@ void SAL_CALL TypeDetectionImporter::startElement( const OUString& aName, const
{ {
OUString aNodeName( xAttribs->getValueByName( sName ) ); OUString aNodeName( xAttribs->getValueByName( sName ) );
if( aNodeName == sFilters ) if( aNodeName == "Filters" )
{ {
eNewState = e_Filters; eNewState = e_Filters;
} }
else if( aNodeName == sTypes ) else if( aNodeName == "Types" )
{ {
eNewState = e_Types; eNewState = e_Types;
} }
@@ -268,7 +261,7 @@ void SAL_CALL TypeDetectionImporter::startElement( const OUString& aName, const
} }
else if( (maStack.top() == e_Filter) || (maStack.top() == e_Type)) else if( (maStack.top() == e_Filter) || (maStack.top() == e_Type))
{ {
if( aName == sProp ) if( aName == "prop" )
{ {
maPropertyName = xAttribs->getValueByName( sName ); maPropertyName = xAttribs->getValueByName( sName );
eNewState = e_Property; eNewState = e_Property;
@@ -276,7 +269,7 @@ void SAL_CALL TypeDetectionImporter::startElement( const OUString& aName, const
} }
else if( maStack.top() == e_Property ) else if( maStack.top() == e_Property )
{ {
if( aName == sValue ) if( aName == "value" )
{ {
eNewState = e_Value; eNewState = e_Value;
maValue.clear(); maValue.clear();

View File

@@ -97,18 +97,6 @@ private:
OUString maValue; OUString maValue;
OUString maNodeName; OUString maNodeName;
OUString maPropertyName; OUString maPropertyName;
const OUString sRootNode;
const OUString sNode;
const OUString sName;
const OUString sProp;
const OUString sValue;
const OUString sUIName;
const OUString sData;
const OUString sFilters;
const OUString sTypes;
const OUString sFilterAdaptorService;
const OUString sXSLTFilterService;
}; };
#endif #endif