[ooo-build-commit] Branch 'ooo/OOO320' - 2 commits - extensions/source package/source wizards/source

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Dec 9 19:33:26 PST 2009


 extensions/source/plugin/base/nfuncs.cxx         |    5 
 package/source/xstor/makefile.mk                 |    1 
 package/source/xstor/owriteablestream.cxx        |   22 +--
 package/source/xstor/selfterminatefilestream.cxx |  156 +++++++++++++++++++++++
 package/source/xstor/selfterminatefilestream.hxx |   79 +++++++++++
 package/source/zippackage/ZipPackage.cxx         |   23 ---
 wizards/source/launcher/FontOOo.xba              |   46 ------
 wizards/source/launcher/makefile.mk              |    3 
 wizards/source/launcher/script.xlb               |    1 
 9 files changed, 252 insertions(+), 84 deletions(-)

New commits:
commit 6a3d6163fc0d6332cb25b3b921c72a512734d1e8
Author: Oliver Bolte <obo at openoffice.org>
Date:   Wed Dec 9 09:51:13 2009 +0000

    CWS-TOOLING: integrate CWS fontooocleanup32
    2009-11-30 21:39:22 +0100 rene  r277681 : remove empty msfontextract dir
    2009-11-30 21:32:22 +0100 rene  r277680 : #i79153# remove remains of FontOOo

diff --git a/wizards/source/launcher/FontOOo.xba b/wizards/source/launcher/FontOOo.xba
deleted file mode 100644
index c05e0c1..0000000
--- a/wizards/source/launcher/FontOOo.xba
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="FontOOo" script:language="StarBasic">Option Explicit
-
-Sub StartFontOOo
-
-Dim ThePath as string
-Dim aService as object
-Dim MyFontOOo as string
-dim TheDoc as object 
-dim args(1) as new com.sun.star.beans.PropertyValue
-
-on error resume next
-
-&apos; Find path
-aService = CreateUnoService(&quot;com.sun.star.util.PathSubstitution&quot;)
-ThePath =ConvertToURL(aService.substituteVariables(&quot;$(prog)&quot;, true))
-ThePath=ThePath &amp; &quot;/../share/dict/ooo&quot;
-
-if  fileExists(ThePath &amp; &quot;/FontOOo.lst&quot;) then
-&apos;read FontOOo.lst file
-        Open ThePath &amp; &quot;/FontOOo.lst&quot; for input as #1
-                line input #1, MyFontOOo
-        close #1
-else
-&apos;create default FontOOo.lst file
-        Open ThePath &amp; &quot;/FontOOo.lst&quot; for output as #1
-                MyFontOOo=ThePath &amp; &quot;/FontOOo.sxw&quot;
-                print #1, MyFontOOo
-        close #1
-endif
-
-&apos;security
-if Not fileExists(MyFontOOo) then
-        MyFontOOo= ThePath &amp; &quot;/FontOOo.sxw&quot;
-endif
-MyFontOOo=ConvertToURL(MyFontOOo) 
-
-&apos;Opens FontOOo main file
-args(0).name=&quot;InteractionHandler&quot;
-args(0).value=&quot;&quot;
-args(1).name=&quot;MacroExecutionMode&quot;
-args(1).value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN &apos;4
-TheDoc=StarDesktop.loadComponentFromURL(MyFontOOo,&quot;_blank&quot;,0,args())
-
-End Sub</script:module>
diff --git a/wizards/source/launcher/makefile.mk b/wizards/source/launcher/makefile.mk
index d20cc07..6efbcc5 100644
--- a/wizards/source/launcher/makefile.mk
+++ b/wizards/source/launcher/makefile.mk
@@ -42,9 +42,6 @@ TARGET=launcher
 
 ZIP1TARGET      = $(LAUNCHER_ALL_TARGET)
 XBAFILES	= DicOOo.xba
-.IF "$(WITH_FONTOOO)" == "YES"
-XBAFILES	+= FontOOo.xba
-.ENDIF
 ZIP1LIST        = *.xdl $(XBAFILES) *.xlb
 
 # --- Targets ------------------------------------------------------
diff --git a/wizards/source/launcher/script.xlb b/wizards/source/launcher/script.xlb
index 88a6e68..55310d9 100644
--- a/wizards/source/launcher/script.xlb
+++ b/wizards/source/launcher/script.xlb
@@ -2,5 +2,4 @@
 <!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
 <library:library xmlns:library="http://openoffice.org/2000/library" library:name="Launcher" library:readonly="true" library:passwordprotected="false">
  <library:element library:name="DicOOo"/>
