<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zhaoshzh</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zhaoshzh"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Zhaoshzh"/>
	<updated>2026-05-05T22:25:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Uno/Cpp/Tutorials/component_tutorial&amp;diff=232857</id>
		<title>Uno/Cpp/Tutorials/component tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Uno/Cpp/Tutorials/component_tutorial&amp;diff=232857"/>
		<updated>2014-01-17T08:32:32Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This tutorial is a general example of how to write a UNO component and how to use it in applications, for example StarOffice or OpenOffice.org. This example is written in C++, however differences for implementing the component in Java will be mentioned.&lt;br /&gt;
&lt;br /&gt;
The component is a basic counter, whose value can be set, read, incremented and decremented.&lt;br /&gt;
&lt;br /&gt;
= Interfaces =&lt;br /&gt;
&lt;br /&gt;
The first step, in writing any component (in almost any language environment) is to specify one or more interfaces that the component must implement.&lt;br /&gt;
&lt;br /&gt;
Interfaces are the key to hiding implementation details in any modern development environment. They are contracts between a client that wants to use a components&amp;#039; functionality and the component (serving this functionality). In UNO terminology, UNO components are called services.&lt;br /&gt;
&lt;br /&gt;
Interfaces separate the specific implementation (there can more than one for a service) from the usage. The client using the component does not have any insight how the component is implemented.&lt;br /&gt;
&lt;br /&gt;
Interfaces are specified using an Interface definition language (IDL). UNO uses UNO-IDL as the interface definition language. An interface for a Counter might look like this:&lt;br /&gt;
&lt;br /&gt;
file counter.idl:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/uno/XInterface.idl&amp;gt;&lt;br /&gt;
module foo&lt;br /&gt;
{&lt;br /&gt;
   /**&lt;br /&gt;
     * Interface to count things.&lt;br /&gt;
     */&lt;br /&gt;
    [ uik(3806AFF0-75A0-11d3-87B300A0-24494732), ident(&amp;quot;XCountable&amp;quot;, 1.0) ]&lt;br /&gt;
    interface XCountable : com::sun::star::uno::XInterface&lt;br /&gt;
    {&lt;br /&gt;
        long getCount();&lt;br /&gt;
        void setCount( [in] long nCount );&lt;br /&gt;
        long increment();&lt;br /&gt;
        long decrement();&lt;br /&gt;
    };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any interface that is specified is derived from XInterface, the basic interface in UNO. The XInterface has methods for lifetime control of the interface (acquire() and release()) and the ability to query for further interfaces of the UNO object (queryInterface()). Once you have an interface of an object, you can query for any others the object provides. If there are no acquired interfaces (references) left on an UNO object, the object might disappear. Interfaces (and services) can be grouped in modules to avoid pollution of the global namespace.&lt;br /&gt;
&lt;br /&gt;
= Services =&lt;br /&gt;
&lt;br /&gt;
Any UNO component (service) exports one or more interfaces that the clients are using. All services are specified using the service directive in an IDL file: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;idl&amp;quot;&amp;gt;&lt;br /&gt;
module foo &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    service Counter&lt;br /&gt;
    {&lt;br /&gt;
        // exported interfaces:&lt;br /&gt;
        interface XCountable;&lt;br /&gt;
    };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The service declaration introduces a service called foo.Counter which supports the XCountable interface.&lt;br /&gt;
&lt;br /&gt;
There are some more IDL features, e.g. attributes, structs, enums, that are omitted at this time. All IDL declarations are put into a typelibrary file (rdb file). This speeds up the back end generation of the language specific files.&lt;br /&gt;
&lt;br /&gt;
To implement the interfaces, the appropriate interface code for the implementation language has to be generated from the rdb file.&lt;br /&gt;
&lt;br /&gt;
In C++ a tool called cppumaker generates pure abstract classes that the component has to implement. This is a common way to describe interfaces in C++. The Java language directly supports interfaces as a language feature (javamaker will generate Java interfaces).&lt;br /&gt;
&lt;br /&gt;
= Implementation =&lt;br /&gt;
&lt;br /&gt;
A component that is implemented in C++ is normally packaged in a shared library. This shared lib exports two symbols, which are explained further below. Java implementations are normally packaged in a JAR file. In this case the manifest file identifies a class implementing two methods with similar semantics.&lt;br /&gt;
&lt;br /&gt;
A simple implementation of the counting UNO service foo.Counter might be:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
//file foo.cxx:&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;rtl/ustring.hxx&amp;gt;&lt;br /&gt;
#include &amp;lt;cppuhelper/implbase1.hxx&amp;gt;&lt;br /&gt;
#include &amp;lt;cppuhelper/factory.hxx&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XSingleServiceFactory.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/lang/XMultiServiceFactory.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;com/sun/star/registry/XRegistryKey.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;foo/XCountable.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace rtl;&lt;br /&gt;
using namespace com::sun::star::uno;&lt;br /&gt;
using namespace com::sun::star::lang;&lt;br /&gt;
using namespace com::sun::star::registry;&lt;br /&gt;
using namespace foo;&lt;br /&gt;
&lt;br /&gt;
//==================================================================================================&lt;br /&gt;
class MyCounterImpl : public cppu::WeakImplHelper1&amp;lt; XCountable &amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	// to obtain other services if needed&lt;br /&gt;
	Reference&amp;lt; XMultiServiceFactory &amp;gt; _xServiceManager;&lt;br /&gt;
	&lt;br /&gt;
	sal_Int32 _nCount;&lt;br /&gt;
	&lt;br /&gt;
	Reference&amp;lt; XText &amp;gt; _xText;&lt;br /&gt;
	void dump( sal_Int32 nValue ) const;&lt;br /&gt;
	&lt;br /&gt;
public:&lt;br /&gt;
	MyCounterImpl( const Reference&amp;lt; XMultiServiceFactory &amp;gt; &amp;amp; xServiceManager );&lt;br /&gt;
	virtual ~MyCounterImpl();&lt;br /&gt;
	&lt;br /&gt;
	// XCountable implementation&lt;br /&gt;
	virtual sal_Int32 SAL_CALL getCount() throw (RuntimeException);&lt;br /&gt;
	virtual void SAL_CALL setCount( sal_Int32 nCount ) throw (RuntimeException);&lt;br /&gt;
	virtual sal_Int32 SAL_CALL increment() throw (RuntimeException);&lt;br /&gt;
	virtual sal_Int32 SAL_CALL decrement() throw (RuntimeException);&lt;br /&gt;
};&lt;br /&gt;
//__________________________________________________________________________________________________&lt;br /&gt;
MyCounterImpl::MyCounterImpl( const Reference&amp;lt; XMultiServiceFactory &amp;gt; &amp;amp; xServiceManager )&lt;br /&gt;
	: _xServiceManager( xServiceManager )&lt;br /&gt;
{&lt;br /&gt;
	cerr &amp;lt;&amp;lt; &amp;quot;&amp;lt; MyCounterImpl ctor called &amp;gt;&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
&lt;br /&gt;
	if (_xServiceManager.is())&lt;br /&gt;
	{&lt;br /&gt;
		Reference&amp;lt; XComponentLoader &amp;gt; xLoader( _xServiceManager-&amp;gt;createInstance(&lt;br /&gt;
			L&amp;quot;com.sun.star.frame.Desktop&amp;quot; ), UNO_QUERY );&lt;br /&gt;
		if (xLoader.is())&lt;br /&gt;
		{&lt;br /&gt;
			Reference&amp;lt; XTextDocument &amp;gt; xDoc( xLoader-&amp;gt;loadComponentFromURL(&lt;br /&gt;
				L&amp;quot;private:scalc/factory&amp;quot;, L&amp;quot;_blank&amp;quot;, 0, Sequence&amp;lt; PropertyValue &amp;gt;() ), UNO_QUERY );&lt;br /&gt;
			if (xDoc.is())&lt;br /&gt;
				_xText = xTextDoc-&amp;gt;getText();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
//__________________________________________________________________________________________________&lt;br /&gt;
MyCounterImpl::~MyCounterImpl()&lt;br /&gt;
{&lt;br /&gt;
	cerr &amp;lt;&amp;lt; &amp;quot;&amp;lt; MyCounterImpl dtor called &amp;gt;&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
}&lt;br /&gt;
//__________________________________________________________________________________________________&lt;br /&gt;
void MyCounterImpl::dump( sal_Int32 nValue ) const&lt;br /&gt;
{&lt;br /&gt;
	if (_xText.is())&lt;br /&gt;
		_xText-&amp;gt;setValue( nValue );&lt;br /&gt;
	else&lt;br /&gt;
		cerr &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; nValue;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// XCountable implementation&lt;br /&gt;
//__________________________________________________________________________________________________&lt;br /&gt;
sal_Int32 MyCounterImpl::getCount() throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
	return _nCount;&lt;br /&gt;
}&lt;br /&gt;
//__________________________________________________________________________________________________&lt;br /&gt;
void MyCounterImpl::setCount( sal_Int32 nCount ) throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
	_nCount = nCount;&lt;br /&gt;
	dump( _nCount );&lt;br /&gt;
}&lt;br /&gt;
//__________________________________________________________________________________________________&lt;br /&gt;
sal_Int32 MyCounterImpl::increment() throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
	++_nCount;&lt;br /&gt;
	dump( _nCount );&lt;br /&gt;
	return _nCount;&lt;br /&gt;
}&lt;br /&gt;
//__________________________________________________________________________________________________&lt;br /&gt;
sal_Int32 MyCounterImpl::decrement() throw (RuntimeException)&lt;br /&gt;
{&lt;br /&gt;
	--_nCount;&lt;br /&gt;
	dump( _nCount );&lt;br /&gt;
	return _nCount;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Function to create a new component instance; is needed by factory helper implementation.&lt;br /&gt;
 * @param xMgr service manager to if the components needs other component instances&lt;br /&gt;
 */&lt;br /&gt;
Reference&amp;lt; XInterface &amp;gt; MyCounterImpl_create(&lt;br /&gt;
	const Reference&amp;lt; XMultiServiceFactory &amp;gt; &amp;amp; xMgr )&lt;br /&gt;
{&lt;br /&gt;
	return Reference&amp;lt; XInterface &amp;gt;( new MyCounterImpl( xMgr ) );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Documentation/Caution|The instanciation of a component has changed since this article has been written. The constructor has to use a context instead of a service manager [[Documentation/DevGuide/ProUNO/Service_Manager_and_Component_Context|(see Developer&amp;#039;s Guide)]].}}&lt;br /&gt;
&lt;br /&gt;
The generated header file declares an abstract C++ class and a function called getCppuType(). Any generated type has its getCppuType() describing the type, for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
const com::sun::star::uno::Type &amp;amp; SAL_CALL getCppuType( const com::sun::star::uno::Reference&amp;lt; foo::XCountable &amp;gt; * );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
describes the XCountable interface. Only the type of the parameter is of importance. By using overloaded getCppuType() functions for any type, it is possible to get runtime type information. It is also possible to use little helpers like a template queryInterface() function used for the implementation of XInterface::queryInterface().&lt;br /&gt;
&lt;br /&gt;
So how is the UNO component instantiated? As mentioned above, four symbols are exported by the shared library, providing four functions: component_getDescriptionFunc(), component_getImplementationEnvironment(), component_writeInfo() and component_getFactory().&lt;br /&gt;
&lt;br /&gt;
The first is called to get a description of the component. This function returns a XML formatted string which describes the component. This function could be generated from the XML description with the xml2cmp tool. Each component should provide such a XML description. The second is called from a loader service to get information about the used environment of the component. The third is called whenever the component is registered in some registry file and the latter is called to obtain a factory to get instances of the component.&lt;br /&gt;
&lt;br /&gt;
They are typically implemented as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * This function returns the name of the used environment.&lt;br /&gt;
 * @param ppEnvTypeName name of the environment&lt;br /&gt;
 * @param ppEnv could be point to a special environment, this parameter is normally set to null&lt;br /&gt;
 */&lt;br /&gt;
extern &amp;quot;C&amp;quot; void SAL_CALL component_getImplementationEnvironment(&lt;br /&gt;
    const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )&lt;br /&gt;
{&lt;br /&gt;
    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
/**&lt;br /&gt;
 * This function creates an implementation section in the registry and another subkey&lt;br /&gt;
 * for each supported service.&lt;br /&gt;
 * @param pServiceManager generic uno interface providing a service manager&lt;br /&gt;
 * @param pRegistryKey generic uno interface providing registry key to write&lt;br /&gt;
 */&lt;br /&gt;
extern &amp;quot;C&amp;quot; sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )&lt;br /&gt;
{&lt;br /&gt;
    if (pRegistryKey)&lt;br /&gt;
    {&lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
           Reference&amp;lt; XRegistryKey &amp;gt; xNewKey(&lt;br /&gt;
              reinterpret_cast&amp;lt; XRegistryKey * &amp;gt;( pRegistryKey )-&amp;gt;createKey(&lt;br /&gt;
                 OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;/foo.MyCounterImpl/UNO/SERVICES&amp;quot;) ) ) );&lt;br /&gt;
           xNewKey-&amp;gt;createKey( OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;foo.Counter&amp;quot;) ) );&lt;br /&gt;
           return sal_True;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return sal_False;&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
component_writeInfo() will write information about all service implementations that are in the shared library. Each service implementation is registered under its implementation name in the implementation section, followed by its service name. The hierarchical structure of the registry is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/IMPLEMENTATIONS/&lt;br /&gt;
    /foo.MyCounterImpl                    // implementation name&lt;br /&gt;
        /UNO&lt;br /&gt;
            /SERVICES&lt;br /&gt;
                /foo.Counter        // service name&lt;br /&gt;
    /bar.AnotherCounterImpl           // implementation name&lt;br /&gt;
       /UNO&lt;br /&gt;
           /SERVICES&lt;br /&gt;
               /foo.Counter        // service name&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Function to create a new component instance; is needed by factory helper implementation.&lt;br /&gt;
 * @param xMgr service manager to if the components needs other component instances&lt;br /&gt;
 */&lt;br /&gt;
Reference&amp;lt; XInterface &amp;gt; MyCounterImpl_create( const Reference&amp;lt; XMultiServiceFactory &amp;gt; &amp;amp; xMgr )&lt;br /&gt;
{&lt;br /&gt;
    return Reference&amp;lt; XInterface &amp;gt;( new MyCounterImpl( xMgr ) );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * This function is called to get service factories for an implementation.&lt;br /&gt;
 * @param pImplName name of implementation&lt;br /&gt;
 * @param pServiceManager generic uno interface providing a service manager to instantiate components&lt;br /&gt;
 * @param pRegistryKey registry data key to read and write component persistent data&lt;br /&gt;
 * @return a component factory (generic uno interface)&lt;br /&gt;
 */&lt;br /&gt;
extern &amp;quot;C&amp;quot; void * SAL_CALL component_getFactory(&lt;br /&gt;
    const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )&lt;br /&gt;
{&lt;br /&gt;
    void * pRet = 0;&lt;br /&gt;
    // which implementation is required?&lt;br /&gt;
    if (pServiceManager &amp;amp;&amp;amp; rtl_str_compare( pImplName, &amp;quot;foo.MyCounterImpl&amp;quot; ))&lt;br /&gt;
    {&lt;br /&gt;
        rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;foo.Counter&amp;quot;) );&lt;br /&gt;
        Reference&amp;lt; XSingleServiceFactory &amp;gt; xFactory(&lt;br /&gt;
           cppu::createSingleFactory( // helper function from cppuhelper lib&lt;br /&gt;
           reinterpret_cast&amp;lt; XMultiServiceFactory * &amp;gt;( pServiceManager ),&lt;br /&gt;
           OUString( RTL_CONSTASCII_USTRINGPARAM(&amp;quot;foo.MyCounterImpl&amp;quot;) ),&lt;br /&gt;
           MyCounterImpl_create,&lt;br /&gt;
           Sequence&amp;lt; rtl::OUString &amp;gt;( &amp;amp;aServiceName, 1 ) ) );&lt;br /&gt;
        if (xFactory.is())&lt;br /&gt;
        {&lt;br /&gt;
           xFactory.acquire();&lt;br /&gt;
           pRet = xFactory.get();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return pRet;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
component_getFactory() demands a certain implementation from the shared library. The returned uno interface is a component factory that is used to produce service instances of the component implementation. The first parameter identifies the name of the required implementation. This name must correspond to the registered one from component_writeInfo(). The second parameter provides a service manager instance, components can use this for getting further components. The last parameter provides a registry key to the implementation section of the component, so it can read and write persistent data to the registry, e.g. for booting.&lt;br /&gt;
&lt;br /&gt;
When working in the OpenOffice build framework, make sure to add these functions to the util/NAME.map file, eg&lt;br /&gt;
when adding the first UNO service to calc&amp;#039;s scfilt library, do &lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
--- sc/util/scfilt.map&lt;br /&gt;
+++ sc/util/scfilt.map&lt;br /&gt;
@@ -1,6 +1,9 @@&lt;br /&gt;
 SCFILT_1_0 {&lt;br /&gt;
   global:&lt;br /&gt;
     ScFilterCreate;&lt;br /&gt;
+    component_getImplementationEnvironment;&lt;br /&gt;
+    component_writeInfo;&lt;br /&gt;
+    component_getFactory;&lt;br /&gt;
   local:&lt;br /&gt;
     *;&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and that you tell scp2 the library is a UNO library, in the case of scfilt, do&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
--- scp2/source/calc/file_calc.scp&lt;br /&gt;
+++ scp2/source/calc/file_calc.scp&lt;br /&gt;
@@ -49,7 +49,7 @@ STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sc, sc)&lt;br /&gt;
 &lt;br /&gt;
 STD_LIB_FILE_PATCH( gid_File_Lib_Scui, scui)&lt;br /&gt;
 &lt;br /&gt;
-STD_LIB_FILE( gid_File_Lib_Scfilt, scfilt)&lt;br /&gt;
+STD_UNO_LIB_FILE( gid_File_Lib_Scfilt, scfilt)&lt;br /&gt;
 &lt;br /&gt;
 STD_UNO_LIB_FILE( gid_File_Lib_Scd, scd)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=Attentions after Passive Component Registration=&lt;br /&gt;
1. create a new .component file,for example,&lt;br /&gt;
create scfilt.component in sc/util,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&amp;lt;component loader=&amp;quot;com.sun.star.loader.SharedLibrary&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
xmlns=&amp;quot;http://openoffice.org/2010/uno-components&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;implementation name=&amp;quot;com.sun.star.comp.ExcelFilterExport&amp;quot;&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
&amp;lt;service name=&amp;quot;com.sun.star.document.ExportFilter&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/implementation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/component&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
2. add the new component in the make file,for example,&lt;br /&gt;
add scfilt.component,the code should like this:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
ALLTAR : $(MISC)/sc.component $(MISC)/scfilt.component $(MISC)/scd.component $(MISC)/vbaobj.component&lt;br /&gt;
&lt;br /&gt;
$(MISC)/sc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \&lt;br /&gt;
        sc.component&lt;br /&gt;
    $(XSLTPROC) --nonet --stringparam uri \&lt;br /&gt;
        &amp;#039;$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)&amp;#039; -o $@ \&lt;br /&gt;
        $(SOLARENV)/bin/createcomponent.xslt sc.component&lt;br /&gt;
&lt;br /&gt;
$(MISC)/scfilt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \&lt;br /&gt;
        scfilt.component&lt;br /&gt;
    $(XSLTPROC) --nonet --stringparam uri \&lt;br /&gt;
        &amp;#039;$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL6TARGETN:f)&amp;#039; -o $@ \&lt;br /&gt;
        $(SOLARENV)/bin/createcomponent.xslt scfilt.component&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. deliver the .component file.for example,&lt;br /&gt;
in sc/prj/d.lst&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
..\%__SRC%\misc\scfilt.component %_DEST%\xml%_EXT%\scfilt.component&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
4. if your service implement is a DLL,then add the module component to the list in &lt;br /&gt;
&lt;br /&gt;
postprocess/packcomponets/makefile.mk,for example,&lt;br /&gt;
add &amp;#039;scfilt&amp;#039;to the list of my_components.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Author: Daniel Bölzle ($Date: 2004/11/17 12:41:00 $)&lt;br /&gt;
Copyright 2001 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
* [[Constructing_Components|Constructing Components]]&lt;br /&gt;
* [[Component_and_Dialog|The Counter Component with a dialog]]&lt;br /&gt;
* [[Uno/Cpp/Tutorials/Introduction_to_Cpp_Uno|C++ and UNO tutorial]]&lt;br /&gt;
* [[UNO_component_packaging|Component with Python]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Uno]]&lt;br /&gt;
[[Category:Uno:Cpp]]&lt;br /&gt;
[[Category:Tutorial]]&lt;br /&gt;
[[Category:Cpp]]&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Add-In]]&lt;br /&gt;
[[Category:Add-On]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:JavaEclipseTuto&amp;diff=232702</id>
		<title>Talk:JavaEclipseTuto</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:JavaEclipseTuto&amp;diff=232702"/>
		<updated>2014-01-10T23:16:18Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is there some reason that this is called JavaEclipseTuto instead of JavaEclipesTutorial??&lt;br /&gt;
--[[User:Mikeleib|Mikeleib]] 21:52, 17 March 2006 (CET)&lt;br /&gt;
To make it shorter, but if you mind it would be better... I don&amp;#039;t see any problem&lt;br /&gt;
&lt;br /&gt;
--[[User:Cedricbosdo|cedricbosdo]] 09:51, 19 March 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m trying to get a Java component working in OpenOffice, but for some reason I&amp;#039;m not very lucky at it. &lt;br /&gt;
So I took some step&amp;#039;s back and tried your HelloWorld example by the letter.&lt;br /&gt;
&lt;br /&gt;
I still have no successfull creation of a Java component, but I do have some observations and questions.&lt;br /&gt;
&lt;br /&gt;
When I follow the example, an implementation class file pops up in gedit (source/org/openoffice/helloworld/HelloworldImpl)&lt;br /&gt;
The generated MANIFEST.MF searches that file like:&lt;br /&gt;
  ManifestVersion: 1.0&lt;br /&gt;
  RegistrationClassName: org.openoffice.helloworld.comp.HelloworldImpl &lt;br /&gt;
There is also a class org.openoffice.helloworld.Helloworld. (I assume this is generated by a tool like JavaMaker?).&lt;br /&gt;
This is also the class which is refered to in &amp;#039;types.rdb&amp;#039; and &amp;#039;Helloworld.rdb&amp;#039; &lt;br /&gt;
I have the impression, this should be &amp;#039;HelloworldImpl&amp;#039;. (EDIT: Obviously not)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When I try to export the project, there is an error message about &amp;#039;services.rdb&amp;#039;: &lt;br /&gt;
&lt;br /&gt;
[[Image:Package-export-error.png]]&lt;br /&gt;
&lt;br /&gt;
So my questions are:&lt;br /&gt;
* Should I implement HelloworldImpl or Helloworld (EDIT: the Impl)&lt;br /&gt;
* If not the latter, what&amp;#039;s the purpose of Helloworld. (SOme kind of placeholder?)&lt;br /&gt;
* What must be done to get rid of the services.rdb missing message&lt;br /&gt;
* can I view error messages or obtain a list of executed commands somewhere (ah, I will do as said in the troubleshooting page. (Not very informative though))&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m using SDK 2.2 (680m6)(and also 680m14 from Ubuntu:feisty) and OpenOffice 2.2.0-1ubuntu3&lt;br /&gt;
&lt;br /&gt;
* EDIT 1: using the distribution SDK seems to help a lot indeed. I can generate a HelloworldImpl now.&lt;br /&gt;
* EDIT 2: well, it seems to work. I created my own project, and the export worked. However, I had to change something&lt;br /&gt;
(removed and reimported it to eclipse) and the export does not seem to work anymore (An internal error occured during &amp;quot;Package export job&amp;quot;). What are the pre-requisites? How can I find out what&amp;#039;s going wrong. (I could find no relevant message in workspace/.metadata/.log)&lt;br /&gt;
* EDIT 3: Appart from &amp;#039;export&amp;#039;, I got my project functioning also (10 July).&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
--[[User:Steckelfisch|Steckelfisch]] 9-11 July 2007&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------&lt;br /&gt;
when you build ooeclipseintegration&lt;br /&gt;
you should add parameter of -Dopenoffice.home and -Declipse.home&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStyles_OoxML&amp;diff=207698</id>
		<title>Calc/Performance/CellStyles OoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStyles_OoxML&amp;diff=207698"/>
		<updated>2012-10-19T03:07:03Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Performance/CellStyles OoxML to Calc/Performance/CellStylesOfOoxML over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Calc/Performance/CellStylesOfOoxML]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=207697</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=207697"/>
		<updated>2012-10-19T03:07:03Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Performance/CellStyles OoxML to Calc/Performance/CellStylesOfOoxML over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Performance/CellStylesInOoxML]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
[[Category:Done]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
*the used styles should be imported.&lt;br /&gt;
*the unused duplicate styles should be imported only once.&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=207695</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=207695"/>
		<updated>2012-10-19T03:06:16Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Performance/CellStylesOfOoxML to Calc/Performance/CellStyles OoxML&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Performance/CellStylesInOoxML]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
[[Category:Done]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
*the used styles should be imported.&lt;br /&gt;
*the unused duplicate styles should be imported only once.&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=207694</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=207694"/>
		<updated>2012-10-19T03:04:10Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Performance/CellStylesInOoxML]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
[[Category:Done]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
*the used styles should be imported.&lt;br /&gt;
*the unused duplicate styles should be imported only once.&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205423</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205423"/>
		<updated>2012-09-21T05:32:29Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Performance/CellStylesInOoxML]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
[[Category:Done]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205422</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205422"/>
		<updated>2012-09-21T05:29:51Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|! Performance]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesInOoxML&amp;diff=205421</id>
		<title>Calc/Performance/CellStylesInOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesInOoxML&amp;diff=205421"/>
		<updated>2012-09-21T03:36:06Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Performance/CellStylesInOoxML to Calc/Performance/CellStylesOfOoxML&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Calc/Performance/CellStylesOfOoxML]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205420</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205420"/>
		<updated>2012-09-21T03:36:06Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Performance/CellStylesInOoxML to Calc/Performance/CellStylesOfOoxML&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Performance/{{SUBPAGENAME}}]]&lt;br /&gt;
