Commits

Anonymous committed c1a1449

#i10000#

Comments (0)

Files changed (7)

sc/source/filter/excel/namebuff.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 }
 
 
-const sal_Char* ExtNameBuff::pJoostTest = "Joost ist immer noch doof!";
-
-
-ExtNameBuff::~ExtNameBuff()
+BOOL ExtName::IsOLE( void ) const
 {
-	ExtName*	pDel = ( ExtName* ) List::First();
-	while( pDel )
-	{
-		delete pDel;
-		pDel = ( ExtName* ) List::Next();
-	}
+    return ( nFlags & 0x0002 ) != 0;
 }
 
 
-void ExtNameBuff::AddDDE( const String& rName )
+ExtNameBuff::ExtNameBuff( const XclImpRoot& rRoot ) :
+    XclImpRoot( rRoot )
 {
-	ExtName*	pNew = new ExtName( rName );
-	pNew->nFlags = 0x0001;
-
-	List::Insert( pNew, LIST_APPEND );
 }
 
 
-void ExtNameBuff::AddOLE( const String& rName, UINT32 nStorageId )
+void ExtNameBuff::AddDDE( const String& rName, sal_Int16 nRefIdx )
 {
-	ExtName*	pNew = new ExtName( rName );
-	pNew->nFlags = 0x0002;
-	pNew->nStorageId = nStorageId;
-
-	List::Insert( pNew, LIST_APPEND );
+    ExtName aNew( rName, 0x0001 );
+    maExtNames[ nRefIdx ].push_back( aNew );
 }
 
 
-void ExtNameBuff::AddName( const String& rName )
+void ExtNameBuff::AddOLE( const String& rName, sal_Int16 nRefIdx, UINT32 nStorageId )
 {
-    ExtName* pNew = new ExtName( pExcRoot->pIR->GetScAddInName( rName ) );
-	pNew->nFlags = 0x0004;
-
-	List::Insert( pNew, LIST_APPEND );
+    ExtName aNew( rName, 0x0002 );
+    aNew.nStorageId = nStorageId;
+    maExtNames[ nRefIdx ].push_back( aNew );
 }
 
 
-const ExtName* ExtNameBuff::GetName( const UINT16 nExcelIndex ) const
+void ExtNameBuff::AddName( const String& rName, sal_Int16 nRefIdx )
 {
-	DBG_ASSERT( nExcelIndex > 0, "*ExtNameBuff::GetName(): Index kann nur >0 sein!" );
+    ExtName aNew( GetScAddInName( rName ), 0x0004 );
+    maExtNames[ nRefIdx ].push_back( aNew );
+}
 
-	return ( const ExtName* ) List::GetObject( nExcelIndex - 1 );
+
+const ExtName* ExtNameBuff::GetNameByIndex( sal_Int16 nRefIdx, sal_uInt16 nNameIdx ) const
+{
+    DBG_ASSERT( nNameIdx > 0, "ExtNameBuff::GetNameByIndex() - invalid name index" );
+    ExtNameMap::const_iterator aIt = maExtNames.find( nRefIdx );
+    return ((aIt != maExtNames.end()) && (0 < nNameIdx) && (nNameIdx <= aIt->second.size())) ? &aIt->second[ nNameIdx - 1 ] : 0;
 }
 
 
 void ExtNameBuff::Reset( void )
 {
-	ExtName*	pDel = ( ExtName* ) List::First();
-	while( pDel )
-	{
-		delete pDel;
-		pDel = ( ExtName* ) List::Next();
-	}
-
-	sal_Char cTmp = *pJoostTest;
-	cTmp++;
-
-	List::Clear();
+    maExtNames.clear();
 }
 
 

sc/source/filter/excel/xistream.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
     return nRet;
 }
 
-//UNUSED2008-05  sal_Size XclImpStream::CopyRecordToStream( SvStream& rOutStrm )
-//UNUSED2008-05  {
-//UNUSED2008-05      sal_Size nRet = 0;
-//UNUSED2008-05      if( mbValidRec )
-//UNUSED2008-05      {
-//UNUSED2008-05          PushPosition();
-//UNUSED2008-05          RestorePosition( maFirstRec );
-//UNUSED2008-05          nRet = CopyToStream( rOutStrm, GetRecSize() );
-//UNUSED2008-05          PopPosition();
-//UNUSED2008-05      }
-//UNUSED2008-05      return nRet;
-//UNUSED2008-05  }
+sal_Size XclImpStream::CopyRecordToStream( SvStream& rOutStrm )
+{
+    sal_Size nRet = 0;
+    if( mbValidRec )
+    {
+        PushPosition();
+        RestorePosition( maFirstRec );
+        nRet = CopyToStream( rOutStrm, GetRecSize() );
+        PopPosition();
+    }
+    return nRet;
+}
 
 void XclImpStream::Seek( sal_Size nPos )
 {

sc/source/filter/excel/xlstyle.cxx

         InsertBuiltinFormats();
 }
 
+void XclNumFmtBuffer::InitializeImport()
+{
+    maFmtMap.clear();
+}
+
 //UNUSED2008-05  const XclNumFmt* XclNumFmtBuffer::GetFormat( sal_uInt16 nXclNumFmt ) const
 //UNUSED2008-05  {
 //UNUSED2008-05      XclNumFmtMap::const_iterator aIt = maFmtMap.find( nXclNumFmt );

sc/source/filter/ftools/fapihelper.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
     return CreateInstance( ::comphelper::getProcessServiceFactory(), rServiceName );
 }
 