- <library:element library:name="FontOOo"/>
 </library:library>
commit 35d55b0c49c9e742905ccc3bc361123755f954c2
Author: Oliver Bolte <obo at openoffice.org>
Date:   Wed Dec 9 08:32:23 2009 +0000

    CWS-TOOLING: integrate CWS fwk129
    2009-12-07 14:19:39 +0100 mba  r277741 : #i106367#: typo again
    2009-12-02 10:32:30 +0100 jsk  r277700 : fwk129: #i105719 - Fixed file size, wording and timing
    2009-11-25 13:25:48 +0100 mav  r277632 : #i107047# let the temporary stream be flushed in time
    2009-11-25 13:17:36 +0100 mav  r277631 : #i105719# switch to temporary file ealier to allow storing to the same location
    2009-11-23 14:47:02 +0100 mav  r277596 : #i105343# no outdated info in the buffer
    2009-11-23 14:09:49 +0100 os  r277595 : #i107064# copy styles in SwDoc::CreateCopy()
    2009-11-23 10:38:29 +0100 mba  r277592 : #i104338#: fix build without Java
    2009-11-20 10:22:11 +0100 cd  r277572 : #i107003# Make toolbar invisible before calling doLazyDelete. This prevents possible crashes in scenarios where a modal dialog is visible.
    2009-11-19 18:30:33 +0100 mav  r277569 : #i107035# let the temporary file be removed after the stream has been closed
    2009-11-19 18:06:21 +0100 mba  r277565 : #i106390#: crash caused by optimization
    2009-11-19 17:58:34 +0100 mba  r277564 : #i106367#: typo prevents correct asian language fallback
    2009-11-19 17:57:16 +0100 mba  r277563 : #i106390#: crash caused by optimization
    2009-11-19 16:35:41 +0100 nn  r277561 : #i106854# get source stream directly from document's storage instead of a temporary SfxMedium
    2009-11-19 12:36:38 +0100 mav  r277558 : #i106854# check the date of the original file

diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx
index a8c194b..5440884 100644
--- a/extensions/source/plugin/base/nfuncs.cxx
+++ b/extensions/source/plugin/base/nfuncs.cxx
@@ -102,8 +102,13 @@ NPNetscapeFuncs aNPNFuncs =
     NPN_MemFree,
     NPN_MemFlush,
     NPN_ReloadPlugins,
+#ifdef OJI
     NPN_GetJavaEnv,
     NPN_GetJavaPeer,
+#else
+    0,
+    0,
+#endif
     NPN_GetURLNotify,
     NPN_PostURLNotify,
     NPN_GetValue,
diff --git a/package/source/xstor/makefile.mk b/package/source/xstor/makefile.mk
index a0e49f2..703873f 100644
--- a/package/source/xstor/makefile.mk
+++ b/package/source/xstor/makefile.mk
@@ -52,6 +52,7 @@ SLOFILES =  \
         $(SLO)$/xstorage.obj\
         $(SLO)$/xfactory.obj\
         $(SLO)$/disposelistener.obj\
+        $(SLO)$/selfterminatefilestream.obj\
         $(SLO)$/switchpersistencestream.obj\
         $(SLO)$/register.obj
 
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index d1b5487..3dad1bd 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -48,6 +48,7 @@
 #include <comphelper/storagehelper.hxx>
 #include <comphelper/ofopxmlhelper.hxx>
 
+#include "selfterminatefilestream.hxx"
 #include "owriteablestream.hxx"
 #include "oseekinstream.hxx"
 #include "mutexholder.hxx"
