loplugin:stringview whitelist getLength and isEmpty

Change-Id: I38f3410c0b25ff579879b9de1f266af4d8fd51e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150256
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2023-04-12 08:29:04 +02:00
parent 08495e24e8
commit c45bc08dc6
19 changed files with 46 additions and 48 deletions

View File

@@ -43,16 +43,9 @@ public:
bool preRun() override bool preRun() override
{ {
auto const fn = handler.getMainFileName(); auto const fn = handler.getMainFileName();
return !( return !(loplugin::isSamePathname(fn, SRCDIR "/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx")
loplugin::isSamePathname(fn, SRCDIR "/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx") || loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/rtl/strings/")
|| loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/strings/test_ostring_concat.cxx") || loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/rtl/oustring/"));
|| loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/strings/test_oustring_concat.cxx")
|| loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/oustring/rtl_OUString2.cxx")
|| loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/strings/test_oustring_compare.cxx")
|| loplugin::isSamePathname(fn,
SRCDIR "/sal/qa/rtl/strings/test_oustring_startswith.cxx")
|| loplugin::isSamePathname(fn, SRCDIR
"/sal/qa/rtl/strings/test_strings_defaultstringview.cxx"));
} }
virtual void run() override virtual void run() override
@@ -368,7 +361,8 @@ bool StringView::VisitCXXMemberCallExpr(CXXMemberCallExpr const* expr)
|| dc.Function("toDouble") || dc.Function("equalsAscii") || dc.Function("equalsAsciiL") || dc.Function("toDouble") || dc.Function("equalsAscii") || dc.Function("equalsAsciiL")
|| dc.Function("equalsIgnoreAsciiCase") || dc.Function("compareToIgnoreAsciiCase") || dc.Function("equalsIgnoreAsciiCase") || dc.Function("compareToIgnoreAsciiCase")
|| dc.Function("matchIgnoreAsciiCase") || dc.Function("trim") || dc.Function("matchIgnoreAsciiCase") || dc.Function("trim")
|| dc.Function("startsWith") || dc.Function("endsWith") || dc.Function("match")) || dc.Function("startsWith") || dc.Function("endsWith") || dc.Function("match")
|| dc.Function("isEmpty") || dc.Function("getLength"))
{ {
handleSubExprThatCouldBeView(expr->getImplicitObjectArgument()); handleSubExprThatCouldBeView(expr->getImplicitObjectArgument());
} }

View File

