diff options
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 42 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 22 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 |
3 files changed, 33 insertions, 33 deletions
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 35773d796740..5b45c82ab571 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -568,10 +568,10 @@ void OOXMLDocumentImpl::resolveCustomXmlStream(Stream & rStream) beans::StringPair aPair = aSeq[i]; // Need to resolve only customxml files from document relationships. // Skipping other files. - if (aPair.Second.compareTo(sCustomType) == 0 || - aPair.Second.compareTo(sCustomTypeStrict) == 0) + if (aPair.Second == sCustomType || + aPair.Second == sCustomTypeStrict) bFound = true; - else if(aPair.First.compareTo(sTarget) == 0 && bFound) + else if(aPair.First == sTarget && bFound) { // Adding value to extern variable customTarget. It will be used in ooxmlstreamimpl // to ensure customxml target is visited in lcl_getTarget. @@ -644,26 +644,26 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/) OOXMLStream::StreamType_t nType(OOXMLStream::UNKNOWN); bool bFound = true; - if(gType.compareTo(sSettingsType) == 0 || - gType.compareTo(sSettingsTypeStrict) == 0) + if(gType == sSettingsType || + gType == sSettingsTypeStrict) { nType = OOXMLStream::SETTINGS; contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"; } - else if(gType.compareTo(sStylesType) == 0 || - gType.compareTo(sStylesTypeStrict) == 0) + else if(gType == sStylesType || + gType == sStylesTypeStrict) { nType = OOXMLStream::STYLES; contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"; } - else if(gType.compareTo(sWebSettings) == 0 || - gType.compareTo(sWebSettingsStrict) == 0) + else if(gType == sWebSettings || + gType == sWebSettingsStrict) { nType = OOXMLStream::WEBSETTINGS; contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"; } - else if(gType.compareTo(sFonttableType) == 0 || - gType.compareTo(sFonttableTypeStrict) == 0) + else if(gType == sFonttableType || + gType == sFonttableTypeStrict) { nType = OOXMLStream::FONTTABLE; contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"; @@ -735,24 +735,24 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(OOXMLStream::Pointer_t pStream) for (sal_Int32 i = 0; i < aSeq.getLength(); i++) { beans::StringPair aPair = aSeq[i]; - if (aPair.Second.compareTo(sChartType) == 0 || - aPair.Second.compareTo(sChartTypeStrict) == 0) + if (aPair.Second == sChartType || + aPair.Second == sChartTypeStrict) { bFound = true; } - else if(aPair.Second.compareTo(sFootersType) == 0 || - aPair.Second.compareTo(sFootersTypeStrict) == 0) + else if(aPair.Second == sFootersType || + aPair.Second == sFootersTypeStrict) { bHeaderFooterFound = true; streamType = OOXMLStream::FOOTER; } - else if(aPair.Second.compareTo(sHeaderType) == 0 || - aPair.Second.compareTo(sHeaderTypeStrict) == 0) + else if(aPair.Second == sHeaderType || + aPair.Second == sHeaderTypeStrict) { bHeaderFooterFound = true; streamType = OOXMLStream::HEADER; } - else if(aPair.First.compareTo(sTarget) == 0 && ( bFound || bHeaderFooterFound )) + else if(aPair.First == sTarget && ( bFound || bHeaderFooterFound )) { // Adding value to extern variable customTarget. It will be used in ooxmlstreamimpl // to ensure chart.xml target is visited in lcl_getTarget. @@ -823,10 +823,10 @@ void OOXMLDocumentImpl::resolveActiveXStream(Stream & rStream) beans::StringPair aPair = aSeq[i]; // Need to resolve only ActiveX files from document relationships. // Skipping other files. - if (aPair.Second.compareTo(sCustomType) == 0 || - aPair.Second.compareTo(sCustomTypeStrict) == 0) + if (aPair.Second == sCustomType || + aPair.Second == sCustomTypeStrict) bFound = true; - else if(aPair.First.compareTo(sTarget) == 0 && bFound) + else if(aPair.First == sTarget && bFound) { // Adding value to extern variable customTarget. It will be used in ooxmlstreamimpl // to ensure ActiveX.xml target is visited in lcl_getTarget. diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx index 759762a58021..f107924e26a1 100644 --- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx @@ -287,21 +287,21 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess> { const beans::StringPair &rPair = rSeq[i]; - if (rPair.First.compareTo(sType) == 0 && - ( rPair.Second.compareTo(sStreamType) == 0 || - rPair.Second.compareTo(sStreamTypeStrict) == 0)) + if (rPair.First == sType && + ( rPair.Second == sStreamType || + rPair.Second == sStreamTypeStrict )) bFound = true; - else if(rPair.First.compareTo(sType) == 0 && - ((rPair.Second.compareTo(sOleObjectType) == 0 || - rPair.Second.compareTo(sOleObjectTypeStrict) == 0) && + else if(rPair.First == sType && + ((rPair.Second == sOleObjectType || + rPair.Second == sOleObjectTypeStrict) && nStreamType == EMBEDDINGS)) { bFound = true; } - else if (rPair.First.compareTo(sId) == 0 && - rPair.Second.compareTo(rId) == 0) + else if (rPair.First == sId && + rPair.Second == rId) bFound = true; - else if (rPair.First.compareTo(sTarget) == 0) + else if (rPair.First == sTarget) { // checking item[n].xml or activex[n].xml is not visited already. if(customTarget != rPair.Second && (sStreamType == sCustomType || sStreamType == sActiveXType || sStreamType == sChartType || sStreamType == sFooterType || sStreamType == sHeaderType)) @@ -313,8 +313,8 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess> sMyTarget = rPair.Second; } } - else if (rPair.First.compareTo(sTargetMode) == 0 && - rPair.Second.compareTo(sExternal) == 0) + else if (rPair.First == sTargetMode && + rPair.Second == sExternal) bExternalTarget = true; } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index b45fd3e7e768..a4c7c1d31382 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -759,7 +759,7 @@ int RTFDocumentImpl::resolvePict(bool bInline) // provided by picw and pich. OString aURLBS(OUStringToOString(aGraphicUrl, RTL_TEXTENCODING_UTF8)); const char aURLBegin[] = "vnd.sun.star.GraphicObject:"; - if (aURLBS.compareTo(aURLBegin, RTL_CONSTASCII_LENGTH(aURLBegin)) == 0) + if (aURLBS.startsWith(aURLBegin)) { Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic(); Size aSize(aGraphic.GetPrefSize()); |