[[Category:Done]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205419</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205419"/>
		<updated>2012-09-21T03:35:14Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Calc|Performance/{{SUBPAGENAME}}]]&lt;br /&gt;
[[Category:Done]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205418</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205418"/>
		<updated>2012-09-21T03:33:11Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:Calc Performance Optimizations for CellStylesInOoxML}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205417</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205417"/>
		<updated>2012-09-21T03:31:00Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf&amp;#039;s) which define the formatting for all named cell styles &lt;br /&gt;
in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, &lt;br /&gt;
font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records &lt;br /&gt;
also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border &lt;br /&gt;
or not. &lt;br /&gt;
*cellXfs&lt;br /&gt;
&lt;br /&gt;
This element contains the master formatting records (xf) which define the formatting applied to cells in this &lt;br /&gt;
workbook. These records are the starting point for determining the formatting for a cell. Cells in the Sheet Part &lt;br /&gt;
reference the xf records by zero-based index. &lt;br /&gt;
&lt;br /&gt;
*cellStyles&lt;br /&gt;
This element contains the named cell styles, consisting of a sequence of named style records. A named cell style &lt;br /&gt;
is a collection of direct or themed formatting (e.g., cell border, cell fill, and font type/size/style) grouped &lt;br /&gt;
together into a single named style, and can be applied to a cell. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the relationship.&lt;br /&gt;
&lt;br /&gt;
[[File:Cellstyle_relationship.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
In this solution:&lt;br /&gt;
&lt;br /&gt;
1. if there are two same cell styles,named &amp;quot;style1&amp;quot; and &amp;quot;style2&amp;quot;,&lt;br /&gt;
if a cell uses the second one,all the two cell styles will be created.&lt;br /&gt;
&lt;br /&gt;
2. if there are two different cell styles, all the styles will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
3. if there are two same cell styles, but they are used by different cells,&lt;br /&gt;
all of them will be imported to spreadsheet.&lt;br /&gt;
&lt;br /&gt;
4. if there are two same cell styles, and they are not used by any cell,&lt;br /&gt;
only import the first one to spreadsheet.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Cellstyle_relationship.JPG&amp;diff=205416</id>
		<title>File:Cellstyle relationship.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Cellstyle_relationship.JPG&amp;diff=205416"/>
		<updated>2012-09-21T02:49:24Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205415</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205415"/>
		<updated>2012-09-21T02:47:53Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
In MS 2007 .xlsx file,there are 3 items to record the cell style.&lt;br /&gt;
*cellStyle&lt;br /&gt;
*cellStyles&lt;br /&gt;
*cellStyleXfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205414</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205414"/>
		<updated>2012-09-21T02:42:17Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
&lt;br /&gt;
		F+D: 4,810,522&lt;br /&gt;
	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue&lt;br /&gt;
	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues&lt;br /&gt;
	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	&lt;br /&gt;
4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205413</id>
		<title>Calc/Performance/CellStylesOfOoxML</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Performance/CellStylesOfOoxML&amp;diff=205413"/>
		<updated>2012-09-21T02:40:12Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: Created page with &amp;quot; If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo, it will take about 20 seconds to create the cell styles. After analyze the sample file, th…&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
If there are a lot of cell styles in MS 2007 .xlsx file, when loading the file in Aoo,&lt;br /&gt;
it will take about 20 seconds to create the cell styles.&lt;br /&gt;
After analyze the sample file, there are lots of duplicated cell style items in the&lt;br /&gt;
original file,and such file maybe created by script or other tools. So a method must&lt;br /&gt;
be used to get rid of the duplicated unused cell styles.&lt;br /&gt;
&lt;br /&gt;
Here is the result data by the rational purify.&lt;br /&gt;
	Calls: 178,325&lt;br /&gt;
	F+D: 25,128,429&lt;br /&gt;
		Calls: 4,268&lt;br /&gt;
		F+D: 24,404,739&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	Calls: 45,336&lt;br /&gt;
			F+D: 13,999,231&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	Calls: 28,282&lt;br /&gt;
			F+D: 10,547,312&lt;br /&gt;
1)oox::xls::OoxSheetDataContext::onCreatContext	1) oox::xls::OoxSheetDataContext::importRow&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet&lt;br /&gt;
		4) ScStyleObj::setPropertyValue	Calls: 36,334&lt;br /&gt;
			F+D: 8,745,959&lt;br /&gt;
	Calls:178,308&lt;br /&gt;
	F+D: 5,538,047	&lt;br /&gt;
		Calls: 158,771&lt;br /&gt;
		F+D: 4,810,522	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	&lt;br /&gt;
