[Libreoffice-commits] .: sc/inc sc/source unusedcode.easy

Thomas Arnhold tarnhold at kemper.freedesktop.org
Tue Jan 17 05:05:56 PST 2012


 sc/inc/dpglobal.hxx                  |    6 ---
 sc/inc/dpobject.hxx                  |    4 --
 sc/inc/dpsave.hxx                    |    1 
 sc/inc/dptablecache.hxx              |    5 ---
 sc/source/core/data/dpobject.cxx     |   39 -----------------------
 sc/source/core/data/dpsave.cxx       |   57 ----------------------------------
 sc/source/core/data/dptablecache.cxx |   58 -----------------------------------
 sc/source/ui/dbgui/fieldwnd.cxx      |   11 ------
 sc/source/ui/inc/fieldwnd.hxx        |    6 ---
 unusedcode.easy                      |   14 --------
 10 files changed, 201 deletions(-)

New commits:
commit a47cb498471f38987c248519435bc4867ffa456e
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Tue Jan 17 12:53:28 2012 +0100

    remove unused ScDP* methods

diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx
index 9d99b69..55a6aea 100644
--- a/sc/inc/dpglobal.hxx
+++ b/sc/inc/dpglobal.hxx
@@ -136,23 +136,17 @@ public:
     // case insensitive equality
     static sal_Int32    Compare( const ScDPItemData& rA, const ScDPItemData& rB );
 
-#if OSL_DEBUG_LEVEL > 1
-    void    dump() const;
-#endif
-
 public:
     bool IsHasData() const ;
     bool IsHasErr() const ;
     bool IsValue() const;
     String  GetString() const ;
     double  GetValue() const ;
-    sal_uLong    GetNumFormat() const ;
     bool HasStringData() const ;
     bool IsDate() const;
     bool HasDatePart() const;
     void SetDate( bool b ) ;
 
-    TypedStrData*  CreateTypeString( );
     sal_uInt8    GetType() const;
     sal_uInt8 & GetFlag() throw() { return mbFlag; }
     const sal_uInt8 & GetFlag() const throw() { return const_cast<ScDPItemData*>(this)->GetFlag(); }
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 47c1999..a894833 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -278,7 +278,6 @@ public:
 
     private:
         void updateCache(const ScRange& rRange, std::set<ScDPObject*>& rRefs);
-        void removeCache(const ScRange& rRange);
         bool remove(const ScDPCache* p);
     };
 
@@ -298,7 +297,6 @@ public:
         size_t size() const;
     private:
         void updateCache(const rtl::OUString& rName, const ScRange& rRange, std::set<ScDPObject*>& rRefs);
-        void removeCache(const ::rtl::OUString& rName);
         bool remove(const ScDPCache* p);
     };
 
@@ -331,7 +329,6 @@ public:
     public:
         DBCaches(ScDocument* pDoc);
         const ScDPCache* getCache(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand);
-        size_t size() const;
 
     private:
         com::sun::star::uno::Reference<com::sun::star::sdbc::XRowSet> createRowSet(
@@ -339,7 +336,6 @@ public:
 
         void updateCache(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand,
                          std::set<ScDPObject*>& rRefs);
-        void removeCache(sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand);
         bool remove(const ScDPCache* p);
     };
 
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index fc16b49..ee2fd6d 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -328,7 +328,6 @@ public:
         { return bDrillDown; }
 
     void WriteToSource( const com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>& xSource );
-    void Refresh( const com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>& xSource );
     bool IsEmpty() const;
 
     const ScDPDimensionSaveData* GetExistingDimensionData() const
diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx
index dcfc066..c4c2ebc 100644
--- a/sc/inc/dptablecache.hxx
+++ b/sc/inc/dptablecache.hxx
@@ -103,19 +103,15 @@ public:
     SCROW GetIdByItemData( long nDim, const String& sItemData ) const;
     SCROW GetIdByItemData( long nDim, const ScDPItemData& rData ) const;
 
-    SCROW GetAdditionalItemID ( const String& sItemData ) const;
     SCROW GetAdditionalItemID( const ScDPItemData& rData ) const;
 
     SCCOL GetDimensionIndex( String sName) const;
-    const ScDPItemData* GetSortedItemData( SCCOL nDim, SCROW nOrder ) const;
     sal_uLong GetNumType ( sal_uLong nFormat ) const;
     sal_uLong GetNumberFormat( long nDim ) const;
     bool  IsDateDimension( long nDim ) const ;
-    sal_uLong GetDimNumType( SCCOL nDim) const;
     SCROW GetDimMemberCount( SCCOL nDim ) const;
     SCROW GetOrder( long nDim, SCROW nIndex ) const;
 