@@ -196,7 +196,7 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >&
// External file AND/OR remote connection // External file AND/OR remote connection
else if (url.startsWith("sdbc:firebird:")) else if (url.startsWith("sdbc:firebird:"))
{ {
m_sFirebirdURL = url.copy(OUString("sdbc:firebird:").getLength()); m_sFirebirdURL = url.copy(strlen("sdbc:firebird:"));
if (m_sFirebirdURL.startsWith("file://")) if (m_sFirebirdURL.startsWith("file://"))
{ {
m_bIsFile = true; m_bIsFile = true;

View File

@@ -204,7 +204,7 @@ namespace dbaui
m_xJavaDriverLabel->set_visible(bEnableJDBC); m_xJavaDriverLabel->set_visible(bEnableJDBC);
m_xJavaDriver->set_visible(bEnableJDBC); m_xJavaDriver->set_visible(bEnableJDBC);
m_xTestJavaDriver->set_visible(bEnableJDBC); m_xTestJavaDriver->set_visible(bEnableJDBC);
m_xTestJavaDriver->set_sensitive( !m_xJavaDriver->get_text().trim().isEmpty() ); m_xTestJavaDriver->set_sensitive( !o3tl::trim(m_xJavaDriver->get_text()).empty() );
m_xFL3->set_visible(bEnableJDBC); m_xFL3->set_visible(bEnableJDBC);
checkTestConnection(); checkTestConnection();
@@ -244,7 +244,7 @@ namespace dbaui
#if HAVE_FEATURE_JAVA #if HAVE_FEATURE_JAVA
try try
{ {
if ( !m_xJavaDriver->get_text().trim().isEmpty() ) if ( !o3tl::trim(m_xJavaDriver->get_text()).empty() )
{ {
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
m_xJavaDriver->set_text(m_xJavaDriver->get_text().trim()); // fdo#68341 m_xJavaDriver->set_text(m_xJavaDriver->get_text().trim()); // fdo#68341
@@ -266,14 +266,14 @@ namespace dbaui
OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
bool bEnableTestConnection = !m_xConnectionURL->get_visible() || !m_xConnectionURL->GetTextNoPrefix().isEmpty(); bool bEnableTestConnection = !m_xConnectionURL->get_visible() || !m_xConnectionURL->GetTextNoPrefix().isEmpty();
if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC ) if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC )
bEnableTestConnection = bEnableTestConnection && (!m_xJavaDriver->get_text().trim().isEmpty()); bEnableTestConnection = bEnableTestConnection && (!o3tl::trim(m_xJavaDriver->get_text()).empty());
m_xTestConnection->set_sensitive(bEnableTestConnection); m_xTestConnection->set_sensitive(bEnableTestConnection);
return true; return true;
} }
IMPL_LINK(OConnectionTabPage, OnEditModified, weld::Entry&, rEdit, void) IMPL_LINK(OConnectionTabPage, OnEditModified, weld::Entry&, rEdit, void)
{ {
if (&rEdit == m_xJavaDriver.get()) if (&rEdit == m_xJavaDriver.get())
m_xTestJavaDriver->set_sensitive( !m_xJavaDriver->get_text().trim().isEmpty() ); m_xTestJavaDriver->set_sensitive( !o3tl::trim(m_xJavaDriver->get_text()).empty() );
checkTestConnection(); checkTestConnection();
// tell the listener we were modified // tell the listener we were modified

View File

@@ -448,7 +448,7 @@ using namespace ::com::sun::star;
OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
// to get the correct value when saveValue was called by base class // to get the correct value when saveValue was called by base class
if ( m_xETDriverClass->get_text().trim().isEmpty() ) if ( o3tl::trim(m_xETDriverClass->get_text()).empty() )
{ {
m_xETDriverClass->set_text(m_sDefaultJdbcDriverName); m_xETDriverClass->set_text(m_sDefaultJdbcDriverName);
m_xETDriverClass->save_value(); m_xETDriverClass->save_value();
@@ -467,7 +467,7 @@ using namespace ::com::sun::star;
#if HAVE_FEATURE_JAVA #if HAVE_FEATURE_JAVA
try try
{ {
if ( !m_xETDriverClass->get_text().trim().isEmpty() ) if ( !o3tl::trim(m_xETDriverClass->get_text()).empty() )
{ {
// TODO change jvmaccess // TODO change jvmaccess
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
@@ -488,8 +488,8 @@ using namespace ::com::sun::star;
void OGeneralSpecialJDBCConnectionPageSetup::callModifiedHdl(weld::Widget* pControl) void OGeneralSpecialJDBCConnectionPageSetup::callModifiedHdl(weld::Widget* pControl)
{ {
if (pControl == m_xETDriverClass.get()) if (pControl == m_xETDriverClass.get())
m_xPBTestJavaDriver->set_sensitive( !m_xETDriverClass->get_text().trim().isEmpty() ); m_xPBTestJavaDriver->set_sensitive( !o3tl::trim(m_xETDriverClass->get_text()).empty() );
bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && ( !m_xETHostname->get_text().isEmpty() ) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !m_xETDriverClass->get_text().trim().isEmpty() )); bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && ( !m_xETHostname->get_text().isEmpty() ) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !o3tl::trim(m_xETDriverClass->get_text()).empty() ));
SetRoadmapStateValue(bRoadmapState); SetRoadmapStateValue(bRoadmapState);
OGenericAdministrationPage::callModifiedHdl(); OGenericAdministrationPage::callModifiedHdl();
} }

View File

@@ -442,7 +442,7 @@ namespace dbaui
OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
// to get the correct value when saveValue was called by base class // to get the correct value when saveValue was called by base class
if ( m_bUseClass && m_xEDDriverClass->get_text().trim().isEmpty() ) if ( m_bUseClass && o3tl::trim(m_xEDDriverClass->get_text()).empty() )
{ {
m_xEDDriverClass->set_text(m_sDefaultJdbcDriverName); m_xEDDriverClass->set_text(m_sDefaultJdbcDriverName);
m_xEDDriverClass->save_value(); m_xEDDriverClass->save_value();
@@ -457,7 +457,7 @@ namespace dbaui
#if HAVE_FEATURE_JAVA #if HAVE_FEATURE_JAVA
try try
{ {
if (!m_xEDDriverClass->get_text().trim().isEmpty()) if (!o3tl::trim(m_xEDDriverClass->get_text()).empty())
{ {
// TODO change jvmaccess // TODO change jvmaccess
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
@@ -478,7 +478,7 @@ namespace dbaui
void OGeneralSpecialJDBCDetailsPage::callModifiedHdl(weld::Widget* pControl) void OGeneralSpecialJDBCDetailsPage::callModifiedHdl(weld::Widget* pControl)
{ {
if (m_bUseClass && pControl == m_xEDDriverClass.get()) if (m_bUseClass && pControl == m_xEDDriverClass.get())
m_xTestJavaDriver->set_sensitive(!m_xEDDriverClass->get_text().trim().isEmpty()); m_xTestJavaDriver->set_sensitive(!o3tl::trim(m_xEDDriverClass->get_text()).empty());
// tell the listener we were modified // tell the listener we were modified
OGenericAdministrationPage::callModifiedHdl(); OGenericAdministrationPage::callModifiedHdl();

View File

@@ -1146,7 +1146,7 @@ void Test::testUnderlineCopyPaste()
aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true ); aEditEngine.InsertText( xData, OUString(), rDoc.GetEndPaM(), true );
// Assert changes // Assert changes
CPPUNIT_ASSERT_EQUAL( aTextLen + (OUString("textforunder")).getLength(), rDoc.GetTextLen() ); CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(aTextLen + strlen("textforunder")), rDoc.GetTextLen() );
CPPUNIT_ASSERT_EQUAL( OUString(aParaText + "textforunder" ), rDoc.GetParaAsString(sal_Int32(0)) ); CPPUNIT_ASSERT_EQUAL( OUString(aParaText + "textforunder" ), rDoc.GetParaAsString(sal_Int32(0)) );
// Check updated text for appropriate Underline // Check updated text for appropriate Underline

View File

@@ -232,9 +232,9 @@ TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos,
current = entry[current] + word.getLength() + 1; current = entry[current] + word.getLength() + 1;
sal_Int32 start=current; sal_Int32 start=current;
if (offset.hasElements()) { if (offset.hasElements()) {
if (word.getLength() != OUString(&wordData[current]).getLength()) if (word.getLength() != static_cast<sal_Int32>(std::u16string_view(&wordData[current]).size()))
one2one=false; one2one=false;
sal_Int32 convertedLength=OUString(&wordData[current]).getLength(); sal_Int32 convertedLength=std::u16string_view(&wordData[current]).size();
while (wordData[current]) { while (wordData[current]) {
offsetRange[count]=nStartPos + currPos + ((current-start) * offsetRange[count]=nStartPos + currPos + ((current-start) *
word.getLength() / convertedLength); word.getLength() / convertedLength);

View File

@@ -29,6 +29,7 @@
#include <iostream> #include <iostream>
#include <osl/file.hxx> #include <osl/file.hxx>
#include <osl/process.h> #include <osl/process.h>
#include <o3tl/string_view.hxx>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <unicode/regex.h> #include <unicode/regex.h>
@@ -1060,7 +1061,7 @@ bool lcl_isTag( const icu::UnicodeString& rString )
OString XMLUtil::QuotHTML( const OString &rString ) OString XMLUtil::QuotHTML( const OString &rString )
{ {
if( rString.trim().isEmpty() ) if( o3tl::trim(rString).empty() )
return rString; return rString;
UErrorCode nIcuErr = U_ZERO_ERROR; UErrorCode nIcuErr = U_ZERO_ERROR;
static const sal_uInt32 nSearchFlags = static const sal_uInt32 nSearchFlags =

View File

@@ -2438,7 +2438,7 @@ void XmlStreamObject::implDumpText( TextInputStream& rTextStrm )
entirely. */ entirely. */
mxOut->writeString( aElem ); mxOut->writeString( aElem );
mxOut->newLine(); mxOut->newLine();
if( !aText.trim().isEmpty() ) if( !o3tl::trim(aText).empty() )
{ {
mxOut->writeString( aText ); mxOut->writeString( aText );
mxOut->newLine(); mxOut->newLine();

View File

@@ -138,7 +138,7 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
{ {
nGroupOn = report::GroupOn::INTERVAL; nGroupOn = report::GroupOn::INTERVAL;
_rImport.removeFunction(sExpression); _rImport.removeFunction(sExpression);
sExpression = sExpression.copy(OUString("INT_count_").getLength()); sExpression = sExpression.copy(std::string_view("INT_count_").size());
OUString sInterval = sCompleteFormula.getToken(1,'/'); OUString sInterval = sCompleteFormula.getToken(1,'/');
sInterval = sInterval.getToken(0,')'); sInterval = sInterval.getToken(0,')');
m_xGroup->setGroupInterval(sInterval.toInt32()); m_xGroup->setGroupInterval(sInterval.toInt32());

View File

@@ -325,7 +325,7 @@ bool SmEditTextWindow::KeyInput(const KeyEvent& rKEvt)
if (index != -1) if (index != -1)
{ {
selected = selected.copy(index, sal_Int32(aSelection.nEndPos-index)); selected = selected.copy(index, sal_Int32(aSelection.nEndPos-index));
if (selected.trim().isEmpty()) if (o3tl::trim(selected).empty())
autoClose = true; autoClose = true;
} }
else else
@@ -336,7 +336,7 @@ bool SmEditTextWindow::KeyInput(const KeyEvent& rKEvt)
else else
{ {
selected = selected.copy(aSelection.nEndPos); selected = selected.copy(aSelection.nEndPos);
if (selected.trim().isEmpty()) if (o3tl::trim(selected).empty())
autoClose = true; autoClose = true;
} }
} }

View File

@@ -176,12 +176,12 @@ void PlaceEditDialog::InitDetails( )
// Create CMIS controls for each server type // Create CMIS controls for each server type
// Load the ServerType entries // Load the ServerType entries
bool bSkipGDrive = OUString( GDRIVE_CLIENT_ID ).isEmpty() || bool bSkipGDrive = std::string_view( GDRIVE_CLIENT_ID ).empty() ||
OUString( GDRIVE_CLIENT_SECRET ).isEmpty(); std::string_view( GDRIVE_CLIENT_SECRET ).empty();
bool bSkipAlfresco = OUString( ALFRESCO_CLOUD_CLIENT_ID ).isEmpty() || bool bSkipAlfresco = std::string_view( ALFRESCO_CLOUD_CLIENT_ID ).empty() ||
OUString( ALFRESCO_CLOUD_CLIENT_SECRET ).isEmpty(); std::string_view( ALFRESCO_CLOUD_CLIENT_SECRET ).empty();
bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() || bool bSkipOneDrive= std::string_view( ONEDRIVE_CLIENT_ID ).empty() ||
OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty(); std::string_view( ONEDRIVE_CLIENT_SECRET ).empty();
Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get() ); Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get() );
Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get() ); Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get() );

View File

@@ -96,6 +96,7 @@
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <officecfg/Office/Common.hxx> #include <officecfg/Office/Common.hxx>
#include <o3tl/safeint.hxx> #include <o3tl/safeint.hxx>
#include <o3tl/string_view.hxx>
#include <o3tl/typed_flags_set.hxx> #include <o3tl/typed_flags_set.hxx>
#include <bitmaps.hlst> #include <bitmaps.hlst>
#include <sal/log.hxx> #include <sal/log.hxx>
@@ -4352,7 +4353,7 @@ void ColorListBox::createColorWindow()
void ColorListBox::SelectEntry(const NamedColor& rColor) void ColorListBox::SelectEntry(const NamedColor& rColor)
{ {
if (rColor.second.trim().isEmpty()) if (o3tl::trim(rColor.second).empty())
{ {
SelectEntry(rColor.first); SelectEntry(rColor.first);
return; return;

View File

@@ -36,6 +36,7 @@
#include <txtftn.hxx> #include <txtftn.hxx>
#include <txtfrm.hxx> #include <txtfrm.hxx>
#include <svl/itemiter.hxx> #include <svl/itemiter.hxx>
#include <o3tl/string_view.hxx>
#include <o3tl/vector_utils.hxx> #include <o3tl/vector_utils.hxx>
#include <svx/swframetypes.hxx> #include <svx/swframetypes.hxx>
#include <fmtanchr.hxx> #include <fmtanchr.hxx>
@@ -1253,7 +1254,7 @@ public:
const uno::Reference<document::XDocumentProperties> xDocumentProperties( const uno::Reference<document::XDocumentProperties> xDocumentProperties(
xDPS->getDocumentProperties()); xDPS->getDocumentProperties());
OUString sTitle = xDocumentProperties->getTitle(); OUString sTitle = xDocumentProperties->getTitle();
if (sTitle.trim().isEmpty()) if (o3tl::trim(sTitle).empty())
{ {
lclAddIssue(m_rIssueCollection, SwResId(STR_DOCUMENT_TITLE), lclAddIssue(m_rIssueCollection, SwResId(STR_DOCUMENT_TITLE),
sfx::AccessibilityIssueID::DOCUMENT_TITLE); sfx::AccessibilityIssueID::DOCUMENT_TITLE);

View File

@@ -68,6 +68,7 @@
#include <ndindex.hxx> #include <ndindex.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <o3tl/string_view.hxx>
#include <wrtsh.hxx> #include <wrtsh.hxx>
#include <view.hxx> #include <view.hxx>
@@ -1996,7 +1997,7 @@ bool SwFlyFrame::IsShowUnfloatButton(SwWrtShell* pWrtSh) const
if (pLower->IsTextFrame()) if (pLower->IsTextFrame())
{ {
const SwTextFrame* pTextFrame = static_cast<const SwTextFrame*>(pLower); const SwTextFrame* pTextFrame = static_cast<const SwTextFrame*>(pLower);
if (!pTextFrame->GetText().trim().isEmpty()) if (!o3tl::trim(pTextFrame->GetText()).empty())
return false; return false;
} }
pLower = pLower->GetNext(); pLower = pLower->GetNext();

View File

@@ -790,13 +790,13 @@ namespace
OUStringBuffer aBuf; OUStringBuffer aBuf;
sal_Int32 nTextLen; sal_Int32 nTextLen;
nTextLen = OUString(OUString::number(rFormatter.GetMin())).getLength(); nTextLen = std::u16string_view(OUString::number(rFormatter.GetMin())).size();
string::padToLength(aBuf, nTextLen, '9'); string::padToLength(aBuf, nTextLen, '9');
Size aMinTextSize = rSpinField.CalcMinimumSizeForText( Size aMinTextSize = rSpinField.CalcMinimumSizeForText(
rFormatter.CreateFieldText(OUString::unacquired(aBuf).toInt64())); rFormatter.CreateFieldText(OUString::unacquired(aBuf).toInt64()));
aBuf.setLength(0); aBuf.setLength(0);
nTextLen = OUString(OUString::number(rFormatter.GetMax())).getLength(); nTextLen = std::u16string_view(OUString::number(rFormatter.GetMax())).size();
string::padToLength(aBuf, nTextLen, '9'); string::padToLength(aBuf, nTextLen, '9');
Size aMaxTextSize = rSpinField.CalcMinimumSizeForText( Size aMaxTextSize = rSpinField.CalcMinimumSizeForText(
rFormatter.CreateFieldText(OUString::unacquired(aBuf).toInt64())); rFormatter.CreateFieldText(OUString::unacquired(aBuf).toInt64()));

View File

@@ -77,12 +77,12 @@ static void lcl_DumpEntryAndSiblings(tools::JsonWriter& rJsonWriter,
{ {
const OUString& rCollapsed = pBmpItem->GetBitmap1().GetStock(); const OUString& rCollapsed = pBmpItem->GetBitmap1().GetStock();
const OUString& rExpanded = pBmpItem->GetBitmap2().GetStock(); const OUString& rExpanded = pBmpItem->GetBitmap2().GetStock();
if (!rCollapsed.trim().isEmpty() || !rExpanded.trim().isEmpty()) if (!o3tl::trim(rCollapsed).empty() || !o3tl::trim(rExpanded).empty())
{ {
auto aColumn = rJsonWriter.startStruct(); auto aColumn = rJsonWriter.startStruct();
if (!rCollapsed.trim().isEmpty()) if (!o3tl::trim(rCollapsed).empty())
rJsonWriter.put("collapsed", rCollapsed); rJsonWriter.put("collapsed", rCollapsed);
if (!rExpanded.trim().isEmpty()) if (!o3tl::trim(rExpanded).empty())
rJsonWriter.put("expanded", rExpanded); rJsonWriter.put("expanded", rExpanded);
} }
} }

View File

@@ -291,7 +291,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
pCurrentVectorIndex.reset(); pCurrentVectorIndex.reset();
aIndexFolderResultVectorVector.clear(); aIndexFolderResultVectorVector.clear();
sal_Int32 replIdx = OUString( "#HLP#" ).getLength(); sal_Int32 replIdx = strlen( "#HLP#" );
OUString replWith = "vnd.sun.star.help://"; OUString replWith = "vnd.sun.star.help://";
int nResultCount = aCompleteResultVector.size(); int nResultCount = aCompleteResultVector.size();

View File

@@ -303,7 +303,7 @@ bool OPropertyImport::encounteredAttribute(sal_Int32 nAttributeToken) const
void OPropertyImport::characters(const OUString& _rChars ) void OPropertyImport::characters(const OUString& _rChars )
{ {
// ignore them (should be whitespace only) // ignore them (should be whitespace only)
OSL_ENSURE(_rChars.trim().isEmpty(), "OPropertyImport::Characters: non-whitespace characters!"); OSL_ENSURE(o3tl::trim(_rChars).empty(), "OPropertyImport::Characters: non-whitespace characters!");
} }
bool OPropertyImport::handleAttribute(sal_Int32 nAttributeToken, const OUString& _rValue) bool OPropertyImport::handleAttribute(sal_Int32 nAttributeToken, const OUString& _rValue)
@@ -370,7 +370,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > OPropertyElementsConte
void OPropertyElementsContext::characters(const OUString& _rChars) void OPropertyElementsContext::characters(const OUString& _rChars)
{ {
OSL_ENSURE(_rChars.trim().isEmpty(), "OPropertyElementsContext::Characters: non-whitespace characters detected!"); OSL_ENSURE(o3tl::trim(_rChars).empty(), "OPropertyElementsContext::Characters: non-whitespace characters detected!");
} }
#endif #endif