2)oox::xls::OoxSheetDataContext::onEndElement	1) oox::xls::WorksheetHelper::setCellFormat&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::WorksheetData::writeXfldRowRangeProperties&lt;br /&gt;
	oox::xls::StylesBuffer::writeCellXfToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
	Calls: 1&lt;br /&gt;
	F+D: 21,475,924	&lt;br /&gt;
		Calls: 14,234&lt;br /&gt;
		F+D: 21,419,377	&lt;br /&gt;
		1) ScCellRangesBase::setPropertyValues	&lt;br /&gt;
		2) ScCellRangesBase::setPropertyValue	&lt;br /&gt;
		3) ScStyleObj::setPropertyValues	&lt;br /&gt;
3)oox::xls::OoxStylesFragement::finalizeImport	1) oox::xls::CellStyle::createStyle&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeStylesXfToPropertySet&lt;br /&gt;
	oox::xls::StylesBuffer::writeFontToProperSet&lt;br /&gt;
	oox::xls::StylesBuffer::writeBorderToProperSet&lt;br /&gt;
	oox::xls::Allignment::writeToPropertySet&lt;br /&gt;
	&lt;br /&gt;
	oox::xls::StylesBuffer::writeFillToPropertySet	4) ScStyleObj::setPropertyValue	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The  oox::xls::CellStyle::createStyle is called 14,234 times, and the F+D: 21,419,377&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=205077</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=205077"/>
		<updated>2012-09-07T04:49:04Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc|Features/{{SUBPAGENAME}}]]&lt;br /&gt;