-    SCROW GetSortedItemDataId( SCCOL nDim, SCROW nOrder ) const;
     const DataListType& GetDimMemberValues( SCCOL nDim ) const;
     bool InitFromDoc(ScDocument* pDoc, const ScRange& rRange);
     bool InitFromDataBase(const  ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& xRowSet, const Date& rNullDate);
@@ -123,7 +119,6 @@ public:
     SCROW  GetRowCount() const;
     SCROW  GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) const;
     String GetDimensionName( sal_uInt16 nColumn ) const;
-    bool IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const;
     bool IsRowEmpty( SCROW nRow ) const;
     bool IsValid() const;
     bool ValidQuery(SCROW nRow, const ScQueryParam& rQueryParam) const;
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 3113f1b..984d3de 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2597,25 +2597,6 @@ void ScDPCollection::SheetCaches::updateCache(const ScRange& rRange, std::set<Sc
     rRefs.swap(aRefs);
 }
 
-void ScDPCollection::SheetCaches::removeCache(const ScRange& rRange)
-{
-    RangeIndexType::iterator it = std::find(maRanges.begin(), maRanges.end(), rRange);
-    if (it == maRanges.end())
-        // Not cached.  Nothing to do.
-        return;
-
-    size_t nIndex = std::distance(maRanges.begin(), it);
-    CachesType::iterator itCache = maCaches.find(nIndex);
-    if (itCache == maCaches.end())
-    {
-        OSL_FAIL("Cache pool and index pool out-of-sync !!!");
-        return;
-    }
-
-    it->SetInvalid(); // Make this slot available for future caches.
-    maCaches.erase(itCache);
-}
-
 bool ScDPCollection::SheetCaches::remove(const ScDPCache* p)
 {
     CachesType::iterator it = maCaches.begin(), itEnd = maCaches.end();
@@ -2675,13 +2656,6 @@ void ScDPCollection::NameCaches::updateCache(const OUString& rName, const ScRang
     rRefs.swap(aRefs);
 }
 
-void ScDPCollection::NameCaches::removeCache(const OUString& rName)
-{
-    CachesType::iterator itr = maCaches.find(rName);
-    if (itr != maCaches.end())
-        maCaches.erase(itr);
-}
-
 bool ScDPCollection::NameCaches::remove(const ScDPCache* p)
 {
     CachesType::iterator it = maCaches.begin(), itEnd = maCaches.end();
@@ -2729,11 +2703,6 @@ const ScDPCache* ScDPCollection::DBCaches::getCache(sal_Int32 nSdbType, const OU
     return p;
 }
 
-size_t ScDPCollection::DBCaches::size() const
-{
-    return maCaches.size();
-}
-
 uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet(
     sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const ::rtl::OUString& rCommand)
 {
@@ -2832,14 +2801,6 @@ void ScDPCollection::DBCaches::updateCache(
     aRefs.swap(rRefs);
 }
 
-void ScDPCollection::DBCaches::removeCache(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand)
-{
-    DBType aType(nSdbType, rDBName, rCommand);
-    CachesType::iterator itr = maCaches.find(aType);
-    if (itr != maCaches.end())
-        maCaches.erase(itr);
-}
-
 bool ScDPCollection::DBCaches::remove(const ScDPCache* p)
 {
     CachesType::iterator it = maCaches.begin(), itEnd = maCaches.end();
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 33bcc42..e8a48b7 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -1241,63 +1241,6 @@ bool ScDPSaveData::HasInvisibleMember(const OUString& rDimName) const
     return pDim->HasInvisibleMember();
 }
 
-void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xSource )
-{
-    try
-    {
-        std::list<rtl::OUString> deletedDims;
-
-        {
-            boost::ptr_vector<ScDPSaveDimension>::iterator iter = aDimList.end()-1;
-            for (long i = aDimList.size()-1; i >= 0; ++i,--iter)
-            {
-                rtl::OUString aName = iter->GetName();
-                if ( iter->IsDataLayout() )
-                    continue;
-
-                uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
-                uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
-                long nIntCount = xIntDims->getCount();
-                bool bFound = false;
-                for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
-                {
-                    uno::Reference<uno::XInterface> xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(nIntDim) );
-                    uno::Reference<container::XNamed> xDimName( xIntDim, uno::UNO_QUERY );
-                    if ( xDimName.is() && xDimName->getName() == aName )
-                        bFound = true;
-                }
-
-                if ( !bFound )
-                {
-                    deletedDims.push_back( aName );
-                    iter = aDimList.erase(iter);
-                    OSL_FAIL( "\n Remove dim: \t" );
-                    OSL_TRACE( "%s", aName.getStr() );
-                }
-
-            }
-        }
-
-        {
-            boost::ptr_vector<ScDPSaveDimension>::reverse_iterator iter;
-            for (iter = aDimList.rbegin(); iter != aDimList.rend(); ++iter) //check every dimension ??
-            {
-                rtl::OUString aName = iter->GetName();
-                if ( iter->IsDataLayout() )
-                    continue;
-                iter->Refresh( xSource, deletedDims );
-
-            }
-        }
-
-        mbDimensionMembersBuilt = false; // there may be new members
-    }
-    catch(uno::Exception&)
-    {
-        OSL_FAIL("error in ScDPSaveData::Refresh");
-    }
-}
-
 void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
                                 com::sun::star::sheet::XDimensionsSupplier>& xSource ,
                                 const std::list<rtl::OUString>& deletedDims)
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index ed45647..6dd05e9 100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -306,24 +306,6 @@ sal_Int32 ScDPItemData::Compare( const ScDPItemData& rA,
         return ScGlobal::GetCollator()->compareString( rA.aString, rB.aString );
 }
 
