Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 03/08/2013 09:04 AM, Stephan Bergmann wrote:
commit 3d4723f80a37e719359ad78ad063bc39ac28cd32
Author: Stephan Bergmann <sbergman@redhat.com>
Date:   Fri Mar 8 09:03:10 2013 +0100

     Revert "simplify some compareTo"

     This reverts commit 19020191cbf3e3c7a7bf98d0958d86d931ae687b,

       s1.compareTo(s2, length-of-s2)

     is *not* equivalent to

       s1 == s2

Please watch out for these. The correct replacement would be s1.startsWith(s2).

Stephan

diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 38def3a..12df6d7 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -157,7 +157,7 @@ OUString SAL_CALL DBTypeDetection::detect( ::com::sun::star::uno::Sequence< ::co
              xStorageProperties->getPropertyValue( INFO_MEDIATYPE ) >>= sMediaType;
              if ( sMediaType == MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII || sMediaType == 
MIMETYPE_VND_SUN_XML_BASE_ASCII )
              {
-                if ( bStreamFromDescr && (sURL != "private:stream") )
+                if ( bStreamFromDescr && sURL.compareTo( OUString( "private:stream" ), 14 ) != 
COMPARE_EQUAL )
                  {
                      // After fixing of the i88522 issue ( use the new file locking for database 
files ) the stream from the type detection can be used further
                      // for now the file should be reopened to have read/write access

[...]

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.