[[Category:Feature|{{SUBPAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
{{bug|120478}}&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What has been done in this item:&lt;br /&gt;
&lt;br /&gt;
1. Support load duplicate names from MS 2003 file.&lt;br /&gt;
&lt;br /&gt;
2. Support save duplicate names to MS 2003 file.&lt;br /&gt;
&lt;br /&gt;
3. Support load duplicate names from MS 2007 file.&lt;br /&gt;
&lt;br /&gt;
4. Support load duplicate names form ODF file.&lt;br /&gt;
&lt;br /&gt;
5. Support save duplicate names to ODF file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Limitation:&lt;br /&gt;
&lt;br /&gt;
1. If a formula references a name that is defined in other workbook or a global range,&lt;br /&gt;
&lt;br /&gt;
such formula can not be interpreted by Aoo.&lt;br /&gt;
&lt;br /&gt;
2. Can not create duplicate named range in UI dialog.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=205076</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=205076"/>
		<updated>2012-09-07T04:47:19Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc|Features/{{SUBPAGENAME}}]]&lt;br /&gt;
[[Category:Feature|{{SUBPAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
{{bug|120478}}&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What has been done in this item:&lt;br /&gt;
&lt;br /&gt;
1. Support load duplicate names from MS 2003 file.&lt;br /&gt;
&lt;br /&gt;
2. Support save duplicate names to MS 2003 file.&lt;br /&gt;
&lt;br /&gt;
3. Support load duplicate names from MS 2007 file.&lt;br /&gt;
&lt;br /&gt;
4. Support load duplicate names form ODF file.&lt;br /&gt;
&lt;br /&gt;
5. Support save duplicate names to ODF file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Limitation:&lt;br /&gt;
&lt;br /&gt;
1. If a formula references a name that is defined in other workbook or a global range,&lt;br /&gt;
&lt;br /&gt;
such formula can not be interpreted by Aoo.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204989</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204989"/>
		<updated>2012-08-31T09:02:57Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc|Features/{{SUBPAGENAME}}]]&lt;br /&gt;
[[Category:Feature|{{SUBPAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
{{bug|120478}}&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What has been done in this item:&lt;br /&gt;
&lt;br /&gt;
1. Support load duplicate names from MS 2003 file.&lt;br /&gt;
&lt;br /&gt;
2. Support save duplicate names to MS 2003 file.&lt;br /&gt;
&lt;br /&gt;
3. Support load duplicate names from MS 2007 file.&lt;br /&gt;
&lt;br /&gt;
4. Support load duplicate names form ODF file.&lt;br /&gt;
&lt;br /&gt;
5. Support save duplicate names to ODF file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Limitation:&lt;br /&gt;
&lt;br /&gt;
1. If duplicate names are used in a formula,save file to ODF format,&lt;br /&gt;
the formula for the name(&amp;quot;aaa&amp;quot;) defined in a sheet is&lt;br /&gt;
of:=SUM(aaa)&lt;br /&gt;
the formula for the anme defined in a workbook is&lt;br /&gt;
of:=SUM(aaa)&lt;br /&gt;
if reload the exported file to Aoo,all will be marked as the name in a sheet.&lt;br /&gt;
&lt;br /&gt;
2. If a formula references a name that is defined in other workbook,&lt;br /&gt;
&lt;br /&gt;
load the file in Aoo,it will be displayed&lt;br /&gt;
as &amp;quot;#NAME?&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204803</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204803"/>
		<updated>2012-08-21T03:02:47Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc|Features/{{SUBPAGENAME}}]]&lt;br /&gt;
[[Category:Feature|{{SUBPAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
{{bug|120478}}&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204802</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204802"/>
		<updated>2012-08-21T03:01:23Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc|Features/{{SUBPAGENAME}}]]&lt;br /&gt;
[[Category:Feature|{{SUBPAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204801</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204801"/>
		<updated>2012-08-21T02:58:47Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Features]]&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Calc_name_range_enchancement(step1)&amp;diff=204800</id>
		<title>Calc/Implementation/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Calc_name_range_enchancement(step1)&amp;diff=204800"/>
		<updated>2012-08-21T02:56:49Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Implementation/Calc name range enchancement(step1) to Calc/Features/Calc name range enchancement(step1)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Calc/Features/Calc name range enchancement(step1)]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204799</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204799"/>
		<updated>2012-08-21T02:56:49Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Implementation/Calc name range enchancement(step1) to Calc/Features/Calc name range enchancement(step1)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Implementation]]&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204798</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204798"/>
		<updated>2012-08-21T02:55:47Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Implementation]]&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The export content in xml file.&lt;br /&gt;
&lt;br /&gt;
[[File:Namerange.JPG]]&lt;br /&gt;
&lt;br /&gt;
If save a file to ODF file,the named range in a sheet will be added in the area of &amp;quot;&amp;lt;&amp;lt;[table:table]&amp;gt;&amp;gt;&amp;quot;, the named range in a workbook will be added in the area of &amp;quot;&amp;lt;office:spreadsheet&amp;gt;&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Namerange.JPG&amp;diff=204797</id>
		<title>File:Namerange.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Namerange.JPG&amp;diff=204797"/>
		<updated>2012-08-21T02:47:58Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Calc_name_range_enchancement&amp;diff=204516</id>
		<title>Calc/Implementation/Calc name range enchancement</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Calc_name_range_enchancement&amp;diff=204516"/>
		<updated>2012-08-14T07:28:24Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Implementation/Calc name range enchancement to Calc/Implementation/Calc name range enchancement(step1)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Calc/Implementation/Calc name range enchancement(step1)]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204515</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204515"/>
		<updated>2012-08-14T07:28:24Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Implementation/Calc name range enchancement to Calc/Implementation/Calc name range enchancement(step1)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Implementation]]&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204513</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204513"/>
		<updated>2012-08-14T07:06:37Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Implementation]]&lt;br /&gt;
