--- a/oox/inc/oox/helper/containerhelper.hxx Fri Jul 09 11:03:28 2010 +0100 +++ a/oox/inc/oox/helper/containerhelper.hxx Fri Jul 09 12:10:16 2010 +0100 @@ -124,6 +124,13 @@ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); } + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) ); + } /** Calls the passed functor for every contained object. Passes the index as first argument and the object reference as second argument to rFunctor. */ template< typename FunctorType > @@ -280,6 +287,13 @@ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const { forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); + } + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) ); } /** Calls the passed functor for every contained object. Passes the key as first argument and the object reference as second argument to rFunctor. */ --- a/oox/inc/oox/ole/vbamodule.hxx Fri Jul 09 11:03:28 2010 +0100 +++ a/oox/inc/oox/ole/vbamodule.hxx Fri Jul 09 12:10:16 2010 +0100 @@ -72,13 +72,15 @@ void importSourceCode( StorageBase& rVbaStrg, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, - const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const; + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxOleNameOverrides ) const; /** Creates empty document module for the passed Basic library/project. */ void createEmptyDocModule( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxDocObjectNA ) const; private: + void extractOleOverrideFromAttr( const rtl::OUString& rAttribute, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxOleNameOverrides ) const; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel; /// Document model used to import/export the VBA project. ::rtl::OUString maName; --- a/oox/inc/oox/ole/vbaproject.hxx Fri Jul 09 11:03:28 2010 +0100 +++ a/oox/inc/oox/ole/vbaproject.hxx Fri Jul 09 12:10:16 2010 +0100 @@ -248,7 +248,7 @@ const ::rtl::OUString& rProxyArgs, const ::rtl::OUString& rProxyType, const ::rtl::OUString& rProxyCode ); - + void setOleOverridesSink( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxOleOverridesSink ){ mxOleOverridesSink = rxOleOverridesSink; } private: VbaProject( const VbaProject& ); VbaProject& operator=( const VbaProject& ); @@ -279,6 +279,8 @@ mxBasicLib; /// The Basic library of the document used for import. ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxDialogLib; /// The dialog library of the document used for import. + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > + mxOleOverridesSink; ::rtl::OUString maPrjName; /// Name of VBA project being imported }; --- a/oox/source/ole/vbamodule.cxx Fri Jul 09 11:03:28 2010 +0100 +++ a/oox/source/ole/vbamodule.cxx Fri Jul 09 12:10:16 2010 +0100 @@ -27,6 +27,7 @@ #include "oox/ole/vbamodule.hxx" #include +#include #include #include #include @@ -35,17 +36,28 @@ #include "oox/helper/textinputstream.hxx" #include "oox/ole/vbahelper.hxx" #include "oox/ole/vbainputstream.hxx" +#include +#include using ::rtl::OUString; using ::rtl::OUStringBuffer; using ::com::sun::star::container::XNameAccess; using ::com::sun::star::container::XNameContainer; +using ::com::sun::star::container::XIndexContainer; +using ::com::sun::star::container::ElementExistException; +using ::com::sun::star::container::NoSuchElementException; +using ::com::sun::star::lang::IndexOutOfBoundsException; +using ::com::sun::star::lang::WrappedTargetException; +using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::frame::XModel; using ::com::sun::star::script::ModuleInfo; using ::com::sun::star::script::XVBAModuleInfo; using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Type; +using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; @@ -55,6 +67,70 @@ namespace ole { // ============================================================================ +typedef ::cppu::WeakImplHelper1< XIndexContainer > OleIdToNameContainer_BASE; +typedef std::hash_map< sal_Int32, rtl::OUString > ObjIdToName; +class OleIdToNameContainer : public OleIdToNameContainer_BASE +{ + ObjIdToName ObjIdToNameHash; + ::osl::Mutex m_aMutex; + bool hasByIndex( ::sal_Int32 Index ) + { + ::osl::MutexGuard aGuard( m_aMutex ); + return ( ObjIdToNameHash.find( Index ) != ObjIdToNameHash.end() ); + } +public: + OleIdToNameContainer() {} + // XIndexContainer Methods + virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const Any& Element ) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + rtl::OUString sOleName; + if ( !( Element >>= sOleName ) ) + throw IllegalArgumentException(); + ObjIdToNameHash[ Index ] = sOleName; + } + virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !hasByIndex( Index ) ) + throw IndexOutOfBoundsException(); + ObjIdToNameHash.erase( ObjIdToNameHash.find( Index ) ); + } + // XIndexReplace Methods + virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const Any& Element ) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !hasByIndex( Index ) ) + throw IndexOutOfBoundsException(); + rtl::OUString sOleName; + if ( !( Element >>= sOleName ) ) + throw IllegalArgumentException(); + ObjIdToNameHash[ Index ] = sOleName; + } + // XIndexAccess Methods + virtual ::sal_Int32 SAL_CALL getCount( ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + return ObjIdToNameHash.size(); + } + virtual Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !hasByIndex( Index ) ) + throw IndexOutOfBoundsException(); + return makeAny( ObjIdToNameHash[ Index ] ); + } + // XElementAccess Methods + virtual Type SAL_CALL getElementType( ) throw (RuntimeException) + { + return ::getCppuType((const ::rtl::OUString*)(NULL) ); + } + virtual ::sal_Bool SAL_CALL hasElements( ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + return ( getCount() > 0 ); + } +}; VbaModule::VbaModule( const Reference< XModel >& rxDocModel, const OUString& rName, rtl_TextEncoding eTextEnc, bool bExecutable ) : mxDocModel( rxDocModel ), @@ -134,8 +210,34 @@ OSL_ENSURE( mnOffset < SAL_MAX_UINT32, "VbaModule::importDirRecords - missing module stream offset" ); } +void VbaModule::extractOleOverrideFromAttr( const rtl::OUString& rAttribute, + const Reference< XNameContainer >& rxOleNameOverrides ) const +{ + // format of the attribute we are interested in is + // Attribute VB_Control = "ControlName", intString, MSForms, ControlTypeAsString + // e.g. + // Attribute VB_Control = "CommandButton1, 201, 19, MSForms, CommandButton" + rtl::OUString sControlAttribute( RTL_CONSTASCII_USTRINGPARAM("Attribute VB_Control = \"") ); + if ( rxOleNameOverrides.is() && rAttribute.indexOf( sControlAttribute ) != -1 ) + { + rtl::OUString sRest = rAttribute.copy( sControlAttribute.getLength() ); + sal_Int32 nPos = sRest.indexOf( ',' ); + rtl::OUString sCntrlName = sRest.copy( 0, nPos ); + + sal_Int32 nCntrlId = sRest.copy( nPos + 1 ).copy( 0, sRest.indexOf( ',', nPos + 1) ).toInt32(); + OSL_TRACE("In module %s, assiging %d controlname %s", + rtl::OUStringToOString( maName, RTL_TEXTENCODING_UTF8 ).getStr(), nCntrlId, + rtl::OUStringToOString( sCntrlName, RTL_TEXTENCODING_UTF8 ).getStr() ); + if ( !rxOleNameOverrides->hasByName( maName ) ) + rxOleNameOverrides->insertByName( maName, makeAny( Reference< XIndexContainer> ( new OleIdToNameContainer() ) ) ); + Reference< XIndexContainer > xIdToOleName; + if ( rxOleNameOverrides->getByName( maName ) >>= xIdToOleName ) + xIdToOleName->insertByIndex( nCntrlId, makeAny( sCntrlName ) ); + } +} + void VbaModule::importSourceCode( StorageBase& rVbaStrg, - const Reference< XNameContainer >& rxBasicLib, const Reference< XNameAccess >& rxDocObjectNA ) const + const Reference< XNameContainer >& rxBasicLib, const Reference< XNameAccess >& rxDocObjectNA, const Reference< XNameContainer >& rxOleNameOverrides ) const { if( (maName.getLength() == 0) || (maStreamName.getLength() == 0) || (mnOffset == SAL_MAX_UINT32) ) return; @@ -208,6 +310,8 @@ aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Rem " ) ); aSourceCode.append( aCodeLine ).append( sal_Unicode( '\n' ) ); } + else + extractOleOverrideFromAttr( aCodeLine, rxOleNameOverrides ); } // close the subroutine named after the module --- a/oox/source/ole/vbaproject.cxx Fri Jul 09 11:03:28 2010 +0100 +++ a/oox/source/ole/vbaproject.cxx Fri Jul 09 12:10:16 2010 +0100 @@ -473,7 +473,7 @@ aGeneratedModules.forEachMem( &VbaModule::createEmptyDocModule, ::boost::cref( xBasicLib ), ::boost::cref( xDocObjectNA ) ); aModules.forEachMem( &VbaModule::importSourceCode, - ::boost::ref( *xVbaStrg ), ::boost::cref( xBasicLib ), ::boost::cref( xDocObjectNA ) ); + ::boost::ref( *xVbaStrg ), ::boost::cref( xBasicLib ), ::boost::cref( xDocObjectNA ), ::boost::cref( mxOleOverridesSink ) ); } } catch( Exception& ) --- a/oox/source/xls/excelfilter.cxx Fri Jul 09 11:03:28 2010 +0100 +++ a/oox/source/xls/excelfilter.cxx Fri Jul 09 12:10:16 2010 +0100 @@ -35,6 +35,7 @@ #include "oox/xls/workbookfragment.hxx" #include "oox/dump/biffdumper.hxx" #include "oox/dump/xlsbdumper.hxx" +#include using ::rtl::OUString; using ::com::sun::star::uno::Any; @@ -42,6 +43,7 @@ using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::XInterface; +using ::com::sun::star::container::XNameContainer; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::xml::sax::XFastDocumentHandler; using ::oox::core::BinaryFilterBase; @@ -278,11 +280,14 @@ { Sequence< rtl::OUString > sGeneratedCNames; getArgument( CREATE_OUSTRING( "GeneratedCodeNames" ) ) >>= sGeneratedCNames; + Reference< XNameContainer > xOleNameOverrideSink; + getArgument( CREATE_OUSTRING( "OleNameOverrideInfo" ) ) >>= xOleNameOverrideSink; WorkbookHelperRoot aHelper( *this, eBiff ); StorageRef xVbaPrjStrg = openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false ) ; if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() ) { VbaProject aVbaProject( getGlobalFactory(), aHelper.getDocument() ); + aVbaProject.setOleOverridesSink( xOleNameOverrideSink ); aVbaProject.importVbaProject( *xVbaPrjStrg, getGraphicHelper(), sGeneratedCNames ); bRet = true; } --- a/sc/source/filter/excel/excimp8.cxx Fri Jul 09 11:03:28 2010 +0100 +++ a/sc/source/filter/excel/excimp8.cxx Fri Jul 09 12:10:16 2010 +0100 @@ -102,6 +102,7 @@ #include #include #include +#include #include #include #include @@ -115,6 +116,85 @@ +//OleNameOverrideContainer + +typedef ::cppu::WeakImplHelper1< container::XNameContainer > OleNameOverrideContainer_BASE; + +class OleNameOverrideContainer : public OleNameOverrideContainer_BASE +{ +private: + typedef std::hash_map< rtl::OUString, uno::Reference< container::XIndexContainer >, ::rtl::OUStringHash, + ::std::equal_to< ::rtl::OUString > > NamedIndexToOleName; + NamedIndexToOleName IdToOleNameHash; + ::osl::Mutex m_aMutex; +public: + // XElementAccess + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return container::XIndexContainer::static_type(0); } + virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + return ( IdToOleNameHash.size() > 0 ); + } + // XNameAcess + virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !hasByName(aName) ) + throw container::NoSuchElementException(); + return uno::makeAny( IdToOleNameHash[ aName ] ); + } + virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + uno::Sequence< ::rtl::OUString > aResult( IdToOleNameHash.size() ); + NamedIndexToOleName::iterator it = IdToOleNameHash.begin(); + NamedIndexToOleName::iterator it_end = IdToOleNameHash.end(); + rtl::OUString* pName = aResult.getArray(); + for (; it != it_end; ++it, ++pName ) + *pName = it->first; + return aResult; + } + virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + return ( IdToOleNameHash.find( aName ) != IdToOleNameHash.end() ); + } + + // XElementAccess + virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + return IdToOleNameHash.size(); + } + // XNameContainer + virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( hasByName( aName ) ) + throw container::ElementExistException(); + uno::Reference< container::XIndexContainer > xElement; + if ( ! ( aElement >>= xElement ) ) + throw lang::IllegalArgumentException(); + IdToOleNameHash[ aName ] = xElement; + } + virtual void SAL_CALL removeByName( const ::rtl::OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !hasByName( aName ) ) + throw container::NoSuchElementException(); + IdToOleNameHash.erase( IdToOleNameHash.find( aName ) ); + } + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !hasByName( aName ) ) + throw container::NoSuchElementException(); + uno::Reference< container::XIndexContainer > xElement; + if ( ! ( aElement >>= xElement ) ) + throw lang::IllegalArgumentException(); + IdToOleNameHash[ aName ] = xElement; + } +}; ImportExcel8::ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm ) : ImportExcel( rImpData, rStrm ) @@ -288,7 +368,7 @@ try { uno::Reference< lang::XComponent > xComponent( pShell->GetModel(), uno::UNO_QUERY_THROW ); - uno::Sequence< beans::NamedValue > aArgSeq(1); + uno::Sequence< beans::NamedValue > aArgSeq(2); // I guess we could actually handle the GeneratedCodeNames here // ( e.g. after import create the required modules ) but... // better to reuse the code in the filter right? @@ -304,6 +384,10 @@ } aArgSeq[ 0 ].Value <<= sGeneratedCNames; + aArgSeq[ 1 ].Name = CREATE_OUSTRING( "OleNameOverrideInfo"); + uno::Reference< container::XNameContainer > xOleNameOverrideSink( new OleNameOverrideContainer() ); + aArgSeq[ 1 ].Value <<= xOleNameOverrideSink; + uno::Sequence< uno::Any > aArgs( 2 ); aArgs[ 0 ] <<= getProcessServiceFactory(); aArgs[ 1 ] <<= aArgSeq; @@ -328,6 +412,7 @@ // call the filter uno::Reference< document::XFilter > xFilter( xImporter, uno::UNO_QUERY_THROW ); xFilter->filter( aMediaDesc.getAsConstPropertyValueList() ); + GetObjectManager().SetOleNameOverrideInfo( xOleNameOverrideSink ); } catch( uno::Exception& ) { --- a/sc/source/filter/excel/read.cxx Fri Jul 09 11:03:28 2010 +0100 +++ a/sc/source/filter/excel/read.cxx Fri Jul 09 12:10:16 2010 +0100 @@ -1237,7 +1237,6 @@ std::vector < SCTAB >::iterator it_end = nTabsWithNoCodeName.end(); for ( std::vector < SCTAB >::iterator it = nTabsWithNoCodeName.begin(); it != it_end; ++it ) { - bool bGotCodeName = false; SCTAB nTab = 1; OSL_TRACE("Trying to find suitable codename for %d", *it ); while ( true ) --- a/sc/source/filter/excel/xiescher.cxx Fri Jul 09 11:03:28 2010 +0100 +++ a/sc/source/filter/excel/xiescher.cxx Fri Jul 09 12:10:16 2010 +0100 @@ -114,6 +114,8 @@ #include "xipage.hxx" #include "xichart.hxx" #include "xicontent.hxx" +#include "scextopt.hxx" + #include "namebuff.hxx" using ::rtl::OUString; @@ -240,7 +242,7 @@ xDrawObj.reset( new XclImpPhObj( rRoot ) ); } } - + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj3( rStrm ); return xDrawObj; } @@ -273,6 +275,7 @@ } } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj4( rStrm ); return xDrawObj; } @@ -315,6 +318,7 @@ } } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj5( rStrm ); return xDrawObj; } @@ -373,6 +377,7 @@ } } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj8( rStrm ); return xDrawObj; } @@ -2820,6 +2825,17 @@ return xSdrObj.release(); } +String XclImpPictureObj::GetObjName() const +{ + if( IsOcxControl() ) + { + String sName( GetObjectManager().GetOleNameOverride( GetTab(), GetObjId() ) ); + if ( sName.Len() > 0 ) + return sName; + } + return XclImpDrawObjBase::GetObjName(); +} + void XclImpPictureObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const { if( IsOcxControl() ) @@ -3134,6 +3150,24 @@ { } +String XclImpObjectManager::GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId ) +{ + rtl::OUString sOleName; + String sCodeName = GetExtDocOptions().GetCodeName( nTab ); + + if ( mxOleCtrlNameOverride->hasByName( sCodeName ) ) + { + Reference< XIndexContainer > xIdToOleName; + mxOleCtrlNameOverride->getByName( sCodeName ) >>= xIdToOleName; + xIdToOleName->getByIndex( nObjId ) >>= sOleName; + } + OSL_TRACE("XclImpObjectManager::GetOleNameOverride tab %d, ( module %s ) object id ( %d ) is %s", nTab, + rtl::OUStringToOString( sCodeName, RTL_TEXTENCODING_UTF8 ).getStr(), nObjId, + rtl::OUStringToOString( sOleName, RTL_TEXTENCODING_UTF8 ).getStr() ); + + return sOleName; +} + void XclImpDffConverter::StartProgressBar( sal_Size nProgressSize ) { mxProgress.reset( new ScfProgressBar( GetDocShell(), STR_PROGRESS_CALCULATING ) ); --- a/sc/source/filter/inc/xiescher.hxx Fri Jul 09 11:03:28 2010 +0100 +++ a/sc/source/filter/inc/xiescher.hxx Fri Jul 09 12:10:16 2010 +0100 @@ -92,7 +92,7 @@ /** Returns the Excel object type from OBJ record. */ inline sal_uInt16 GetObjType() const { return mnObjType; } /** Returns the name of this object, may generate a default name. */ - String GetObjName() const; + virtual String GetObjName() const; /** Returns associated macro name, if set, otherwise zero length string. */ inline const String& GetMacroName() const { return maMacroName; } @@ -114,7 +114,6 @@ bool IsValidSize( const Rectangle& rAnchorRect ) const; /** Returns the range in the sheet covered by this object. */ ScRange GetUsedArea( SCTAB nScTab ) const; - /** Returns true, if the object is valid and will be processed. */ inline bool IsProcessSdrObj() const { return mbProcessSdr && !mbHidden; } /** Returns true, if the SdrObject will be created or processed, but not be inserted into the draw page. */ @@ -172,7 +171,7 @@ virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const; /** Derived classes may perform additional processing for the passed SdrObject after insertion. */ virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const; - + SCTAB GetTab() const { return mnTab; } private: /** Reads the contents of a BIFF3 OBJ record. */ void ImplReadObj3( XclImpStream& rStrm ); @@ -186,6 +185,7 @@ private: XclObjAnchor maAnchor; /// The position of the object in its parent. sal_uInt16 mnObjId; /// The object identifier (unique per drawing). + SCTAB mnTab; /// Location of object sal_uInt16 mnObjType; /// The Excel object type from OBJ record. sal_uInt32 mnDffShapeId; /// Shape ID from DFF stream. sal_uInt32 mnDffFlags; /// Shape flags from DFF stream. @@ -862,7 +862,8 @@ { public: explicit XclImpPictureObj( const XclImpRoot& rRoot ); - + /** Returns the ObjectName - can use non-obvious lookup for override in the associated vba document module stream**/ + virtual String GetObjName() const; /** Returns the graphic imported from the IMGDATA record. */ inline const Graphic& GetGraphic() const { return maGraphic; } /** Returns the visible area of the imported graphic. */ @@ -1225,9 +1226,16 @@ String GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const; /** Returns the used area in the sheet with the passed index. */ ScRange GetUsedArea( SCTAB nScTab ) const; + /** Sets the container to recieve overriden shape/ctrls names from + the filter. */ + void SetOleNameOverrideInfo( const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& rxOverrideInfo ) { mxOleCtrlNameOverride = rxOverrideInfo; } + /** Returns the name of overridden name ( or zero length string ) for + associated object id. */ + String GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId ); // ------------------------------------------------------------------------ private: + com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxOleCtrlNameOverride; typedef ::std::map< sal_uInt16, String > DefObjNameMap; typedef ScfRef< XclImpSheetDrawing > XclImpSheetDrawingRef; typedef ::std::map< SCTAB, XclImpSheetDrawingRef > XclImpSheetDrawingMap;