openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steele, Raymond" <raymond.ste...@lmco.com>
Subject soffice process still running
Date Mon, 28 Jan 2013 22:44:10 GMT
After implementing the below code, the soffice process continues to run. I check this using
ps -ef| grep soffice on Solaris 10 x86 OpenOffice 3.2.  Can anyone explain how to get this
process to stop? I do not want to use the kill command because I do not want to kill any other
instances of open office. Thanks!

  // Conditions: xDocument = m_xLoadedDocument
  // Check supported functionality of the document (model or controller).
  com.sun.star.frame.XModel xModel =
    (com.sun.star.frame.XModel)UnoRuntime.queryInterface(
      com.sun.star.frame.XModel.class,xDocument);

  if(xModel!=null)
  {
    // It is a full featured office document.
    // Try to use close mechanism instead of a hard dispose().
    // But maybe such service is not available on this model.
    com.sun.star.util.XCloseable xCloseable =
      (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(
        com.sun.star.util.XCloseable.class,xModel);

  if(xCloseable!=null)
  {
    try
      {
        // use close(boolean DeliverOwnership)
        // The boolean parameter DeliverOwnership tells objects vetoing the close process
that they may
        // assume ownership if they object the closure by throwing a CloseVetoException
        // Here we give up ownership. To be on the safe side, catch possible veto exception
anyway.
        xCloseable.close(true);
      }
      catch(com.sun.star.util.CloseVetoException exCloseVeto)
      {
      }
  }
  // If close is not supported by this model - try to dispose it.
  // But if the model disagree with a reset request for the modify state
  // we shouldn't do so. Otherwhise some strange things can happen.
  else
  {
      com.sun.star.lang.XComponent xDisposeable =
        (com.sun.star.lang.XComponent)UnoRuntime.queryInterface(
         com.sun.star.lang.XComponent.class,xModel);
         xDisposeable.dispose();
       }
       catch(com.sun.star.beans.PropertyVetoException exModifyVeto)
       {
       }
      }
    }
  }


Raymond Steele
U-2 Mission Planning
Software Engineer
Lockheed Martin - IS&GS Defense
1300 S. Litchfield Rd.
Goodyear, AZ 85338
Email: raymond.steele@lmco.com
Business phone:  623-925-6102


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message