[ooo-build-commit] patches/dev300

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Jul 7 02:23:34 PDT 2009


 patches/dev300/warning-string-comparsion-sw.diff |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit a13ff254e37fc4f0e6f81a90e186fb6d6dd987e4
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Jul 7 11:20:35 2009 +0200

    Fix crash in rtf export, n#462657.
    
    It is probably triggered by a copy to clipboard that is happening in KDE due
    to 'klipper'.
    
    * patches/dev300/warning-string-comparsion-sw.diff: Add check for NULL before
      strcmp().

diff --git a/patches/dev300/warning-string-comparsion-sw.diff b/patches/dev300/warning-string-comparsion-sw.diff
index 838e356..15870fb 100644
--- a/patches/dev300/warning-string-comparsion-sw.diff
+++ b/patches/dev300/warning-string-comparsion-sw.diff
@@ -5,7 +5,7 @@
      sOut += sOptions;
  
 -    if( (const sal_Char *)sHTML_IT_image == (const sal_Char *)pType )
-+    if( !strcmp( sHTML_IT_image, pType ) )
++    if( pType && !strcmp( sHTML_IT_image, pType ) )
      {
          aTmp = xPropSet->getPropertyValue(
                      OUString::createFromAscii( "ImageURL" ) );
@@ -14,7 +14,7 @@
          // Wenn Zeichen-Objekte nicht absolut positioniert werden duerfen,
          // das entsprechende Flag loeschen.
 -        nFrmOpts |= ((const sal_Char *)sHTML_IT_image == (const sal_Char *)pType
-+        nFrmOpts |= ( !strcmp ( sHTML_IT_image, pType )
++        nFrmOpts |= ( ( pType && !strcmp ( sHTML_IT_image, pType ) )
                              ? HTML_FRMOPTS_IMG_CONTROL_CSS1
                              : HTML_FRMOPTS_CONTROL_CSS1);
      }
@@ -24,9 +24,9 @@
      {
 -        sal_Bool bEdit = sHTML_textarea == pTag || (const sal_Char *)sHTML_IT_file == (const sal_Char *)pType ||
 -                     (const sal_Char *)sHTML_IT_text == (const sal_Char *)pType;
-+        sal_Bool bEdit = !strcmp ( sHTML_textarea, pTag ) || 
-+			 !strcmp ( sHTML_IT_file, pType ) ||
-+			 !strcmp (sHTML_IT_text, pType );
++        sal_Bool bEdit = ( pTag && !strcmp ( sHTML_textarea, pTag ) ) || 
++			 ( pType && !strcmp ( sHTML_IT_file, pType ) ) ||
++			 ( pType && !strcmp ( sHTML_IT_text, pType ) );
  
          SfxItemSet aItemSet( rHTMLWrt.pDoc->GetAttrPool(), RES_CHRATR_BEGIN,
                               RES_CHRATR_END );
@@ -35,7 +35,7 @@
      rWrt.Strm() << '>';
  
 -    if( sHTML_select == pTag )
-+    if( !strcmp ( sHTML_select, pTag ) )
++    if( pTag && !strcmp ( sHTML_select, pTag ) )
      {
          aTmp = xPropSet->getPropertyValue(
                      OUString::createFromAscii( "StringItemList" ) );
@@ -44,7 +44,7 @@
          HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sHTML_select, sal_False );
      }
 -    else if( sHTML_textarea == pTag )
-+    else if( !strcmp ( sHTML_textarea, pTag ) )
++    else if( pTag && !strcmp ( sHTML_textarea, pTag ) )
      {
          // In TextAreas duerfen keine zusaetzlichen Spaces oder LF exportiert
          // werden!
@@ -53,8 +53,8 @@
          HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sHTML_textarea, sal_False );
      }
 -    else if( (const sal_Char *)sHTML_IT_checkbox == (const sal_Char *)pType || (const sal_Char *)sHTML_IT_radio == (const sal_Char *)pType )
-+    else if( !strcmp ( sHTML_IT_checkbox, pType ) || 
-+	     !strcmp ( sHTML_IT_radio, pType ) )
++    else if( ( pType && !strcmp ( sHTML_IT_checkbox, pType ) ) ||
++	     ( pType && !strcmp ( sHTML_IT_radio, pType ) ) )
      {
          aTmp = xPropSet->getPropertyValue( OUString::createFromAscii("Label") );
          if( aTmp.getValueType() == ::getCppuType((const OUString*)0) &&
@@ -65,7 +65,7 @@
      unsigned long nSize, SwRTFWriter &rWrt)
  {
 -    bool bIsWMF = (const char *)pBLIPType == (const char *)sRTF_WMETAFILE ? true : false;
-+    bool bIsWMF = !strcmp(pBLIPType, sRTF_WMETAFILE) ? true : false;
++    bool bIsWMF = (pBLIPType && !strcmp(pBLIPType, sRTF_WMETAFILE)) ? true : false;
      if (pBLIPType && nSize && pGraphicAry)
      {
          rWrt.Strm() << '{' << sRTF_PICT;
@@ -74,7 +74,7 @@
       a wmf already then we don't need any such wrapping
      */
 -    bool bIsWMF = (const sal_Char*)pBLIPType == (const sal_Char*)sRTF_WMETAFILE ? true : false;
-+    bool bIsWMF = !strcmp(pBLIPType, sRTF_WMETAFILE) ? true : false;
++    bool bIsWMF = (pBLIPType && !strcmp(pBLIPType, sRTF_WMETAFILE)) ? true : false;
      if (!bIsWMF)
  	    OutComment(rRTFWrt, sRTF_SHPPICT);
  


More information about the ooo-build-commit mailing list