summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-12-05 14:51:24 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2011-12-05 19:25:11 -0500
commit793432143e95f746348a495961da8b73464a862a (patch)
tree10952015ae5dd1623aa07bb45c441309516f3448 /sc
parent4ea9d4daf7a2e79a0b78701f1a5f76b447d132ed (diff)
Empty data sequence backend no longer used. Let's purge it.
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/chart2uno.hxx140
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx275
2 files changed, 0 insertions, 415 deletions
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index 2f923494bd98..544ab9b09a32 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -64,8 +64,6 @@
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
-#define USE_CHART2_EMPTYDATASEQUENCE 0
-
class ScDocument;
// DataProvider ==============================================================
@@ -471,144 +469,6 @@ private:
bool m_bExtDataRebuildQueued;
};
-#if USE_CHART2_EMPTYDATASEQUENCE
-// DataSequence ==============================================================
-
-class ScChart2EmptyDataSequence : public
- ::cppu::WeakImplHelper6<
- ::com::sun::star::chart2::data::XDataSequence,
- ::com::sun::star::chart2::data::XTextualDataSequence,
- ::com::sun::star::util::XCloneable,
- ::com::sun::star::util::XModifyBroadcaster,
- ::com::sun::star::beans::XPropertySet,
-// ::com::sun::star::lang::XUnoTunnel,
- ::com::sun::star::lang::XServiceInfo>,
- SfxListener
-{
-public:
-
- explicit ScChart2EmptyDataSequence( ScDocument* pDoc,
- const com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider >& xDP,
- const ScRangeListRef& rRangeList, sal_Bool bColumn );
- virtual ~ScChart2EmptyDataSequence();
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
-
- // XDataSequence ---------------------------------------------------------
-
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
- SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getSourceRangeRepresentation()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
- SAL_CALL generateLabel(::com::sun::star::chart2::data::LabelOrigin nOrigin)
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex( ::sal_Int32 nIndex )
- throw (::com::sun::star::lang::IndexOutOfBoundsException,
- ::com::sun::star::uno::RuntimeException);
-
- // XTextualDataSequence --------------------------------------------------
-
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
- SAL_CALL getTextualData( ) throw (::com::sun::star::uno::RuntimeException);
-
- // XPropertySet ----------------------------------------------------------
-
- virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySetInfo> SAL_CALL
- getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL setPropertyValue(
- const ::rtl::OUString& rPropertyName,
- const ::com::sun::star::uno::Any& rValue)
- throw( ::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::beans::PropertyVetoException,
- ::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
- const ::rtl::OUString& rPropertyName)
- throw( ::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL addPropertyChangeListener(
- const ::rtl::OUString& rPropertyName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertyChangeListener>& xListener)
- throw( ::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL removePropertyChangeListener(
- const ::rtl::OUString& rPropertyName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertyChangeListener>& rListener)
- throw( ::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL addVetoableChangeListener(
- const ::rtl::OUString& rPropertyName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XVetoableChangeListener>& rListener)
- throw( ::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL removeVetoableChangeListener(
- const ::rtl::OUString& rPropertyName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XVetoableChangeListener>& rListener)
- throw( ::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
-
- // XCloneable ------------------------------------------------------------
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
- throw (::com::sun::star::uno::RuntimeException);
-
- // XModifyBroadcaster ----------------------------------------------------
-
- virtual void SAL_CALL addModifyListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeModifyListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
- throw (::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo ----------------------------------------------------------
-
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw(
- ::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString&
- rServiceName) throw( ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
- getSupportedServiceNames() throw(
- ::com::sun::star::uno::RuntimeException);
-
- // Implementation --------------------------------------------------------
-
- ScRangeListRef GetRangeList() { return m_xRanges; }
-
-private:
-
- // properties
- ::com::sun::star::chart2::data::DataSequenceRole m_aRole;
- sal_Bool m_bIncludeHiddenCells;
- // internals
- ScRangeListRef m_xRanges;
- ScDocument* m_pDocument;
- com::sun::star::uno::Reference < com::sun::star::chart2::data::XDataProvider > m_xDataProvider;
- SfxItemPropertySet m_aPropSet;
- sal_Bool m_bColumn; // defines the orientation to create the right labels
-
-};
-#endif
-
#endif // SC_CHART2UNO_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 0b7aaa0d39e0..ecfe9fa61d31 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -63,10 +63,6 @@ SC_SIMPLE_SERVICE_INFO( ScChart2DataSource, "ScChart2DataSource",
"com.sun.star.chart2.data.DataSource")
SC_SIMPLE_SERVICE_INFO( ScChart2DataSequence, "ScChart2DataSequence",
"com.sun.star.chart2.data.DataSequence")
-#if USE_CHART2_EMPTYDATASEQUENCE
-SC_SIMPLE_SERVICE_INFO( ScChart2EmptyDataSequence, "ScChart2EmptyDataSequence",
- "com.sun.star.chart2.data.DataSequence")
-#endif
using namespace ::com::sun::star;
using namespace ::formula;
@@ -3379,275 +3375,4 @@ void ScChart2DataSequence::setDataChangedHint(bool b)
m_bGotDataChangedHint = b;
}
-
-#if USE_CHART2_EMPTYDATASEQUENCE
-// DataSequence ==============================================================
-
-ScChart2EmptyDataSequence::ScChart2EmptyDataSequence( ScDocument* pDoc,
- const uno::Reference < chart2::data::XDataProvider >& xDP,
- const ScRangeListRef& rRangeList,
- sal_Bool bColumn)
- : m_bIncludeHiddenCells( sal_True)
- , m_xRanges( rRangeList)
- , m_pDocument( pDoc)
- , m_xDataProvider( xDP)
- , m_aPropSet(lcl_GetDataSequencePropertyMap())
- , m_bColumn(bColumn)
-{
- if ( m_pDocument )
- m_pDocument->AddUnoObject( *this);
- // FIXME: real implementation of identifier and it's mapping to ranges.
- // Reuse ScChartListener?
-
- // BM: don't use names of named ranges but the UI range strings
-// String aStr;
-// rRangeList->Format( aStr, SCR_ABS_3D, m_pDocument );
-// m_aIdentifier = ::rtl::OUString( aStr );
-
-// m_aIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ID_"));
-// static sal_Int32 nID = 0;
-// m_aIdentifier += ::rtl::OUString::valueOf( ++nID);
-}
-
-
-ScChart2EmptyDataSequence::~ScChart2EmptyDataSequence()
-{
- if ( m_pDocument )
- m_pDocument->RemoveUnoObject( *this);
-}
-
-
-void ScChart2EmptyDataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
-{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
- {
- m_pDocument = NULL;
- }
-}
-
-
-uno::Sequence< uno::Any> SAL_CALL ScChart2EmptyDataSequence::getData()
- throw ( uno::RuntimeException)
-{
- SolarMutexGuard aGuard;
- if ( !m_pDocument)
- throw uno::RuntimeException();
- return uno::Sequence< uno::Any>();
-}
-
-// XTextualDataSequence --------------------------------------------------
-
-uno::Sequence< rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::getTextualData( ) throw (uno::RuntimeException)
-{
- SolarMutexGuard aGuard;
- if ( !m_pDocument)
- throw uno::RuntimeException();
-
- sal_Int32 nCount = 0;
- ScRange* p;
-
- OSL_ENSURE(m_xRanges->Count() == 1, "not handled count of ranges");
-
- for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
- {
- p->Justify();
- // TODO: handle overlaping ranges?
- nCount += m_bColumn ? p->aEnd.Col() - p->aStart.Col() + 1 : p->aEnd.Row() - p->aStart.Row() + 1;
- }
- uno::Sequence< rtl::OUString > aSeq( nCount);
- rtl::OUString* pArr = aSeq.getArray();
- nCount = 0;
- for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
- {
- if (m_bColumn)
- {
- for (SCCOL nCol = p->aStart.Col(); nCol <= p->aEnd.Col(); ++nCol)
- {
- String aString = ScGlobal::GetRscString(STR_COLUMN);
- aString += ' ';
- ScAddress aPos( nCol, 0, 0 );
- String aColStr;
- aPos.Format( aColStr, SCA_VALID_COL, NULL );
- aString += aColStr;
- pArr[nCount] = aString;
- ++nCount;
- }
- }
- else
- {
- sal_Int32 n = p->aEnd.Row() - p->aStart.Row() + 1;
- for (sal_Int32 i = 0; i < n; ++i)
- pArr[nCount++] = String::CreateFromInt32( i+1 );
- }
- }
- return aSeq;
-}
-
-::rtl::OUString SAL_CALL ScChart2EmptyDataSequence::getSourceRangeRepresentation()
- throw ( uno::RuntimeException)
-{
- SolarMutexGuard aGuard;
- String aStr;
- OSL_ENSURE( m_pDocument, "No Document -> no SourceRangeRepresentation" );
- if( m_pDocument )
- m_xRanges->Format( aStr, SCR_ABS_3D, m_pDocument, m_pDocument->GetAddressConvention() );
- return aStr;
-}
-
-uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::generateLabel(chart2::data::LabelOrigin /*nOrigin*/)
- throw (uno::RuntimeException)
-{
- SolarMutexGuard aGuard;
- uno::Sequence< ::rtl::OUString > aRet;
- return aRet;
-}
-
-::sal_Int32 SAL_CALL ScChart2EmptyDataSequence::getNumberFormatKeyByIndex( ::sal_Int32 /*nIndex*/ )
- throw (lang::IndexOutOfBoundsException,
- uno::RuntimeException)
-{
- sal_Int32 nResult = 0;
-
- SolarMutexGuard aGuard;
- if ( !m_pDocument)
- return nResult;
-
- return nResult;
-}
-
-// XCloneable ================================================================
-
-uno::Reference< util::XCloneable > SAL_CALL ScChart2EmptyDataSequence::createClone()
- throw (uno::RuntimeException)
-{
- SolarMutexGuard aGuard;
- if (m_xDataProvider.is())
- {
- // copy properties
- uno::Reference < util::XCloneable > xClone(new ScChart2EmptyDataSequence(m_pDocument, m_xDataProvider, new ScRangeList(*m_xRanges), m_bColumn));
- uno::Reference< beans::XPropertySet > xProp( xClone, uno::UNO_QUERY );
- if( xProp.is())
- {
- xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ROLE )),
- uno::makeAny( m_aRole ));
- xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS )),
- uno::makeAny( m_bIncludeHiddenCells ));
- }
- return xClone;
- }
- return uno::Reference< util::XCloneable >();
-}
-
-// XModifyBroadcaster ========================================================
-
-void SAL_CALL ScChart2EmptyDataSequence::addModifyListener( const uno::Reference< util::XModifyListener >& /*aListener*/ )
- throw (uno::RuntimeException)
-{
- // TODO: Implement
-}
-
-void SAL_CALL ScChart2EmptyDataSequence::removeModifyListener( const uno::Reference< util::XModifyListener >& /*aListener*/ )
- throw (uno::RuntimeException)
-{
- // TODO: Implement
-}
-
-// DataSequence XPropertySet -------------------------------------------------
-
-uno::Reference< beans::XPropertySetInfo> SAL_CALL
-ScChart2EmptyDataSequence::getPropertySetInfo() throw( uno::RuntimeException)
-{
- SolarMutexGuard aGuard;
- static uno::Reference<beans::XPropertySetInfo> aRef =
- new SfxItemPropertySetInfo( m_aPropSet.getPropertyMap() );
- return aRef;
-}
-
-
-void SAL_CALL ScChart2EmptyDataSequence::setPropertyValue(
- const ::rtl::OUString& rPropertyName, const uno::Any& rValue)
- throw( beans::UnknownPropertyException,
- beans::PropertyVetoException,
- lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ROLE)))
- {
- if ( !(rValue >>= m_aRole))
- throw lang::IllegalArgumentException();
- }
- else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
- {
- if ( !(rValue >>= m_bIncludeHiddenCells))
- throw lang::IllegalArgumentException();
- }
- else
- throw beans::UnknownPropertyException();
- // TODO: support optional properties
-}
-
-
-uno::Any SAL_CALL ScChart2EmptyDataSequence::getPropertyValue(
- const ::rtl::OUString& rPropertyName)
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- uno::Any aRet;
- if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ROLE)))
- aRet <<= m_aRole;
- else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
- aRet <<= m_bIncludeHiddenCells;
- else
- throw beans::UnknownPropertyException();
- // TODO: support optional properties
- return aRet;
-}
-
-
-void SAL_CALL ScChart2EmptyDataSequence::addPropertyChangeListener(
- const ::rtl::OUString& /*rPropertyName*/,
- const uno::Reference< beans::XPropertyChangeListener>& /*xListener*/)
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- // FIXME: real implementation
- OSL_FAIL( "Not yet implemented" );
-}
-
-
-void SAL_CALL ScChart2EmptyDataSequence::removePropertyChangeListener(
- const ::rtl::OUString& /*rPropertyName*/,
- const uno::Reference< beans::XPropertyChangeListener>& /*rListener*/)
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- // FIXME: real implementation
- OSL_FAIL( "Not yet implemented" );
-}
-
-
-void SAL_CALL ScChart2EmptyDataSequence::addVetoableChangeListener(
- const ::rtl::OUString& /*rPropertyName*/,
- const uno::Reference< beans::XVetoableChangeListener>& /*rListener*/)
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- // FIXME: real implementation
- OSL_FAIL( "Not yet implemented" );
-}
-
-
-void SAL_CALL ScChart2EmptyDataSequence::removeVetoableChangeListener(
- const ::rtl::OUString& /*rPropertyName*/,
- const uno::Reference< beans::XVetoableChangeListener>& /*rListener*/ )
- throw( beans::UnknownPropertyException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- // FIXME: real implementation
- OSL_FAIL( "Not yet implemented" );
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */