diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-10-07 23:14:05 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-10-08 08:06:06 +0300 |
commit | d650d404c006ffcbb47d6871e2eab6fc4d764c40 (patch) | |
tree | 5b06e7275ed14bb25b18fabe51567d4c71245a37 /sc/source | |
parent | 45948e12698a30facf6e247e7c6df3e41417cd14 (diff) |
Deduplicate CTB, TBC and CTBWrapper (for disable-dynloading)
Change-Id: I0e9895ca59fa75958107df2cbf4348214df52664
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/excel/excimp8.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xltoolbar.cxx | 76 | ||||
-rw-r--r-- | sc/source/filter/excel/xltoolbar.hxx | 36 |
3 files changed, 57 insertions, 57 deletions
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 416b3da01763..d0a4a7ea0161 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -343,7 +343,7 @@ void ImportExcel8::ReadBasic( void ) SvStorageStreamRef xXCB = xRootStrg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "XCB" ) ), STREAM_STD_READ | STREAM_NOCREATE ); if ( xXCB.Is()|| SVSTREAM_OK == xXCB->GetError() ) { - CTBWrapper wrapper; + ScCTBWrapper wrapper; if ( wrapper.Read( *xXCB ) ) { #if OSL_DEBUG_LEVEL > 1 diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx index b8fd7539aa79..f582ab89a300 100644 --- a/sc/source/filter/excel/xltoolbar.cxx +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -94,17 +94,17 @@ CTBS::CTBS() : bSignature(0), bVersion(0), reserved1(0), reserved2(0), reserved3 { } -CTB::CTB() : nViews( 0 ), ectbid(0) +ScCTB::ScCTB() : nViews( 0 ), ectbid(0) { } -CTB::CTB(sal_uInt16 nNum ) : nViews( nNum ), ectbid(0) +ScCTB::ScCTB(sal_uInt16 nNum ) : nViews( nNum ), ectbid(0) { } -bool CTB::Read( SvStream &rS ) +bool ScCTB::Read( SvStream &rS ) { - OSL_TRACE("CTB::Read() stream pos 0x%x", rS.Tell() ); + OSL_TRACE("ScCTB::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); tb.Read( rS ); for ( sal_uInt16 index = 0; index < nViews; ++index ) @@ -117,17 +117,17 @@ bool CTB::Read( SvStream &rS ) for ( sal_Int16 index = 0; index < tb.getcCL(); ++index ) { - TBC aTBC; + ScTBC aTBC; aTBC.Read( rS ); rTBC.push_back( aTBC ); } return true; } -void CTB::Print( FILE* fp ) +void ScCTB::Print( FILE* fp ) { Indent a; - indent_printf( fp, "[ 0x%x ] CTB -- dump\n", nOffSet ); + indent_printf( fp, "[ 0x%x ] ScCTB -- dump\n", nOffSet ); indent_printf( fp, " nViews 0x%x\n", nViews); tb.Print( fp ); @@ -141,25 +141,25 @@ void CTB::Print( FILE* fp ) it->Print( fp ); } indent_printf( fp, " ectbid 0x%x\n", ectbid); - std::vector<TBC>::iterator it_end = rTBC.end(); + std::vector<ScTBC>::iterator it_end = rTBC.end(); counter = 0; - for ( std::vector<TBC>::iterator it = rTBC.begin(); it != it_end; ++it ) + for ( std::vector<ScTBC>::iterator it = rTBC.begin(); it != it_end; ++it ) { - indent_printf( fp, " TBC [%d]\n", counter++); + indent_printf( fp, " ScTBC [%d]\n", counter++); Indent c; it->Print( fp ); } } -bool CTB::IsMenuToolbar() +bool ScCTB::IsMenuToolbar() { return tb.IsMenuToolbar(); } -bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xMenuDesc, CustomToolBarImportHelper& helper ) +bool ScCTB::ImportMenuTB( ScCTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xMenuDesc, CustomToolBarImportHelper& helper ) { sal_Int32 index = 0; - for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it, ++index ) + for ( std::vector< ScTBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it, ++index ) { if ( !it->ImportToolBarControl( rWrapper, xMenuDesc, helper, IsMenuToolbar() ) ) return false; @@ -167,7 +167,7 @@ bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::co return true; } -bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper ) +bool ScCTB::ImportCustomToolBar( ScCTBWrapper& rWrapper, CustomToolBarImportHelper& helper ) { static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) ); @@ -186,7 +186,7 @@ bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ), uno::makeAny( name.getString() ) ); rtl::OUString sToolBarName = sToolbarPrefix.concat( name.getString() ); - for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it ) + for ( std::vector< ScTBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it ) { if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, helper, IsMenuToolbar() ) ) return false; @@ -236,14 +236,14 @@ void CTBS::Print( FILE* fp ) indent_printf( fp, " ictbView 0x%x\n", ictbView ); } -TBC::TBC() +ScTBC::ScTBC() { } bool -TBC::Read(SvStream &rS) +ScTBC::Read(SvStream &rS) { - OSL_TRACE("TBC::Read() stream pos 0x%x", rS.Tell() ); + OSL_TRACE("ScTBC::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); if ( !tbch.Read( rS ) ) return false; @@ -266,10 +266,10 @@ TBC::Read(SvStream &rS) void -TBC::Print(FILE* fp) +ScTBC::Print(FILE* fp) { Indent a; - indent_printf( fp, "[ 0x%x ] TBC -- dump\n", nOffSet ); + indent_printf( fp, "[ 0x%x ] ScTBC -- dump\n", nOffSet ); tbch.Print( fp ); if ( tbcCmd.get() ) tbcCmd->Print( fp ); @@ -277,7 +277,7 @@ TBC::Print(FILE* fp) tbcd->Print( fp ); } -bool TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuToolbar ) +bool ScTBC::ImportToolBarControl( ScCTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuToolbar ) { // how to identify built-in-command ? // bool bBuiltin = false; @@ -290,11 +290,11 @@ bool TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< TBCMenuSpecific* pMenu = tbcd->getMenuSpecific(); if ( pMenu ) { - // search for CTB with the appropriate name ( it contains the + // search for ScCTB with the appropriate name ( it contains the // menu items, although we cannot import ( or create ) a menu on // a custom toolbar we can import the menu items in a separate // toolbar ( better than nothing ) - CTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() ); + ScCTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() ); if ( pCustTB ) { uno::Reference< container::XIndexContainer > xMenuDesc; @@ -365,24 +365,24 @@ bool TBCCmd::Read( SvStream &rS ) return true; } -CTBWrapper::CTBWrapper() +ScCTBWrapper::ScCTBWrapper() { } -CTBWrapper::~CTBWrapper() +ScCTBWrapper::~ScCTBWrapper() { } bool -CTBWrapper::Read( SvStream &rS) +ScCTBWrapper::Read( SvStream &rS) { - OSL_TRACE("CTBWrapper::Read() stream pos 0x%x", rS.Tell() ); + OSL_TRACE("ScCTBWrapper::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); if ( !ctbSet.Read( rS ) ) return false; for ( sal_uInt16 index = 0; index < ctbSet.ctb; ++index ) { - CTB aCTB( ctbSet.ctbViews ); + ScCTB aCTB( ctbSet.ctbViews ); if ( !aCTB.Read( rS ) ) return false; rCTB.push_back( aCTB ); @@ -391,23 +391,23 @@ CTBWrapper::Read( SvStream &rS) } void -CTBWrapper::Print( FILE* fp ) +ScCTBWrapper::Print( FILE* fp ) { Indent a; - indent_printf( fp, "[ 0x%x ] CTBWrapper -- dump\n", nOffSet ); + indent_printf( fp, "[ 0x%x ] ScCTBWrapper -- dump\n", nOffSet ); ctbSet.Print( fp ); - std::vector<CTB>::iterator it_end = rCTB.end(); - for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it ) + std::vector<ScCTB>::iterator it_end = rCTB.end(); + for ( std::vector<ScCTB>::iterator it = rCTB.begin(); it != it_end; ++it ) { Indent b; it->Print( fp ); } } -CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) +ScCTB* ScCTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) { - CTB* pCTB = NULL; - for ( std::vector< CTB >::iterator it = rCTB.begin(); it != rCTB.end(); ++it ) + ScCTB* pCTB = NULL; + for ( std::vector< ScCTB >::iterator it = rCTB.begin(); it != rCTB.end(); ++it ) { if ( it->GetName().equals( sTBName ) ) { @@ -418,7 +418,7 @@ CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) return pCTB; } -bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) +bool ScCTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) { if(rCTB.empty()) return true; @@ -426,8 +426,8 @@ bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( ui::ModuleUIConfigurationManagerSupplier::create(xContext) ); - std::vector<CTB>::iterator it_end = rCTB.end(); - for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it ) + std::vector<ScCTB>::iterator it_end = rCTB.end(); + for ( std::vector<ScCTB>::iterator it = rCTB.begin(); it != it_end; ++it ) { // for each customtoolbar CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument" ) ) ) ); diff --git a/sc/source/filter/excel/xltoolbar.hxx b/sc/source/filter/excel/xltoolbar.hxx index f6e1cc6bb516..cc9794331bd9 100644 --- a/sc/source/filter/excel/xltoolbar.hxx +++ b/sc/source/filter/excel/xltoolbar.hxx @@ -35,7 +35,7 @@ namespace css = ::com::sun::star; -class CTBWrapper; +class ScCTBWrapper; // hmm I don't normally use these packed structures // but.. hey always good to do something different class TBCCmd : public TBBase @@ -52,36 +52,36 @@ public: void Print(FILE* fp); }; -class TBC : public TBBase +class ScTBC : public TBBase { TBCHeader tbch; boost::shared_ptr<TBCCmd> tbcCmd; // optional boost::shared_ptr<TBCData> tbcd; public: - TBC(); - ~TBC(){} + ScTBC(); + ~ScTBC(){} void Print( FILE* ); bool Read(SvStream &rS); - bool ImportToolBarControl( CTBWrapper&, const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar ); + bool ImportToolBarControl( ScCTBWrapper&, const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar ); }; -class CTB : public TBBase +class ScCTB : public TBBase { sal_uInt16 nViews; TB tb; std::vector<TBVisualData> rVisualData; sal_uInt32 ectbid; - std::vector< TBC > rTBC; - bool ImportCustomToolBar_Impl( CTBWrapper&, CustomToolBarImportHelper& ); + std::vector< ScTBC > rTBC; + bool ImportCustomToolBar_Impl( ScCTBWrapper&, CustomToolBarImportHelper& ); public: - CTB(); - CTB(sal_uInt16); - ~CTB(){} + ScCTB(); + ScCTB(sal_uInt16); + ~ScCTB(){} void Print( FILE* ); bool Read(SvStream &rS); bool IsMenuToolbar(); - bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& ); - bool ImportMenuTB( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& ); + bool ImportCustomToolBar( ScCTBWrapper&, CustomToolBarImportHelper& ); + bool ImportMenuTB( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& ); rtl::OUString GetName() { return tb.getName().getString(); } @@ -106,19 +106,19 @@ public: bool Read(SvStream &rS); }; -class CTBWrapper : public TBBase +class ScCTBWrapper : public TBBase { CTBS ctbSet; - std::vector< CTB > rCTB; + std::vector< ScCTB > rCTB; public: - CTBWrapper(); - ~CTBWrapper(); + ScCTBWrapper(); + ~ScCTBWrapper(); bool Read(SvStream &rS); void Print( FILE* ); bool ImportCustomToolBar( SfxObjectShell& rDocSh ); - CTB* GetCustomizationData( const rtl::OUString& name ); + ScCTB* GetCustomizationData( const rtl::OUString& name ); }; |