&lt;br /&gt;
MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204512</id>
		<title>Calc/Features/Calc name range enchancement(step1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Features/Calc_name_range_enchancement(step1)&amp;diff=204512"/>
		<updated>2012-08-14T07:03:13Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: Created page with &amp;quot;MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.  File:Ms name range.JPG  When …&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MS Excel can support worksheet/workbook scope defined name. User can use same string to create new name if the 2 names are in different ranges.&lt;br /&gt;
&lt;br /&gt;
[[File:Ms name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
When AOO loading a xlsx file which has duplicated defined name, AOO will only change the name. But any other place which use the defined name is not changed, which will cause problems. For example,in VBA project, if it used a name with “aaa” in the range of workbook,if there is also a name with “aaa” in the range of worksheet,Aoo will change the  name to “aaa_1”. The reference to the second one will be changed to an invalid name. And it can be checked in the define names dialog, there are 2 items, one is “aaa” and the second is changed to “aaa_1”.&lt;br /&gt;
&lt;br /&gt;
[[File:Old name range.JPG]]&lt;br /&gt;
&lt;br /&gt;
This enchancemnet will support &lt;br /&gt;
(1)loading worksheet scope defined name from MS xlsx/xls and ods file.&lt;br /&gt;
(2)export defined name to MS xls(2003) and ods file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if MS office defined range names with a sheet or a work book,import it in Aoo,&lt;br /&gt;
make the name of work sheet to the original,but with a flag of sheet name,for &lt;br /&gt;
example,the name is &amp;quot;aaa&amp;quot; in the range of work sheet, it will be &amp;quot;aaa (sheet1)&amp;quot; in the define name dialog , and the name “aaa” will be as its&amp;#039; original one if it is in the range of workbook.&lt;br /&gt;
&lt;br /&gt;
[[File:New_name_range.JPG]]&lt;br /&gt;
&lt;br /&gt;
Add functions in interface XNamedRange: com::sun::star::container::XNamed&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1.string getScopeName();&lt;br /&gt;
//Return the name of the range.&lt;br /&gt;
2.void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Set the range name and the scope name.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add functions in interface XNamedRanges: com::sun::star::container::XNameAccess&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1. void addNewByScopeName(&lt;br /&gt;
			[in] string aScopeName,&lt;br /&gt;
			[in] string aRangeName,&lt;br /&gt;
			[in] string aContent,&lt;br /&gt;
			[in] com::sun::star::table::CellAddress aPosition,&lt;br /&gt;
			[in] long nType );&lt;br /&gt;
//Add a scope named range to the name range list.&lt;br /&gt;
2. void removeByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//Remove a defined range from the name range list.	&lt;br /&gt;
3. boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );&lt;br /&gt;
//IF there is already a name range with name of aRangeName and the scope of aScopeName.&lt;br /&gt;
4. any getByScopeName( [in] string aScopeName, [in] string aRangeName )&lt;br /&gt;
			raises( com::sun::star::container::NoSuchElementException, &lt;br /&gt;
					com::sun::star::lang::WrappedTargetException ); &lt;br /&gt;
//Return a name range by scope name and range name.					&lt;br /&gt;
5.sequence&amp;lt;RangeScopeName&amp;gt; getElementScopeNames();&lt;br /&gt;
//Return all name ranges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:New_name_range.JPG&amp;diff=204508</id>
		<title>File:New name range.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:New_name_range.JPG&amp;diff=204508"/>
		<updated>2012-08-14T06:53:39Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Old_name_range.JPG&amp;diff=204507</id>
		<title>File:Old name range.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Old_name_range.JPG&amp;diff=204507"/>
		<updated>2012-08-14T06:52:49Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Ms_name_range.JPG&amp;diff=204506</id>
		<title>File:Ms name range.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Ms_name_range.JPG&amp;diff=204506"/>
		<updated>2012-08-14T06:51:19Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: Ms_name_range&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ms_name_range&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201669</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201669"/>
		<updated>2012-06-01T06:25:36Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Implementation]]&lt;br /&gt;
