summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-15 10:11:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-15 10:11:50 +0100
commit260fbeb21a86f7483891016a483c0b175947a35e (patch)
tree7377bf3fe69b5566c73009e95d925808be53bac3 /filter
parent2b86f17f0538519d468aaa9811f2f1cdfb270134 (diff)
filter: Use appropriate OUString functions on string constants
Change-Id: I4b1c365bb2ff80b30748630d2c6296bf4ed6fd53
Diffstat (limited to 'filter')
-rw-r--r--filter/source/config/cache/filterfactory.cxx2
-rw-r--r--filter/source/msfilter/msvbahelper.cxx2
-rw-r--r--filter/source/pdf/pdfexport.cxx4
-rw-r--r--filter/source/svg/svgdialog.cxx4
-rw-r--r--filter/source/svg/svgwriter.cxx16
-rw-r--r--filter/source/t602/t602filter.cxx180
-rw-r--r--filter/source/xsltfilter/LibXSLTTransformer.cxx3
7 files changed, 102 insertions, 109 deletions
diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx
index 1f23168747a3..9f668cf9a50b 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -189,7 +189,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea
throw (css::uno::RuntimeException, std::exception)
{
// reject old deprecated queries ...
- if (sQuery.matchAsciiL("_filterquery_",13,0))
+ if (sQuery.startsWith("_filterquery_"))
throw css::uno::RuntimeException(
"Use of deprecated and now unsupported query!",
static_cast< css::container::XContainerQuery* >(this));
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index e4ae3d86bd09..a02a028f7ef8 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -119,7 +119,7 @@ SfxObjectShell* findShellForUrl( const OUString& sMacroURLOrPath )
}
}
- if ( sMacroURLOrPath.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) )
+ if ( sMacroURLOrPath.endsWithIgnoreAsciiCase( ".dot" ) )
{
uno::Reference<document::XDocumentPropertiesSupplier> const
xDocPropSupp(xModel, uno::UNO_QUERY);
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 9e834564725e..84c95b8a477c 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -847,7 +847,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
OUString sShowOnlineLayout( "ShowOnlineLayout" );
uno::Reference< beans::XPropertySet > xViewProperties;
- if ( aCreator.equalsAscii( "Writer" ) )
+ if ( aCreator == "Writer" )
{
//i92835 if Writer is in web layout mode this has to be switched to normal view and back to web view in the end
try
@@ -868,7 +868,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
const sal_Int32 nPageCount = xRenderable->getRendererCount( aSelection, aRenderOptions );
- if ( mbExportNotesPages && aCreator.equalsAscii( "Impress" ) )
+ if ( mbExportNotesPages && aCreator == "Impress" )
{
uno::Reference< drawing::XShapes > xShapes; // sj: do not allow to export notes when
if ( ! ( aSelection >>= xShapes ) ) // exporting a selection -> todo: in the dialog
diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx
index 5f6cb4730eed..cf715534a6bd 100644
--- a/filter/source/svg/svgdialog.cxx
+++ b/filter/source/svg/svgdialog.cxx
@@ -193,7 +193,7 @@ Sequence< PropertyValue > SAL_CALL SVGDialog::getPropertyValues()
for( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; ++i )
{
- if( maMediaDescriptor[ i ].Name.equalsAscii( SVG_FILTER_DATA_NAME ) )
+ if( maMediaDescriptor[ i ].Name == SVG_FILTER_DATA_NAME )
break;
}
@@ -217,7 +217,7 @@ void SAL_CALL SVGDialog::setPropertyValues( const Sequence< PropertyValue >& rPr
for( sal_Int32 i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
{
- if( maMediaDescriptor[ i ].Name.equalsAscii( SVG_FILTER_DATA_NAME ) )
+ if( maMediaDescriptor[ i ].Name == SVG_FILTER_DATA_NAME )
{
maMediaDescriptor[ i ].Value >>= maFilterData;
break;
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 6d2efbad1713..3e9c2d580582 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -616,7 +616,7 @@ sal_Int32 SVGTextWriter::setTextPosition( const GDIMetaFile& rMtf, sal_uLong& nC
}
else
{
- if( sContent.equalsAscii( "\n" ) )
+ if( sContent == "\n" )
mbLineBreak = true;
}
}
@@ -631,7 +631,7 @@ sal_Int32 SVGTextWriter::setTextPosition( const GDIMetaFile& rMtf, sal_uLong& nC
}
else
{
- if( sContent.equalsAscii( "\n" ) )
+ if( sContent == "\n" )
mbLineBreak = true;
}
}
@@ -941,11 +941,11 @@ bool SVGTextWriter::nextParagraph()
for( sal_Int32 i = 0; i < nCount; ++i )
{
const PropertyValue& rProp = pPropArray[i];
- if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_NUMBERINGTYPE, sizeof(XML_UNO_NAME_NRULE_NUMBERINGTYPE)-1 ) )
+ if( rProp.Name == XML_UNO_NAME_NRULE_NUMBERINGTYPE )
{
rProp.Value >>= eType;
}
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_BULLET_CHAR, sizeof(XML_UNO_NAME_NRULE_BULLET_CHAR)-1 ) )
+ else if( rProp.Name == XML_UNO_NAME_NRULE_BULLET_CHAR )
{
OUString sValue;
rProp.Value >>= sValue;
@@ -1094,14 +1094,14 @@ bool SVGTextWriter::nextTextPortion()
#if OSL_DEBUG_LEVEL > 0
sInfo += "text field type: " + sFieldName + "; content: " + xTextField->getPresentation( /* show command: */ sal_False ) + "; ";
#endif
- if( sFieldName.equalsAscii( "DateTime" ) || sFieldName.equalsAscii( "Header" )
- || sFieldName.equalsAscii( "Footer" ) || sFieldName.equalsAscii( "PageNumber" ) )
+ if( sFieldName == "DateTime" || sFieldName == "Header"
+ || sFieldName == "Footer" || sFieldName == "PageNumber" )
{
mbIsPlacehlolderShape = true;
}
else
{
- mbIsURLField = sFieldName.equalsAscii( "URL" );
+ mbIsURLField = sFieldName == "URL";
if( mbIsURLField )
{
@@ -1492,7 +1492,7 @@ void SVGTextWriter::writeTextPortion( const Point& rPos,
if( sContent.isEmpty() )
continue;
- if( sContent.equalsAscii( "\n" ) )
+ if( sContent == "\n" )
mbLineBreak = true;
if( sContent.match( rText, nStartPos ) )
bNotSync = false;
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index aa4ab8ebcdbc..2e3d82cfc7e7 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -114,16 +114,12 @@ namespace T602ImportFilter {
"\x04\x4d\x02\xdd\x04\x4e\x02\xc7\x04\x4f\x00\xa7\x04\x34\x00\xe0" // F
"\x00\xb4\x00\xb0\x00\xc0\x02\xc6\x01\x58\x01\x59\x00\x20\x00\x20";
-#define _AddAtt(_nam, _val) \
- mpAttrList->AddAttribute(OUString::createFromAscii( _nam ),\
- OUString::createFromAscii( _val ) );
-
#define _Start(_nam) \
- mxHandler->startElement(OUString::createFromAscii(_nam), mAttrList);\
+ mxHandler->startElement(_nam, mAttrList);\
mpAttrList->Clear();
#define _End(_nam) \
- mxHandler->endElement(OUString::createFromAscii(_nam));
+ mxHandler->endElement(_nam);
#define _Chars(_ch) \
mxHandler->characters(OUString::createFromAscii((sal_Char *) _ch) );
@@ -226,7 +222,7 @@ void T602ImportFilter::inschr(unsigned char ch)
} else {
char s[20];
sprintf(s,"%i",pst.wasspace);
- _AddAtt("text:c",s);
+ mpAttrList->AddAttribute("text:c",OUString::createFromAscii(s));
_Start("text:s");
_End("text:s");
}
@@ -275,28 +271,28 @@ bool SAL_CALL T602ImportFilter::importImpl( const Sequence< ::com::sun::star::be
mxHandler->startDocument();
- _AddAtt("xmlns:office", "http://openoffice.org/2000/office");
- _AddAtt("xmlns:style", "http://openoffice.org/2000/style");
- _AddAtt("xmlns:text", "http://openoffice.org/2000/text");
- _AddAtt("xmlns:table", "http://openoffice.org/2000/table");
- _AddAtt("xmlns:draw", "http://openoffice.org/2000/draw");
- _AddAtt("xmlns:fo", "http://www.w3.org/1999/XSL/Format");
- _AddAtt("xmlns:xlink", "http://www.w3.org/1999/xlink");
- _AddAtt("xmlns:number", "http://openoffice.org/2000/datastyle");
- _AddAtt("xmlns:svg", "http://www.w3.org/2000/svg");
- _AddAtt("xmlns:chart", "http://openoffice.org/2000/chart");
- _AddAtt("xmlns:dr3d", "http://openoffice.org/2000/dr3d");
- _AddAtt("xmlns:math", "http://www.w3.org/1998/Math/MathML");
- _AddAtt("xmlns:form", "http://openoffice.org/2000/form");
- _AddAtt("xmlns:script", "http://openoffice.org/2000/script");
- _AddAtt("office:class", "text");
- _AddAtt("office:version", "1.0");
+ mpAttrList->AddAttribute("xmlns:office", "http://openoffice.org/2000/office");
+ mpAttrList->AddAttribute("xmlns:style", "http://openoffice.org/2000/style");
+ mpAttrList->AddAttribute("xmlns:text", "http://openoffice.org/2000/text");
+ mpAttrList->AddAttribute("xmlns:table", "http://openoffice.org/2000/table");
+ mpAttrList->AddAttribute("xmlns:draw", "http://openoffice.org/2000/draw");
+ mpAttrList->AddAttribute("xmlns:fo", "http://www.w3.org/1999/XSL/Format");
+ mpAttrList->AddAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+ mpAttrList->AddAttribute("xmlns:number", "http://openoffice.org/2000/datastyle");
+ mpAttrList->AddAttribute("xmlns:svg", "http://www.w3.org/2000/svg");
+ mpAttrList->AddAttribute("xmlns:chart", "http://openoffice.org/2000/chart");
+ mpAttrList->AddAttribute("xmlns:dr3d", "http://openoffice.org/2000/dr3d");
+ mpAttrList->AddAttribute("xmlns:math", "http://www.w3.org/1998/Math/MathML");
+ mpAttrList->AddAttribute("xmlns:form", "http://openoffice.org/2000/form");
+ mpAttrList->AddAttribute("xmlns:script", "http://openoffice.org/2000/script");
+ mpAttrList->AddAttribute("office:class", "text");
+ mpAttrList->AddAttribute("office:version", "1.0");
_Start("office:document-content");
_Start("office:font-decls");
- _AddAtt("style:name","Courier New");
- _AddAtt("fo:font-family","Courier New");
- _AddAtt("style:font-pitch","fixed");
+ mpAttrList->AddAttribute("style:name","Courier New");
+ mpAttrList->AddAttribute("fo:font-family","Courier New");
+ mpAttrList->AddAttribute("style:font-pitch","fixed");
_Start("style:font-decl");
_End("style:font-decl");
_End("office:font-decls");
@@ -304,128 +300,128 @@ bool SAL_CALL T602ImportFilter::importImpl( const Sequence< ::com::sun::star::be
_Start("office:automatic-styles");
// Standardni text
- _AddAtt("style:name","P1");
- _AddAtt("style:family","paragraph");
- _AddAtt("style:parent-style-name","Standard");
+ mpAttrList->AddAttribute("style:name","P1");
+ mpAttrList->AddAttribute("style:family","paragraph");
+ mpAttrList->AddAttribute("style:parent-style-name","Standard");
_Start("style:style");
- _AddAtt("style:font-name","Courier New");
- _AddAtt("fo:font-size",fs);
+ mpAttrList->AddAttribute("style:font-name","Courier New");
+ mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs));
_Start("style:properties");
_End("style:properties");
_End("style:style");
// Standardni text - konec stranky
- _AddAtt("style:name","P2");
- _AddAtt("style:family","paragraph");
- _AddAtt("style:parent-style-name","Standard");
+ mpAttrList->AddAttribute("style:name","P2");
+ mpAttrList->AddAttribute("style:family","paragraph");
+ mpAttrList->AddAttribute("style:parent-style-name","Standard");
_Start("style:style");
- _AddAtt("style:font-name","Courier New");
- _AddAtt("fo:font-size",fs);
- _AddAtt("fo:break-before","page");
+ mpAttrList->AddAttribute("style:font-name","Courier New");
+ mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs));
+ mpAttrList->AddAttribute("fo:break-before","page");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T1 Normalni text
- _AddAtt("style:name","T1");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T1");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T2 Tucny text
- _AddAtt("style:name","T2");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T2");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("fo:font-weight","bold");
+ mpAttrList->AddAttribute("fo:font-weight","bold");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T3 Kurziva
- _AddAtt("style:name","T3");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T3");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("fo:font-style","italic");
+ mpAttrList->AddAttribute("fo:font-style","italic");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T4 Siroky text
- _AddAtt("style:name","T4");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T4");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("fo:font-weight","bold");
- _AddAtt("style:text-scale","200%");
+ mpAttrList->AddAttribute("fo:font-weight","bold");
+ mpAttrList->AddAttribute("style:text-scale","200%");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T5 Vysoky text
- _AddAtt("style:name","T5");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T5");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("fo:font-size",fs2);
- _AddAtt("fo:font-weight","bold");
- _AddAtt("style:text-scale","50%");
+ mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2));
+ mpAttrList->AddAttribute("fo:font-weight","bold");
+ mpAttrList->AddAttribute("style:text-scale","50%");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T6 Velky text
- _AddAtt("style:name","T6");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T6");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("fo:font-size",fs2);
- _AddAtt("fo:font-weight","bold");
+ mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2));
+ mpAttrList->AddAttribute("fo:font-weight","bold");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T7 Podtrzeny text
- _AddAtt("style:name","T7");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T7");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("style:text-underline","single");
+ mpAttrList->AddAttribute("style:text-underline","single");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T8 Podtrzena tucny text
- _AddAtt("style:name","T8");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T8");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("fo:font-weight","bold");
- _AddAtt("style:text-underline","single");
+ mpAttrList->AddAttribute("fo:font-weight","bold");
+ mpAttrList->AddAttribute("style:text-underline","single");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T9 Podtrzena kurziva
- _AddAtt("style:name","T9");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T9");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("fo:font-style","italic");
- _AddAtt("style:text-underline","single");
+ mpAttrList->AddAttribute("fo:font-style","italic");
+ mpAttrList->AddAttribute("style:text-underline","single");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T10 Horni index
- _AddAtt("style:name","T10");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T10");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("style:text-position","27% 100%");
+ mpAttrList->AddAttribute("style:text-position","27% 100%");
_Start("style:properties");
_End("style:properties");
_End("style:style");
// T11 Dolni index
- _AddAtt("style:name","T11");
- _AddAtt("style:family","text");
+ mpAttrList->AddAttribute("style:name","T11");
+ mpAttrList->AddAttribute("style:family","text");
_Start("style:style");
- _AddAtt("style:text-position","-27% 100%");
+ mpAttrList->AddAttribute("style:text-position","-27% 100%");
_Start("style:properties");
_End("style:properties");
_End("style:style");
@@ -524,7 +520,8 @@ void T602ImportFilter::wrtfnt()
}
_End("text:span");
- _AddAtt("text:style-name", style);
+ mpAttrList->AddAttribute(
+ "text:style-name", OUString::createFromAscii(style));
_Start("text:span");
}
@@ -561,7 +558,7 @@ void T602ImportFilter::par602(bool endofpage)
if(pst.waspar||ini.reformatpars) {
_End("text:span");
_End("text:p");
- _AddAtt("text:style-name", "P1");
+ mpAttrList->AddAttribute("text:style-name", "P1");
_Start("text:p");
_Start("text:span");
wrtfnt();
@@ -587,7 +584,7 @@ void T602ImportFilter::par602(bool endofpage)
if(!ini.reformatpars) {
_End("text:span");
_End("text:p");
- _AddAtt("text:style-name", "P2");
+ mpAttrList->AddAttribute("text:style-name", "P2");
_Start("text:p");
_Start("text:span");
wrtfnt();
@@ -694,9 +691,9 @@ void T602ImportFilter::Read602()
if (node==QUIT) return;
- _AddAtt("text:style-name", "P1");
+ mpAttrList->AddAttribute("text:style-name", "P1");
_Start("text:p");
- _AddAtt("text:style-name", "T1");
+ mpAttrList->AddAttribute("text:style-name", "T1");
_Start("text:span");
if (node==START) { node = EOL; }
@@ -910,33 +907,30 @@ bool T602ImportFilterDialog::OptionsDlg()
Any any;
#define _propInt(_prop,_nam,_val) \
any <<= (sal_Int32)_val;\
- _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
+ _prop->setPropertyValue(_nam, any);
#define _propShort(_prop,_nam,_val) \
any <<= (sal_Int16)_val;\
- _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
+ _prop->setPropertyValue(_nam, any);
#define _propBool(_prop,_nam,_val) \
any <<= _val;\
- _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
+ _prop->setPropertyValue(_nam, any);
#define _propString(_prop,_nam,_val) \
- any <<= OUString::createFromAscii(_val);\
- _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
+ any <<= OUString(_val);\
+ _prop->setPropertyValue(_nam, any);
#define _propStringFromResId(_prop,_nam,_val) \
any <<= getResStr(_val);\
- _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
+ _prop->setPropertyValue(_nam, any);
#define _propGet(_prop,_nam) \
- _prop->getPropertyValue(OUString::createFromAscii(_nam));
-#define _InstCtx(_path,_ctx)\
- rServiceManager->createInstanceWithContext(\
- OUString::createFromAscii(_path),_ctx);
+ _prop->getPropertyValue(_nam);
#define _Inst(_path)\
- xMultiServiceFactory->createInstance(OUString::createFromAscii(_path) );
+ xMultiServiceFactory->createInstance(_path);
#define _Insert(_cont,_nam,_obj) \
any <<= _obj;\
- _cont->insertByName( OUString::createFromAscii(_nam), any );
+ _cont->insertByName( _nam, any );
Reference < XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext();
Reference < XMultiComponentFactory > rServiceManager = rComponentContext->getServiceManager();
- Reference < XInterface > rInstance = _InstCtx("com.sun.star.awt.UnoControlDialogModel", rComponentContext );
+ Reference < XInterface > rInstance = rServiceManager->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", rComponentContext );
Reference <XMultiServiceFactory> xMultiServiceFactory (rInstance,UNO_QUERY);
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index eb07843a9803..c76161497baf 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -334,8 +334,7 @@ namespace XSLT
if (lastErr)
msg = OUString::createFromAscii(lastErr->message);
else
- msg = OUString::createFromAscii(
- "Unknown XSLT transformation error");
+ msg = "Unknown XSLT transformation error";
m_transformer->error(msg);
}