[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Sat Jun 8 13:35:35 PDT 2013


 sw/source/core/doc/swserv.cxx       |    7 +------
 sw/source/filter/basflt/shellio.cxx |   30 ++++++++++++------------------
 2 files changed, 13 insertions(+), 24 deletions(-)

New commits:
commit 8a3f61c42b7dfd7221bd7bc9d9a5a70c052a0bf5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jun 8 21:33:13 2013 +0100

    Revert "Check pointer before deferenging"
    
    these are all exception enabled .o's new doesn't return NULL on failure, it
    throws bad_alloc
    
    This reverts commit 6b379300ad3fdbc5c58901c6e06fe600367f83c0.

diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index 476767d..e2a34af 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -78,17 +78,12 @@ sal_Bool SwServerObject::GetData( uno::Any & rData,
 
         case SECTION_SERVER:
             pPam = new SwPaM( SwPosition( *CNTNT_TYPE.pSectNd ) );
-            if (!pPam)
-            {
-                break;
-            }
             pPam->Move( fnMoveForward );
             pPam->SetMark();
             pPam->GetPoint()->nNode = *CNTNT_TYPE.pSectNd->EndOfSectionNode();
             pPam->Move( fnMoveBackward );
             break;
-        case NONE_SERVER:
-            break;
+        case NONE_SERVER: break;
         }
 
         if( pPam )
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index af77503..a17f91d 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -830,12 +830,9 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const String* pRealFileName )
             else
             {
                 pPam = new SwPaM( *pPam );
-                if (pPam)
-                {
-                    pPam->Move( fnMoveBackward, fnGoDoc );
-                    pPam->SetMark();
-                    pPam->Move( fnMoveForward, fnGoDoc );
-                }
+                pPam->Move( fnMoveBackward, fnGoDoc );
+                pPam->SetMark();
+                pPam->Move( fnMoveForward, fnGoDoc );
             }
         }
         // pPam ist immer noch der akt. Cursor !!
@@ -845,19 +842,16 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const String* pRealFileName )
         // keine Shell oder alles schreiben -> eigenen Pam erzeugen
         SwDoc* pOutDoc = pDoc ? pDoc : &rDoc;
         pPam = new SwPaM( pOutDoc->GetNodes().GetEndOfContent() );
-        if (pPam)
+        if( pOutDoc->IsClipBoard() )
         {
-            if( pOutDoc->IsClipBoard() )
-            {
-                pPam->Move( fnMoveBackward, fnGoDoc );
-                pPam->SetMark();
-                pPam->Move( fnMoveForward, fnGoDoc );
-            }
-            else
-            {
-                pPam->SetMark();
-                pPam->Move( fnMoveBackward, fnGoDoc );
-            }
+            pPam->Move( fnMoveBackward, fnGoDoc );
+            pPam->SetMark();
+            pPam->Move( fnMoveForward, fnGoDoc );
+        }
+        else
+        {
+            pPam->SetMark();
+            pPam->Move( fnMoveBackward, fnGoDoc );
         }
     }
 


More information about the Libreoffice-commits mailing list