[Libreoffice-commits] .: starmath/source

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Sun Nov 21 09:18:21 PST 2010


 starmath/source/view.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit bfe33f821e176353753a28d34371ff778fadab59
Author: Norbert Thiebaud <norbert at sqdata.com>
Date:   Sun Nov 21 11:03:05 2010 -0600

    fix potential null pointer dereference

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 75871e6..23a6083 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1451,7 +1451,7 @@ bool SmViewShell::Insert( SfxMedium& rMedium )
     SmDocShell *pDoc = GetDoc();
     String aText( pDoc->GetText() );
     String aTemp = aText;
-    bool bRet = false, bChkOldVersion = true;
+    bool bRet = false;
 
     uno::Reference < embed::XStorage > xStorage = rMedium.GetStorage();
     uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
@@ -1459,7 +1459,6 @@ bool SmViewShell::Insert( SfxMedium& rMedium )
     {
         if ( xNameAccess->hasByName( C2S( "content.xml" ) ) || xNameAccess->hasByName( C2S( "Content.xml" ) ))
         {
-            bChkOldVersion = false;
             // is this a fabulous math package ?
             Reference<com::sun::star::frame::XModel> xModel(pDoc->GetModel());
             SmXMLImportWrapper aEquation(xModel);    //!! modifies the result of pDoc->GetText() !!
@@ -1799,10 +1798,10 @@ void SmViewShell::Execute(SfxRequest& rReq)
                     {
                         pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet);
                         OSL_ENSURE(pDlg, "Dialogdiet fail!");
+                        pDlg->SetLimits( MINZOOM, MAXZOOM );
+                        if( pDlg->Execute() != RET_CANCEL )
+                            pSet = pDlg->GetOutputItemSet();
                     }
-                    pDlg->SetLimits( MINZOOM, MAXZOOM );
-                    if( pDlg->Execute() != RET_CANCEL )
-                        pSet = pDlg->GetOutputItemSet();
                 }
                 if ( pSet )
                 {


More information about the Libreoffice-commits mailing list