&lt;br /&gt;
== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Filter_structure.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
&lt;br /&gt;
[[File:SfxFilterContainer.JPG]]&lt;br /&gt;
&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
[[File:Callstack.JPG]]&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
&lt;br /&gt;
[[File:Callstack2.JPG]]&lt;br /&gt;
&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
[[File:deepdetect.jpg]]&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:Loadchart.JPG]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter&amp;diff=201668</id>
		<title>Calc/Implementation/Filter</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter&amp;diff=201668"/>
		<updated>2012-06-01T06:24:15Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Implementation/Filter to Calc/Implementation/Filter in spreadsheet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Calc/Implementation/Filter in spreadsheet]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201667</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201667"/>
		<updated>2012-06-01T06:24:15Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: moved Calc/Implementation/Filter to Calc/Implementation/Filter in spreadsheet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Implementation]]&lt;br /&gt;
&lt;br /&gt;
== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Filter_structure.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
&lt;br /&gt;
[[File:SfxFilterContainer.JPG]]&lt;br /&gt;
&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
[[File:Callstack.JPG]]&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
&lt;br /&gt;
[[File:Callstack2.JPG]]&lt;br /&gt;
&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
[[File:deepdetect.jpg]]&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:Loadchart.JPG]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201656</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201656"/>
		<updated>2012-06-01T02:15:39Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Calc]]&lt;br /&gt;
