[Libreoffice-commits] .: sc/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Oct 7 22:15:23 PDT 2012


 sc/source/filter/excel/excimp8.cxx   |    2 
 sc/source/filter/excel/xltoolbar.cxx |   76 +++++++++++++--------------
 sc/source/filter/excel/xltoolbar.hxx |   36 ++++++------
 sw/source/filter/ww8/ww8toolbar.cxx  |   98 +++++++++++++++++------------------
 sw/source/filter/ww8/ww8toolbar.hxx  |   60 ++++++++++-----------
 5 files changed, 136 insertions(+), 136 deletions(-)

New commits:
commit d650d404c006ffcbb47d6871e2eab6fc4d764c40
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Oct 7 23:14:05 2012 +0300

    Deduplicate CTB, TBC and CTBWrapper (for disable-dynloading)
    
    Change-Id: I0e9895ca59fa75958107df2cbf4348214df52664

diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 416b3da..d0a4a7e 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 b8fd753..f582ab8 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 f6e1cc6..cc97943 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 );
 };
 
 
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index 48910c0..696bbb4 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -45,7 +45,7 @@
 #include <map>
 using namespace com::sun::star;
 
-// no. of visual data elements in a CTB ( fixed )
+// no. of visual data elements in a SwCTB ( fixed )
 const short nVisualData = 5;
 
 typedef std::map< sal_Int16, rtl::OUString > IdToString;
@@ -91,7 +91,7 @@ rtl::OUString MSOWordCommandConvertor::MSOTCIDToOOCommand( sal_Int16 key )
 }
 
 
-CTBWrapper::CTBWrapper( bool bReadId ) : Tcg255SubStruct( bReadId )
+SwCTBWrapper::SwCTBWrapper( bool bReadId ) : Tcg255SubStruct( bReadId )
 ,reserved2(0)
 ,reserved3(0)
 ,reserved4(0)
@@ -103,20 +103,20 @@ CTBWrapper::CTBWrapper( bool bReadId ) : Tcg255SubStruct( bReadId )
 {
 }
 
-CTBWrapper::~CTBWrapper()
+SwCTBWrapper::~SwCTBWrapper()
 {
 }
 
-Customization* CTBWrapper::GetCustomizaton( sal_Int16 index )
+Customization* SwCTBWrapper::GetCustomizaton( sal_Int16 index )
 {
     if ( index < 0 || index >= static_cast<sal_Int16>( rCustomizations.size() ) )
         return NULL;
     return &rCustomizations[ index ];
 }
 
-CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName )
+SwCTB* SwCTBWrapper::GetCustomizationData( const rtl::OUString& sTBName )
 {
-    CTB* pCTB = NULL;
+    SwCTB* pCTB = NULL;
     for ( std::vector< Customization >::iterator it = rCustomizations.begin(); it != rCustomizations.end(); ++it )
     {
         if ( it->GetCustomizationData() && it->GetCustomizationData()->GetName().equals( sTBName ) )
@@ -128,9 +128,9 @@ CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName )
     return pCTB;
 }
 
