diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2009-12-10 07:40:02 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2009-12-10 07:40:02 +0100 |
commit | ada13bed0d00ec3af944850148f9b3ed177dd101 (patch) | |
tree | 5c7666ac557685dde87d0b8a9647f3ee955afeee | |
parent | fb287ba7c5fdacfefba0dabf81211b6d1759453e (diff) | |
parent | d95c37cdac36e96c22fa38b519817cc0466f1f96 (diff) |
dba33d: merge with DEV300_m67
130 files changed, 7191 insertions, 1327 deletions
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx new file mode 100755 index 000000000000..765dc115fa11 --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx @@ -0,0 +1,277 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2009 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleGridControl.hxx,v $ + * $Revision: 1.3 $ + * + * 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 ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROL_HXX +#define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROL_HXX + +#include <accessibility/extended/AccessibleGridControlBase.hxx> +#include <accessibility/extended/AccessibleGridControlTable.hxx> +#include <cppuhelper/weakref.hxx> +#include <svtools/accessibletable.hxx> + + +#include <memory> + +using namespace ::svt::table; + +// ============================================================================ + +namespace accessibility { + + class AccessibleGridControl_Impl; + +// ============================================================================ + +/** This class represents the complete accessible Grid Control object. */ +class AccessibleGridControl : public AccessibleGridControlBase +{ + friend class AccessibleGridControlAccess; + +protected: + AccessibleGridControl( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent, + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator, + ::svt::table::IAccessibleTable& _rTable + ); + + virtual ~AccessibleGridControl(); + + /** sets the XAccessible which created the context + + <p>To be called only once, and only if in the ctor NULL was passed.</p> + */ + void setCreator( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator + ); + + /** Cleans up members. */ + using AccessibleGridControlBase::disposing; + virtual void SAL_CALL disposing(); + +protected: + // XAccessibleContext ----------------------------------------------------- + + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessible interface of the specified child. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The role of this object (a table). */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleComponent --------------------------------------------------- + + /** @return + The accessible child rendered under the given point. + */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Grabs the focus to the Grid Control. */ + virtual void SAL_CALL grabFocus() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The key bindings associated with this object. */ + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo ----------------------------------------------------------- + + /** @return + The name of this class. + */ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + +public: + // helper functions + /** returns the accessible object for the row or the column header bar + */ + inline ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > + getHeaderBar( ::svt::table::AccessibleTableControlObjType _eObjType ) + { + return implGetHeaderBar(_eObjType); + } + + /** returns the accessible object for the table representation + */ + inline ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > + getTable( ) + { + return implGetTable(); + } + +protected: + // internal virtual methods ----------------------------------------------- + + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox(); + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen(); + + // internal helper methods ------------------------------------------------ + + /** This method creates (once) and returns the accessible data table child. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the data table. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > implGetTable(); + + /** This method creates (once) and returns the specified header bar. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the header bar. */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > + implGetHeaderBar( ::svt::table::AccessibleTableControlObjType eObjType ); + + /** This method returns one of the children that are always present: + Data table, row and column header bar or corner control. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the specified child. */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > + implGetFixedChild( sal_Int32 nChildIndex ); + + /** This method creates and returns an accessible table. + @return An AccessibleGridControlTable. */ + virtual AccessibleGridControlTable* createAccessibleTable(); + +private: + // members ---------------------------------------------------------------- + ::std::auto_ptr< AccessibleGridControl_Impl > m_pImpl; +}; + +// ============================================================================ +/** the XAccessible which creates/returns an AccessibleGridControl + + <p>The instance holds it's XAccessibleContext with a hard reference, while + the contxt holds this instance weak.</p> +*/ +typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessible + > AccessibleGridControlAccess_Base; + +class AccessibleGridControlAccess :public AccessibleGridControlAccess_Base + ,public ::svt::table::IAccessibleTableControl +{ +private: + ::osl::Mutex m_aMutex; + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + m_xParent; + ::svt::table::IAccessibleTable& m_rTable; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + m_xContext; + AccessibleGridControl* m_pContext; + // note that this pointer is valid as long as m_xContext is valid! + +public: + AccessibleGridControlAccess( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent, + ::svt::table::IAccessibleTable& _rTable + ); + + /// checks whether the accessible context is still alive + bool isContextAlive() const; + + /// returns the AccessibleContext belonging to this Accessible + inline AccessibleGridControl* getContext() { return m_pContext; } + inline const AccessibleGridControl* getContext() const { return m_pContext; } + +protected: + virtual ~AccessibleGridControlAccess(); + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + SAL_CALL getAccessibleContext() throw ( ::com::sun::star::uno::RuntimeException ); + + // IAccessibleTable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + getMyself() + { + return this; + } + void dispose(); + virtual sal_Bool isAlive() const + { + return isContextAlive(); + } + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + getTableHeader( ::svt::table::AccessibleTableControlObjType _eObjType ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAccessible; + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + xAccessible = pContext->getHeaderBar( _eObjType ); + return xAccessible; + } + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + getTable() + { + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAccessible; + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + xAccessible = pContext->getTable(); + return xAccessible; + } + virtual void commitEvent( sal_Int16 nEventId, + const ::com::sun::star::uno::Any& rNewValue, const ::com::sun::star::uno::Any& rOldValue ) + { + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + pContext->commitEvent( nEventId, rNewValue, rOldValue ); + } + +private: + AccessibleGridControlAccess(); // never implemented + AccessibleGridControlAccess( const AccessibleGridControlAccess& ); // never implemented + AccessibleGridControlAccess& operator=( const AccessibleGridControlAccess& ); // never implemented +}; + +// ============================================================================ +} // namespace accessibility + +// ============================================================================ + +#endif + diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx new file mode 100755 index 000000000000..3cfdc182aee8 --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx @@ -0,0 +1,470 @@ +/************************************************************************* + * + * 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: AccessibleGridControlBase.hxx,v $ + * $Revision: 1.3 $ + * + * 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 ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLBASE_HXX +#define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLBASE_HXX + +#include <svtools/accessibletable.hxx> +#include <tools/debug.hxx> +#include <rtl/ustring.hxx> +#include <tools/gen.hxx> +#include <vcl/svapp.hxx> +#include <cppuhelper/compbase4.hxx> +#include <comphelper/broadcasthelper.hxx> +#include <unotools/accessiblestatesethelper.hxx> +#include <toolkit/helper/convert.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/accessibility/XAccessibleComponent.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <com/sun/star/awt/XFocusListener.hpp> +#include <comphelper/accessibleeventnotifier.hxx> +#include <comphelper/uno3.hxx> + +// ============================================================================ + +class Window; + +namespace utl { + class AccessibleStateSetHelper; +} + +// ============================================================================ + +namespace accessibility { + +// ============================================================================ + +/** Aquire the solar mutex. */ +class TCSolarGuard : public ::vos::OGuard +{ +public: + inline TCSolarGuard() : ::vos::OGuard( Application::GetSolarMutex() ) {} +}; + +// ============================================================================ + +typedef ::cppu::WeakAggComponentImplHelper4< + ::com::sun::star::accessibility::XAccessibleContext, + ::com::sun::star::accessibility::XAccessibleComponent, + ::com::sun::star::accessibility::XAccessibleEventBroadcaster, + ::com::sun::star::lang::XServiceInfo > + AccessibleGridControlImplHelper; + +/** The GridControl accessible objects inherit from this base class. It + implements basic functionality for various Accessibility interfaces and + the event broadcaster and contains the ::osl::Mutex. */ +class AccessibleGridControlBase : + public ::comphelper::OBaseMutex, + public AccessibleGridControlImplHelper +{ +public: + /** Constructor sets specified name and description. + @param rxParent XAccessible interface of the parent object. + @param rTable The Table control. + @param eNameText The constant for the name text. + @param eDescrText The constant for the description text. */ + AccessibleGridControlBase( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +protected: + virtual ~AccessibleGridControlBase(); + + /** Commits DeFunc event to listeners and cleans up members. */ + virtual void SAL_CALL disposing(); + +public: + // XAccessibleContext ----------------------------------------------------- + + /** @return A reference to the parent accessible object. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleParent() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The description of this object. + */ + virtual ::rtl::OUString SAL_CALL getAccessibleDescription() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The name of this object. + */ + virtual ::rtl::OUString SAL_CALL getAccessibleName() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The relation set (the GridControl does not have one). + */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL + getAccessibleRelationSet() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The set of current states. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL + getAccessibleStateSet() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The parent's locale. */ + virtual ::com::sun::star::lang::Locale SAL_CALL getLocale() + throw ( ::com::sun::star::accessibility::IllegalAccessibleComponentStateException, + ::com::sun::star::uno::RuntimeException ); + + /** @return + The role of this object. Panel, ROWHEADER, COLUMNHEADER, TABLE, TABLE_CELL are supported. + */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( ::com::sun::star::uno::RuntimeException ); + + /* Derived classes have to implement: + - getAccessibleChildCount, + - getAccessibleChild, + - getAccessibleRole. + Derived classes may overwrite getAccessibleIndexInParent to increase + performance. */ + + // XAccessibleComponent --------------------------------------------------- + + /** @return + <TRUE/>, if the point lies within the bounding box of this object. */ + virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& rPoint ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The bounding box of this object. */ + virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The upper left corner of the bounding box relative to the parent. */ + virtual ::com::sun::star::awt::Point SAL_CALL getLocation() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The upper left corner of the bounding box in screen coordinates. */ + virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The size of the bounding box. */ + virtual ::com::sun::star::awt::Size SAL_CALL getSize() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the object is showing. */ + virtual sal_Bool SAL_CALL isShowing() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the object is visible. */ + virtual sal_Bool SAL_CALL isVisible() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the object can accept the focus. */ + virtual sal_Bool SAL_CALL isFocusTraversable() + throw ( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + + /* Derived classes have to implement: + - getAccessibleAt, + - grabFocus, + - getAccessibleKeyBinding. */ + + /** @return + No key bindings supported by default. + */ + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding() + throw ( ::com::sun::star::uno::RuntimeException ); + /** @return + The accessible child rendered under the given point. + */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) + throw ( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleEventBroadcaster -------------------------------------------- + + /** Adds a new event listener */ + using cppu::WeakAggComponentImplHelperBase::addEventListener; + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& rxListener ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Removes an event listener. */ + using cppu::WeakAggComponentImplHelperBase::removeEventListener; + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& rxListener ) + throw ( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider ---------------------------------------------------------- + + /** @return An unique implementation ID. */ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo ----------------------------------------------------------- + + /** @return Whether the specified service is supported by this class. */ + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return A list of all supported services. */ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw ( ::com::sun::star::uno::RuntimeException ); + + /* Derived classes have to implement: + - getImplementationName. */ + + // helper methods --------------------------------------------------------- + + /** @return The GridControl object type. */ + inline ::svt::table::AccessibleTableControlObjType getType() const; + + /** Commits an event to all listeners. */ + void commitEvent( + sal_Int16 nEventId, + const ::com::sun::star::uno::Any& rNewValue, + + const ::com::sun::star::uno::Any& rOldValue ); + /** @return <TRUE/>, if the object is not disposed or disposing. */ + sal_Bool isAlive() const; + +protected: + // internal virtual methods ----------------------------------------------- + + /** Determines whether the Grid control is really showing inside of + its parent accessible window. Derived classes may implement different + behaviour. + @attention This method requires locked mutex's and a living object. + @return <TRUE/>, if the object is really showing. */ + virtual sal_Bool implIsShowing(); + + /** Derived classes return the bounding box relative to the parent window. + @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() = 0; + ///** Derived classes return the bounding box in screen coordinates. + // @attention This method requires locked mutex's and a living object. + // @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() = 0; + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. This method calls FillStateSet at the GridControl which + fills it with more states depending on the object type. Derived classes + may overwrite this method and add more states. + @attention This method requires locked mutex's. + @return A filled AccessibleStateSetHelper. */ + virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper(); + + // internal helper methods ------------------------------------------------ + + /** @throws <type>DisposedException</type> If the object is not alive. */ + void ensureIsAlive() const + throw ( ::com::sun::star::lang::DisposedException ); + + /** @return The ::osl::Mutex member provided by the class OBaseMutex. */ + inline ::osl::Mutex& getOslMutex(); + /** @return Pointer to the global ::osl::Mutex. */ + static inline ::osl::Mutex* getOslGlobalMutex(); + + /** Changes the name of the object (flat assignment, no notify). + @attention This method requires a locked mutex. */ + inline void implSetName( const ::rtl::OUString& rName ); + /** Changes the description of the object (flat assignment, no notify). + @attention This method requires a locked mutex. */ + inline void implSetDescription( const ::rtl::OUString& rDescription ); + + /** Locks all mutex's and calculates the bounding box relative to the + parent window. + @return The bounding box (VCL rect.) relative to the parent object. */ + Rectangle getBoundingBox() + throw ( ::com::sun::star::lang::DisposedException ); + ///** Locks all mutex's and calculates the bounding box in screen + // coordinates. + // @return The bounding box (VCL rect.) in screen coordinates. */ + Rectangle getBoundingBoxOnScreen() + throw ( ::com::sun::star::lang::DisposedException ); + + /** Creates a new UUID, if rId is empty. + @attention This method requires locked global mutex to prevent double + creation of an UUID. */ + static void implCreateUuid( ::com::sun::star::uno::Sequence< sal_Int8 >& rId ); + + ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } + void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } + +public: + // public versions of internal helper methods, with access control + struct TC_AccessControl { friend class TC_SolarMethodGuard; private: TC_AccessControl() { } }; + + inline ::osl::Mutex& getMutex( const TC_AccessControl& ) { return getOslMutex(); } + inline void ensureIsAlive( const TC_AccessControl& ) { ensureIsAlive(); } + +protected: + // members ---------------------------------------------------------------- + + /** The parent accessible object. */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > m_xParent; + /** The SVT Table control. */ + ::svt::table::IAccessibleTable& m_aTable; + /** The type of this object (for names, descriptions, state sets, ...). */ + ::svt::table::AccessibleTableControlObjType m_eObjType; + +private: + /** Localized name. */ + ::rtl::OUString m_aName; + /** Localized description text. */ + ::rtl::OUString m_aDescription; + ::comphelper::AccessibleEventNotifier::TClientId m_aClientId; +}; + +// ============================================================================ +// a version of AccessibleGridControlBase which implements not only the XAccessibleContext, +// but also the XAccessible + +typedef ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessible + > GridControlAccessibleElement_Base; + +class GridControlAccessibleElement + :public AccessibleGridControlBase + ,public GridControlAccessibleElement_Base +{ +protected: + /** Constructor sets specified name and description. + + @param rxParent XAccessible interface of the parent object. + @param rTable The Table control. + @param eNameText The constant for the name text. + @param eDescrText The constant for the description text. + */ + GridControlAccessibleElement( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +public: + // XInterface + DECLARE_XINTERFACE( ) + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + +protected: + virtual ~GridControlAccessibleElement(); + +protected: + // XAccessible ------------------------------------------------------------ + + /** @return The XAccessibleContext interface of this object. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext() + throw ( ::com::sun::star::uno::RuntimeException ); + +private: + GridControlAccessibleElement(); // never implemented + GridControlAccessibleElement( const GridControlAccessibleElement& ); // never implemented + GridControlAccessibleElement& operator=( const GridControlAccessibleElement& ); // never implemented +}; + +// ============================================================================ +// a helper class for protecting methods which need to lock the solar mutex in addition to the own mutex + +typedef ::osl::MutexGuard OslMutexGuard; + +class TC_SolarMethodGuard : public TCSolarGuard, public OslMutexGuard +{ +public: + inline TC_SolarMethodGuard( AccessibleGridControlBase& _rOwner, bool _bEnsureAlive = true ) + :TCSolarGuard( ) + ,OslMutexGuard( _rOwner.getMutex( AccessibleGridControlBase::TC_AccessControl() ) ) + { + if ( _bEnsureAlive ) + _rOwner.ensureIsAlive( AccessibleGridControlBase::TC_AccessControl() ); + } +}; + +// inlines -------------------------------------------------------------------- + +inline ::svt::table::AccessibleTableControlObjType AccessibleGridControlBase::getType() const +{ + return m_eObjType; +} + +inline ::osl::Mutex& AccessibleGridControlBase::getOslMutex() +{ + return m_aMutex; +} + +inline ::osl::Mutex* AccessibleGridControlBase::getOslGlobalMutex() +{ + return ::osl::Mutex::getGlobalMutex(); +} + +inline void AccessibleGridControlBase::implSetName( + const ::rtl::OUString& rName ) +{ + m_aName = rName; +} + +inline void AccessibleGridControlBase::implSetDescription( + const ::rtl::OUString& rDescription ) +{ + m_aDescription = rDescription; +} + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLBASE_HXX + diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx new file mode 100755 index 000000000000..f164e7576247 --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx @@ -0,0 +1,227 @@ +/************************************************************************* + * + * 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: AccessibleGridControlHeader.hxx,v $ + * $Revision: 1.3 $ + * + * 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 ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADER_HXX +#define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADER_HXX + + +#include "accessibility/extended/AccessibleGridControlHeaderCell.hxx" +#include "accessibility/extended/AccessibleGridControlTableBase.hxx" + +// ============================================================================ + +namespace accessibility { + +// ============================================================================ + +/** This class represents the accessible object of a header bar of a Grid Control + (row or column header bar). This object supports the + XAccessibleSelection interface. Selecting a child of this object selects + complete rows or columns of the data table. */ +class AccessibleGridControlHeader : public AccessibleGridControlTableBase +{ +public: + /** @param eObjType One of the two allowed types TCTYPE_ROWHEADERBAR or + TCTYPE_COLUMNHEADERBAR. */ + AccessibleGridControlHeader( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +protected: + virtual ~AccessibleGridControlHeader(); + +public: + // XAccessibleContext ----------------------------------------------------- + + /** @return + The XAccessible interface of the specified child. + */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleComponent --------------------------------------------------- + + /** @return The accessible child rendered under the given point. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Grabs the focus to (the current cell of) the data table. */ + virtual void SAL_CALL grabFocus() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The key bindings associated with this object. */ + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleTable ------------------------------------------------------- + + /** @return The description text of the specified row. */ + virtual ::rtl::OUString SAL_CALL + getAccessibleRowDescription( sal_Int32 nRow ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The description text of the specified column. */ + virtual ::rtl::OUString SAL_CALL + getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessibleTable interface of the row header bar. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessibleTable interface of the column header bar. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return An index list of completely selected rows. */ + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return An index list of completely selected columns. */ + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the specified row is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the specified column is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessible interface of the cell object at the specified + cell position. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the specified cell is selected. */ + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo ----------------------------------------------------------- + + /** @return The name of this class. */ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return An unique implementation ID. */ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( ::com::sun::star::uno::RuntimeException ); + +protected: + // internal virtual methods ----------------------------------------------- + /** @attention This method requires locked mutex's and a living object. + @return The absolute child index from the index of selected children. + @throws <type>IndexOutOfBoundsException</type> + If the specified index is invalid. */ + //sal_Int32 implGetChildIndexFromSelectedIndex( sal_Int32 nSelectedChildIndex ) + // throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Returns the specified row or column. Uses one of the parameters, + depending on object type. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the specified column/row. */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > + implGetChild( sal_Int32 nRow, sal_uInt32 nColumnPos ); + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox(); + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen(); + + /** @attention This method requires locked mutex's and a living object. + @return The count of used rows. */ + virtual sal_Int32 implGetRowCount() const; + /** @attention This method requires locked mutex's and a living object. + @return The count of used columns. */ + virtual sal_Int32 implGetColumnCount() const; + + // internal helper methods ------------------------------------------------ + + /** @return <TRUE/>, if the objects is a header bar for rows. */ + inline sal_Bool isRowBar() const; + /** @return <TRUE/>, if the objects is a header bar for columns. */ + inline sal_Bool isColumnBar() const; + + /** @attention This method requires locked mutex's and a living object. + @throws <type>IndexOutOfBoundsException</type> + If the specified row/column index (depending on type) is invalid. */ + void ensureIsValidHeaderIndex( sal_Int32 nIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); +}; + +// inlines -------------------------------------------------------------------- + +inline sal_Bool AccessibleGridControlHeader::isRowBar() const +{ + return getType() == ::svt::table::TCTYPE_ROWHEADERBAR; +} + +inline sal_Bool AccessibleGridControlHeader::isColumnBar() const +{ + return getType() == ::svt::table::TCTYPE_COLUMNHEADERBAR; +} + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLHEADER_HXX + diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx new file mode 100755 index 000000000000..3827cc7dad0a --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * 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: AccessibleGridControlHeaderCell.hxx,v $ + * $Revision: 1.3 $ + * + * 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 ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX +#define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX + +#include "accessibility/extended/AccessibleGridControlTableCell.hxx" + +namespace accessibility +{ + class AccessibleGridControlHeaderCell : public AccessibleGridControlCell, public ::com::sun::star::accessibility::XAccessible + { + sal_Int32 m_nColumnRowId; + public: + AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId, + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& _rTable, + ::svt::table::AccessibleTableControlObjType _eObjType); + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessible interface of the specified child. */ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException ); + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw ( ::com::sun::star::uno::RuntimeException ); + + /** Grabs the focus to the GridControl. */ + virtual void SAL_CALL grabFocus() throw ( ::com::sun::star::uno::RuntimeException ); + + // XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw (); + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw (); + // XAccessible ------------------------------------------------------------ + + /** @return The XAccessibleContext interface of this object. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext() + throw ( ::com::sun::star::uno::RuntimeException ); + //------------------------------------------------------------------------- + inline sal_Bool isRowBarCell() const + { + return getType() == ::svt::table::TCTYPE_ROWHEADERCELL; + } + + /** @return + The name of this class. + */ + virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( ::com::sun::star::uno::RuntimeException ); + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. + */ + ::utl::AccessibleStateSetHelper* implCreateStateSetHelper(); + + protected: + virtual Rectangle implGetBoundingBox(); + + virtual Rectangle implGetBoundingBoxOnScreen(); + private: + ::rtl::OUString m_sHeaderName; + }; +} + +#endif // ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX + diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx new file mode 100755 index 000000000000..c3465c6c32fb --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx @@ -0,0 +1,236 @@ +/************************************************************************* + * + * 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: AccessibleGridControlTable.hxx,v $ + * $Revision: 1.3 $ + * + * 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 ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX +#define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLE_HXX + +#include "accessibility/extended/AccessibleGridControlTableBase.hxx" +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> + +// ============================================================================ + +namespace accessibility { + +// ============================================================================ +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleSelection > + AccessibleGridControlTableImplHelper1; +/** This class represents the accessible object of the data table of a + Grid control. */ +class AccessibleGridControlTable : public AccessibleGridControlTableBase, + public AccessibleGridControlTableImplHelper1 +{ +public: + AccessibleGridControlTable( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType _eType); + +protected: + virtual ~AccessibleGridControlTable(); + +public: + // XAccessibleContext ----------------------------------------------------- + + /** @return The XAccessible interface of the specified child. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleComponent --------------------------------------------------- + + /** @return The accessible child rendered under the given point. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Grabs the focus to (the current cell of) the data table. */ + virtual void SAL_CALL grabFocus() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The key bindings associated with this object. */ + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleTable ------------------------------------------------------- + + /** @return The description text of the specified row. */ + virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The description text of the specified column. */ + virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessibleTable interface of the row header bar. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessibleTable interface of the column header bar. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return An index list of completely selected rows. */ + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return An index list of completely selected columns. */ + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the specified row is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the specified column is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The XAccessible interface of the cell object at the specified + cell position. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the specified cell is selected. */ + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + // XAccessibleSelection --------------------------------------------------- + + /** Selects the specified child (row or column of the table). */ + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return <TRUE/>, if the specified child (row/column) is selected. */ + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** Clears the complete selection. */ + virtual void SAL_CALL clearAccessibleSelection() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Selects all children or first, if multiselection is not supported. */ + virtual void SAL_CALL selectAllAccessibleChildren() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The number of selected rows/columns. */ + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The specified selected row/column. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** Removes the specified row/column from the selection. */ + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + // XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw (); + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw (); + // XServiceInfo ----------------------------------------------------------- + + /** @return The name of this class. */ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + +protected: + // internal virtual methods ----------------------------------------------- + + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox(); + ///** @attention This method requires locked mutex's and a living object. + // @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen(); + + + //// internal helper methods ------------------------------------------------ + /** Returns the specified row or column. Uses one of the parameters, + depending on object type. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the specified column/row. */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > + implGetChild( sal_Int32 nRow, sal_uInt16 nColumnPos ); + ///** @attention This method requires a locked mutex. + // @return The XAccessibleTable interface of the specified header bar. */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleTable > + implGetHeaderBar( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::uno::RuntimeException ); +}; + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLE_HXX + diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx new file mode 100755 index 000000000000..aa9eb061f147 --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx @@ -0,0 +1,247 @@ +/************************************************************************* + * + * 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: AccessibleGridControlTableBase.hxx,v $ + * $Revision: 1.3 $ + * + * 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 ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLEBASE_HXX +#define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLTABLEBASE_HXX + +#include "accessibility/extended/AccessibleGridControlBase.hxx" +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/accessibility/XAccessibleTable.hpp> + +// ============================================================================ + +namespace accessibility { + +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleTable > + AccessibleGridControlTableImplHelper; + +/** The Grid Control accessible table objects inherit from this base class. It + implements basic functionality for the XAccessibleTable interface. + Grid COntrol table objects are: the data table, the column header bar and the + row header bar. */ +class AccessibleGridControlTableBase : + public GridControlAccessibleElement, + public AccessibleGridControlTableImplHelper +{ +public: + /** Constructor sets specified name and description. + @param rxParent XAccessible interface of the parent object. + @param rTable The Table control. + @param eNameText The constant for the name text. + @param eDescrText The constant for the description text. */ + AccessibleGridControlTableBase( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +protected: + virtual ~AccessibleGridControlTableBase(); + +public: + // XAccessibleContext ----------------------------------------------------- + + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The role of this object (a table). */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( ::com::sun::star::uno::RuntimeException ); + + /* Derived classes have to implement: + - getAccessibleChild, + - getAccessibleIndexInParent. */ + + // XAccessibleComponent --------------------------------------------------- + + /* Derived classes have to implement: + - getAccessibleAt, + - grabFocus, + - getAccessibleKeyBinding. */ + + // XAccessibleTable ------------------------------------------------------- + + /** @return The number of used rows in the table (0 = empty table). */ + virtual sal_Int32 SAL_CALL getAccessibleRowCount() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The number of used columns in the table (0 = empty table). */ + virtual sal_Int32 SAL_CALL getAccessibleColumnCount() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The row extent of the specified cell (always 1). */ + virtual sal_Int32 SAL_CALL + getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The column extent of the specified cell (always 1). */ + virtual sal_Int32 SAL_CALL + getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The caption cell of the table (not supported). */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCaption() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The summary object of the table (not supported). */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleSummary() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return The child index of the specified cell. */ + virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The row index of the specified child cell. */ + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** @return The column index of the specified child cell. */ + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /* Derived classes have to implement: + - getAccessibleRowDescription, + - getAccessibleColumnDescription, + - getAccessibleRowHeaders, + - getAccessibleColumnHeaders, + - getSelectedAccessibleRows, + - getSelectedAccessibleColumns, + - isAccessibleRowSelected, + - isAccessibleColumnSelected, + - getAccessibleCellAt, + - isAccessibleSelected. */ + + // XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw (); + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw (); + + // XTypeProvider ---------------------------------------------------------- + + /** @return A sequence of possible types (received from base classes). */ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return An unique implementation ID. */ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( ::com::sun::star::uno::RuntimeException ); + +protected: + // internal helper methods ------------------------------------------------ + + /** @attention This method requires locked mutex's and a living object. + @param nColumn + the position of the column in the Accessible world + @return + the position of the column in VCL the Accessible world + */ + sal_uInt16 implToVCLColumnPos( sal_Int32 nColumn ) const; + + /** @attention This method requires locked mutex's and a living object. + @return The number of cells of the table. */ + sal_Int32 implGetChildCount() const; + + /** @attention This method requires locked mutex's and a living object. + @return The row index of the specified cell index. */ + sal_Int32 implGetRow( sal_Int32 nChildIndex ) const; + /** @attention This method requires locked mutex's and a living object. + @return The column index of the specified cell index. */ + sal_Int32 implGetColumn( sal_Int32 nChildIndex ) const; + /** @attention This method requires locked mutex's and a living object. + @return The child index of the specified cell address. */ + sal_Int32 implGetChildIndex( sal_Int32 nRow, sal_Int32 nColumn ) const; + + /** @attention This method requires locked mutex's and a living object. + @return <TRUE/>, if the specified row is selected. */ + sal_Bool implIsRowSelected( sal_Int32 nRow ) const; + + /** @attention This method requires locked mutex's and a living object. + @return The count of selected rows. */ + sal_Int32 implGetSelectedRowCount() const; + + /** Fills a sequence with sorted indexes of completely selected rows. + @attention This method requires locked mutex's and a living object. + @param rSeq Out-parameter that takes the sorted row index list. */ + void implGetSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& rSeq ); + /** Fills a sequence with sorted indexes of completely selected columns. + @attention This method requires locked mutex's and a living object. + @param rSeq Out-parameter that takes the sorted column index list. */ + //void implGetSelectedColumns( ::com::sun::star::uno::Sequence< sal_Int32 >& rSeq ); + + /** @attention This method requires locked mutex's and a living object. + @throws <type>IndexOutOfBoundsException</type> + If the specified row index is invalid. */ + void ensureIsValidRow( sal_Int32 nRow ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws <type>IndexOutOfBoundsException</type> + If the specified column index is invalid. */ + void ensureIsValidColumn( sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws <type>IndexOutOfBoundsException</type> + If the specified cell address is invalid. */ + void ensureIsValidAddress( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws <type>IndexOutOfBoundsException</type> + If the specified child index is invalid. */ + void ensureIsValidIndex( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); +}; + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLEBASE_HXX + diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx new file mode 100755 index 000000000000..537cbc138b1c --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * 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: AccessibleGridControlTableCell.hxx,v $ + * $Revision: 1.4 $ + * + * 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 ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX +#define ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX + +#include <comphelper/accessibletexthelper.hxx> +#include <cppuhelper/implbase2.hxx> +#include "accessibility/extended/AccessibleGridControlBase.hxx" +#include <svtools/accessibletable.hxx> + +namespace accessibility +{ + class AccessibleGridControlCell : public AccessibleGridControlBase + { + private: + sal_Int32 m_nRowPos; // the row number of the table cell + sal_Int32 m_nColPos; // the column id of the table cell + + protected: + // attribute access + inline sal_Int32 getRowPos( ) const { return m_nRowPos; } + inline sal_Int32 getColumnPos( ) const { return m_nColPos; } + + // XAccessibleComponent + virtual void SAL_CALL grabFocus() throw ( ::com::sun::star::uno::RuntimeException ); + + protected: + AccessibleGridControlCell( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent, + ::svt::table::IAccessibleTable& _rTable, + sal_Int32 _nRowPos, + sal_uInt16 _nColPos, + ::svt::table::AccessibleTableControlObjType _eType + ); + + virtual ~AccessibleGridControlCell(); + + private: + AccessibleGridControlCell(); // never implemented + AccessibleGridControlCell( const AccessibleGridControlCell& ); // never implemented + AccessibleGridControlCell& operator=( const AccessibleGridControlCell& ); // never implemented + }; + + typedef ::cppu::ImplHelper2 < ::com::sun::star::accessibility::XAccessibleText + , ::com::sun::star::accessibility::XAccessible + > AccessibleTextHelper_BASE; + // implementation of a table cell of GridControl + class AccessibleGridControlTableCell :public AccessibleGridControlCell + ,public AccessibleTextHelper_BASE + ,public ::comphelper::OCommonAccessibleText + { + private: + sal_Int32 m_nOffset; + + protected: + // OCommonAccessibleText + virtual ::rtl::OUString implGetText(); + virtual ::com::sun::star::lang::Locale implGetLocale(); + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); + virtual Rectangle implGetBoundingBox(); + virtual Rectangle implGetBoundingBoxOnScreen(); + + public: + AccessibleGridControlTableCell( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent, + ::svt::table::IAccessibleTable& _rTable, + sal_Int32 _nRowId, + sal_uInt16 _nColId, + svt::table::AccessibleTableControlObjType eObjType); + + // XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType ) + throw ( ::com::sun::star::uno::RuntimeException ); + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw (); + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw (); + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The name of this class. + */ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The count of visible children. + */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( ::com::sun::star::uno::RuntimeException ); + + /** @return + The XAccessible interface of the specified child. + */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ); + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. + */ + ::utl::AccessibleStateSetHelper* implCreateStateSetHelper(); + + // XAccessible ------------------------------------------------------------ + + /** @return The XAccessibleContext interface of this object. */ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext() + throw ( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + }; +} +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLECELL_HXX + diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx new file mode 100755 index 000000000000..fd24a3f27aa1 --- /dev/null +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -0,0 +1,391 @@ +/************************************************************************* + * + * 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: AccessibleGridControl.cxx,v $ + * $Revision: 1.3 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_accessibility.hxx" +#include "accessibility/extended/AccessibleGridControl.hxx" +#include "accessibility/extended/AccessibleGridControlTable.hxx" +#include "accessibility/extended/AccessibleGridControlHeader.hxx" +#include <svtools/accessibletable.hxx> +#include <comphelper/types.hxx> +#include <toolkit/helper/vclunohelper.hxx> +//#include "svtools/table/tablecontrol.hxx" + +// ============================================================================ + +namespace accessibility +{ + +// ============================================================================ + +using ::rtl::OUString; + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::accessibility; +using namespace ::svt; +using namespace ::svt::table; + +// ============================================================================ +class AccessibleGridControl_Impl +{ +public: + /// the XAccessible which created the AccessibleGridControl + WeakReference< XAccessible > m_aCreator; + + /** The data table child. */ + Reference< + ::com::sun::star::accessibility::XAccessible > m_xTable; + AccessibleGridControlTable* m_pTable; + + /** The header bar for rows. */ + Reference< + ::com::sun::star::accessibility::XAccessible > m_xRowHeaderBar; + AccessibleGridControlHeader* m_pRowHeaderBar; + + /** The header bar for columns (first row of the table). */ + Reference< + ::com::sun::star::accessibility::XAccessible > m_xColumnHeaderBar; + AccessibleGridControlHeader* m_pColumnHeaderBar; +}; + +// Ctor/Dtor/disposing -------------------------------------------------------- + +DBG_NAME( AccessibleGridControl ) + +AccessibleGridControl::AccessibleGridControl( + const Reference< XAccessible >& _rxParent, const Reference< XAccessible >& _rxCreator, + IAccessibleTable& _rTable ) + : AccessibleGridControlBase( _rxParent, _rTable, TCTYPE_GRIDCONTROL ) +{ +// DBG_CTOR( AccessibleTableControl, NULL ); + m_pImpl.reset( new AccessibleGridControl_Impl() ); + m_pImpl->m_aCreator = _rxCreator; +} +// ----------------------------------------------------------------------------- +void AccessibleGridControl::setCreator( const Reference< XAccessible >& _rxCreator ) +{ +#if OSL_DEBUG_LEVEL > 0 + Reference< XAccessible > xCreator = (Reference< XAccessible >)m_pImpl->m_aCreator; + DBG_ASSERT( !xCreator.is(), "accessibility/extended/AccessibleGridControl::setCreator: creator already set!" ); +#endif + m_pImpl->m_aCreator = _rxCreator; +} + +// ----------------------------------------------------------------------------- +AccessibleGridControl::~AccessibleGridControl() +{ + DBG_DTOR( AccessibleGridControl, NULL ); +} +// ----------------------------------------------------------------------------- + +void SAL_CALL AccessibleGridControl::disposing() +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + + m_pImpl->m_pTable = NULL; + m_pImpl->m_pColumnHeaderBar = NULL; + m_pImpl->m_pRowHeaderBar = NULL; + m_pImpl->m_aCreator = Reference< XAccessible >(); + + Reference< XAccessible > xTable = m_pImpl->m_xTable; + + Reference< XComponent > xComp( m_pImpl->m_xTable, UNO_QUERY ); + if ( xComp.is() ) + { + xComp->dispose(); + } + + AccessibleGridControlBase::disposing(); +} +// ----------------------------------------------------------------------------- + +// XAccessibleContext --------------------------------------------------------- + +sal_Int32 SAL_CALL AccessibleGridControl::getAccessibleChildCount() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return m_aTable.GetAccessibleControlCount(); +} +// ----------------------------------------------------------------------------- + +Reference< XAccessible > SAL_CALL +AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + + if (nChildIndex<0 || nChildIndex>=getAccessibleChildCount()) + throw IndexOutOfBoundsException(); + + Reference< XAccessible > xChild; + if (isAlive()) + { + if(nChildIndex == 0 && m_aTable.HasColHeader()) + { + if(!m_pImpl->m_xColumnHeaderBar.is()){ + AccessibleGridControlHeader* pColHeaderBar = new AccessibleGridControlHeader(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_COLUMNHEADERBAR); + m_pImpl->m_xColumnHeaderBar = pColHeaderBar; + } + xChild = m_pImpl->m_xColumnHeaderBar; + } + else if(m_aTable.HasRowHeader() && (nChildIndex == 1 || nChildIndex == 0)) + { + if(!m_pImpl->m_xRowHeaderBar.is()){ + AccessibleGridControlHeader* pRowHeaderBar = new AccessibleGridControlHeader(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_ROWHEADERBAR); + m_pImpl->m_xRowHeaderBar = pRowHeaderBar; + } + xChild = m_pImpl->m_xRowHeaderBar; + } + else + { + AccessibleGridControlTable* pTable = new AccessibleGridControlTable(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_TABLE); + m_pImpl->m_xTable = pTable; + xChild = m_pImpl->m_xTable; + } + } + + return xChild; +} +// ----------------------------------------------------------------------------- + +sal_Int16 SAL_CALL AccessibleGridControl::getAccessibleRole() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return AccessibleRole::PANEL; +} +// ----------------------------------------------------------------------------- + +// XAccessibleComponent ------------------------------------------------------- + +Reference< XAccessible > SAL_CALL +AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint ) + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + Reference< XAccessible > xChild; + sal_Int32 nIndex = 0; + if( m_aTable.ConvertPointToControlIndex( nIndex, VCLPoint( rPoint ) ) ) + xChild = m_aTable.CreateAccessibleControl( nIndex ); + else + { + // try whether point is in one of the fixed children + // (table, header bars, corner control) + Point aPoint( VCLPoint( rPoint ) ); + for( nIndex = 0; (nIndex < 3) && !xChild.is(); ++nIndex ) + { + Reference< XAccessible > xCurrChild( implGetFixedChild( nIndex ) ); + Reference< XAccessibleComponent > + xCurrChildComp( xCurrChild, uno::UNO_QUERY ); + + if( xCurrChildComp.is() && + VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) ) + xChild = xCurrChild; + } + } + return xChild; +} +// ----------------------------------------------------------------------------- + +void SAL_CALL AccessibleGridControl::grabFocus() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + m_aTable.GrabFocus(); +} +// ----------------------------------------------------------------------------- + +Any SAL_CALL AccessibleGridControl::getAccessibleKeyBinding() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return Any(); +} +// ----------------------------------------------------------------------------- + +// XServiceInfo --------------------------------------------------------------- + +OUString SAL_CALL AccessibleGridControl::getImplementationName() + throw ( uno::RuntimeException ) +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleGridControl" ) ); +} +// ----------------------------------------------------------------------------- + +// internal virtual methods --------------------------------------------------- + +Rectangle AccessibleGridControl::implGetBoundingBox() +{ + Window* pParent = m_aTable.GetAccessibleParentWindow(); + DBG_ASSERT( pParent, "implGetBoundingBox - missing parent window" ); + return m_aTable.GetWindowExtentsRelative( pParent ); +} +// ----------------------------------------------------------------------------- + +Rectangle AccessibleGridControl::implGetBoundingBoxOnScreen() +{ + return m_aTable.GetWindowExtentsRelative( NULL ); +} +// internal helper methods ---------------------------------------------------- + +Reference< XAccessible > AccessibleGridControl::implGetTable() +{ + if( !m_pImpl->m_xTable.is() ) + { + m_pImpl->m_pTable = createAccessibleTable(); + m_pImpl->m_xTable = m_pImpl->m_pTable; + + } + return m_pImpl->m_xTable; +} +// ----------------------------------------------------------------------------- + +Reference< XAccessible > +AccessibleGridControl::implGetHeaderBar( AccessibleTableControlObjType eObjType ) +{ + Reference< XAccessible > xRet; + Reference< XAccessible >* pxMember = NULL; + + if( eObjType == TCTYPE_ROWHEADERBAR ) + pxMember = &m_pImpl->m_xRowHeaderBar; + else if( eObjType == TCTYPE_COLUMNHEADERBAR ) + pxMember = &m_pImpl->m_xColumnHeaderBar; + + if( pxMember ) + { + if( !pxMember->is() ) + { + AccessibleGridControlHeader* pHeaderBar = new AccessibleGridControlHeader( + (Reference< XAccessible >)m_pImpl->m_aCreator, m_aTable, eObjType ); + + if ( TCTYPE_COLUMNHEADERBAR == eObjType) + m_pImpl->m_pColumnHeaderBar = pHeaderBar; + else + m_pImpl->m_pRowHeaderBar = pHeaderBar; + + *pxMember = pHeaderBar; + } + xRet = *pxMember; + } + return xRet; +} +// ----------------------------------------------------------------------------- +Reference< XAccessible > +AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex ) +{ + Reference< XAccessible > xRet; + switch( nChildIndex ) + { + case TCINDEX_COLUMNHEADERBAR: + xRet = implGetHeaderBar( TCTYPE_COLUMNHEADERBAR ); + break; + case TCINDEX_ROWHEADERBAR: + xRet = implGetHeaderBar( TCTYPE_ROWHEADERBAR ); + break; + case TCINDEX_TABLE: + xRet = implGetTable(); + break; + } + return xRet; +} +// ----------------------------------------------------------------------------- +AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable() +{ + Reference< XAccessible > xCreator = (Reference< XAccessible >)m_pImpl->m_aCreator; + DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" ); + return new AccessibleGridControlTable( xCreator, m_aTable, TCTYPE_TABLE ); +} +// ============================================================================ +// = AccessibleGridControlAccess +// ============================================================================ +DBG_NAME( AccessibleGridControlAccess ) +// ----------------------------------------------------------------------------- +AccessibleGridControlAccess::AccessibleGridControlAccess( const Reference< XAccessible >& _rxParent, IAccessibleTable& _rTable ) + :m_xParent( _rxParent ) + ,m_rTable( _rTable ) + ,m_pContext( NULL ) +{ + DBG_CTOR( AccessibleGridControlAccess, NULL ); +} + +// ----------------------------------------------------------------------------- +AccessibleGridControlAccess::~AccessibleGridControlAccess() +{ + DBG_DTOR( AccessibleGridControlAccess, NULL ); +} + +// ----------------------------------------------------------------------------- +void AccessibleGridControlAccess::dispose() +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + m_pContext = NULL; + ::comphelper::disposeComponent( m_xContext ); +} + +// ----------------------------------------------------------------------------- +Reference< XAccessibleContext > SAL_CALL AccessibleGridControlAccess::getAccessibleContext() throw ( RuntimeException ) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + DBG_ASSERT( ( m_pContext && m_xContext.is() ) || ( !m_pContext && !m_xContext.is() ), + "accessibility/extended/AccessibleGridControlAccess::getAccessibleContext: inconsistency!" ); + + // if the context died meanwhile (we're no listener, so it won't tell us explicitily when this happens), + // then reset an re-create. + if ( m_pContext && !m_pContext->isAlive() ) + m_xContext = m_pContext = NULL; + + if ( !m_xContext.is() ) + m_xContext = m_pContext = new AccessibleGridControl( m_xParent, this, m_rTable ); + + return m_xContext; +} + +// ----------------------------------------------------------------------------- +bool AccessibleGridControlAccess::isContextAlive() const +{ + return ( NULL != m_pContext ) && m_pContext->isAlive(); +} + +// ============================================================================ + +} // namespace accessibility diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx new file mode 100755 index 000000000000..91dd9bd3bdc5 --- /dev/null +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -0,0 +1,551 @@ +/************************************************************************* + * + * 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: AccessibleGridControlBase.cxx,v $ + * $Revision: 1.3 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_accessibility.hxx" +#include "accessibility/extended/AccessibleGridControlBase.hxx" +#include <svtools/accessibletable.hxx> +#include <rtl/uuid.h> +// +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <unotools/accessiblerelationsethelper.hxx> + +// ============================================================================ + +using ::rtl::OUString; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Any; + +using namespace ::com::sun::star; +using namespace ::com::sun::star::accessibility; +using namespace ::comphelper; +using namespace ::svt; +using namespace ::svt::table; + + +// ============================================================================ + +namespace accessibility { + +using namespace com::sun::star::accessibility::AccessibleStateType; +// ============================================================================ + +// Ctor/Dtor/disposing -------------------------------------------------------- + +DBG_NAME( AccessibleGridControlBase ) + +AccessibleGridControlBase::AccessibleGridControlBase( + const Reference< XAccessible >& rxParent, + svt::table::IAccessibleTable& rTable, + AccessibleTableControlObjType eObjType ) : + AccessibleGridControlImplHelper( m_aMutex ), + m_xParent( rxParent ), + m_aTable( rTable), + m_eObjType( eObjType ), + m_aName( rTable.GetAccessibleObjectName( eObjType, 0, 0 ) ), + m_aDescription( rTable.GetAccessibleObjectDescription( eObjType ) ), + m_aClientId(0) +{ + DBG_CTOR( AccessibleGridControlBase, NULL ); +} + +AccessibleGridControlBase::~AccessibleGridControlBase() +{ +// DBG_DTOR( AccessibleGridControlBase, NULL ); + + if( isAlive() ) + { + // increment ref count to prevent double call of Dtor + osl_incrementInterlockedCount( &m_refCount ); + dispose(); + } +} + +void SAL_CALL AccessibleGridControlBase::disposing() +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + m_xParent = NULL; +} + +// XAccessibleContext --------------------------------------------------------- + +Reference< XAccessible > SAL_CALL AccessibleGridControlBase::getAccessibleParent() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return m_xParent; +} + +sal_Int32 SAL_CALL AccessibleGridControlBase::getAccessibleIndexInParent() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + // -1 for child not found/no parent (according to specification) + sal_Int32 nRet = -1; + + Reference< uno::XInterface > xMeMyselfAndI( static_cast< XAccessibleContext* >( this ), uno::UNO_QUERY ); + + // iterate over parent's children and search for this object + if( m_xParent.is() ) + { + Reference< XAccessibleContext > + xParentContext( m_xParent->getAccessibleContext() ); + if( xParentContext.is() ) + { + Reference< uno::XInterface > xChild; + + sal_Int32 nChildCount = xParentContext->getAccessibleChildCount(); + for( sal_Int32 nChild = 0; nChild < nChildCount; ++nChild ) + { + xChild = xChild.query( xParentContext->getAccessibleChild( nChild ) ); + + if ( xMeMyselfAndI.get() == xChild.get() ) + { + nRet = nChild; + break; + } + } + } + } + return nRet; +} + +OUString SAL_CALL AccessibleGridControlBase::getAccessibleDescription() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return m_aDescription; +} + +OUString SAL_CALL AccessibleGridControlBase::getAccessibleName() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return m_aName; +} + +Reference< XAccessibleRelationSet > SAL_CALL +AccessibleGridControlBase::getAccessibleRelationSet() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + // GridControl does not have relations. + return new utl::AccessibleRelationSetHelper; +} + +Reference< XAccessibleStateSet > SAL_CALL +AccessibleGridControlBase::getAccessibleStateSet() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + // don't check whether alive -> StateSet may contain DEFUNC + return implCreateStateSetHelper(); +} + +lang::Locale SAL_CALL AccessibleGridControlBase::getLocale() + throw ( IllegalAccessibleComponentStateException, uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + if( m_xParent.is() ) + { + Reference< XAccessibleContext > + xParentContext( m_xParent->getAccessibleContext() ); + if( xParentContext.is() ) + return xParentContext->getLocale(); + } + throw IllegalAccessibleComponentStateException(); +} + +// XAccessibleComponent ------------------------------------------------------- + +sal_Bool SAL_CALL AccessibleGridControlBase::containsPoint( const awt::Point& rPoint ) + throw ( uno::RuntimeException ) +{ + return Rectangle( Point(), getBoundingBox().GetSize() ).IsInside( VCLPoint( rPoint ) ); +} + +awt::Rectangle SAL_CALL AccessibleGridControlBase::getBounds() + throw ( uno::RuntimeException ) +{ + return AWTRectangle( getBoundingBox() ); +} + +awt::Point SAL_CALL AccessibleGridControlBase::getLocation() + throw ( uno::RuntimeException ) +{ + return AWTPoint( getBoundingBox().TopLeft() ); +} + +awt::Point SAL_CALL AccessibleGridControlBase::getLocationOnScreen() + throw ( uno::RuntimeException ) +{ + return AWTPoint( getBoundingBoxOnScreen().TopLeft() ); +} + +awt::Size SAL_CALL AccessibleGridControlBase::getSize() + throw ( uno::RuntimeException ) +{ + return AWTSize( getBoundingBox().GetSize() ); +} + +sal_Bool SAL_CALL AccessibleGridControlBase::isShowing() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return implIsShowing(); +} + +sal_Bool SAL_CALL AccessibleGridControlBase::isVisible() + throw ( uno::RuntimeException ) +{ + Reference< XAccessibleStateSet > xStateSet = getAccessibleStateSet(); + return xStateSet.is() ? + xStateSet->contains( AccessibleStateType::VISIBLE ) : sal_False; +} + +sal_Bool SAL_CALL AccessibleGridControlBase::isFocusTraversable() + throw ( uno::RuntimeException ) +{ + Reference< XAccessibleStateSet > xStateSet = getAccessibleStateSet(); + return xStateSet.is() ? + xStateSet->contains( AccessibleStateType::FOCUSABLE ) : sal_False; +} +// XAccessibleEventBroadcaster ------------------------------------------------ + +void SAL_CALL AccessibleGridControlBase::addEventListener( + const Reference< XAccessibleEventListener>& _rxListener ) + throw ( uno::RuntimeException ) +{ + if ( _rxListener.is() ) + { + ::osl::MutexGuard aGuard( getOslMutex() ); + if ( !getClientId( ) ) + setClientId( AccessibleEventNotifier::registerClient( ) ); + + AccessibleEventNotifier::addEventListener( getClientId( ), _rxListener ); + } +} + +void SAL_CALL AccessibleGridControlBase::removeEventListener( + const Reference< XAccessibleEventListener>& _rxListener ) + throw ( uno::RuntimeException ) +{ + if( _rxListener.is() && getClientId( ) ) + { + ::osl::MutexGuard aGuard( getOslMutex() ); + sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( getClientId( ), _rxListener ); + if ( !nListenerCount ) + { + // no listeners anymore + // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), + // and at least to us not firing any events anymore, in case somebody calls + // NotifyAccessibleEvent, again + + AccessibleEventNotifier::TClientId nId( getClientId( ) ); + setClientId( 0 ); + AccessibleEventNotifier::revokeClient( nId ); + } + } +} + +// XTypeProvider -------------------------------------------------------------- + +Sequence< sal_Int8 > SAL_CALL AccessibleGridControlBase::getImplementationId() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslGlobalMutex() ); + static Sequence< sal_Int8 > aId; + implCreateUuid( aId ); + return aId; +} + +// XServiceInfo --------------------------------------------------------------- + +sal_Bool SAL_CALL AccessibleGridControlBase::supportsService( + const OUString& rServiceName ) + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + + Sequence< OUString > aSupportedServices( getSupportedServiceNames() ); + const OUString* pArrBegin = aSupportedServices.getConstArray(); + const OUString* pArrEnd = pArrBegin + aSupportedServices.getLength(); + const OUString* pString = pArrBegin; + + for( ; ( pString != pArrEnd ) && ( rServiceName != *pString ); ++pString ) + ; + + return pString != pArrEnd; +} + +Sequence< OUString > SAL_CALL AccessibleGridControlBase::getSupportedServiceNames() + throw ( uno::RuntimeException ) +{ + const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleContext" ) ); + return Sequence< OUString >( &aServiceName, 1 ); +} +// internal virtual methods --------------------------------------------------- + +sal_Bool AccessibleGridControlBase::implIsShowing() +{ + sal_Bool bShowing = sal_False; + if( m_xParent.is() ) + { + Reference< XAccessibleComponent > + xParentComp( m_xParent->getAccessibleContext(), uno::UNO_QUERY ); + if( xParentComp.is() ) + bShowing = implGetBoundingBox().IsOver( + VCLRectangle( xParentComp->getBounds() ) ); + } + return bShowing; +} + +::utl::AccessibleStateSetHelper* AccessibleGridControlBase::implCreateStateSetHelper() +{ + ::utl::AccessibleStateSetHelper* + pStateSetHelper = new ::utl::AccessibleStateSetHelper; + + if( isAlive() ) + { + // SHOWING done with m_xParent + if( implIsShowing() ) + pStateSetHelper->AddState( AccessibleStateType::SHOWING ); + // GridControl fills StateSet with states depending on object type + m_aTable.FillAccessibleStateSet( *pStateSetHelper, getType() ); + } + else + pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); + + return pStateSetHelper; +} + +// internal helper methods ---------------------------------------------------- + +sal_Bool AccessibleGridControlBase::isAlive() const +{ + return !rBHelper.bDisposed && !rBHelper.bInDispose && &m_aTable; +} + +void AccessibleGridControlBase::ensureIsAlive() const + throw ( lang::DisposedException ) +{ + if( !isAlive() ) + throw lang::DisposedException(); +} + +Rectangle AccessibleGridControlBase::getBoundingBox() + throw ( lang::DisposedException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + Rectangle aRect = implGetBoundingBox(); + if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() ) + { + DBG_ERRORFILE( "rectangle doesn't exist" ); + } + return aRect; +} +// +Rectangle AccessibleGridControlBase::getBoundingBoxOnScreen() + throw ( lang::DisposedException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + Rectangle aRect = implGetBoundingBoxOnScreen(); + if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() ) + { + DBG_ERRORFILE( "rectangle doesn't exist" ); + } + return aRect; +} + +void AccessibleGridControlBase::commitEvent( + sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue ) +{ + ::osl::ClearableMutexGuard aGuard( getOslMutex() ); + if ( !getClientId( ) ) + // if we don't have a client id for the notifier, then we don't have listeners, then + // we don't need to notify anything + return; + + // build an event object + AccessibleEventObject aEvent; + aEvent.Source = *this; + aEvent.EventId = _nEventId; + aEvent.OldValue = _rOldValue; + aEvent.NewValue = _rNewValue; + + // let the notifier handle this event + + AccessibleEventNotifier::addEvent( getClientId( ), aEvent ); +} +// ----------------------------------------------------------------------------- + +void AccessibleGridControlBase::implCreateUuid( Sequence< sal_Int8 >& rId ) +{ + if( !rId.hasElements() ) + { + rId.realloc( 16 ); + rtl_createUuid( reinterpret_cast< sal_uInt8* >( rId.getArray() ), 0, sal_True ); + } +} +// ----------------------------------------------------------------------------- +sal_Int16 SAL_CALL AccessibleGridControlBase::getAccessibleRole() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + sal_Int16 nRole = AccessibleRole::UNKNOWN; + switch ( m_eObjType ) + { + case TCTYPE_ROWHEADERCELL: + nRole = AccessibleRole::ROW_HEADER; + break; + case TCTYPE_COLUMNHEADERCELL: + nRole = AccessibleRole::COLUMN_HEADER; + break; + case TCTYPE_COLUMNHEADERBAR: + case TCTYPE_ROWHEADERBAR: + case TCTYPE_TABLE: + nRole = AccessibleRole::TABLE; + break; + case TCTYPE_TABLECELL: + nRole = AccessibleRole::TABLE_CELL; + break; + case TCTYPE_GRIDCONTROL: + nRole = AccessibleRole::PANEL; + break; + } + return nRole; +} +// ----------------------------------------------------------------------------- +Any SAL_CALL AccessibleGridControlBase::getAccessibleKeyBinding() + throw ( uno::RuntimeException ) +{ + return Any(); +} +// ----------------------------------------------------------------------------- +Reference<XAccessible > SAL_CALL AccessibleGridControlBase::getAccessibleAtPoint( const ::com::sun::star::awt::Point& ) + throw ( uno::RuntimeException ) +{ + return NULL; +} +//// ----------------------------------------------------------------------------- +sal_Int32 SAL_CALL AccessibleGridControlBase::getForeground( ) throw (::com::sun::star::uno::RuntimeException) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + sal_Int32 nColor = 0; + Window* pInst = m_aTable.GetWindowInstance(); + if ( pInst ) + { + if ( pInst->IsControlForeground() ) + nColor = pInst->GetControlForeground().GetColor(); + else + { + Font aFont; + if ( pInst->IsControlFont() ) + aFont = pInst->GetControlFont(); + else + aFont = pInst->GetFont(); + nColor = aFont.GetColor().GetColor(); + } + } + + return nColor; +} +// ----------------------------------------------------------------------------- +sal_Int32 SAL_CALL AccessibleGridControlBase::getBackground( ) throw (::com::sun::star::uno::RuntimeException) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + sal_Int32 nColor = 0; + Window* pInst = m_aTable.GetWindowInstance(); + if ( pInst ) + { + if ( pInst->IsControlBackground() ) + nColor = pInst->GetControlBackground().GetColor(); + else + nColor = pInst->GetBackground().GetColor().GetColor(); + } + + return nColor; +} + +//// ============================================================================ +GridControlAccessibleElement::GridControlAccessibleElement( const Reference< XAccessible >& rxParent, + IAccessibleTable& rTable, + AccessibleTableControlObjType eObjType ) + :AccessibleGridControlBase( rxParent, rTable, eObjType ) +{ +// DBG_CTOR( GridControlAccessibleElement, NULL ); +} + +// XInterface ----------------------------------------------------------------- +IMPLEMENT_FORWARD_XINTERFACE2( GridControlAccessibleElement, AccessibleGridControlBase, GridControlAccessibleElement_Base) + +// XTypeProvider -------------------------------------------------------------- +IMPLEMENT_FORWARD_XTYPEPROVIDER2( GridControlAccessibleElement, AccessibleGridControlBase, GridControlAccessibleElement_Base ) + +// XAccessible ---------------------------------------------------------------- + +Reference< XAccessibleContext > SAL_CALL GridControlAccessibleElement::getAccessibleContext() throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return this; +} +// ---------------------------------------------------------------------------- +GridControlAccessibleElement::~GridControlAccessibleElement( ) +{ +// DBG_DTOR( GridControlAccessibleElement, NULL ); +} + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx new file mode 100755 index 000000000000..d8cc7a11d202 --- /dev/null +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -0,0 +1,321 @@ +/************************************************************************* + * + * 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: AccessibleGridControlHeader.cxx,v $ + * $Revision: 1.3 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_accessibility.hxx" + + +#include "accessibility/extended/AccessibleGridControlHeader.hxx" +#include "accessibility/extended/AccessibleGridControlHeaderCell.hxx" +#include "accessibility/extended/AccessibleGridControlTableCell.hxx" +#include <svtools/accessibletable.hxx> + + +// ============================================================================ + +using ::rtl::OUString; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Any; + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::accessibility; +using namespace ::svt; +using namespace ::svt::table; + +// ============================================================================ + +namespace accessibility { + +// ============================================================================ + +// Ctor/Dtor/disposing -------------------------------------------------------- + +DBG_NAME( AccessibleGridControlHeader ) + +AccessibleGridControlHeader::AccessibleGridControlHeader( + const Reference< XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType): + AccessibleGridControlTableBase( rxParent, rTable, eObjType ) +{ +// DBG_CTOR( AccessibleGridControlHeaderBar, NULL ); + + DBG_ASSERT( isRowBar() || isColumnBar(), + "accessibility/extended/AccessibleGridControlHeaderBar - invalid object type" ); +} + +AccessibleGridControlHeader::~AccessibleGridControlHeader() +{ +// DBG_DTOR( AccessibleGridControlHeader, NULL ); +} + +// XAccessibleContext --------------------------------------------------------- + +Reference< XAccessible > SAL_CALL +AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + + if (nChildIndex<0 || nChildIndex>=getAccessibleChildCount()) + throw IndexOutOfBoundsException(); + ensureIsAlive(); + Reference< XAccessible > xChild; + if(m_eObjType == svt::table::TCTYPE_COLUMNHEADERBAR) + { + AccessibleGridControlHeaderCell* pColHeaderCell = new AccessibleGridControlHeaderCell(nChildIndex, this, m_aTable, svt::table::TCTYPE_COLUMNHEADERCELL); + xChild = pColHeaderCell; + } + else if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR) + { + AccessibleGridControlHeaderCell* pRowHeaderCell = new AccessibleGridControlHeaderCell(nChildIndex, this, m_aTable, svt::table::TCTYPE_ROWHEADERCELL); + xChild = pRowHeaderCell; + } + return xChild; +} + +sal_Int32 SAL_CALL AccessibleGridControlHeader::getAccessibleIndexInParent() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader()) + return 1; + else + return 0; +} + +// XAccessibleComponent ------------------------------------------------------- + +Reference< XAccessible > SAL_CALL +AccessibleGridControlHeader::getAccessibleAtPoint( const awt::Point& rPoint ) + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + sal_Int32 nRow = 0; + sal_Int32 nColumnPos = 0; + sal_Bool bConverted = isRowBar() ? + m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) : + m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ); + + return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >(); +} + +void SAL_CALL AccessibleGridControlHeader::grabFocus() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + // focus on header not supported +} + +Any SAL_CALL AccessibleGridControlHeader::getAccessibleKeyBinding() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return Any(); // no special key bindings for header +} + +// XAccessibleTable ----------------------------------------------------------- + +OUString SAL_CALL AccessibleGridControlHeader::getAccessibleRowDescription( sal_Int32 nRow ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidRow( nRow ); + return OUString(); // no headers in headers +} + +OUString SAL_CALL AccessibleGridControlHeader::getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidColumn( nColumn ); + return OUString(); // no headers in headers +} + +Reference< XAccessibleTable > SAL_CALL AccessibleGridControlHeader::getAccessibleRowHeaders() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return NULL; // no headers in headers +} + +Reference< XAccessibleTable > SAL_CALL AccessibleGridControlHeader::getAccessibleColumnHeaders() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return NULL; // no headers in headers +} + +Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleRows() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + Sequence< sal_Int32 > aSelSeq; + // row of column header bar not selectable + if( isRowBar() ) + implGetSelectedRows( aSelSeq ); + return aSelSeq; +} +//columns aren't selectable +Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleColumns() + throw ( uno::RuntimeException ) +{ + return NULL; +} +//To Do - not yet implemented +sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 nRow ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidRow( nRow ); + //return isRowBar() ? implIsRowSelected( nRow ) : sal_False; + return sal_False; +} +//columns aren't selectable +sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + (void)nColumn; + return sal_False; +} + +Reference< XAccessible > SAL_CALL AccessibleGridControlHeader::getAccessibleCellAt( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidAddress( nRow, nColumn ); + return implGetChild( nRow, implToVCLColumnPos( nColumn ) ); +} +// TO DO - not implemented yet +sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleSelected( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidAddress( nRow, nColumn ); + return FALSE; + // return isRowBar() ? implIsRowSelected( nRow ) : implIsColumnSelected( nColumn ); +} + +// XServiceInfo --------------------------------------------------------------- + +OUString SAL_CALL AccessibleGridControlHeader::getImplementationName() + throw ( uno::RuntimeException ) +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleGridControlHeader" ) ); +} + +Sequence< sal_Int8 > SAL_CALL AccessibleGridControlHeader::getImplementationId() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslGlobalMutex() ); + static Sequence< sal_Int8 > aId; + implCreateUuid( aId ); + return aId; +} + +// internal virtual methods --------------------------------------------------- + +Rectangle AccessibleGridControlHeader::implGetBoundingBox() +{ + return m_aTable.calcHeaderRect(isColumnBar()); +} + +Rectangle AccessibleGridControlHeader::implGetBoundingBoxOnScreen() +{ + return m_aTable.calcHeaderRect(isColumnBar()); +} + +sal_Int32 AccessibleGridControlHeader::implGetRowCount() const +{ + return 1; +} + +sal_Int32 AccessibleGridControlHeader::implGetColumnCount() const +{ + return 1; +} + +// internal helper methods ---------------------------------------------------- + +Reference< XAccessible > AccessibleGridControlHeader::implGetChild( + sal_Int32 nRow, sal_uInt32 nColumnPos ) +{ + Reference< XAccessible > xChild; + if(m_eObjType == svt::table::TCTYPE_COLUMNHEADERBAR) + { + AccessibleGridControlHeaderCell* pColHeaderCell = new AccessibleGridControlHeaderCell(nColumnPos, this, m_aTable, svt::table::TCTYPE_COLUMNHEADERCELL); + xChild = pColHeaderCell; + } + else if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR) + { + AccessibleGridControlHeaderCell* pRowHeaderCell = new AccessibleGridControlHeaderCell(nRow, this, m_aTable, svt::table::TCTYPE_ROWHEADERCELL); + xChild = pRowHeaderCell; + } + return xChild; +} + +void AccessibleGridControlHeader::ensureIsValidHeaderIndex( sal_Int32 nIndex ) + throw ( lang::IndexOutOfBoundsException ) +{ + if( isRowBar() ) + ensureIsValidRow( nIndex ); + else + ensureIsValidColumn( nIndex ); +} + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx new file mode 100755 index 000000000000..52139a694aef --- /dev/null +++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx @@ -0,0 +1,173 @@ +/************************************************************************* + * + * 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: AccessibleGridControlHeaderCell.cxx,v $ + * $Revision: 1.3 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_accessibility.hxx" + +#include "accessibility/extended/AccessibleGridControlHeaderCell.hxx" +#include <svtools/accessibletable.hxx> +#include "accessibility/extended/AccessibleGridControl.hxx" + +namespace accessibility +{ + using namespace ::com::sun::star::accessibility; + using namespace ::com::sun::star::lang; + using namespace ::com::sun::star::uno; + using namespace ::svt; + using namespace ::svt::table; + +AccessibleGridControlHeaderCell::AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId, + const Reference< XAccessible >& rxParent, + IAccessibleTable& rTable, + AccessibleTableControlObjType eObjType) +: AccessibleGridControlCell( rxParent, rTable, _nColumnRowId, 0, eObjType) +, m_nColumnRowId(_nColumnRowId) +{ +} +/** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. +*/ +::utl::AccessibleStateSetHelper* AccessibleGridControlHeaderCell::implCreateStateSetHelper() +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ::utl::AccessibleStateSetHelper* + pStateSetHelper = new ::utl::AccessibleStateSetHelper; + + if( isAlive() ) + { + // SHOWING done with mxParent + if( implIsShowing() ) + pStateSetHelper->AddState( AccessibleStateType::SHOWING ); + + TCSolarGuard aSolarGuard; + pStateSetHelper->AddState( AccessibleStateType::VISIBLE ); + pStateSetHelper->AddState( AccessibleStateType::FOCUSABLE ); + pStateSetHelper->AddState( AccessibleStateType::TRANSIENT ); + pStateSetHelper->AddState( AccessibleStateType::SELECTABLE ); + + if ( m_aTable.IsRowSelected(m_nColumnRowId) ) + pStateSetHelper->AddState( AccessibleStateType::SELECTED ); + } + else + pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); + + return pStateSetHelper; +} +// ----------------------------------------------------------------------------- +/** @return + The count of visible children. +*/ +sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleChildCount() + throw ( RuntimeException ) +{ + return 0; +} +// ----------------------------------------------------------------------------- + +/** @return + The XAccessible interface of the specified child. +*/ +Reference<XAccessible > SAL_CALL AccessibleGridControlHeaderCell::getAccessibleChild( sal_Int32 ) + throw ( IndexOutOfBoundsException,RuntimeException ) +{ + throw IndexOutOfBoundsException(); +} +// XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + ::com::sun::star::uno::Any SAL_CALL AccessibleGridControlHeaderCell::queryInterface( + const ::com::sun::star::uno::Type& rType ) + throw ( ::com::sun::star::uno::RuntimeException ) + { + Any aRet = AccessibleGridControlCell::queryInterface(rType); + return aRet; + } + + /** Aquires the object (calls acquire() on base class). */ + void SAL_CALL AccessibleGridControlHeaderCell::acquire() throw () + { + AccessibleGridControlCell::acquire(); + } + + /** Releases the object (calls release() on base class). */ + void SAL_CALL AccessibleGridControlHeaderCell::release() throw () + { + AccessibleGridControlCell::release(); + } + /** @return The XAccessibleContext interface of this object. */ + Reference< com::sun::star::accessibility::XAccessibleContext > SAL_CALL AccessibleGridControlHeaderCell::getAccessibleContext() throw ( RuntimeException ) + { + ensureIsAlive(); + return this; + } + +// ----------------------------------------------------------------------------- + +/** Grabs the focus to the column header. */ +void SAL_CALL AccessibleGridControlHeaderCell::grabFocus() + throw ( ::com::sun::star::uno::RuntimeException ) +{ +} +// ----------------------------------------------------------------------------- +/** @return + The name of this class. +*/ +::rtl::OUString SAL_CALL AccessibleGridControlHeaderCell::getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleGridControlHeaderCell" ) ); +} +// ----------------------------------------------------------------------------- +Rectangle AccessibleGridControlHeaderCell::implGetBoundingBox() +{ + return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle +} +// ----------------------------------------------------------------------------- + +Rectangle AccessibleGridControlHeaderCell::implGetBoundingBoxOnScreen() +{ + return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle +} +// ----------------------------------------------------------------------------- +sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleIndexInParent() + throw ( RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + sal_Int32 nIndex = m_nColumnRowId; + return nIndex; +} +// ----------------------------------------------------------------------------- +} // namespace accessibility +// ----------------------------------------------------------------------------- + + diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx new file mode 100755 index 000000000000..ba6c229e2dc5 --- /dev/null +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -0,0 +1,416 @@ +/************************************************************************* + * + * 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: AccessibleGridControlTable.cxx,v $ + * $Revision: 1.3 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_accessibility.hxx" + + +#include "accessibility/extended/AccessibleGridControlTable.hxx" +#include "accessibility/extended/AccessibleGridControlTableCell.hxx" +#include <svtools/accessibletable.hxx> + +// ============================================================================ + +using ::rtl::OUString; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Any; + +using namespace ::com::sun::star; +using namespace ::com::sun::star::accessibility; +using namespace ::svt; +using namespace ::svt::table; +// ============================================================================ + +namespace accessibility { + +// ============================================================================ + +// Ctor/Dtor/disposing -------------------------------------------------------- + +DBG_NAME( AccessibleGridControlTable ) + +AccessibleGridControlTable::AccessibleGridControlTable( + const Reference< XAccessible >& rxParent, + IAccessibleTable& rTable, + AccessibleTableControlObjType _eType) : + AccessibleGridControlTableBase( rxParent, rTable, _eType ) +{ + DBG_CTOR( AccessibleGridControlTable, NULL ); +} + +AccessibleGridControlTable::~AccessibleGridControlTable() +{ + DBG_DTOR( AccessibleGridControlTable, NULL ); +} + +// XAccessibleContext --------------------------------------------------------- + +Reference< XAccessible > SAL_CALL +AccessibleGridControlTable::getAccessibleChild( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidIndex( nChildIndex ); + return new AccessibleGridControlTableCell(this, m_aTable, nChildIndex/m_aTable.GetColumnCount(), nChildIndex%m_aTable.GetColumnCount(), TCTYPE_TABLECELL); +} + +sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + if(m_aTable.HasRowHeader() && m_aTable.HasColHeader()) + return 0; + else if((!m_aTable.HasRowHeader() && m_aTable.HasColHeader()) || (m_aTable.HasRowHeader() && !m_aTable.HasColHeader()) ) + return 1; + else + return 2; + +} + +// XAccessibleComponent ------------------------------------------------------- + +Reference< XAccessible > SAL_CALL +AccessibleGridControlTable::getAccessibleAtPoint( const awt::Point& rPoint ) + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + Reference< XAccessible > xChild; + sal_Int32 nRow = 0; + sal_Int32 nColumnPos = 0; + if( m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) ) + xChild = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumnPos, TCTYPE_TABLECELL); + + return xChild; +} + +void SAL_CALL AccessibleGridControlTable::grabFocus() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + m_aTable.GrabFocus(); +} + +Any SAL_CALL AccessibleGridControlTable::getAccessibleKeyBinding() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return Any(); // no special key bindings for data table +} + +// XAccessibleTable ----------------------------------------------------------- + +OUString SAL_CALL AccessibleGridControlTable::getAccessibleRowDescription( sal_Int32 nRow ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidRow( nRow ); + return m_aTable.GetRowDescription( nRow ); +} + +OUString SAL_CALL AccessibleGridControlTable::getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidColumn( nColumn ); + return m_aTable.GetColumnDescription( (sal_uInt16)nColumn ); +} + +Reference< XAccessibleTable > SAL_CALL AccessibleGridControlTable::getAccessibleRowHeaders() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + if(m_aTable.HasColHeader()) + return implGetHeaderBar( 1 ); + else + return implGetHeaderBar( 0 ); +} + +Reference< XAccessibleTable > SAL_CALL AccessibleGridControlTable::getAccessibleColumnHeaders() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return implGetHeaderBar( 0 ); +} + +Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleRows() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + Sequence< sal_Int32 > aSelSeq; + implGetSelectedRows( aSelSeq ); + return aSelSeq; +} + +//columns aren't selectable +Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleColumns() + throw ( uno::RuntimeException ) +{ +// TCSolarGuard aSolarGuard; +// ::osl::MutexGuard aGuard( getOslMutex() ); +// ensureIsAlive(); +// +// Sequence< sal_Int32 > aSelSeq; +// implGetSelectedColumns( aSelSeq ); +// return aSelSeq; + return NULL; +} + +//To Do: not implemented yet +sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleRowSelected( sal_Int32 nRow ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + //TCSolarGuard aSolarGuard; + //::osl::MutexGuard aGuard( getOslMutex() ); + //ensureIsAlive(); + //ensureIsValidRow( nRow ); + //return implIsRowSelected( nRow ); + (void) nRow; + return sal_False; +} + +//columns aren't selectable +sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + /*TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidColumn( nColumn ); + return implIsColumnSelected( nColumn );*/ + (void) nColumn; + return sal_False; +} + +Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getAccessibleCellAt( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidAddress( nRow, nColumn ); + return new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn, TCTYPE_TABLECELL); +} + +sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + /*TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidAddress( nRow, nColumn ); + return implIsRowSelected( nRow ) || implIsColumnSelected( nColumn );*/ + (void) nRow; + (void) nColumn; + return sal_False; +} +//To Do: not implemented yet +void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidIndex( nChildIndex ); + //if( isRowBar() ) + // implSelectRow( nChildIndex, sal_True ); + //else + // implSelectColumn( implToVCLColumnPos( nChildIndex ), sal_True ); +} +//To Do - not implemented yet +sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleChildSelected( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + // using interface methods - no mutex + /*return isRowBar() ? + isAccessibleRowSelected( nChildIndex ) : + isAccessibleColumnSelected( nChildIndex );*/ + (void)nChildIndex; + return FALSE; +} +//To Do - not implemented yet +void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); +} +//To Do - not implemented yet +void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); +} +//To Do - not implemented yet +sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + // return isRowBar() ? implGetSelectedRowCount() : implGetSelectedColumnCount(); + return 0; +} +//To Do - not implemented yet +Reference< XAccessible > SAL_CALL +AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + (void)nSelectedChildIndex; + // method may throw lang::IndexOutOfBoundsException + //sal_Int32 nIndex = implGetChildIndexFromSelectedIndex( nSelectedChildIndex ); + //return implGetChild( nIndex, implToVCLColumnPos( nIndex ) ); + return NULL; +} +//To Do - not implemented yet +void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild( + sal_Int32 nSelectedChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + (void)nSelectedChildIndex; + // method may throw lang::IndexOutOfBoundsException + //if ( isAccessibleChildSelected(nSelectedChildIndex) ) + //{ + // if( isRowBar() ) + // implSelectRow( nSelectedChildIndex, sal_False ); + // else + // implSelectColumn( implToVCLColumnPos( nSelectedChildIndex ), sal_False ); + //} +} +// XInterface ----------------------------------------------------------------- + +Any SAL_CALL AccessibleGridControlTable::queryInterface( const uno::Type& rType ) + throw ( uno::RuntimeException ) +{ + Any aAny( AccessibleGridControlTableBase::queryInterface( rType ) ); + return aAny.hasValue() ? + aAny : AccessibleGridControlTableImplHelper1::queryInterface( rType ); +} + +void SAL_CALL AccessibleGridControlTable::acquire() throw () +{ + AccessibleGridControlTableBase::acquire(); +} + +void SAL_CALL AccessibleGridControlTable::release() throw () +{ + AccessibleGridControlTableBase::release(); +} +// XServiceInfo --------------------------------------------------------------- + +OUString SAL_CALL AccessibleGridControlTable::getImplementationName() + throw ( uno::RuntimeException ) +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleGridControlTable" ) ); +} + +// internal virtual methods --------------------------------------------------- + +Rectangle AccessibleGridControlTable::implGetBoundingBox() +{ + return m_aTable.calcTableRect(); +} + +Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen() +{ + return m_aTable.calcTableRect(); +} +// internal helper methods ---------------------------------------------------- + +Reference< XAccessible > AccessibleGridControlTable::implGetChild( + sal_Int32 nRow, sal_uInt16 nColumnPos ) +{ + (void)nRow; + (void)nColumnPos; + return NULL; +} +//To Do - not implemented yet +//sal_Int32 AccessibleGridControlTable::implGetChildIndexFromSelectedIndex( +// sal_Int32 nSelectedChildIndex ) +// throw ( lang::IndexOutOfBoundsException ) +//{ +// (void)nSelectedChildIndex; +// return 0; +//} +Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar( + sal_Int32 nChildIndex ) + throw ( uno::RuntimeException ) +{ + Reference< XAccessible > xRet; + Reference< XAccessibleContext > xContext( m_xParent, uno::UNO_QUERY ); + if( xContext.is() ) + { + try + { + xRet = xContext->getAccessibleChild( nChildIndex ); + } + catch( lang::IndexOutOfBoundsException& ) + { + DBG_ERROR( "implGetHeaderBar - wrong child index" ); + } + // RuntimeException goes to caller + } + return Reference< XAccessibleTable >( xRet, uno::UNO_QUERY ); +} + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx new file mode 100755 index 000000000000..bc266f10f323 --- /dev/null +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -0,0 +1,318 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2009 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleGridControlTableBase.cxx,v $ + * $Revision: 1.3 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_accessibility.hxx" + + +#include "accessibility/extended/AccessibleGridControlTableBase.hxx" +#include <svtools/accessibletable.hxx> +#include <tools/multisel.hxx> +#include <comphelper/sequence.hxx> + +// ============================================================================ + +using ::rtl::OUString; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Any; + +using namespace ::com::sun::star; +using namespace ::com::sun::star::accessibility; +using namespace ::svt; +using namespace ::svt::table; + +// ============================================================================ + +namespace accessibility { + +// ============================================================================ + +// Ctor/Dtor/disposing -------------------------------------------------------- + +DBG_NAME( AccessibleGridControlTableBase ) + +AccessibleGridControlTableBase::AccessibleGridControlTableBase( + const Reference< XAccessible >& rxParent, + IAccessibleTable& rTable, + AccessibleTableControlObjType eObjType ) : + GridControlAccessibleElement( rxParent, rTable, eObjType ) +{ + DBG_CTOR( AccessibleGridControlTableBase, NULL ); +} + +AccessibleGridControlTableBase::~AccessibleGridControlTableBase() +{ + DBG_DTOR( AccessibleGridControlTableBase, NULL ); +} + +// XAccessibleContext --------------------------------------------------------- + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleChildCount() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + sal_Int32 nChildren = 0; + if(m_eObjType == TCTYPE_ROWHEADERBAR) + nChildren = m_aTable.GetRowCount(); + else if(m_eObjType == TCTYPE_TABLE) + nChildren = m_aTable.GetRowCount()*m_aTable.GetColumnCount(); + else if(m_eObjType == TCTYPE_COLUMNHEADERBAR) + nChildren = m_aTable.GetColumnCount(); + return nChildren; +} + +sal_Int16 SAL_CALL AccessibleGridControlTableBase::getAccessibleRole() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return AccessibleRole::TABLE; +} + +// XAccessibleTable ----------------------------------------------------------- + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleRowCount() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return m_aTable.GetRowCount(); +} + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleColumnCount() + throw ( uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + return m_aTable.GetColumnCount(); +} + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleRowExtentAt( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidAddress( nRow, nColumn ); + return 1; // merged cells not supported +} + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleColumnExtentAt( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidAddress( nRow, nColumn ); + return 1; // merged cells not supported +} + +Reference< XAccessible > SAL_CALL AccessibleGridControlTableBase::getAccessibleCaption() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return NULL; // not supported +} + +Reference< XAccessible > SAL_CALL AccessibleGridControlTableBase::getAccessibleSummary() + throw ( uno::RuntimeException ) +{ + ensureIsAlive(); + return NULL; // not supported +} + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleIndex( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidAddress( nRow, nColumn ); + return implGetChildIndex( nRow, nColumn ); +} + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleRow( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidIndex( nChildIndex ); + return implGetRow( nChildIndex ); +} + +sal_Int32 SAL_CALL AccessibleGridControlTableBase::getAccessibleColumn( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) +{ + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidIndex( nChildIndex ); + return implGetColumn( nChildIndex ); +} + +// XInterface ----------------------------------------------------------------- + +Any SAL_CALL AccessibleGridControlTableBase::queryInterface( const uno::Type& rType ) + throw ( uno::RuntimeException ) +{ + Any aAny( GridControlAccessibleElement::queryInterface( rType ) ); + return aAny.hasValue() ? + aAny : AccessibleGridControlTableImplHelper::queryInterface( rType ); +} + +void SAL_CALL AccessibleGridControlTableBase::acquire() throw () +{ + GridControlAccessibleElement::acquire(); +} + +void SAL_CALL AccessibleGridControlTableBase::release() throw () +{ + GridControlAccessibleElement::release(); +} + +// XTypeProvider -------------------------------------------------------------- + +Sequence< uno::Type > SAL_CALL AccessibleGridControlTableBase::getTypes() + throw ( uno::RuntimeException ) +{ + return ::comphelper::concatSequences( + GridControlAccessibleElement::getTypes(), + AccessibleGridControlTableImplHelper::getTypes() ); +} + +Sequence< sal_Int8 > SAL_CALL AccessibleGridControlTableBase::getImplementationId() + throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( getOslGlobalMutex() ); + static Sequence< sal_Int8 > aId; + implCreateUuid( aId ); + return aId; +} + +// internal helper methods ---------------------------------------------------- + +sal_uInt16 AccessibleGridControlTableBase::implToVCLColumnPos( sal_Int32 nColumn ) const +{ + sal_uInt16 nVCLPos = 0; + if( (0 <= nColumn) && (nColumn < m_aTable.GetColumnCount()) ) + { + // regard "handle column" + if( m_aTable.HasRowHeader() ) + ++nColumn; + nVCLPos = static_cast< sal_uInt16 >( nColumn ); + } + return nVCLPos; +} + +sal_Int32 AccessibleGridControlTableBase::implGetChildCount() const +{ + return m_aTable.GetRowCount()*m_aTable.GetColumnCount(); +} + +sal_Int32 AccessibleGridControlTableBase::implGetRow( sal_Int32 nChildIndex ) const +{ + sal_Int32 nColumns = m_aTable.GetColumnCount(); + return nColumns ? (nChildIndex / nColumns) : 0; +} + +sal_Int32 AccessibleGridControlTableBase::implGetColumn( sal_Int32 nChildIndex ) const +{ + sal_Int32 nColumns = m_aTable.GetColumnCount(); + return nColumns ? (nChildIndex % nColumns) : 0; +} + +sal_Int32 AccessibleGridControlTableBase::implGetChildIndex( + sal_Int32 nRow, sal_Int32 nColumn ) const +{ + return nRow * m_aTable.GetColumnCount() + nColumn; +} + +sal_Bool AccessibleGridControlTableBase::implIsRowSelected( sal_Int32 nRow ) const +{ + return m_aTable.IsRowSelected( nRow ); +} + +sal_Int32 AccessibleGridControlTableBase::implGetSelectedRowCount() const +{ + return m_aTable.GetSelectedRowCount(); +} + +void AccessibleGridControlTableBase::implGetSelectedRows( Sequence< sal_Int32 >& rSeq ) +{ + rSeq = comphelper::containerToSequence(m_aTable.GetSelectedRows()); +} + +void AccessibleGridControlTableBase::ensureIsValidRow( sal_Int32 nRow ) + throw ( lang::IndexOutOfBoundsException ) +{ + if( nRow >= m_aTable.GetRowCount() ) + throw lang::IndexOutOfBoundsException( + OUString( RTL_CONSTASCII_USTRINGPARAM( "row index is invalid" ) ), *this ); +} + +void AccessibleGridControlTableBase::ensureIsValidColumn( sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException ) +{ + if( nColumn >= m_aTable.GetColumnCount() ) + throw lang::IndexOutOfBoundsException( + OUString( RTL_CONSTASCII_USTRINGPARAM("column index is invalid") ), *this ); +} + +void AccessibleGridControlTableBase::ensureIsValidAddress( + sal_Int32 nRow, sal_Int32 nColumn ) + throw ( lang::IndexOutOfBoundsException ) +{ + ensureIsValidRow( nRow ); + ensureIsValidColumn( nColumn ); +} + +void AccessibleGridControlTableBase::ensureIsValidIndex( sal_Int32 nChildIndex ) + throw ( lang::IndexOutOfBoundsException ) +{ + if( nChildIndex >= implGetChildCount() ) + throw lang::IndexOutOfBoundsException( + OUString( RTL_CONSTASCII_USTRINGPARAM("child index is invalid") ), *this ); +} + +// ============================================================================ + +} // namespace accessibility + +// ============================================================================ + diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx new file mode 100755 index 000000000000..981a3e6086b0 --- /dev/null +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -0,0 +1,379 @@ +/************************************************************************* + * + * 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: AccessibleGridControlTableCell.cxx,v $ + * $Revision: 1.4 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_accessibility.hxx" + +#include "accessibility/extended/AccessibleGridControlTableCell.hxx" +#include <svtools/accessibletable.hxx> +#include "accessibility/extended/AccessibleGridControl.hxx" +#include <tools/gen.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <com/sun/star/accessibility/AccessibleEventId.hpp> + +namespace accessibility +{ + namespace + { + void checkIndex_Impl( sal_Int32 _nIndex, const ::rtl::OUString& _sText ) throw (::com::sun::star::lang::IndexOutOfBoundsException) + { + if ( _nIndex >= _sText.getLength() ) + throw ::com::sun::star::lang::IndexOutOfBoundsException(); + } + + sal_Int32 getIndex_Impl( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_uInt16 _nColumnCount ) + { + return _nRow * _nColumnCount + _nColumn; + } + } + using namespace ::com::sun::star::lang; + using namespace utl; + using namespace comphelper; + using ::rtl::OUString; + using ::accessibility::AccessibleGridControl; + using namespace ::com::sun::star::uno; + using ::com::sun::star::accessibility::XAccessible; + using namespace ::com::sun::star::accessibility; + using namespace ::svt; + using namespace ::svt::table; + + + // ============================================================================= + // = AccessibleGridControlCell + // ============================================================================= + //DBG_NAME( svt_AccessibleGridControlCell ) + // ----------------------------------------------------------------------------- + AccessibleGridControlCell::AccessibleGridControlCell( + const Reference< XAccessible >& _rxParent, IAccessibleTable& _rTable, + sal_Int32 _nRowPos, sal_uInt16 _nColPos, AccessibleTableControlObjType _eType ) + :AccessibleGridControlBase( _rxParent, _rTable, _eType ) + ,m_nRowPos( _nRowPos ) + ,m_nColPos( _nColPos ) + { +// DBG_CTOR( svt_AccessibleGridControlCell, NULL ); + // set accessible name here, because for that we need the position of the cell + // and so the base class isn't capable of doing this + ::rtl::OUString aAccName; + if(_eType == TCTYPE_TABLECELL) + aAccName = _rTable.GetAccessibleObjectName( TCTYPE_TABLECELL, _nRowPos, _nColPos ); + else if(_eType == TCTYPE_ROWHEADERCELL) + aAccName = _rTable.GetAccessibleObjectName( TCTYPE_ROWHEADERCELL, _nRowPos, 0 ); + else if(_eType == TCTYPE_COLUMNHEADERCELL) + aAccName = _rTable.GetAccessibleObjectName( TCTYPE_COLUMNHEADERCELL, 0, _nRowPos ); + implSetName( aAccName ); + } + + // ----------------------------------------------------------------------------- + AccessibleGridControlCell::~AccessibleGridControlCell() + { + } + + // ----------------------------------------------------------------------------- + void SAL_CALL AccessibleGridControlCell::grabFocus() throw ( RuntimeException ) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + m_aTable.GoToCell( m_nColPos, m_nRowPos ); + } + //// ----------------------------------------------------------------------------- + // implementation of a table cell + ::rtl::OUString AccessibleGridControlTableCell::implGetText() + { + ensureIsAlive(); + //return mpTable->GetAccessibleCellText( getRowPos(), static_cast< USHORT >( getColumnPos() ) ); + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "test" )); + } + + ::com::sun::star::lang::Locale AccessibleGridControlTableCell::implGetLocale() + { + ensureIsAlive(); + return m_aTable.GetAccessible()->getAccessibleContext()->getLocale(); + } + + void AccessibleGridControlTableCell::implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) + { + nStartIndex = 0; + nEndIndex = 0; + } + + AccessibleGridControlTableCell::AccessibleGridControlTableCell(const Reference<XAccessible >& _rxParent, + IAccessibleTable& _rTable, + sal_Int32 _nRowPos, + sal_uInt16 _nColPos, + AccessibleTableControlObjType eObjType) + :AccessibleGridControlCell( _rxParent, _rTable, _nRowPos, _nColPos, eObjType ) + { + } + + // XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + ::com::sun::star::uno::Any SAL_CALL AccessibleGridControlTableCell::queryInterface( + const ::com::sun::star::uno::Type& rType ) + throw ( ::com::sun::star::uno::RuntimeException ) + { + Any aRet = AccessibleGridControlCell::queryInterface(rType); + if ( !aRet.hasValue() ) + aRet = AccessibleTextHelper_BASE::queryInterface(rType); + return aRet; + } + + /** Aquires the object (calls acquire() on base class). */ + void SAL_CALL AccessibleGridControlTableCell::acquire() throw () + { + AccessibleGridControlCell::acquire(); + } + + /** Releases the object (calls release() on base class). */ + void SAL_CALL AccessibleGridControlTableCell::release() throw () + { + AccessibleGridControlCell::release(); + } + + ::com::sun::star::awt::Rectangle SAL_CALL AccessibleGridControlTableCell::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + + ensureIsAlive(); + if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) + throw IndexOutOfBoundsException(); + + ::com::sun::star::awt::Rectangle aRect; + + if ( &m_aTable ) + { + aRect = AWTRectangle( m_aTable.GetFieldCharacterBounds( getRowPos(), getColumnPos(), nIndex ) ); + } + + return aRect; + } + + sal_Int32 SAL_CALL AccessibleGridControlTableCell::getIndexAtPoint( const ::com::sun::star::awt::Point& _aPoint ) throw (RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + return m_aTable.GetFieldIndexAtPoint( getRowPos(), getColumnPos(), VCLPoint( _aPoint ) ); + } + + /** @return + The name of this class. + */ + ::rtl::OUString SAL_CALL AccessibleGridControlTableCell::getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ) + { + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleGridControlTableCell" ) ); + } + + /** @return The count of visible children. */ + sal_Int32 SAL_CALL AccessibleGridControlTableCell::getAccessibleChildCount() + throw ( ::com::sun::star::uno::RuntimeException ) + { + return 0; + } + + /** @return The XAccessible interface of the specified child. */ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + AccessibleGridControlTableCell::getAccessibleChild( sal_Int32 ) + throw ( ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException ) + { + throw ::com::sun::star::lang::IndexOutOfBoundsException(); + } + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. + */ + ::utl::AccessibleStateSetHelper* AccessibleGridControlTableCell::implCreateStateSetHelper() + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + + ::utl::AccessibleStateSetHelper* pStateSetHelper = new ::utl::AccessibleStateSetHelper; + + if( isAlive() ) + { + // SHOWING done with mxParent + if( implIsShowing() ) + pStateSetHelper->AddState( AccessibleStateType::SHOWING ); + + m_aTable.FillAccessibleStateSetForCell( *pStateSetHelper, getRowPos(), static_cast< sal_uInt16 >( getColumnPos() ) ); + } + else + pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); + + return pStateSetHelper; + } + + + // XAccessible ------------------------------------------------------------ + + /** @return The XAccessibleContext interface of this object. */ + Reference< XAccessibleContext > SAL_CALL AccessibleGridControlTableCell::getAccessibleContext() throw ( RuntimeException ) + { + ensureIsAlive(); + return this; + } + + // XAccessibleContext ----------------------------------------------------- + + sal_Int32 SAL_CALL AccessibleGridControlTableCell::getAccessibleIndexInParent() + throw ( ::com::sun::star::uno::RuntimeException ) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + + return ( getRowPos() * m_aTable.GetColumnCount() ) + getColumnPos(); + } + + sal_Int32 SAL_CALL AccessibleGridControlTableCell::getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException) + { + return -1; + } + sal_Bool SAL_CALL AccessibleGridControlTableCell::setCaretPosition ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + + if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) ) + throw IndexOutOfBoundsException(); + + return sal_False; + } + sal_Unicode SAL_CALL AccessibleGridControlTableCell::getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getCharacter( nIndex ); + } + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL AccessibleGridControlTableCell::getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + + ::rtl::OUString sText( implGetText() ); + + if ( !implIsValidIndex( nIndex, sText.getLength() ) ) + throw IndexOutOfBoundsException(); + + return ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >(); + } + sal_Int32 SAL_CALL AccessibleGridControlTableCell::getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getCharacterCount( ); + } + + ::rtl::OUString SAL_CALL AccessibleGridControlTableCell::getSelectedText( ) throw (::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getSelectedText( ); + } + sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getSelectionStart( ); + } + sal_Int32 SAL_CALL AccessibleGridControlTableCell::getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getSelectionEnd( ); + } + sal_Bool SAL_CALL AccessibleGridControlTableCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) ) + throw IndexOutOfBoundsException(); + + return sal_False; + } + ::rtl::OUString SAL_CALL AccessibleGridControlTableCell::getText( ) throw (::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getText( ); + } + ::rtl::OUString SAL_CALL AccessibleGridControlTableCell::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex ); + } + ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleGridControlTableCell::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getTextAtIndex( nIndex ,aTextType); + } + ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleGridControlTableCell::getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getTextBeforeIndex( nIndex ,aTextType); + } + ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleGridControlTableCell::getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + return OCommonAccessibleText::getTextBehindIndex( nIndex ,aTextType); + } + sal_Bool SAL_CALL AccessibleGridControlTableCell::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + { + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ::rtl::OUString sText = implGetText(); + checkIndex_Impl( nStartIndex, sText ); + checkIndex_Impl( nEndIndex, sText ); + + //!!! don't know how to put a string into the clipboard + return sal_False; + } + Rectangle AccessibleGridControlTableCell::implGetBoundingBox() + { + return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle + } + // ----------------------------------------------------------------------------- + + Rectangle AccessibleGridControlTableCell::implGetBoundingBoxOnScreen() + { + return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle + } +} diff --git a/accessibility/source/extended/makefile.mk b/accessibility/source/extended/makefile.mk index 701bff8f7b51..34f9158f1f02 100644 --- a/accessibility/source/extended/makefile.mk +++ b/accessibility/source/extended/makefile.mk @@ -64,7 +64,14 @@ SLOFILES=\ $(SLO)$/listboxaccessible.obj \ $(SLO)$/accessiblebrowseboxcell.obj \ $(SLO)$/accessibleeditbrowseboxcell.obj \ - $(SLO)$/textwindowaccessibility.obj + $(SLO)$/textwindowaccessibility.obj \ + $(SLO)$/AccessibleGridControlBase.obj \ + $(SLO)$/AccessibleGridControl.obj \ + $(SLO)$/AccessibleGridControlTableBase.obj \ + $(SLO)$/AccessibleGridControlHeader.obj \ + $(SLO)$/AccessibleGridControlTableCell.obj \ + $(SLO)$/AccessibleGridControlHeaderCell.obj \ + $(SLO)$/AccessibleGridControlTable.obj # --- Targets ------------------------------------------------------- diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index 5c8b742db53c..60e4f416dc3c 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -72,6 +72,8 @@ #include <accessibility/extended/accessibleeditbrowseboxcell.hxx> #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> +#include <accessibility/extended/AccessibleGridControl.hxx> +#include <svtools/accessibletable.hxx> #include <floatingwindowaccessible.hxx> @@ -94,6 +96,7 @@ inline bool hasFloatingChild(Window *pWindow) using namespace ::com::sun::star::awt; using namespace ::com::sun::star::accessibility; using namespace ::svt; + using namespace ::svt::table; //================================================================ //= IAccessibleFactory @@ -150,6 +153,12 @@ inline bool hasFloatingChild(Window *pWindow) IAccessibleTableProvider& _rBrowseBox ) const; + virtual IAccessibleTableControl* + createAccessibleTableControl( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent, + IAccessibleTable& _rTable + ) const; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > createAccessibleIconChoiceCtrl( SvtIconChoiceCtrl& _rIconCtrl, @@ -412,6 +421,13 @@ inline bool hasFloatingChild(Window *pWindow) } //-------------------------------------------------------------------- + IAccessibleTableControl* AccessibleFactory::createAccessibleTableControl( + const Reference< XAccessible >& _rxParent, IAccessibleTable& _rTable ) const + { + return new AccessibleGridControlAccess( _rxParent, _rTable ); + } + + //-------------------------------------------------------------------- Reference< XAccessible > AccessibleFactory::createAccessibleIconChoiceCtrl( SvtIconChoiceCtrl& _rIconCtrl, const Reference< XAccessible >& _xParent ) const { diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 4219d1d5b099..65be45907b90 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -4288,7 +4288,7 @@ BOOL StatementControl::HandleCommonMethods( Window *pControl ) Edit *pMyEd = new Edit(pDlg,WB_CENTER | WB_BORDER ); pMyEd->SetSizePixel(Size(100,30)); - pDlg->SetText(CUniString("Schlieen")); + pDlg->SetText(UniString("Schlieen", RTL_TEXTENCODING_ISO_8859_1)); pDlg->Show(); pMyEd->Show(); ULONG nTime = Time().GetTime(); diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index e068530459a8..d3937963c155 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -521,6 +521,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d abGP.Append( "20" ); // Linux ia64 #elif defined LINUX && defined S390 abGP.Append( "21" ); // Linux S390 +#elif defined LINUX && defined HPPA + abGP.Append( "22" ); // Linux PA-RISC #else #error ("unknown platform. please request an ID for your platform on qa/dev") #endif diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 27dce8dccc2f..644bd85bcb4d 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -944,6 +944,7 @@ BreakPointWindow::BreakPointWindow( Window* pParent ) : pModulWindow = 0; nCurYOffset = 0; setBackgroundColor(GetSettings().GetStyleSettings().GetFieldColor()); + m_bHighContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode(); nMarkerPos = MARKER_NOMARKER; // nCurYOffset merken und nicht von EditEngine holen. @@ -1161,6 +1162,7 @@ void BreakPointWindow::DataChanged(DataChangedEvent const & rDCEvt) != rDCEvt.GetOldSettings()->GetStyleSettings().GetFieldColor()) { setBackgroundColor(aColor); + m_bHighContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode(); Invalidate(); } } @@ -1169,7 +1171,6 @@ void BreakPointWindow::DataChanged(DataChangedEvent const & rDCEvt) void BreakPointWindow::setBackgroundColor(Color aColor) { SetBackground(Wallpaper(aColor)); - m_bHighContrastMode = aColor.IsDark(); } diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index d89191803c9f..d33310b6e339 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -46,7 +46,7 @@ #include <ide_pch.hxx> -#include <vector>
+#include <vector> #include <basidesh.hrc> #include <baside3.hxx> #include <localizationmgr.hxx> @@ -64,7 +64,7 @@ #include <helpid.hrc> #include <bastype2.hxx> #include <svx/svdview.hxx> -#include <svx/unolingu.hxx>
+#include <svx/unolingu.hxx> #include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <comphelper/processfactory.hxx> @@ -75,7 +75,7 @@ #include <com/sun/star/script/XLibraryContainer2.hpp> #endif #include <svtools/ehdl.hxx> -#include <svtools/langtab.hxx>
+#include <svtools/langtab.hxx> #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> @@ -641,10 +641,10 @@ void __EXPORT DialogWindow::ExecuteCommand( SfxRequest& rReq ) case SID_EXPORT_DIALOG: SaveDialog(); break; -
- case SID_IMPORT_DIALOG:
- ImportDialog();
- break;
+ + case SID_IMPORT_DIALOG: + ImportDialog(); + break; } rReq.Done(); @@ -866,406 +866,406 @@ BOOL DialogWindow::SaveDialog() return bDone; } -extern bool localesAreEqual( const ::com::sun::star::lang::Locale& rLocaleLeft,
- const ::com::sun::star::lang::Locale& rLocaleRight );
- -std::vector< lang::Locale > implGetLanguagesOnlyContainedInFirstSeq
- ( Sequence< lang::Locale > aFirstSeq, Sequence< lang::Locale > aSecondSeq )
-{
- std::vector< lang::Locale > avRet;
-
- const lang::Locale* pFirst = aFirstSeq.getConstArray();
- const lang::Locale* pSecond = aSecondSeq.getConstArray();
- sal_Int32 nFirstCount = aFirstSeq.getLength();
- sal_Int32 nSecondCount = aSecondSeq.getLength();
-
- for( sal_Int32 iFirst = 0 ; iFirst < nFirstCount ; iFirst++ )
- {
- const lang::Locale& rFirstLocale = pFirst[ iFirst ];
-
- bool bAlsoContainedInSecondSeq = false;
- for( sal_Int32 iSecond = 0 ; iSecond < nSecondCount ; iSecond++ )
- {
- const lang::Locale& rSecondLocale = pSecond[ iSecond ];
-
- bool bMatch = localesAreEqual( rFirstLocale, rSecondLocale );
- if( bMatch )
- {
- bAlsoContainedInSecondSeq = true;
- break;
- }
- }
-
- if( !bAlsoContainedInSecondSeq )
- avRet.push_back( rFirstLocale );
- }
-
- return avRet;
-}
-
-
-class NameClashQueryBox : public MessBox
-{
-public:
- NameClashQueryBox( Window* pParent,
- const XubString& rTitle, const XubString& rMessage );
-};
-
-NameClashQueryBox::NameClashQueryBox( Window* pParent,
- const XubString& rTitle, const XubString& rMessage )
- : MessBox( pParent, 0, rTitle, rMessage )
-{
- if ( rTitle.Len() )
- SetText( rTitle );
-
- maMessText = rMessage;
-
- AddButton( String( IDEResId( RID_STR_DLGIMP_CLASH_RENAME ) ), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( String( IDEResId( RID_STR_DLGIMP_CLASH_REPLACE ) ), RET_NO, 0 );
- AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
-
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
- QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
-}
-
-
-class LanguageMismatchQueryBox : public MessBox
-{
-public:
- LanguageMismatchQueryBox( Window* pParent,
- const XubString& rTitle, const XubString& rMessage );
-};
-
-LanguageMismatchQueryBox::LanguageMismatchQueryBox( Window* pParent,
- const XubString& rTitle, const XubString& rMessage )
- : MessBox( pParent, 0, rTitle, rMessage )
-{
- if ( rTitle.Len() )
- SetText( rTitle );
-
- maMessText = rMessage;
- AddButton( String( IDEResId( RID_STR_DLGIMP_MISMATCH_ADD ) ), RET_YES,
- BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
- AddButton( String( IDEResId( RID_STR_DLGIMP_MISMATCH_OMIT ) ), RET_NO, 0 );
- AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
- AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
-
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
- QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
-}
-
-BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName )
-{
- BOOL bDone = FALSE;
-
- Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
- Reference < XFilePicker > xFP;
- if( xMSF.is() )
- {
- Sequence <Any> aServiceType(1);
- aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
- xFP = Reference< XFilePicker >( xMSF->createInstanceWithArguments(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aServiceType ), UNO_QUERY );
- }
-
- Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY);
- xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, sal_False);
- Any aValue;
- aValue <<= (sal_Bool) sal_True;
- xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
-
- String aCurPath( rCurPath );
- if ( aCurPath.Len() )
- xFP->setDisplayDirectory ( aCurPath );
-
- String aDialogStr( IDEResId( RID_STR_STDDIALOGNAME ) );
- Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
- xFltMgr->appendFilter( aDialogStr, String( RTL_CONSTASCII_USTRINGPARAM( "*.xdl" ) ) );
- xFltMgr->appendFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
- xFltMgr->setCurrentFilter( aDialogStr );
-
- if( xFP->execute() == RET_OK )
- {
- Sequence< ::rtl::OUString > aPaths = xFP->getFiles();
- aCurPath = aPaths[0];
-
- ::rtl::OUString aBasePath;
- ::rtl::OUString aOUCurPath( aCurPath );
- sal_Int32 iSlash = aOUCurPath.lastIndexOf( '/' );
- if( iSlash != -1 )
- aBasePath = aOUCurPath.copy( 0, iSlash + 1 );
-
- try
- {
- // create dialog model
- Reference< container::XNameContainer > xDialogModel( xMSF->createInstance
- ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ) ), UNO_QUERY_THROW );
-
- Reference< XSimpleFileAccess > xSFI( xMSF->createInstance
- ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW );
-
- Reference< XInputStream > xInput;
- if( xSFI->exists( aCurPath ) )
- xInput = xSFI->openFileRead( aCurPath );
-
- Reference< XComponentContext > xContext;
- Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
- OSL_ASSERT( xProps.is() );
- OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
-
- String aXmlDlgName;
- Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
- if( xDialogModelPropSet.is() )
- {
- try
- {
- Any aXmlDialogNameAny = xDialogModelPropSet->getPropertyValue( DLGED_PROP_NAME );
- ::rtl::OUString aOUXmlDialogName;
- aXmlDialogNameAny >>= aOUXmlDialogName;
- aXmlDlgName = aOUXmlDialogName;
- }
- catch( beans::UnknownPropertyException& )
- {}
- }
- bool bValidName = (aXmlDlgName.Len() != 0);
- OSL_ASSERT( bValidName );
- if( !bValidName )
- return bDone;
-
- bool bDialogAlreadyExists = rDocument.hasDialog( aLibName, aXmlDlgName );
-
- String aNewDlgName = aXmlDlgName;
- enum NameClashMode
- {
- NO_CLASH,
- CLASH_OVERWRITE_DIALOG,
- CLASH_RENAME_DIALOG,
- };
- NameClashMode eNameClashMode = NO_CLASH;
- if( bDialogAlreadyExists )
- {
- String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_CLASH_TITLE ) );
- String aQueryBoxText( IDEResId( RID_STR_DLGIMP_CLASH_TEXT ) );
- aQueryBoxText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "$(ARG1)" ) ), aXmlDlgName );
-
- NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
- USHORT nRet = aQueryBox.Execute();
- if( RET_YES == nRet )
- {
- // RET_YES == Rename, see NameClashQueryBox::NameClashQueryBox
- eNameClashMode = CLASH_RENAME_DIALOG;
-
- aNewDlgName = rDocument.createObjectName( E_DIALOGS, aLibName );
- }
- else if( RET_NO == nRet )
- {
- // RET_NO == Replace, see NameClashQueryBox::NameClashQueryBox
- eNameClashMode = CLASH_OVERWRITE_DIALOG;
- }
- else if( RET_CANCEL == nRet )
- {
- return bDone;
- }
- }
-
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
- if( pIDEShell == NULL )
- {
- OSL_ASSERT( pIDEShell != NULL );
- return bDone;
- }
-
- // Resource?
- ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- Reference< task::XInteractionHandler > xDummyHandler;
- bool bReadOnly = true;
- Reference< XStringResourceWithLocation > xImportStringResource =
- StringResourceWithLocation::create( xContext, aBasePath, bReadOnly,
- aLocale, aXmlDlgName, ::rtl::OUString(), xDummyHandler );
-
- Sequence< lang::Locale > aImportLocaleSeq = xImportStringResource->getLocales();
- sal_Int32 nImportLocaleCount = aImportLocaleSeq.getLength();
-
- Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, TRUE ) );
- Reference< resource::XStringResourceManager > xLibStringResourceManager = LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
- sal_Int32 nLibLocaleCount = 0;
- Sequence< lang::Locale > aLibLocaleSeq;
- if( xLibStringResourceManager.is() )
- {
- aLibLocaleSeq = xLibStringResourceManager->getLocales();
- nLibLocaleCount = aLibLocaleSeq.getLength();
- }
-
- // Check language matches
- std::vector< lang::Locale > aOnlyInImportLanguages =
- implGetLanguagesOnlyContainedInFirstSeq( aImportLocaleSeq, aLibLocaleSeq );
- int nOnlyInImportLanguageCount = aOnlyInImportLanguages.size();
-
- // For now: Keep languages from lib
- bool bLibLocalized = (nLibLocaleCount > 0);
- bool bImportLocalized = (nImportLocaleCount > 0);
-
- bool bAddDialogLanguagesToLib = false;
- if( nOnlyInImportLanguageCount > 0 )
- {
- String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_MISMATCH_TITLE ) );
- String aQueryBoxText( IDEResId( RID_STR_DLGIMP_MISMATCH_TEXT ) );
- LanguageMismatchQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
- USHORT nRet = aQueryBox.Execute();
- if( RET_YES == nRet )
- {
- // RET_YES == Add, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
- bAddDialogLanguagesToLib = true;
- }
- // RET_NO == Omit, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
- // -> nothing to do here
- //else if( RET_NO == nRet )
- //{
- //}
- else if( RET_CANCEL == nRet )
- {
- return bDone;
- }
- }
-
- if( bImportLocalized )
- {
- bool bCopyResourcesForDialog = true;
- if( bAddDialogLanguagesToLib )
- {
- LocalizationMgr* pCurMgr = pIDEShell->GetCurLocalizationMgr();
-
- lang::Locale aFirstLocale;
- aFirstLocale = aOnlyInImportLanguages[0];
- if( nOnlyInImportLanguageCount > 1 )
- {
- // Check if import default belongs to only import languages and use it then
- lang::Locale aImportDefaultLocale = xImportStringResource->getDefaultLocale();
- lang::Locale aTmpLocale;
- for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i )
- {
- aTmpLocale = aOnlyInImportLanguages[i];
- if( localesAreEqual( aImportDefaultLocale, aTmpLocale ) )
- {
- aFirstLocale = aImportDefaultLocale;
- break;
- }
- }
- }
-
- Sequence< lang::Locale > aFirstLocaleSeq( 1 );
- aFirstLocaleSeq[0] = aFirstLocale;
- pCurMgr->handleAddLocales( aFirstLocaleSeq );
-
- if( nOnlyInImportLanguageCount > 1 )
- {
- Sequence< lang::Locale > aRemainingLocaleSeq( nOnlyInImportLanguageCount - 1 );
- lang::Locale aTmpLocale;
- int iSeq = 0;
- for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i )
- {
- aTmpLocale = aOnlyInImportLanguages[i];
- if( !localesAreEqual( aFirstLocale, aTmpLocale ) )
- aRemainingLocaleSeq[iSeq++] = aTmpLocale;
- }
- pCurMgr->handleAddLocales( aRemainingLocaleSeq );
- }
- }
- else if( !bLibLocalized )
- {
- Reference< resource::XStringResourceManager > xImportStringResourceManager( xImportStringResource, UNO_QUERY );
- LocalizationMgr::resetResourceForDialog( xDialogModel, xImportStringResourceManager );
- bCopyResourcesForDialog = false;
- }
-
- if( bCopyResourcesForDialog )
- {
- Reference< resource::XStringResourceResolver > xImportStringResourceResolver( xImportStringResource, UNO_QUERY );
- LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, aXmlDlgName,
- xLibStringResourceManager, xImportStringResourceResolver );
- }
- }
- else if( bLibLocalized )
- {
- LocalizationMgr::setResourceIDsForDialog( xDialogModel, xLibStringResourceManager );
- }
-
-
- LocalizationMgr::setStringResourceAtDialog( rDocument, aLibName, aNewDlgName, xDialogModel );
-
- if( eNameClashMode == CLASH_OVERWRITE_DIALOG )
- {
- if ( BasicIDE::RemoveDialog( rDocument, aLibName, aNewDlgName ) )
- {
- IDEBaseWindow* pDlgWin = pIDEShell->FindDlgWin( rDocument, aLibName, aNewDlgName, FALSE, TRUE );
- if( pDlgWin != NULL )
- pIDEShell->RemoveWindow( pDlgWin, TRUE );
- BasicIDE::MarkDocumentModified( rDocument );
- }
- else
- {
- // TODO: Assertion?
- return bDone;
- }
- }
-
- if( eNameClashMode == CLASH_RENAME_DIALOG )
- {
- bool bRenamed = false;
- if( xDialogModelPropSet.is() )
- {
- try
- {
- Any aXmlDialogNameAny;
- aXmlDialogNameAny <<= ::rtl::OUString( aNewDlgName );
- xDialogModelPropSet->setPropertyValue( DLGED_PROP_NAME, aXmlDialogNameAny );
- bRenamed = true;
- }
- catch( beans::UnknownPropertyException& )
- {}
- }
-
-
- if( bRenamed )
- {
- LocalizationMgr::renameStringResourceIDs( rDocument, aLibName, aNewDlgName, xDialogModel );
- }
- else
- {
- // TODO: Assertion?
- return bDone;
- }
- }
-
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
- bool bSuccess = rDocument.insertDialog( aLibName, aNewDlgName, xISP );
- if( bSuccess )
- {
- DialogWindow* pNewDlgWin = pIDEShell->CreateDlgWin( rDocument, aLibName, aNewDlgName );
- pIDEShell->SetCurWindow( pNewDlgWin, TRUE );
- }
-
- bDone = TRUE;
- }
- catch( Exception& )
- {}
- }
-
- return bDone;
-}
-
-BOOL DialogWindow::ImportDialog()
-{
- DBG_CHKTHIS( DialogWindow, 0 );
-
- const ScriptDocument& rDocument = GetDocument();
- String aLibName = GetLibName();
- BOOL bRet = implImportDialog( this, aCurPath, rDocument, aLibName );
- return bRet;
-}
-
+extern bool localesAreEqual( const ::com::sun::star::lang::Locale& rLocaleLeft, + const ::com::sun::star::lang::Locale& rLocaleRight ); + +std::vector< lang::Locale > implGetLanguagesOnlyContainedInFirstSeq + ( Sequence< lang::Locale > aFirstSeq, Sequence< lang::Locale > aSecondSeq ) +{ + std::vector< lang::Locale > avRet; + + const lang::Locale* pFirst = aFirstSeq.getConstArray(); + const lang::Locale* pSecond = aSecondSeq.getConstArray(); + sal_Int32 nFirstCount = aFirstSeq.getLength(); + sal_Int32 nSecondCount = aSecondSeq.getLength(); + + for( sal_Int32 iFirst = 0 ; iFirst < nFirstCount ; iFirst++ ) + { + const lang::Locale& rFirstLocale = pFirst[ iFirst ]; + + bool bAlsoContainedInSecondSeq = false; + for( sal_Int32 iSecond = 0 ; iSecond < nSecondCount ; iSecond++ ) + { + const lang::Locale& rSecondLocale = pSecond[ iSecond ]; + + bool bMatch = localesAreEqual( rFirstLocale, rSecondLocale ); + if( bMatch ) + { + bAlsoContainedInSecondSeq = true; + break; + } + } + + if( !bAlsoContainedInSecondSeq ) + avRet.push_back( rFirstLocale ); + } + + return avRet; +} + + +class NameClashQueryBox : public MessBox +{ +public: + NameClashQueryBox( Window* pParent, + const XubString& rTitle, const XubString& rMessage ); +}; + +NameClashQueryBox::NameClashQueryBox( Window* pParent, + const XubString& rTitle, const XubString& rMessage ) + : MessBox( pParent, 0, rTitle, rMessage ) +{ + if ( rTitle.Len() ) + SetText( rTitle ); + + maMessText = rMessage; + + AddButton( String( IDEResId( RID_STR_DLGIMP_CLASH_RENAME ) ), RET_YES, + BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); + AddButton( String( IDEResId( RID_STR_DLGIMP_CLASH_REPLACE ) ), RET_NO, 0 ); + AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + + SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? + QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() ); +} + + +class LanguageMismatchQueryBox : public MessBox +{ +public: + LanguageMismatchQueryBox( Window* pParent, + const XubString& rTitle, const XubString& rMessage ); +}; + +LanguageMismatchQueryBox::LanguageMismatchQueryBox( Window* pParent, + const XubString& rTitle, const XubString& rMessage ) + : MessBox( pParent, 0, rTitle, rMessage ) +{ + if ( rTitle.Len() ) + SetText( rTitle ); + + maMessText = rMessage; + AddButton( String( IDEResId( RID_STR_DLGIMP_MISMATCH_ADD ) ), RET_YES, + BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); + AddButton( String( IDEResId( RID_STR_DLGIMP_MISMATCH_OMIT ) ), RET_NO, 0 ); + AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 4 ); + + SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? + QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() ); +} + +BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName ) +{ + BOOL bDone = FALSE; + + Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() ); + Reference < XFilePicker > xFP; + if( xMSF.is() ) + { + Sequence <Any> aServiceType(1); + aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE; + xFP = Reference< XFilePicker >( xMSF->createInstanceWithArguments( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aServiceType ), UNO_QUERY ); + } + + Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY); + xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, sal_False); + Any aValue; + aValue <<= (sal_Bool) sal_True; + xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue); + + String aCurPath( rCurPath ); + if ( aCurPath.Len() ) + xFP->setDisplayDirectory ( aCurPath ); + + String aDialogStr( IDEResId( RID_STR_STDDIALOGNAME ) ); + Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY); + xFltMgr->appendFilter( aDialogStr, String( RTL_CONSTASCII_USTRINGPARAM( "*.xdl" ) ) ); + xFltMgr->appendFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) ); + xFltMgr->setCurrentFilter( aDialogStr ); + + if( xFP->execute() == RET_OK ) + { + Sequence< ::rtl::OUString > aPaths = xFP->getFiles(); + aCurPath = aPaths[0]; + + ::rtl::OUString aBasePath; + ::rtl::OUString aOUCurPath( aCurPath ); + sal_Int32 iSlash = aOUCurPath.lastIndexOf( '/' ); + if( iSlash != -1 ) + aBasePath = aOUCurPath.copy( 0, iSlash + 1 ); + + try + { + // create dialog model + Reference< container::XNameContainer > xDialogModel( xMSF->createInstance + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ) ), UNO_QUERY_THROW ); + + Reference< XSimpleFileAccess > xSFI( xMSF->createInstance + ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW ); + + Reference< XInputStream > xInput; + if( xSFI->exists( aCurPath ) ) + xInput = xSFI->openFileRead( aCurPath ); + + Reference< XComponentContext > xContext; + Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY ); + OSL_ASSERT( xProps.is() ); + OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext ); + ::xmlscript::importDialogModel( xInput, xDialogModel, xContext ); + + String aXmlDlgName; + Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY ); + if( xDialogModelPropSet.is() ) + { + try + { + Any aXmlDialogNameAny = xDialogModelPropSet->getPropertyValue( DLGED_PROP_NAME ); + ::rtl::OUString aOUXmlDialogName; + aXmlDialogNameAny >>= aOUXmlDialogName; + aXmlDlgName = aOUXmlDialogName; + } + catch( beans::UnknownPropertyException& ) + {} + } + bool bValidName = (aXmlDlgName.Len() != 0); + OSL_ASSERT( bValidName ); + if( !bValidName ) + return bDone; + + bool bDialogAlreadyExists = rDocument.hasDialog( aLibName, aXmlDlgName ); + + String aNewDlgName = aXmlDlgName; + enum NameClashMode + { + NO_CLASH, + CLASH_OVERWRITE_DIALOG, + CLASH_RENAME_DIALOG, + }; + NameClashMode eNameClashMode = NO_CLASH; + if( bDialogAlreadyExists ) + { + String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_CLASH_TITLE ) ); + String aQueryBoxText( IDEResId( RID_STR_DLGIMP_CLASH_TEXT ) ); + aQueryBoxText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "$(ARG1)" ) ), aXmlDlgName ); + + NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText ); + USHORT nRet = aQueryBox.Execute(); + if( RET_YES == nRet ) + { + // RET_YES == Rename, see NameClashQueryBox::NameClashQueryBox + eNameClashMode = CLASH_RENAME_DIALOG; + + aNewDlgName = rDocument.createObjectName( E_DIALOGS, aLibName ); + } + else if( RET_NO == nRet ) + { + // RET_NO == Replace, see NameClashQueryBox::NameClashQueryBox + eNameClashMode = CLASH_OVERWRITE_DIALOG; + } + else if( RET_CANCEL == nRet ) + { + return bDone; + } + } + + BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); + if( pIDEShell == NULL ) + { + OSL_ASSERT( pIDEShell != NULL ); + return bDone; + } + + // Resource? + ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale(); + Reference< task::XInteractionHandler > xDummyHandler; + bool bReadOnly = true; + Reference< XStringResourceWithLocation > xImportStringResource = + StringResourceWithLocation::create( xContext, aBasePath, bReadOnly, + aLocale, aXmlDlgName, ::rtl::OUString(), xDummyHandler ); + + Sequence< lang::Locale > aImportLocaleSeq = xImportStringResource->getLocales(); + sal_Int32 nImportLocaleCount = aImportLocaleSeq.getLength(); + + Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, TRUE ) ); + Reference< resource::XStringResourceManager > xLibStringResourceManager = LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib ); + sal_Int32 nLibLocaleCount = 0; + Sequence< lang::Locale > aLibLocaleSeq; + if( xLibStringResourceManager.is() ) + { + aLibLocaleSeq = xLibStringResourceManager->getLocales(); + nLibLocaleCount = aLibLocaleSeq.getLength(); + } + + // Check language matches + std::vector< lang::Locale > aOnlyInImportLanguages = + implGetLanguagesOnlyContainedInFirstSeq( aImportLocaleSeq, aLibLocaleSeq ); + int nOnlyInImportLanguageCount = aOnlyInImportLanguages.size(); + + // For now: Keep languages from lib + bool bLibLocalized = (nLibLocaleCount > 0); + bool bImportLocalized = (nImportLocaleCount > 0); + + bool bAddDialogLanguagesToLib = false; + if( nOnlyInImportLanguageCount > 0 ) + { + String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_MISMATCH_TITLE ) ); + String aQueryBoxText( IDEResId( RID_STR_DLGIMP_MISMATCH_TEXT ) ); + LanguageMismatchQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText ); + USHORT nRet = aQueryBox.Execute(); + if( RET_YES == nRet ) + { + // RET_YES == Add, see LanguageMismatchQueryBox::LanguageMismatchQueryBox + bAddDialogLanguagesToLib = true; + } + // RET_NO == Omit, see LanguageMismatchQueryBox::LanguageMismatchQueryBox + // -> nothing to do here + //else if( RET_NO == nRet ) + //{ + //} + else if( RET_CANCEL == nRet ) + { + return bDone; + } + } + + if( bImportLocalized ) + { + bool bCopyResourcesForDialog = true; + if( bAddDialogLanguagesToLib ) + { + LocalizationMgr* pCurMgr = pIDEShell->GetCurLocalizationMgr(); + + lang::Locale aFirstLocale; + aFirstLocale = aOnlyInImportLanguages[0]; + if( nOnlyInImportLanguageCount > 1 ) + { + // Check if import default belongs to only import languages and use it then + lang::Locale aImportDefaultLocale = xImportStringResource->getDefaultLocale(); + lang::Locale aTmpLocale; + for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i ) + { + aTmpLocale = aOnlyInImportLanguages[i]; + if( localesAreEqual( aImportDefaultLocale, aTmpLocale ) ) + { + aFirstLocale = aImportDefaultLocale; + break; + } + } + } + + Sequence< lang::Locale > aFirstLocaleSeq( 1 ); + aFirstLocaleSeq[0] = aFirstLocale; + pCurMgr->handleAddLocales( aFirstLocaleSeq ); + + if( nOnlyInImportLanguageCount > 1 ) + { + Sequence< lang::Locale > aRemainingLocaleSeq( nOnlyInImportLanguageCount - 1 ); + lang::Locale aTmpLocale; + int iSeq = 0; + for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i ) + { + aTmpLocale = aOnlyInImportLanguages[i]; + if( !localesAreEqual( aFirstLocale, aTmpLocale ) ) + aRemainingLocaleSeq[iSeq++] = aTmpLocale; + } + pCurMgr->handleAddLocales( aRemainingLocaleSeq ); + } + } + else if( !bLibLocalized ) + { + Reference< resource::XStringResourceManager > xImportStringResourceManager( xImportStringResource, UNO_QUERY ); + LocalizationMgr::resetResourceForDialog( xDialogModel, xImportStringResourceManager ); + bCopyResourcesForDialog = false; + } + + if( bCopyResourcesForDialog ) + { + Reference< resource::XStringResourceResolver > xImportStringResourceResolver( xImportStringResource, UNO_QUERY ); + LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, aXmlDlgName, + xLibStringResourceManager, xImportStringResourceResolver ); + } + } + else if( bLibLocalized ) + { + LocalizationMgr::setResourceIDsForDialog( xDialogModel, xLibStringResourceManager ); + } + + + LocalizationMgr::setStringResourceAtDialog( rDocument, aLibName, aNewDlgName, xDialogModel ); + + if( eNameClashMode == CLASH_OVERWRITE_DIALOG ) + { + if ( BasicIDE::RemoveDialog( rDocument, aLibName, aNewDlgName ) ) + { + IDEBaseWindow* pDlgWin = pIDEShell->FindDlgWin( rDocument, aLibName, aNewDlgName, FALSE, TRUE ); + if( pDlgWin != NULL ) + pIDEShell->RemoveWindow( pDlgWin, TRUE ); + BasicIDE::MarkDocumentModified( rDocument ); + } + else + { + // TODO: Assertion? + return bDone; + } + } + + if( eNameClashMode == CLASH_RENAME_DIALOG ) + { + bool bRenamed = false; + if( xDialogModelPropSet.is() ) + { + try + { + Any aXmlDialogNameAny; + aXmlDialogNameAny <<= ::rtl::OUString( aNewDlgName ); + xDialogModelPropSet->setPropertyValue( DLGED_PROP_NAME, aXmlDialogNameAny ); + bRenamed = true; + } + catch( beans::UnknownPropertyException& ) + {} + } + + + if( bRenamed ) + { + LocalizationMgr::renameStringResourceIDs( rDocument, aLibName, aNewDlgName, xDialogModel ); + } + else + { + // TODO: Assertion? + return bDone; + } + } + + Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext ); + bool bSuccess = rDocument.insertDialog( aLibName, aNewDlgName, xISP ); + if( bSuccess ) + { + DialogWindow* pNewDlgWin = pIDEShell->CreateDlgWin( rDocument, aLibName, aNewDlgName ); + pIDEShell->SetCurWindow( pNewDlgWin, TRUE ); + } + + bDone = TRUE; + } + catch( Exception& ) + {} + } + + return bDone; +} + +BOOL DialogWindow::ImportDialog() +{ + DBG_CHKTHIS( DialogWindow, 0 ); + + const ScriptDocument& rDocument = GetDocument(); + String aLibName = GetLibName(); + BOOL bRet = implImportDialog( this, aCurPath, rDocument, aLibName ); + return bRet; +} + DlgEdModel* DialogWindow::GetModel() const { return pEditor ? pEditor->GetModel() : NULL; diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx index 55bc15810a2b..d71f1b2929d7 100644 --- a/basctl/source/basicide/objdlg.cxx +++ b/basctl/source/basicide/objdlg.cxx @@ -300,7 +300,7 @@ void ObjectCatalogToolBox_Impl::DataChanged(DataChangedEvent const & rDCEvt) void ObjectCatalogToolBox_Impl::setImages() { - bool bHC = GetDisplayBackground().GetColor().IsDark(); + bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); if (bHC != m_bHighContrast) { SetImageList(bHC ? m_aImagesHighContrast : m_aImagesNormal); diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx index e2af9e0346a1..3ebc749c30aa 100644 --- a/basctl/source/basicide/tbxctl.cxx +++ b/basctl/source/basicide/tbxctl.cxx @@ -186,7 +186,7 @@ void TbxControls::StateChanged( USHORT nSID, SfxItemState eState, Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages(), - GetToolBox().GetDisplayBackground().GetColor().IsDark() ); + GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode() ); ToolBox& rBox = GetToolBox(); rBox.SetItemImage(GetId(), aImage); nLastSlot = nLastEnum; diff --git a/extensions/inc/abpilot.hrc b/extensions/inc/abpilot.hrc new file mode 100644 index 000000000000..bac5dc33d5d1 --- /dev/null +++ b/extensions/inc/abpilot.hrc @@ -0,0 +1,44 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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 EXTENSIONS_ABPILOT_HRC
+#define EXTENSIONS_ABPILOT_HRC
+
+#include "extensio.hrc"
+
+#define HID_ABSPILOT_PREVIOUS ( HID_ABP_START + 0) +#define HID_ABSPILOT_NEXT ( HID_ABP_START + 1) +#define HID_ABSPILOT_CANCEL ( HID_ABP_START + 2) +#define HID_ABSPILOT_FINISH ( HID_ABP_START + 3) +#define UID_ABSPILOT_HELP ( HID_ABP_START + 4) +#define HID_ABSPILOT ( HID_ABP_START + 5) + // !! if you add new IDs, please also adjust HID_ABP_LAST below !! +#define HID_ABP_LAST HID_ABSPILOT + +#if HID_ABP_LAST > HID_ABP_END + #error help id range overflow (ABP) +#endif + +#endif // EXTENSIONS_ABPILOT_HRC diff --git a/extensions/inc/bibliography.hrc b/extensions/inc/bibliography.hrc new file mode 100644 index 000000000000..7275598bf377 --- /dev/null +++ b/extensions/inc/bibliography.hrc @@ -0,0 +1,85 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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 EXTENSIONS_BIBLIOGRAPHY_HRC
+#define EXTENSIONS_BIBLIOGRAPHY_HRC
+
+#include "extensio.hrc"
+
+#define HID_BIB_CHANGESOURCE ( HID_BIBLIO_START + 0) +#define HID_BIB_MAPPINGDLG ( HID_BIBLIO_START + 1) +#define HID_BIB_TBX_TABLE ( HID_BIBLIO_START + 2) +#define HID_BIB_TBX_SEARCH ( HID_BIBLIO_START + 3) +#define HID_BIB_TBX_AUTOFILTER ( HID_BIBLIO_START + 4) +#define HID_BIB_IDENTIFIER_POS ( HID_BIBLIO_START + 5) +#define HID_BIB_AUTHORITYTYPE_POS ( HID_BIBLIO_START + 6) +#define HID_BIB_AUTHOR_POS ( HID_BIBLIO_START + 7) +#define HID_BIB_TITLE_POS ( HID_BIBLIO_START + 8) +#define HID_BIB_YEAR_POS ( HID_BIBLIO_START + 9) +#define HID_BIB_ISBN_POS ( HID_BIBLIO_START + 10) +#define HID_BIB_BOOKTITLE_POS ( HID_BIBLIO_START + 11) +#define HID_BIB_CHAPTER_POS ( HID_BIBLIO_START + 12) +#define HID_BIB_EDITION_POS ( HID_BIBLIO_START + 13) +#define HID_BIB_EDITOR_POS ( HID_BIBLIO_START + 14) +#define HID_BIB_HOWPUBLISHED_POS ( HID_BIBLIO_START + 15) +#define HID_BIB_INSTITUTION_POS ( HID_BIBLIO_START + 16) +#define HID_BIB_JOURNAL_POS ( HID_BIBLIO_START + 17) +#define HID_BIB_MONTH_POS ( HID_BIBLIO_START + 18) +#define HID_BIB_NOTE_POS ( HID_BIBLIO_START + 19) +#define HID_BIB_ANNOTE_POS ( HID_BIBLIO_START + 20) +#define HID_BIB_NUMBER_POS ( HID_BIBLIO_START + 21) +#define HID_BIB_ORGANIZATIONS_POS ( HID_BIBLIO_START + 22) +#define HID_BIB_PAGES_POS ( HID_BIBLIO_START + 23) +#define HID_BIB_PUBLISHER_POS ( HID_BIBLIO_START + 24) +#define HID_BIB_ADDRESS_POS ( HID_BIBLIO_START + 25) +#define HID_BIB_SCHOOL_POS ( HID_BIBLIO_START + 26) +#define HID_BIB_SERIES_POS ( HID_BIBLIO_START + 27) +#define HID_BIB_REPORTTYPE_POS ( HID_BIBLIO_START + 28) +#define HID_BIB_VOLUME_POS ( HID_BIBLIO_START + 29) +#define HID_BIB_URL_POS ( HID_BIBLIO_START + 30) +#define HID_BIB_CUSTOM1_POS ( HID_BIBLIO_START + 31) +#define HID_BIB_CUSTOM2_POS ( HID_BIBLIO_START + 32) +#define HID_BIB_CUSTOM3_POS ( HID_BIBLIO_START + 33) +#define HID_BIB_CUSTOM4_POS ( HID_BIBLIO_START + 34) +#define HID_BIB_CUSTOM5_POS ( HID_BIBLIO_START + 35) +#define HID_BIB_DB_TBX ( HID_BIBLIO_START + 36) +#define HID_BIB_DB_GHIDCTRL ( HID_BIBLIO_START + 37) +#define HID_BIB_CONTROL_PAGE ( HID_BIBLIO_START + 38) +#define HID_BIB_CONTROL_PARENT ( HID_BIBLIO_START + 39) +#define UID_BIB_FRAME_WINDOW ( HID_BIBLIO_START + 40) +#define HID_BIB_DELETE_RECORD ( HID_BIBLIO_START + 41) +#define HID_BIB_INSERT_RECORD ( HID_BIBLIO_START + 42) +#define HID_BIB_DB_GRIDCTRL ( HID_BIBLIO_START + 43) +#define HID_DLG_MAPPING ( HID_BIBLIO_START + 44) +#define HID_DLG_DBCHANGE ( HID_BIBLIO_START + 45) +#define HID_SELECTION_TLB ( HID_BIBLIO_START + 46) + // !! if you add new IDs, please also adjust HID_ABP_LAST below !! +#define HID_BIB_LAST HID_SELECTION_TLB + +#if HID_BIB_LAST > HID_BIBLIO_END + #error help id range overflow (BIBLIO) +#endif + +#endif // EXTENSIONS_BIBLIOGRAPHY_HRC
diff --git a/extensions/inc/dbpilots.hrc b/extensions/inc/dbpilots.hrc new file mode 100644 index 000000000000..c111a99ddb46 --- /dev/null +++ b/extensions/inc/dbpilots.hrc @@ -0,0 +1,54 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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 EXTENSIONS_DBPILOT_HRC
+#define EXTENSIONS_DBPILOT_HRC
+
+#include "extensio.hrc"
+
+#define HID_GHIDWIZARD_PREVIOUS ( HID_DBP_START + 0) +#define HID_GHIDWIZARD_NEXT ( HID_DBP_START + 1) +#define HID_GHIDWIZARD_CANCEL ( HID_DBP_START + 2) +#define HID_GHIDWIZARD_FINISH ( HID_DBP_START + 3) +#define HID_GROUPWIZARD_PREVIOUS ( HID_DBP_START + 4) +#define HID_GROUPWIZARD_NEXT ( HID_DBP_START + 5) +#define HID_GROUPWIZARD_CANCEL ( HID_DBP_START + 6) +#define HID_GROUPWIZARD_FINISH ( HID_DBP_START + 7) +#define HID_LISTWIZARD_PREVIOUS ( HID_DBP_START + 8) +#define HID_LISTWIZARD_NEXT ( HID_DBP_START + 9) +#define HID_LISTWIZARD_CANCEL ( HID_DBP_START + 10) +#define HID_LISTWIZARD_FINISH ( HID_DBP_START + 11) +#define HID_GRIDWIZARD_PREVIOUS ( HID_DBP_START + 12) +#define HID_GRIDWIZARD_NEXT ( HID_DBP_START + 13) +#define HID_GRIDWIZARD_CANCEL ( HID_DBP_START + 14) +#define HID_GRIDWIZARD_FINISH ( HID_DBP_START + 15) + // !! if you add new IDs, please also adjust HID_ABP_LAST below !! +#define HID_DBP_LAST HID_GRIDWIZARD_FINISH + +#if HID_DBP_LAST > HID_DBP_END + #error help id range overflow (DBP) +#endif +
+#endif // EXTENSIONS_DBPILOT_HRC
diff --git a/extensions/inc/extensio.hrc b/extensions/inc/extensio.hrc index 6af1dc5b04fb..ee84e9a560f6 100644 --- a/extensions/inc/extensio.hrc +++ b/extensions/inc/extensio.hrc @@ -33,438 +33,46 @@ #include <svtools/solar.hrc> // ----------------------------------------------------------------------- -// - resource id areas +// - resource id ranges -#define RID_DBP_START ( RID_MORE_EXTENSIONS_START + 0 ) -#define RID_DBP_END ( RID_MORE_EXTENSIONS_START + 29 ) +#define RID_ABP_START ( RID_MORE_EXTENSIONS_START + 0 ) +#define RID_ABP_END ( RID_MORE_EXTENSIONS_START + 19 ) -#define RID_DBI_START ( RID_MORE_EXTENSIONS_START + 30 ) -#define RID_DBI_END ( RID_MORE_EXTENSIONS_START + 59 ) +#define RID_DBP_START ( RID_MORE_EXTENSIONS_START + 20 ) +#define RID_DBP_END ( RID_MORE_EXTENSIONS_START + 39 ) -#define RID_ABP_START ( RID_MORE_EXTENSIONS_START + 60 ) -#define RID_ABP_END ( RID_MORE_EXTENSIONS_START + 89 ) +// !!! please adjust RID_LAST_EXTENSIONS_RANGE if you add new ranges here !!! +#define RID_LAST_EXTENSIONS_RANGE RID_DBP_END -// ----------------------------------------------------------------------- -// - help ids - -#define HID_PROTOCOLS HID_EXTENSIONS_START - -#define HID_BIB_CHANGESOURCE (HID_EXTENSIONS_START + 1) -#define HID_BIB_MAPPINGDLG (HID_EXTENSIONS_START + 2) -#define HID_BIB_TBX_TABLE (HID_EXTENSIONS_START + 3) -#define HID_BIB_TBX_SEARCH (HID_EXTENSIONS_START + 4) -#define HID_BIB_TBX_AUTOFILTER (HID_EXTENSIONS_START + 5) - -#define HID_BIB_IDENTIFIER_POS (HID_EXTENSIONS_START + 6) -#define HID_BIB_AUTHORITYTYPE_POS (HID_EXTENSIONS_START + 7) -#define HID_BIB_AUTHOR_POS (HID_EXTENSIONS_START + 8) -#define HID_BIB_TITLE_POS (HID_EXTENSIONS_START + 9) -#define HID_BIB_YEAR_POS (HID_EXTENSIONS_START + 10) -#define HID_BIB_ISBN_POS (HID_EXTENSIONS_START + 11) -#define HID_BIB_BOOKTITLE_POS (HID_EXTENSIONS_START + 12) -#define HID_BIB_CHAPTER_POS (HID_EXTENSIONS_START + 13) -#define HID_BIB_EDITION_POS (HID_EXTENSIONS_START + 14) -#define HID_BIB_EDITOR_POS (HID_EXTENSIONS_START + 15) -#define HID_BIB_HOWPUBLISHED_POS (HID_EXTENSIONS_START + 16) -#define HID_BIB_INSTITUTION_POS (HID_EXTENSIONS_START + 17) -#define HID_BIB_JOURNAL_POS (HID_EXTENSIONS_START + 18) -#define HID_BIB_MONTH_POS (HID_EXTENSIONS_START + 19) -#define HID_BIB_NOTE_POS (HID_EXTENSIONS_START + 20) -#define HID_BIB_ANNOTE_POS (HID_EXTENSIONS_START + 21) -#define HID_BIB_NUMBER_POS (HID_EXTENSIONS_START + 22) -#define HID_BIB_ORGANIZATIONS_POS (HID_EXTENSIONS_START + 23) -#define HID_BIB_PAGES_POS (HID_EXTENSIONS_START + 24) -#define HID_BIB_PUBLISHER_POS (HID_EXTENSIONS_START + 25) -#define HID_BIB_ADDRESS_POS (HID_EXTENSIONS_START + 26) -#define HID_BIB_SCHOOL_POS (HID_EXTENSIONS_START + 27) -#define HID_BIB_SERIES_POS (HID_EXTENSIONS_START + 28) -#define HID_BIB_REPORTTYPE_POS (HID_EXTENSIONS_START + 29) -#define HID_BIB_VOLUME_POS (HID_EXTENSIONS_START + 30) -#define HID_BIB_URL_POS (HID_EXTENSIONS_START + 31) -#define HID_BIB_CUSTOM1_POS (HID_EXTENSIONS_START + 32) -#define HID_BIB_CUSTOM2_POS (HID_EXTENSIONS_START + 33) -#define HID_BIB_CUSTOM3_POS (HID_EXTENSIONS_START + 34) -#define HID_BIB_CUSTOM4_POS (HID_EXTENSIONS_START + 35) -#define HID_BIB_CUSTOM5_POS (HID_EXTENSIONS_START + 36) - -#define HID_BIB_DB_TBX (HID_EXTENSIONS_START + 37) -#define HID_BIB_DB_GRIDCTRL (HID_EXTENSIONS_START + 38) -#define HID_BIB_CONTROL_PAGE (HID_EXTENSIONS_START + 39) -#define HID_BIB_CONTROL_PARENT (HID_EXTENSIONS_START + 40) - -#define HID_GRIDWIZARD_PREVIOUS (HID_EXTENSIONS_START + 41) -#define HID_GRIDWIZARD_NEXT (HID_EXTENSIONS_START + 42) -#define HID_GRIDWIZARD_CANCEL (HID_EXTENSIONS_START + 43) -#define HID_GRIDWIZARD_FINISH (HID_EXTENSIONS_START + 44) -#define HID_GROUPWIZARD_PREVIOUS (HID_EXTENSIONS_START + 45) -#define HID_GROUPWIZARD_NEXT (HID_EXTENSIONS_START + 46) -#define HID_GROUPWIZARD_CANCEL (HID_EXTENSIONS_START + 47) -#define HID_GROUPWIZARD_FINISH (HID_EXTENSIONS_START + 48) -#define HID_LISTWIZARD_PREVIOUS (HID_EXTENSIONS_START + 49) -#define HID_LISTWIZARD_NEXT (HID_EXTENSIONS_START + 50) -#define HID_LISTWIZARD_CANCEL (HID_EXTENSIONS_START + 51) -#define HID_LISTWIZARD_FINISH (HID_EXTENSIONS_START + 52) -#define HID_DBIWIZARD_PREVIOUS (HID_EXTENSIONS_START + 53) -#define HID_DBIWIZARD_NEXT (HID_EXTENSIONS_START + 54) -#define HID_DBIWIZARD_CANCEL (HID_EXTENSIONS_START + 55) -#define HID_DBIWIZARD_FINISH (HID_EXTENSIONS_START + 56) -#define UID_DBIWIZARD_SOURCESTATS (HID_EXTENSIONS_START + 57) -#define UID_DBIWIZARD_SOURCEFILE (HID_EXTENSIONS_START + 58) -#define UID_DBIWIZARD_QUERIES (HID_EXTENSIONS_START + 59) -#define UID_DBIWIZARD_FORMS (HID_EXTENSIONS_START + 60) -#define UID_DBIWIZARD_FORMS_SAVETO (HID_EXTENSIONS_START + 61) - -#define UID_BIB_FRAME_WINDOW (HID_EXTENSIONS_START + 62) - -#define HID_ABSPILOT_PREVIOUS (HID_EXTENSIONS_START + 63) -#define HID_ABSPILOT_NEXT (HID_EXTENSIONS_START + 64) -#define HID_ABSPILOT_CANCEL (HID_EXTENSIONS_START + 65) -#define HID_ABSPILOT_FINISH (HID_EXTENSIONS_START + 66) -#define UID_ABSPILOT_HELP (HID_EXTENSIONS_START + 67) -#define HID_ABSPILOT (HID_EXTENSIONS_START + 68) - -#define HID_DBIWIZARD (HID_EXTENSIONS_START + 69) -#define UID_DBIWIZARD_HELP (HID_EXTENSIONS_START + 70) -#define HID_DBIWIZARD_FILESELECTION (HID_EXTENSIONS_START + 71) - -#define HID_BIB_DELETE_RECORD (HID_EXTENSIONS_START + 72) -#define HID_BIB_INSERT_RECORD (HID_EXTENSIONS_START + 73) +#if RID_LAST_EXTENSIONS_RANGE > RID_MORE_EXTENSIONS_END + #error id range overflow +#endif -#define HID_DLG_MAPPING (HID_EXTENSIONS_START + 74) -#define HID_DLG_DBCHANGE (HID_EXTENSIONS_START + 75) -#define HID_SELECTION_TLB (HID_EXTENSIONS_START + 76) +// ----------------------------------------------------------------------- +// - help id ranges -#define HID_CHECK_FOR_UPD_DLG (HID_EXTENSIONS_START + 77) -#define HID_CHECK_FOR_UPD_CLOSE (HID_EXTENSIONS_START + 78) -#define HID_CHECK_FOR_UPD_PAUSE (HID_EXTENSIONS_START + 80) -#define HID_CHECK_FOR_UPD_RESUME (HID_EXTENSIONS_START + 81) -#define HID_CHECK_FOR_UPD_DOWNLOAD (HID_EXTENSIONS_START + 82) -#define HID_CHECK_FOR_UPD_DOWNLOAD2 (HID_EXTENSIONS_START + 83) -#define HID_CHECK_FOR_UPD_INSTALL (HID_EXTENSIONS_START + 84) -#define HID_CHECK_FOR_UPD_STATUS (HID_EXTENSIONS_START + 85) -#define HID_CHECK_FOR_UPD_DESCRIPTION (HID_EXTENSIONS_START + 86) -#define HID_CHECK_FOR_UPD_CANCEL (HID_EXTENSIONS_START + 87) +#define HID_DBP_START ( HID_EXTENSIONS_START + 0 ) +#define HID_DBP_END ( HID_EXTENSIONS_START + 19 ) -// please adjust HID_LAST_EXTENSIONS_ID if you add new ids here! -// you probably have to insert your new helpid into util/hidother.hrc, too! +#define HID_ABP_START ( HID_EXTENSIONS_START + 20 ) +#define HID_ABP_END ( HID_EXTENSIONS_START + 39 ) -#define HID_LAST_EXTENSIONS_ID HID_CHECK_FOR_UPD_CANCEL +#define HID_BIBLIO_START ( HID_EXTENSIONS_START + 40 ) +#define HID_BIBLIO_END ( HID_EXTENSIONS_START + 89 ) -#if HID_LAST_EXTENSIONS_ID > HID_EXTENSIONS_END - #error id overflow -#endif +#define HID_PROPC_START ( HID_EXTENSIONS_START + 90 ) +#define HID_PROPC_END ( HID_EXTENSIONS_START + 499 ) -//----------------------------------------------------------------------- - // FREE -#define HID_PROP_INPUT_REQUIRED (HID_FORMS_START + 1) -#define HID_PROP_GROUPBOX (HID_FORMS_START + 2) -#define HID_PROP_CONTROLSOURCE (HID_FORMS_START + 3) -#define HID_PROP_NAME (HID_FORMS_START + 4) -#define HID_PROP_TABINDEX (HID_FORMS_START + 5) -#define HID_PROP_MASTERFIELDS (HID_FORMS_START + 6) -#define HID_PROP_SLAVEFIELDS (HID_FORMS_START + 7) -#define HID_PROP_DATASOURCE (HID_FORMS_START + 8) -#define HID_PROP_CURSORSOURCE (HID_FORMS_START + 9) -#define HID_PROP_CURSORSOURCETYPE (HID_FORMS_START + 10) -#define HID_PROP_CURSORTYPE (HID_FORMS_START + 11) -#define HID_PROP_READONLY (HID_FORMS_START + 12) -#define HID_PROP_DATAENTRY (HID_FORMS_START + 13) -#define HID_PROP_NAVIGATION (HID_FORMS_START + 14) -#define HID_PROP_CYCLE (HID_FORMS_START + 15) -#define HID_PROP_ALLOW_ADDITIONS (HID_FORMS_START + 16) -#define HID_PROP_ALLOW_EDITS (HID_FORMS_START + 17) -#define HID_PROP_ALLOW_DELETIONS (HID_FORMS_START + 18) -#define HID_PROP_DIRTY (HID_FORMS_START + 19) -#define HID_PROP_OLDVALUE (HID_FORMS_START + 20) -#define HID_PROP_VALUE (HID_FORMS_START + 21) -#define HID_PROP_LOCKED (HID_FORMS_START + 22) -#define HID_PROP_FORMATKEY (HID_FORMS_START + 23) -#define HID_PROP_REQUIRED (HID_FORMS_START + 24) -#define HID_PROP_WHEEL_BEHAVIOR (HID_FORMS_START + 25) - // FREE -#define HID_PROP_UNIQUE (HID_FORMS_START + 27) -#define HID_PROP_CLASSID (HID_FORMS_START + 28) -#define HID_PROP_LEFT (HID_FORMS_START + 29) -#define HID_PROP_RIGHT (HID_FORMS_START + 30) -#define HID_PROP_HEIGHT (HID_FORMS_START + 31) -#define HID_PROP_WIDTH (HID_FORMS_START + 32) -#define HID_PROP_BOUNDCOLUMN (HID_FORMS_START + 33) -#define HID_PROP_LISTSOURCETYPE (HID_FORMS_START + 34) -#define HID_PROP_LISTSOURCE (HID_FORMS_START + 35) -#define HID_PROP_LISTINDEX (HID_FORMS_START + 36) -#define HID_PROP_TEXT (HID_FORMS_START + 37) -#define HID_PROP_LABEL (HID_FORMS_START + 38) -#define HID_PROP_STRINGITEMLIST (HID_FORMS_START + 39) -#define HID_PROP_SEARCHING (HID_FORMS_START + 40) -#define HID_PROP_FONT (HID_FORMS_START + 41) -#define HID_PROP_ROWHEIGHT (HID_FORMS_START + 42) -#define HID_PROP_BACKGROUNDCOLOR (HID_FORMS_START + 43) -#define HID_PROP_FILLCOLOR (HID_FORMS_START + 44) -#define HID_PROP_LINECOLOR (HID_FORMS_START + 46) -#define HID_PROP_BORDER (HID_FORMS_START + 47) -#define HID_PROP_ALIGN (HID_FORMS_START + 48) -#define HID_PROP_DROPDOWN (HID_FORMS_START + 49) -#define HID_PROP_MULTILINE (HID_FORMS_START + 50) -#define HID_PROP_HSCROLL (HID_FORMS_START + 51) -#define HID_PROP_VSCROLL (HID_FORMS_START + 52) -#define HID_PROP_TABSTOP (HID_FORMS_START + 53) -#define HID_PROP_REFVALUE (HID_FORMS_START + 54) -#define HID_PROP_BUTTONTYPE (HID_FORMS_START + 55) -#define HID_PROP_SUBMIT_ACTION (HID_FORMS_START + 56) -#define HID_PROP_SUBMIT_METHOD (HID_FORMS_START + 57) -#define HID_PROP_SUBMIT_ENCODING (HID_FORMS_START + 58) -#define HID_PROP_DEFAULTVALUE (HID_FORMS_START + 59) -#define HID_PROP_SUBMIT_TARGET (HID_FORMS_START + 60) -#define HID_PROP_DEFAULT_STATE (HID_FORMS_START + 61) -#define HID_PROP_IMAGE_URL (HID_FORMS_START + 62) -#define HID_PROP_DEFAULT_SELECT_SEQ (HID_FORMS_START + 63) -#define HID_PROP_MULTISELECTION (HID_FORMS_START + 64) -#define HID_PROP_DATE (HID_FORMS_START + 65) -#define HID_PROP_DATEMIN (HID_FORMS_START + 66) -#define HID_PROP_DATEMAX (HID_FORMS_START + 67) -#define HID_PROP_DATEFORMAT (HID_FORMS_START + 68) -#define HID_PROP_TIME (HID_FORMS_START + 69) -#define HID_PROP_TIMEMIN (HID_FORMS_START + 70) -#define HID_PROP_TIMEMAX (HID_FORMS_START + 71) -#define HID_PROP_TIMEFORMAT (HID_FORMS_START + 72) -#define HID_PROP_VALUEMIN (HID_FORMS_START + 73) -#define HID_PROP_VALUEMAX (HID_FORMS_START + 74) -#define HID_PROP_VALUESTEP (HID_FORMS_START + 75) -#define HID_PROP_CURRENCYSYMBOL (HID_FORMS_START + 76) -#define HID_PROP_EDITMASK (HID_FORMS_START + 77) -#define HID_PROP_LITERALMASK (HID_FORMS_START + 78) -#define HID_PROP_ENABLED (HID_FORMS_START + 79) -#define HID_PROP_AUTOCOMPLETE (HID_FORMS_START + 80) -#define HID_PROP_LINECOUNT (HID_FORMS_START + 81) -#define HID_PROP_MAXTEXTLEN (HID_FORMS_START + 82) -#define HID_PROP_SPIN (HID_FORMS_START + 83) -#define HID_PROP_STRICTFORMAT (HID_FORMS_START + 84) -#define HID_PROP_SHOWTHOUSANDSEP (HID_FORMS_START + 85) -#define HID_PROP_VERTICAL_ALIGN (HID_FORMS_START + 86) -#define HID_PROP_PRINTABLE (HID_FORMS_START + 87) -#define HID_PROP_TARGET_URL (HID_FORMS_START + 88) -#define HID_PROP_TARGET_FRAME (HID_FORMS_START + 89) -#define HID_PROP_TAG (HID_FORMS_START + 90) -#define HID_PROP_ECHO_CHAR (HID_FORMS_START + 91) -#define HID_PROP_EMPTY_IS_NULL (HID_FORMS_START + 92) -#define HID_PROP_DECIMAL_ACCURACY (HID_FORMS_START + 93) -#define HID_PROP_ENABLE_VISIBLE (HID_FORMS_START + 94) -#define HID_PROP_DEFAULT_BUTTON (HID_FORMS_START + 95) -#define HID_PROP_HIDDEN_VALUE (HID_FORMS_START + 96) -#define HID_PROP_TRISTATE (HID_FORMS_START + 97) -#define HID_PROP_NAVIGATIONBAR (HID_FORMS_START + 98) -#define HID_PROP_FILTER (HID_FORMS_START + 99) -#define HID_PROP_SORT_CRITERIA (HID_FORMS_START + 100) -#define HID_PROP_DEFAULT_LONG_VALUE (HID_FORMS_START + 101) -#define HID_PROP_DEFAULT_TIME (HID_FORMS_START + 102) -#define HID_PROP_DEFAULT_DATE (HID_FORMS_START + 103) -#define HID_PROP_HELPTEXT (HID_FORMS_START + 104) -#define HID_PROP_HELPURL (HID_FORMS_START + 105) -#define HID_PROP_RECORDMARKER (HID_FORMS_START + 106) -#define HID_PROP_FILTERPROPOSAL (HID_FORMS_START + 107) -#define HID_PROP_EFFECTIVEMIN (HID_FORMS_START + 108) -#define HID_PROP_EFFECTIVEMAX (HID_FORMS_START + 109) -#define HID_PROP_EFFECTIVEDEFAULT (HID_FORMS_START + 110) -#define HID_PROP_CONTROLLABEL (HID_FORMS_START + 111) -#define HID_PROP_CURRSYM_POSITION (HID_FORMS_START + 112) -#define HID_PROP_ESCAPE_PROCESSING (HID_FORMS_START + 113) - // FREE -#define HID_PROP_TITLE (HID_FORMS_START + 115) -#define HID_PROP_STEP (HID_FORMS_START + 116) - // FREE -#define HID_PROP_PROGRESSVALUE (HID_FORMS_START + 118) -#define HID_PROP_PROGRESSVALUE_MIN (HID_FORMS_START + 119) -#define HID_PROP_PROGRESSVALUE_MAX (HID_FORMS_START + 120) -#define HID_PROP_SCROLLVALUE (HID_FORMS_START + 121) -#define HID_PROP_SCROLLVALUE_MAX (HID_FORMS_START + 122) -#define HID_PROP_LINEINCREMENT (HID_FORMS_START + 123) -#define HID_PROP_BLOCKINCREMENT (HID_FORMS_START + 124) -#define HID_PROP_VISIBLESIZE (HID_FORMS_START + 125) -#define HID_PROP_ORIENTATION (HID_FORMS_START + 126) -#define HID_PROP_POSITIONX (HID_FORMS_START + 127) -#define HID_PROP_POSITIONY (HID_FORMS_START + 128) -#define HID_PROP_PUSHBUTTONTYPE (HID_FORMS_START + 129) -#define HID_PROP_STATE (HID_FORMS_START + 130) -#define HID_PROP_SCALEIMAGE (HID_FORMS_START + 131) -#define HID_PROP_BOUND_CELL (HID_FORMS_START + 132) -#define HID_PROP_LIST_CELL_RANGE (HID_FORMS_START + 133) -#define HID_PROP_CELL_EXCHANGE_TYPE (HID_FORMS_START + 134) -#define HID_PROP_SELECTEDITEMS (HID_FORMS_START + 135) -#define HID_PROP_SCROLLVALUE_MIN (HID_FORMS_START + 136) -#define HID_PROP_DEFAULT_SCROLLVALUE (HID_FORMS_START + 137) -#define HID_PROP_REPEAT_DELAY (HID_FORMS_START + 138) -#define HID_PROP_SYMBOLCOLOR (HID_FORMS_START + 139) -#define HID_PROP_SPINVALUE (HID_FORMS_START + 140) -#define HID_PROP_SPINVALUE_MIN (HID_FORMS_START + 141) -#define HID_PROP_SPINVALUE_MAX (HID_FORMS_START + 142) -#define HID_PROP_DEFAULT_SPINVALUE (HID_FORMS_START + 143) -#define HID_PROP_SPININCREMENT (HID_FORMS_START + 144) -#define HID_PROP_REPEAT (HID_FORMS_START + 145) -#define HID_PROP_WORDBREAK (HID_FORMS_START + 146) -#define HID_PROP_SHOW_SCROLLBARS (HID_FORMS_START + 147) -#define HID_PROP_TABORDER_CONTROLS (HID_FORMS_START + 148) -#define HID_FIELDLINK_DETAIL_COLUMN (HID_FORMS_START + 149) -#define HID_FIELDLINK_MASTER_COLUMN (HID_FORMS_START + 150) -#define UID_FIELDLINK_DETAIL1 (HID_FORMS_START + 151) -#define UID_FIELDLINK_MASTER1 (HID_FORMS_START + 152) -#define UID_FIELDLINK_DETAIL2 (HID_FORMS_START + 153) -#define UID_FIELDLINK_MASTER2 (HID_FORMS_START + 154) -#define UID_FIELDLINK_DETAIL3 (HID_FORMS_START + 155) -#define UID_FIELDLINK_MASTER3 (HID_FORMS_START + 156) -#define UID_FIELDLINK_DETAIL4 (HID_FORMS_START + 157) -#define UID_FIELDLINK_MASTER4 (HID_FORMS_START + 158) -#define HID_PROP_ICONSIZE (HID_FORMS_START + 159) -#define HID_PROP_SHOW_POSITION (HID_FORMS_START + 160) -#define HID_PROP_SHOW_NAVIGATION (HID_FORMS_START + 161) -#define HID_PROP_SHOW_RECORDACTIONS (HID_FORMS_START + 162) -#define HID_PROP_SHOW_FILTERSORT (HID_FORMS_START + 163) -#define HID_PROP_AUTOLINEBREAK (HID_FORMS_START + 164) -#define HID_PROP_TEXTTYPE (HID_FORMS_START + 165) -#define HID_PROP_LINEEND_FORMAT (HID_FORMS_START + 166) -#define HID_PROP_XSD_TOTAL_DIGITS (HID_FORMS_START + 167) -#define HID_PROP_XSD_FRACTION_DIGITS (HID_FORMS_START + 168) -#define HID_PROP_XSD_MAX_INCLUSIVE (HID_FORMS_START + 169) -#define HID_PROP_XSD_MAX_EXCLUSIVE (HID_FORMS_START + 170) -#define HID_PROP_XSD_MIN_INCLUSIVE (HID_FORMS_START + 171) -#define HID_PROP_XSD_MIN_EXCLUSIVE (HID_FORMS_START + 172) -#define HID_PROP_UNCHECKEDREFVALUE (HID_FORMS_START + 173) -#define HID_PROP_SUBMISSION_ID (HID_FORMS_START + 174) - // FREE - // FREE - // FREE - // FREE - // FREE -#define UID_PROP_DLG_FONT_TYPE (HID_FORMS_START + 180) -#define UID_PROP_DLG_IMAGE_URL (HID_FORMS_START + 181) -#define UID_PROP_DLG_BACKGROUNDCOLOR (HID_FORMS_START + 182) -#define UID_PROP_DLG_SYMBOLCOLOR (HID_FORMS_START + 183) -#define UID_PROP_DLG_ATTR_DATASOURCE (HID_FORMS_START + 184) -#define UID_PROP_DLG_ATTR_TARGET_URL (HID_FORMS_START + 185) -#define UID_PROP_DLG_NUMBER_FORMAT (HID_FORMS_START + 186) -#define UID_PROP_DLG_CONTROLLABEL (HID_FORMS_START + 187) -#define UID_PROP_DLG_FILLCOLOR (HID_FORMS_START + 188) -#define UID_PROP_DLG_TABINDEX (HID_FORMS_START + 189) -#define UID_PROP_DLG_SQLCOMMAND (HID_FORMS_START + 190) -#define UID_PROP_DLG_FORMLINKFIELDS (HID_FORMS_START + 191) -#define UID_PROP_DLG_FILTER (HID_FORMS_START + 192) -#define UID_PROP_DLG_ORDER (HID_FORMS_START + 193) -#define UID_PROP_DLG_SELECTION (HID_FORMS_START + 194) -#define UID_EVT_MACRODLG (HID_FORMS_START + 195) -#define UID_BRWEVT_APPROVEACTIONPERFORMED (HID_FORMS_START + 196) -#define UID_BRWEVT_ACTIONPERFORMED (HID_FORMS_START + 197) -#define UID_BRWEVT_CHANGED (HID_FORMS_START + 198) -#define UID_BRWEVT_TEXTCHANGED (HID_FORMS_START + 199) -#define UID_BRWEVT_ITEMSTATECHANGED (HID_FORMS_START + 200) -#define UID_BRWEVT_FOCUSGAINED (HID_FORMS_START + 201) -#define UID_BRWEVT_FOCUSLOST (HID_FORMS_START + 202) -#define UID_BRWEVT_KEYTYPED (HID_FORMS_START + 203) -#define UID_BRWEVT_KEYUP (HID_FORMS_START + 204) -#define UID_BRWEVT_MOUSEENTERED (HID_FORMS_START + 205) -#define UID_BRWEVT_MOUSEDRAGGED (HID_FORMS_START + 206) -#define UID_BRWEVT_MOUSEMOVED (HID_FORMS_START + 207) -#define UID_BRWEVT_MOUSEPRESSED (HID_FORMS_START + 208) -#define UID_BRWEVT_MOUSERELEASED (HID_FORMS_START + 209) -#define UID_BRWEVT_MOUSEEXITED (HID_FORMS_START + 210) -#define UID_BRWEVT_APPROVERESETTED (HID_FORMS_START + 211) -#define UID_BRWEVT_RESETTED (HID_FORMS_START + 212) -#define UID_BRWEVT_SUBMITTED (HID_FORMS_START + 213) -#define UID_BRWEVT_BEFOREUPDATE (HID_FORMS_START + 214) -#define UID_BRWEVT_AFTERUPDATE (HID_FORMS_START + 215) -#define UID_BRWEVT_LOADED (HID_FORMS_START + 216) -#define UID_BRWEVT_RELOADING (HID_FORMS_START + 217) -#define UID_BRWEVT_RELOADED (HID_FORMS_START + 218) -#define UID_BRWEVT_UNLOADING (HID_FORMS_START + 219) -#define UID_BRWEVT_UNLOADED (HID_FORMS_START + 220) -#define UID_BRWEVT_CONFIRMDELETE (HID_FORMS_START + 221) -#define UID_BRWEVT_APPROVEROWCHANGE (HID_FORMS_START + 222) -#define UID_BRWEVT_ROWCHANGE (HID_FORMS_START + 223) -#define UID_BRWEVT_POSITIONING (HID_FORMS_START + 224) -#define UID_BRWEVT_POSITIONED (HID_FORMS_START + 225) -#define UID_BRWEVT_APPROVEPARAMETER (HID_FORMS_START + 226) -#define UID_BRWEVT_ERROROCCURED (HID_FORMS_START + 227) -#define UID_BRWEVT_ADJUSTMENTVALUECHANGED (HID_FORMS_START + 228) -#define HID_PROP_XML_DATA_MODEL (HID_FORMS_START + 229) -#define HID_PROP_BIND_EXPRESSION (HID_FORMS_START + 230) -#define HID_PROP_XSD_REQUIRED (HID_FORMS_START + 231) -#define HID_PROP_XSD_RELEVANT (HID_FORMS_START + 232) -#define HID_PROP_XSD_READONLY (HID_FORMS_START + 233) -#define HID_PROP_XSD_CONSTRAINT (HID_FORMS_START + 234) -#define HID_PROP_XSD_CALCULATION (HID_FORMS_START + 235) -#define HID_PROP_XSD_DATA_TYPE (HID_FORMS_START + 236) -#define HID_PROP_XSD_WHITESPACES (HID_FORMS_START + 237) -#define HID_PROP_XSD_PATTERN (HID_FORMS_START + 238) -#define HID_PROP_XSD_LENGTH (HID_FORMS_START + 239) -#define HID_PROP_XSD_MIN_LENGTH (HID_FORMS_START + 230) -#define HID_PROP_XSD_MAX_LENGTH (HID_FORMS_START + 241) -#define UID_PROP_DLG_BIND_EXPRESSION (HID_FORMS_START + 242) -#define UID_PROP_DLG_XSD_REQUIRED (HID_FORMS_START + 243) -#define UID_PROP_DLG_XSD_RELEVANT (HID_FORMS_START + 244) -#define UID_PROP_DLG_XSD_READONLY (HID_FORMS_START + 245) -#define UID_PROP_DLG_XSD_CONSTRAINT (HID_FORMS_START + 246) -#define UID_PROP_DLG_XSD_CALCULATION (HID_FORMS_START + 247) -#define UID_PROP_ADD_DATA_TYPE (HID_FORMS_START + 248) -#define UID_PROP_REMOVE_DATA_TYPE (HID_FORMS_START + 249) -#define HID_PROP_LIST_BINDING (HID_FORMS_START + 250) -#define HID_PROP_BINDING_NAME (HID_FORMS_START + 251) -#define HID_PROP_SELECTION_TYPE (HID_FORMS_START + 253) -#define HID_PROP_ROOT_DISPLAYED (HID_FORMS_START + 254) -#define HID_PROP_SHOWS_HANDLES (HID_FORMS_START + 255) -#define HID_PROP_SHOWS_ROOT_HANDLES (HID_FORMS_START + 256) -#define HID_PROP_EDITABLE (HID_FORMS_START + 257) -#define HID_PROP_INVOKES_STOP_NOT_EDITING (HID_FORMS_START + 258) -#define HID_PROP_ROW_HEIGHT (HID_FORMS_START + 259) -#define HID_PROP_DECORATION (HID_FORMS_START + 252) +#define HID_UPDATE_START ( HID_EXTENSIONS_START + 500 ) +#define HID_UPDATE_END ( HID_EXTENSIONS_START + 519 ) -#define HID_EVT_ACTIONPERFORMED (HID_FORMS_START + 300) -#define HID_EVT_AFTERUPDATE (HID_FORMS_START + 301) -#define HID_EVT_BEFOREUPDATE (HID_FORMS_START + 302) -#define HID_EVT_CONFIRMDELETE (HID_FORMS_START + 303) -#define HID_EVT_ERROROCCURED (HID_FORMS_START + 304) -#define HID_EVT_FOCUSGAINED (HID_FORMS_START + 305) -#define HID_EVT_FOCUSLOST (HID_FORMS_START + 306) -#define HID_EVT_ITEMSTATECHANGED (HID_FORMS_START + 307) -#define HID_EVT_KEYTYPED (HID_FORMS_START + 308) -#define HID_EVT_LOADED (HID_FORMS_START + 309) -#define HID_EVT_MOUSEDRAGGED (HID_FORMS_START + 310) -#define HID_EVT_MOUSEENTERED (HID_FORMS_START + 311) -#define HID_EVT_MOUSEEXITED (HID_FORMS_START + 312) -#define HID_EVT_MOUSEMOVED (HID_FORMS_START + 313) -#define HID_EVT_MOUSEPRESSED (HID_FORMS_START + 314) -#define HID_EVT_MOUSERELEASED (HID_FORMS_START + 315) -#define HID_EVT_POSITIONED (HID_FORMS_START + 316) -#define HID_EVT_RESETTED (HID_FORMS_START + 317) -#define HID_EVT_SUBMITTED (HID_FORMS_START + 318) -#define HID_EVT_TEXTCHANGED (HID_FORMS_START + 319) -#define HID_EVT_UNLOADED (HID_FORMS_START + 320) -#define HID_EVT_CHANGED (HID_FORMS_START + 321) -#define HID_EVT_APPROVEACTIONPERFORMED (HID_FORMS_START + 322) -#define HID_EVT_APPROVERESETTED (HID_FORMS_START + 323) -#define HID_EVT_KEYUP (HID_FORMS_START + 324) -#define HID_EVT_APPROVEPARAMETER (HID_FORMS_START + 325) -#define HID_EVT_POSITIONING (HID_FORMS_START + 326) -#define HID_EVT_RELOADED (HID_FORMS_START + 327) -#define HID_EVT_APPROVEROWCHANGE (HID_FORMS_START + 328) -#define HID_EVT_ROWCHANGE (HID_FORMS_START + 329) -#define HID_EVT_RELOADING (HID_FORMS_START + 330) -#define HID_EVT_UNLOADING (HID_FORMS_START + 331) -#define HID_EVT_ADJUSTMENTVALUECHANGED (HID_FORMS_START + 332) -#define HID_PROP_TOGGLE (HID_FORMS_START + 333) -#define HID_PROP_FOCUSONCLICK (HID_FORMS_START + 334) -#define HID_PROP_HIDEINACTIVESELECTION (HID_FORMS_START + 335) -#define HID_PROP_VISUALEFFECT (HID_FORMS_START + 336) -#define HID_PROP_BORDERCOLOR (HID_FORMS_START + 337) -#define UID_PROP_DLG_BORDERCOLOR (HID_FORMS_START + 338) -#define HID_PROP_IMAGEPOSITION (HID_FORMS_START + 339) -#define HID_PROP_NOLABEL (HID_FORMS_START + 340) -#define HID_PROP_WRITING_MODE (HID_FORMS_START + 341) -#define HID_PROP_ANCHOR_TYPE (HID_FORMS_START + 343) - // please adjust HID_LAST_FORMS_ID if you add new ids here! +// !!! please adjust HID_LAST_EXTENSIONS_RANGE if you add new ranges here !!! -#define HID_LAST_FORMS_ID HID_PROP_ANCHOR_TYPE +#define HID_LAST_EXTENSIONS_RANGE HID_UPDATE_END -#if HID_LAST_FORMS_ID > HID_FORMS_END - #error id overflow +#if HID_LAST_EXTENSIONS_RANGE > HID_EXTENSIONS_END + #error id range overflow #endif #endif diff --git a/extensions/inc/propctrlr.hrc b/extensions/inc/propctrlr.hrc new file mode 100644 index 000000000000..cd27f844434f --- /dev/null +++ b/extensions/inc/propctrlr.hrc @@ -0,0 +1,336 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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 EXTENSIONS_PROPCTRLR_HRC
+#define EXTENSIONS_PROPCTRLR_HRC
+
+#include "extensio.hrc"
+
+#define HID_PROP_INPUT_REQUIRED ( HID_PROPC_START + 0) +#define HID_PROP_GROUPBOX ( HID_PROPC_START + 1) +#define HID_PROP_CONTROLSOURCE ( HID_PROPC_START + 2) +#define HID_PROP_NAME ( HID_PROPC_START + 3) +#define HID_PROP_TABINDEX ( HID_PROPC_START + 4) +#define HID_PROP_MASTERFIELDS ( HID_PROPC_START + 5) +#define HID_PROP_SLAVEFIELDS ( HID_PROPC_START + 6) +#define HID_PROP_DATASOURCE ( HID_PROPC_START + 7) +#define HID_PROP_CURSORSOURCE ( HID_PROPC_START + 8) +#define HID_PROP_CURSORSOURCETYPE ( HID_PROPC_START + 9) +#define HID_PROP_CURSORTYPE ( HID_PROPC_START + 10) +#define HID_PROP_READONLY ( HID_PROPC_START + 11) +#define HID_PROP_DATAENTRY ( HID_PROPC_START + 12) +#define HID_PROP_NAVIGATION ( HID_PROPC_START + 13) +#define HID_PROP_CYCLE ( HID_PROPC_START + 14) +#define HID_PROP_ALLOW_ADDITIONS ( HID_PROPC_START + 15) +#define HID_PROP_ALLOW_EDITS ( HID_PROPC_START + 16) +#define HID_PROP_ALLOW_DELETIONS ( HID_PROPC_START + 17) +#define HID_PROP_DIRTY ( HID_PROPC_START + 18) +#define HID_PROP_OLDVALUE ( HID_PROPC_START + 19) +#define HID_PROP_VALUE ( HID_PROPC_START + 20) +#define HID_PROP_LOCKED ( HID_PROPC_START + 21) +#define HID_PROP_FORMATKEY ( HID_PROPC_START + 22) +#define HID_PROP_REQUIRED ( HID_PROPC_START + 23) +#define HID_PROP_WHEEL_BEHAVIOR ( HID_PROPC_START + 24) +#define HID_PROP_UNIQUE ( HID_PROPC_START + 25) +#define HID_PROP_CLASSID ( HID_PROPC_START + 26) +#define HID_PROP_LEFT ( HID_PROPC_START + 27) +#define HID_PROP_RIGHT ( HID_PROPC_START + 28) +#define HID_PROP_HEIGHT ( HID_PROPC_START + 29) +#define HID_PROP_WIDTH ( HID_PROPC_START + 30) +#define HID_PROP_BOUNDCOLUMN ( HID_PROPC_START + 31) +#define HID_PROP_LISTSOURCETYPE ( HID_PROPC_START + 32) +#define HID_PROP_LISTSOURCE ( HID_PROPC_START + 33) +#define HID_PROP_LISTINDEX ( HID_PROPC_START + 34) +#define HID_PROP_TEXT ( HID_PROPC_START + 35) +#define HID_PROP_LABEL ( HID_PROPC_START + 36) +#define HID_PROP_STRINGITEMLIST ( HID_PROPC_START + 37) +#define HID_PROP_SEARCHING ( HID_PROPC_START + 38) +#define HID_PROP_FONT ( HID_PROPC_START + 39) +#define HID_PROP_ROWHEIGHT ( HID_PROPC_START + 40) +#define HID_PROP_BACKGROUNDCOLOR ( HID_PROPC_START + 41) +#define HID_PROP_FILLCOLOR ( HID_PROPC_START + 42) +#define HID_PROP_LINECOLOR ( HID_PROPC_START + 43) +#define HID_PROP_BORDER ( HID_PROPC_START + 44) +#define HID_PROP_ALIGN ( HID_PROPC_START + 45) +#define HID_PROP_DROPDOWN ( HID_PROPC_START + 46) +#define HID_PROP_MULTILINE ( HID_PROPC_START + 47) +#define HID_PROP_HSCROLL ( HID_PROPC_START + 48) +#define HID_PROP_VSCROLL ( HID_PROPC_START + 49) +#define HID_PROP_TABSTOP ( HID_PROPC_START + 50) +#define HID_PROP_REFVALUE ( HID_PROPC_START + 51) +#define HID_PROP_BUTTONTYPE ( HID_PROPC_START + 52) +#define HID_PROP_SUBMIT_ACTION ( HID_PROPC_START + 53) +#define HID_PROP_SUBMIT_METHOD ( HID_PROPC_START + 54) +#define HID_PROP_SUBMIT_ENCODING ( HID_PROPC_START + 55) +#define HID_PROP_DEFAULTVALUE ( HID_PROPC_START + 56) +#define HID_PROP_SUBMIT_TARGET ( HID_PROPC_START + 57) +#define HID_PROP_DEFAULT_STATE ( HID_PROPC_START + 58) +#define HID_PROP_IMAGE_URL ( HID_PROPC_START + 59) +#define HID_PROP_DEFAULT_SELECT_SEQ ( HID_PROPC_START + 60) +#define HID_PROP_MULTISELECTION ( HID_PROPC_START + 61) +#define HID_PROP_DATE ( HID_PROPC_START + 62) +#define HID_PROP_DATEMIN ( HID_PROPC_START + 63) +#define HID_PROP_DATEMAX ( HID_PROPC_START + 64) +#define HID_PROP_DATEFORMAT ( HID_PROPC_START + 65) +#define HID_PROP_TIME ( HID_PROPC_START + 66) +#define HID_PROP_TIMEMIN ( HID_PROPC_START + 67) +#define HID_PROP_TIMEMAX ( HID_PROPC_START + 68) +#define HID_PROP_TIMEFORMAT ( HID_PROPC_START + 69) +#define HID_PROP_VALUEMIN ( HID_PROPC_START + 70) +#define HID_PROP_VALUEMAX ( HID_PROPC_START + 71) +#define HID_PROP_VALUESTEP ( HID_PROPC_START + 72) +#define HID_PROP_CURRENCYSYMBOL ( HID_PROPC_START + 73) +#define HID_PROP_EDITMASK ( HID_PROPC_START + 74) +#define HID_PROP_LITERALMASK ( HID_PROPC_START + 75) +#define HID_PROP_ENABLED ( HID_PROPC_START + 76) +#define HID_PROP_AUTOCOMPLETE ( HID_PROPC_START + 77) +#define HID_PROP_LINECOUNT ( HID_PROPC_START + 78) +#define HID_PROP_MAXTEXTLEN ( HID_PROPC_START + 79) +#define HID_PROP_SPIN ( HID_PROPC_START + 80) +#define HID_PROP_STRICTFORMAT ( HID_PROPC_START + 81) +#define HID_PROP_SHOWTHOUSANDSEP ( HID_PROPC_START + 82) +#define HID_PROP_VERTICAL_ALIGN ( HID_PROPC_START + 83) +#define HID_PROP_PRINTABLE ( HID_PROPC_START + 84) +#define HID_PROP_TARGET_URL ( HID_PROPC_START + 85) +#define HID_PROP_TARGET_FRAME ( HID_PROPC_START + 86) +#define HID_PROP_TAG ( HID_PROPC_START + 87) +#define HID_PROP_ECHO_CHAR ( HID_PROPC_START + 88) +#define HID_PROP_EMPTY_IS_NULL ( HID_PROPC_START + 89) +#define HID_PROP_DECIMAL_ACCURACY ( HID_PROPC_START + 90) +#define HID_PROP_ENABLE_VISIBLE ( HID_PROPC_START + 91) +#define HID_PROP_DEFAULT_BUTTON ( HID_PROPC_START + 92) +#define HID_PROP_HIDDEN_VALUE ( HID_PROPC_START + 93) +#define HID_PROP_TRISTATE ( HID_PROPC_START + 94) +#define HID_PROP_NAVIGATIONBAR ( HID_PROPC_START + 95) +#define HID_PROP_FILTER ( HID_PROPC_START + 96) +#define HID_PROP_SORT_CRITERIA ( HID_PROPC_START + 97) +#define HID_PROP_DEFAULT_LONG_VALUE ( HID_PROPC_START + 98) +#define HID_PROP_DEFAULT_TIME ( HID_PROPC_START + 99) +#define HID_PROP_DEFAULT_DATE ( HID_PROPC_START + 100) +#define HID_PROP_HELPTEXT ( HID_PROPC_START + 101) +#define HID_PROP_HELPURL ( HID_PROPC_START + 102) +#define HID_PROP_RECORDMARKER ( HID_PROPC_START + 103) +#define HID_PROP_FILTERPROPOSAL ( HID_PROPC_START + 104) +#define HID_PROP_EFFECTIVEMIN ( HID_PROPC_START + 105) +#define HID_PROP_EFFECTIVEMAX ( HID_PROPC_START + 106) +#define HID_PROP_EFFECTIVEDEFAULT ( HID_PROPC_START + 107) +#define HID_PROP_CONTROLLABEL ( HID_PROPC_START + 108) +#define HID_PROP_CURRSYM_POSITION ( HID_PROPC_START + 109) +#define HID_PROP_ESCAPE_PROCESSING ( HID_PROPC_START + 110) +#define HID_PROP_TITLE ( HID_PROPC_START + 111) +#define HID_PROP_STEP ( HID_PROPC_START + 112) +#define HID_PROP_PROGRESSVALUE ( HID_PROPC_START + 113) +#define HID_PROP_PROGRESSVALUE_MIN ( HID_PROPC_START + 114) +#define HID_PROP_PROGRESSVALUE_MAX ( HID_PROPC_START + 115) +#define HID_PROP_SCROLLVALUE ( HID_PROPC_START + 116) +#define HID_PROP_SCROLLVALUE_MAX ( HID_PROPC_START + 117) +#define HID_PROP_LINEINCREMENT ( HID_PROPC_START + 118) +#define HID_PROP_BLOCKINCREMENT ( HID_PROPC_START + 119) +#define HID_PROP_VISIBLESIZE ( HID_PROPC_START + 120) +#define HID_PROP_ORIENTATION ( HID_PROPC_START + 121) +#define HID_PROP_POSITIONX ( HID_PROPC_START + 122) +#define HID_PROP_POSITIONY ( HID_PROPC_START + 123) +#define HID_PROP_PUSHBUTTONTYPE ( HID_PROPC_START + 124) +#define HID_PROP_STATE ( HID_PROPC_START + 125) +#define HID_PROP_SCALEIMAGE ( HID_PROPC_START + 126) +#define HID_PROP_BOUND_CELL ( HID_PROPC_START + 127) +#define HID_PROP_LIST_CELL_RANGE ( HID_PROPC_START + 128) +#define HID_PROP_CELL_EXCHANGE_TYPE ( HID_PROPC_START + 129) +#define HID_PROP_SELECTEDITEMS ( HID_PROPC_START + 130) +#define HID_PROP_SCROLLVALUE_MIN ( HID_PROPC_START + 131) +#define HID_PROP_DEFAULT_SCROLLVALUE ( HID_PROPC_START + 132) +#define HID_PROP_REPEAT_DELAY ( HID_PROPC_START + 133) +#define HID_PROP_SYMBOLCOLOR ( HID_PROPC_START + 134) +#define HID_PROP_SPINVALUE ( HID_PROPC_START + 135) +#define HID_PROP_SPINVALUE_MIN ( HID_PROPC_START + 136) +#define HID_PROP_SPINVALUE_MAX ( HID_PROPC_START + 137) +#define HID_PROP_DEFAULT_SPINVALUE ( HID_PROPC_START + 138) +#define HID_PROP_SPININCREMENT ( HID_PROPC_START + 139) +#define HID_PROP_REPEAT ( HID_PROPC_START + 140) +#define HID_PROP_WORDBREAK ( HID_PROPC_START + 141) +#define HID_PROP_SHOW_SCROLLBARS ( HID_PROPC_START + 142) +#define HID_PROP_TABORDER_CONTROLS ( HID_PROPC_START + 143) +#define HID_FIELDLINK_DETAIL_COLUMN ( HID_PROPC_START + 144) +#define HID_FIELDLINK_MASTER_COLUMN ( HID_PROPC_START + 145) +#define UID_FIELDLINK_DETAIL1 ( HID_PROPC_START + 146) +#define UID_FIELDLINK_MASTER1 ( HID_PROPC_START + 147) +#define UID_FIELDLINK_DETAIL2 ( HID_PROPC_START + 148) +#define UID_FIELDLINK_MASTER2 ( HID_PROPC_START + 149) +#define UID_FIELDLINK_DETAIL3 ( HID_PROPC_START + 150) +#define UID_FIELDLINK_MASTER3 ( HID_PROPC_START + 151) +#define UID_FIELDLINK_DETAIL4 ( HID_PROPC_START + 152) +#define UID_FIELDLINK_MASTER4 ( HID_PROPC_START + 153) +#define HID_PROP_ICONSIZE ( HID_PROPC_START + 154) +#define HID_PROP_SHOW_POSITION ( HID_PROPC_START + 155) +#define HID_PROP_SHOW_NAVIGATION ( HID_PROPC_START + 156) +#define HID_PROP_SHOW_RECORDACTIONS ( HID_PROPC_START + 157) +#define HID_PROP_SHOW_FILTERSORT ( HID_PROPC_START + 158) +#define HID_PROP_AUTOLINEBREAK ( HID_PROPC_START + 159) +#define HID_PROP_TEXTTYPE ( HID_PROPC_START + 160) +#define HID_PROP_LINEEND_FORMAT ( HID_PROPC_START + 161) +#define HID_PROP_XSD_TOTAL_DIGITS ( HID_PROPC_START + 162) +#define HID_PROP_XSD_FRACTION_DIGITS ( HID_PROPC_START + 163) +#define HID_PROP_XSD_MAX_INCLUSIVE ( HID_PROPC_START + 164) +#define HID_PROP_XSD_MAX_EXCLUSIVE ( HID_PROPC_START + 165) +#define HID_PROP_XSD_MIN_INCLUSIVE ( HID_PROPC_START + 166) +#define HID_PROP_XSD_MIN_EXCLUSIVE ( HID_PROPC_START + 167) +#define HID_PROP_UNCHECKEDREFVALUE ( HID_PROPC_START + 168) +#define HID_PROP_SUBMISSION_ID ( HID_PROPC_START + 169) +#define UID_PROP_DLG_FONT_TYPE ( HID_PROPC_START + 170) +#define UID_PROP_DLG_IMAGE_URL ( HID_PROPC_START + 171) +#define UID_PROP_DLG_BACKGROUNDCOLOR ( HID_PROPC_START + 172) +#define UID_PROP_DLG_SYMBOLCOLOR ( HID_PROPC_START + 173) +#define UID_PROP_DLG_ATTR_DATASOURCE ( HID_PROPC_START + 174) +#define UID_PROP_DLG_ATTR_TARGET_URL ( HID_PROPC_START + 175) +#define UID_PROP_DLG_NUMBER_FORMAT ( HID_PROPC_START + 176) +#define UID_PROP_DLG_CONTROLLABEL ( HID_PROPC_START + 177) +#define UID_PROP_DLG_FILLCOLOR ( HID_PROPC_START + 178) +#define UID_PROP_DLG_TABINDEX ( HID_PROPC_START + 179) +#define UID_PROP_DLG_SQLCOMMAND ( HID_PROPC_START + 180) +#define UID_PROP_DLG_FORMLINKFIELDS ( HID_PROPC_START + 181) +#define UID_PROP_DLG_FILTER ( HID_PROPC_START + 182) +#define UID_PROP_DLG_ORDER ( HID_PROPC_START + 183) +#define UID_PROP_DLG_SELECTION ( HID_PROPC_START + 184) +#define UID_EVT_MACRODLG ( HID_PROPC_START + 185) +#define UID_BRWEVT_APPROVEACTIONPERFORMED ( HID_PROPC_START + 186) +#define UID_BRWEVT_ACTIONPERFORMED ( HID_PROPC_START + 187) +#define UID_BRWEVT_CHANGED ( HID_PROPC_START + 188) +#define UID_BRWEVT_TEXTCHANGED ( HID_PROPC_START + 189) +#define UID_BRWEVT_ITEMSTATECHANGED ( HID_PROPC_START + 190) +#define UID_BRWEVT_FOCUSGAINED ( HID_PROPC_START + 191) +#define UID_BRWEVT_FOCUSLOST ( HID_PROPC_START + 192) +#define UID_BRWEVT_KEYTYPED ( HID_PROPC_START + 193) +#define UID_BRWEVT_KEYUP ( HID_PROPC_START + 194) +#define UID_BRWEVT_MOUSEENTERED ( HID_PROPC_START + 195) +#define UID_BRWEVT_MOUSEDRAGGED ( HID_PROPC_START + 196) +#define UID_BRWEVT_MOUSEMOVED ( HID_PROPC_START + 197) +#define UID_BRWEVT_MOUSEPRESSED ( HID_PROPC_START + 198) +#define UID_BRWEVT_MOUSERELEASED ( HID_PROPC_START + 199) +#define UID_BRWEVT_MOUSEEXITED ( HID_PROPC_START + 200) +#define UID_BRWEVT_APPROVERESETTED ( HID_PROPC_START + 201) +#define UID_BRWEVT_RESETTED ( HID_PROPC_START + 202) +#define UID_BRWEVT_SUBMITTED ( HID_PROPC_START + 203) +#define UID_BRWEVT_BEFOREUPDATE ( HID_PROPC_START + 204) +#define UID_BRWEVT_AFTERUPDATE ( HID_PROPC_START + 205) +#define UID_BRWEVT_LOADED ( HID_PROPC_START + 206) +#define UID_BRWEVT_RELOADING ( HID_PROPC_START + 207) +#define UID_BRWEVT_RELOADED ( HID_PROPC_START + 208) +#define UID_BRWEVT_UNLOADING ( HID_PROPC_START + 209) +#define UID_BRWEVT_UNLOADED ( HID_PROPC_START + 210) +#define UID_BRWEVT_CONFIRMDELETE ( HID_PROPC_START + 211) +#define UID_BRWEVT_APPROVEROWCHANGE ( HID_PROPC_START + 212) +#define UID_BRWEVT_ROWCHANGE ( HID_PROPC_START + 213) +#define UID_BRWEVT_POSITIONING ( HID_PROPC_START + 214) +#define UID_BRWEVT_POSITIONED ( HID_PROPC_START + 215) +#define UID_BRWEVT_APPROVEPARAMETER ( HID_PROPC_START + 216) +#define UID_BRWEVT_ERROROCCURED ( HID_PROPC_START + 217) +#define UID_BRWEVT_ADJUSTMENTVALUECHANGED ( HID_PROPC_START + 218) +#define HID_PROP_XML_DATA_MODEL ( HID_PROPC_START + 219) +#define HID_PROP_BIND_EXPRESSION ( HID_PROPC_START + 220) +#define HID_PROP_XSD_REQUIRED ( HID_PROPC_START + 221) +#define HID_PROP_XSD_RELEVANT ( HID_PROPC_START + 222) +#define HID_PROP_XSD_READONLY ( HID_PROPC_START + 223) +#define HID_PROP_XSD_CONSTRAINT ( HID_PROPC_START + 224) +#define HID_PROP_XSD_CALCULATION ( HID_PROPC_START + 225) +#define HID_PROP_XSD_DATA_TYPE ( HID_PROPC_START + 226) +#define HID_PROP_XSD_WHITESPACES ( HID_PROPC_START + 227) +#define HID_PROP_XSD_PATTERN ( HID_PROPC_START + 228) +#define HID_PROP_XSD_LENGTH ( HID_PROPC_START + 229) +#define HID_PROP_XSD_MIN_LENGTH ( HID_PROPC_START + 230) +#define HID_PROP_XSD_MAX_LENGTH ( HID_PROPC_START + 231) +#define UID_PROP_DLG_BIND_EXPRESSION ( HID_PROPC_START + 232) +#define UID_PROP_DLG_XSD_REQUIRED ( HID_PROPC_START + 233) +#define UID_PROP_DLG_XSD_RELEVANT ( HID_PROPC_START + 234) +#define UID_PROP_DLG_XSD_READONLY ( HID_PROPC_START + 235) +#define UID_PROP_DLG_XSD_CONSTRAINT ( HID_PROPC_START + 236) +#define UID_PROP_DLG_XSD_CALCULATION ( HID_PROPC_START + 237) +#define UID_PROP_ADD_DATA_TYPE ( HID_PROPC_START + 238) +#define UID_PROP_REMOVE_DATA_TYPE ( HID_PROPC_START + 239) +#define HID_PROP_LIST_BINDING ( HID_PROPC_START + 240) +#define HID_PROP_BINDING_NAME ( HID_PROPC_START + 241) +#define HID_PROP_SELECTION_TYPE ( HID_PROPC_START + 242) +#define HID_PROP_ROOT_DISPLAYED ( HID_PROPC_START + 243) +#define HID_PROP_SHOWS_HANDLES ( HID_PROPC_START + 244) +#define HID_PROP_SHOWS_ROOT_HANDLES ( HID_PROPC_START + 245) +#define HID_PROP_EDITABLE ( HID_PROPC_START + 246) +#define HID_PROP_INVOKES_STOP_NOT_EDITING ( HID_PROPC_START + 247) +#define HID_PROP_ROW_HEIGHT ( HID_PROPC_START + 248) +#define HID_PROP_DECORATION ( HID_PROPC_START + 249) +#define HID_EVT_ACTIONPERFORMED ( HID_PROPC_START + 250) +#define HID_EVT_AFTERUPDATE ( HID_PROPC_START + 251) +#define HID_EVT_BEFOREUPDATE ( HID_PROPC_START + 252) +#define HID_EVT_CONFIRMDELETE ( HID_PROPC_START + 253) +#define HID_EVT_ERROROCCURED ( HID_PROPC_START + 254) +#define HID_EVT_FOCUSGAINED ( HID_PROPC_START + 255) +#define HID_EVT_FOCUSLOST ( HID_PROPC_START + 256) +#define HID_EVT_ITEMSTATECHANGED ( HID_PROPC_START + 257) +#define HID_EVT_KEYTYPED ( HID_PROPC_START + 258) +#define HID_EVT_LOADED ( HID_PROPC_START + 259) +#define HID_EVT_MOUSEDRAGGED ( HID_PROPC_START + 260) +#define HID_EVT_MOUSEENTERED ( HID_PROPC_START + 261) +#define HID_EVT_MOUSEEXITED ( HID_PROPC_START + 262) +#define HID_EVT_MOUSEMOVED ( HID_PROPC_START + 263) +#define HID_EVT_MOUSEPRESSED ( HID_PROPC_START + 264) +#define HID_EVT_MOUSERELEASED ( HID_PROPC_START + 265) +#define HID_EVT_POSITIONED ( HID_PROPC_START + 266) +#define HID_EVT_RESETTED ( HID_PROPC_START + 267) +#define HID_EVT_SUBMITTED ( HID_PROPC_START + 268) +#define HID_EVT_TEXTCHANGED ( HID_PROPC_START + 269) +#define HID_EVT_UNLOADED ( HID_PROPC_START + 270) +#define HID_EVT_CHANGED ( HID_PROPC_START + 271) +#define HID_EVT_APPROVEACTIONPERFORMED ( HID_PROPC_START + 272) +#define HID_EVT_APPROVERESETTED ( HID_PROPC_START + 273) +#define HID_EVT_KEYUP ( HID_PROPC_START + 274) +#define HID_EVT_APPROVEPARAMETER ( HID_PROPC_START + 275) +#define HID_EVT_POSITIONING ( HID_PROPC_START + 276) +#define HID_EVT_RELOADED ( HID_PROPC_START + 277) +#define HID_EVT_APPROVEROWCHANGE ( HID_PROPC_START + 278) +#define HID_EVT_ROWCHANGE ( HID_PROPC_START + 279) +#define HID_EVT_RELOADING ( HID_PROPC_START + 280) +#define HID_EVT_UNLOADING ( HID_PROPC_START + 281) +#define HID_EVT_ADJUSTMENTVALUECHANGED ( HID_PROPC_START + 282) +#define HID_PROP_TOGGLE ( HID_PROPC_START + 283) +#define HID_PROP_FOCUSONCLICK ( HID_PROPC_START + 284) +#define HID_PROP_HIDEINACTIVESELECTION ( HID_PROPC_START + 285) +#define HID_PROP_VISUALEFFECT ( HID_PROPC_START + 286) +#define HID_PROP_BORDERCOLOR ( HID_PROPC_START + 287) +#define UID_PROP_DLG_BORDERCOLOR ( HID_PROPC_START + 288) +#define HID_PROP_IMAGEPOSITION ( HID_PROPC_START + 289) +#define HID_PROP_NOLABEL ( HID_PROPC_START + 290) +#define HID_PROP_WRITING_MODE ( HID_PROPC_START + 291) +#define HID_PROP_ANCHOR_TYPE ( HID_PROPC_START + 292) +#define HID_FM_PROPDLG_TABCTR ( HID_PROPC_START + 293) +#define HID_FM_PROPDLG_TAB_GENERAL ( HID_PROPC_START + 294) +#define HID_FM_PROPDLG_TAB_DATA ( HID_PROPC_START + 295) +#define HID_FM_PROPDLG_TAB_EVT ( HID_PROPC_START + 296) + // please adjust HID_LAST_PROPC_ID if you add new ids here! + +#define HID_LAST_PROPC_ID HID_FM_PROPDLG_TAB_EVT + +#if HID_LAST_PROPC_ID > HID_PROPC_END + #error help id overflow (PROPC) +#endif + +#endif // EXTENSIONS_PROPCTRLR_HRC diff --git a/extensions/inc/update.hrc b/extensions/inc/update.hrc new file mode 100644 index 000000000000..806f99686bee --- /dev/null +++ b/extensions/inc/update.hrc @@ -0,0 +1,48 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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 EXTENSIONS_UPDATE_HRC
+#define EXTENSIONS_UPDATE_HRC
+
+#include "extensio.hrc"
+
+#define HID_CHECK_FOR_UPD_DLG ( HID_UPDATE_START + 0) +#define HID_CHECK_FOR_UPD_CLOSE ( HID_UPDATE_START + 1) +#define HID_CHECK_FOR_UPD_PAUSE ( HID_UPDATE_START + 2) +#define HID_CHECK_FOR_UPD_RESUME ( HID_UPDATE_START + 3) +#define HID_CHECK_FOR_UPD_DOWNLOAD ( HID_UPDATE_START + 4) +#define HID_CHECK_FOR_UPD_DOWNLOAD2 ( HID_UPDATE_START + 5) +#define HID_CHECK_FOR_UPD_INSTALL ( HID_UPDATE_START + 6) +#define HID_CHECK_FOR_UPD_STATUS ( HID_UPDATE_START + 7) +#define HID_CHECK_FOR_UPD_DESCRIPTION ( HID_UPDATE_START + 8) +#define HID_CHECK_FOR_UPD_CANCEL ( HID_UPDATE_START + 9) + // !! if you add new IDs, please also adjust HID_UPDATE_LAST below !! +#define HID_UPDATE_LAST HID_CHECK_FOR_UPD_CANCEL + +#if HID_UPDATE_LAST > HID_UPDATE_END + #error help id range overflow (UPDATE) +#endif +
+#endif // EXTENSIONS_UPDATE_HRC
diff --git a/extensions/prj/d.lst b/extensions/prj/d.lst index 053796a2c365..ecfe0ef9abcd 100644 --- a/extensions/prj/d.lst +++ b/extensions/prj/d.lst @@ -20,6 +20,7 @@ mkdir: %_DEST%\bin%_EXT%\so ..\%__SRC%\bin\nsplugin %_DEST%\bin%_EXT%\nsplugin ..\%__SRC%\bin\npsoplugin.dll %_DEST%\bin%_EXT%\npsoplugin.dll ..\%__SRC%\bin\npsoplugin_so.dll %_DEST%\bin%_EXT%\so\npsoplugin.dll +..\%__SRC%\bin\x64\so_activex.dll %_DEST%\bin%_EXT%\so_activex_x64.dll ..\%__SRC%\bin\mdibundle.zip %_DEST%\bin%_EXT%\mdibundle.zip ..\source\bibliography\uiconfig\sbibliography\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\sbibliography\menubar\*.xml diff --git a/extensions/source/abpilot/abpresid.hrc b/extensions/source/abpilot/abpresid.hrc index 9ca5ccdea925..6b7a7d467d2b 100644 --- a/extensions/source/abpilot/abpresid.hrc +++ b/extensions/source/abpilot/abpresid.hrc @@ -31,9 +31,7 @@ #ifndef EXTENSIONS_ABPRESID_HRC #define EXTENSIONS_ABPRESID_HRC -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "abpilot.hrc" //======================================================================== // basics diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index c28d28481884..50e9fb0326ae 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -31,12 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" #include "abspilot.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif -#ifndef EXTENSIONS_ABPRESID_HRC +#include "abpilot.hrc" #include "abpresid.hrc" -#endif #include "componentmodule.hxx" #include <tools/debug.hxx> #include <svtools/localresaccess.hxx> diff --git a/extensions/source/activex/main/SOActiveX.cpp b/extensions/source/activex/main/SOActiveX.cpp index 9811cd3f7c19..52833ae17587 100644 --- a/extensions/source/activex/main/SOActiveX.cpp +++ b/extensions/source/activex/main/SOActiveX.cpp @@ -1025,6 +1025,7 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di ) hr = CreateFrameOldWay( mOffWin, di.prcBounds->right - di.prcBounds->left, di.prcBounds->bottom - di.prcBounds->top ); + if( !SUCCEEDED( hr ) ) { // if the frame can not be opened do not try any more @@ -1038,6 +1039,7 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di ) { hr = LoadURLToFrame(); mbLoad = FALSE; + if( !SUCCEEDED( hr ) ) { // if the document can not be opened do not try any more diff --git a/extensions/source/activex/main/SOComWindowPeer.h b/extensions/source/activex/main/SOComWindowPeer.h index 27c6f4037baa..55be8cafcbb0 100644 --- a/extensions/source/activex/main/SOComWindowPeer.h +++ b/extensions/source/activex/main/SOComWindowPeer.h @@ -55,7 +55,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER) /* [in] */ short /*s*/, /* [retval][out] */ long __RPC_FAR *ret) { - *ret = (long) m_hwnd; + *ret = HandleToLong( m_hwnd ); return S_OK; } diff --git a/extensions/source/activex/main/makefile.mk b/extensions/source/activex/main/makefile.mk index 64dcbe34a2e1..6ecd7f909484 100644 --- a/extensions/source/activex/main/makefile.mk +++ b/extensions/source/activex/main/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # 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 @@ -49,6 +49,10 @@ LIBTARGET=NO USE_DEFFILE=YES UWINAPILIB= +.IF "$(BUILD_X64)"!="" +USE_DEFFILE_X64=TRUE +.ENDIF + INCPRE+=$(foreach,i,$(ATL_INCLUDE) -I$(i)) \ -I$(MISC) \ @@ -58,9 +62,6 @@ INCPRE+=$(foreach,i,$(ATL_INCLUDE) -I$(i)) \ .IF "$(PRODUCT)"!="" RC+=-DPRODUCT .ENDIF -.IF "$(USE_STLP_DEBUG)"!="" -CDEFS+=-D_DEBUG -.ENDIF # "$(USE_STLP_DEBUG)"!="" RCFILES=\ $(TARGET).rc @@ -86,13 +87,9 @@ SHL1STDLIBS=\ .IF "$(COM)"!="GCC" .IF "$(CCNUMVER)" > "001300000000" -.IF "$(USE_STLP_DEBUG)" != "" - SHL1STDLIBS+= $(ATL_LIB)$/atlsd.lib -.ELSE SHL1STDLIBS+= $(ATL_LIB)$/atls.lib .ENDIF .ENDIF -.ENDIF # $(KERNEL32LIB) \ @@ -110,9 +107,51 @@ SHL1RES=$(RES)$/$(TARGET).res .ENDIF +.IF "$(BUILD_X64)"!="" +# -------------------- x64 ----------------------- + +CDEFS_X64+:=$(foreach,i,$(CDEFS) $(subst,-D_X86_=1, $i)) +LIBTARGET_X64=NO +USE_DEFFILE_X64=YES +UWINAPILIB_X64= + +SLOFILES_X64= \ + $(SLO_X64)$/so_activex.obj \ + $(SLO_X64)$/SOActiveX.obj \ + $(SLO_X64)$/SOComWindowPeer.obj \ + $(SLO_X64)$/SODispatchInterceptor.obj \ + $(SLO_X64)$/SOActionsApproval.obj \ + $(SLO_X64)$/StdAfx2.obj + +SHL1TARGET_X64=$(TARGET) + +SHL1STDLIBS_X64+=\ + $(UUIDLIB_X64) \ + $(ADVAPI32LIB_X64) \ + $(OLE32LIB_X64) \ + $(OLEAUT32LIB_X64) \ + $(GDI32LIB_X64) \ + $(URLMONLIB_X64) \ + $(SHLWAPILIB_X64) \ + $(KERNEL32LIB_X64) \ + $(USER32LIB_X64) \ + $(MSVCRT_X64) \ + $(MSVCPRT_X64) \ + $(OLDNAMESLIB_X64) + +SHL1OBJS_X64=$(SLOFILES_X64) +SHL1DEF_X64=$(TARGET).def + +SHL1STDLIBS_X64+= $(ATL_LIB)$/amd64$/atls.lib + +.ENDIF # "$(BUILD_X64)"!="" + # --- Targets ---------------------------------- +.INCLUDE : set_wntx64.mk +VERSIONOBJ_X64= .INCLUDE : target.mk +.INCLUDE : tg_wntx64.mk $(MISC)$/envsettings.h : makefile.mk -$(RM) $@ diff --git a/extensions/source/activex/main/so_activex.cpp b/extensions/source/activex/main/so_activex.cpp index 057406a0f1f2..7db1c67e1585 100644 --- a/extensions/source/activex/main/so_activex.cpp +++ b/extensions/source/activex/main/so_activex.cpp @@ -24,6 +24,30 @@ BEGIN_OBJECT_MAP(ObjectMap) OBJECT_ENTRY(CLSID_SOActiveX, CSOActiveX) END_OBJECT_MAP() + +#define X64_LIB_NAME "so_activex_x64.dll" +#define X32_LIB_NAME "so_activex.dll" + +// 06.11.2009 tkr: to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY +// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems. +// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and +// extensions\source\activex\main\so_activex.cpp +#ifndef KEY_WOW64_64KEY + #define KEY_WOW64_64KEY (0x0100) +#endif + +const REGSAM n64KeyAccess = KEY_ALL_ACCESS | KEY_WOW64_64KEY; +const REGSAM n32KeyAccess = KEY_ALL_ACCESS; + +#ifdef _AMD64_ +const BOOL bX64 = TRUE; +#else +const BOOL bX64 = FALSE; +#endif + +// 10.11.2009 tkr: MinGW doesn't know anything about RegDeleteKeyExA if WINVER < 0x0502. +WINADVAPI LONG WINAPI RegDeleteKeyExA(HKEY,LPCSTR,REGSAM,DWORD); + ///////////////////////////////////////////////////////////////////////////// // DLL Entry Point @@ -131,20 +155,21 @@ const char* aLocalPrefix = "Software\\Classes\\"; BOOL createKey( HKEY hkey, const char* aKeyToCreate, + REGSAM nKeyAccess, const char* aValue = NULL, const char* aChildName = NULL, const char* aChildValue = NULL ) { HKEY hkey1; - return ( ERROR_SUCCESS == RegCreateKey( hkey, aKeyToCreate, &hkey1 ) - && ( !aValue || ERROR_SUCCESS == RegSetValueEx( hkey1, + return ( ERROR_SUCCESS == RegCreateKeyExA( hkey, aKeyToCreate, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && ( !aValue || ERROR_SUCCESS == RegSetValueExA( hkey1, "", 0, REG_SZ, (const BYTE*)aValue, strlen( aValue ) ) ) - && ( !aChildName || ERROR_SUCCESS == RegSetValueEx( hkey1, + && ( !aChildName || ERROR_SUCCESS == RegSetValueExA( hkey1, aChildName, 0, REG_SZ, @@ -154,8 +179,8 @@ BOOL createKey( HKEY hkey, } -STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ); -STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiveXPath ) +STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ); +STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess, const char* pProgramPath, const char* pLibName ) { BOOL aResult = FALSE; @@ -164,89 +189,86 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv HKEY hkey2 = NULL; HKEY hkey3 = NULL; HKEY hkey4 = NULL; - char aSubKey[513]; + char aSubKey[513]; int ind; const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; - char pActiveXPath101[1024]; - char pPrCatalogPath[1019]; + char pActiveXPath[1124]; + char pActiveXPath101[1124]; // In case SO7 is installed for this user he can have local registry entries that will prevent him from // using SO8 ActiveX control. The fix is just to clean up the local entries related to ActiveX control. // Unfortunately it can be done only for the user who installs the office. if ( bForAllUsers ) - DllUnregisterServerNative( nMode, sal_False ); + DllUnregisterServerNative( nMode, sal_False, sal_False ); #ifdef MY_DEBUG - MessageBoxA(NULL, pActiveXPath, "Library Path, ( from library )", MB_OK | MB_ICONINFORMATION); + MessageBoxA(NULL, pProgramPath, "Library Path, ( from library )", MB_OK | MB_ICONINFORMATION); #endif - if ( pActiveXPath ) + if ( pProgramPath && strlen( pProgramPath ) < 1024 ) { - sprintf( pActiveXPath101, "%s, 101", pActiveXPath ); - - int nPrCatLength = strlen( pActiveXPath ) - sizeof( "so_activex.dll" ) + 1; - strncpy( pPrCatalogPath, pActiveXPath, nPrCatLength ); - pPrCatalogPath[ nPrCatLength ] = 0; + sprintf( pActiveXPath, "%s\\%s", pProgramPath, pLibName ); + sprintf( pActiveXPath101, "%s\\%s, 101", pProgramPath, pLibName ); { - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); aResult = - ( ERROR_SUCCESS == RegCreateKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey ) - && ERROR_SUCCESS == RegSetValueEx( hkey, "", 0, REG_SZ, (const BYTE*)"SOActiveX Class", 17 ) - && createKey( hkey, "Control" ) - && createKey( hkey, "EnableFullPage" ) - && createKey( hkey, "InprocServer32", pActiveXPath, "ThreadingModel", "Apartment" ) - && createKey( hkey, "MiscStatus", "0" ) - && createKey( hkey, "MiscStatus\\1", "131473" ) - && createKey( hkey, "ProgID", "so_activex.SOActiveX.1" ) - && createKey( hkey, "Programmable" ) - && createKey( hkey, "ToolboxBitmap32", pActiveXPath101 ) - && createKey( hkey, "TypeLib", aTypeLib ) - && createKey( hkey, "Version", "1.0" ) - && createKey( hkey, "VersionIndependentProgID", "so_activex.SOActiveX" ) + ( ERROR_SUCCESS == RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey , NULL ) + && ERROR_SUCCESS == RegSetValueExA( hkey, "", 0, REG_SZ, (const BYTE*)"SOActiveX Class", 17 ) + && createKey( hkey, "Control", nKeyAccess ) + && createKey( hkey, "EnableFullPage", nKeyAccess ) + && createKey( hkey, "InprocServer32", nKeyAccess, pActiveXPath, "ThreadingModel", "Apartment" ) + && createKey( hkey, "MiscStatus", nKeyAccess, "0" ) + && createKey( hkey, "MiscStatus\\1", nKeyAccess, "131473" ) + && createKey( hkey, "ProgID", nKeyAccess, "so_activex.SOActiveX.1" ) + && createKey( hkey, "Programmable", nKeyAccess ) + && createKey( hkey, "ToolboxBitmap32", nKeyAccess, pActiveXPath101 ) + && createKey( hkey, "TypeLib", nKeyAccess, aTypeLib ) + && createKey( hkey, "Version", nKeyAccess, "1.0" ) + && createKey( hkey, "VersionIndependentProgID", nKeyAccess, "so_activex.SOActiveX" ) && ERROR_SUCCESS == RegCloseKey( hkey ) - && ERROR_SUCCESS == RegCreateKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aPrefix, &hkey ) - && createKey( hkey, "so_activex.SOActiveX", "SOActiveX Class" ) - && ERROR_SUCCESS == RegCreateKey( hkey, "so_activex.SOActiveX", &hkey1 ) - && createKey( hkey1, "CLSID", aClassID ) - && createKey( hkey1, "CurVer", "so_activex.SOActiveX.1" ) + && ERROR_SUCCESS == RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aPrefix, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey , NULL ) + && createKey( hkey, "so_activex.SOActiveX", nKeyAccess, "SOActiveX Class" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "so_activex.SOActiveX", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && createKey( hkey1, "CLSID", nKeyAccess, aClassID ) + && createKey( hkey1, "CurVer", nKeyAccess, "so_activex.SOActiveX.1" ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) - && createKey( hkey, "so_activex.SOActiveX.1", "SOActiveX Class" ) - && ERROR_SUCCESS == RegCreateKey( hkey, "so_activex.SOActiveX.1", &hkey1 ) - && createKey( hkey1, "CLSID", aClassID ) + && createKey( hkey, "so_activex.SOActiveX.1", nKeyAccess, "SOActiveX Class" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "so_activex.SOActiveX.1", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && createKey( hkey1, "CLSID", nKeyAccess, aClassID ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) - && ERROR_SUCCESS == RegCreateKey( hkey, "TypeLib", &hkey1 ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aTypeLib, &hkey2 ) - && createKey( hkey2, "1.0", "wrap_activex 1.0 Type Library" ) - && ERROR_SUCCESS == RegCreateKey( hkey2, "1.0", &hkey3 ) - && ERROR_SUCCESS == RegCreateKey( hkey3, "0", &hkey4 ) - && createKey( hkey4, "win32", pActiveXPath ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "TypeLib", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aTypeLib, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "1.0", nKeyAccess, "wrap_activex 1.0 Type Library" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey2, "1.0", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey3 , NULL ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey3, "0", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey4 , NULL ) + && createKey( hkey4, "win32", nKeyAccess, pActiveXPath ) && ERROR_SUCCESS == RegCloseKey( hkey4 ) - && createKey( hkey3, "FLAGS", "0" ) - && createKey( hkey3, "HELPDIR", pPrCatalogPath ) + && createKey( hkey3, "FLAGS", nKeyAccess, "0" ) + && createKey( hkey3, "HELPDIR", nKeyAccess, pProgramPath ) && ERROR_SUCCESS == RegCloseKey( hkey3 ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) - && ERROR_SUCCESS == RegCreateKey( hkey, "Interface", &hkey1 ) - && createKey( hkey1, aInterIDWinPeer, "ISOComWindowPeer" ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aInterIDWinPeer, &hkey2 ) - && createKey( hkey2, "ProxyStubClsid", aProxyStubWinPeer ) - && createKey( hkey2, "ProxyStubClsid32", aProxyStubWinPeer ) - && createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "Interface", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && createKey( hkey1, aInterIDWinPeer, nKeyAccess, "ISOComWindowPeer" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aInterIDWinPeer, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "ProxyStubClsid", nKeyAccess, aProxyStubWinPeer ) + && createKey( hkey2, "ProxyStubClsid32", nKeyAccess, aProxyStubWinPeer ) + && createKey( hkey2, "TypeLib", nKeyAccess, aTypeLib, "Version", "1.0" ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) - && createKey( hkey1, aInterIDActApprove, "ISOActionsApproval" ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aInterIDActApprove, &hkey2 ) - && createKey( hkey2, "ProxyStubClsid", aProxyStubActApprove ) - && createKey( hkey2, "ProxyStubClsid32", aProxyStubActApprove ) - && createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" ) + && createKey( hkey1, aInterIDActApprove, nKeyAccess, "ISOActionsApproval" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aInterIDActApprove, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "ProxyStubClsid", nKeyAccess, aProxyStubActApprove ) + && createKey( hkey2, "ProxyStubClsid32", nKeyAccess, aProxyStubActApprove ) + && createKey( hkey2, "TypeLib", nKeyAccess, aTypeLib, "Version", "1.0" ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) - && createKey( hkey1, aInterIDDispInt, "ISODispatchInterceptor" ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aInterIDDispInt, &hkey2 ) - && createKey( hkey2, "ProxyStubClsid", aProxyStubDispInt ) - && createKey( hkey2, "ProxyStubClsid32", aProxyStubDispInt ) - && createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" ) + && createKey( hkey1, aInterIDDispInt, nKeyAccess, "ISODispatchInterceptor" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aInterIDDispInt, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "ProxyStubClsid", nKeyAccess, aProxyStubDispInt ) + && createKey( hkey2, "ProxyStubClsid32", nKeyAccess, aProxyStubDispInt ) + && createKey( hkey2, "TypeLib", nKeyAccess, aTypeLib, "Version", "1.0" ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) && ERROR_SUCCESS == RegCloseKey( hkey ) ); @@ -259,11 +281,11 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv { if( nForModes[ind] & nMode ) { - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) -// || ERROR_SUCCESS != RegSetValueEx(hkey, "Extension", 0, REG_SZ, -// (const BYTE *)aFileExt[ind], strlen( aFileExt[ind] ) ) - || ERROR_SUCCESS != RegSetValueEx(hkey, "CLSID", 0, REG_SZ, + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) +// || ERROR_SUCCESS != RegSetValueExA(hkey, "Extension", 0, REG_SZ, +// (const BYTE *)aFileExt[ind], strlen( aFileExt[ind] ) ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "CLSID", 0, REG_SZ, (const BYTE *)aClassID, strlen(aClassID)) ) aResult = FALSE; @@ -271,9 +293,9 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv RegCloseKey(hkey),hkey= NULL; /* - wsprintf( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) - || ERROR_SUCCESS != RegSetValueEx(hkey, "Content Type", 0, REG_SZ, + wsprintfA( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "Content Type", 0, REG_SZ, (const BYTE *)aMimeType[ind], strlen( aMimeType[ind] ) ) ) aResult = FALSE; if( hkey ) @@ -282,13 +304,13 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv } } - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); - if ( aResult && ERROR_SUCCESS == RegOpenKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + if ( aResult && ERROR_SUCCESS == RegOpenKeyExA(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, nKeyAccess, &hkey) ) { for( ind = 0; ind < SUPPORTED_EXT_NUM; ind++ ) { - wsprintf( aSubKey, "EnableFullPage\\%s", aFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey( hkey, aSubKey, &hkey1 ) ) + wsprintfA( aSubKey, "EnableFullPage\\%s", aFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( hkey, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) ) aResult = FALSE; if ( hkey1 ) @@ -304,30 +326,62 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv return aResult; } +STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit, const char* pProgramPath ) +{ + HRESULT hr = S_OK; + if ( bFor64Bit ) + hr = DllRegisterServerNative_Impl( nMode, bForAllUsers, n64KeyAccess, pProgramPath, X64_LIB_NAME ); + + if ( SUCCEEDED( hr ) ) + hr = DllRegisterServerNative_Impl( nMode, bForAllUsers, n32KeyAccess, pProgramPath, X32_LIB_NAME ); + + return hr; +} + + ///////////////////////////////////////////////////////////////////////////// // DllUnregisterServer - Removes entries from the system registry +HRESULT DeleteKeyTree( HKEY hkey, const char* pPath, REGSAM nKeyAccess ) +{ + HKEY hkey1 = NULL; + + char pSubKeyName[256]; + // first delete the subkeys + while( ERROR_SUCCESS == RegOpenKeyExA( hkey, pPath, 0, nKeyAccess, &hkey1) + && ERROR_SUCCESS == RegEnumKeyA( hkey1, 0, pSubKeyName, 256 ) + && ERROR_SUCCESS == DeleteKeyTree( hkey1, pSubKeyName, nKeyAccess ) ) + { + RegCloseKey( hkey1 ),hkey1= NULL; + } -STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ) + if ( hkey1 ) + RegCloseKey( hkey1 ),hkey1= NULL; + + // delete the key itself + return RegDeleteKeyExA( hkey, pPath, nKeyAccess & ( KEY_WOW64_64KEY | KEY_WOW64_32KEY ), 0 ); +} + +STDAPI DllUnregisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) { HKEY hkey = NULL; BOOL fErr = FALSE; - char aSubKey[513]; - const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; + char aSubKey[513]; + const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; - for( int ind = 0; ind < SUPPORTED_EXT_NUM; ind++ ) + for( int ind = 0; ind < SUPPORTED_EXT_NUM; ind++ ) { if( nForModes[ind] & nMode ) { DWORD nSubKeys = 0, nValues = 0; - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { - if ( ERROR_SUCCESS != RegDeleteValue( hkey, "CLSID" ) ) + if ( ERROR_SUCCESS != RegDeleteValue( hkey, "CLSID" ) ) fErr = TRUE; - if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, NULL, NULL, NULL, + if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, NULL, NULL, NULL, &nSubKeys, NULL, NULL, &nValues, NULL, NULL, NULL, NULL ) ) { @@ -338,12 +392,12 @@ STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } - wsprintf( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { @@ -358,43 +412,53 @@ STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } } } - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%sso_activex.SOActiveX", aPrefix ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%sso_activex.SOActiveX", aPrefix ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%sso_activex.SOActiveX.1", aPrefix ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%sso_activex.SOActiveX.1", aPrefix ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\TypeLib\\%s", aPrefix, aTypeLib ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\TypeLib\\%s", aPrefix, aTypeLib ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDWinPeer ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDWinPeer ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDDispInt ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDDispInt ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDActApprove ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDActApprove ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; return !fErr; } +STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ) +{ + HRESULT hr = DllUnregisterServerNative_Impl( nMode, bForAllUsers, n32KeyAccess ); + if ( SUCCEEDED( hr ) && bFor64Bit ) + hr = DllUnregisterServerNative_Impl( nMode, bForAllUsers, n64KeyAccess ); + + return hr; +} + + ///////////////////////////////////////////////////////////////////////////// // DllRegisterServerDoc - Adds entries to the system registry @@ -409,41 +473,41 @@ const char* aMSMimeType[] = { "application/msword", "application/mspowerpoint" }; const int nForMSModes[] = { 1, 1, 2, 2, 4, 4, 4 }; -STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ); -STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers ) +STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ); +STDAPI DllRegisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) { BOOL aResult = TRUE; HKEY hkey = NULL; HKEY hkey1 = NULL; - char aSubKey[513]; + char aSubKey[513]; int ind; - const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; + const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; // In case SO7 is installed for this user he can have local registry entries that will prevent him from // using SO8 ActiveX control. The fix is just to clean up the local entries related to ActiveX control. // Unfortunately it can be done only for the user who installs the office. if ( bForAllUsers ) - DllUnregisterServerDoc( nMode, sal_False ); + DllUnregisterServerDoc( nMode, sal_False, sal_False ); for( ind = 0; ind < SUPPORTED_MSEXT_NUM && aResult; ind++ ) { if( nForMSModes[ind] & nMode ) { - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) - || ERROR_SUCCESS != RegSetValueEx(hkey, "Extension", 0, REG_SZ, + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "Extension", 0, REG_SZ, (const BYTE *)aMSFileExt[ind], strlen( aMSFileExt[ind] ) ) - || ERROR_SUCCESS != RegSetValueEx(hkey, "CLSID", 0, REG_SZ, + || ERROR_SUCCESS != RegSetValueExA(hkey, "CLSID", 0, REG_SZ, (const BYTE *)aClassID, strlen(aClassID)) ) aResult = FALSE; if( hkey ) RegCloseKey(hkey),hkey= NULL; - wsprintf( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) - || ERROR_SUCCESS != RegSetValueEx(hkey, "Content Type", 0, REG_SZ, + wsprintfA( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "Content Type", 0, REG_SZ, (const BYTE *)aMSMimeType[ind], strlen( aMSMimeType[ind] ) ) ) aResult = FALSE; @@ -452,16 +516,16 @@ STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers ) } } - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); - if ( aResult && ERROR_SUCCESS == RegCreateKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey ) - && createKey( hkey, "EnableFullPage" ) ) + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + if ( aResult && ERROR_SUCCESS == RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey , NULL ) + && createKey( hkey, "EnableFullPage", nKeyAccess ) ) { for( ind = 0; ind < SUPPORTED_MSEXT_NUM; ind++ ) { if( nForMSModes[ind] & nMode ) { - wsprintf( aSubKey, "EnableFullPage\\%s", aMSFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey( hkey, aSubKey, &hkey1 ) ) + wsprintfA( aSubKey, "EnableFullPage\\%s", aMSFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( hkey, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) ) aResult = FALSE; if ( hkey1 ) @@ -478,17 +542,28 @@ STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers ) return aResult; } +STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ) +{ + HRESULT hr = S_OK; + if ( bFor64Bit ) + hr = DllRegisterServerDoc_Impl( nMode, bForAllUsers, n64KeyAccess ); + + if ( SUCCEEDED( hr ) ) + hr = DllRegisterServerDoc_Impl( nMode, bForAllUsers, n32KeyAccess ); + + return hr; +} ///////////////////////////////////////////////////////////////////////////// // DllUnregisterServerDoc - Removes entries from the system registry -STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) +STDAPI DllUnregisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) { HKEY hkey = NULL; BOOL fErr = FALSE; - char aSubKey[513]; - const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; + char aSubKey[513]; + const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; for( int ind = 0; ind < SUPPORTED_MSEXT_NUM; ind++ ) { @@ -496,8 +571,8 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) { DWORD nSubKeys = 0, nValues = 0; - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { @@ -518,12 +593,12 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } - wsprintf( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { @@ -541,7 +616,7 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } } @@ -550,33 +625,59 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) return !fErr; } +STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ) +{ + HRESULT hr = S_OK; + if ( bFor64Bit ) + hr = DllUnregisterServerDoc_Impl( nMode, bForAllUsers, n64KeyAccess ); + + if ( SUCCEEDED( hr ) ) + hr = DllUnregisterServerDoc_Impl( nMode, bForAllUsers, n32KeyAccess ); + + return hr; +} + +///////////////////////////////////////////////////////////////////////////// +// DllRegisterServer - regsvr32 entry point + STDAPI DllRegisterServer( void ) { - char pActiveXPath[1019]; + char pProgramPath[1024]; HRESULT aResult = E_FAIL; - HMODULE aCurModule = GetModuleHandleA( "so_activex.dll" ); - if( aCurModule && GetModuleFileNameA( aCurModule, pActiveXPath, 1019 ) ) + HMODULE aCurModule = GetModuleHandleA( bX64 ? X64_LIB_NAME : X32_LIB_NAME ); + DWORD nLen = 0; + DWORD nLibNameLen = strlen( bX64 ? X64_LIB_NAME : X32_LIB_NAME ); + + if( aCurModule ) { - aResult = DllRegisterServerNative( 31, TRUE, pActiveXPath ); - if( SUCCEEDED( aResult ) ) - aResult = DllRegisterServerDoc( 31, TRUE ); - else + nLen = GetModuleFileNameA( aCurModule, pProgramPath, 1024 ); + if ( nLen && nLen > nLibNameLen + 1 ) { - aResult = DllRegisterServerNative( 31, FALSE, pActiveXPath ); + pProgramPath[ nLen - nLibNameLen - 1 ] = 0; + aResult = DllRegisterServerNative( 31, TRUE, bX64, pProgramPath ); if( SUCCEEDED( aResult ) ) - aResult = DllRegisterServerDoc( 31, FALSE ); + aResult = DllRegisterServerDoc( 31, TRUE, bX64 ); + else + { + aResult = DllRegisterServerNative( 31, FALSE, bX64, pProgramPath ); + if( SUCCEEDED( aResult ) ) + aResult = DllRegisterServerDoc( 31, FALSE, bX64 ); + } } } return aResult; } +///////////////////////////////////////////////////////////////////////////// +// DllUnregisterServer - regsvr32 entry point + STDAPI DllUnregisterServer( void ) { - DllUnregisterServerDoc( 63, FALSE ); - DllUnregisterServerNative( 63, FALSE ); - DllUnregisterServerDoc( 63, TRUE ); - return DllUnregisterServerNative( 63, TRUE ); + DllUnregisterServerDoc( 63, FALSE, bX64 ); + DllUnregisterServerNative( 63, FALSE, bX64 ); + DllUnregisterServerDoc( 63, TRUE, bX64 ); + return DllUnregisterServerNative( 63, TRUE, bX64 ); } diff --git a/extensions/source/bibliography/bib.hrc b/extensions/source/bibliography/bib.hrc index fad6da48c020..c30bd0846875 100644 --- a/extensions/source/bibliography/bib.hrc +++ b/extensions/source/bibliography/bib.hrc @@ -30,7 +30,7 @@ #ifndef BIB_HRC #define BIB_HRC -#include <extensio.hrc> +#include "bibliography.hrc" #ifndef RID_BIB_START #define RID_BIB_START RID_EXTENSIONS_START diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx index 77d9858f028d..464a45ca3e76 100644 --- a/extensions/source/bibliography/bibbeam.cxx +++ b/extensions/source/bibliography/bibbeam.cxx @@ -32,17 +32,13 @@ #include "precompiled_extensions.hxx" #include <osl/mutex.hxx> #include <tools/urlobj.hxx> -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include <comphelper/processfactory.hxx> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/util/XURLTransformer.hpp> -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "bibliography.hrc" #include <vcl/lstbox.hxx> #include <vcl/edit.hxx> #include <tools/debug.hxx> diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 3d9667b94f06..a554741c666a 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -370,7 +370,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, const rtl: BibBookContainer *pMyWindow = new BibBookContainer( pParent, m_pDatMan ); pMyWindow->Show(); - ::bib::BibView* pView = new ::bib::BibView( pMyWindow, m_pDatMan, WB_SECTION_STYLE | WB_3DLOOK ); + ::bib::BibView* pView = new ::bib::BibView( pMyWindow, m_pDatMan, WB_VSCROLL | WB_HSCROLL | WB_3DLOOK ); pView->Show(); m_pDatMan->SetView( pView ); diff --git a/extensions/source/bibliography/bibview.hxx b/extensions/source/bibliography/bibview.hxx index 57b713e0f24d..feb8eceb0e35 100644 --- a/extensions/source/bibliography/bibview.hxx +++ b/extensions/source/bibliography/bibview.hxx @@ -32,8 +32,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XControlContainer.hpp> -#include <svtools/section.hxx> -#include <svtools/sectctr.hxx> #include "formcontrolcontainer.hxx" #include "bibshortcuthandler.hxx" diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index dafc065a47b8..7dd3e3984de9 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -81,20 +81,14 @@ #include "bibview.hxx" // #100312# --------- #include "bibbeam.hxx" -#ifndef _BIB_FMPROP_HRC #include "bibprop.hrc" -#endif #include "toolbar.hxx" #include "toolbar.hrc" #include "bibconfig.hxx" #include "bibbeam.hxx" -#ifndef BIB_HRC #include "bib.hrc" -#endif #include "datman.hrc" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "bibliography.hrc" #include <connectivity/dbtools.hxx> using namespace ::com::sun::star; diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index c1547c952873..50bc4821f0ac 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -42,18 +42,12 @@ #include "framectr.hxx" #include "datman.hxx" #include "bibresid.hxx" -#ifndef BIB_HRC #include "bib.hrc" -#endif -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include "bibconfig.hxx" #include <cppuhelper/implbase1.hxx> // helper for implementations #include <vcl/svapp.hxx> -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include <extensio.hrc> -#endif +#include "bibliography.hrc" #include <comphelper/processfactory.hxx> #include <com/sun/star/form/XConfirmDeleteListener.hpp> #include <com/sun/star/form/runtime/XFormController.hpp> diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index e072279f9656..eb6e941c313b 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -40,28 +40,18 @@ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/form/ListSourceType.hpp> #include <com/sun/star/awt/XWindow.hpp> -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include <cppuhelper/implbase1.hxx> // helper for implementations #include "general.hxx" #include "sections.hrc" #include "bibresid.hxx" #include "datman.hxx" #include "bibconfig.hxx" -#ifndef _BIB_FMPROP_HRC #include "bibprop.hrc" -#endif -#ifndef BIB_HRC #include "bib.hrc" -#endif #include "bibmod.hxx" -#ifndef BIBTOOLS_HXX #include "bibtools.hxx" -#endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "bibliography.hrc" #include <tools/debug.hxx> #include <vcl/mnemonic.hxx> #include <vcl/svapp.hxx> @@ -69,9 +59,7 @@ #include <vcl/mnemonic.hxx> #include <algorithm> #include <functional> -#ifndef _VECTOR_ #include <vector> -#endif using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/extensions/source/bibliography/hidother.src b/extensions/source/bibliography/hidother.src index b0dbac415a31..82111c538094 100644 --- a/extensions/source/bibliography/hidother.src +++ b/extensions/source/bibliography/hidother.src @@ -27,8 +27,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "..\..\inc\extensio.hrc" // HID_FUNC_XXX -//#include "hidother.hrc" + +#include "bibliography.hrc" hidspecial HID_BIB_IDENTIFIER_POS { HelpID = HID_BIB_IDENTIFIER_POS ; }; hidspecial HID_BIB_AUTHORITYTYPE_POS { HelpID = HID_BIB_AUTHORITYTYPE_POS ; }; diff --git a/extensions/source/bibliography/menu.src b/extensions/source/bibliography/menu.src index d06cce2e4361..468fbf5837db 100644 --- a/extensions/source/bibliography/menu.src +++ b/extensions/source/bibliography/menu.src @@ -36,7 +36,7 @@ #ifndef _GLOBALACC_SRC #include <svx/globlac.hrc> #endif -#include <extensio.hrc> +#include "bibliography.hrc" #include "bib.hrc" diff --git a/extensions/source/bibliography/sections.src b/extensions/source/bibliography/sections.src index b6fd032d5f4e..ea9d5f3412e3 100644 --- a/extensions/source/bibliography/sections.src +++ b/extensions/source/bibliography/sections.src @@ -30,7 +30,7 @@ //#pragma CHARSET_ANSI #include "sections.hrc" -#include "extensio.hrc" +#include "bibliography.hrc" #define FT_POS 12 #define FTSIZE_LEFT 88 diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 71de2963862b..416ff1e1845b 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -620,8 +620,8 @@ void BibToolBar::RebuildToolbar() void BibToolBar::ApplyImageList() { ImageList& rList = ( nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ) ? - ( GetDisplayBackground().GetColor().IsDark() ? aImgLstHC : aImgLst ) : - ( GetDisplayBackground().GetColor().IsDark() ? aBigImgLstHC : aBigImgLst ); + ( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImgLstHC : aImgLst ) : + ( GetSettings().GetStyleSettings().GetHighContrastMode() ? aBigImgLstHC : aBigImgLst ); SetItemImage(TBC_BT_AUTOFILTER , rList.GetImage(SID_FM_AUTOFILTER)); SetItemImage(TBC_BT_FILTERCRIT , rList.GetImage(SID_FM_FILTERCRIT)); diff --git a/extensions/source/bibliography/toolbar.src b/extensions/source/bibliography/toolbar.src index 49154b69a3c0..a291a11e25bd 100644 --- a/extensions/source/bibliography/toolbar.src +++ b/extensions/source/bibliography/toolbar.src @@ -28,7 +28,7 @@ * ************************************************************************/ #include <svx/svxids.hrc> -#include "extensio.hrc" +#include "bibliography.hrc" #include "toolbar.hrc" #define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }; diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 43d8c7af5889..1d02cac88a4b 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -376,7 +376,7 @@ namespace dbp { ::svt::OLocalResourceAccess aLocalResAccess( ModuleRes( RID_PAGE_TABLESELECTION ), RSC_TABPAGE ); - bool bIsHiContrast = m_aTable.GetBackground().GetColor().IsDark(); + bool bIsHiContrast = m_aTable.GetSettings().GetStyleSettings().GetHighContrastMode(); aTableImage = Image( ModuleRes( bIsHiContrast ? IMG_TABLE_HC : IMG_TABLE ) ); aQueryImage = Image( ModuleRes( bIsHiContrast ? IMG_QUERY_HC : IMG_QUERY ) ); } diff --git a/extensions/source/dbpilots/dbpresid.hrc b/extensions/source/dbpilots/dbpresid.hrc index ab2efbe89921..c54463704f44 100644 --- a/extensions/source/dbpilots/dbpresid.hrc +++ b/extensions/source/dbpilots/dbpresid.hrc @@ -31,9 +31,7 @@ #ifndef _EXTENSIONS_DBP_DBPRESID_HRC_ #define _EXTENSIONS_DBP_DBPRESID_HRC_ -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" //======================================================================== // basics diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index ad09e2d7122c..c3d50e6c112d 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -39,9 +39,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <tools/debug.hxx> #include "dbptools.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" #define GW_STATE_DATASOURCE_SELECTION 0 #define GW_STATE_FIELDSELECTION 1 diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 8b82db094b31..2f6c87783811 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -36,9 +36,7 @@ #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> #include "optiongrouplayouter.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" //#define GBW_STATE_DATASELECTION 0 diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index f86b284b72fd..8afc76a0beea 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -40,9 +40,7 @@ #include <tools/debug.hxx> #include <vcl/msgbox.hxx> #include <connectivity/dbtools.hxx> -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" #include <comphelper/extract.hxx> //......................................................................... diff --git a/extensions/source/propctrlr/browserview.cxx b/extensions/source/propctrlr/browserview.cxx index 9e9780574328..f73d4f10d77a 100644 --- a/extensions/source/propctrlr/browserview.cxx +++ b/extensions/source/propctrlr/browserview.cxx @@ -32,9 +32,7 @@ #include "precompiled_extensions.hxx" #include "browserview.hxx" #include "propertyeditor.hxx" -#ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" -#endif +#include "propctrlr.hrc" #include <tools/debug.hxx> #include <memory> diff --git a/extensions/source/propctrlr/composeduiupdate.cxx b/extensions/source/propctrlr/composeduiupdate.cxx index ac5802129e28..cb4e02e6fb90 100644 --- a/extensions/source/propctrlr/composeduiupdate.cxx +++ b/extensions/source/propctrlr/composeduiupdate.cxx @@ -779,13 +779,6 @@ namespace pcr ); } - //---------------------------------------------------------------- - void SAL_CALL ComposedPropertyUIUpdate::fire() - { - impl_checkDisposed(); - impl_fireAll_throw(); - } - //-------------------------------------------------------------------- void ComposedPropertyUIUpdate::impl_fireAll_throw() { diff --git a/extensions/source/propctrlr/composeduiupdate.hxx b/extensions/source/propctrlr/composeduiupdate.hxx index 8f5ead84ecf1..ddccb8475040 100644 --- a/extensions/source/propctrlr/composeduiupdate.hxx +++ b/extensions/source/propctrlr/composeduiupdate.hxx @@ -119,26 +119,6 @@ namespace pcr ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > getUIForPropertyHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _rxHandler ); - /** fires the collected UI changes to our delegator UI - - All operations for any elements are forwarded: - <ul><li>If an element has been hidden at least once, it's also hidden at the delegator UI.</li> - <li>If an element has been shown at least once, and never been hidden, it's also - shown at the delegator UI.</li> - <li>If an element has never been shown or hidden, it's also not touched at the delegator UI.</li> - <li>The same holds if you replace "hidden" in the last three items with "disabled", - and "shown" with "enabled".</li> - <li>If an element should have been rebuilt (->XObjectInspectorUI::rebuiltPropertyUI) - at least once, it's rebuilt at the delegator UI, too.<br/> - After that, the request to rebuild the UI for this property is cleared, so subsequent - calls to ->fire will not trigger an new rebuilt request. - </ul> - - @throws ::com::sun::star::lang::DisposedException - if ->dispose has been called previously - */ - void SAL_CALL fire(); - /** Suspends automatic firing of UI changes normally, as soon as any of the property handlers does a request for an @@ -182,7 +162,21 @@ namespace pcr /// throws an exception if the component is already disposed void impl_checkDisposed() const; - /** fires all accumulated changes + /** fires the collected UI changes to our delegator UI + + All operations for any elements are forwarded: + <ul><li>If an element has been hidden at least once, it's also hidden at the delegator UI.</li> + <li>If an element has been shown at least once, and never been hidden, it's also + shown at the delegator UI.</li> + <li>If an element has never been shown or hidden, it's also not touched at the delegator UI.</li> + <li>The same holds if you replace "hidden" in the last three items with "disabled", + and "shown" with "enabled".</li> + <li>If an element should have been rebuilt (->XObjectInspectorUI::rebuiltPropertyUI) + at least once, it's rebuilt at the delegator UI, too.<br/> + After that, the request to rebuild the UI for this property is cleared, so subsequent + calls to ->fire will not trigger an new rebuilt request. + </ul> + @precond instance is not disposed */ diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index aed1d120bb09..dcc8c3e78508 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -41,9 +41,7 @@ #ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_ #include "modulepcr.hxx" #endif -#ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" -#endif +#include "propctrlr.hrc" #include "formmetadata.hxx" /** === begin UNO includes === **/ diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index b200d37cb83b..7511c1dfa1e4 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -33,9 +33,7 @@ #include "eformspropertyhandler.hxx" #include "formstrings.hxx" #include "formmetadata.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #include "formbrowsertools.hxx" #include "eformshelper.hxx" #include "handlerhelper.hxx" diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index e2d1ff5d308d..95fc1cbbfcb9 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -32,7 +32,7 @@ #include "precompiled_extensions.hxx" #include "eventhandler.hxx" -#include "extensio.hrc" +#include "propctrlr.hrc" #include "formbrowsertools.hxx" #include "formresid.hrc" #include "formstrings.hxx" diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index e28eb2e89224..f21e70a20f47 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -32,7 +32,7 @@ #include "precompiled_extensions.hxx" #include "controltype.hxx" -#include "extensio.hrc" +#include "propctrlr.hrc" #include "fontdialog.hxx" #include "formcomponenthandler.hxx" #include "formlinkdialog.hxx" diff --git a/extensions/source/propctrlr/formcontroller.cxx b/extensions/source/propctrlr/formcontroller.cxx index d37a67d39daf..96234358a886 100644 --- a/extensions/source/propctrlr/formcontroller.cxx +++ b/extensions/source/propctrlr/formcontroller.cxx @@ -35,7 +35,7 @@ #include "formstrings.hxx" #include "defaultforminspection.hxx" #ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" +#include "propctrlr.hrc" #endif /** === begin UNO includes === **/ diff --git a/extensions/source/propctrlr/formhelpid.hrc b/extensions/source/propctrlr/formhelpid.hrc deleted file mode 100644 index 529c3b30d97b..000000000000 --- a/extensions/source/propctrlr/formhelpid.hrc +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * 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: formhelpid.hrc,v $ - * $Revision: 1.17 $ - * - * 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 _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#define _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ - -#ifndef _SOLAR_HRC -#include <svtools/solar.hrc> -#endif - -// TODO: create a new help id range in <svtools/solar.hrc> -// at the moment, the help ids are ripped from svx/inc/fmhelper.hrc -// (the old property browser was implemented in svx) - -#define HID_PROPCONTROLLER_START HID_FORMS_START + 400 - -// FREE -// FREE -// FREE -// FREE -// FREE -#define HID_FM_PROPDLG_TABCTR (HID_PROPCONTROLLER_START + 5) -#define HID_FM_PROPDLG_TAB_GENERAL (HID_PROPCONTROLLER_START + 6) -#define HID_FM_PROPDLG_TAB_DATA (HID_PROPCONTROLLER_START + 7) -#define HID_FM_PROPDLG_TAB_EVT (HID_PROPCONTROLLER_START + 8) - -#endif // _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ - diff --git a/extensions/source/propctrlr/formlinkdialog.src b/extensions/source/propctrlr/formlinkdialog.src index 5132e9886338..c86ee2a6f1bd 100644 --- a/extensions/source/propctrlr/formlinkdialog.src +++ b/extensions/source/propctrlr/formlinkdialog.src @@ -31,9 +31,7 @@ #ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #ifndef EXTENSIONS_SOURCE_PROPCTRLR_FORMLINKDIALOG_HRC #include "formlinkdialog.hrc" #endif diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index cdfefa314c55..0fba16859fdc 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -32,15 +32,13 @@ #include "precompiled_extensions.hxx" #include "formmetadata.hxx" #ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" +#include "propctrlr.hrc" #endif #include "formstrings.hxx" #ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #include <svtools/localresaccess.hxx> #include <tools/debug.hxx> #include <cppuhelper/extract.hxx> diff --git a/extensions/source/propctrlr/listselectiondlg.src b/extensions/source/propctrlr/listselectiondlg.src index d334b956dc1e..6a994ce83be8 100644 --- a/extensions/source/propctrlr/listselectiondlg.src +++ b/extensions/source/propctrlr/listselectiondlg.src @@ -31,9 +31,7 @@ #ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #ifndef EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HRC #include "listselectiondlg.hrc" #endif diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index f8021b55229c..865a0074d457 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -114,7 +114,7 @@ namespace pcr aPB_OK.SetClickHdl( LINK( this, TabOrderDialog, OKClickHdl ) ); aPB_OK.Disable(); - sal_Bool bIsHighContrast = GetDisplayBackground().GetColor().IsDark(); + sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); pImageList = new ImageList( PcrRes( bIsHighContrast ? RID_IL_FORMEXPLORER_HC : RID_IL_FORMEXPLORER ) ); diff --git a/extensions/source/propctrlr/taborder.src b/extensions/source/propctrlr/taborder.src index 168d5f7d3bcb..681176cb314e 100644 --- a/extensions/source/propctrlr/taborder.src +++ b/extensions/source/propctrlr/taborder.src @@ -34,9 +34,7 @@ #ifndef EXTENSIONS_SOURCE_PROPCTRLR_TABORDER_HRC #include "taborder.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" ModalDialog RID_DLG_TABORDER { diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index 8b60b63ec95a..9555caaac6d3 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -34,18 +34,10 @@ #include "formstrings.hxx" #include "formmetadata.hxx" #include "xsddatatypes.hxx" -#ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_ #include "modulepcr.hxx" -#endif -#ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" -#endif -#ifndef _EXTENSIONS_PROPCTRLR_FORMLOCALID_HRC_ #include "formlocalid.hrc" -#endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #include "newdatatype.hxx" #include "xsdvalidationhelper.hxx" #include "pcrcommon.hxx" diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 23d4da29a41f..7ca5e97239d1 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -264,7 +264,7 @@ protected: virtual void SAL_CALL onTerminated(); /* Wrapper around checkForUpdates */ - bool runCheck(); + bool runCheck( bool & rbExtensionsChecked ); private: @@ -453,7 +453,7 @@ UpdateCheckThread::cancel() //------------------------------------------------------------------------------ bool -UpdateCheckThread::runCheck() +UpdateCheckThread::runCheck( bool & rbExtensionsChecked ) { bool ret = false; UpdateState eUIState = UPDATESTATE_NO_UPDATE_AVAIL; @@ -474,12 +474,14 @@ UpdateCheckThread::runCheck() // and when there was no office update found if ( ( eUIState != UPDATESTATE_UPDATE_AVAIL ) && ( eUIState != UPDATESTATE_UPDATE_NO_DOWNLOAD ) && - !aController->isDialogShowing() ) + !aController->isDialogShowing() && + !rbExtensionsChecked ) { bool bHasExtensionUpdates = checkForExtensionUpdates( m_xContext ); aController->setHasExtensionUpdates( bHasExtensionUpdates ); if ( bHasExtensionUpdates ) aController->setUIState( UPDATESTATE_EXT_UPD_AVAIL ); + rbExtensionsChecked = true; } // joining with this thread is safe again @@ -500,6 +502,11 @@ UpdateCheckThread::onTerminated() void SAL_CALL UpdateCheckThread::run() { + bool bExtensionsChecked = false; + TimeValue systime; + TimeValue nExtCheckTime; + osl_getSystemTime( &nExtCheckTime ); + osl::Condition::Result aResult = osl::Condition::result_timeout; TimeValue tv = { 10, 0 }; @@ -547,7 +554,6 @@ UpdateCheckThread::run() if( ! checkNow ) { - TimeValue systime; osl_getSystemTime(&systime); // Go back to sleep until time has elapsed @@ -563,19 +569,28 @@ UpdateCheckThread::run() static sal_uInt8 n = 0; - if( ! hasInternetConnection() || ! runCheck() ) + if( ! hasInternetConnection() || ! runCheck( bExtensionsChecked ) ) { - // Increase next by 1, 5, 15, 60, .. minutes - static const sal_Int16 nRetryInterval[] = { 60, 300, 900, 3600 }; + // the extension update check should be independent from the office update check + // + osl_getSystemTime( &systime ); + if ( nExtCheckTime.Seconds + offset < systime.Seconds ) + bExtensionsChecked = false; - if( n < sizeof(nRetryInterval) / sizeof(sal_Int16) ) + // Increase next by 15, 60, .. minutes + static const sal_Int32 nRetryInterval[] = { 900, 3600, 14400, 86400 }; + + if( n < sizeof(nRetryInterval) / sizeof(sal_Int32) ) ++n; tv.Seconds = nRetryInterval[n-1]; aResult = m_aCondition.wait(&tv); } else // reset retry counter + { n = 0; + bExtensionsChecked = false; + } } } @@ -591,8 +606,10 @@ UpdateCheckThread::run() void SAL_CALL ManualUpdateCheckThread::run() { + bool bExtensionsChecked = false; + try { - runCheck(); + runCheck( bExtensionsChecked ); m_aCondition.reset(); } catch(const uno::Exception& e) { @@ -1528,6 +1545,8 @@ void UpdateCheck::showExtensionDialog() rtl::Reference<UpdateHandler> UpdateCheck::getUpdateHandler() { + osl::MutexGuard aGuard(m_aMutex); + if( ! m_aUpdateHandler.is() ) m_aUpdateHandler = new UpdateHandler(m_xContext, this); diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 19ca5588c09c..ad1debd91beb 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -31,7 +31,7 @@ #include "precompiled_extensions.hxx" #include "updatehdl.hxx" -#include "extensio.hrc" +#include "update.hrc" #include "osl/diagnose.h" #include "osl/thread.hxx" @@ -200,6 +200,10 @@ void UpdateHandler::setVisible( bool bVisible ) if ( !mxUpdDlg.is() ) createDialog(); + // this should never happen, but if it happens we better return here + if ( !mxUpdDlg.is() ) + return; + updateState( meCurState ); uno::Reference< awt::XWindow > xWindow( mxUpdDlg, uno::UNO_QUERY ); @@ -1032,6 +1036,12 @@ void UpdateHandler::showControls( short nControls ) //-------------------------------------------------------------------- void UpdateHandler::createDialog() { + if ( !mxContext.is() ) + { + OSL_ASSERT( false ); + return; + } + uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager() ); if( xServiceManager.is() ) diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index e7ca93eacc18..bed6bed85bc3 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -114,14 +114,16 @@ public: throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) { sal_Int32 n = m_xStream->readBytes(aData, nBytesToRead); - OSL_TRACE( aData.get()->elements ); + if ( n ) + OSL_TRACE( "Read [%d] bytes: %s\n", n, aData.get()->elements ); return n; }; virtual sal_Int32 SAL_CALL readSomeBytes(uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) { sal_Int32 n = m_xStream->readSomeBytes(aData, nMaxBytesToRead); - OSL_TRACE( aData.get()->elements ); + if ( n ) + OSL_TRACE( "Read [%d] bytes: %s\n", n, aData.get()->elements ); return n; }; virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) diff --git a/extensions/util/hidother.src b/extensions/util/hidother.src index 3f8fcd5ed7f8..308e4ed2ab88 100644 --- a/extensions/util/hidother.src +++ b/extensions/util/hidother.src @@ -28,7 +28,11 @@ * ************************************************************************/ -#include "../inc/extensio.hrc" +#include "../inc/abpilot.hrc" +#include "../inc/bibliography.hrc" +#include "../inc/dbpilots.hrc" +#include "../inc/propctrlr.hrc" +#include "../inc/update.hrc" hidspecial HID_ABSPILOT { HelpId = HID_ABSPILOT; } hidspecial HID_ABSPILOT_CANCEL { HelpId = HID_ABSPILOT_CANCEL; } @@ -90,13 +94,6 @@ hidspecial HID_CHECK_FOR_UPD_PAUSE { HelpId = HID_CHECK_FOR_UPD_PAU hidspecial HID_CHECK_FOR_UPD_RESUME { HelpId = HID_CHECK_FOR_UPD_RESUME; } hidspecial HID_CHECK_FOR_UPD_STATUS { HelpId = HID_CHECK_FOR_UPD_STATUS; } -hidspecial HID_DBIWIZARD { HelpId = HID_DBIWIZARD; } -hidspecial HID_DBIWIZARD_CANCEL { HelpId = HID_DBIWIZARD_CANCEL; } -hidspecial HID_DBIWIZARD_FILESELECTION { HelpId = HID_DBIWIZARD_FILESELECTION; } -hidspecial HID_DBIWIZARD_FINISH { HelpId = HID_DBIWIZARD_FINISH; } -hidspecial HID_DBIWIZARD_NEXT { HelpId = HID_DBIWIZARD_NEXT; } -hidspecial HID_DBIWIZARD_PREVIOUS { HelpId = HID_DBIWIZARD_PREVIOUS; } - hidspecial HID_DLG_DBCHANGE { HelpId = HID_DLG_DBCHANGE; } hidspecial HID_DLG_MAPPING { HelpId = HID_DLG_MAPPING; } @@ -345,7 +342,6 @@ hidspecial HID_PROP_XSD_REQUIRED { HelpId = HID_PROP_XSD_REQUIRED hidspecial HID_PROP_XSD_TOTAL_DIGITS { HelpId = HID_PROP_XSD_TOTAL_DIGITS; } hidspecial HID_PROP_XSD_WHITESPACES { HelpId = HID_PROP_XSD_WHITESPACES; } -hidspecial HID_PROTOCOLS { HelpId = HID_PROTOCOLS; } hidspecial HID_SELECTION_TLB { HelpId = HID_SELECTION_TLB; } hidspecial UID_ABSPILOT_HELP { HelpId = UID_ABSPILOT_HELP; } @@ -385,13 +381,6 @@ hidspecial UID_BRWEVT_TEXTCHANGED { HelpId = UID_BRWEVT_TEXTCHANGE hidspecial UID_BRWEVT_UNLOADED { HelpId = UID_BRWEVT_UNLOADED; } hidspecial UID_BRWEVT_UNLOADING { HelpId = UID_BRWEVT_UNLOADING; } -hidspecial UID_DBIWIZARD_FORMS { HelpId = UID_DBIWIZARD_FORMS; } -hidspecial UID_DBIWIZARD_FORMS_SAVETO { HelpId = UID_DBIWIZARD_FORMS_SAVETO; } -hidspecial UID_DBIWIZARD_HELP { HelpId = UID_DBIWIZARD_HELP; } -hidspecial UID_DBIWIZARD_QUERIES { HelpId = UID_DBIWIZARD_QUERIES; } -hidspecial UID_DBIWIZARD_SOURCEFILE { HelpId = UID_DBIWIZARD_SOURCEFILE; } -hidspecial UID_DBIWIZARD_SOURCESTATS { HelpId = UID_DBIWIZARD_SOURCESTATS; } - hidspecial UID_EVT_MACRODLG { HelpId = UID_EVT_MACRODLG; } hidspecial UID_FIELDLINK_DETAIL1 { HelpId = UID_FIELDLINK_DETAIL1; } @@ -435,3 +424,8 @@ hidspecial UID_PROP_DLG_XSD_READONLY { HelpId = UID_PROP_DLG_XSD_READ hidspecial UID_PROP_DLG_XSD_RELEVANT { HelpId = UID_PROP_DLG_XSD_RELEVANT; } hidspecial UID_PROP_DLG_XSD_REQUIRED { HelpId = UID_PROP_DLG_XSD_REQUIRED; } hidspecial UID_PROP_REMOVE_DATA_TYPE { HelpId = UID_PROP_REMOVE_DATA_TYPE; } + +hidspecial HID_FM_PROPDLG_TABCTR { HelpId = HID_FM_PROPDLG_TABCTR; } +hidspecial HID_FM_PROPDLG_TAB_GENERAL { HelpId = HID_FM_PROPDLG_TAB_GENERAL; } +hidspecial HID_FM_PROPDLG_TAB_DATA { HelpId = HID_FM_PROPDLG_TAB_DATA; } +hidspecial HID_FM_PROPDLG_TAB_EVT { HelpId = HID_FM_PROPDLG_TAB_EVT; } diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 1d6d204ea977..432bc5124775 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -747,6 +747,13 @@ void SAL_CALL OComboBoxModel::reloaded( const EventObject& aEvent ) throw(Runtim loadData( false ); } +//------------------------------------------------------------------------------ +void OComboBoxModel::resetNoBroadcast() +{ + OBoundControlModel::resetNoBroadcast(); + m_aLastKnownValue.clear(); +} + //----------------------------------------------------------------------------- sal_Bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset ) { diff --git a/forms/source/component/ComboBox.hxx b/forms/source/component/ComboBox.hxx index 835099a7637c..068f4fd97163 100644 --- a/forms/source/component/ComboBox.hxx +++ b/forms/source/component/ComboBox.hxx @@ -145,6 +145,8 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); + // OEntryListHelper overriables virtual void stringItemListChanged( ControlModelLock& _rInstanceLock ); virtual void connectedExternalListSource( ); diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx index 1b19b794d273..963e8fa165b7 100644 --- a/forms/source/component/Currency.cxx +++ b/forms/source/component/Currency.cxx @@ -257,6 +257,13 @@ Any OCurrencyModel::getDefaultForReset() const return aValue; } +//------------------------------------------------------------------------------ +void OCurrencyModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + //......................................................................... } // namespace frm //......................................................................... diff --git a/forms/source/component/Currency.hxx b/forms/source/component/Currency.hxx index 91eb109d6a14..3e968dcf3bc7 100644 --- a/forms/source/component/Currency.hxx +++ b/forms/source/component/Currency.hxx @@ -73,6 +73,8 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); + protected: DECLARE_XCLONEABLE(); diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index b95b48b9b214..bb9ecded3e28 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -151,7 +151,6 @@ public: DocumentModifyGuard( const Reference< XInterface >& _rxFormComponent ) :m_xDocumentModify( getXModel( _rxFormComponent ), UNO_QUERY ) { - OSL_ENSURE( m_xDocumentModify.is(), "DocumentModifyGuard::DocumentModifyGuard: no document, or no XModifiable2!" ); impl_changeModifiableFlag_nothrow( false ); } ~DocumentModifyGuard() diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index 33332ae82908..5d0d3f21ce7a 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -348,6 +348,13 @@ Any ODateModel::getDefaultForReset() const } //------------------------------------------------------------------------------ +void ODateModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + +//------------------------------------------------------------------------------ Sequence< Type > ODateModel::getSupportedBindingTypes() { return Sequence< Type >( &::getCppuType( static_cast< util::Date* >( NULL ) ), 1 ); diff --git a/forms/source/component/Date.hxx b/forms/source/component/Date.hxx index 4c4e84e2822f..7eb1acfabf75 100644 --- a/forms/source/component/Date.hxx +++ b/forms/source/component/Date.hxx @@ -96,6 +96,8 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); + virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm ); protected: diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 0f4abd687d65..4eca9402fef8 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -675,6 +675,13 @@ sal_Bool OEditModel::approveDbColumnType( sal_Int32 _nColumnType ) } //------------------------------------------------------------------------------ +void OEditModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aLastKnownValue.clear(); +} + +//------------------------------------------------------------------------------ sal_Bool OEditModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) { Any aNewValue( m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ) ); diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx index cb8d5c6300e4..774944eda939 100644 --- a/forms/source/component/Edit.hxx +++ b/forms/source/component/Edit.hxx @@ -118,6 +118,8 @@ protected: virtual sal_Bool approveDbColumnType( sal_Int32 _nColumnType ); + virtual void resetNoBroadcast(); + protected: virtual sal_uInt16 getPersistenceFlags() const; diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 3ba45781c11b..4a612642bbff 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -2266,14 +2266,6 @@ void OBoundControlModel::impl_connectDatabaseColumn_noNotify( bool _bFromReload m_bLoaded = sal_True; onConnectedDbColumn( xRowSet ); - // Some derived classes decide to cache the "current" (resp. "last known") control value, so operations like - // commitControlValueToDbColumn can be made a no-op when nothing actually changed. - // Normally, this cache is kept in sync with the column value, but during a reload, this synchronization is - // temporarily disable. To allow the derived classes to update their cache from the current column value, - // we call translateDbColumnToControlValue. - if ( _bFromReload && hasField() ) - translateDbColumnToControlValue(); - // initially transfer the db column value to the control, if we successfully connected to a database column if ( hasField() ) initFromField( xRowSet ); diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index bc0e952f1735..0edbf781e786 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -1248,6 +1248,13 @@ Any OFormattedModel::getDefaultForReset() const return m_xAggregateSet->getPropertyValue( PROPERTY_EFFECTIVE_DEFAULT ); } +//------------------------------------------------------------------------------ +void OFormattedModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + //......................................................................... } //......................................................................... diff --git a/forms/source/component/FormattedField.hxx b/forms/source/component/FormattedField.hxx index 0e728288aaba..4a25d10c5c81 100644 --- a/forms/source/component/FormattedField.hxx +++ b/forms/source/component/FormattedField.hxx @@ -141,6 +141,7 @@ namespace frm virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm ); virtual void onDisconnectedDbColumn(); diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index ec953f66c6f6..4bbf42381900 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -1003,23 +1003,23 @@ namespace frm sal_Bool OListBoxModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) { // current selektion list - const ORowSetValue rCurrentValue( getFirstSelectedValue() ); - if ( rCurrentValue != m_aSaveValue ) + const ORowSetValue aCurrentValue( getFirstSelectedValue() ); + if ( aCurrentValue != m_aSaveValue ) { - if ( rCurrentValue.isNull() ) + if ( aCurrentValue.isNull() ) m_xColumnUpdate->updateNull(); else { try { - m_xColumnUpdate->updateObject( rCurrentValue.makeAny() ); + m_xColumnUpdate->updateObject( aCurrentValue.makeAny() ); } catch ( const Exception& ) { return sal_False; } } - m_aSaveValue = rCurrentValue; + m_aSaveValue = aCurrentValue; } return sal_True; } @@ -1037,10 +1037,10 @@ namespace frm Sequence< sal_Int16 > aSelectionIndicies; - // Bei NULL-Eintraegen Selektion aufheben! ORowSetValue aCurrentValue; - aCurrentValue.fill( xBoundField->getPropertyValue( PROPERTY_VALUE ) ); + aCurrentValue.fill( getFieldType(), m_xColumn ); + // reset selection for NULL values if ( aCurrentValue.isNull() ) { if ( m_nNULLPos != -1 ) @@ -1088,6 +1088,13 @@ namespace frm } //-------------------------------------------------------------------- + void OListBoxModel::resetNoBroadcast() + { + OBoundControlModel::resetNoBroadcast(); + m_aSaveValue.setNull(); + } + + //-------------------------------------------------------------------- void SAL_CALL OListBoxModel::disposing( const EventObject& _rSource ) throw ( RuntimeException ) { if ( !OEntryListHelper::handleDisposing( _rSource ) ) diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index 60bd63b3712d..308fb618e18a 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -157,6 +157,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); virtual ::com::sun::star::uno::Any getCurrentFormComponentValue() const; diff --git a/forms/source/component/Numeric.cxx b/forms/source/component/Numeric.cxx index 2ec1f0cfcfdc..2eba2daae067 100644 --- a/forms/source/component/Numeric.cxx +++ b/forms/source/component/Numeric.cxx @@ -212,6 +212,13 @@ Any ONumericModel::getDefaultForReset() const return aValue; } +//------------------------------------------------------------------------------ +void ONumericModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + //......................................................................... } // namespace frm //......................................................................... diff --git a/forms/source/component/Numeric.hxx b/forms/source/component/Numeric.hxx index 45b096afef50..5599707e86d5 100644 --- a/forms/source/component/Numeric.hxx +++ b/forms/source/component/Numeric.hxx @@ -72,6 +72,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); protected: DECLARE_XCLONEABLE(); diff --git a/forms/source/component/Pattern.cxx b/forms/source/component/Pattern.cxx index 64f5ea0e5e75..166522c18359 100644 --- a/forms/source/component/Pattern.cxx +++ b/forms/source/component/Pattern.cxx @@ -252,6 +252,13 @@ Any OPatternModel::getDefaultForReset() const return makeAny( m_aDefaultText ); } +//------------------------------------------------------------------------------ +void OPatternModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aLastKnownValue.clear(); +} + //......................................................................... } // namespace frm //......................................................................... diff --git a/forms/source/component/Pattern.hxx b/forms/source/component/Pattern.hxx index 8b2bf3b878c2..9e0bc3b68d77 100644 --- a/forms/source/component/Pattern.hxx +++ b/forms/source/component/Pattern.hxx @@ -81,6 +81,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); protected: DECLARE_XCLONEABLE(); diff --git a/forms/source/component/Time.cxx b/forms/source/component/Time.cxx index 85ce1670572d..6a63724829d1 100644 --- a/forms/source/component/Time.cxx +++ b/forms/source/component/Time.cxx @@ -350,6 +350,13 @@ Any OTimeModel::getDefaultForReset() const } //------------------------------------------------------------------------------ +void OTimeModel::resetNoBroadcast() +{ + OEditBaseModel::resetNoBroadcast(); + m_aSaveValue.clear(); +} + +//------------------------------------------------------------------------------ Sequence< Type > OTimeModel::getSupportedBindingTypes() { return Sequence< Type >( &::getCppuType( static_cast< util::Time* >( NULL ) ), 1 ); diff --git a/forms/source/component/Time.hxx b/forms/source/component/Time.hxx index d2ba5381f466..7a7ce373b363 100644 --- a/forms/source/component/Time.hxx +++ b/forms/source/component/Time.hxx @@ -96,6 +96,7 @@ protected: virtual ::com::sun::star::uno::Any getDefaultForReset() const; + virtual void resetNoBroadcast(); virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm ); diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index b9738ddd49ae..79d28727b5d5 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -435,6 +435,11 @@ namespace frm // allowed to leave throw; } + catch( const WrappedTargetException& e ) + { + // allowed to leave + throw; + } catch( const Exception& e ) { OSL_ENSURE( sal_False, "OClickableImageBaseControl::implSubmit: caught an unknown exception!" ); diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 43f784f2219c..9f41f68427b1 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -46,6 +46,8 @@ /** === begin UNO includes === **/ #include <com/sun/star/awt/PosSize.hpp> /** === end UNO includes === **/ + +#include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> @@ -400,6 +402,33 @@ namespace frm } //-------------------------------------------------------------------- + void SAL_CALL ORichTextPeer::draw( sal_Int32 _nX, sal_Int32 _nY ) throw(::com::sun::star::uno::RuntimeException) + { + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + RichTextControl* pControl = static_cast< RichTextControl* >( GetWindow() ); + if ( !pControl ) + return; + + OutputDevice* pTargetDevice = VCLUnoHelper::GetOutputDevice( getGraphics() ); + OSL_ENSURE( pTargetDevice != NULL, "ORichTextPeer::draw: no graphics -> no drawing!" ); + if ( !pTargetDevice ) + return; + + ::Size aSize = pControl->GetSizePixel(); + const MapUnit eTargetUnit = pTargetDevice->GetMapMode().GetMapUnit(); + if ( eTargetUnit != MAP_PIXEL ) + aSize = pControl->PixelToLogic( aSize, eTargetUnit ); + + ::Point aPos( _nX, _nY ); + // the XView::draw API talks about pixels, always ... + if ( eTargetUnit != MAP_PIXEL ) + aPos = pTargetDevice->PixelToLogic( aPos ); + + pControl->Draw( pTargetDevice, aPos, aSize, WINDOW_DRAW_NOCONTROLS ); + } + + //-------------------------------------------------------------------- void SAL_CALL ORichTextPeer::setProperty( const ::rtl::OUString& _rPropertyName, const Any& _rValue ) throw (RuntimeException) { if ( !GetWindow() ) diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx index 5775e2626d2d..eecff6527eea 100644 --- a/forms/source/richtext/richtextcontrol.hxx +++ b/forms/source/richtext/richtextcontrol.hxx @@ -135,6 +135,9 @@ namespace frm ORichTextPeer(); ~ORichTextPeer(); + // XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + // XVclWindowPeer virtual void SAL_CALL setProperty( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::uno::RuntimeException); diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx index bcfb0fc2ad35..9e002d4ed7c0 100644 --- a/forms/source/richtext/richtextimplcontrol.cxx +++ b/forms/source/richtext/richtextimplcontrol.cxx @@ -605,21 +605,32 @@ namespace frm _pDev->SetMapMode( aNormalizedMapMode ); // translate coordinates - Point aPos( OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode ) ); - Size aSize( OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode ) ); + Point aPos( _rPos ); + Size aSize( _rSize ); + if ( aOriginalMapMode.GetMapUnit() == MAP_PIXEL ) + { + aPos = _pDev->PixelToLogic( _rPos, aNormalizedMapMode ); + aSize = _pDev->PixelToLogic( _rSize, aNormalizedMapMode ); + } + else + { + aPos = OutputDevice::LogicToLogic( _rPos, aOriginalMapMode, aNormalizedMapMode ); + aSize = OutputDevice::LogicToLogic( _rSize, aOriginalMapMode, aNormalizedMapMode ); + } Rectangle aPlayground( aPos, aSize ); Size aOnePixel( _pDev->PixelToLogic( Size( 1, 1 ) ) ); + aPlayground.Right() -= aOnePixel.Width(); + aPlayground.Bottom() -= aOnePixel.Height(); // background _pDev->SetLineColor(); - _pDev->DrawRect( Rectangle( aPlayground.TopLeft(), m_pEngine->GetPaperSize()) ); + _pDev->DrawRect( aPlayground ); - // possibly with border + // do we need to draw a border? bool bBorder = ( m_pAntiImpl->GetStyle() & WB_BORDER ); if ( bBorder ) - // let's draw a border - _pDev->SetLineColor( COL_BLACK ); + _pDev->SetLineColor( m_pAntiImpl->GetSettings().GetStyleSettings().GetMonoColor() ); else _pDev->SetLineColor(); _pDev->SetFillColor( m_pAntiImpl->GetBackground().GetColor() ); @@ -632,7 +643,9 @@ namespace frm // leave a space of one pixel between the "surroundings" of the control // and the content lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() ); + lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() ); + // actually draw the content m_pEngine->Draw( _pDev, aPlayground, Point(), TRUE ); _pDev->Pop(); diff --git a/forms/source/richtext/richtextvclcontrol.hxx b/forms/source/richtext/richtextvclcontrol.hxx index 778d31c3e6e1..a4f49aa2d41c 100644 --- a/forms/source/richtext/richtextvclcontrol.hxx +++ b/forms/source/richtext/richtextvclcontrol.hxx @@ -117,13 +117,15 @@ namespace frm const EditView& getView() const; EditView& getView(); + // Window overridables + virtual void Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, ULONG _nFlags ); + protected: // Window overridables virtual void Resize(); virtual void GetFocus(); virtual void StateChanged( StateChangedType nStateChange ); virtual long PreNotify( NotifyEvent& _rNEvt ); - virtual void Draw( OutputDevice* _pDev, const Point& _rPos, const Size& _rSize, ULONG _nFlags ); virtual long Notify( NotifyEvent& _rNEvt ); private: diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index bfefb05f8ab6..f599f196ee32 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -74,6 +74,7 @@ namespace frm sLabel += String::CreateFromAscii( " " ); return sLabel; } +<<<<<<< local static bool lcl_isHighContrast( const Color& _rColor ) { @@ -111,6 +112,8 @@ namespace frm OSL_ENSURE( false, "lcl_getCommandURL: unknown FormFeature!" ); return ::rtl::OUString(); } +======= +>>>>>>> other } //===================================================================== @@ -424,7 +427,15 @@ namespace frm if ( _eSize != m_eImageSize ) { m_eImageSize = _eSize; +<<<<<<< local implUpdateImages(); +======= + ::std::auto_ptr< SfxImageManager > pImageManager( new SfxImageManager( NULL ) ); + pImageManager->SetImagesForceSize( *m_pToolbar, GetSettings().GetStyleSettings().GetHighContrastMode(), m_eImageSize == eLarge ); + + // parts of our layout is dependent on the size of our icons + Resize(); +>>>>>>> other } } diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index b24bc6ee80f5..421c243d82e4 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -534,7 +534,7 @@ Reference < XHyphenatedWord > SAL_CALL Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const ::rtl::OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, - const ::com::sun::star::beans::PropertyValues& /*aProperties*/ ) + const ::com::sun::star::beans::PropertyValues& aProperties ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) @@ -544,6 +544,10 @@ Reference< XPossibleHyphens > SAL_CALL char *lcword; int k; + PropertyHelper_Hyphen & rHelper = GetPropHelper();
+ rHelper.SetTmpPropVals(aProperties);
+ sal_Int16 minTrail = rHelper.GetMinTrailing();
+ sal_Int16 minLead = rHelper.GetMinLeading();
HyphenDict *dict = NULL; rtl_TextEncoding aEnc = 0; @@ -617,6 +621,9 @@ Reference< XPossibleHyphens > SAL_CALL wordlen = encWord.getLength(); lcword = new char[wordlen+1]; hyphens = new char[wordlen+5]; + char ** rep = NULL; // replacements of discretionary hyphenation
+ int * pos = NULL; // array of [hyphenation point] minus [deletion position]
+ int * cut = NULL; // length of deletions in original word
// copy converted word into simple char buffer strcpy(lcword,encWord.getStr()); @@ -627,10 +634,22 @@ Reference< XPossibleHyphens > SAL_CALL n++; // fprintf(stderr,"hyphenate... %s\n",lcword); fflush(stderr); if (n > 0) { - if (hnj_hyphen_hyphenate(dict, lcword, n, hyphens)) + if (hnj_hyphen_hyphenate3(dict, lcword, n, hyphens, NULL, &rep, &pos, &cut,
+ minLead, minTrail, Max(dict->clhmin, Max(dict->clhmin, 2) + Max(0, minLead - Max(dict->lhmin, 2))),
+ Max(dict->crhmin, Max(dict->crhmin, 2) + Max(0, minTrail - Max(dict->rhmin, 2)))))
{ delete[] hyphens; delete[] lcword; +
+ if (rep) {
+ for(int j = 0; j < n; j++) {
+ if (rep[j]) free(rep[j]);
+ }
+ free(rep);
+ }
+ if (pos) free(pos);
+ if (cut) free(cut);
+ return NULL; } } @@ -643,7 +662,7 @@ Reference< XPossibleHyphens > SAL_CALL INT16 i; for ( i = 0; i < encWord.getLength(); i++) - if (hyphens[i]&1) + if (hyphens[i]&1 && (!rep || !rep[i]))
nHyphCount++; Sequence< INT16 > aHyphPos(nHyphCount); @@ -652,15 +671,14 @@ Reference< XPossibleHyphens > SAL_CALL OUString hyphenatedWord; nHyphCount = 0; - for (i = 0; i < encWord.getLength(); i++) - { + for (i = 0; i < nWord.getLength(); i++) {
hyphenatedWordBuffer.append(aWord[i]); - if (hyphens[i]&1) - { - pPos[nHyphCount] = i; - hyphenatedWordBuffer.append(sal_Unicode('=')); - nHyphCount++; - } + // hyphenation position (not alternative)
+ if (hyphens[i]&1 && (!rep || !rep[i])) {
+ pPos[nHyphCount] = i;
+ hyphenatedWordBuffer.append(sal_Unicode('='));
+ nHyphCount++;
+ }
} hyphenatedWord = hyphenatedWordBuffer.makeStringAndClear(); @@ -672,6 +690,16 @@ Reference< XPossibleHyphens > SAL_CALL delete[] hyphens; delete[] lcword; +
+ if (rep) {
+ for(int j = 0; j < n; j++) {
+ if (rep[j]) free(rep[j]);
+ }
+ free(rep);
+ }
+ if (pos) free(pos);
+ if (cut) free(cut);
+ return xRes; } diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 6ca9981d2291..759f7d4d7d03 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1370,6 +1370,16 @@ void SAL_CALL ZipPackage::commitChanges() { uno::Reference< io::XSeekable > xTempSeek( xTempInStream, uno::UNO_QUERY_THROW ); + try + { + xTempSeek->seek( 0 ); + } + catch( uno::Exception& r ) + { + throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Temporary file should be seekable!" ) ), + static_cast < OWeakObject * > ( this ), makeAny ( r ) ); + } + // switch to the new temporary stream only after the transfer PostinitializationGuard aPostInitGuard( xTempInStream, *this ); @@ -1381,8 +1391,6 @@ void SAL_CALL ZipPackage::commitChanges() // preparation for copy step try { - xTempSeek->seek( 0 ); - xOutputStream = m_xStream->getOutputStream(); uno::Reference < XTruncate > xTruncate ( xOutputStream, UNO_QUERY ); if ( !xTruncate.is() ) diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst index 05200fdf938a..ad7d365c30de 100644 --- a/setup_native/prj/build.lst +++ b/setup_native/prj/build.lst @@ -9,6 +9,7 @@ pk setup_native\source\win32\customactions\rebase nmake - w sn_reba pk setup_native\source\win32\customactions\regactivex nmake - w sn_regactivex NULL pk setup_native\source\win32\customactions\regpatchactivex nmake - w sn_regpatchactivex NULL pk setup_native\source\win32\customactions\reg4allmsdoc nmake - w sn_reg4allmsdoc NULL +pk setup_native\source\win32\customactions\reg64 nmake - w sn_reg64 NULL pk setup_native\source\win32\customactions\javafilter nmake - w sn_javafilter NULL pk setup_native\source\win32\customactions\quickstarter nmake - w sn_quickstarter NULL pk setup_native\source\win32\customactions\shellextensions nmake - w sn_shellextensions sn_tools.w NULL diff --git a/setup_native/prj/d.lst b/setup_native/prj/d.lst index a573b94fd5cb..9d429454ebba 100644 --- a/setup_native/prj/d.lst +++ b/setup_native/prj/d.lst @@ -8,6 +8,7 @@ mkdir: %_DEST%\bin%_EXT%\userscripts ..\%__SRC%\bin\uninstall %_DEST%\bin%_EXT%\userscripts\uninstall ..\%__SRC%\bin\noarch\fake-db-1.0-0.noarch.rpm %_DEST%\bin%_EXT%\openoffice.org-userland-1.0-0.noarch.rpm +mkdir: %_DEST%\bin%_EXT%\osolsmf ..\%__SRC%\bin\ulfconv %_DEST%\bin%_EXT%\ulfconv ..\%__SRC%\bin\langpackscript.sh %_DEST%\bin%_EXT%\langpackscript.sh ..\%__SRC%\bin\linuxpatchscript.sh %_DEST%\bin%_EXT%\linuxpatchscript.sh @@ -33,6 +34,10 @@ mkdir: %_DEST%\bin%_EXT%\userscripts ..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif ..\source\java\javaversion.dat %_DEST%\bin%_EXT%\javaversion.dat ..\source\java\javaversion2.dat %_DEST%\bin%_EXT%\javaversion2.dat +..\source\opensolaris\bundledextensions\installed %_DEST%\bin%_EXT%\osolsmf\installed +..\source\opensolaris\bundledextensions\README %_DEST%\bin%_EXT%\osolsmf\README +..\source\opensolaris\bundledextensions\ooo_bundled_extensions.xml %_DEST%\bin%_EXT%\osolsmf\ooo_bundled_extensions.xml +..\source\opensolaris\bundledextensions\svc-ooo_bundled_extensions %_DEST%\bin%_EXT%\osolsmf\svc-ooo_bundled_extensions ..\source\packinfo\solariscopyrightfile %_DEST%\bin%_EXT%\solariscopyrightfile ..\source\packinfo\*.txt %_DEST%\bin%_EXT%\*.txt ..\source\packinfo\*.pcp %_DEST%\bin%_EXT%\*.pcp diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index 81d5649ffec6..ebb16d0ef008 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -46,6 +46,7 @@ BEGIN $savetemppath = ""; $msiinfo_available = 0; $path_displayed = 0; + $localmsidbpath = ""; $plat = $^O; @@ -69,7 +70,7 @@ sub usage { print <<Ende; ---------------------------------------------------------------------- -$prog V1.0 (c) Sun Microsystems 2008 +$prog V1.0 (c) Sun Microsystems 2009 This program installs a Windows Installer installation set without using msiexec.exe. The installation is comparable with an administrative installation using the Windows Installer @@ -150,6 +151,33 @@ sub controlparameter } ############################################################################# +# The program msidb.exe can be located next to the Perl program. Then it is +# not neccessary to find it in the PATH variable. +############################################################################# + +sub check_local_msidb +{ + my $msidbname = "msidb.exe"; + my $perlprogramm = $0; + my $path = $perlprogramm; + + get_path_from_fullqualifiedname(\$path); + + $path =~ s/\\\s*$//; + $path =~ s/\/\s*$//; + + my $msidbpath = ""; + if ( $path =~ /^\s*$/ ) { $msidbpath = $msidbname; } + else { $msidbpath = $path . $separator . $msidbname; } + + if ( -f $msidbpath ) + { + $localmsidbpath = $msidbpath; + print "Using $msidbpath (next to \"admin.pl\")\n"; + } +} + +############################################################################# # Converting a string list with separator $listseparator # into an array ############################################################################# @@ -198,7 +226,8 @@ sub check_system_path } my $patharrayref = convert_stringlist_into_array(\$pathvariable, $local_pathseparator); - my @needed_files_in_path = ("msidb.exe", "expand.exe"); + my @needed_files_in_path = ("expand.exe"); + if ( $localmsidbpath eq "" ) { push(@needed_files_in_path, "msidb.exe"); } # not found locally -> search in path my @optional_files_in_path = ("msiinfo.exe"); print("\nChecking required files:\n"); @@ -386,7 +415,7 @@ sub get_path_from_fullqualifiedname if ( $$longfilenameref =~ /\Q$separator\E/ ) # Is there a separator in the path? Otherwise the path is empty. { - if ( $$longfilenameref =~ /^\s*(\S.*\S\Q$separator\E)(\S.+\S?)/ ) + if ( $$longfilenameref =~ /^\s*(\S.*\Q$separator\E)(\S.+\S?)/ ) { $$longfilenameref = $1; } @@ -486,6 +515,7 @@ sub extract_tables_from_database my ($fullmsidatabasepath, $workdir, $tablelist) = @_; my $msidb = "msidb.exe"; # Has to be in the path + if ( $localmsidbpath ) { $msidb = $localmsidbpath; } my $infoline = ""; my $systemcall = ""; my $returnvalue = ""; @@ -513,6 +543,117 @@ sub extract_tables_from_database } } +######################################################## +# Check, if this installation set contains +# internal cabinet files included into the msi +# database. +######################################################## + +sub check_for_internal_cabfiles +{ + my ($cabfilehash) = @_; + + my $contains_internal_cabfiles = 0; + my %allcabfileshash = (); + + foreach my $filename ( keys %{$cabfilehash} ) + { + if ( $filename =~ /^\s*\#/ ) # starting with a hash + { + $contains_internal_cabfiles = 1; + # setting real filename without hash as key and name with hash as value + my $realfilename = $filename; + $realfilename =~ s/^\s*\#//; + $allcabfileshash{$realfilename} = $filename; + } + } + + return ( $contains_internal_cabfiles, \%allcabfileshash ); +} + +################################################################# +# Exclude all cab files from the msi database. +################################################################# + +sub extract_cabs_from_database +{ + my ($msidatabase, $allcabfiles) = @_; + + my $infoline = ""; + my $fullsuccess = 1; + my $msidb = "msidb.exe"; # Has to be in the path + if ( $localmsidbpath ) { $msidb = $localmsidbpath; } + + my @all_excluded_cabfiles = (); + + if( $^O =~ /cygwin/i ) + { + $msidatabase = qx{cygpath -w "$msidatabase"}; + $msidatabase =~ s/\\/\\\\/g; + $msidatabase =~ s/\s*$//g; + } + else + { + # msidb.exe really wants backslashes. (And double escaping because system() expands the string.) + $msidatabase =~ s/\//\\\\/g; + } + + foreach my $onefile ( keys %{$allcabfiles} ) + { + my $systemcall = $msidb . " -d " . $msidatabase . " -x " . $onefile; + system($systemcall); + push(@all_excluded_cabfiles, $onefile); + } + + \@all_excluded_cabfiles; +} + +################################################################################ +# Collect all DiskIds to the corresponding cabinet files from Media.idt. +################################################################################ + +sub analyze_media_file +{ + my ($filecontent) = @_; + + my %diskidhash = (); + + for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) + { + if ( $i < 3 ) { next; } + + if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ ) + { + my $diskid = $1; + my $cabfile = $4; + + $diskidhash{$cabfile} = $diskid; + } + } + + return \%diskidhash; +} + +sub analyze_customaction_file +{ + my ($filecontent) = @_; + + my $register_extensions_exists = 0; + + my %table = (); + + for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) + { + if ( ${$filecontent}[$i] =~ /^\s*RegisterExtensions\s+/ ) + { + $register_extensions_exists = 1; + last; + } + } + + return $register_extensions_exists; +} + ################################################################################ # Analyzing the content of Directory.idt ################################################################################# @@ -930,6 +1071,10 @@ sub register_one_extension $localextension =~ s/\\/\\\\/g; } + if ( $^O =~ /cygwin/i ) { + $executable = "./" . $executable; + } + my $systemcall = $executable . " add --shared --verbose " . "\"" . $localextension . "\"" . " -env:UserInstallation=file://" . $temppath . " 2\>\&1 |"; print "... $systemcall\n"; @@ -1142,6 +1287,7 @@ $starttime = time(); getparameter(); controlparameter(); +check_local_msidb(); check_system_path(); my $temppath = get_temppath(); @@ -1153,9 +1299,36 @@ create_directory($helperdir); # Get File.idt, Component.idt and Directory.idt from database -my $tablelist = "File Directory Component"; +my $tablelist = "File Directory Component Media CustomAction"; extract_tables_from_database($databasepath, $helperdir, $tablelist); +# Set unpackdir +my $unpackdir = $helperdir . $separator . "unpack"; +create_directory($unpackdir); + +# Reading media table to check for internal cabinet files +my $filename = $helperdir . $separator . "Media.idt"; +if ( ! -f $filename ) { exit_program("ERROR: Could not find required file: $filename !"); } +my $filecontent = read_file($filename); +my $cabfilehash = analyze_media_file($filecontent); + +# Check, if there are internal cab files +my ( $contains_internal_cabfiles, $all_internal_cab_files) = check_for_internal_cabfiles($cabfilehash); + +if ( $contains_internal_cabfiles ) +{ + # Set unpackdir + my $cabdir = $helperdir . $separator . "internal_cabs"; + create_directory($cabdir); + my $from = cwd(); + chdir($cabdir); + # Exclude all cabinet files from database + my $all_excluded_cabs = extract_cabs_from_database($databasepath, $all_internal_cab_files); + print "Unpacking files from internal cabinet file(s)\n"; + foreach my $cabfile ( @{$all_excluded_cabs} ) { unpack_cabinet_file($cabfile, $unpackdir); } + chdir($from); +} + # Unpack all cab files into $helperdir, cab files must be located next to msi database my $installdir = $databasepath; @@ -1166,11 +1339,7 @@ make_absolute_filename_to_relative_filename(\$databasefilename); my $cabfiles = find_file_with_file_extension("cab", $installdir); -if ( $#{$cabfiles} < 0 ) { exit_program("ERROR: Did not find any cab file in directory $installdir"); } - -# Set unpackdir -my $unpackdir = $helperdir . $separator . "unpack"; -create_directory($unpackdir); +if (( $#{$cabfiles} < 0 ) && ( ! $contains_internal_cabfiles )) { exit_program("ERROR: Did not find any cab file in directory $installdir"); } print "Unpacking files from cabinet file(s)\n"; for ( my $i = 0; $i <= $#{$cabfiles}; $i++ ) @@ -1180,8 +1349,8 @@ for ( my $i = 0; $i <= $#{$cabfiles}; $i++ ) } # Reading tables -my $filename = $helperdir . $separator . "Directory.idt"; -my $filecontent = read_file($filename); +$filename = $helperdir . $separator . "Directory.idt"; +$filecontent = read_file($filename); my $dirhash = analyze_directory_file($filecontent); $filename = $helperdir . $separator . "Component.idt"; @@ -1203,8 +1372,16 @@ my $msidatabase = $targetdir . $separator . $databasefilename; my $copyreturn = copy($databasepath, $msidatabase); if ( ! $copyreturn) { exit_program("ERROR: Could not copy $source to $dest\n"); } -# Registering extensions -register_extensions($unopkgfile, $extensions, $temppath); +# Reading tables +$filename = $helperdir . $separator . "CustomAction.idt"; +$filecontent = read_file($filename); +my $register_extensions_exists = analyze_customaction_file($filecontent); + +if ( $register_extensions_exists ) +{ + # Registering extensions + register_extensions($unopkgfile, $extensions, $temppath); +} # Saving info in Summary Information Stream of msi database (required for following patches) if ( $msiinfo_available ) { write_sis_info($msidatabase); } diff --git a/setup_native/source/java/javaversion.dat b/setup_native/source/java/javaversion.dat index 87172c3a6495..7ff47b499e45 100755 --- a/setup_native/source/java/javaversion.dat +++ b/setup_native/source/java/javaversion.dat @@ -30,30 +30,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 16 -WINDOWSJAVAVERSION=Java 6 Update 16 +JAVAVERSION=Java 6 Update 17 +WINDOWSJAVAVERSION=Java 6 Update 17 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u16-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_16 +WINDOWSJAVAFILENAME=jre-6u17-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_17 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u16-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u17-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp <filename> ) -LINUXJAVANAME=jre-1.6.0_16-fcs +LINUXJAVANAME=jre-1.6.0_17-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u16-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u17-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_16_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_16_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_16_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_17_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_17_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_17_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_16_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_16_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_16_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_17_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_17_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_17_x86.tar.gz # Solaris (pkgUnit.xml, needs only to be changed in major changes) SOLARISJAVART=SUNWj6rt diff --git a/setup_native/source/java/javaversion2.dat b/setup_native/source/java/javaversion2.dat index 87172c3a6495..7ff47b499e45 100644 --- a/setup_native/source/java/javaversion2.dat +++ b/setup_native/source/java/javaversion2.dat @@ -30,30 +30,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 16 -WINDOWSJAVAVERSION=Java 6 Update 16 +JAVAVERSION=Java 6 Update 17 +WINDOWSJAVAVERSION=Java 6 Update 17 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u16-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_16 +WINDOWSJAVAFILENAME=jre-6u17-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_17 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u16-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u17-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp <filename> ) -LINUXJAVANAME=jre-1.6.0_16-fcs +LINUXJAVANAME=jre-1.6.0_17-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u16-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u17-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_16_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_16_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_16_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_17_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_17_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_17_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_16_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_16_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_16_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_17_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_17_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_17_x86.tar.gz # Solaris (pkgUnit.xml, needs only to be changed in major changes) SOLARISJAVART=SUNWj6rt diff --git a/setup_native/source/opensolaris/bundledextensions/README b/setup_native/source/opensolaris/bundledextensions/README new file mode 100644 index 000000000000..f64c225d9df9 --- /dev/null +++ b/setup_native/source/opensolaris/bundledextensions/README @@ -0,0 +1,80 @@ +================================================================================ +Installation information +================================================================================ + +In order to properly install the bundled extensions, such as dictionaries, it is +necessary that the files + +installed +ooo_bundled_extensions.xml +svc-ooo_bundled_extensions + +are part of the OpenOffice.org IPS package. They must be added to the package +after all other files have been added. Those other files are the SVR4 packages +of OOo which can be imported by pkg (pkg import). +The files have to be uploaded this way: + +pkgsend -s url_to_pkg_server add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default +pkgsend -s url_to_pkg_server add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions +pkgsend -s url_to_pkg_server add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default + + +--- + +${EXTENSIONPATH} must be replaced by the path to the folder containing the +bundled extensions. This path changes with every major release of OOo because of +the version number which is part of a folder name. The +current value is: + +EXTENSIONPATH=/opt/openoffice.org3/share/extension/install + +The service was tested with OpenSolaris release 2009.6 and may not work with a +previous release. + + +================================================================================ +What do these files do +================================================================================ + +The three files constitute a SMF service. When this service is started, then it +installes the bundled extensions which are contained in +/opt/openoffice.org3/share/extension/install. To install them, the service calls +"unopkg add --shared ..." with the appropriate arguments. + +The service is started initially after the installation of +ooo_bundled_extensions.xml. At this time, all files of OOo, including the +extensions, have been copied to their destination. The service calls unopkg on +behalf of every extension and adds the path to that extension to the file +'installed'. The file 'installed' is used to remember what extensions have +already been installed with unopkg. This will prevent to reinstall those +extensions whenever the service is restarted. + +When a new version of OOo becomes available, then the respective OOo package +containes a new version of 'installed'. That is, it contains a version string, +such as 3.2.0. The sole reason for that string is, to change the content of this +file in every release. Otherwise IPS would not replace the installed version of +'installed' with the one contained in the package. + +The update procedure of OOo will replace 'installed'. 'installed' is associated +with a restart_fmri of the service ooo_bundled_extensions. That is after +copying 'installed' the service will be restarted. It then installes all +extensions contained in /opt/openoffice.org3/share/extension/install, because +the newly installed 'installed' file does not contain any entries yet, except +for the version string. + + +================================================================================ +Known issues +================================================================================ + +If OOo, which contains this service, is uninstalled and later it is installed +again, then the bundled extensions are not installed. That is, unopkg is not +called to install them with OOo's Extensions Manager. The reasons is a bug in +OpenSolaris: + +http://defect.opensolaris.org/bz/show_bug.cgi?id=5742 + +To work around this, one can call after uninstalling OOo + +svccfg delete -f ooo_bundled_extensions +svccfg delete smf/manifest diff --git a/setup_native/source/opensolaris/bundledextensions/installed b/setup_native/source/opensolaris/bundledextensions/installed new file mode 100644 index 000000000000..0c8d8df5ae26 --- /dev/null +++ b/setup_native/source/opensolaris/bundledextensions/installed @@ -0,0 +1 @@ +${OOOPACKAGEVERSION} diff --git a/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml new file mode 100644 index 000000000000..66acd508c281 --- /dev/null +++ b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml @@ -0,0 +1,60 @@ +<?xml version="1.0"?> + +<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> + +<service_bundle type="manifest" name="ooo_bundled_extensions"> + +<service + name="application/ooo_bundled_extensions" + type="service" + version="1"> + + <create_default_instance enabled="true" /> + <single_instance/> + + <dependency name="service_available" + grouping="require_all" + restart_on="none" + type="service"> + <service_fmri value="svc:/system/filesystem/local:default" /> + </dependency> + + <exec_method + type="method" name="start" + exec="/lib/svc/method/svc-ooo_bundled_extensions start" + timeout_seconds="160"> + <method_context> + <method_credential user="root" group="root" /> + </method_context> + </exec_method> + + + <exec_method + type="method" name="stop" + exec="/lib/svc/method/svc-ooo_bundled_extensions stop" + timeout_seconds="160" > + <method_context> + <method_credential user="root" group="root" /> + </method_context> + </exec_method> + + <property_group name="startd" type="framework"> + <propval name="duration" type="astring" + value="transient" /> + <propval name="ignore_error" + type="astring" value="core,signal" /> + + </property_group> + + <stability value="Unstable" /> + + <template> + <common_name> + <loctext xml:lang="C"> + Installation of OpenOffice.org's bundled extensions. + </loctext> + </common_name> + </template> +</service> + +</service_bundle> diff --git a/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions new file mode 100644 index 000000000000..696277011133 --- /dev/null +++ b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions @@ -0,0 +1,108 @@ +#!/sbin/sh + +. /lib/svc/share/smf_include.sh + +#The start method is used for installing and updating the +#extensions. The service keeps a list +#(share/extensions/install/installed) of the extensions which were +#already installed. During installation, the bundled extensions are +#copied to the install folder (share/extensions/install). Finally this +#service, which is part of the office installation package, will be +#started and the start "method" of this script is called. Then all +#extensions in the "install" folder are checked if they are already +#installed by reading the list "installed". Because the list is empty +#at this time, all the extensions will be installed. +# +#If this service is restarted then the script checks if there is an +#extensions which is not yet installed, that is there is no entry for +#it in the 'installed' file. Only if this is the case then that +#extensions will be installed and its path is added to 'installed'. +# +#In case of an update, new versions of existing extensions and +#completely new extensions may be copied to the 'install' folder. Also +#a new 'installed' file will be copied which replaces the existing +#file. The new 'installed' file does not contain any entries of +#installed extensions. Therefore the next time when the start method is +#run all extensions contained in share/extensions/install will be +#installed. + +#Create the folder which contains the temporary user installation +INSTDIR=`/usr/bin/mktemp -d "/tmp/userinstall.XXXXXX"` + +OOO_BASE_DIR="/opt/openoffice.org/basis${OOOBASEVERSION}" + +case "$1" in +'start') + EXTENSIONDIR=/opt/openoffice.org${OOOBRANDPACKAGEVERSION}/share/extension/install + for FILE in $EXTENSIONDIR/*.oxt + do + #We check if the file exist, because if there is no extension + #then $FILE will contain "<..>/*.oxt" + if [ -f "$FILE" ]; then + #Determine if this extension is already installed. We do + #that by checking the file "installed" which contains a + #list of all installed extensions including the full path + EXTENSIONFILE=`basename $FILE` + INSTALLED=`sed -n "/$EXTENSIONFILE/p" $EXTENSIONDIR/installed` + + if [ -z "$INSTALLED" ]; then + #We have not found the name of the extension in the + #list. That is, it has not been installed (with unopkg) yet. + #Therefore we do it now. + echo installing $FILE + /opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg add --shared --bundled "$FILE" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + #Let us remember that this extensions has been installed + #by adding the path name of the extension to the file + #installed + echo $FILE >> $EXTENSIONDIR/installed + fi + fi + done + + #Now check for extensions which need to be uninstalled + #(unopkg). This is the case if the list of extensions in the file + #installed contains the name of an extension which does not exist + #in the the folder <..>/share/extension/install. +# LINE="" +# NEWCONTENT="" +# REMOVED="" +# LIST=`cat $EXTENSIONDIR/installed` +# #remove blank lines +# LIST=`echo "$LIST" | sed '/^[:blank:]*$/d'` + +# echo "$LIST" | while [ 1 ] +# do +# read LINE || break +# if [ ! -f "$LINE" ]; then +# #The extension file has been removed from +# #share/extension/install. Now we remove the installed +# #extension +# echo removing `basename $LINE` +# /opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg remove --shared --bundled "`basename $LINE`" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' +# REMOVED=1 +# else +# NEWCONTENT+=$LINE +# NEWCONTENT+="\n" +# fi +# done + +# #Write the new list to the file "installed". It now has all names +# #remove which refered to previously removed extensions (removed +# #from .../share/extension/install) +# if [ "$REMOVED" ]; then +# #remove the last empty line +# NEWCONTENT=`echo "$NEWCONTENT" | sed '/^[:space:]*$/d'` +# echo "$NEWCONTENT" > $EXTENSIONDIR/installed +# fi + + ;; + 'stop') + echo "#### stop ####" + ;; + *) + echo "Usage: $0 { start | stop }" + exit 1 + ;; +esac + +exit $SMF_EXIT_OK diff --git a/setup_native/source/ulfconv/ulfconv.cxx b/setup_native/source/ulfconv/ulfconv.cxx index 6ca6834461f9..7a345f8b365a 100644 --- a/setup_native/source/ulfconv/ulfconv.cxx +++ b/setup_native/source/ulfconv/ulfconv.cxx @@ -199,6 +199,8 @@ void read_encoding_table(char * file, EncodingMap& aEncodingMap) aEncodingMap.insert( EncodingMap::value_type(language, encoding->value) ); } } + + fclose(fp); } /************************************************************************ @@ -311,6 +313,7 @@ int main( int argc, char * const argv[] ) ostream = fopen(outfile, "w"); if ( ostream == NULL ) { fprintf(stderr, "ulfconv: %s : %s\n", outfile, strerror(errno)); + fclose(istream); exit(2); } } @@ -351,4 +354,7 @@ int main( int argc, char * const argv[] ) fputs(buffer, ostream); } } + + fclose(ostream); + fclose(istream); } diff --git a/setup_native/source/win32/customactions/reg64/exports.dxp b/setup_native/source/win32/customactions/reg64/exports.dxp new file mode 100755 index 000000000000..3282da1eeac0 --- /dev/null +++ b/setup_native/source/win32/customactions/reg64/exports.dxp @@ -0,0 +1,2 @@ +InstallReg64 +DeinstallReg64 diff --git a/setup_native/source/win32/customactions/reg64/makefile.mk b/setup_native/source/win32/customactions/reg64/makefile.mk new file mode 100755 index 000000000000..17c56716af14 --- /dev/null +++ b/setup_native/source/win32/customactions/reg64/makefile.mk @@ -0,0 +1,112 @@ +#************************************************************************* +# +# 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: makefile.mk,v $ +# +# $Revision: 1.20 $ +# +# 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. +# +#************************************************************************* + +PRJ=..$/..$/..$/.. +PRJNAME=setup_native +TARGET=reg64msi + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=TRUE +NO_DEFAULT_STL=TRUE +DYNAMIC_CRT= +USE_DEFFILE=TRUE +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE + +.INCLUDE : settings.mk + +.IF "$(USE_SYSTEM_STL)" != "YES" +CFLAGS+=-D_STLP_USE_STATIC_LIB +.ENDIF + +#Disable precompiled header +CDEFS+=-Dnot_used_define_to_disable_pch + +# --- Files -------------------------------------------------------- + +.IF "$(GUI)"=="WNT" + +UWINAPILIB= + +SLOFILES = \ + $(SLO)$/reg64.obj + +STDSHL += \ + $(KERNEL32LIB)\ + $(USER32LIB)\ + $(ADVAPI32LIB)\ + $(SHELL32LIB)\ + $(MSILIB)\ + $(SHLWAPILIB)\ + +# msvcprt.lib + +SHL1TARGET = $(TARGET) +SHL1IMPLIB = i$(TARGET) + +SHL1OBJS=$(SLOFILES) +SHL1DEF = $(MISC)$/$(SHL1TARGET).def +SHL1DEPN = $(SLB)$/$(TARGET).lib +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=exports.dxp + +.ENDIF + + +# --- mapimailer -------------------------------------------------------- + +#TARGETTYPE=CUI + +#OBJFILES= $(OBJ)$/reg64.obj + +#APP1TARGET=reg64 +#APP1OBJS=$(OBJFILES) +#APP1STDLIBS=$(KERNEL32LIB)\ +# $(ADVAPI32LIB)\ +# $(MSILIB)\ +# $(SHELL32LIB)\ +# msvcprt.lib\ +# $(OLE32LIB)\ +# $(COMCTL32LIB)\ +# $(UUIDLIB) + + +#APP1DEF=$(MISC)$/$(APP1TARGET).def + +# --- Targets -------------------------------------------------------------- + +.INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE + +# ------------------------------------------------------------------------- + + diff --git a/setup_native/source/win32/customactions/reg64/reg64.cxx b/setup_native/source/win32/customactions/reg64/reg64.cxx new file mode 100755 index 000000000000..ebb2890e7e49 --- /dev/null +++ b/setup_native/source/win32/customactions/reg64/reg64.cxx @@ -0,0 +1,474 @@ +/************************************************************************* +* +* 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: shellextensions.cxx,v $ +* $Revision: 1.7 $ +* +* 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. +* +************************************************************************/ + +/* + +*/ + + +#define UNICODE + +#ifdef _MSC_VER +#pragma warning(push, 1) /* disable warnings within system headers */ +#endif +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <msiquery.h> +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#include <malloc.h> +//#include <string> +//#include <map>
+#include <strsafe.h> + +// 10.11.2009 tkr: MinGW doesn't know anything about RegDeleteKeyExW if WINVER < 0x0502. +WINADVAPI LONG WINAPI RegDeleteKeyExW(HKEY,LPCWSTR,REGSAM,DWORD); + +// 06.11.2009 tkr: to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY +// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems. +// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and +// extensions\source\activex\main\so_activex.cpp +#ifndef KEY_WOW64_64KEY + #define KEY_WOW64_64KEY (0x0100) +#endif + + +#define TABLE_NAME L"Reg64" +#define BASISINSTALLLOCATION L"[BASISINSTALLLOCATION]" + +bool isInstall4AllUsers; +wchar_t * sBasisInstallLocation; + + +enum OPERATION { + SET, + REMOVE +}; + +#ifdef DEBUG +inline void OutputDebugStringFormat( const wchar_t* pFormat, ... ) +{ + wchar_t buffer[1024]; + va_list args; + + va_start( args, pFormat ); + StringCchVPrintf( buffer, sizeof(buffer), pFormat, args ); + OutputDebugString( buffer ); +} +#else +static inline void OutputDebugStringFormat( const wchar_t*, ... ) +{ +} +#endif + +bool WriteRegistry( MSIHANDLE & hMSI, OPERATION op, const wchar_t* componentName) +{ + INSTALLSTATE current_state; + INSTALLSTATE comp_state; + UINT ret = MsiGetComponentState( hMSI, componentName, ¤t_state, &comp_state ); + if ( ERROR_SUCCESS == ret ) + { + if (current_state == INSTALLSTATE_ABSENT) + OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_ABSENT"); + else if (current_state == INSTALLSTATE_DEFAULT) + OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_DEFAULT"); + else if (current_state == INSTALLSTATE_LOCAL) + OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_LOCAL"); + else if (current_state == INSTALLSTATE_REMOVED) + OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_REMOVED"); + else if (current_state == INSTALLSTATE_SOURCE) + OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_SOURCE"); + else if (current_state == INSTALLSTATE_UNKNOWN) + OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_UNKNOWN"); + + if (comp_state == INSTALLSTATE_ABSENT) + OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_ABSENT"); + else if (comp_state == INSTALLSTATE_DEFAULT) + OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_DEFAULT"); + else if (comp_state == INSTALLSTATE_LOCAL) + OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_LOCAL"); + else if (comp_state == INSTALLSTATE_REMOVED) + OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_REMOVED"); + else if (comp_state == INSTALLSTATE_SOURCE) + OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_SOURCE"); + else if (comp_state == INSTALLSTATE_UNKNOWN) + OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_UNKNOWN"); + + switch (op) + { + case SET : + if ( comp_state == INSTALLSTATE_LOCAL || ( current_state == INSTALLSTATE_LOCAL && comp_state == INSTALLSTATE_UNKNOWN ) ) + { + return true; + } + break; + case REMOVE: + OutputDebugStringFormat(L"WriteRegistry - Remove\n" ); + if ( current_state == INSTALLSTATE_LOCAL && (comp_state == INSTALLSTATE_ABSENT || comp_state == INSTALLSTATE_REMOVED) ) + { + OutputDebugStringFormat(L"WriteRegistry - To be removed\n" ); + return true; + } + } + } else + { + if (ERROR_INVALID_HANDLE == ret) OutputDebugStringFormat(L"WriteRegistry - Invalid handle"); + if (ERROR_UNKNOWN_FEATURE == ret) OutputDebugStringFormat(L"WriteRegistry - Unknown feature"); + } + + return false; +} + +BOOL UnicodeEquals( wchar_t* pStr1, wchar_t* pStr2 ) +{ + if ( pStr1 == NULL && pStr2 == NULL ) + return TRUE; + else if ( pStr1 == NULL || pStr2 == NULL ) + return FALSE; + + while( *pStr1 == *pStr2 && *pStr1 && *pStr2 ) + pStr1++, pStr2++; + + return ( *pStr1 == 0 && *pStr2 == 0 ); +} + +BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) +{ + OutputDebugStringFormat(L"GetMsiProp - START\n" ); + DWORD sz = 0; + UINT ret = MsiGetProperty( hMSI, pPropName, L"", &sz ); + if ( ret == ERROR_MORE_DATA ) + { + sz++; + DWORD nbytes = sz * sizeof( wchar_t ); + wchar_t* buff = reinterpret_cast<wchar_t*>( malloc( nbytes ) ); + ZeroMemory( buff, nbytes ); + MsiGetProperty( hMSI, pPropName, buff, &sz ); + + OutputDebugStringFormat(L"GetMsiProp - Value" ); + OutputDebugStringFormat( buff ); + *ppValue = buff; + + return TRUE; + } else if (ret == ERROR_INVALID_HANDLE) + { + OutputDebugStringFormat(L"GetMsiProp - ERROR_INVALID_HANDLE" ); + } else if (ret == ERROR_INVALID_PARAMETER) + { + OutputDebugStringFormat(L"GetMsiProp - ERROR_INVALID_PARAMETER" ); + } else if (ret == ERROR_SUCCESS) + { + OutputDebugStringFormat(L"GetMsiProp - ERROR_SUCCESS" ); + } + + + OutputDebugStringFormat(L"GetMsiProp - ENDE\n" ); + return FALSE; +} + +bool IsInstallForAllUsers( MSIHANDLE hMSI ) +{ + OutputDebugStringFormat(L"IsInstallForAllUsers - START\n" ); + bool bResult = FALSE; + wchar_t* pVal = NULL; + if ( GetMsiProp( hMSI, L"ALLUSERS", &pVal ) && pVal ) + { + bResult = UnicodeEquals( pVal , L"1" ); + free( pVal ); + } + + OutputDebugStringFormat(L"IsInstallForAllUsers - ENDE\n" ); + return bResult; +} + +wchar_t* GetBasisInstallLocation( MSIHANDLE hMSI ) +{ + OutputDebugStringFormat(L"GetBasisInstallLocation - START\n" ); + bool bResult = FALSE; + wchar_t* pVal = NULL; + GetMsiProp( hMSI, L"BASISINSTALLLOCATION", &pVal); + + OutputDebugStringFormat(L"GetBasisInstallLocation - ENDE\n" ); + return pVal; +} + + +bool QueryReg64Table(MSIHANDLE& rhDatabase, MSIHANDLE& rhView) +{ + OutputDebugStringFormat(L"QueryReg64Table - START\n" ); + int const arraysize = 400; + wchar_t szSelect[arraysize]; + StringCbPrintfW(szSelect, arraysize * sizeof(wchar_t), L"SELECT * FROM %s",TABLE_NAME);
+ OutputDebugStringFormat( szSelect );
+
+ UINT ret = MsiDatabaseOpenView(rhDatabase,szSelect,&rhView);
+ if (ret != ERROR_SUCCESS)
+ {
+ if ( ret == ERROR_BAD_QUERY_SYNTAX)
+ OutputDebugStringFormat(L"QueryReg64Table - MsiDatabaseOpenView - FAILED - ERROR_BAD_QUERY_SYNTAX\n" );
+ if ( ret == ERROR_INVALID_HANDLE)
+ OutputDebugStringFormat(L"QueryReg64Table - MsiDatabaseOpenView - FAILED - ERROR_INVALID_HANDLE\n" );
+ return false;
+ }
+ // execute query - not a parameter query so second parameter is NULL.
+ if (MsiViewExecute(rhView,NULL) != ERROR_SUCCESS)
+ {
+ OutputDebugStringFormat(L"QueryReg64Table - MsiViewExecute - FAILED\n" );
+ return false;
+ }
+ + OutputDebugStringFormat(L"QueryReg64Table - ENDE\n" ); + return true; +} + +//--------------------------------------- +bool DeleteRegistryKey(HKEY RootKey, const wchar_t* KeyName) +{ + int rc = RegDeleteKeyExW( + RootKey, KeyName, KEY_WOW64_64KEY, 0); + + return (ERROR_SUCCESS == rc); +} + + + + +//--------------------------------------- +// +//--------------------------------------- + +bool SetRegistryKey(HKEY RootKey, const wchar_t* KeyName, const wchar_t* ValueName, const wchar_t* Value) +{ + HKEY hSubKey; + + // open or create the desired key + int rc = RegCreateKeyEx( + RootKey, KeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_WOW64_64KEY, 0, &hSubKey, 0); + + if (ERROR_SUCCESS == rc) + { + OutputDebugStringFormat(L"SetRegistryKey - Created\n" ); + rc = RegSetValueEx( + hSubKey, ValueName, 0, REG_SZ, reinterpret_cast<const BYTE*>(Value), (wcslen(Value) + 1) * sizeof(wchar_t)); + + RegCloseKey(hSubKey); + } else { + OutputDebugStringFormat(L"SetRegistryKey - FAILED\n" ); + } + + + return (ERROR_SUCCESS == rc); +} + +bool DoRegEntries( MSIHANDLE& rhMSI, OPERATION op, MSIHANDLE& rhView) +{ + OutputDebugStringFormat(L"DoRegEntries - START\n" ); + + MSIHANDLE hRecord; + + long lRoot;
+ wchar_t szKey[255];
+ wchar_t szName[255];
+ wchar_t szValue[1024];
+ wchar_t szComponent[255];
+ + /// read records until there are no more records
+ while (MsiViewFetch(rhView,&hRecord) == ERROR_SUCCESS)
+ {
+ DWORD dwKey = 255;
+ DWORD dwName = 255;
+ DWORD dwValue = 1024;
+ DWORD dwComponent = 255;
+
+ szKey[0] = '\0';
+ szName[0] = '\0';
+ szValue[0] = '\0';
+ szComponent[0] = '\0';
+
+ lRoot = MsiRecordGetInteger(hRecord,2);
+ MsiRecordGetString(hRecord,3,szKey,&dwKey);
+
+ if (!MsiRecordIsNull(hRecord, 4))
+ MsiRecordGetString(hRecord,4,szName,&dwName);
+
+ if (!MsiRecordIsNull(hRecord, 5))
+ {
+ MsiRecordGetString(hRecord,5,szValue,&dwValue);
+
+
+
+ wchar_t* nPos = wcsstr(szValue , BASISINSTALLLOCATION);
+ if ( NULL != nPos)
+ {
+
+ DWORD nPrefixSize = nPos - szValue;
+
+ DWORD nPropSize = wcslen(sBasisInstallLocation);
+ DWORD nPostfixSize = dwValue - wcslen( BASISINSTALLLOCATION );
+
+ DWORD nNewValueBytes = (nPropSize + nPostfixSize + 1) * sizeof( wchar_t ); + wchar_t* newValue = reinterpret_cast<wchar_t*>( malloc( nNewValueBytes ) ); + ZeroMemory( newValue, nNewValueBytes );
+
+ // prefix
+ wcsncpy(newValue, szValue, nPrefixSize);
+
+ // basis location
+ wcsncat(newValue, sBasisInstallLocation, nPropSize * sizeof( wchar_t ));
+
+ // postfix
+ wcsncat(newValue, nPos + ( wcslen( BASISINSTALLLOCATION ) ), nPropSize * sizeof( wchar_t ));
+
+ wcsncpy(szValue, newValue, nNewValueBytes <=1024? nNewValueBytes: 1024);
+
+ free(newValue);
+ }
+
+ }
+
+
+ MsiRecordGetString(hRecord,6,szComponent,&dwComponent);
+
+ OutputDebugStringFormat(L"****** DoRegEntries *******" );
+ OutputDebugStringFormat(L"Root:" );
+ HKEY key = HKEY_CURRENT_USER;
+ switch (lRoot)
+ {
+ case(-1):
+ if (isInstall4AllUsers)
+ {
+ key = HKEY_CURRENT_USER;
+ OutputDebugStringFormat(L"HKEY_CURRENT_USER" );
+ }
+ else
+ {
+ key = HKEY_LOCAL_MACHINE;
+ OutputDebugStringFormat(L"HKEY_LOCAL_MACHINE" );
+ }
+ break;
+ case(0):
+ key = HKEY_CLASSES_ROOT;
+ OutputDebugStringFormat(L"HKEY_CLASSES_ROOT" );
+ break;
+ case(1):
+ key = HKEY_CURRENT_USER;
+ OutputDebugStringFormat(L"HKEY_CURRENT_USER" );
+ break;
+ case(2):
+ key = HKEY_LOCAL_MACHINE;
+ OutputDebugStringFormat(L"HKEY_LOCAL_MACHINE" );
+ break;
+ case(3):
+ key = HKEY_USERS;
+ OutputDebugStringFormat(L"HKEY_USERS" );
+ break;
+
+ }
+
+ OutputDebugStringFormat(L"Key:");
+ OutputDebugStringFormat( szKey );
+ OutputDebugStringFormat(L"Name:");
+ OutputDebugStringFormat( szName );
+ OutputDebugStringFormat(L"Value:");
+ OutputDebugStringFormat( szValue);
+ OutputDebugStringFormat(L"Component:");
+ OutputDebugStringFormat( szComponent );
+ OutputDebugStringFormat(L"*******************" );
+ switch (op)
+ {
+ case SET:
+
+ if (WriteRegistry(rhMSI, SET, szComponent))
+ {
+ OutputDebugStringFormat(L"DoRegEntries - Write\n" );
+ SetRegistryKey(key, szKey, szName, szValue);
+ }
+ break;
+ case REMOVE:
+ OutputDebugStringFormat(L"DoRegEntries - PreRemove\n" );
+ if (WriteRegistry(rhMSI, REMOVE, szComponent))
+ {
+ OutputDebugStringFormat(L"DoRegEntries - Remove\n" );
+ DeleteRegistryKey(key, szKey);
+ }
+ break;
+ }
+ }
+
+ MsiCloseHandle(rhView);
+ + + OutputDebugStringFormat(L"DoRegEntries - ENDE\n" ); + + return true; +} + + +bool Reg64(MSIHANDLE& rhMSI, OPERATION op) +{ + isInstall4AllUsers = IsInstallForAllUsers(rhMSI); + sBasisInstallLocation = GetBasisInstallLocation(rhMSI);
+
+ if (NULL == sBasisInstallLocation)
+ {
+ OutputDebugStringFormat(L"BASISINSTALLLOCATION is NULL\n" );
+ return false;
+ }
+ + MSIHANDLE hView; + MSIHANDLE hDatabase = MsiGetActiveDatabase(rhMSI); + + QueryReg64Table(hDatabase, hView); + OutputDebugStringFormat(L"Do something\n" ); + DoRegEntries( rhMSI, op, hView); + OutputDebugStringFormat(L"Something done\n" ); + + MsiCloseHandle(hView); + MsiCloseHandle(hDatabase); + free(sBasisInstallLocation); + + return true; +} + +extern "C" UINT __stdcall InstallReg64(MSIHANDLE hMSI) +{ + OutputDebugStringFormat(L"InstallReg64\n" ); + Reg64(hMSI, SET); + return ERROR_SUCCESS; +} + +extern "C" UINT __stdcall DeinstallReg64(MSIHANDLE hMSI) +{ + OutputDebugStringFormat(L"DeinstallReg64\n" ); + Reg64(hMSI, REMOVE); + return ERROR_SUCCESS; +}
\ No newline at end of file diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx index c2a70b66b761..8c64fe784e6e 100644 --- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx +++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx @@ -51,8 +51,8 @@ // #define OWN_DEBUG_PRINT -typedef int ( __stdcall * DllNativeRegProc ) ( int, BOOL, const char* ); -typedef int ( __stdcall * DllNativeUnregProc ) ( int, BOOL ); +typedef int ( __stdcall * DllNativeRegProc ) ( int, BOOL, BOOL, const char* ); +typedef int ( __stdcall * DllNativeUnregProc ) ( int, BOOL, BOOL ); BOOL UnicodeEquals( wchar_t* pStr1, wchar_t* pStr2 ) { @@ -90,7 +90,7 @@ void WarningMessageInt( wchar_t* pWarning, unsigned int nValue ) #endif //---------------------------------------------------------- -void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallForAllUser ) +void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) { #ifdef OWN_DEBUG_PRINT MessageBoxW(NULL, L"RegisterActiveXNative", L"Information", MB_OK | MB_ICONINFORMATION); @@ -112,7 +112,18 @@ void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallFor #ifdef OWN_DEBUG_PRINT MessageBoxA(NULL, pActiveXPath, "Library Path", MB_OK | MB_ICONINFORMATION); #endif - ( *pNativeProc )( nMode, InstallForAllUser, pActiveXPath ); + int nLen = strlen( pActiveXPath ); + int nRemoveLen = strlen( "\\so_activex.dll" ); + if ( nLen > nRemoveLen ) + { + char* pProgramPath = reinterpret_cast<char*>( malloc( nLen - nRemoveLen + 1 ) ); + strncpy( pProgramPath, pActiveXPath, nLen - nRemoveLen ); + pProgramPath[ nLen - nRemoveLen ] = 0; + + ( *pNativeProc )( nMode, InstallForAllUser, InstallFor64Bit, pProgramPath ); + + free( pProgramPath ); + } } FreeLibrary( hModule ); @@ -120,7 +131,7 @@ void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallFor } //---------------------------------------------------------- -void UnregisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallForAllUser ) +void UnregisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) { // For Win98/WinME the values should be written to the local machine OSVERSIONINFO aVerInfo; @@ -133,7 +144,7 @@ void UnregisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallF { DllNativeUnregProc pNativeProc = ( DllNativeUnregProc )GetProcAddress( hModule, "DllUnregisterServerNative" ); if( pNativeProc!=NULL ) - ( *pNativeProc )( nMode, InstallForAllUser ); + ( *pNativeProc )( nMode, InstallForAllUser, InstallFor64Bit ); FreeLibrary( hModule ); } @@ -162,7 +173,7 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) BOOL GetActiveXControlPath( MSIHANDLE hMSI, char** ppActiveXPath ) { wchar_t* pProgPath = NULL; - if ( GetMsiProp( hMSI, L"BASISINSTALLLOCATION", &pProgPath ) && pProgPath ) + if ( GetMsiProp( hMSI, L"OFFICEINSTALLLOCATION", &pProgPath ) && pProgPath ) { char* pCharProgPath = UnicodeToAnsiString( pProgPath ); #ifdef OWN_DEBUG_PRINT @@ -313,6 +324,19 @@ BOOL MakeInstallForAllUsers( MSIHANDLE hMSI ) } //---------------------------------------------------------- +BOOL MakeInstallFor64Bit( MSIHANDLE hMSI ) +{ + BOOL bResult = FALSE; + wchar_t* pVal = NULL; + if ( GetMsiProp( hMSI, L"VersionNT64", &pVal ) && pVal ) + { + bResult = TRUE; + free( pVal ); + } + + return bResult; +} +//---------------------------------------------------------- extern "C" UINT __stdcall InstallActiveXControl( MSIHANDLE hMSI ) { int nOldInstallMode = 0; @@ -333,6 +357,8 @@ extern "C" UINT __stdcall InstallActiveXControl( MSIHANDLE hMSI ) #endif BOOL bInstallForAllUser = MakeInstallForAllUsers( hMSI ); + BOOL bInstallFor64Bit = MakeInstallFor64Bit( hMSI ); + char* pActiveXPath = NULL; if ( GetActiveXControlPath( hMSI, &pActiveXPath ) && pActiveXPath && GetDelta( hMSI, nOldInstallMode, nInstallMode, nDeinstallMode ) ) @@ -351,10 +377,10 @@ extern "C" UINT __stdcall InstallActiveXControl( MSIHANDLE hMSI ) // the control is installed in the new selected configuration if ( current_state == INSTALLSTATE_LOCAL && nDeinstallMode ) - UnregisterActiveXNative( pActiveXPath, nDeinstallMode, bInstallForAllUser ); + UnregisterActiveXNative( pActiveXPath, nDeinstallMode, bInstallForAllUser, bInstallFor64Bit ); if ( nInstallMode ) - RegisterActiveXNative( pActiveXPath, nInstallMode, bInstallForAllUser ); + RegisterActiveXNative( pActiveXPath, nInstallMode, bInstallForAllUser, bInstallFor64Bit ); } else if ( current_state == INSTALLSTATE_LOCAL && future_state == INSTALLSTATE_ABSENT ) { @@ -362,7 +388,7 @@ extern "C" UINT __stdcall InstallActiveXControl( MSIHANDLE hMSI ) MessageBox(NULL, L"InstallActiveXControl, removing", L"Information", MB_OK | MB_ICONINFORMATION); #endif if ( nOldInstallMode ) - UnregisterActiveXNative( pActiveXPath, nOldInstallMode, bInstallForAllUser ); + UnregisterActiveXNative( pActiveXPath, nOldInstallMode, bInstallForAllUser, bInstallFor64Bit ); } } @@ -393,6 +419,7 @@ extern "C" UINT __stdcall DeinstallActiveXControl( MSIHANDLE hMSI ) if ( current_state == INSTALLSTATE_LOCAL && GetActiveXControlPath( hMSI, &pActiveXPath ) && pActiveXPath ) { BOOL bInstallForAllUser = MakeInstallForAllUsers( hMSI ); + BOOL bInstallFor64Bit = MakeInstallFor64Bit( hMSI ); { UnregisterActiveXNative( pActiveXPath, @@ -402,7 +429,8 @@ extern "C" UINT __stdcall DeinstallActiveXControl( MSIHANDLE hMSI ) | CALC_COMPONENT | WRITER_COMPONENT | MATH_COMPONENT, - bInstallForAllUser ); + bInstallForAllUser, + bInstallFor64Bit ); } free( pActiveXPath ); diff --git a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx index 2a5d775eba5e..c6c807241c74 100644 --- a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx @@ -102,22 +102,95 @@ RegistryEntry InfotipHandler = { TEXT("{087B3AE3-E237-4467-B8DB-5A38AB959AC9}"), RegistryEntry PropHandler = { TEXT("{63542C48-9552-494A-84F7-73AA6A7C99C1}"), TEXT("OpenOffice.org Property Sheet Handler") }; RegistryEntry ThumbViewer = { TEXT("{3B092F0C-7696-40E3-A80F-68D74DA84210}"), TEXT("OpenOffice.org Thumbnail Viewer") }; +BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) +{ + DWORD sz = 0; + if ( MsiGetProperty( hMSI, pPropName, 0, &sz ) == ERROR_MORE_DATA ) + { + sz++; + DWORD nbytes = sz * sizeof( char ); + char* buff = reinterpret_cast<char*>( malloc( nbytes ) ); + ZeroMemory( buff, nbytes ); + MsiGetProperty( hMSI, pPropName, buff, &sz ); + *ppValue = buff; + + return TRUE; + } + + return FALSE; +} + +bool IsVersionNT64( MSIHANDLE hMSI ) +{ + char* pVal = NULL; + + if ( GetMsiProp( hMSI, "VersionNT64", &pVal ) && pVal ) + { + free( pVal ); + return true; + } + + return false; +} + + + + /* Called during installation when the module "Windows Explorer Extensions" is selected. */ -extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE) +extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE hMSI) { //MessageBox(NULL, TEXT("InstallExecSequenceEntry"), TEXT("Pythonmsi"), MB_OK | MB_ICONINFORMATION); HKEY hKey; - if (RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), &hKey) == ERROR_SUCCESS) + + +// 06.11.2009 tkr: to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY +// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems. +// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and +// extensions\source\activex\main\so_activex.cpp +#ifndef KEY_WOW64_64KEY + #define KEY_WOW64_64KEY (0x0100) +#endif + + if (IsVersionNT64(hMSI)) { - RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1); - RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1); - RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1); - RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1); + // Open Windows 64 Bit Registry + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),0, KEY_WRITE | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS) + { + RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1); + RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1); + RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1); + RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1); - RegCloseKey(hKey); + RegCloseKey(hKey); + } + + // Open Windows 32 Bit Registry on Win64 maschine + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),0, KEY_WRITE, &hKey ) == ERROR_SUCCESS) + { + RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1); + RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1); + RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1); + RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1); + + RegCloseKey(hKey); + } + + + } else + { + if (RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), &hKey) == ERROR_SUCCESS) + { + RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1); + RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1); + RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1); + RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1); + + RegCloseKey(hKey); + } } return ERROR_SUCCESS; } diff --git a/setup_native/source/win32/msi-encodinglist.txt b/setup_native/source/win32/msi-encodinglist.txt index ad3f1fb15824..81258d61f38b 100644 --- a/setup_native/source/win32/msi-encodinglist.txt +++ b/setup_native/source/win32/msi-encodinglist.txt @@ -4,6 +4,8 @@ af 1252 1078 # Afrikaans ar 1256 1025 ar-SA 1256 1025 as-IN 0 1101 # Assamese +as 0 1101 # Assamese +ast 1252 1610 be-BY 1251 1059 # Belarusian bg 1251 1026 # Bulgarian bn 0 2117 # Bengali @@ -12,6 +14,7 @@ bn-IN 0 1093 # Bengali India br 1252 1150 # Breton brx 0 1603 # Bodo (India) bs 0 5146 # bosnian +bo 0 2121 ca 1252 1027 # Catalan cs 1250 1029 # Czech cy 1252 1106 # Welsh @@ -55,12 +58,15 @@ ko 949 1042 kok 0 1111 # Konkani ks 0 1120 # Kashmiri ku 0 1574 +kid 1252 1033 # key id pseudo language +ky 0 2100 lo 0 1108 # Lao lt 1257 1063 # Lithuanian lv 1257 1062 # Latvian mai 0 1605 # Maithili (India) mk 1251 1071 # Macedonian ml-IN 0 1100 +ml 0 1100 mn 0 1104 # Mongolian mni 0 1112 # Manipuri mn-TR 0 2128 # Mongolian Classical/traditional @@ -80,10 +86,13 @@ or 0 1096 # Oriya oc 1252 1154 # Occitan-lengadocian or-IN 0 1096 pa-IN 0 1094 # Punjabi +pap 0 2171 +om 0 2162 pl 1250 1045 pt 1252 2070 pt-BR 1252 1046 pt-PT 1252 2070 +ps 0 2171 rm 0 1047 # Raeto-Romance ro 1250 1048 # Romanian ru 1251 1049 @@ -91,6 +100,7 @@ rw 0 1569 # Kinyarwanda sa-IN 0 1103 # Sanskrit sat 0 1606 # Santali sb 0 1070 # Sorbian +sc 0 3047 sd 0 1113 # Sindhi sh 1250 2074 # Serbian Latin sk 1250 1051 # Slovak @@ -103,9 +113,11 @@ st 0 1072 # Southern Sotho, Sutu sv 1252 1053 sw 1252 1089 # Swahili sw-TZ 1252 1089 # Swahili +si 0 2133 ta 0 1097 # Tamil ta-IN 0 1097 # Tamil te-IN 0 1098 +te 0 1098 tg 0 1064 # Tajik th 874 1054 ti-ER 0 1139 @@ -117,6 +129,7 @@ uk 1251 1058 # Ukrainian ur 1256 1056 # Urdu ur-IN 0 2080 uz 0 1091 # Uzbek (Latin) +ug 0 2200 ve 0 1075 # Venda vi 1258 1066 # Vietnamese xh 0 1076 # Xhosa diff --git a/setup_native/tests/opensolaris/bundledextensions/send_ooo b/setup_native/tests/opensolaris/bundledextensions/send_ooo new file mode 100644 index 000000000000..669e63ceda1b --- /dev/null +++ b/setup_native/tests/opensolaris/bundledextensions/send_ooo @@ -0,0 +1,32 @@ +#! /bin/bash + + +if [ $# = 0 ] +then +echo "usage: send_ooo path_to_pkg_folder + +The files +installed, +ooo_bundled_extension.xml, +svc-ooo_bundled_extension +must be in the current directory. The pkg.depotd or the service +application/pkg/server must listen to port 80" + +exit +fi + + +EXTENSIONPATH=/opt/openoffice.org3/share/extension/install + +eval `pkgsend -s http://localhost:80 open ooo_test@3.2-1` +pkgsend -s http://localhost:80 import $1/openofficeorg-ure +pkgsend -s http://localhost:80 import $1/ooobasis* +pkgsend -s http://localhost:80 import $1/openofficeorg3* + +pkgsend -s http://localhost:80 add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default +pkgsend -s http://localhost:80 add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions +pkgsend -s http://localhost:80 add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default + +pkgsend -s http://localhost:80 add set name=description value="OOo 3.2 with dictionaries: en fr es da de" +pkgsend -s http://localhost:80 close + diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java index 36ac2a2da127..23dec6a80191 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java @@ -287,9 +287,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog /** used in developement to start the wizard */ public static void main(String args[]) { - String ConnectStr = "uno:socket,host=127.0.0.1,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.NamingService"; //localhost - // ;Lo-1.Germany.sun.com; - // 10.16.65.155 + String ConnectStr = "uno:socket,host=127.0.0.1,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager"; try { XMultiServiceFactory xLocMSF = Desktop.connect(ConnectStr); AgendaWizardDialogImpl wizard = new AgendaWizardDialogImpl(xLocMSF); diff --git a/wizards/com/sun/star/wizards/common/Desktop.java b/wizards/com/sun/star/wizards/common/Desktop.java index 064033585ac1..2c4c81368fc4 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.java +++ b/wizards/com/sun/star/wizards/common/Desktop.java @@ -182,21 +182,11 @@ public class Desktop public static XMultiServiceFactory connect(String connectStr) throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException, Exception { - XComponentContext xcomponentcontext = null; - XMultiComponentFactory xMultiComponentFactory = getMultiComponentFactory(); - // create a connector, so that it can contact the office - Object xUrlResolver = xMultiComponentFactory.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", xcomponentcontext); - XUnoUrlResolver urlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(XUnoUrlResolver.class, xUrlResolver); - Object rInitialObject = urlResolver.resolve(connectStr); - XNamingService rName = (XNamingService) UnoRuntime.queryInterface(XNamingService.class, rInitialObject); - XMultiServiceFactory xMSF = null; - if (rName != null) - { - System.err.println("got the remote naming service !"); - Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager"); - xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr); - } - return (xMSF); + XMultiComponentFactory componentFactory = getMultiComponentFactory(); + Object xUrlResolver = componentFactory.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver", null ); + XUnoUrlResolver urlResolver = UnoRuntime.queryInterface(XUnoUrlResolver.class, xUrlResolver); + XMultiServiceFactory orb = UnoRuntime.queryInterface(XMultiServiceFactory.class, urlResolver.resolve( connectStr ) ); + return orb; } public static String getIncrementSuffix(XNameAccess xElementContainer, String ElementName) diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 658ff59d9df2..5ac373b80ded 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -597,8 +597,13 @@ public class DBMetaData public void getDataSourceInterfaces() throws Exception { +<<<<<<< local xCompleted = UnoRuntime.queryInterface( XCompletedConnection.class, m_dataSource ); xDataSourcePropertySet = UnoRuntime.queryInterface( XPropertySet.class, m_dataSource ); +======= + xCompleted = (XCompletedConnection) UnoRuntime.queryInterface(XCompletedConnection.class, getDataSource()); + xDataSourcePropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, getDataSource()); +>>>>>>> other bPasswordIsRequired = ((Boolean) xDataSourcePropertySet.getPropertyValue("IsPasswordRequired")).booleanValue(); } @@ -681,7 +686,11 @@ public class DBMetaData private boolean getConnection(String _DataSourceName) { setDataSourceByName(_DataSourceName, true); +<<<<<<< local return getConnection(m_dataSource); +======= + return getConnection( getDataSource() ); +>>>>>>> other } private boolean getConnection(com.sun.star.sdbc.XConnection _DBConnection) diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java index 311a97f362ed..a8dbe94e5db0 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java @@ -107,7 +107,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog try { - String ConnectStr = "uno:socket,host=127.0.0.1,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.NamingService"; + String ConnectStr = "uno:socket,host=127.0.0.1,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager"; XMultiServiceFactory xLocMSF = Desktop.connect(ConnectStr); FaxWizardDialogImpl lw = new FaxWizardDialogImpl(xLocMSF); lw.startWizard(xLocMSF, null); diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java index 4a58311751ef..1a47712ca213 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java @@ -121,7 +121,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog public static void main(String args[]) { //only being called when starting wizard remotely - String ConnectStr = "uno:socket,host=127.0.0.1,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.NamingService"; + String ConnectStr = "uno:socket,host=127.0.0.1,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager"; XMultiServiceFactory xLocMSF = null; try { diff --git a/wizards/com/sun/star/wizards/query/QueryWizard.java b/wizards/com/sun/star/wizards/query/QueryWizard.java index 468540f9569a..14fe9c4757a9 100644 --- a/wizards/com/sun/star/wizards/query/QueryWizard.java +++ b/wizards/com/sun/star/wizards/query/QueryWizard.java @@ -89,7 +89,7 @@ public class QueryWizard extends WizardDialog CurDBMetaData = new QuerySummary(xMSF, m_oResource); } -/* public static void main(String args[]) + public static void main(String args[]) { String ConnectStr = "uno:pipe,name=fs93730;urp;StarOffice.ServiceManager"; try @@ -110,7 +110,6 @@ public class QueryWizard extends WizardDialog jexception.printStackTrace(System.out); } } - */ public XComponent[] startQueryWizard(XMultiServiceFactory xMSF, PropertyValue[] CurPropertyValues) { diff --git a/wizards/com/sun/star/wizards/report/CallReportWizard.java b/wizards/com/sun/star/wizards/report/CallReportWizard.java index 914ef13f0c75..82c405747ad8 100644 --- a/wizards/com/sun/star/wizards/report/CallReportWizard.java +++ b/wizards/com/sun/star/wizards/report/CallReportWizard.java @@ -36,6 +36,8 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.text.XTextDocument; import com.sun.star.wizards.common.Properties; import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.wizards.common.Desktop; /** This class capsulates the class, that implements the minimal component, a * factory for creating the service (<CODE>__getServiceFactory</CODE>) and a @@ -48,6 +50,27 @@ public class CallReportWizard static boolean bWizardstartedalready; + public static void main(String args[]) + { + String ConnectStr = "uno:pipe,name=fs93730;urp;StarOffice.ServiceManager"; + try + { + XMultiServiceFactory orb = Desktop.connect(ConnectStr); + if ( orb != null ) + { + PropertyValue[] curproperties = new PropertyValue[1]; + curproperties[0] = Properties.createProperty("DataSourceName", "countries"); + + ReportWizard wizard = new ReportWizard(orb); + wizard.startReportWizard(orb, curproperties); + } + } + catch (java.lang.Exception jexception) + { + jexception.printStackTrace(System.out); + } + } + /** Gives a factory for creating the service. * This method is called by the <code>JavaLoader</code> * <p> diff --git a/wizards/com/sun/star/wizards/web/CallWizard.java b/wizards/com/sun/star/wizards/web/CallWizard.java index 4d417afc986d..7019e00f5d5c 100644 --- a/wizards/com/sun/star/wizards/web/CallWizard.java +++ b/wizards/com/sun/star/wizards/web/CallWizard.java @@ -299,15 +299,10 @@ public class CallWizard { String ConnectStr = - "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.NamingService"; - //localhost ;Lo-1.Germany.sun.com; 10.16.65.155 + "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager"; try { XMultiServiceFactory xmsf = Desktop.connect(ConnectStr); - //File dir = new File("D:\\CWS\\extras6");//("C:\\Documents and Settings\\rpiterman\\My Documents"); - //getFiles(dir,xLocMSF); - - //read Configuration CallWizard.WizardImplementation ww = new CallWizard.WizardImplementation(xmsf); ww.trigger("start"); diff --git a/wizards/com/sun/star/wizards/web/FTPDialog.java b/wizards/com/sun/star/wizards/web/FTPDialog.java index 3352b1dff07f..0d9b083489e5 100644 --- a/wizards/com/sun/star/wizards/web/FTPDialog.java +++ b/wizards/com/sun/star/wizards/web/FTPDialog.java @@ -636,7 +636,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID */ public static void main(String args[]) { - String ConnectStr = "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.NamingService"; //localhost ;Lo-1.Germany.sun.com; 10.16.65.155 + String ConnectStr = "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager"; try { XMultiServiceFactory xLocMSF = Desktop.connect(ConnectStr); diff --git a/wizards/com/sun/star/wizards/web/WebWizard.java b/wizards/com/sun/star/wizards/web/WebWizard.java index 6913369991b4..41de8c8e5293 100644 --- a/wizards/com/sun/star/wizards/web/WebWizard.java +++ b/wizards/com/sun/star/wizards/web/WebWizard.java @@ -59,15 +59,10 @@ public class WebWizard extends WWD_Events { String ConnectStr = - "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.NamingService"; - //localhost ;Lo-1.Germany.sun.com; 10.16.65.155 + "uno:socket,host=localhost,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager"; try { XMultiServiceFactory xmsf = Desktop.connect(ConnectStr); - //File dir = new File("D:\\CWS\\extras6");//("C:\\Documents and Settings\\rpiterman\\My Documents"); - //getFiles(dir,xLocMSF); - - //read Configuration WebWizard ww = new WebWizard(xmsf); ww.show(); ww.cleanup(); diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 7f04872f7a63..765649ba3bf7 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -122,7 +122,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif ,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) ) ,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) ) { - if ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() ) + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) maKeyImg.SetImage( Image( XMLSEC_RES( IMG_KEY_HC ) ) ); //Verify the certificate @@ -139,14 +139,14 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif sal_Int32 certErrors = certStatus & mask; bool bCertValid = certErrors > 0 ? false : true; - bool bIsDark = ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() != FALSE ); + bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); if ( !bCertValid ) { maCertImg.SetImage( - Image( XMLSEC_RES( bIsDark ? IMG_STATE_NOT_VALIDATED_HC : IMG_STATE_NOT_VALIDATED ) ) ); + Image( XMLSEC_RES( bHC ? IMG_STATE_NOT_VALIDATED_HC : IMG_STATE_NOT_VALIDATED ) ) ); maHintNotTrustedFI.SetText( String( XMLSEC_RES( STR_CERTIFICATE_NOT_VALIDATED ) ) ); } - else if ( bIsDark ) + else if ( bHC ) maCertImg.SetImage( Image( XMLSEC_RES( IMG_STATE_CERIFICATED_HC ) ) ); FreeResource(); @@ -430,7 +430,7 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, Cert ,msCertNotValidated ( XMLSEC_RES( STR_PATH_CERT_NOT_VALIDATED ) ) { - if ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() ) + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) { maCertImage = Image( XMLSEC_RES( IMG_CERT_SMALL_HC ) ); maCertNotValidatedImage = Image( XMLSEC_RES( IMG_CERT_NOTVALIDATED_SMALL_HC ) ); diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index cf07edb7023e..e8a484f38944 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -216,7 +216,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( maSigsNotvalidatedFI.SetText( String( XMLSEC_RES( STR_NO_INFO_TO_VERIFY ) ) ); - if ( GetBackground().GetColor().IsDark() ) + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) { // high contrast mode needs other images maSigsValidImg.SetImage( Image( XMLSEC_RES( IMG_STATE_VALID_HC ) ) ); diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index 9d469a53a479..f7fa2c08eca5 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -429,7 +429,7 @@ void MacroSecurityTrustedSourcesTP::ClosePage( void ) ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) : FixedImage(pParent, rResId) { - sal_Bool bHighContrast = pParent->GetDisplayBackground().GetColor().IsDark(); + sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode(); SetImage( Image(XMLSEC_RES( bHighContrast ? RID_XMLSECTP_LOCK_HC : RID_XMLSECTP_LOCK ))); } diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx index 41dbd6232bce..e01fe5109190 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -239,7 +239,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su ) ; if( cbIssuer <= 0 ) { - delete issuer ; + delete [] issuer ; throw RuntimeException() ; } @@ -252,7 +252,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su if(issuer[cbIssuer-1] == 0) cbIssuer--; //delimit the last 0x00; OUString xIssuer(issuer , cbIssuer ,encoding ) ; //By CP - delete issuer ; + delete [] issuer ; return replaceTagSWithTagST(xIssuer); } else { @@ -288,7 +288,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su ) ; if( cbSubject <= 0 ) { - delete subject ; + delete [] subject ; throw RuntimeException() ; } @@ -301,7 +301,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su if(subject[cbSubject-1] == 0) cbSubject--; //delimit the last 0x00; OUString xSubject(subject , cbSubject ,encoding ) ; //By CP - delete subject ; + delete [] subject ; return replaceTagSWithTagST(xSubject); } else { |