@@ -847,6 +848,9 @@ void OWriteStream_Impl::Commit()
 
     if ( m_xCacheStream.is() )
     {
+        if ( m_pAntiImpl )
+            m_pAntiImpl->DeInit();
+
         uno::Reference< io::XInputStream > xInStream( m_xCacheStream->getInputStream(), uno::UNO_SET_THROW );
 
         xNewPackageStream = uno::Reference< packages::XDataSinkEncrSupport >(
@@ -858,23 +862,16 @@ void OWriteStream_Impl::Commit()
         m_xCacheStream = uno::Reference< io::XStream >();
         m_xCacheSeek = uno::Reference< io::XSeekable >();
 
-        if ( m_pAntiImpl )
-            m_pAntiImpl->DeInit();
     }
     else if ( m_aTempURL.getLength() )
     {
-        uno::Reference < ucb::XSimpleFileAccess > xTempAccess( 
-                        GetServiceFactory()->createInstance ( 
-                                ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ),
-                        uno::UNO_QUERY );
-
-        if ( !xTempAccess.is() )
-            throw uno::RuntimeException(); // TODO:
+        if ( m_pAntiImpl )
+            m_pAntiImpl->DeInit();
 
         uno::Reference< io::XInputStream > xInStream;
         try
         {
-            xInStream = xTempAccess->openFileRead( m_aTempURL );
+            xInStream.set( static_cast< io::XInputStream* >( new OSelfTerminateFileStream( GetServiceFactory(), m_aTempURL ) ), uno::UNO_QUERY );
         }
         catch( uno::Exception& )
         {
@@ -890,9 +887,6 @@ void OWriteStream_Impl::Commit()
         // TODO/NEW: Let the temporary file be removed after commit
         xNewPackageStream->setDataStream( xInStream );
         m_aTempURL = ::rtl::OUString();
-
-        if ( m_pAntiImpl )
-            m_pAntiImpl->DeInit();
     }
     else // if ( m_bHasInsertedStreamOptimization )
     {
@@ -2624,6 +2618,8 @@ void SAL_CALL OWriteStream::dispose()
             m_xInStream = uno::Reference< io::XInputStream >();
         }
 
+        m_xSeekable = uno::Reference< io::XSeekable >();
+
         m_pImpl->m_pAntiImpl = NULL;
 
         if ( !m_bInitOnDemand )
diff --git a/package/source/xstor/selfterminatefilestream.cxx b/package/source/xstor/selfterminatefilestream.cxx
new file mode 100644
index 0000000..dd41edb
--- /dev/null
+++ b/package/source/xstor/selfterminatefilestream.cxx
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ocompinstream.cxx,v $
+ * $Revision: 1.12 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_package.hxx"
+
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+
+#include "selfterminatefilestream.hxx"
+#include <comphelper/processfactory.hxx>
+
+using namespace ::com::sun::star;
+
+//-----------------------------------------------
+OSelfTerminateFileStream::OSelfTerminateFileStream( const uno::Reference< lang::XMultiServiceFactory > xFactory, const ::rtl::OUString& aURL )
+: m_aURL( aURL )
+{
+    uno::Reference< lang::XMultiServiceFactory > xOwnFactory = xFactory;
+    if ( !xOwnFactory.is() )
+        xOwnFactory.set( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW );
+
+    // IMPORTANT: The implementation is based on idea that m_xFileAccess, m_xInputStream and m_xSeekable are always set
+    // otherwise an exception is thrown in constructor
+
+    m_xFileAccess.set( xOwnFactory->createInstance (
+                            ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ),
+                       uno::UNO_QUERY_THROW );
+
+    m_xInputStream.set( m_xFileAccess->openFileRead( aURL ), uno::UNO_SET_THROW );
+    m_xSeekable.set( m_xInputStream, uno::UNO_QUERY_THROW );
+}
+
+//-----------------------------------------------
+OSelfTerminateFileStream::~OSelfTerminateFileStream()
+{
+    CloseStreamDeleteFile();
+}
+
+//-----------------------------------------------
+void OSelfTerminateFileStream::CloseStreamDeleteFile()
+{
+    try
+    {
+        m_xInputStream->closeInput();
+    }
+    catch( uno::Exception& )
+    {}
+
+    try
+    {
+        m_xFileAccess->kill( m_aURL );
+    }
+    catch( uno::Exception& )
+    {}
+}
+
+//-----------------------------------------------
+sal_Int32 SAL_CALL OSelfTerminateFileStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) 
+        throw ( io::NotConnectedException,
+                io::BufferSizeExceededException,
+                io::IOException,
+                uno::RuntimeException )
+{
+    return m_xInputStream->readBytes( aData, nBytesToRead );
+}
+
+//-----------------------------------------------
+sal_Int32 SAL_CALL OSelfTerminateFileStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) 
+        throw ( io::NotConnectedException,
+                io::BufferSizeExceededException,
+                io::IOException,
+                uno::RuntimeException )
+{
+    return m_xInputStream->readSomeBytes( aData, nMaxBytesToRead );
+}
+
+//-----------------------------------------------
+void SAL_CALL OSelfTerminateFileStream::skipBytes( sal_Int32 nBytesToSkip ) 
+        throw ( io::NotConnectedException,
+                io::BufferSizeExceededException,
+                io::IOException,
+                uno::RuntimeException )
+{
+    return m_xInputStream->skipBytes( nBytesToSkip );
+}
+
+//-----------------------------------------------
+sal_Int32 SAL_CALL OSelfTerminateFileStream::available(  ) 
+        throw ( io::NotConnectedException,
+                io::IOException,
+                uno::RuntimeException )
+{
+    return m_xInputStream->available();
+}
+
+//-----------------------------------------------
+void SAL_CALL OSelfTerminateFileStream::closeInput(  ) 
+        throw ( io::NotConnectedException,
+                io::IOException,
+                uno::RuntimeException )
+{
+    CloseStreamDeleteFile();
+}
+
+//-----------------------------------------------
+void SAL_CALL OSelfTerminateFileStream::seek( sal_Int64 location )
+        throw ( lang::IllegalArgumentException,
+                io::IOException,
+                uno::RuntimeException )
+{
+    m_xSeekable->seek( location );
+}
+
+//-----------------------------------------------
+sal_Int64 SAL_CALL OSelfTerminateFileStream::getPosition()
+        throw ( io::IOException, 
+                uno::RuntimeException)
+{
+    return m_xSeekable->getPosition();
+}
+
+//-----------------------------------------------
+sal_Int64 SAL_CALL OSelfTerminateFileStream::getLength()
+        throw ( io::IOException,
+                uno::RuntimeException )
+{
+    return m_xSeekable->getLength();
+}
+
diff --git a/package/source/xstor/selfterminatefilestream.hxx b/package/source/xstor/selfterminatefilestream.hxx
new file mode 100644
index 0000000..273674d
--- /dev/null
+++ b/package/source/xstor/selfterminatefilestream.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ocompinstream.hxx,v $
+ * $Revision: 1.7 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SELFTERMINATEFILESTREAM_HXX_
+#define _SELFTERMINATEFILESTREAM_HXX_
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+struct OWriteStream_Impl;
+
+class OSelfTerminateFileStream : public cppu::WeakImplHelper2< ::com::sun::star::io::XInputStream,
+                                                               ::com::sun::star::io::XSeekable >
+{
+protected:
+    ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > m_xFileAccess;
+
+    ::rtl::OUString m_aURL;
+
+    ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream;
+    ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xSeekable;
+
+public:
+    OSelfTerminateFileStream( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, const ::rtl::OUString& aURL );
+
+    virtual ~OSelfTerminateFileStream();
+
+    void CloseStreamDeleteFile();
+
+    // XInputStream
+    virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) 
+        throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+    virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) 
+        throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) 
+        throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+    virtual sal_Int32 SAL_CALL available() 
+        throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL closeInput() 
+        throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+    //XSeekable
+    virtual void SAL_CALL seek( sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+    virtual sal_Int64 SAL_CALL getPosition() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+    virtual sal_Int64 SAL_CALL getLength() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+};
+
+#endif
+
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 874efb7..35187ac 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -135,25 +135,6 @@ sal_Bool isLocalFile_Impl( ::rtl::OUString aURL )
     return ( aSystemPath.getLength() != 0 );
 }
 
-class PostinitializationGuard
-{
-    uno::Reference< io::XInputStream > m_xTempStream;
-
-    ZipPackage&                        m_rZipPackage;
-
-public:
-    PostinitializationGuard( const uno::Reference< io::XInputStream >& xTempStream,
-                             ZipPackage& rZipPackage )
-    : m_xTempStream( xTempStream )
-    , m_rZipPackage( rZipPackage )
-    {}
-
-    virtual ~PostinitializationGuard()
-    {
-        m_rZipPackage.ConnectTo( m_xTempStream );
-    }
-};
-
 }
 
 //===========================================================================
@@ -1380,8 +1361,8 @@ void SAL_CALL ZipPackage::commitChanges()
                     static_cast < OWeakObject * > ( this ), makeAny ( r ) );
         }
 
-        // switch to the new temporary stream only after the transfer
-        PostinitializationGuard aPostInitGuard( xTempInStream, *this );
+        // connect to the temporary stream
+        ConnectTo( xTempInStream );
 
         if ( m_eMode == e_IMode_XStream )
         {


More information about the ooo-build-commit mailing list