[[Category:Implementation]]&lt;br /&gt;
&lt;br /&gt;
== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Filter_structure.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
&lt;br /&gt;
[[File:SfxFilterContainer.JPG]]&lt;br /&gt;
&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
[[File:Callstack.JPG]]&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
&lt;br /&gt;
[[File:Callstack2.JPG]]&lt;br /&gt;
&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
[[File:deepdetect.jpg]]&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:Loadchart.JPG]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201655</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201655"/>
		<updated>2012-06-01T02:13:33Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: (checkpoint save)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:Filter_structure.JPG]]&lt;br /&gt;
&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
&lt;br /&gt;
[[File:SfxFilterContainer.JPG]]&lt;br /&gt;
&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
[[File:Callstack.JPG]]&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
&lt;br /&gt;
[[File:Callstack2.JPG]]&lt;br /&gt;
&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
[[File:deepdetect.jpg]]&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;br /&gt;
&lt;br /&gt;
[[File:Loadchart.JPG]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201654</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201654"/>
		<updated>2012-06-01T02:13:05Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: (checkpoint save)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
[[File:Filter_structure.JPG]]&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
&lt;br /&gt;
[[File:SfxFilterContainer.JPG]]&lt;br /&gt;
&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
[[File:Callstack.JPG]]&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
[[File:Callstack2.JPG]]&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
[[File:deepdetect.jpg]]&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;br /&gt;
[[File:Loadchart.JPG]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201653</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201653"/>
		<updated>2012-06-01T02:12:25Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: (checkpoint save)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
[[File:Filter_structure.JPG]]&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
[[File:SfxFilterContainer.JPG]]&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
[[File:Callstack.JPG]]&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
[[File:Callstack2.JPG]]&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
[[File:deepdetect.jpg]]&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;br /&gt;
[[File:Loadchart.JPG]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201652</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201652"/>
		<updated>2012-06-01T02:11:44Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: (checkpoint save)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
[[File:Filter_structure.JPG]]&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
[[File:SfxFilterContainer.JPG.JPG]]&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
[[File:Callstack.JPG]]&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
[[File:Callstack2.JPG]]&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
[[File:deepdetect.jpg]]&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;br /&gt;
[[File:Loadchart.JPG]]&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Loadchart.JPG&amp;diff=201651</id>
		<title>File:Loadchart.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Loadchart.JPG&amp;diff=201651"/>
		<updated>2012-06-01T02:10:59Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Deepdetect.jpg&amp;diff=201650</id>
		<title>File:Deepdetect.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Deepdetect.jpg&amp;diff=201650"/>
		<updated>2012-06-01T02:05:48Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Callstack2.JPG&amp;diff=201649</id>
		<title>File:Callstack2.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Callstack2.JPG&amp;diff=201649"/>
		<updated>2012-06-01T02:03:11Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Callstack.JPG&amp;diff=201648</id>
		<title>File:Callstack.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Callstack.JPG&amp;diff=201648"/>
		<updated>2012-06-01T02:02:07Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:SfxFilterContainer.JPG&amp;diff=201647</id>
		<title>File:SfxFilterContainer.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:SfxFilterContainer.JPG&amp;diff=201647"/>
		<updated>2012-06-01T02:00:59Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Filter_structure.JPG&amp;diff=201646</id>
		<title>File:Filter structure.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Filter_structure.JPG&amp;diff=201646"/>
		<updated>2012-06-01T01:59:08Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201645</id>
		<title>Calc/Implementation/Filter in spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Calc/Implementation/Filter_in_spreadsheet&amp;diff=201645"/>
		<updated>2012-06-01T01:56:30Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: Created page with &amp;quot;== The whole view of filter == An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must…&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The whole view of filter ==&lt;br /&gt;
An in-memory Symphony document is represented by it&amp;#039;s document model. On disk, the same document is represented as a file. An import component must turn the latter into the former as shown by this diagram.&lt;br /&gt;
[[File:Example.jpg]]&lt;br /&gt;
== Filter in symphony ==&lt;br /&gt;
When open a file in symphony, the supported filters will be initialized by the class of SfxFilterContainer in sfx2\inc\sfx2. &lt;br /&gt;
It contains a member of SfxFilterContainer_Impl *pImpl. Symphony uses this class to control every SfxFilter.&lt;br /&gt;
There are a global variable for storing SfxFilter, the name is &lt;br /&gt;
static SfxFilterList_Impl* pFilterArr = 0; &lt;br /&gt;
it is defined in sfx2\source\bastyp\fltfnc.cxx.&lt;br /&gt;
Indeed SfxFilterList_Impl is a list defined by DECLARE_LIST( SfxFilterList_Impl, SfxFilter* ) in sfx2\inc\arrdecl.hxx.&lt;br /&gt;
The detail can be traced by the call stack.&lt;br /&gt;
== Get the correct filter to load a document ==&lt;br /&gt;
To import a real document, symphony should get the file type to use the correct filter.&lt;br /&gt;
To get the filter, Symphony will use flat detection and deep detection.&lt;br /&gt;
In few words the &amp;quot;flat detection&amp;quot; is a type detection based on document extension, for example,a document named &amp;quot;test.xls&amp;quot;, it will get calc to load it by the extension of &amp;quot;xls&amp;quot;. &lt;br /&gt;
The &amp;quot;deep detection&amp;quot; is the detection that analyzes the document contents. For example, if a document named &amp;quot;test.xls&amp;quot;,but it is presentation document, then the deep detection should be joined. &lt;br /&gt;
In the file of  filter\source\config\cache\typedetection.cxx, the function of &lt;br /&gt;
TypeDetection::queryTypeByDescriptor is the entry for getting the filter to loading the document.&lt;br /&gt;
*Flat detection&lt;br /&gt;
FilterCache::detectFlatForURL, it can get the correct filter by the extention of the document name.&lt;br /&gt;
The function is defined in filter\source\config\cache\filtercache.cxx&lt;br /&gt;
A subset of document types is defined for a real filter. For example, to calc, it is defined in Basis\share\registry\modules\org\openoffice\TypeDetection\Filter\fcfg_calc_filters.xcu, here is an item for MS excel 97 file format.&lt;br /&gt;
&amp;lt;node oor:name=&amp;quot;MS Excel 97&amp;quot; oor:op=&amp;quot;replace&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Flags&amp;quot;&amp;gt;&amp;lt;value&amp;gt;IMPORT EXPORT ALIEN PREFERRED&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIComponent&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FilterService&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UserData&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;UIName&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;value xml:lang=&amp;quot;x-default&amp;quot;&amp;gt;Microsoft Excel 97/2000/XP&amp;lt;/value&amp;gt;&lt;br /&gt;
	&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;FileFormatVersion&amp;quot;&amp;gt;&amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;Type&amp;quot;&amp;gt;&amp;lt;value&amp;gt;calc_MS_Excel_97&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;TemplateName&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;prop oor:name=&amp;quot;DocumentService&amp;quot;&amp;gt;&amp;lt;value&amp;gt;com.sun.star.sheet.SpreadsheetDocument&amp;lt;/value&amp;gt;&amp;lt;/prop&amp;gt;&lt;br /&gt;
&amp;lt;/node&amp;gt;&lt;br /&gt;
The UIName defines the string of MS excel 97 displayed for open/save dialog.&lt;br /&gt;
The Type defines the string used in the internal code of Symphony.&lt;br /&gt;
The DocumentService defines which service is used to import/export such document.&lt;br /&gt;
*Deep detection&lt;br /&gt;
Symphony uses the interface XExtendedFilterDetection to look into the document stream to detect the format. It belongs to :: com :: sun :: star :: document.&lt;br /&gt;
This function is called by TypeDetection::impl_askDetectService &lt;br /&gt;
in the file filter\source\config\cache\typedetection.cxx&lt;br /&gt;
sDeepType = xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
In the step 3.1, Symphony has got the filters by the file&amp;#039;s extention.&lt;br /&gt;
The types matching to the given extention.&lt;br /&gt;
Calc_MS_Excel_40&lt;br /&gt;
Calc_MS_Excel_95&lt;br /&gt;
Calc_MS_Excel_97&lt;br /&gt;
Calc_Text_txt_csv_StarCalc&lt;br /&gt;
Calc_MS_Excel_5095&lt;br /&gt;
By the types, Symphony will do the deep detection. It is realized by a spreadsheet servcie of &lt;br /&gt;
com.sun.star.comp.calc.FormatDetector.&lt;br /&gt;
&lt;br /&gt;
In the function of TypeDetection::impl_askDetectService(), It &lt;br /&gt;
calls xDetector-&amp;gt;detect(lDescriptor);&lt;br /&gt;
The real implement function is ScFilterDetect::detect()&lt;br /&gt;
It is defined in sc\source\ui\unoobj\scdetect.cxx&lt;br /&gt;
At first, make a SotStorage by the input stream of MS excel&lt;br /&gt;
SotStorageRef aStorage = new SotStorage ( pStream, FALSE );&lt;br /&gt;
Then check the content of the file, if there is a sub stream named &amp;quot;Workbook&amp;quot; or &amp;quot;Book&amp;quot;.&lt;br /&gt;
String aStreamName(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Workbook&amp;quot;));&lt;br /&gt;
BOOL bExcel97Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
aStreamName = String(RTL_CONSTASCII_STRINGPARAM(&amp;quot;Book&amp;quot;));&lt;br /&gt;
BOOL bExcel5Stream = ( aStorage-&amp;gt;IsStream( aStreamName ) );&lt;br /&gt;
&lt;br /&gt;
*Load a chart in spreadsheet filter&lt;br /&gt;
Chart is managed by the class of XclImpObjectManager in spreadsheet. The real implement is XclImpChartObj that is base on XclImplDrawObjBase.&lt;br /&gt;
XclImpChart will import the parts of chart, for example, diagram, series, title, background, etc.&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Window_clipboard.png&amp;diff=200345</id>
		<title>File:Window clipboard.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Window_clipboard.png&amp;diff=200345"/>
		<updated>2012-04-27T08:29:52Z</updated>

		<summary type="html">&lt;p&gt;Zhaoshzh: uploaded a new version of &amp;quot;File:Window clipboard.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Window_clipboard&lt;/div&gt;</summary>
		<author><name>Zhaoshzh</name></author>
	</entry>
</feed>