-#if OSL_DEBUG_LEVEL > 1
-void    ScDPItemData::dump() const
-{
-    OSL_TRACE( "Numberformat= %o",  nNumFormat );
-    OSL_TRACE( "%s", aString.GetBuffer() );
-    OSL_TRACE( "fValue= %f", fValue );
-    OSL_TRACE( "mbFlag= %d", mbFlag);
-}
-#endif
-
-TypedStrData* ScDPItemData::CreateTypeString( )
-{
-    if ( IsValue() )
-        return new TypedStrData( aString, fValue, SC_STRTYPE_VALUE );
-    else
-        return new TypedStrData( aString );
-}
-
 sal_uInt8 ScDPItemData::GetType() const
 {
     if ( IsHasErr() )
@@ -360,10 +342,6 @@ double ScDPItemData::GetValue() const
 {
     return fValue;
 }
-sal_uLong  ScDPItemData::GetNumFormat() const
-{
-    return nNumFormat;
-}
 
 bool ScDPItemData::HasStringData() const
 {
@@ -597,16 +575,6 @@ bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const
     }
 }
 
-sal_uLong ScDPCache::GetDimNumType( SCCOL nDim) const
-{
-    OSL_ENSURE( IsValid(), "  IsValid() == false " );
-    OSL_ENSURE( nDim < mnColumnCount && nDim >=0, " dimention out of bound " );
-    if ( maTableDataValues[nDim].size()==0 )
-        return NUMBERFORMAT_UNDEFINED;
-    else
-        return GetNumType(maTableDataValues[nDim][0].nNumFormat);
-}
-
 bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
 {
     if (!rParam.GetEntry(0).bDoQuery)
@@ -805,11 +773,6 @@ bool ScDPCache::IsRowEmpty( SCROW nRow ) const
     return mbEmptyRow[ nRow ];
 }
 
-bool ScDPCache::IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const
-{
-    return !GetItemDataById( nColumn, GetItemDataId( nColumn, nRow, false ) )->IsHasData();
-}
-
 bool ScDPCache::AddData(long nDim, ScDPItemData* pData)
 {
     OSL_ENSURE( IsValid(), "  IsValid() == false " );
@@ -926,15 +889,6 @@ const ScDPCache::DataListType& ScDPCache::GetDimMemberValues(SCCOL nDim) const
     return maTableDataValues[nDim];
 }
 
-SCROW ScDPCache::GetSortedItemDataId(SCCOL nDim, SCROW nOrder) const
-{
-    OSL_ENSURE ( IsValid(), "IsValid");
-    OSL_ENSURE( nDim>=0 && nDim < mnColumnCount,  "nDim < mnColumnCount");
-    OSL_ENSURE( nOrder >= 0 && (size_t) nOrder < maGlobalOrder[nDim].size(), "nOrder < mpGlobalOrder[nDim].size()" );
-
-    return maGlobalOrder[nDim][nOrder];
-}
-
 sal_uLong ScDPCache::GetNumType(sal_uLong nFormat) const
 {
     SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
@@ -987,12 +941,6 @@ SCROW ScDPCache::GetDimMemberCount( SCCOL nDim ) const
     return maTableDataValues[nDim].size();
 }
 
