summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-10-06 13:27:23 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-10-06 13:27:23 +0000
commit1bc46807d949243d15bbc1ff005eacd61b1a7089 (patch)
tree97168f5d6509d151dc9bcf593dfa0e33fd721bd9 /sc
parent84b6bbeb092a473128c4d667b56f2f8f5db37a2f (diff)
#i10000#
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/namebuff.cxx60
-rw-r--r--sc/source/filter/excel/xistream.cxx24
-rw-r--r--sc/source/filter/excel/xlstyle.cxx5
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx48
-rw-r--r--sc/source/filter/inc/fapihelper.hxx22
-rw-r--r--sc/source/filter/inc/namebuff.hxx1
-rw-r--r--sc/source/filter/inc/xistream.hxx6
7 files changed, 77 insertions, 89 deletions
diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx
index 16ddd53939cf..df53c3edcd3c 100644
--- a/sc/source/filter/excel/namebuff.cxx
+++ b/sc/source/filter/excel/namebuff.cxx
@@ -294,69 +294,51 @@ BOOL ExtName::IsDDE( void ) const
}
-const sal_Char* ExtNameBuff::pJoostTest = "Joost ist immer noch doof!";
+BOOL ExtName::IsOLE( void ) const
+{
+ return ( nFlags & 0x0002 ) != 0;
+}
-ExtNameBuff::~ExtNameBuff()
+ExtNameBuff::ExtNameBuff( const XclImpRoot& rRoot ) :
+ XclImpRoot( rRoot )
{
- ExtName* pDel = ( ExtName* ) List::First();
- while( pDel )
- {
- delete pDel;
- pDel = ( ExtName* ) List::Next();
- }
}
-void ExtNameBuff::AddDDE( const String& rName )
+void ExtNameBuff::AddDDE( const String& rName, sal_Int16 nRefIdx )
{
- ExtName* pNew = new ExtName( rName );
- pNew->nFlags = 0x0001;
-
- List::Insert( pNew, LIST_APPEND );
+ ExtName aNew( rName, 0x0001 );
+ maExtNames[ nRefIdx ].push_back( aNew );
}
-void ExtNameBuff::AddOLE( const String& rName, UINT32 nStorageId )
+void ExtNameBuff::AddOLE( const String& rName, sal_Int16 nRefIdx, UINT32 nStorageId )
{
- ExtName* pNew = new ExtName( rName );
- pNew->nFlags = 0x0002;
- pNew->nStorageId = nStorageId;
-
- List::Insert( pNew, LIST_APPEND );
+ ExtName aNew( rName, 0x0002 );
+ aNew.nStorageId = nStorageId;
+ maExtNames[ nRefIdx ].push_back( aNew );
}
-void ExtNameBuff::AddName( const String& rName )
+void ExtNameBuff::AddName( const String& rName, sal_Int16 nRefIdx )
{
- ExtName* pNew = new ExtName( pExcRoot->pIR->GetScAddInName( rName ) );
- pNew->nFlags = 0x0004;
-
- List::Insert( pNew, LIST_APPEND );
+ ExtName aNew( GetScAddInName( rName ), 0x0004 );
+ maExtNames[ nRefIdx ].push_back( aNew );
}
-const ExtName* ExtNameBuff::GetName( const UINT16 nExcelIndex ) const
+const ExtName* ExtNameBuff::GetNameByIndex( sal_Int16 nRefIdx, sal_uInt16 nNameIdx ) const
{
- DBG_ASSERT( nExcelIndex > 0, "*ExtNameBuff::GetName(): Index kann nur >0 sein!" );
-
- return ( const ExtName* ) List::GetObject( nExcelIndex - 1 );
+ 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();
}
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index 44d4040a1e53..931f08ef468f 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -770,18 +770,18 @@ sal_Size XclImpStream::CopyToStream( SvStream& rOutStrm, sal_Size nBytes )
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 )
{
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index a3ae0cc5458d..55efda524da1 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -1469,6 +1469,11 @@ XclNumFmtBuffer::XclNumFmtBuffer( const XclRoot& rRoot ) :
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 );
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 53f9bae131be..c87ac3601f63 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -111,35 +111,35 @@ Reference< XInterface > ScfApiHelper::CreateInstance( const OUString& rServiceNa
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 )
{
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index dd126cbcbbc8..572e9d148a60 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -89,22 +89,22 @@ public:
/** 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. */
diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx
index 7838d6550807..4048d3292ae3 100644
--- a/sc/source/filter/inc/namebuff.hxx
+++ b/sc/source/filter/inc/namebuff.hxx
@@ -327,6 +327,7 @@ struct ExtName
inline ExtName( const String& r, sal_uInt16 n ) : aName( r ), nStorageId( 0 ), nFlags( n ) {}
BOOL IsDDE( void ) const;
+ BOOL IsOLE( void ) const;
};
diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx
index bad06af69ac2..aa1cae84d8f6 100644
--- a/sc/source/filter/inc/xistream.hxx
+++ b/sc/source/filter/inc/xistream.hxx
@@ -358,9 +358,9 @@ public:
@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. */