[Libreoffice] [PATCH] Fix for fdo43460 Part VII getLength() to isEmpty()

Ivan Timofeev timofeev.i.s at gmail.com
Tue Dec 13 00:04:27 PST 2011


Hi Olivier,

13.12.2011 05:08, Olivier Hallot пишет:
> Please find attached a partial fix for Easy Hack FDO43460
>
> Part VII
> Module
> comphelper

Not sure whether this improves readability:

+++ b/comphelper/source/misc/storagehelper.cxx
@@ -522,7 +522,7 @@ sal_Bool OStorageHelper::PathHasSegment( const 
::rtl::OUString& aPath, const ::r
      const sal_Int32 nPathLen = aPath.getLength();
      const sal_Int32 nSegLen = aSegment.getLength();

-    if ( nSegLen && nPathLen >= nSegLen )
+    if ( !aSegment.isEmpty() && nPathLen >= nSegLen )
      {
          ::rtl::OUString aEndSegment( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
          aEndSegment += aSegment;

and in the script this is described as false positive. So I dropped this 
change and pushed:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=00a67c0f9056729695e6004707d64b448756fa6f

This easy hack is not so easy due to its enormous monotony. ;) Thank you 
for doing this!

Ivan


More information about the LibreOffice mailing list