-const ScDPItemData* ScDPCache::GetSortedItemData(SCCOL nDim, SCROW nOrder) const
-{
-    SCROW n = GetSortedItemDataId( nDim, nOrder );
-    return GetItemDataById( nDim, n );
-}
-
 SCCOL ScDPCache::GetDimensionIndex(String sName) const
 {
     for (size_t i = 1; i < maLabelNames.size(); ++i)
@@ -1052,12 +1000,6 @@ SCROW ScDPCache::GetIdByItemData( long nDim, const ScDPItemData& rData  ) const
     return  GetRowCount() + maAdditionalData.getDataId(rData);
 }
 
-SCROW ScDPCache::GetAdditionalItemID ( const String& sItemData ) const
-{
-    ScDPItemData rData ( sItemData );
-    return GetAdditionalItemID( rData );
-}
-
 SCROW ScDPCache::GetAdditionalItemID( const ScDPItemData& rData ) const
 {
     return GetRowCount() + maAdditionalData.insertData( rData );
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index dc438f3..40eb873 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -560,11 +560,6 @@ void ScDPFieldControlBase::DrawField(
     rDev.DrawBitmap( rRect.TopLeft(), aVirDev.GetBitmap( Point( 0, 0 ), aDevSize ) );
 }
 
-ScDPLayoutDlg* ScDPFieldControlBase::GetParentDlg() const
-{
-    return mpDlg;
-}
-
 void ScDPFieldControlBase::AppendPaintable(Window* p)
 {
     maPaintables.push_back(p);
@@ -681,12 +676,6 @@ void ScDPFieldControlBase::MoveSelection(SCsCOL nDX, SCsROW nDY)
     SetSelection( nNewIndex );
 }
 
-void ScDPFieldControlBase::ModifySelectionOffset( long nOffsetDiff )
-{
-    mnFieldSelected -= nOffsetDiff;
-    Redraw();
-}
-
 void ScDPFieldControlBase::SelectNext()
 {
     SetSelection(mnFieldSelected + 1);
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index edd8aec..2b232cf 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -151,10 +151,6 @@ public:
     size_t GetSelectedField() const;
     void SetSelectedField(size_t nSelected);
 
-    /** Notifies this control that the offset of the first field has been changed.
-        The control has to adjust the selection to keep the same field selected
-        on scrolling with scrollbar. */
-    void            ModifySelectionOffset( long nOffsetDiff );
     /** Selects the next field. Called i.e. after moving a field from SELECT area. */
     void            SelectNext();
     /** Grabs focus and sets new selection. */
@@ -190,8 +186,6 @@ protected:
     void DrawField(
         OutputDevice& rDev, const Rectangle& rRect, FieldName& rText, bool bFocus );
 
-    ScDPLayoutDlg* GetParentDlg() const;
-
     void AppendPaintable(Window* p);
     void DrawPaintables();
     void DrawInvertSelection();
diff --git a/unusedcode.easy b/unusedcode.easy
index b1dcbcd..6efb15d 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -252,21 +252,7 @@ ScCsvControl::ScCsvControl(Window*, ScCsvLayoutData const&, long)
 ScDBCollection::AnonDBs::erase(boost::void_ptr_iterator<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<void**, std::__cxx1998::vector<void*, std::allocator<void*> > >, std::__debug::vector<void*, std::allocator<void*> > >, ScDBData>)
 ScDBCollection::AnonDBs::size() const
 ScDLL::Exit()
-ScDPCache::GetAdditionalItemID(String const&) const
-ScDPCache::GetDimNumType(short) const
-ScDPCache::GetSortedItemData(short, int) const
-ScDPCache::IsEmptyMember(int, unsigned short) const
-ScDPCollection::DBCaches::removeCache(int, rtl::OUString const&, rtl::OUString const&)
-ScDPCollection::DBCaches::size() const
-ScDPCollection::NameCaches::removeCache(rtl::OUString const&)
-ScDPCollection::SheetCaches::removeCache(ScRange const&)
-ScDPFieldControlBase::GetParentDlg() const
-ScDPFieldControlBase::ModifySelectionOffset(long)
 ScDPFieldControlBase::SetSelectedField(unsigned long)
-ScDPItemData::CreateTypeString()
-ScDPItemData::GetNumFormat() const
-ScDPItemData::dump() const
-ScDPSaveData::Refresh(com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier> const&)
 ScDdeLink::ResetValue()
 ScDocRowHeightUpdater::TabRanges::TabRanges()
 ScDocument::SetAllTabRangeNames(std::__debug::map<short, ScRangeName const*, std::less<short>, std::allocator<std::pair<short const, ScRangeName const*> > > const&)


More information about the Libreoffice-commits mailing list