incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject svn commit: r1363673 [5/5] - in /incubator/ooo/trunk/main: filter/prj/ filter/source/config/fragments/ filter/source/config/fragments/filters/ filter/source/config/fragments/types/ filter/source/xmlfilterdetect/ filter/source/xslt/export/uof2/ filter/s...
Date Fri, 20 Jul 2012 08:24:52 GMT
Added: incubator/ooo/trunk/main/filter/source/xsltfilter/uof2storage.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/xsltfilter/uof2storage.hxx?rev=1363673&view=auto
==============================================================================
--- incubator/ooo/trunk/main/filter/source/xsltfilter/uof2storage.hxx (added)
+++ incubator/ooo/trunk/main/filter/source/xsltfilter/uof2storage.hxx Fri Jul 20 08:24:50
2012
@@ -0,0 +1,209 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ **************************************************************/
+ 
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+//This file is about the conversion of the UOF v2.0 and ODF document format from CS2C 20120610.
+#ifndef FILTER_SOURCE_XSLTFILTER_UOF2STORAGE_HXX
+#define FILTER_SOURCE_XSLTFILTER_UOF2STORAGE_HXX
+
+#include "containerhelper.hxx"
+
+#include <vector>
+
+#include <com/sun/star/uno/Reference.h>
+#include <rtl/ustring.hxx>
+
+namespace com { namespace sun { namespace star {
+	namespace embed { class XStorage; }
+	namespace io {
+		class XInputStream;
+		class XOutputStream;
+		class XStream;
+	}
+	namespace lang{
+		class XMultiServiceFactory;
+	}
+}}}
+
+namespace XSLT{
+
+const ::rtl::OUString METAELEMNAME = ::rtl::OUString::createFromAscii("_meta/meta.xml");
+const ::rtl::OUString UOFELEMNAME = ::rtl::OUString::createFromAscii("uof.xml");
+const ::rtl::OUString CONTENTELEMNAME = ::rtl::OUString::createFromAscii("content.xml");
+
+class StorageBase;
+typedef ::boost::shared_ptr< StorageBase > StorageRef;
+
+class StorageBase
+{
+public:
+	explicit StorageBase(
+		const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >&
rxInStream,
+		bool bBaseStreamAccess);
+
+	explicit StorageBase(
+		const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
+		bool bBaseStreamAccess);
+
+	virtual ~StorageBase();
+
+	/************************************************************************
+	* Returns true, if the object represents a valid storage
+	************************************************************************/
+	bool isStorage() const;
+
+	/************************************************************************
+	* Returns true, if the object represent the root storage               
+	************************************************************************/
+	bool isRootStorage()const;
+
+	/************************************************************************
+	* Returns true, if the storage operates in read-only mode(based on an
+	* input stream
+	************************************************************************/
+	bool isReadOnly()const;
+
+	/************************************************************************
+	* Returns the com.sun.star.embed.XStorage interface of the current storage
+	************************************************************************/
+	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+		getXStorage() const;
+
+	/** Returns the element name of this storage */
+	const ::rtl::OUString& getName() const;
+
+	::rtl::OUString getPath() const;
+
+	void getElementNames( ::std::vector< ::rtl::OUString >& orElementNames ) const;
+
+	StorageRef openSubStorage( const ::rtl::OUString& rStorageName, bool bCreatedMissing
);
+
+	::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+		openInputStream(const ::rtl::OUString& rStreamName);
+
+	::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+		openOutputStream(const ::rtl::OUString& rStreamName);
+
+	void copyToStorage(StorageBase& rDestStrg, const ::rtl::OUString& rElementName );
+
+	void copyStorageToStorage(StorageBase& rDestStrg);
+
+	void commit();
+protected:
+	explicit StorageBase( const StorageBase& rParentStorage, const ::rtl::OUString&
rStorageName, bool bReadOnly );
+private:
+	StorageBase( const StorageBase& );
+	StorageBase& operator = (const StorageBase& );
+
+	virtual bool implIsStorage() const = 0;
+
+	virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+		implGetXStorage() const = 0;
+
+	virtual void implGetElementNames( ::std::vector< ::rtl::OUString >& orElementNames
) const = 0;
+
+	virtual StorageRef implOpenSubStorage( const ::rtl::OUString& rElementName, bool bCreate
) = 0;
+
+	virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+		implOpenInputStream( const ::rtl::OUString& rElementName ) = 0;
+
+	virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+		implOpenOutputStream( const ::rtl::OUString& rElementName ) = 0;
+
+	virtual void implCommit() const = 0;
+
+	StorageRef getSubStorage( const ::rtl::OUString& rElementName, bool bCreateMissing );
+private:
+	typedef RefMap< ::rtl::OUString, StorageBase > SubStorageMap;
+
+	SubStorageMap m_aSubStorages;///Map of direct sub storages.
+	::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInStream;///Cached
base input stream(to keep it alive)
+	::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xOutStream;///
Cached base output stream(to keep it alive)
+	::rtl::OUString m_aParentPath;///Full path of parent storage
+	::rtl::OUString m_aStorageName;///Name of this storage, if it is a substorage
+	bool m_bBaseStreamAccess;///True = access base streams with empty stream name.
+	bool m_bReadOnly; ///True = storage opened read-only (based on input stream)
+};
+
+class ZipStorage : public StorageBase
+{
+public:
+	explicit ZipStorage(
+		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory
>& rxFactory,
+		const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >&
rxInStream);
+
+	explicit ZipStorage(
+		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory
>& rxFactory,
+		const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxStream);
+
+	virtual ~ZipStorage();
+
+private:
+	explicit ZipStorage(
+		const ZipStorage& rParentStorage,
+		const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >&
rxStorage,
+		const ::rtl::OUString& rElementName);
+
+	virtual bool implIsStorage() const;
+
+	virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+		implGetXStorage() const;
+
+	virtual void implGetElementNames( ::std::vector< ::rtl::OUString >& orElementNames
) const;
+
+	virtual StorageRef implOpenSubStorage( const ::rtl::OUString& rElementName, bool bCreatedMissing
);
+
+	virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+		implOpenInputStream( const ::rtl::OUString& rElementName );
+
+	virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+		implOpenOutputStream( const ::rtl::OUString& rElementName );
+
+	virtual void implCommit() const;
+
+private:
+	typedef ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > XStorageRef;
+	XStorageRef m_xStorage;
+};
+
+class UOF2Storage
+{
+public:
+	explicit UOF2Storage( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory
>& rxFactory,
+		const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >&
rxInStream );
+
+	explicit UOF2Storage( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory
>& rxFactory,
+		const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream
);
+
+	~UOF2Storage();
+
+	::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getMetaInputStream()
const;
+	::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > getMetaOutputStream(bool
bMissingCreate);
+
+	bool isValidUOF2Doc() const;// just for UOF2 document import
+
+	StorageRef getMainStorageRef(){ return m_pMainStorage; }
+private:
+	StorageRef m_pMainStorage;
+};
+
+}
+#endif

