diff options
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/cellsuno.hxx | 8 | ||||
-rw-r--r-- | sc/inc/convuno.hxx | 41 | ||||
-rw-r--r-- | sc/inc/document.hxx | 8 | ||||
-rw-r--r-- | sc/inc/docuno.hxx | 1 | ||||
-rwxr-xr-x | sc/inc/eventuno.hxx | 91 | ||||
-rw-r--r-- | sc/inc/funcuno.hxx | 3 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 1 | ||||
-rwxr-xr-x | sc/inc/sheetevents.hxx | 65 | ||||
-rw-r--r-- | sc/inc/table.hxx | 10 | ||||
-rw-r--r-- | sc/inc/unonames.hxx | 5 | ||||
-rw-r--r-- | sc/inc/viewuno.hxx | 5 |
11 files changed, 235 insertions, 3 deletions
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 13469b110455..a53f167b164a 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -90,6 +90,7 @@ #include <com/sun/star/document/XActionLockable.hpp> #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> #include <com/sun/star/sheet/XExternalSheetName.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> @@ -1002,7 +1003,8 @@ class ScTableSheetObj : public ScCellRangeObj, public com::sun::star::util::XProtectable, public com::sun::star::sheet::XScenario, public com::sun::star::sheet::XScenarioEnhanced, - public com::sun::star::sheet::XExternalSheetName + public com::sun::star::sheet::XExternalSheetName, + public com::sun::star::document::XEventsSupplier { friend class ScTableSheetsObj; // fuer insertByName() @@ -1207,6 +1209,10 @@ public: throw (::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException); + // XEventsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents() + throw (::com::sun::star::uno::RuntimeException); + // XPropertySet ueberladen wegen Sheet-Properties virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() diff --git a/sc/inc/convuno.hxx b/sc/inc/convuno.hxx index 135ac055b2fe..0f93d6d6de0d 100644 --- a/sc/inc/convuno.hxx +++ b/sc/inc/convuno.hxx @@ -28,6 +28,7 @@ #ifndef SC_CONVUNO_HXX #define SC_CONVUNO_HXX +#include <algorithm> #include <i18npool/lang.h> #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> @@ -70,6 +71,19 @@ public: static inline void FillApiEndAddress( ::com::sun::star::table::CellAddress& rApiAddress, const ::com::sun::star::table::CellRangeAddress& rApiRange ); + + /** Returns true, if the passed ranges have at least one common cell. */ + static inline bool Intersects( + const ::com::sun::star::table::CellRangeAddress& rApiARange1, + const ::com::sun::star::table::CellRangeAddress& rApiARange2 ); + /** Returns true, if the passed address rApiInner is inside the passed range rApiOuter. */ + static inline bool Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellAddress& rApiInner ); + /** Returns true, if the passed range rApiInner is completely inside the passed range rApiOuter. */ + static inline bool Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellRangeAddress& rApiInner ); }; @@ -135,6 +149,33 @@ inline void ScUnoConversion::FillApiEndAddress( rApiAddress.Sheet = rApiRange.Sheet; } +inline bool ScUnoConversion::Intersects( + const ::com::sun::star::table::CellRangeAddress& rApiRange1, + const ::com::sun::star::table::CellRangeAddress& rApiRange2 ) +{ + return (rApiRange1.Sheet == rApiRange2.Sheet) && + (::std::max( rApiRange1.StartColumn, rApiRange2.StartColumn ) <= ::std::min( rApiRange1.EndColumn, rApiRange2.EndColumn )) && + (::std::max( rApiRange1.StartRow, rApiRange2.StartRow ) <= ::std::min( rApiRange1.EndRow, rApiRange2.EndRow )); +} + +inline bool ScUnoConversion::Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellAddress& rApiInner ) +{ + return (rApiOuter.Sheet == rApiInner.Sheet) && + (rApiOuter.StartColumn <= rApiInner.Column) && (rApiInner.Column <= rApiOuter.EndColumn) && + (rApiOuter.StartRow <= rApiInner.Row) && (rApiInner.Row <= rApiOuter.EndRow); +} + +inline bool ScUnoConversion::Contains( + const ::com::sun::star::table::CellRangeAddress& rApiOuter, + const ::com::sun::star::table::CellRangeAddress& rApiInner ) +{ + return (rApiOuter.Sheet == rApiInner.Sheet) && + (rApiOuter.StartColumn <= rApiInner.StartColumn) && (rApiInner.EndColumn <= rApiOuter.EndColumn) && + (rApiOuter.StartRow <= rApiInner.StartRow) && (rApiInner.EndRow <= rApiOuter.EndRow); +} + //___________________________________________________________________ inline sal_Bool operator==( diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 768dc815a482..0f22b40eef1d 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -731,6 +731,14 @@ public: BOOL HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ); BOOL HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect ); + const ScSheetEvents* GetSheetEvents( SCTAB nTab ) const; + void SetSheetEvents( SCTAB nTab, const ScSheetEvents* pNew ); + bool HasSheetEventScript( sal_Int32 nEvent ) const; // on any sheet + + BOOL HasCalcNotification( SCTAB nTab ) const; + void SetCalcNotification( SCTAB nTab ); + void ResetCalcNotifications(); + SC_DLLPUBLIC ScOutlineTable* GetOutlineTable( SCTAB nTab, BOOL bCreate = FALSE ); BOOL SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline ); diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 15a0c5e72359..2c3ecee39e32 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -112,6 +112,7 @@ private: const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rOptions, ScMarkData& rMark, ScPrintSelectionStatus& rStatus, String& rPagesStr ) const; com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> GetFormatter(); + void HandleCalculateEvents(); rtl::OUString maBuildId; sal_Int32 mnXlsWriteProtPass; diff --git a/sc/inc/eventuno.hxx b/sc/inc/eventuno.hxx new file mode 100755 index 000000000000..f3ae72f0f1bf --- /dev/null +++ b/sc/inc/eventuno.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sheetdata.hxx,v $ + * $Revision: 1.16.32.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_EVENTUNO_HXX +#define SC_EVENTUNO_HXX + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XNameReplace.hpp> +#include <cppuhelper/implbase2.hxx> +#include <svl/lstner.hxx> + +#include "global.hxx" + +class ScDocShell; + +class ScSheetEventsObj : public cppu::WeakImplHelper2< + com::sun::star::container::XNameReplace, + com::sun::star::lang::XServiceInfo>, + public SfxListener +{ +private: + ScDocShell* mpDocShell; + SCTAB mnTab; + +public: + ScSheetEventsObj(ScDocShell* pDocSh, SCTAB nT); + virtual ~ScSheetEventsObj(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // XNameReplace + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, + const ::com::sun::star::uno::Any& aElement ) + throw(::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) + throw(::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) + throw(::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() 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& ServiceName ) + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw(::com::sun::star::uno::RuntimeException); +}; + +#endif + diff --git a/sc/inc/funcuno.hxx b/sc/inc/funcuno.hxx index 3eef9082e26d..4413782a0e2f 100644 --- a/sc/inc/funcuno.hxx +++ b/sc/inc/funcuno.hxx @@ -72,7 +72,8 @@ private: ScTempDocCache aDocCache; ScDocOptions* pOptions; SfxItemPropertyMap aPropertyMap; - BOOL bInvalid; + bool mbArray; + bool mbValid; public: ScFunctionAccess(); diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index c2bf3e96ed5c..ad60c62a9c7e 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -833,6 +833,7 @@ #define FID_TAB_INDEX (TAB_POPUP_START+6) #define FID_TAB_RTL (TAB_POPUP_START+7) #define FID_TAB_DESELECTALL (TAB_POPUP_START+8) +#define FID_TAB_EVENTS (TAB_POPUP_START+9) #define TAB_POPUP_END (DATA_MENU_END + 20) diff --git a/sc/inc/sheetevents.hxx b/sc/inc/sheetevents.hxx new file mode 100755 index 000000000000..8f52efb990f7 --- /dev/null +++ b/sc/inc/sheetevents.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sheetdata.hxx,v $ + * $Revision: 1.16.32.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SHEETEVENTS_HXX +#define SC_SHEETEVENTS_HXX + +#include <rtl/ustring.hxx> + +#define SC_SHEETEVENT_FOCUS 0 +#define SC_SHEETEVENT_UNFOCUS 1 +#define SC_SHEETEVENT_SELECT 2 +#define SC_SHEETEVENT_DOUBLECLICK 3 +#define SC_SHEETEVENT_RIGHTCLICK 4 +#define SC_SHEETEVENT_CHANGE 5 +#define SC_SHEETEVENT_CALCULATE 6 +#define SC_SHEETEVENT_COUNT 7 + +class ScSheetEvents +{ + rtl::OUString** mpScriptNames; + + void Clear(); + +public: + ScSheetEvents(); + ScSheetEvents(const ScSheetEvents& rOther); + ~ScSheetEvents(); + + const ScSheetEvents& operator= (const ScSheetEvents& rOther); + + const rtl::OUString* GetScript(sal_Int32 nEvent) const; + void SetScript(sal_Int32 nEvent, const rtl::OUString* pNew); + + static rtl::OUString GetEventName(sal_Int32 nEvent); +}; + +#endif + diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index aed123bd7a65..850cae4d587b 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -63,6 +63,7 @@ class ScPrintSaverTab; class ScProgress; class ScProgress; class ScRangeList; +class ScSheetEvents; class ScSortInfoArray; class ScStyleSheet; class ScTableLink; @@ -118,6 +119,8 @@ private: ScOutlineTable* pOutlineTable; + ScSheetEvents* pSheetEvents; + SCCOL nTableAreaX; SCROW nTableAreaY; BOOL bTableAreaValid; @@ -126,6 +129,7 @@ private: BOOL bVisible; BOOL bStreamValid; BOOL bPendingRowHeights; + BOOL bCalcNotification; SCTAB nTab; USHORT nRecalcLvl; // Rekursionslevel Size-Recalc @@ -189,6 +193,9 @@ public: void RemoveSubTotals( ScSubTotalParam& rParam ); BOOL DoSubTotals( ScSubTotalParam& rParam ); + const ScSheetEvents* GetSheetEvents() const { return pSheetEvents; } + void SetSheetEvents( const ScSheetEvents* pNew ); + BOOL IsVisible() const { return bVisible; } void SetVisible( BOOL bVis ); @@ -198,6 +205,9 @@ public: BOOL IsPendingRowHeights() const { return bPendingRowHeights; } void SetPendingRowHeights( BOOL bSet ); + BOOL GetCalcNotification() const { return bCalcNotification; } + void SetCalcNotification( BOOL bSet ); + BOOL IsLayoutRTL() const { return bLayoutRTL; } BOOL IsLoadingRTL() const { return bLoadingRTL; } void SetLayoutRTL( BOOL bSet ); diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 330251742870..1e37e812efc1 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -632,5 +632,10 @@ #define SC_UNO_SHAREDOC "IsDocumentShared" +// EventDescriptor + +#define SC_UNO_EVENTTYPE "EventType" +#define SC_UNO_SCRIPT "Script" + #endif diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx index 988602b2056f..19b5c60fd070 100644 --- a/sc/inc/viewuno.hxx +++ b/sc/inc/viewuno.hxx @@ -48,6 +48,8 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/datatransfer/XTransferableSupplier.hpp> +#include "address.hxx" + class ScTabViewShell; #define SC_VIEWPANE_ACTIVE 0xFFFF @@ -195,6 +197,7 @@ private: XViewPropertyChangeListenerArr_Impl aPropertyChgListeners; XMouseClickHandlerArr_Impl aMouseClickHandlers; XActivationEventListenerArr_Impl aActivationListeners; + SCTAB nPreviousTab; sal_Bool bDrawSelModeSet; ScViewPaneObj* GetObjectByIndex_Impl(USHORT nIndex) const; @@ -223,7 +226,7 @@ public: void SelectionChanged(); void VisAreaChanged(); void SheetChanged(); - sal_Bool IsMouseListening() { return aMouseClickHandlers.Count() > 0; } + bool IsMouseListening() const; sal_Bool MousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); sal_Bool MouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); |