diff options
Diffstat (limited to 'filter/source/xsltdialog/typedetectionexport.cxx')
-rw-r--r-- | filter/source/xsltdialog/typedetectionexport.cxx | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/filter/source/xsltdialog/typedetectionexport.cxx b/filter/source/xsltdialog/typedetectionexport.cxx index 30c4f894bf9c..253be6f8a5a6 100644 --- a/filter/source/xsltdialog/typedetectionexport.cxx +++ b/filter/source/xsltdialog/typedetectionexport.cxx @@ -25,7 +25,7 @@ #include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <tools/urlobj.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include "typedetectionexport.hxx" #include "xmlfiltercommon.hxx" @@ -79,18 +79,17 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co { try { - static const OUStringLiteral sComponentData ( u"oor:component-data" ); - static const OUStringLiteral sNode ( u"node" ); - static const OUStringLiteral sName ( u"oor:name" ); - static const OUStringLiteral sWhiteSpace ( u" " ); - static const OUStringLiteral sUIName ( u"UIName" ); - static const OUStringLiteral sComma ( u"," ); - static const OUStringLiteral sDelim ( u";" ); - static const OUStringLiteral sData ( u"Data" ); - static const OUStringLiteral sDocTypePrefix ( u"doctype:" ); - static const OUStringLiteral sFilterAdaptorService( u"com.sun.star.comp.Writer.XmlFilterAdaptor" ); - static const OUStringLiteral sXSLTFilterService ( u"com.sun.star.documentconversion.XSLTFilter" ); - static const OUStringLiteral sCdataAttribute ( u"CDATA" ); + static constexpr OUString sComponentData ( u"oor:component-data"_ustr ); + static constexpr OUString sNode ( u"node"_ustr ); + static constexpr OUString sName ( u"oor:name"_ustr ); + static constexpr OUString sWhiteSpace ( u" "_ustr ); + static constexpr OUString sUIName ( u"UIName"_ustr ); + static constexpr OUString sComma ( u","_ustr ); + static constexpr OUString sDelim ( u";"_ustr ); + static constexpr OUString sData ( u"Data"_ustr ); + static constexpr OUStringLiteral sDocTypePrefix ( u"doctype:" ); + static constexpr OUStringLiteral sFilterAdaptorService( u"com.sun.star.comp.Writer.XmlFilterAdaptor" ); + static constexpr OUStringLiteral sXSLTFilterService ( u"com.sun.star.documentconversion.XSLTFilter" ); // set up sax writer and connect to given output stream @@ -98,10 +97,10 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co xHandler->setOutputStream( xOS ); rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "xmlns:oor", sCdataAttribute, "http://openoffice.org/2001/registry" ); - pAttrList->AddAttribute ( "xmlns:xs", sCdataAttribute, "http://www.w3.org/2001/XMLSchema" ); - pAttrList->AddAttribute ( sName, sCdataAttribute, "TypeDetection" ); - pAttrList->AddAttribute ( "oor:package", sCdataAttribute, "org.openoffice.Office" ); + pAttrList->AddAttribute ( u"xmlns:oor"_ustr, u"http://openoffice.org/2001/registry"_ustr ); + pAttrList->AddAttribute ( u"xmlns:xs"_ustr, u"http://www.w3.org/2001/XMLSchema"_ustr ); + pAttrList->AddAttribute ( sName, u"TypeDetection"_ustr ); + pAttrList->AddAttribute ( u"oor:package"_ustr, u"org.openoffice.Office"_ustr ); xHandler->startDocument(); xHandler->ignorableWhitespace ( sWhiteSpace ); @@ -110,14 +109,14 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co // export types { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( sName, sCdataAttribute, "Types" ); + pAttrList->AddAttribute ( sName, u"Types"_ustr ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); for (auto const& filter : rFilters) { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute( sName, sCdataAttribute, filter->maType ); + pAttrList->AddAttribute( sName, filter->maType ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); OUString sValue = "0" + sComma + sComma; @@ -141,14 +140,14 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co // export filters { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( sName, sCdataAttribute, "Filters" ); + pAttrList->AddAttribute ( sName, u"Filters"_ustr ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); for (auto const& filter : rFilters) { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute( sName, sCdataAttribute, filter->maFilterName ); + pAttrList->AddAttribute( sName, filter->maFilterName ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); addLocaleProperty( xHandler, sUIName, filter->maInterfaceName ); @@ -207,14 +206,13 @@ void TypeDetectionExporter::addProperty( const Reference< XWriter >& xHandler, c { try { - static const OUStringLiteral sCdataAttribute( u"CDATA" ); - static const OUStringLiteral sProp( u"prop" ); - static const OUStringLiteral sValue( u"value" ); - static const OUStringLiteral sWhiteSpace ( u" " ); + static constexpr OUString sProp( u"prop"_ustr ); + static constexpr OUString sValue( u"value"_ustr ); + static constexpr OUString sWhiteSpace ( u" "_ustr ); rtl::Reference<::comphelper::AttributeList>pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "oor:name", sCdataAttribute, rName ); - pAttrList->AddAttribute ( "oor:type", sCdataAttribute, "xs:string" ); + pAttrList->AddAttribute ( u"oor:name"_ustr, rName ); + pAttrList->AddAttribute ( u"oor:type"_ustr, u"xs:string"_ustr ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sProp, pAttrList ); @@ -235,19 +233,18 @@ void TypeDetectionExporter::addLocaleProperty( const Reference< XWriter >& xHand { try { - static const OUStringLiteral sCdataAttribute( u"CDATA" ); - static const OUStringLiteral sProp( u"prop" ); - static const OUStringLiteral sValue( u"value" ); - static const OUStringLiteral sWhiteSpace ( u" " ); + static constexpr OUString sProp( u"prop"_ustr ); + static constexpr OUString sValue( u"value"_ustr ); + static constexpr OUString sWhiteSpace ( u" "_ustr ); rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "oor:name", sCdataAttribute, rName ); - pAttrList->AddAttribute ( "oor:type", sCdataAttribute, "xs:string" ); + pAttrList->AddAttribute ( u"oor:name"_ustr, rName ); + pAttrList->AddAttribute ( u"oor:type"_ustr, u"xs:string"_ustr ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sProp, pAttrList ); pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "xml:lang", sCdataAttribute, "en-US" ); + pAttrList->AddAttribute ( u"xml:lang"_ustr, u"en-US"_ustr ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sValue, pAttrList ); xHandler->characters( rValue ); |