-bool CTBWrapper::Read( SvStream& rS )
+bool SwCTBWrapper::Read( SvStream& rS )
 {
-    OSL_TRACE("CTBWrapper::Read() stream pos 0x%x", rS.Tell() );
+    OSL_TRACE("SwCTBWrapper::Read() stream pos 0x%x", rS.Tell() );
     nOffSet = rS.Tell();
     Tcg255SubStruct::Read( rS );
     rS >> reserved2 >> reserved3 >> reserved4 >> reserved5;
@@ -138,18 +138,18 @@ bool CTBWrapper::Read( SvStream& rS )
     long nExpectedPos =  rS.Tell() + cbDTBC;
     if ( cbDTBC )
     {
-        // cbDTBC is the size in bytes of the TBC array
-        // but the size of a TBC element is dynamic ( and this relates to TBDelta's
+        // cbDTBC is the size in bytes of the SwTBC array
+        // but the size of a SwTBC element is dynamic ( and this relates to TBDelta's
         int nStart = rS.Tell();
 
         int bytesRead = 0;
         int bytesToRead = cbDTBC - bytesRead;
         // cbDTBC specifies the size ( in bytes ) taken by an array ( of unspecified size )
-        // of TBC records ( TBC records have dynamic length, so we need to check our position
+        // of SwTBC records ( SwTBC records have dynamic length, so we need to check our position
         // after each read )
         do
         {
-            TBC aTBC;
+            SwTBC aTBC;
             if ( !aTBC.Read( rS ) )
                 return false;
             rtbdc.push_back( aTBC );
@@ -159,7 +159,7 @@ bool CTBWrapper::Read( SvStream& rS )
     if ( static_cast< long >( rS.Tell() ) != nExpectedPos )
     {
         // Strange error condition, shouldn't happen ( but does in at least
-        // one test document ) In the case where it happens the TBC &
+        // one test document ) In the case where it happens the SwTBC &
         // TBCHeader records seem blank??? ( and incorrect )
         OSL_ENSURE( static_cast< long >(rS.Tell()) == nExpectedPos, "### Error: Expected pos not equal to actual pos after reading rtbdc");
         OSL_TRACE("\tPos now is 0x%x should be 0x%x", rS.Tell(), nExpectedPos );
@@ -184,9 +184,9 @@ bool CTBWrapper::Read( SvStream& rS )
     return true;
 }
 
-TBC* CTBWrapper::GetTBCAtOffset( sal_uInt32 nStreamOffset )
+SwTBC* SwCTBWrapper::GetTBCAtOffset( sal_uInt32 nStreamOffset )
 {
-    for ( std::vector< TBC >::iterator it = rtbdc.begin(); it != rtbdc.end(); ++it )
+    for ( std::vector< SwTBC >::iterator it = rtbdc.begin(); it != rtbdc.end(); ++it )
     {
         if ( (*it).GetOffset() == nStreamOffset )
             return &(*it);
@@ -194,10 +194,10 @@ TBC* CTBWrapper::GetTBCAtOffset( sal_uInt32 nStreamOffset )
     return NULL;
 }
 
-void CTBWrapper::Print( FILE* fp )
+void SwCTBWrapper::Print( FILE* fp )
 {
     Indent a;
-    indent_printf(fp,"[ 0x%x ] CTBWrapper - dump\n", nOffSet );
+    indent_printf(fp,"[ 0x%x ] SwCTBWrapper - dump\n", nOffSet );
     bool bRes = ( ch == 0x12 && reserved2 == 0x0 && reserved3 == 0x7 && reserved4 == 0x6 && reserved5 == 0xC );
     if ( bRes )
         indent_printf(fp,"  sanity check ( first 8 bytes conform )\n");
@@ -217,7 +217,7 @@ void CTBWrapper::Print( FILE* fp )
 
     sal_Int32 index = 0;
 
-    for ( std::vector< TBC >::iterator it = rtbdc.begin(); it != rtbdc.end(); ++it, ++index )
+    for ( std::vector< SwTBC >::iterator it = rtbdc.begin(); it != rtbdc.end(); ++it, ++index )
     {
         indent_printf(fp,"  Dumping rtbdc[%d]\n", static_cast< int >( index ));
         Indent b;
@@ -234,7 +234,7 @@ void CTBWrapper::Print( FILE* fp )
     }
 }
 
-bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh )
+bool SwCTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh )
 {
     for ( std::vector< Customization >::iterator it = rCustomizations.begin(); it != rCustomizations.end(); ++it )
     {
@@ -256,7 +256,7 @@ bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh )
     return false;
 }
 
-Customization::Customization( CTBWrapper* wrapper ) : tbidForTBD( 0 )
+Customization::Customization( SwCTBWrapper* wrapper ) : tbidForTBD( 0 )
 ,reserved1( 0 )
 , ctbds( 0 )
 , pWrapper( wrapper )
@@ -288,7 +288,7 @@ bool Customization::Read( SvStream &rS)
     }
     else
     {
-        customizationDataCTB.reset( new CTB() );
+        customizationDataCTB.reset( new SwCTB() );
         if ( !customizationDataCTB->Read( rS ) )
                 return false;
     }
@@ -328,7 +328,7 @@ void Customization::Print( FILE* fp )
 
 }
 