-//UNUSED2008-05  Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
-//UNUSED2008-05          Reference< XMultiServiceFactory > xFactory, const OUString& rServiceName, const Sequence< Any >& rArgs )
-//UNUSED2008-05  {
-//UNUSED2008-05      Reference< XInterface > xInt;
-//UNUSED2008-05      if( xFactory.is() )
-//UNUSED2008-05      {
-//UNUSED2008-05          try
-//UNUSED2008-05          {
-//UNUSED2008-05              xInt = xFactory->createInstanceWithArguments( rServiceName, rArgs );
-//UNUSED2008-05          }
-//UNUSED2008-05          catch( Exception& )
-//UNUSED2008-05          {
-//UNUSED2008-05              DBG_ERRORFILE( "ScfApiHelper::CreateInstanceWithArgs - cannot create instance" );
-//UNUSED2008-05          }
-//UNUSED2008-05      }
-//UNUSED2008-05      return xInt;
-//UNUSED2008-05  }
-//UNUSED2008-05  
+Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
+        Reference< XMultiServiceFactory > xFactory, const OUString& rServiceName, const Sequence< Any >& rArgs )
+{
+    Reference< XInterface > xInt;
+    if( xFactory.is() )
+    {
+        try
+        {
+            xInt = xFactory->createInstanceWithArguments( rServiceName, rArgs );
+        }
+        catch( Exception& )
+        {
+            DBG_ERRORFILE( "ScfApiHelper::CreateInstanceWithArgs - cannot create instance" );
+        }
+    }
+    return xInt;
+}
+
 //UNUSED2008-05  Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
 //UNUSED2008-05          SfxObjectShell* pShell, const OUString& rServiceName, const Sequence< Any >& rArgs )
 //UNUSED2008-05  {
 //UNUSED2008-05      return CreateInstanceWithArgs( GetServiceFactory( pShell ), rServiceName, rArgs );
 //UNUSED2008-05  }
-//UNUSED2008-05  
-//UNUSED2008-05  Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
-//UNUSED2008-05          const OUString& rServiceName, const Sequence< Any >& rArgs )
-//UNUSED2008-05  {
-//UNUSED2008-05      return CreateInstanceWithArgs( ::comphelper::getProcessServiceFactory(), rServiceName, rArgs );
-//UNUSED2008-05  }
+
+Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
+        const OUString& rServiceName, const Sequence< Any >& rArgs )
+{
+    return CreateInstanceWithArgs( ::comphelper::getProcessServiceFactory(), rServiceName, rArgs );
+}
 
 String ScfApiHelper::QueryPasswordForMedium( SfxMedium& rMedium )
 {

sc/source/filter/inc/fapihelper.hxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
     /** Creates an instance from the passed service name, using the process service factory. */
     static XInterfaceRef CreateInstance( const ::rtl::OUString& rServiceName );
 
-//UNUSED2008-05  /** Creates an instance from the passed service name, using the passed service factory. */
-//UNUSED2008-05  static XInterfaceRef CreateInstanceWithArgs(
-//UNUSED2008-05                          XServiceFactoryRef xFactory,
-//UNUSED2008-05                          const ::rtl::OUString& rServiceName,
-//UNUSED2008-05                          const UnoAnySequence& rArgs );
-//UNUSED2008-05  
+    /** Creates an instance from the passed service name, using the passed service factory. */
+    static XInterfaceRef CreateInstanceWithArgs(
+                            XServiceFactoryRef xFactory,
+                            const ::rtl::OUString& rServiceName,
+                            const UnoAnySequence& rArgs );
+
 //UNUSED2008-05  /** Creates an instance from the passed service name, using the service factory of the passed object. */
 //UNUSED2008-05  static XInterfaceRef CreateInstanceWithArgs(
 //UNUSED2008-05                          SfxObjectShell* pShell,
 //UNUSED2008-05                          const ::rtl::OUString& rServiceName,
 //UNUSED2008-05                          const UnoAnySequence& rArgs );
-//UNUSED2008-05  
-//UNUSED2008-05  /** Creates an instance from the passed service name, using the process service factory. */
-//UNUSED2008-05  static XInterfaceRef CreateInstanceWithArgs(
-//UNUSED2008-05                          const ::rtl::OUString& rServiceName,
-//UNUSED2008-05                          const UnoAnySequence& rArgs );
+
+    /** Creates an instance from the passed service name, using the process service factory. */
+    static XInterfaceRef CreateInstanceWithArgs(
+                            const ::rtl::OUString& rServiceName,
+                            const UnoAnySequence& rArgs );
 
     /** Opens a password dialog and returns the entered password.
         @return  The entered password or an empty string on 'Cancel' or any error. */

sc/source/filter/inc/namebuff.hxx

     inline          ExtName( const String& r, sal_uInt16 n ) : aName( r ), nStorageId( 0 ), nFlags( n ) {}
 
 	BOOL			IsDDE( void ) const;
+    BOOL            IsOLE( void ) const;
 };
 
 

sc/source/filter/inc/xistream.hxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
     /** Copies nBytes bytes to rOutStrm.
         @return  Count of bytes really written. */
     sal_Size            CopyToStream( SvStream& rOutStrm, sal_Size nBytes );
-  
-//UNUSED2008-05  /** Copies the entire record to rOutStrm. The current record position keeps unchanged.
-//UNUSED2008-05      @return  Count of bytes really written. */
-//UNUSED2008-05  sal_Size            CopyRecordToStream( SvStream& rOutStrm );
+
+    /** Copies the entire record to rOutStrm. The current record position keeps unchanged.
+        @return  Count of bytes really written. */
+    sal_Size            CopyRecordToStream( SvStream& rOutStrm );
 
     /** Seeks absolute in record content to the specified position.
         @descr  The value 0 means start of record, independent from physical stream position. */