[Libreoffice-commits] .: sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 28 03:56:29 PDT 2012


 sfx2/source/doc/docfile.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 469780c715f2a5dee6c58347941aefe6f3de079f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Sep 28 12:47:13 2012 +0200

    fdo#54744: Fix broken logic of string comparison
    
    d1cc007108442056f50d3a6d1212b2b4cfdc4c14 "sal_Bool to bool, String to OUString,
    in SfxMedium." changed
    
      !aLogicName.CompareToAscii( "private:stream", 14 ) == COMPARE_EQUAL     // (a)
    
    where that suspicious ! made it effectively behave as
    
      aLogicName.CompareToAscii( "private:stream", 14 ) != COMPARE_EQUAL      // (b)
    
    to
    
      (aLogicName.compareToAscii("private:stream", 14) == 0)                  // (c)
    
    where (c) corresponds to (a), but the intended behavior was apparently (b):
    Exporting to hybrid PDF now causes the embedded ODF stream (which is saved to a
    private:stream URL) to be empty, as (c) is erroneously satisfied now, causing
    the following lines to erroneously clear SID_OUTPUTSTREAM.
    
    Change-Id: Ia2c1a69db7b4da07bfe01f52c3f6759301358a84

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 06253f3..db5887e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2464,7 +2464,7 @@ void SfxMedium::Init_Impl()
     SFX_ITEMSET_ARG( pImp->m_pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM, false);
     if( pOutStreamItem
      && ( !( pOutStreamItem->GetValue() >>= rOutStream )
-          || (pImp->m_aLogicName.compareToAscii("private:stream", 14) == 0)) )
+          || (pImp->m_aLogicName.compareToAscii("private:stream", 14) != 0)) )
     {
         pImp->m_pSet->ClearItem( SID_OUTPUTSTREAM );
         OSL_FAIL( "Unexpected Output stream parameter!\n" );


More information about the Libreoffice-commits mailing list