-bool Customization::ImportMenu( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
+bool Customization::ImportMenu( SwCTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
 {
     if ( tbidForTBD == 0x25 )  // we can handle in a limited way additions the built-in menu bar
     {
@@ -346,7 +346,7 @@ bool Customization::ImportMenu( CTBWrapper& rWrapper, CustomToolBarImportHelper&
 
                     sMenuBar = sMenuBar.concat( "menubar" );
                     // Get menu name
-                    TBC* pTBC = pWrapper->GetTBCAtOffset( it->TBCStreamOffset() );
+                    SwTBC* pTBC = pWrapper->GetTBCAtOffset( it->TBCStreamOffset() );
                     if ( !pTBC )
                         return false;
                     rtl::OUString sMenuName = pTBC->GetCustomText();
@@ -402,7 +402,7 @@ bool Customization::ImportMenu( CTBWrapper& rWrapper, CustomToolBarImportHelper&
     return true;
 }
 
-bool Customization::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
+bool Customization::ImportCustomToolBar( SwCTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
 {
     if ( GetTBIDForTB() == 0x25 )
         return ImportMenu( rWrapper, helper );
@@ -487,7 +487,7 @@ void TBDelta::Print( FILE* fp )
     }
 }
 
-CTB::CTB() : cbTBData( 0 )
+SwCTB::SwCTB() : cbTBData( 0 )
 ,iWCTBl( 0 )
 ,reserved( 0 )
 ,unused( 0 )
@@ -495,19 +495,19 @@ CTB::CTB() : cbTBData( 0 )
 {
 }
 
-CTB::~CTB()
+SwCTB::~SwCTB()
 {
 }
 
-bool CTB::IsMenuToolbar()
+bool SwCTB::IsMenuToolbar()
 {
     return tb.IsMenuToolbar();
 }
 
 
-bool CTB::Read( SvStream &rS)
+bool SwCTB::Read( SvStream &rS)
 {
-    OSL_TRACE("CTB::Read() stream pos 0x%x", rS.Tell() );
+    OSL_TRACE("SwCTB::Read() stream pos 0x%x", rS.Tell() );
     nOffSet = rS.Tell();
     if ( !name.Read( rS ) )
         return false;
@@ -527,7 +527,7 @@ bool CTB::Read( SvStream &rS)
     {
         for ( sal_Int32 index = 0; index < cCtls; ++index )
         {
-            TBC aTBC;
+            SwTBC aTBC;
             if ( !aTBC.Read( rS ) )
                 return false;
             rTBC.push_back( aTBC );
@@ -537,10 +537,10 @@ bool CTB::Read( SvStream &rS)
 }
 
 void
-CTB::Print( FILE* fp )
+SwCTB::Print( FILE* fp )
 {
     Indent a;
-    indent_printf(fp, "[ 0x%x ] CTB - dump\n", nOffSet );
+    indent_printf(fp, "[ 0x%x ] SwCTB - dump\n", nOffSet );
     indent_printf(fp, "  name %s\n", rtl::OUStringToOString( name.getString(), RTL_TEXTENCODING_UTF8 ).getStr() );
     indent_printf(fp, "  cbTBData size, in bytes, of this structure excluding the name, cCtls, and rTBC fields.  %x\n", static_cast< unsigned int >( cbTBData ) );
 
@@ -563,7 +563,7 @@ CTB::Print( FILE* fp )
     }
 }
 
-bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
+bool SwCTB::ImportCustomToolBar( SwCTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
 {
     static rtl::OUString sToolbarPrefix( "private:resource/toolbar/custom_" );
     bool bRes = false;
@@ -580,7 +580,7 @@ bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper&
         xProps->setPropertyValue( "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< SwTBC >::iterator it =  rTBC.begin(); it != rTBC.end(); ++it )
         {
             // createToolBar item for control
             if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, helper, IsMenuToolbar() ) )
@@ -608,9 +608,9 @@ bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper&
     return bRes;
 }
 
-bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xIndexContainer, CustomToolBarImportHelper& rHelper )
+bool SwCTB::ImportMenuTB( SwCTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xIndexContainer, CustomToolBarImportHelper& rHelper )
 {
-    for ( std::vector< TBC >::iterator it =  rTBC.begin(); it != rTBC.end(); ++it )
+    for ( std::vector< SwTBC >::iterator it =  rTBC.begin(); it != rTBC.end(); ++it )
     {
         // createToolBar item for control
         if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, rHelper, true ) )
@@ -619,17 +619,17 @@ bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::co
     return true;
 }
 
-TBC::TBC()
+SwTBC::SwTBC()
 {
 }
 
-TBC::~TBC()
+SwTBC::~SwTBC()
 {
 }
 
-bool TBC::Read( SvStream &rS )
+bool SwTBC::Read( SvStream &rS )
 {
-    OSL_TRACE("TBC::Read() stream pos 0x%x", rS.Tell() );
+    OSL_TRACE("SwTBC::Read() stream pos 0x%x", rS.Tell() );
     nOffSet = rS.Tell();
     if ( !tbch.Read( rS ) )
         return false;
@@ -648,10 +648,10 @@ bool TBC::Read( SvStream &rS )
     return true;
 }
 
-void TBC::Print( FILE* fp )
+void SwTBC::Print( FILE* fp )
 {
     Indent a;
-    indent_printf(fp,"[ 0x%x ] TBC -- dump\n", nOffSet );
+    indent_printf(fp,"[ 0x%x ] SwTBC -- dump\n", nOffSet );
     indent_printf(fp,"  dumping header ( TBCHeader )\n");
     tbch.Print( fp );
     if ( cid.get() )
@@ -664,7 +664,7 @@ void TBC::Print( FILE* fp )
 }
 
 bool
-TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar )
+SwTBC::ImportToolBarControl( SwCTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar )
 {
     // cmtFci       0x1 Command based on a built-in command. See CidFci.
     // cmtMacro     0x2 Macro command. See CidMacro.
@@ -724,11 +724,11 @@ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css:
         if ( pMenu )
         {
             OSL_TRACE("** control has a menu, name of toolbar with menu items is %s", rtl::OUStringToOString( pMenu->Name(), RTL_TEXTENCODING_UTF8 ).getStr() );
-            // search for CTB with the appropriate name ( it contains the
+            // search for SwCTB 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() );
+            SwCTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() );
             if ( pCustTB )
             {
                  uno::Reference< container::XIndexContainer > xMenuDesc;
@@ -772,7 +772,7 @@ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css:
 }
 
 rtl::OUString
-TBC::GetCustomText()
+SwTBC::GetCustomText()
 {
     rtl::OUString sCustomText;
     if ( tbcd.get() )
@@ -874,7 +874,7 @@ bool Tcg255::processSubStruct( sal_uInt8 nId, SvStream &rS )
          }
          case 0x12:
          {
-             pSubStruct = new CTBWrapper( false );
+             pSubStruct = new SwCTBWrapper( false );
              break;
          }
          default:
@@ -890,13 +890,13 @@ bool Tcg255::processSubStruct( sal_uInt8 nId, SvStream &rS )
 
 bool Tcg255::ImportCustomToolBar( SfxObjectShell& rDocSh )
 {
-    // Find the CTBWrapper
+    // Find the SwCTBWrapper
     for ( std::vector< Tcg255SubStruct* >::const_iterator it = rgtcgData.begin(); it != rgtcgData.end(); ++it )
     {
         if ( (*it)->id() == 0x12 )
         {
             // not so great, shouldn't really have to do a horror casting
-            CTBWrapper* pCTBWrapper =  dynamic_cast< CTBWrapper* > ( *it );
+            SwCTBWrapper* pCTBWrapper =  dynamic_cast< SwCTBWrapper* > ( *it );
             if ( pCTBWrapper )
             {
                 if ( !pCTBWrapper->ImportCustomToolBar( rDocSh ) )
diff --git a/sw/source/filter/ww8/ww8toolbar.hxx b/sw/source/filter/ww8/ww8toolbar.hxx
index a99c65f..542d288 100644
--- a/sw/source/filter/ww8/ww8toolbar.hxx
+++ b/sw/source/filter/ww8/ww8toolbar.hxx
@@ -45,22 +45,22 @@ public:
     void Print( FILE* fp );
 };
 
-class CTBWrapper;
-class TBC : public TBBase
+class SwCTBWrapper;
+class SwTBC : public TBBase
 {
     TBCHeader tbch;
     boost::shared_ptr< sal_uInt32 > cid; // optional
     boost::shared_ptr<TBCData> tbcd;
 public:
-    TBC();
-    ~TBC();
+    SwTBC();
+    ~SwTBC();
     bool Read(SvStream &rS);
     void Print( FILE* );
-    bool ImportToolBarControl( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
+    bool ImportToolBarControl( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
     rtl::OUString GetCustomText();
 };
 
-class CTB : public TBBase
+class SwCTB : public TBBase
 {
     Xst name;
     sal_Int32 cbTBData;
@@ -70,18 +70,18 @@ class CTB : public TBBase
     sal_uInt16 reserved;
     sal_uInt16 unused;
     sal_Int32 cCtls;
-    std::vector< TBC > rTBC;
+    std::vector< SwTBC > rTBC;
 
-    CTB(const CTB&);
-    CTB& operator = ( const CTB&);
+    SwCTB(const SwCTB&);
+    SwCTB& operator = ( const SwCTB&);
 public:
-    CTB();
-    ~CTB();
+    SwCTB();
+    ~SwCTB();
     bool Read(SvStream &rS);
     void Print( FILE* fp );
     bool IsMenuToolbar();
-    bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
-    bool ImportMenuTB( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
+    bool ImportCustomToolBar( SwCTBWrapper&, CustomToolBarImportHelper& );
+    bool ImportMenuTB( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
     rtl::OUString GetName() { return tb.getName().getString(); }
 };
 
@@ -124,32 +124,32 @@ public:
     bool Read(SvStream &rS);
 };
 
-class CTBWrapper;
+class SwCTBWrapper;
 class Customization : public TBBase
 {
-friend class CTBWrapper;
+friend class SwCTBWrapper;
     sal_Int32 tbidForTBD;
     sal_uInt16 reserved1;
     sal_Int16 ctbds;
-    CTBWrapper* pWrapper;
-    boost::shared_ptr< CTB > customizationDataCTB;
+    SwCTBWrapper* pWrapper;
+    boost::shared_ptr< SwCTB > customizationDataCTB;
     std::vector< TBDelta > customizationDataTBDelta;
     bool bIsDroppedMenuTB;
-    bool ImportMenu( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
+    bool ImportMenu( SwCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
 public:
-    Customization( CTBWrapper* rapper );
+    Customization( SwCTBWrapper* rapper );
     ~Customization();
     bool Read(SvStream &rS);
-    bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
-    bool ImportMenu( CTBWrapper&, CustomToolBarImportHelper& );
+    bool ImportCustomToolBar( SwCTBWrapper&, CustomToolBarImportHelper& );
+    bool ImportMenu( SwCTBWrapper&, CustomToolBarImportHelper& );
     void Print( FILE* );
     sal_Int32 GetTBIDForTB(){ return tbidForTBD; }
-    CTB*  GetCustomizationData() { return customizationDataCTB.get(); };
+    SwCTB*  GetCustomizationData() { return customizationDataCTB.get(); };
 };
 
 class SfxObjectShell;
 
-class CTBWrapper : public Tcg255SubStruct
+class SwCTBWrapper : public Tcg255SubStruct
 {
     // reserved1 is the ch field of Tcg255SubStruct
     sal_uInt16 reserved2;
@@ -162,21 +162,21 @@ class CTBWrapper : public Tcg255SubStruct
 
     sal_Int32 cbDTBC;
 
-    std::vector< TBC > rtbdc; //
+    std::vector< SwTBC > rtbdc; //
     std::vector< Customization > rCustomizations; // array of Customizations
     std::vector< sal_Int16 > dropDownMenuIndices; // array of indexes of Customization toolbars that are dropped by a menu
-    CTBWrapper(const CTBWrapper&);
-    CTBWrapper& operator = ( const CTBWrapper&);
+    SwCTBWrapper(const SwCTBWrapper&);
+    SwCTBWrapper& operator = ( const SwCTBWrapper&);
 public:
-    CTBWrapper( bool bReadId = true );
-    ~CTBWrapper();
+    SwCTBWrapper( bool bReadId = true );
+    ~SwCTBWrapper();
     void InsertDropIndex( sal_Int32 aIndex ) { dropDownMenuIndices.push_back( aIndex ); }
-    TBC* GetTBCAtOffset( sal_uInt32 nStreamOffset );
+    SwTBC* GetTBCAtOffset( sal_uInt32 nStreamOffset );
     bool Read(SvStream &rS);
     bool ImportCustomToolBar( SfxObjectShell& rDocSh );
 
     Customization* GetCustomizaton( sal_Int16 index );
-    CTB* GetCustomizationData( const rtl::OUString& name );
+    SwCTB* GetCustomizationData( const rtl::OUString& name );
     void Print( FILE* );
 };
 


More information about the Libreoffice-commits mailing list