Modified: incubator/ooo/trunk/main/scp2/source/ooo/directory_ooo.scp
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/scp2/source/ooo/directory_ooo.scp?rev=1363673&r1=1363672&r2=1363673&view=diff
==============================================================================
--- incubator/ooo/trunk/main/scp2/source/ooo/directory_ooo.scp (original)
+++ incubator/ooo/trunk/main/scp2/source/ooo/directory_ooo.scp Fri Jul 20 08:24:50 2012
@@ -420,6 +420,16 @@ Directory gid_Dir_Share_Xslt_Import_uof
     ParentID = gid_Dir_Share_Xslt_Import;
     DosName = "uof";
 End
+///Begin Added by wangyumin for uof2-filter from cs2c yumin.wang@cs2c.com.cn on 2012-2-22
14:32:18
+Directory gid_Dir_Share_Xslt_Export_uof2
+    ParentID = gid_Dir_Share_Xslt_Export;
+    DosName = "uof2";
+End
+Directory gid_Dir_Share_Xslt_Import_uof2
+    ParentID = gid_Dir_Share_Xslt_Import;
+    DosName = "uof2";
+End
+/// End Added by wangyumin on 2012-2-22 14:32:18
 Directory gid_Dir_Share_Xslt_Export_Wordml
     ParentID = gid_Dir_Share_Xslt_Export;
     DosName = "wordml";

Modified: incubator/ooo/trunk/main/scp2/source/ooo/file_ooo.scp
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/scp2/source/ooo/file_ooo.scp?rev=1363673&r1=1363672&r2=1363673&view=diff
==============================================================================
--- incubator/ooo/trunk/main/scp2/source/ooo/file_ooo.scp (original)
+++ incubator/ooo/trunk/main/scp2/source/ooo/file_ooo.scp Fri Jul 20 08:24:50 2012
@@ -1445,6 +1445,21 @@ File gid_File_Xsl_Import_uof_uof2odf_pre
     Dir = gid_Dir_Share_Xslt_Import_uof;
     Name = "/xslt/import/uof/uof2odf_presentation.xsl";
 End
+/// This is added by wangyumin for uof2-filter from cs2c yumin.wang@cs2c.com.cn on 2012-5-22
14:23:39
+File  gid_File_Xsl_Export_uof2_odf2uof
+    TXT_FILE_BODY;
+    Styles = (PACKED);
+    Dir = gid_Dir_Share_Xslt_Export_uof2;
+    Name = "/xslt/export/uof2/odf2uof.xsl";
+End
+
+File gid_File_Xsl_Import_uof2_uof2odf
+    TXT_FILE_BODY;
+    Styles = (PACKED);
+    Dir = gid_Dir_Share_Xslt_Import_uof2;
+    Name = "/xslt/import/uof2/uof2odf.xsl";
+End
+/// End added by wangyumin on 2012-5-22 14:23:39
 File gid_File_Xsl_Export_Wordml_Ooo2wordml_Border
     TXT_FILE_BODY;
     Styles = (PACKED);

Modified: incubator/ooo/trunk/main/scp2/source/ooo/module_hidden_ooo.scp
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/scp2/source/ooo/module_hidden_ooo.scp?rev=1363673&r1=1363672&r2=1363673&view=diff
==============================================================================
--- incubator/ooo/trunk/main/scp2/source/ooo/module_hidden_ooo.scp (original)
+++ incubator/ooo/trunk/main/scp2/source/ooo/module_hidden_ooo.scp Fri Jul 20 08:24:50 2012
@@ -186,6 +186,7 @@ Module gid_Module_Root_Files_4
 	gid_File_Lib_Lng,
 	gid_File_Lib_Offacc,
 	gid_File_Lib_Oox,
+	gid_File_Lib_Uof,/** This is added by wangyumin from on 2012-05-20. */
 	gid_File_Lib_Pcr,
 	gid_File_Lib_Pdffilter,
 	gid_File_Lib_Pk,



Mime
View raw message