diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-09 14:50:43 +0200 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-09 14:50:43 +0200 |
commit | 6cf5d942996d8a49cfe2b2750fdf9b1263fa259a (patch) | |
tree | ba15d1ea8f479930c549c5203e6149c183e7cf0a | |
parent | 9abc6eb238e1c2784f5896ec905d9de0b7a7e38c (diff) | |
parent | 3a9fa417bcc24977c9db13b9f8b9103f94942974 (diff) |
cws tl74: merge with DEV300_m81
222 files changed, 4230 insertions, 1831 deletions
diff --git a/UnoControls/util/exports.map b/UnoControls/util/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/UnoControls/util/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/UnoControls/util/makefile.mk b/UnoControls/util/makefile.mk index 5cd23262a481..aacddb23c0ad 100644 --- a/UnoControls/util/makefile.mk +++ b/UnoControls/util/makefile.mk @@ -44,7 +44,7 @@ LIB1FILES= $(SLB)$/base.lib \ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk b/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk index f99b19cd6590..0d98760a31df 100755 --- a/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk +++ b/accessibility/bridge/org/openoffice/java/accessibility/makefile.mk @@ -102,7 +102,6 @@ PRODUCTSWITCH = false DEBUGSWITCH = true .ENDIF -.IF "$(GUI)"=="UNX" || "$(USE_SHELL)" != "4nt" $(JAVADIR)$/$(PACKAGE)$/%.java: makefile.mk @@-$(MKDIRHIER) $(JAVADIR)$/$(PACKAGE) @-echo package org.openoffice.java.accessibility\; > $@ @@ -110,16 +109,6 @@ $(JAVADIR)$/$(PACKAGE)$/%.java: makefile.mk @-echo public static final boolean DEBUG = $(DEBUGSWITCH)\; >> $@ @-echo public static final boolean PRODUCT = $(PRODUCTSWITCH)\; >> $@ @-echo } >> $@ -.ELSE -$(JAVADIR)$/$(PACKAGE)$/%.java: makefile.mk - @@-$(MKDIRHIER) $(JAVADIR)$/$(PACKAGE) - @-echo package org.openoffice.java.accessibility; > $@ - @-echo public class Build { >> $@ - @-echo public static final boolean DEBUG = $(DEBUGSWITCH); >> $@ - @-echo public static final boolean PRODUCT = $(PRODUCTSWITCH); >> $@ - @-echo } >> $@ -.ENDIF - $(CLASSDIR)$/$(PACKAGE)$/Build.class : $(JAVADIR)$/$(PACKAGE)$/Build.java -$(JAVAC) -d $(CLASSDIR) $(JAVADIR)$/$(PACKAGE)$/Build.java diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx index 957b0a508bd8..cb2c4f6628c8 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx @@ -56,7 +56,7 @@ 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 + ::svt::table::IAccessibleTable& _rTable ); virtual ~AccessibleGridControl(); @@ -177,8 +177,7 @@ private: <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; +typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessible > AccessibleGridControlAccess_Base; class AccessibleGridControlAccess :public AccessibleGridControlAccess_Base ,public ::svt::table::IAccessibleTableControl @@ -191,7 +190,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > m_xContext; - AccessibleGridControl* m_pContext; + AccessibleGridControl* m_pContext; // note that this pointer is valid as long as m_xContext is valid! public: @@ -253,7 +252,7 @@ protected: private: AccessibleGridControlAccess(); // never implemented - AccessibleGridControlAccess( const AccessibleGridControlAccess& ); // never implemented + AccessibleGridControlAccess( const AccessibleGridControlAccess& ); // never implemented AccessibleGridControlAccess& operator=( const AccessibleGridControlAccess& ); // never implemented }; diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx index 3bdd5abe8912..c6a26d8c4548 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx @@ -96,8 +96,8 @@ public: @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, + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, ::svt::table::AccessibleTableControlObjType eObjType ); protected: @@ -135,14 +135,14 @@ public: The relation set (the GridControl does not have one). */ virtual ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL - getAccessibleRelationSet() + ::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() + getAccessibleStateSet() throw ( ::com::sun::star::uno::RuntimeException ); /** @return The parent's locale. */ @@ -407,7 +407,7 @@ protected: private: GridControlAccessibleElement(); // never implemented - GridControlAccessibleElement( const GridControlAccessibleElement& ); // never implemented + GridControlAccessibleElement( const GridControlAccessibleElement& ); // never implemented GridControlAccessibleElement& operator=( const GridControlAccessibleElement& ); // never implemented }; diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx index b45ad5bdae5a..90306435bd4b 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx @@ -51,7 +51,7 @@ public: AccessibleGridControlHeader( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, + ::svt::table::IAccessibleTable& rTable, ::svt::table::AccessibleTableControlObjType eObjType ); protected: diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx index 648614a9e214..0672ca28a151 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx @@ -36,9 +36,9 @@ namespace accessibility 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); + 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 ); @@ -56,8 +56,8 @@ namespace accessibility /** 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 ); + 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 (); diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx index 35b7a69f5aa6..28d9cfb919f1 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx @@ -57,9 +57,9 @@ public: @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 ); + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); protected: virtual ~AccessibleGridControlTableBase(); diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx index dd44927d7fc1..dd44927d7fc1 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx diff --git a/accessibility/inc/accessibility/extended/AccessibleToolPanelDeck.hxx b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeck.hxx new file mode 100755 index 000000000000..10c6520b6a3d --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeck.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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 ACC_ACCESSIBLETOOLPANELDECK_HXX +#define ACC_ACCESSIBLETOOLPANELDECK_HXX + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include <cppuhelper/implbase1.hxx> +#include <toolkit/awt/vclxaccessiblecomponent.hxx> + +#include <boost/scoped_ptr.hpp> + +namespace svt +{ + class ToolPanelDeck; +} + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + //================================================================================================================== + //= AccessibleToolPanelDeck + //================================================================================================================== + class AccessibleToolPanelDeck_Impl; + typedef VCLXAccessibleComponent AccessibleToolPanelDeck_Base; + class AccessibleToolPanelDeck : public AccessibleToolPanelDeck_Base + { + public: + AccessibleToolPanelDeck( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, + ::svt::ToolPanelDeck& i_rPanelDeck + ); + + using AccessibleToolPanelDeck_Base::NotifyAccessibleEvent; + + protected: + virtual ~AccessibleToolPanelDeck(); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + // VCLXAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& i_rVclWindowEvent ); + virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& i_rStateSet ); + + private: + ::boost::scoped_ptr< AccessibleToolPanelDeck_Impl > m_pImpl; + }; + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... + +#endif // ACC_ACCESSIBLETOOLPANELDECK_HXX diff --git a/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBar.hxx b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBar.hxx new file mode 100644 index 000000000000..cc2d39c5acbf --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBar.hxx @@ -0,0 +1,92 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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 ACC_ACCESSIBLETOOLPANELTABBAR_HXX +#define ACC_ACCESSIBLETOOLPANELTABBAR_HXX + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include <cppuhelper/implbase1.hxx> +#include <toolkit/awt/vclxaccessiblecomponent.hxx> + +#include <boost/scoped_ptr.hpp> + +namespace svt +{ + class IToolPanelDeck; + class PanelTabBar; +} + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + //================================================================================================================== + //= AccessibleToolPanelTabBar + //================================================================================================================== + class AccessibleToolPanelTabBar_Impl; + typedef VCLXAccessibleComponent AccessibleToolPanelTabBar_Base; + class AccessibleToolPanelTabBar : public AccessibleToolPanelTabBar_Base + { + public: + AccessibleToolPanelTabBar( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar + ); + + using AccessibleToolPanelTabBar_Base::NotifyAccessibleEvent; + + protected: + virtual ~AccessibleToolPanelTabBar(); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + // VCLXAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& i_rVclWindowEvent ); + virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& i_rStateSet ); + + private: + ::boost::scoped_ptr< AccessibleToolPanelTabBar_Impl > m_pImpl; + }; + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... + +#endif // ACC_ACCESSIBLETOOLPANELTABBAR_HXX diff --git a/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx new file mode 100644 index 000000000000..80b2ccaaf104 --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx @@ -0,0 +1,107 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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 ACC_ACCESSIBLETOOLPANELDECKTABBARITEM_HXX +#define ACC_ACCESSIBLETOOLPANELDECKTABBARITEM_HXX + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include <comphelper/accessiblecomponenthelper.hxx> +#include <cppuhelper/implbase1.hxx> + +#include <boost/scoped_ptr.hpp> + +namespace svt +{ + class IToolPanelDeck; + class PanelTabBar; +} + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + //================================================================================================================== + //= AccessibleToolPanelDeckTabBarItem + //================================================================================================================== + class AccessibleToolPanelDeckTabBarItem_Impl; + typedef ::comphelper::OAccessibleExtendedComponentHelper AccessibleToolPanelDeckTabBarItem_Base; + class AccessibleToolPanelDeckTabBarItem : public AccessibleToolPanelDeckTabBarItem_Base + { + public: + AccessibleToolPanelDeckTabBarItem( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar, + const size_t i_nItemPos + ); + + using AccessibleToolPanelDeckTabBarItem_Base::NotifyAccessibleEvent; + using AccessibleToolPanelDeckTabBarItem_Base::lateInit; + + protected: + virtual ~AccessibleToolPanelDeckTabBarItem(); + + public: + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus( ) 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); + + // XAccessibleExtendedComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); + + protected: + // OCommonAccessibleComponent + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + protected: + ::boost::scoped_ptr< AccessibleToolPanelDeckTabBarItem_Impl > m_pImpl; + }; + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... + +#endif // ACC_ACCESSIBLETOOLPANELDECKTABBARITEM_HXX diff --git a/accessibility/inc/accessibility/helper/accessiblestrings.hrc b/accessibility/inc/accessibility/helper/accessiblestrings.hrc index 859da828beb1..1f936e678b98 100644 --- a/accessibility/inc/accessibility/helper/accessiblestrings.hrc +++ b/accessibility/inc/accessibility/helper/accessiblestrings.hrc @@ -45,7 +45,8 @@ #define RID_STR_ACC_ACTION_DECBLOCK ( RID_TK_ACC_START + 6 ) -#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 1000 ) +#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 100 ) +#define RID_STR_ACC_DESC_PANELDECL_TABBAR ( RID_TK_ACC_START + 101 ) // ----------------------------------------------------------------------------- diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx index 168938d50a6c..7283cec6a95c 100644 --- a/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx +++ b/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx @@ -57,6 +57,7 @@ private: void UpdateAllItems_Impl(); void UpdateItemName_Impl( sal_Int32 _nPos ); void UpdateItemEnabled_Impl( sal_Int32 _nPos ); + void UpdateCustomPopupItemp_Impl( Window* pWindow, bool bOpen ); void HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent, bool _bShow ); void ReleaseSubToolBox( ToolBox* _pSubToolBox ); diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index e8111657d7d0..f0aa406b62bf 100644..100755 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -33,7 +33,6 @@ #include <svtools/accessibletable.hxx> #include <comphelper/types.hxx> #include <toolkit/helper/vclunohelper.hxx> -//#include "svtools/table/tablecontrol.hxx" // ============================================================================ @@ -61,21 +60,19 @@ public: /** The data table child. */ Reference< ::com::sun::star::accessibility::XAccessible > m_xTable; - AccessibleGridControlTable* m_pTable; + AccessibleGridControlTable* m_pTable; /** The header bar for rows. */ Reference< ::com::sun::star::accessibility::XAccessible > m_xRowHeaderBar; - AccessibleGridControlHeader* m_pRowHeaderBar; + AccessibleGridControlHeader* m_pRowHeaderBar; /** The header bar for columns (first row of the table). */ Reference< ::com::sun::star::accessibility::XAccessible > m_xColumnHeaderBar; - AccessibleGridControlHeader* m_pColumnHeaderBar; + AccessibleGridControlHeader* m_pColumnHeaderBar; }; -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControl ) AccessibleGridControl::AccessibleGridControl( @@ -83,7 +80,6 @@ AccessibleGridControl::AccessibleGridControl( IAccessibleTable& _rTable ) : AccessibleGridControlBase( _rxParent, _rTable, TCTYPE_GRIDCONTROL ) { -// DBG_CTOR( AccessibleTableControl, NULL ); m_pImpl.reset( new AccessibleGridControl_Impl() ); m_pImpl->m_aCreator = _rxCreator; } @@ -91,7 +87,6 @@ AccessibleGridControl::AccessibleGridControl( // ----------------------------------------------------------------------------- AccessibleGridControl::~AccessibleGridControl() { - DBG_DTOR( AccessibleGridControl, NULL ); } // ----------------------------------------------------------------------------- @@ -99,7 +94,7 @@ void SAL_CALL AccessibleGridControl::disposing() { ::osl::MutexGuard aGuard( getOslMutex() ); - m_pImpl->m_pTable = NULL; + m_pImpl->m_pTable = NULL; m_pImpl->m_pColumnHeaderBar = NULL; m_pImpl->m_pRowHeaderBar = NULL; m_pImpl->m_aCreator = Reference< XAccessible >(); @@ -143,7 +138,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) { if(nChildIndex == 0 && m_aTable.HasColHeader()) { - if(!m_pImpl->m_xColumnHeaderBar.is()){ + 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; } @@ -151,7 +147,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) } else if(m_aTable.HasRowHeader() && (nChildIndex == 1 || nChildIndex == 0)) { - if(!m_pImpl->m_xRowHeaderBar.is()){ + 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; } @@ -164,7 +161,6 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) xChild = m_pImpl->m_xTable; } } - return xChild; } // ----------------------------------------------------------------------------- @@ -200,11 +196,11 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint ) { Reference< XAccessible > xCurrChild( implGetFixedChild( nIndex ) ); Reference< XAccessibleComponent > - xCurrChildComp( xCurrChild, uno::UNO_QUERY ); + xCurrChildComp( xCurrChild, uno::UNO_QUERY ); if( xCurrChildComp.is() && - VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) ) - xChild = xCurrChild; + VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) ) + xChild = xCurrChild; } } return xChild; @@ -217,7 +213,7 @@ void SAL_CALL AccessibleGridControl::grabFocus() TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - m_aTable.GrabFocus(); + m_aTable.GrabFocus(); } // ----------------------------------------------------------------------------- @@ -260,7 +256,6 @@ Reference< XAccessible > AccessibleGridControl::implGetTable() { m_pImpl->m_pTable = createAccessibleTable(); m_pImpl->m_xTable = m_pImpl->m_pTable; - } return m_pImpl->m_xTable; } @@ -302,7 +297,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex ) Reference< XAccessible > xRet; switch( nChildIndex ) { - case TCINDEX_COLUMNHEADERBAR: + case TCINDEX_COLUMNHEADERBAR: xRet = implGetHeaderBar( TCTYPE_COLUMNHEADERBAR ); break; case TCINDEX_ROWHEADERBAR: @@ -318,7 +313,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex ) 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?" ); + DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" ); return new AccessibleGridControlTable( xCreator, m_aTable, TCTYPE_TABLE ); } // ============================================================================ @@ -331,13 +326,11 @@ AccessibleGridControlAccess::AccessibleGridControlAccess( const Reference< XAcce ,m_rTable( _rTable ) ,m_pContext( NULL ) { - DBG_CTOR( AccessibleGridControlAccess, NULL ); } // ----------------------------------------------------------------------------- AccessibleGridControlAccess::~AccessibleGridControlAccess() { - DBG_DTOR( AccessibleGridControlAccess, NULL ); } // ----------------------------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index 12d4a7d141a4..ea81bd350426 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -57,8 +57,6 @@ namespace accessibility { using namespace com::sun::star::accessibility::AccessibleStateType; // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlBase ) AccessibleGridControlBase::AccessibleGridControlBase( @@ -73,13 +71,10 @@ AccessibleGridControlBase::AccessibleGridControlBase( 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 @@ -122,20 +117,19 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getAccessibleIndexInParent() xParentContext( m_xParent->getAccessibleContext() ); if( xParentContext.is() ) { - Reference< uno::XInterface > xChild; + 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; - } + xChild = xChild.query( xParentContext->getAccessibleChild( nChild ) ); + if ( xMeMyselfAndI.get() == xChild.get() ) + { + nRet = nChild; + break; } } + } } return nRet; } @@ -160,9 +154,9 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleGridControlBase::getAccessibleRelationSet() throw ( uno::RuntimeException ) { - ensureIsAlive(); - // GridControl does not have relations. - return new utl::AccessibleRelationSetHelper; + ensureIsAlive(); + // GridControl does not have relations. + return new utl::AccessibleRelationSetHelper; } Reference< XAccessibleStateSet > SAL_CALL @@ -185,7 +179,7 @@ lang::Locale SAL_CALL AccessibleGridControlBase::getLocale() Reference< XAccessibleContext > xParentContext( m_xParent->getAccessibleContext() ); if( xParentContext.is() ) - return xParentContext->getLocale(); + return xParentContext->getLocale(); } throw IllegalAccessibleComponentStateException(); } @@ -268,19 +262,18 @@ void SAL_CALL AccessibleGridControlBase::removeEventListener( { if( _rxListener.is() && getClientId( ) ) { - ::osl::MutexGuard aGuard( getOslMutex() ); + ::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 ); - } + 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 ); + } } } @@ -310,7 +303,6 @@ sal_Bool SAL_CALL AccessibleGridControlBase::supportsService( for( ; ( pString != pArrEnd ) && ( rServiceName != *pString ); ++pString ) ; - return pString != pArrEnd; } @@ -351,7 +343,6 @@ sal_Bool AccessibleGridControlBase::implIsShowing() } else pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); - return pStateSetHelper; } @@ -382,7 +373,7 @@ Rectangle AccessibleGridControlBase::getBoundingBox() } return aRect; } -// + Rectangle AccessibleGridControlBase::getBoundingBoxOnScreen() throw ( lang::DisposedException ) { @@ -436,22 +427,22 @@ sal_Int16 SAL_CALL AccessibleGridControlBase::getAccessibleRole() 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; + 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; } @@ -480,17 +471,16 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getForeground( ) throw (::com::su { if ( pInst->IsControlForeground() ) nColor = pInst->GetControlForeground().GetColor(); + else + { + Font aFont; + if ( pInst->IsControlFont() ) + aFont = pInst->GetControlFont(); else - { - Font aFont; - if ( pInst->IsControlFont() ) - aFont = pInst->GetControlFont(); - else - aFont = pInst->GetFont(); - nColor = aFont.GetColor().GetColor(); - } + aFont = pInst->GetFont(); + nColor = aFont.GetColor().GetColor(); + } } - return nColor; } // ----------------------------------------------------------------------------- @@ -505,20 +495,18 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getBackground( ) throw (::com::su { if ( pInst->IsControlBackground() ) nColor = pInst->GetControlBackground().GetColor(); - else + else nColor = pInst->GetBackground().GetColor().GetColor(); } - return nColor; } //// ============================================================================ GridControlAccessibleElement::GridControlAccessibleElement( const Reference< XAccessible >& rxParent, - IAccessibleTable& rTable, - AccessibleTableControlObjType eObjType ) + IAccessibleTable& rTable, + AccessibleTableControlObjType eObjType ) :AccessibleGridControlBase( rxParent, rTable, eObjType ) { -// DBG_CTOR( GridControlAccessibleElement, NULL ); } // XInterface ----------------------------------------------------------------- @@ -537,7 +525,6 @@ Reference< XAccessibleContext > SAL_CALL GridControlAccessibleElement::getAccess // ---------------------------------------------------------------------------- GridControlAccessibleElement::~GridControlAccessibleElement( ) { -// DBG_DTOR( GridControlAccessibleElement, NULL ); } // ============================================================================ diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index c7622c18981e..1870eebc8e3e 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -56,8 +56,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlHeader ) AccessibleGridControlHeader::AccessibleGridControlHeader( @@ -66,15 +64,12 @@ AccessibleGridControlHeader::AccessibleGridControlHeader( ::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 --------------------------------------------------------- @@ -83,11 +78,11 @@ Reference< XAccessible > SAL_CALL AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; + TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); if (nChildIndex<0 || nChildIndex>=getAccessibleChildCount()) - throw IndexOutOfBoundsException(); + throw IndexOutOfBoundsException(); ensureIsAlive(); Reference< XAccessible > xChild; if(m_eObjType == svt::table::TCTYPE_COLUMNHEADERBAR) @@ -106,11 +101,11 @@ AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex ) 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; + ensureIsAlive(); + if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader()) + return 1; + else + return 0; } // XAccessibleComponent ------------------------------------------------------- @@ -126,8 +121,8 @@ AccessibleGridControlHeader::getAccessibleAtPoint( const awt::Point& rPoint ) 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 ) ); + m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) : + m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ); return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >(); } @@ -181,35 +176,24 @@ Reference< XAccessibleTable > SAL_CALL AccessibleGridControlHeader::getAccessibl ensureIsAlive(); return NULL; // no headers in headers } - +//not selectable 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 ); + Sequence< sal_Int32 > aSelSeq(0); return aSelSeq; } //columns aren't selectable Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleColumns() throw ( uno::RuntimeException ) { - return NULL; + Sequence< sal_Int32 > aSelSeq(0); + return aSelSeq; } -//To Do - not yet implemented -sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 nRow ) +//row headers not selectable +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 @@ -219,28 +203,19 @@ sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleColumnSelected( sal_I (void)nColumn; return sal_False; } - +//not implemented Reference< XAccessible > SAL_CALL AccessibleGridControlHeader::getAccessibleCellAt( - sal_Int32 nRow, sal_Int32 nColumn ) + 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 ) ); + return NULL; } -// TO DO - not implemented yet +// not selectable sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleSelected( - sal_Int32 nRow, sal_Int32 nColumn ) + 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 ); + return sal_False; } // XServiceInfo --------------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx index 485c57c40ae1..485c57c40ae1 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index efd78fc8634a..461e776f1392 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -51,8 +51,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlTable ) AccessibleGridControlTable::AccessibleGridControlTable( @@ -61,12 +59,10 @@ AccessibleGridControlTable::AccessibleGridControlTable( AccessibleTableControlObjType _eType) : AccessibleGridControlTableBase( rxParent, rTable, _eType ) { - DBG_CTOR( AccessibleGridControlTable, NULL ); } AccessibleGridControlTable::~AccessibleGridControlTable() { - DBG_DTOR( AccessibleGridControlTable, NULL ); } // XAccessibleContext --------------------------------------------------------- @@ -92,7 +88,6 @@ sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent() return 1; else return 2; - } // XAccessibleComponent ------------------------------------------------------- @@ -177,7 +172,6 @@ Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessible TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - Sequence< sal_Int32 > aSelSeq; implGetSelectedRows( aSelSeq ); return aSelSeq; @@ -187,38 +181,34 @@ Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessible 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; + Sequence< sal_Int32 > aSelSeq(0); + return aSelSeq; } -//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; + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidRow( nRow ); + sal_Bool bSelected = sal_False; + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + for(int i=0; i<selectedRows.getLength(); i++) + { + if(nRow == selectedRows[i]) + { + bSelected = sal_True; + continue; + } + } + return bSelected; } //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; } @@ -238,16 +228,14 @@ sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - /*TCSolarGuard aSolarGuard; + TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidAddress( nRow, nColumn ); - return implIsRowSelected( nRow ) || implIsColumnSelected( nColumn );*/ - (void) nRow; (void) nColumn; - return sal_False; + //selection of single cells not possible, so if row is selected, the cell will be selected too + return isAccessibleRowSelected(nRow); } -//To Do: not implemented yet void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { @@ -255,48 +243,51 @@ void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChil ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidIndex( nChildIndex ); - //if( isRowBar() ) - // implSelectRow( nChildIndex, sal_True ); - //else - // implSelectColumn( implToVCLColumnPos( nChildIndex ), sal_True ); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + sal_Int32 nRow = (nChildIndex / nColumns); + std::vector< sal_Int32 > selectedRows = m_aTable.GetSelectedRows(); + selectedRows.push_back(nRow); } -//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; + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidIndex( nChildIndex ); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + sal_Int32 nRow = (nChildIndex / nColumns); + return isAccessibleRowSelected(nRow); } -//To Do - not implemented yet void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); + for(unsigned int i=0;i<m_aTable.GetSelectedRows().size();i++) + m_aTable.RemoveSelectedRow((sal_Int32)i); } -//To Do - not implemented yet void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + for(int i=0;i<m_aTable.GetRowCount();i++) + selectedRows[i]=i; } -//To Do - not implemented yet sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - return 0; + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + return selectedRows.getLength()*nColumns; } -//To Do - not implemented yet Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) @@ -304,10 +295,12 @@ AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChild TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - (void)nSelectedChildIndex; - return NULL; + if(isAccessibleChildSelected(nSelectedChildIndex)) + return getAccessibleChild(nSelectedChildIndex); + else + return NULL; } -//To Do - not implemented yet +//not implemented yet, because only row selection possible void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) @@ -316,14 +309,6 @@ void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild( ::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 ----------------------------------------------------------------- @@ -364,14 +349,6 @@ Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen() return m_aTable.calcTableRect(); } // internal helper methods ---------------------------------------------------- -//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 ) diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index 8a7e3102bdf7..352e80e1a666 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -53,8 +53,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlTableBase ) AccessibleGridControlTableBase::AccessibleGridControlTableBase( @@ -63,12 +61,10 @@ AccessibleGridControlTableBase::AccessibleGridControlTableBase( AccessibleTableControlObjType eObjType ) : GridControlAccessibleElement( rxParent, rTable, eObjType ) { - DBG_CTOR( AccessibleGridControlTableBase, NULL ); } AccessibleGridControlTableBase::~AccessibleGridControlTableBase() { - DBG_DTOR( AccessibleGridControlTableBase, NULL ); } // XAccessibleContext --------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index f511eb43cbf8..43b9400e9050 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -65,7 +65,6 @@ namespace accessibility // ============================================================================= // = AccessibleGridControlCell // ============================================================================= - //DBG_NAME( svt_AccessibleGridControlCell ) // ----------------------------------------------------------------------------- AccessibleGridControlCell::AccessibleGridControlCell( const Reference< XAccessible >& _rxParent, IAccessibleTable& _rTable, @@ -74,7 +73,6 @@ namespace accessibility ,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; @@ -104,8 +102,7 @@ namespace accessibility ::rtl::OUString AccessibleGridControlTableCell::implGetText() { ensureIsAlive(); - //return mpTable->GetAccessibleCellText( getRowPos(), static_cast< USHORT >( getColumnPos() ) ); - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "test" )); + return m_aTable.GetAccessibleCellText( getRowPos(), getColumnPos() ); } ::com::sun::star::lang::Locale AccessibleGridControlTableCell::implGetLocale() @@ -166,10 +163,7 @@ namespace accessibility ::com::sun::star::awt::Rectangle aRect; if ( &m_aTable ) - { aRect = AWTRectangle( m_aTable.GetFieldCharacterBounds( getRowPos(), getColumnPos(), nIndex ) ); - } - return aRect; } @@ -363,12 +357,12 @@ namespace accessibility //!!! 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/AccessibleToolPanelDeck.cxx b/accessibility/source/extended/AccessibleToolPanelDeck.cxx new file mode 100755 index 000000000000..6976b221a8b5 --- /dev/null +++ b/accessibility/source/extended/AccessibleToolPanelDeck.cxx @@ -0,0 +1,412 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "precompiled_accessibility.hxx" + +#include "accessibility/extended/AccessibleToolPanelDeck.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +/** === end UNO includes === **/ + +#include <svtools/toolpanel/toolpaneldeck.hxx> +#include <toolkit/awt/vclxwindow.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <vcl/svapp.hxx> +#include <vos/mutex.hxx> +#include <unotools/accessiblestatesethelper.hxx> +#include <tools/diagnose_ex.h> + +#include <boost/noncopyable.hpp> +#include <vector> + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::accessibility::XAccessible; + using ::com::sun::star::accessibility::XAccessibleContext; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::lang::IndexOutOfBoundsException; + using ::com::sun::star::lang::Locale; + using ::com::sun::star::accessibility::XAccessibleRelationSet; + using ::com::sun::star::accessibility::XAccessibleStateSet; + using ::com::sun::star::accessibility::IllegalAccessibleComponentStateException; + using ::com::sun::star::awt::XFont; + /** === end UNO using === **/ + namespace AccessibleRole = ::com::sun::star::accessibility::AccessibleRole; + namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; + namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; + + typedef ::com::sun::star::awt::Rectangle UnoRectangle; + typedef ::com::sun::star::awt::Point UnoPoint; + + //================================================================================================================== + //= AccessibleToolPanelDeck_Impl - declaration + //================================================================================================================== + class AccessibleToolPanelDeck_Impl :public ::boost::noncopyable + ,public ::svt::IToolPanelDeckListener + { + public: + AccessibleToolPanelDeck_Impl( + AccessibleToolPanelDeck& i_rAntiImpl, + const Reference< XAccessible >& i_rAccessibleParent, + ::svt::ToolPanelDeck& i_rPanelDeck + ); + + void checkDisposed(); + bool isDisposed() const { return m_pPanelDeck == NULL; } + void dispose(); + + ~AccessibleToolPanelDeck_Impl(); + + Reference< XAccessible > getOwnAccessible() const; + Reference< XAccessible > getActivePanelAccessible(); + + protected: + // IToolPanelDeckListener + virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ); + virtual void PanelRemoved( const size_t i_nPosition ); + virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ); + virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ); + virtual void Dying(); + + public: + AccessibleToolPanelDeck& m_rAntiImpl; + Reference< XAccessible > m_xAccessibleParent; + ::svt::ToolPanelDeck* m_pPanelDeck; + + typedef ::std::vector< Reference< XAccessible > > AccessibleChildren; + Reference< XAccessible > m_xActivePanelAccessible; + }; + + //================================================================================================================== + //= MethodGuard + //================================================================================================================== + namespace + { + class MethodGuard + { + public: + MethodGuard( AccessibleToolPanelDeck_Impl& i_rImpl ) + :m_aGuard( Application::GetSolarMutex() ) + { + i_rImpl.checkDisposed(); + } + ~MethodGuard() + { + } + + void clear() + { + m_aGuard.clear(); + } + + private: + ::vos::OClearableGuard m_aGuard; + }; + } + + //================================================================================================================== + //= AccessibleToolPanelDeck_Impl - implementation + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeck_Impl::AccessibleToolPanelDeck_Impl( AccessibleToolPanelDeck& i_rAntiImpl, const Reference< XAccessible >& i_rAccessibleParent, + ::svt::ToolPanelDeck& i_rPanelDeck ) + :m_rAntiImpl( i_rAntiImpl ) + ,m_xAccessibleParent( i_rAccessibleParent ) + ,m_pPanelDeck( &i_rPanelDeck ) + ,m_xActivePanelAccessible() + { + m_pPanelDeck->AddListener( *this ); + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeck_Impl::~AccessibleToolPanelDeck_Impl() + { + if ( !isDisposed() ) + dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck_Impl::dispose() + { + ENSURE_OR_RETURN_VOID( !isDisposed(), "disposed twice" ); + m_pPanelDeck->RemoveListener( *this ); + m_pPanelDeck = NULL; + m_xAccessibleParent.clear(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck_Impl::checkDisposed() + { + if ( isDisposed() ) + throw DisposedException( ::rtl::OUString(), *&m_rAntiImpl ); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelDeck_Impl::getOwnAccessible() const + { + Reference< XAccessible > xOwnAccessible( static_cast< XAccessible* >( m_rAntiImpl.GetVCLXWindow() ) ); + OSL_ENSURE( xOwnAccessible->getAccessibleContext() == Reference< XAccessibleContext >( &m_rAntiImpl ), + "AccessibleToolPanelDeck_Impl::getOwnAccessible: could not retrieve proper XAccessible for /myself!" ); + return xOwnAccessible; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelDeck_Impl::getActivePanelAccessible() + { + ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelDeck_Impl::getActivePanelAccessible: already disposed!", NULL ); + + if ( !m_xActivePanelAccessible.is() ) + { + ::boost::optional< size_t > aActivePanel( m_pPanelDeck->GetActivePanel() ); + ENSURE_OR_RETURN( !!aActivePanel, "AccessibleToolPanelDeck_Impl::getActivePanelAccessible: this should not be called without an active panel!", NULL ); + ::svt::PToolPanel pActivePanel( m_pPanelDeck->GetPanel( *aActivePanel ) ); + ENSURE_OR_RETURN( pActivePanel.get() != NULL, "AccessibleToolPanelDeck_Impl::getActivePanelAccessible: no active panel!", NULL ); + m_xActivePanelAccessible = pActivePanel->CreatePanelAccessible( getOwnAccessible() ); + OSL_ENSURE( m_xActivePanelAccessible.is(), "AccessibleToolPanelDeck_Impl::getActivePanelAccessible: illegal accessible returned by the panel!" ); + } + + return m_xActivePanelAccessible; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ) + { + (void)i_pPanel; + (void)i_nPosition; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck_Impl::PanelRemoved( const size_t i_nPosition ) + { + (void)i_nPosition; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) + { + if ( !!i_rOldActive ) + { + if ( !m_xActivePanelAccessible.is() ) + { + // again, this might in theory happen if the XAccessible for the active panel has never before been requested. + // In this case, just say that all our children are invalid, so they all must be re-requested. + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any() ); + } + else + { + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, makeAny( m_xActivePanelAccessible ), Any() ); + } + } + + m_xActivePanelAccessible.clear(); + + if ( !!i_rNewActive ) + { + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, Any(), makeAny( getActivePanelAccessible() ) ); + } + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ) + { + MethodGuard aGuard( *this ); + + (void)i_rNewLayouter; + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any() ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck_Impl::Dying() + { + // the tool panel deck is dying, so dispose ourself + m_rAntiImpl.dispose(); + } + + //================================================================================================================== + //= AccessibleToolPanelDeck + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeck::AccessibleToolPanelDeck( const Reference< XAccessible >& i_rAccessibleParent, + ::svt::ToolPanelDeck& i_rPanelDeck ) + :AccessibleToolPanelDeck_Base( i_rPanelDeck.GetWindowPeer() ) + ,m_pImpl( new AccessibleToolPanelDeck_Impl( *this, i_rAccessibleParent, i_rPanelDeck ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeck::~AccessibleToolPanelDeck() + { + } + + //------------------------------------------------------------------------------------------------------------------ + sal_Int32 SAL_CALL AccessibleToolPanelDeck::getAccessibleChildCount( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + + sal_Int32 nChildCount( m_pImpl->m_pPanelDeck->GetLayouter()->GetAccessibleChildCount() ); + + ::boost::optional< size_t > aActivePanel( m_pImpl->m_pPanelDeck->GetActivePanel() ); + if ( !!aActivePanel ) + return ++nChildCount; + + return nChildCount; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelDeck::getAccessibleChild( sal_Int32 i_nIndex ) throw (IndexOutOfBoundsException, RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + + const sal_Int32 nChildCount( getAccessibleChildCount() ); + if ( ( i_nIndex < 0 ) || ( i_nIndex >= nChildCount ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + + // first "n" children are provided by the layouter + const size_t nLayouterCount( m_pImpl->m_pPanelDeck->GetLayouter()->GetAccessibleChildCount() ); + if ( size_t( i_nIndex ) < nLayouterCount ) + return m_pImpl->m_pPanelDeck->GetLayouter()->GetAccessibleChild( + size_t( i_nIndex ), + m_pImpl->getOwnAccessible() + ); + + // the last child is the XAccessible of the active panel + return m_pImpl->getActivePanelAccessible(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelDeck::getAccessibleParent( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + const Reference< XAccessible > xParent = implGetForeignControlledParent(); + if ( xParent.is() ) + return xParent; + return m_pImpl->m_xAccessibleParent; + } + + //------------------------------------------------------------------------------------------------------------------ + sal_Int16 SAL_CALL AccessibleToolPanelDeck::getAccessibleRole( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + return AccessibleRole::PANEL; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelDeck::getAccessibleAtPoint( const UnoPoint& i_rPoint ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + + const ::Point aRequestedPoint( VCLUnoHelper::ConvertToVCLPoint( i_rPoint ) ); + // check the panel window itself + const ::Window& rActivePanelAnchor( m_pImpl->m_pPanelDeck->GetPanelWindowAnchor() ); + const Rectangle aPanelAnchorArea( rActivePanelAnchor.GetPosPixel(), rActivePanelAnchor.GetOutputSizePixel() ); + if ( aPanelAnchorArea.IsInside( aRequestedPoint ) ) + // note that this assumes that the Window which actually implements the concrete panel covers + // the complete area of its "anchor" Window. But this is ensured by the ToolPanelDeck implementation. + return m_pImpl->getActivePanelAccessible(); + + // check the XAccessible instances provided by the layouter + try + { + const ::svt::PDeckLayouter pLayouter( m_pImpl->m_pPanelDeck->GetLayouter() ); + ENSURE_OR_THROW( pLayouter.get() != NULL, "invalid layouter" ); + + const size_t nLayouterChildren = pLayouter->GetAccessibleChildCount(); + for ( size_t i=0; i<nLayouterChildren; ++i ) + { + const Reference< XAccessible > xLayoutItemAccessible( pLayouter->GetAccessibleChild( i, m_pImpl->getOwnAccessible() ), UNO_SET_THROW ); + const Reference< XAccessibleComponent > xLayoutItemComponent( xLayoutItemAccessible->getAccessibleContext(), UNO_QUERY_THROW ); + const ::Rectangle aLayoutItemBounds( VCLUnoHelper::ConvertToVCLRect( xLayoutItemComponent->getBounds() ) ); + if ( aLayoutItemBounds.IsInside( aRequestedPoint ) ) + return xLayoutItemAccessible; + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + return NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL AccessibleToolPanelDeck::grabFocus( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + m_pImpl->m_pPanelDeck->GrabFocus(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL AccessibleToolPanelDeck::disposing() + { + AccessibleToolPanelDeck_Base::disposing(); + m_pImpl->dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelDeck::GetChildAccessible( const VclWindowEvent& i_rVclWindowEvent ) + { + // don't let the base class generate any A11Y events from VclWindowEvent, we completely manage those + // A11Y events ourself + (void)i_rVclWindowEvent; + return NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeck::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& i_rStateSet ) + { + AccessibleToolPanelDeck_Base::FillAccessibleStateSet( i_rStateSet ); + if ( m_pImpl->isDisposed() ) + { + i_rStateSet.AddState( AccessibleStateType::DEFUNC ); + } + else + { + i_rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + } + } + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx new file mode 100644 index 000000000000..7e97e3714172 --- /dev/null +++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx @@ -0,0 +1,459 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "precompiled_accessibility.hxx" + +#include "accessibility/extended/AccessibleToolPanelDeckTabBar.hxx" +#include "accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx" +#include "accessibility/helper/accresmgr.hxx" +#include "accessibility/helper/accessiblestrings.hrc" + +/** === begin UNO includes === **/ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +/** === end UNO includes === **/ + +#include <svtools/toolpanel/toolpaneldeck.hxx> +#include <svtools/toolpanel/paneltabbar.hxx> +#include <unotools/accessiblestatesethelper.hxx> +#include <toolkit/awt/vclxwindow.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <vcl/svapp.hxx> +#include <vcl/button.hxx> +#include <vos/mutex.hxx> +#include <tools/diagnose_ex.h> + +#include <vector> + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::accessibility::XAccessible; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::lang::IndexOutOfBoundsException; + using ::com::sun::star::accessibility::XAccessibleContext; + /** === end UNO using === **/ + + namespace AccessibleRole = ::com::sun::star::accessibility::AccessibleRole; + namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; + namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; + + typedef ::com::sun::star::awt::Point UnoPoint; + typedef ::com::sun::star::awt::Size UnoSize; + typedef ::com::sun::star::awt::Rectangle UnoRectangle; + + //================================================================================================================== + //= AccessibleWrapper + //================================================================================================================== + typedef ::cppu::WeakImplHelper1< XAccessible > AccessibleWrapper_Base; + class AccessibleWrapper : public AccessibleWrapper_Base + { + public: + AccessibleWrapper( const Reference< XAccessibleContext >& i_rContext ) + :m_xContext( i_rContext ) + { + } + + // XAccessible + virtual Reference< XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (RuntimeException) + { + return m_xContext; + } + + private: + const Reference< XAccessibleContext > m_xContext; + }; + + //================================================================================================================== + //= AccessibleToolPanelTabBar_Impl + //================================================================================================================== + class AccessibleToolPanelTabBar_Impl :public ::boost::noncopyable + ,public ::svt::IToolPanelDeckListener + { + public: + AccessibleToolPanelTabBar_Impl( + AccessibleToolPanelTabBar& i_rAntiImpl, + const Reference< XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar + ); + ~AccessibleToolPanelTabBar_Impl(); + + void checkDisposed(); + bool isDisposed() const { return m_pPanelDeck == NULL; } + void dispose(); + + ::svt::IToolPanelDeck* getPanelDeck() const { return m_pPanelDeck; } + ::svt::PanelTabBar* getTabBar() const { return m_pTabBar; } + const Reference< XAccessible >& getAccessibleParent() const { return m_xAccessibleParent; } + Reference< XAccessible > getAccessiblePanelItem( size_t i_nPosition ); + Reference< XAccessible > getOwnAccessible() const; + + protected: + // IToolPanelDeckListener + virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ); + virtual void PanelRemoved( const size_t i_nPosition ); + virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ); + virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ); + virtual void Dying(); + + DECL_LINK( OnWindowEvent, const VclSimpleEvent* ); + + private: + AccessibleToolPanelTabBar& m_rAntiImpl; + Reference< XAccessible > m_xAccessibleParent; + ::svt::IToolPanelDeck* m_pPanelDeck; + ::svt::PanelTabBar* m_pTabBar; + ::std::vector< Reference< XAccessible > > m_aChildren; + }; + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar_Impl::AccessibleToolPanelTabBar_Impl( AccessibleToolPanelTabBar& i_rAntiImpl, + const Reference< XAccessible >& i_rAccessibleParent, ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) + :m_rAntiImpl( i_rAntiImpl ) + ,m_xAccessibleParent( i_rAccessibleParent ) + ,m_pPanelDeck( &i_rPanelDeck ) + ,m_pTabBar( &i_rTabBar ) + ,m_aChildren() + { + m_pPanelDeck->AddListener( *this ); + m_aChildren.resize( m_pPanelDeck->GetPanelCount() ); + + const String sAccessibleDescription( TK_RES_STRING( RID_STR_ACC_DESC_PANELDECL_TABBAR ) ); + i_rTabBar.SetAccessibleName( sAccessibleDescription ); + i_rTabBar.SetAccessibleDescription( sAccessibleDescription ); + + i_rTabBar.GetScrollButton( true ).AddEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); + i_rTabBar.GetScrollButton( false ).AddEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::checkDisposed() + { + if ( isDisposed() ) + throw DisposedException( ::rtl::OUString(), *&m_rAntiImpl ); + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar_Impl::~AccessibleToolPanelTabBar_Impl() + { + if ( !isDisposed() ) + dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::dispose() + { + ENSURE_OR_RETURN_VOID( !isDisposed(), "disposed twice" ); + m_pPanelDeck->RemoveListener( *this ); + m_pPanelDeck = NULL; + + m_pTabBar->GetScrollButton( true ).RemoveEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); + m_pTabBar->GetScrollButton( false ).RemoveEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); + m_pTabBar = NULL; + + m_xAccessibleParent.clear(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelTabBar_Impl::getAccessiblePanelItem( size_t i_nPosition ) + { + ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelTabBar_Impl::getAccessiblePanelItem: already disposed!", NULL ); + ENSURE_OR_RETURN( i_nPosition < m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::getAccessiblePanelItem: invalid index!", NULL ); + + Reference< XAccessible >& rAccessibleChild( m_aChildren[ i_nPosition ] ); + if ( !rAccessibleChild.is() ) + { + ::rtl::Reference< AccessibleToolPanelDeckTabBarItem > pAccesibleItemContext( new AccessibleToolPanelDeckTabBarItem( + getOwnAccessible(), *m_pPanelDeck, *m_pTabBar, i_nPosition ) ); + rAccessibleChild.set( new AccessibleWrapper( pAccesibleItemContext.get() ) ); + pAccesibleItemContext->lateInit( rAccessibleChild ); + } + return rAccessibleChild; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelTabBar_Impl::getOwnAccessible() const + { + Reference< XAccessible > xOwnAccessible( static_cast< XAccessible* >( m_rAntiImpl.GetVCLXWindow() ) ); + OSL_ENSURE( xOwnAccessible->getAccessibleContext() == Reference< XAccessibleContext >( &m_rAntiImpl ), + "AccessibleToolPanelTabBar_Impl::getOwnAccessible: could not retrieve proper XAccessible for /myself!" ); + return xOwnAccessible; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ) + { + ENSURE_OR_RETURN_VOID( i_nPosition <= m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::PanelInserted: illegal position (or invalid cache!)" ); + (void)i_pPanel; + m_aChildren.insert( m_aChildren.begin() + i_nPosition, NULL ); + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, Any(), makeAny( getAccessiblePanelItem( i_nPosition ) ) ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::PanelRemoved( const size_t i_nPosition ) + { + ENSURE_OR_RETURN_VOID( i_nPosition < m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::PanelInserted: illegal position (or invalid cache!)" ); + + const Reference< XAccessible > xOldChild( getAccessiblePanelItem( i_nPosition ) ); + m_aChildren.erase( m_aChildren.begin() + i_nPosition ); + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, makeAny( xOldChild ), Any() ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) + { + (void)i_rOldActive; + (void)i_rNewActive; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ) + { + (void)i_rNewLayouter; + m_rAntiImpl.dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::Dying() + { + m_rAntiImpl.dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + IMPL_LINK( AccessibleToolPanelTabBar_Impl, OnWindowEvent, const VclSimpleEvent*, i_pEvent ) + { + ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelTabBar_Impl::OnWindowEvent: already disposed!", 0L ); + + const VclWindowEvent* pWindowEvent( dynamic_cast< const VclWindowEvent* >( i_pEvent ) ); + if ( !pWindowEvent ) + return 0L; + + const bool bForwardButton = ( pWindowEvent->GetWindow() == &m_pTabBar->GetScrollButton( true ) ); + const bool bBackwardButton = ( pWindowEvent->GetWindow() == &m_pTabBar->GetScrollButton( false ) ); + ENSURE_OR_RETURN( bForwardButton || bBackwardButton, "AccessibleToolPanelTabBar_Impl::OnWindowEvent: where does this come from?", 0L ); + + const bool bShow = ( i_pEvent->GetId() == VCLEVENT_WINDOW_SHOW ); + const bool bHide = ( i_pEvent->GetId() == VCLEVENT_WINDOW_HIDE ); + if ( !bShow && !bHide ) + // not interested in events other than visibility changes + return 0L; + + const Reference< XAccessible > xButtonAccessible( m_pTabBar->GetScrollButton( bForwardButton ).GetAccessible() ); + const Any aOldChild( bHide ? xButtonAccessible : Reference< XAccessible >() ); + const Any aNewChild( bShow ? xButtonAccessible : Reference< XAccessible >() ); + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldChild, aNewChild ); + + return 1L; + } + + //================================================================================================================== + //= MethodGuard + //================================================================================================================== + namespace + { + class MethodGuard + { + public: + MethodGuard( AccessibleToolPanelTabBar_Impl& i_rImpl ) + :m_aGuard( Application::GetSolarMutex() ) + { + i_rImpl.checkDisposed(); + } + ~MethodGuard() + { + } + + void clear() + { + m_aGuard.clear(); + } + + private: + ::vos::OClearableGuard m_aGuard; + }; + } + + //================================================================================================================== + //= AccessibleToolPanelTabBar + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar::AccessibleToolPanelTabBar( const Reference< XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) + :AccessibleToolPanelTabBar_Base( i_rTabBar.GetWindowPeer() ) + ,m_pImpl( new AccessibleToolPanelTabBar_Impl( *this, i_rAccessibleParent, i_rPanelDeck, i_rTabBar ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar::~AccessibleToolPanelTabBar() + { + } + + //------------------------------------------------------------------------------------------------------------------ + sal_Int32 SAL_CALL AccessibleToolPanelTabBar::getAccessibleChildCount( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + + const bool bHasScrollBack = m_pImpl->getTabBar()->GetScrollButton( false ).IsVisible(); + const bool bHasScrollForward = m_pImpl->getTabBar()->GetScrollButton( true ).IsVisible(); + + return m_pImpl->getPanelDeck()->GetPanelCount() + + ( bHasScrollBack ? 1 : 0 ) + + ( bHasScrollForward ? 1 : 0 ); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleChild( sal_Int32 i_nIndex ) throw (IndexOutOfBoundsException, RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + + const bool bHasScrollBack = m_pImpl->getTabBar()->GetScrollButton( false ).IsVisible(); + const bool bHasScrollForward = m_pImpl->getTabBar()->GetScrollButton( true ).IsVisible(); + + const bool bScrollBackRequested = ( bHasScrollBack && ( i_nIndex == 0 ) ); + const bool bScrollForwardRequested = ( bHasScrollForward && ( i_nIndex == getAccessibleChildCount() - 1 ) ); + OSL_ENSURE( !( bScrollBackRequested && bScrollForwardRequested ), "AccessibleToolPanelTabBar::getAccessibleChild: ouch!" ); + + if ( bScrollBackRequested || bScrollForwardRequested ) + { + Reference< XAccessible > xScrollButtonAccessible( m_pImpl->getTabBar()->GetScrollButton( bScrollForwardRequested ).GetAccessible() ); + ENSURE_OR_RETURN( xScrollButtonAccessible.is(), "AccessibleToolPanelTabBar::getAccessibleChild: invalid button accessible!", NULL ); + #if OSL_DEBUG_LEVEL > 0 + Reference< XAccessibleContext > xScrollButtonContext( xScrollButtonAccessible->getAccessibleContext() ); + ENSURE_OR_RETURN( xScrollButtonContext.is(), "AccessibleToolPanelTabBar::getAccessibleChild: invalid button accessible context!", xScrollButtonAccessible ); + OSL_ENSURE( xScrollButtonContext->getAccessibleParent() == m_pImpl->getOwnAccessible(), + "AccessibleToolPanelTabBar::getAccessibleChild: wrong parent at the button's accesible!" ); + #endif + return xScrollButtonAccessible; + } + + return m_pImpl->getAccessiblePanelItem( i_nIndex - ( bHasScrollBack ? 1 : 0 ) ); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleParent( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + return m_pImpl->getAccessibleParent(); + } + + //------------------------------------------------------------------------------------------------------------------ + sal_Int16 SAL_CALL AccessibleToolPanelTabBar::getAccessibleRole( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + return AccessibleRole::PAGE_TAB_LIST; + } + + //------------------------------------------------------------------------------------------------------------------ + namespace + { + bool lcl_covers( const ::Window& i_rWindow, const ::Point& i_rPoint ) + { + const Rectangle aWindowBounds( i_rWindow.GetWindowExtentsRelative( i_rWindow.GetParent() ) ); + return aWindowBounds.IsInside( i_rPoint ); + } + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleAtPoint( const UnoPoint& i_rPoint ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + + // check the tab items + const UnoPoint aOwnScreenPos( getLocationOnScreen() ); + const ::Point aRequestedScreenPoint( i_rPoint.X + aOwnScreenPos.X, i_rPoint.Y + aOwnScreenPos.Y ); + + for ( size_t i=0; i<m_pImpl->getPanelDeck()->GetPanelCount(); ++i ) + { + const ::Rectangle aItemScreenRect( m_pImpl->getTabBar()->GetItemScreenRect(i) ); + if ( aItemScreenRect.IsInside( aRequestedScreenPoint ) ) + return m_pImpl->getAccessiblePanelItem(i); + } + + // check the scroll buttons + const ::Point aRequestedClientPoint( VCLUnoHelper::ConvertToVCLPoint( i_rPoint ) ); + + const bool bHasScrollBack = m_pImpl->getTabBar()->GetScrollButton( false ).IsVisible(); + if ( bHasScrollBack && lcl_covers( m_pImpl->getTabBar()->GetScrollButton( false ), aRequestedClientPoint ) ) + return m_pImpl->getTabBar()->GetScrollButton( false ).GetAccessible(); + + const bool bHasScrollForward = m_pImpl->getTabBar()->GetScrollButton( true ).IsVisible(); + if ( bHasScrollForward && lcl_covers( m_pImpl->getTabBar()->GetScrollButton( true ), aRequestedClientPoint ) ) + return m_pImpl->getTabBar()->GetScrollButton( true ).GetAccessible(); + + // no hit + return NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL AccessibleToolPanelTabBar::disposing() + { + AccessibleToolPanelTabBar_Base::disposing(); + m_pImpl->dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelTabBar::GetChildAccessible( const VclWindowEvent& i_rVclWindowEvent ) + { + // don't let the base class generate any A11Y events from VclWindowEvent, we completely manage those + // A11Y events ourself + (void)i_rVclWindowEvent; + return NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& i_rStateSet ) + { + AccessibleToolPanelTabBar_Base::FillAccessibleStateSet( i_rStateSet ); + i_rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + + ENSURE_OR_RETURN_VOID( !m_pImpl->isDisposed(), "AccessibleToolPanelTabBar::FillAccessibleStateSet: already disposed!" ); + if ( m_pImpl->getTabBar()->IsVertical() ) + i_rStateSet.AddState( AccessibleStateType::VERTICAL ); + else + i_rStateSet.AddState( AccessibleStateType::HORIZONTAL ); + } + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx new file mode 100644 index 000000000000..0cdfd8480457 --- /dev/null +++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx @@ -0,0 +1,455 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "precompiled_accessibility.hxx" + +#include "accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +/** === end UNO includes === **/ + +#include <svtools/toolpanel/toolpaneldeck.hxx> +#include <svtools/toolpanel/paneltabbar.hxx> +#include <unotools/accessiblestatesethelper.hxx> +#include <unotools/accessiblerelationsethelper.hxx> +#include <tools/diagnose_ex.h> +#include <vcl/svapp.hxx> +#include <vos/mutex.hxx> + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + typedef ::com::sun::star::awt::Rectangle UnoRectangle; + typedef ::com::sun::star::awt::Point UnoPoint; + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::accessibility::XAccessible; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::lang::IndexOutOfBoundsException; + using ::com::sun::star::accessibility::XAccessibleRelationSet; + using ::com::sun::star::accessibility::XAccessibleStateSet; + using ::com::sun::star::accessibility::XAccessibleComponent; + using ::com::sun::star::accessibility::XAccessibleExtendedComponent; + using ::com::sun::star::awt::XFont; + /** === end UNO using === **/ + + namespace AccessibleRole = ::com::sun::star::accessibility::AccessibleRole; + namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; + namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; + + //================================================================================================================== + //= AccessibleToolPanelDeckTabBarItem_Impl + //================================================================================================================== + class AccessibleToolPanelDeckTabBarItem_Impl : public ::svt::IToolPanelDeckListener + { + public: + AccessibleToolPanelDeckTabBarItem_Impl( + AccessibleToolPanelDeckTabBarItem& i_rAntiImpl, + const Reference< XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar, + const size_t i_nItemPos + ); + ~AccessibleToolPanelDeckTabBarItem_Impl(); + + ::svt::PanelTabBar* getTabBar() const { return m_pTabBar; } + + // IToolPanelDeckListener + virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ); + virtual void PanelRemoved( const size_t i_nPosition ); + virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ); + virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ); + virtual void Dying(); + + public: + bool isDisposed() const { return m_pPanelDeck == NULL; } + void checkDisposed() const; + void dispose(); + + const Reference< XAccessible >& + getAccessibleParent() const { return m_xAccessibleParent; } + size_t getItemPos() const { return m_nItemPos; } + + Reference< XAccessibleComponent > getParentAccessibleComponent() const; + ::svt::IToolPanelDeck* getPanelDeck() const { return m_pPanelDeck; } + ::rtl::OUString getPanelDisplayName(); + + private: + void impl_notifyBoundRectChanges(); + void impl_notifyStateChange( const sal_Int16 i_nLostState, const sal_Int16 i_nGainedState ); + + private: + AccessibleToolPanelDeckTabBarItem& m_rAntiImpl; + Reference< XAccessible > m_xAccessibleParent; + ::svt::IToolPanelDeck* m_pPanelDeck; + ::svt::PanelTabBar* m_pTabBar; + size_t m_nItemPos; + }; + + //================================================================================================================== + //= AccessibleToolPanelDeckTabBarItem_Impl + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeckTabBarItem_Impl::AccessibleToolPanelDeckTabBarItem_Impl( AccessibleToolPanelDeckTabBarItem& i_rAntiImpl, + const Reference< XAccessible >& i_rAccessibleParent, ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar, + const size_t i_nItemPos ) + :m_rAntiImpl( i_rAntiImpl ) + ,m_xAccessibleParent( i_rAccessibleParent ) + ,m_pPanelDeck( &i_rPanelDeck ) + ,m_pTabBar( &i_rTabBar ) + ,m_nItemPos( i_nItemPos ) + { + m_pPanelDeck->AddListener( *this ); + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeckTabBarItem_Impl::~AccessibleToolPanelDeckTabBarItem_Impl() + { + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::checkDisposed() const + { + if ( isDisposed() ) + throw DisposedException( ::rtl::OUString(), *&m_rAntiImpl ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::dispose() + { + ENSURE_OR_RETURN_VOID( !isDisposed(), "AccessibleToolPanelDeckTabBarItem_Impl::dispose: disposed twice!" ); + + m_xAccessibleParent.clear(); + m_pPanelDeck->RemoveListener( *this ); + m_pPanelDeck = NULL; + m_pTabBar = NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessibleComponent > AccessibleToolPanelDeckTabBarItem_Impl::getParentAccessibleComponent() const + { + Reference< XAccessible > xAccessibleParent( m_rAntiImpl.getAccessibleParent(), UNO_QUERY_THROW ); + return Reference< XAccessibleComponent >( xAccessibleParent->getAccessibleContext(), UNO_QUERY ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString AccessibleToolPanelDeckTabBarItem_Impl::getPanelDisplayName() + { + const ::svt::PToolPanel pPanel( m_pPanelDeck->GetPanel( getItemPos() ) ); + if ( pPanel.get() == NULL ) + throw DisposedException(); + return pPanel->GetDisplayName(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::impl_notifyBoundRectChanges() + { + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::BOUNDRECT_CHANGED, Any(), Any() ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::impl_notifyStateChange( const sal_Int16 i_nLostState, const sal_Int16 i_nGainedState ) + { + m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, + i_nLostState > -1 ? makeAny( i_nLostState ) : Any(), + i_nGainedState > -1 ? makeAny( i_nGainedState ) : Any() + ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ) + { + (void)i_pPanel; + if ( i_nPosition <= m_nItemPos ) + ++m_nItemPos; + impl_notifyBoundRectChanges(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::PanelRemoved( const size_t i_nPosition ) + { + if ( i_nPosition == m_nItemPos ) + { + m_rAntiImpl.dispose(); + } + else if ( i_nPosition < m_nItemPos ) + { + --m_nItemPos; + impl_notifyBoundRectChanges(); + } + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) + { + if ( m_nItemPos == i_rOldActive ) + { + impl_notifyStateChange( AccessibleStateType::ACTIVE, -1 ); + impl_notifyStateChange( AccessibleStateType::SELECTED, -1 ); + } + else if ( m_nItemPos == i_rNewActive ) + { + impl_notifyStateChange( -1, AccessibleStateType::ACTIVE ); + impl_notifyStateChange( -1, AccessibleStateType::SELECTED ); + } + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ) + { + (void)i_rNewLayouter; + // if the tool panel deck has a new layouter, then the old layouter, and thus all items it was + // responsible for, died. So do we. + dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelDeckTabBarItem_Impl::Dying() + { + // if the tool panel deck is dying, then its layouter dies, so should we. + dispose(); + } + + //================================================================================================================== + //= ItemMethodGuard + //================================================================================================================== + class ItemMethodGuard + { + public: + ItemMethodGuard( AccessibleToolPanelDeckTabBarItem_Impl& i_rImpl ) + :m_aGuard( Application::GetSolarMutex() ) + { + i_rImpl.checkDisposed(); + } + ~ItemMethodGuard() + { + } + + void clear() + { + m_aGuard.clear(); + } + + private: + ::vos::OClearableGuard m_aGuard; + }; + + //================================================================================================================== + //= AccessibleToolPanelDeckTabBarItem + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeckTabBarItem::AccessibleToolPanelDeckTabBarItem( const Reference< XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar, const size_t i_nItemPos ) + :m_pImpl( new AccessibleToolPanelDeckTabBarItem_Impl( *this, i_rAccessibleParent, i_rPanelDeck, i_rTabBar, i_nItemPos ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelDeckTabBarItem::~AccessibleToolPanelDeckTabBarItem() + { + } + + //-------------------------------------------------------------------- + sal_Int32 SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleChildCount( ) throw (RuntimeException) + { + return 0; + } + + //-------------------------------------------------------------------- + Reference< XAccessible > SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException) + { + (void)i; + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + } + + //-------------------------------------------------------------------- + Reference< XAccessible > SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleParent( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + return m_pImpl->getAccessibleParent(); + } + + //-------------------------------------------------------------------- + sal_Int16 SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleRole( ) throw (RuntimeException) + { + return AccessibleRole::PAGE_TAB; + } + + //-------------------------------------------------------------------- + ::rtl::OUString SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleDescription( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + return m_pImpl->getPanelDisplayName(); + } + + //-------------------------------------------------------------------- + ::rtl::OUString SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleName( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + return m_pImpl->getPanelDisplayName(); + } + + //-------------------------------------------------------------------- + Reference< XAccessibleRelationSet > SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleRelationSet( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + ::utl::AccessibleRelationSetHelper* pRelationSet = new utl::AccessibleRelationSetHelper; + return pRelationSet; + } + + //-------------------------------------------------------------------- + Reference< XAccessibleStateSet > SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleStateSet( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + + ::utl::AccessibleStateSetHelper* pStateSet( new ::utl::AccessibleStateSetHelper ); + pStateSet->AddState( AccessibleStateType::FOCUSABLE ); + pStateSet->AddState( AccessibleStateType::SELECTABLE ); + pStateSet->AddState( AccessibleStateType::ICONIFIED ); + + if ( m_pImpl->getItemPos() == m_pImpl->getPanelDeck()->GetActivePanel() ) + { + pStateSet->AddState( AccessibleStateType::ACTIVE ); + pStateSet->AddState( AccessibleStateType::SELECTED ); + } + + if ( m_pImpl->getItemPos() == m_pImpl->getTabBar()->GetFocusedPanelItem() ) + pStateSet->AddState( AccessibleStateType::FOCUSED ); + + if ( m_pImpl->getTabBar()->IsEnabled() ) + pStateSet->AddState( AccessibleStateType::ENABLED ); + + if ( m_pImpl->getTabBar()->IsVisible() ) + { + pStateSet->AddState( AccessibleStateType::SHOWING ); + pStateSet->AddState( AccessibleStateType::VISIBLE ); + } + + return pStateSet; + } + + + //-------------------------------------------------------------------- + Reference< XAccessible > SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleAtPoint( const UnoPoint& i_rLocation ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + // we do not have children ... + (void)i_rLocation; + return NULL; + } + + //-------------------------------------------------------------------- + void SAL_CALL AccessibleToolPanelDeckTabBarItem::grabFocus( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + m_pImpl->getTabBar()->FocusPanelItem( m_pImpl->getItemPos() ); + } + + //-------------------------------------------------------------------- + ::sal_Int32 SAL_CALL AccessibleToolPanelDeckTabBarItem::getForeground( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + Reference< XAccessibleComponent > xParentComponent( m_pImpl->getParentAccessibleComponent(), UNO_SET_THROW ); + return xParentComponent->getForeground(); + } + + //-------------------------------------------------------------------- + ::sal_Int32 SAL_CALL AccessibleToolPanelDeckTabBarItem::getBackground( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + Reference< XAccessibleComponent > xParentComponent( m_pImpl->getParentAccessibleComponent(), UNO_SET_THROW ); + return xParentComponent->getBackground(); + } + + //-------------------------------------------------------------------- + Reference< XFont > SAL_CALL AccessibleToolPanelDeckTabBarItem::getFont( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + Reference< XAccessibleExtendedComponent > xParentComponent( m_pImpl->getParentAccessibleComponent(), UNO_QUERY_THROW ); + // TODO: strictly, this is not correct: The TabBar implementation of the TabLayouter might use + // a different font ... + return xParentComponent->getFont(); + } + + //-------------------------------------------------------------------- + ::rtl::OUString SAL_CALL AccessibleToolPanelDeckTabBarItem::getTitledBorderText( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + // no support + return ::rtl::OUString(); + } + + //-------------------------------------------------------------------- + ::rtl::OUString SAL_CALL AccessibleToolPanelDeckTabBarItem::getToolTipText( ) throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + return m_pImpl->getPanelDisplayName(); + } + + //-------------------------------------------------------------------- + UnoRectangle SAL_CALL AccessibleToolPanelDeckTabBarItem::implGetBounds() throw (RuntimeException) + { + ItemMethodGuard aGuard( *m_pImpl ); + + const ::Rectangle aItemScreenRect( m_pImpl->getTabBar()->GetItemScreenRect( m_pImpl->getItemPos() ) ); + + Reference< XAccessibleComponent > xParentComponent( m_pImpl->getParentAccessibleComponent(), UNO_SET_THROW ); + const UnoPoint aParentLocation( xParentComponent->getLocationOnScreen() ); + return UnoRectangle( + aItemScreenRect.Left() - aParentLocation.X, + aItemScreenRect.Top() - aParentLocation.Y, + aItemScreenRect.GetWidth(), + aItemScreenRect.GetHeight() + ); + } + + //-------------------------------------------------------------------- + void SAL_CALL AccessibleToolPanelDeckTabBarItem::disposing() + { + ItemMethodGuard aGuard( *m_pImpl ); + m_pImpl->dispose(); + } + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx index a352ed51a78c..0468cce97d94 100644 --- a/accessibility/source/extended/accessiblelistbox.cxx +++ b/accessibility/source/extended/accessiblelistbox.cxx @@ -131,8 +131,8 @@ namespace accessibility break; // --> OD 2009-04-01 #i92103# - case VCLEVENT_LISTBOX_ENTRY_EXPANDED : - case VCLEVENT_LISTBOX_ENTRY_COLLAPSED : + case VCLEVENT_ITEM_EXPANDED : + case VCLEVENT_ITEM_COLLAPSED : { SvLBoxEntry* pEntry = static_cast< SvLBoxEntry* >( rVclWindowEvent.GetData() ); if ( pEntry ) @@ -141,7 +141,7 @@ namespace accessibility new AccessibleListBoxEntry( *getListBox(), pEntry, this ); Reference< XAccessible > xChild = pAccListBoxEntry; const short nAccEvent = - ( rVclWindowEvent.GetId() == VCLEVENT_LISTBOX_ENTRY_EXPANDED ) + ( rVclWindowEvent.GetId() == VCLEVENT_ITEM_EXPANDED ) ? AccessibleEventId::LISTBOX_ENTRY_EXPANDED : AccessibleEventId::LISTBOX_ENTRY_COLLAPSED; uno::Any aListBoxEntry; diff --git a/accessibility/source/extended/makefile.mk b/accessibility/source/extended/makefile.mk index 446ec73ec1b7..27f4403c8210 100644..100755 --- a/accessibility/source/extended/makefile.mk +++ b/accessibility/source/extended/makefile.mk @@ -70,7 +70,10 @@ SLOFILES=\ $(SLO)$/AccessibleGridControlHeader.obj \ $(SLO)$/AccessibleGridControlTableCell.obj \ $(SLO)$/AccessibleGridControlHeaderCell.obj \ - $(SLO)$/AccessibleGridControlTable.obj + $(SLO)$/AccessibleGridControlTable.obj \ + $(SLO)$/AccessibleToolPanelDeck.obj \ + $(SLO)$/AccessibleToolPanelDeckTabBar.obj \ + $(SLO)$/AccessibleToolPanelDeckTabBarItem.obj # --- Targets ------------------------------------------------------- diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index 50d3ac682377..7279b5e2ff60 100644..100755 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -29,18 +29,12 @@ #include "precompiled_accessibility.hxx" #include <accessibility/helper/acc_factory.hxx> -#ifndef _TOOLKIT_AWT_VCLXWINDOWS_HXX #include <toolkit/awt/vclxwindows.hxx> -#endif #include <accessibility/standard/vclxaccessiblebutton.hxx> #include <accessibility/standard/vclxaccessiblecheckbox.hxx> -#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWCOMBOBOX_HXX #include <accessibility/standard/vclxaccessibledropdowncombobox.hxx> -#endif #include <accessibility/standard/vclxaccessiblecombobox.hxx> -#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWLISTBOX_HXX #include <accessibility/standard/vclxaccessibledropdownlistbox.hxx> -#endif #include <accessibility/standard/vclxaccessibleedit.hxx> #include <accessibility/standard/vclxaccessiblefixedhyperlink.hxx> #include <accessibility/standard/vclxaccessiblefixedtext.hxx> @@ -67,13 +61,17 @@ #include <accessibility/extended/AccessibleBrowseBoxHeaderCell.hxx> #include <accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx> #include <accessibility/extended/accessibleeditbrowseboxcell.hxx> +#include <accessibility/extended/AccessibleToolPanelDeck.hxx> +#include <accessibility/extended/AccessibleToolPanelDeckTabBar.hxx> +#include <accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx> #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> #include <accessibility/extended/AccessibleGridControl.hxx> #include <svtools/accessibletable.hxx> -#include "vcl/popupmenuwindow.hxx" +#include <vcl/popupmenuwindow.hxx> +#include <cppuhelper/implbase1.hxx> -#include <floatingwindowaccessible.hxx> +#include "floatingwindowaccessible.hxx" //........................................................................ namespace accessibility @@ -227,6 +225,18 @@ inline bool hasFloatingChild(Window *pWindow) sal_uInt16 _nColPos ) const; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + createAccessibleToolPanelDeck( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, + ::svt::ToolPanelDeck& i_rPanelDeck + ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + createAccessibleToolPanelTabBar( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar + ); + protected: virtual ~AccessibleFactory(); }; @@ -508,6 +518,20 @@ inline bool hasFloatingChild(Window *pWindow) _rxFocusWindow, _rBrowseBox, _nRowPos, _nColPos ); } + //-------------------------------------------------------------------- + Reference< XAccessibleContext > AccessibleFactory::createAccessibleToolPanelDeck( + const Reference< XAccessible >& i_rAccessibleParent, ::svt::ToolPanelDeck& i_rPanelDeck ) + { + return new AccessibleToolPanelDeck( i_rAccessibleParent, i_rPanelDeck ); + } + + //-------------------------------------------------------------------- + Reference< XAccessibleContext > AccessibleFactory::createAccessibleToolPanelTabBar( + const Reference< XAccessible >& i_rAccessibleParent, ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) + { + return new AccessibleToolPanelTabBar( i_rAccessibleParent, i_rPanelDeck, i_rTabBar ); + } + //........................................................................ } // namespace accessibility //........................................................................ diff --git a/accessibility/source/helper/accessiblestrings.src b/accessibility/source/helper/accessiblestrings.src index 4df1391f3c1d..ee7f77f9b502 100644 --- a/accessibility/source/helper/accessiblestrings.src +++ b/accessibility/source/helper/accessiblestrings.src @@ -70,3 +70,7 @@ String RID_STR_ACC_NAME_BROWSEBUTTON Text [ en-US ] = "Browse"; }; +String RID_STR_ACC_DESC_PANELDECL_TABBAR +{ + Text [ en-US ] = "Panel Deck Tab Bar"; +}; diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 52b7a7f83cab..ce796af77ab4 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -441,6 +441,26 @@ void VCLXAccessibleToolBox::UpdateAllItems_Impl() } } } + +// ----------------------------------------------------------------------------- + +void VCLXAccessibleToolBox::UpdateCustomPopupItemp_Impl( Window* pWindow, bool bOpen ) +{ + ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); + if( pWindow && pToolBox ) + { + Reference< XAccessible > xChild( pWindow->GetAccessible() ); + if( xChild.is() ) + { + Reference< XAccessible > xChildItem( getAccessibleChild( static_cast< sal_Int32 >( pToolBox->GetItemPos( pToolBox->GetDownItemId() ) ) ) ); + VCLXAccessibleToolBoxItem* pItem = static_cast< VCLXAccessibleToolBoxItem* >( xChildItem.get() ); + + pItem->SetChild( xChild ); + pItem->NotifyChildEvent( xChild, bOpen ); + } + } +} + // ----------------------------------------------------------------------------- void VCLXAccessibleToolBox::UpdateItemName_Impl( sal_Int32 _nPos ) { @@ -582,6 +602,13 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow break; } + case VCLEVENT_DROPDOWN_OPEN: + case VCLEVENT_DROPDOWN_CLOSE: + { + UpdateCustomPopupItemp_Impl( static_cast< Window* >( rVclWindowEvent.GetData() ), rVclWindowEvent.GetId() == VCLEVENT_DROPDOWN_OPEN ); + break; + } + case VCLEVENT_OBJECT_DYING : { // if this toolbox is a subtoolbox, we have to relese it from its parent diff --git a/accessibility/util/acc.map b/accessibility/util/acc.map index 5678c95e71fd..b9e53f414df5 100644 --- a/accessibility/util/acc.map +++ b/accessibility/util/acc.map @@ -1,4 +1,4 @@ -FORMS_1_0 { +UDK_3_0_0 { global: getStandardAccessibleFactory; getSvtAccessibilityComponentFactory; diff --git a/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java b/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java index 02ec7fea2232..6e8e45bc4e82 100644 --- a/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java +++ b/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java @@ -588,28 +588,39 @@ public class AccessibilityWorkBench javax.swing.tree.TreePath aPath = aEvent.getPath(); maTree.scrollPathToVisible (aPath); Object aObject = aPath.getLastPathComponent(); - if (aObject instanceof XAccessible) { - XAccessible xAccessible = (XAccessible) aObject; - if (maObjectViewContainer != null) { - ((AccessibilityModel) maTree.getModel()).addEventListener((TreeNode) aObject, maObjectViewContainer); - maObjectViewContainer.SetObject (xAccessible.getAccessibleContext()); - } + implSetCurrentObject( aObject ); + if (aObject instanceof XAccessible) + { + if (maObjectViewContainer != null) + maObjectViewContainer.SetObject( ((XAccessible)aObject).getAccessibleContext() ); } if (maCanvas != null) maCanvas.SelectObject ((TreeNode) aObject); setCursor (aCursor); } else { - if (maObjectViewContainer != null) { - ((AccessibilityModel) maTree.getModel()).removeEventListener((TreeNode) aEvent.getPath().getLastPathComponent(), maObjectViewContainer); + implSetCurrentObject( aEvent.getPath().getLastPathComponent() ); + if (maObjectViewContainer != null) maObjectViewContainer.SetObject (null); - } if (maCanvas != null) maCanvas.SelectObject (null); } } - + private void implSetCurrentObject( Object i_object ) + { + if ( maObjectViewContainer == null ) + return; + if ( maCurrentObject != null ) + { + AccessibilityModel.removeEventListener( (TreeNode)maCurrentObject, maObjectViewContainer ); + } + maCurrentObject = i_object; + if ( maCurrentObject != null ) + { + AccessibilityModel.addEventListener( (TreeNode)maCurrentObject, maObjectViewContainer ); + } + } // XEventListener public void disposing (EventObject aSourceObj) @@ -687,4 +698,5 @@ public class AccessibilityWorkBench maShapesButton; private JMenuBar maMenuBar; private boolean mbInitialized; + private Object maCurrentObject = null; } diff --git a/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityNode.java b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityNode.java index 93823e9a1941..81a499aabf0d 100644 --- a/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityNode.java +++ b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityNode.java @@ -75,8 +75,7 @@ class AccessibilityNode extends DefaultMutableTreeNode implements XAccessible, if (xAccessibleContext != null) { try { XAccessibleEventBroadcaster xAccessibleEventBroadcaster = - (XAccessibleEventBroadcaster) UnoRuntime.queryInterface( - XAccessibleEventBroadcaster.class, xAccessibleContext); + UnoRuntime.queryInterface( XAccessibleEventBroadcaster.class, xAccessibleContext ); if (xAccessibleEventBroadcaster != null) { if (attach) { xAccessibleEventBroadcaster.addEventListener(this); @@ -91,9 +90,9 @@ class AccessibilityNode extends DefaultMutableTreeNode implements XAccessible, } public void disposing(com.sun.star.lang.EventObject eventObject) { - XAccessibleEventListener listener = this.listener; - if (listener != null) { - listener.disposing(eventObject); + XAccessibleEventListener localListener = this.listener; + if (localListener != null) { + localListener.disposing(eventObject); } treeModel.removeNode(userObject); @@ -135,22 +134,20 @@ class AccessibilityNode extends DefaultMutableTreeNode implements XAccessible, public void notifyEvent(AccessibleEventObject accessibleEventObject) { if (accessibleEventObject.EventId == AccessibleEventId.CHILD) { - XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface( - XAccessible.class, accessibleEventObject.OldValue); + XAccessible xAccessible = UnoRuntime.queryInterface( XAccessible.class, accessibleEventObject.OldValue ); if (xAccessible != null) { handleChildRemoved(xAccessible); } - xAccessible = (XAccessible) UnoRuntime.queryInterface( - XAccessible.class, accessibleEventObject.NewValue); + xAccessible = UnoRuntime.queryInterface( XAccessible.class, accessibleEventObject.NewValue ); if (xAccessible != null) { handleChildAdded(xAccessible); } } - XAccessibleEventListener listener = this.listener; - if (listener != null) { - listener.notifyEvent(accessibleEventObject); + XAccessibleEventListener localListener = this.listener; + if (localListener != null) { + localListener.notifyEvent(accessibleEventObject); } } diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/EventMonitorView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/EventMonitorView.java index 5b4bdcdcc4e4..67e8091e027f 100644 --- a/accessibility/workben/org/openoffice/accessibility/awb/view/EventMonitorView.java +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/EventMonitorView.java @@ -64,6 +64,7 @@ class EventMonitorView public EventMonitorView (ObjectViewContainer aContainer) { super (aContainer); + mnLineNo = 0; Layout(); } @@ -85,7 +86,7 @@ class EventMonitorView maScrollPane = new JScrollPane (maText, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); - maScrollPane.setPreferredSize (new Dimension (300,80)); + maScrollPane.setPreferredSize (new Dimension (300,200)); GridBagConstraints aConstraints = new GridBagConstraints (); aConstraints.weightx = 1; @@ -112,7 +113,7 @@ class EventMonitorView public void notifyEvent (AccessibleEventObject aEvent) { - maText.append (NameProvider.getEventName (aEvent.EventId) + " : " + maText.append ((mnLineNo++) + ". " + NameProvider.getEventName (aEvent.EventId) + " : " + aEvent.OldValue.toString() + " -> " + aEvent.NewValue.toString() + "\n"); @@ -120,5 +121,6 @@ class EventMonitorView } private JTextArea maText; + private int mnLineNo; private JScrollPane maScrollPane; } diff --git a/automation/source/inc/rcontrol.hxx b/automation/source/inc/rcontrol.hxx index 829dd320beb6..7313603096b4 100644 --- a/automation/source/inc/rcontrol.hxx +++ b/automation/source/inc/rcontrol.hxx @@ -305,7 +305,7 @@ #define RC_Profile ( M_SOFFICE | M_MOZILLA | 9 ) // (Popup)Menu #define RC_MenuSelect ( M_SOFFICE | M_MOZILLA | 10 ) -#define RC_SetControlType ( M_SOFFICE | 11 ) +#define RC_SetControlType ( M_SOFFICE | 11 ) // deprecated since RTTI // RemoteFileAccess #define RC_Kill ( M_SOFFICE | 12 ) #define RC_RmDir ( M_SOFFICE | 13 ) @@ -429,14 +429,14 @@ -// Konstanten die im Basic zur Verfügung stehen sollen +// Constants which are available in VCLTestTool scripts -// Verschiedene Typen von Controls für den Befehl SetControlType -// !!!!!!!!!!! Müssen alle bei SetControlType eingetragen werden !!!!!!!!!!!! +// Different types of controls recognized via RTTI #define CONST_CTBrowseBox 100 #define CONST_CTValueSet 103 #define CONST_CTORoadmap 104 #define CONST_CTIExtensionListBox 105 +#define CONST_CTTableControl 106 #define CONST_CTUnknown 199 // Konstanten für das ALignment des gesuchten Splitters diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx index 7f346c298563..c0abcb057f8b 100644 --- a/automation/source/server/sta_list.cxx +++ b/automation/source/server/sta_list.cxx @@ -53,6 +53,7 @@ #include <svtools/valueset.hxx> #include <svtools/roadmap.hxx> #include <svtools/extensionlistbox.hxx> +#include <svtools/table/tablecontrol.hxx> #define WINDOW_ANYTYPE WINDOW_BASE @@ -999,6 +1000,8 @@ String StatementList::ClientTree(Window *pBase, int Indent) WRITEc("/RoadMap") else if ( dynamic_cast< svt::IExtensionListBox* >(pBase) ) WRITEc("/ExtensionListBox") + else if ( dynamic_cast< svt::table::TableControl* >(pBase) ) + WRITEc("/TableControl") else WRITEc("/Unknown") } diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 68ff61bbaa0d..2d1cccd9fc51 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -82,6 +82,7 @@ #include <vcl/wintypes.hxx> #include <svtools/valueset.hxx> #include <svtools/roadmap.hxx> +#include <svtools/table/tablecontrol.hxx> #include <svl/poolitem.hxx> #include <svtools/extensionlistbox.hxx> // Hat keinen Includeschutz @@ -96,6 +97,7 @@ #include <basic/ttstrhlp.hxx> #endif #include <basic/dispdefs.hxx> +#include <basic/sbuno.hxx> #include <vos/socket.hxx> #include <svl/pickerhistory.hxx> #include <com/sun/star/util/XCancellable.hpp> @@ -128,9 +130,10 @@ using namespace com::sun::star::frame; using namespace com::sun::star::uno; -using namespace com::sun::star::util; +//using namespace com::sun::star::util; geht wegen Color nicht using namespace com::sun::star::beans; using namespace svt; +//using namespace svt::table; #ifndef SBX_VALUE_DECL_DEFINED @@ -618,7 +621,7 @@ BOOL StatementSlot::Execute() AddReferer(); if ( !aUnoUrl.Len() ) aUnoUrl = CUniString("slot:").Append( String::CreateFromInt32( nFunctionId ) ); - URL aTargetURL; + ::com::sun::star::util::URL aTargetURL; aTargetURL.Complete = aUnoUrl; Reference < XFramesSupplier > xDesktop = Reference < XFramesSupplier >( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.frame.Desktop") ), UNO_QUERY ); Reference < XFrame > xFrame; @@ -664,7 +667,7 @@ BOOL StatementSlot::Execute() ReportError( GEN_RES_STR1( S_UNO_URL_EXECUTE_FAILED_NO_FRAME, aTargetURL.Complete ) ); else { - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); @@ -865,6 +868,13 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst if ( bFirst ) pRet->GenReturn ( RET_WinInfo, SmartId(), (comm_ULONG)nConf | DH_MODE_DATA_VALID, UniString(), TRUE ); + if ( bFirst ) + { + if ( pBase->GetType() == WINDOW_WINDOW && pBase->GetParent() && pBase->GetParent()->GetType() == WINDOW_CONTROL && + dynamic_cast< svt::table::TableControl* > ( pBase->GetParent() ) ) + pBase = pBase->GetParent(); + } + { // Klammerung, so daß der String nicht während der Rekursion bestehen bleibt String aName; BOOL bSkip = FALSE; @@ -958,6 +968,8 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst aTypeSuffix.AppendAscii( "/RoadMap", 8 ); else if ( dynamic_cast< IExtensionListBox* >(pBase) ) aTypeSuffix.AppendAscii( "/ExtensionListBox" ); + else if ( dynamic_cast< svt::table::TableControl* >(pBase) ) + aTypeSuffix.AppendAscii( "/TableControl" ); else aTypeSuffix.AppendAscii( "/Unknown", 8 ); } @@ -3388,17 +3400,17 @@ BOOL StatementCommand::Execute() { if( (nParams & PARAM_USHORT_1) ) { - Reference < XCancellable > xPicker; + Reference < ::com::sun::star::util::XCancellable > xPicker; switch( nNr1 ) { case CONST_FilePicker: { - xPicker.set( Reference < XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) ); + xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) ); } break; case CONST_FolderPicker: { - xPicker.set( Reference < XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) ); + xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) ); } break; default: @@ -5807,6 +5819,8 @@ BOOL StatementControl::Execute() nRealControlType = CONST_CTORoadmap; else if ( dynamic_cast< IExtensionListBox* >(pControl) ) nRealControlType = CONST_CTIExtensionListBox; + else if ( dynamic_cast< ::svt::table::TableControl* >(pControl) ) + nRealControlType = CONST_CTTableControl; else nRealControlType = CONST_CTUnknown; @@ -6148,6 +6162,163 @@ protected: } } break; + + case CONST_CTTableControl: + { + ::svt::table::TableControl *pTC = dynamic_cast< ::svt::table::TableControl* >(pControl); + switch ( nMethodId ) + { + case M_GetItemType : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && + ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) + { + ::svt::table::PTableModel pModel = pTC->GetModel(); + Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; + pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() )); + } + } + break; + case M_GetItemText : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && + ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) + { + ::svt::table::PTableModel pModel = pTC->GetModel(); + Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; + /* doesn't work ATM since it gets casted to SbxDATE in VCLTestTool unfortunately + SbxVariableRef xRes = new SbxVariable( SbxVARIANT ); + unoToSbxValue( xRes, aCell ); + pRet->GenReturn ( RET_Value, aUId, *xRes );*/ + + Type aType = aCell.getValueType(); + TypeClass eTypeClass = aType.getTypeClass(); + switch( eTypeClass ) + { + /*case TypeClass_ENUM: + { + sal_Int32 nEnum = 0; + enum2int( nEnum, aValue ); + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)nEnum ); + } + break;*/ + case TypeClass_BOOLEAN: + pRet->GenReturn ( RET_Value, aUId, *(sal_Bool*)aCell.getValue() ); + break; + case TypeClass_CHAR: + { + ::rtl::OUString aContent( *(sal_Unicode*)aCell.getValue() ); + pRet->GenReturn ( RET_Value, aUId, aContent ); + } + break; + case TypeClass_STRING: + { + ::rtl::OUString aContent; + aCell >>= aContent; + pRet->GenReturn ( RET_Value, aUId, aContent ); + } + break; + //case TypeClass_FLOAT: break; + //case TypeClass_DOUBLE: break; + //case TypeClass_OCTET: break; + case TypeClass_BYTE: + case TypeClass_SHORT: + case TypeClass_LONG: + case TypeClass_HYPER: + case TypeClass_UNSIGNED_LONG: + case TypeClass_UNSIGNED_HYPER: + { + comm_ULONG val = 0; + aCell >>= val; + pRet->GenReturn ( RET_Value, aUId, val ); + } + break; + //case TypeClass_UNSIGNED_OCTET:break; + case TypeClass_UNSIGNED_SHORT: + { + comm_USHORT val = 0; + aCell >>= val; + pRet->GenReturn ( RET_Value, aUId, val ); + } + break; + default: + pRet->GenReturn ( RET_Value, aUId, comm_USHORT(0) ); + break; + } + } + } + break; + case M_GetColumnCount : + { + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetColumnCount() ); + } + break; + case M_GetRowCount : + { + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetRowCount() ); + } + break; + case M_Select : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetRowCount() )) + { + if ( pTC->GoToRow( ::svt::table::RowPos( nNr1-1 ) ) ) + { + Size aSize( pTC->GetSizePixel() ); +// DirectLog( S_QAError, UniString::CreateFromInt32( aSize.Width() ).Append( UniString::CreateFromInt32( aSize.Height() ) ) ); + Point aPos( aSize.Width() / 2, aSize.Height() / 2 ); + long nStep = aSize.Height() / 4; + ::svt::table::RowPos nLastPos; + while ( ( nLastPos = pTC->GetCurrentRow( aPos ) ) != nNr1-1 && nStep > 0 ) + { + if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID ) + aPos.Y() -= nStep; + else + aPos.Y() += nStep; + nStep /= 2; + } + if ( pTC->GetCurrentRow( aPos ) == nNr1-1 ) + { + MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1); + pTC->getSelEngine()->SelMouseButtonDown( aMEvnt ); + pTC->getSelEngine()->SelMouseButtonUp( aMEvnt ); + } + else + ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "find pos" ) ); + } + else + ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "GoTo" ) ); + } + } + break; + case M_GetSelCount : + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows().size() )); + break; + case M_GetSelIndex : + if ( ! (nParams & PARAM_USHORT_1) ) + nNr1 = 1; + if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRows().size() ) ) + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows()[nNr1-1] +1 ) ); + break; +/* case M_GetSelText : + if ( ! (nParams & PARAM_USHORT_1) ) + nNr1 = 1; + if ( ValueOK(aUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) + { + nNr1--; + COUNT_LBOX( FirstSelected, NextSelected, nNr1); + GetFirstValidTextItem( pThisEntry ); + pRet->GenReturn ( RET_Value, aUId, pItem->GetText() ); + } + break; + */ + default: + ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TableControl" ) ); + break; + } + } + break; + case CONST_CTUnknown: ReportError( aUId, GEN_RES_STR2( S_UNKNOWN_TYPE, UniString::CreateFromInt32( nRT ), MethodString(nMethodId) ) ); break; diff --git a/automation/source/testtool/filter.pl b/automation/source/testtool/filter.pl index 79b7add5c5b3..8f45073b0934 100644 --- a/automation/source/testtool/filter.pl +++ b/automation/source/testtool/filter.pl @@ -71,28 +71,13 @@ sub read_block { print "Leaving read_block at the end\n" if $debug; } -sub convert_path { - - $_ = $_[0]; - $GUI = $ENV {"GUI"}; - $use_shell = $ENV {"USE_SHELL"}; - if ( $GUI eq "WNT" ) - { - if ( defined( $use_shell ) && "$use_shell" eq "4nt" ) - { - s/\//\\/g; - } - } - $_; -} - # Read a file. # first parameter ist the filename sub read_file { local ($filename,$file) = @_; $file++; # String increment - local $TempFileName = &convert_path( $basename."/".$filename ); + local $TempFileName = $basename."/".$filename; print "reading file $TempFileName as $file\n" if $debug; open($file, $TempFileName) || die "error: Could not open file $TempFileName. "; @@ -103,9 +88,6 @@ sub read_file { # main starts here -print &convert_path ("/\n\n\n") if ( $debug ); - - $basename = "."; $basename = $ARGV[0] if defined($ARGV[0]); diff --git a/automation/source/testtool/makefile.mk b/automation/source/testtool/makefile.mk index 962f9d6e2694..db8464130c1b 100644 --- a/automation/source/testtool/makefile.mk +++ b/automation/source/testtool/makefile.mk @@ -87,13 +87,8 @@ $(INCCOM)$/res_type.hxx : $(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/tools$/ $(MISC)$/xfilter.pl : filter.pl -.IF "$(GUI)" == "UNX" || "$(USE_SHELL)"!="4nt" tr -d "\015" < filter.pl > $(MISC)$/xfilter.pl chmod 664 $(MISC)$/xfilter.pl -.ELSE - $(COPY) filter.pl $(MISC)$/xfilter.pl - attrib -r $(MISC)$/xfilter.pl -.ENDIF diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index 461dff80b13d..2361361f277f 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -518,6 +518,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d abGP.Append( "21" ); // Linux S390 #elif defined LINUX && defined HPPA abGP.Append( "22" ); // Linux PA-RISC +#elif defined LINUX && defined AXP + abGP.Append( "23" ); // Linux ALPHA #else #error ("unknown platform. please request an ID for your platform on qa/dev") #endif diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc index 51d1ed2be6fc..8bf7d3316cd0 100644 --- a/basctl/inc/basidesh.hrc +++ b/basctl/inc/basidesh.hrc @@ -182,6 +182,10 @@ #define RID_STR_DLGIMP_MISMATCH_OMIT ( RID_BASICIDE_START + 115 ) #define RID_STR_DLGIMP_MISMATCH_TITLE ( RID_BASICIDE_START + 116 ) #define RID_STR_DLGIMP_MISMATCH_TEXT ( RID_BASICIDE_START + 117 ) +#define RID_STR_DOCUMENT_OBJECTS ( RID_BASICIDE_START + 118 ) +#define RID_STR_USERFORMS ( RID_BASICIDE_START + 119 ) +#define RID_STR_NORMAL_MODULES ( RID_BASICIDE_START + 120 ) +#define RID_STR_CLASS_MODULES ( RID_BASICIDE_START + 121 ) #endif // _SVX_NOIDERESIDS diff --git a/basctl/prj/d.lst b/basctl/prj/d.lst index ffd8e07b1e36..d05ff35bdabc 100644 --- a/basctl/prj/d.lst +++ b/basctl/prj/d.lst @@ -4,8 +4,6 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\menubar mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\toolbar -mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\accelerator -mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\accelerator\en-US mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\statusbar ..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid @@ -22,5 +20,4 @@ mkdir: %_DEST%\inc%_EXT%\basctl ..\uiconfig\basicide\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\menubar\*.xml ..\uiconfig\basicide\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\toolbar\*.xml -..\uiconfig\basicide\accelerator\en-US\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\accelerator\en-US\*.xml ..\uiconfig\basicide\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\BasicIDE\statusbar\*.xml diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 9fc700948249..9f97e1766c3b 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/script/XLibraryContainer2.hpp> #endif #include <com/sun/star/document/MacroExecMode.hpp> +#include <com/sun/star/script/ModuleType.hpp> #include <toolkit/helper/vclunohelper.hxx> #include <sfx2/docfile.hxx> #include <basic/basrdll.hxx> @@ -202,21 +203,35 @@ ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDoc pLayout = pParent; aXEditorWindow.Show(); - BasicManager* pBasMgr = rDocument.getBasicManager(); - if ( pBasMgr ) + SetBackground(); +} + +SbModuleRef ModulWindow::XModule() +{ + // ModuleWindows can now be created as a result of the + // modules getting created via the api. This is a result of an + // elementInserted event from the BasicLibrary container. + // However the SbModule is also created from a different listener to + // the same event ( in basmgr ) Therefore it is possible when we look + // for xModule it may not yet be available, here we keep tring to access + // the module until such time as it exists + + if ( !xModule.Is() ) { - StarBASIC* pBasic = pBasMgr->GetLib( aLibName ); - if ( pBasic ) + BasicManager* pBasMgr = GetDocument().getBasicManager(); + if ( pBasMgr ) { - xBasic = pBasic; - xModule = (SbModule*)pBasic->FindModule( aName ); + StarBASIC* pBasic = pBasMgr->GetLib( GetLibName() ); + if ( pBasic ) + { + xBasic = pBasic; + xModule = (SbModule*)pBasic->FindModule( GetName() ); + } } } - - SetBackground(); + return xModule; } - __EXPORT ModulWindow::~ModulWindow() { DBG_DTOR( ModulWindow, 0 ); @@ -266,7 +281,7 @@ void ModulWindow::CheckCompileBasic() { DBG_CHKTHIS( ModulWindow, 0 ); - if ( xModule.Is() ) + if ( XModule().Is() ) { // Zur Laufzeit wird niemals compiliert! BOOL bRunning = StarBASIC::IsRunning(); @@ -322,7 +337,7 @@ BOOL ModulWindow::BasicExecute() CheckCompileBasic(); - if ( xModule.Is() && xModule->IsCompiled() && !aStatus.bError ) + if ( XModule().Is() && xModule->IsCompiled() && !aStatus.bError ) { if ( GetBreakPoints().Count() ) aStatus.nBasicFlags = aStatus.nBasicFlags | SbDEBUG_BREAK; @@ -332,6 +347,9 @@ BOOL ModulWindow::BasicExecute() DBG_ASSERT( xModule.Is(), "Kein Modul!" ); AddStatus( BASWIN_RUNNINGBASIC ); USHORT nStart, nEnd, nCurMethodStart = 0; + TextSelection aSel = GetEditView()->GetSelection(); + if ( aDocument.isInVBAMode() ) + nCurMethodStart = ( aSel.GetStart().GetPara() + 1 ); SbMethod* pMethod = 0; // erstes Macro, sonst blind "Main" (ExtSearch?) for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ ) @@ -339,15 +357,27 @@ BOOL ModulWindow::BasicExecute() SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro ); DBG_ASSERT( pM, "Method?" ); pM->GetLineRange( nStart, nEnd ); - if ( !pMethod || ( nStart < nCurMethodStart ) ) + if ( aDocument.isInVBAMode() ) + { + if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd ) + { + pMethod = pM; + break; + } + } + else if ( !pMethod || ( nStart < nCurMethodStart ) ) { pMethod = pM; nCurMethodStart = nStart; } } if ( !pMethod ) - pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD ); - + { + if ( aDocument.isInVBAMode() ) + return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE; + else + pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD ); + } if ( pMethod ) { pMethod->SetDebugFlags( aStatus.nBasicFlags ); @@ -374,7 +404,7 @@ BOOL ModulWindow::CompileBasic() CheckCompileBasic(); BOOL bIsCompiled = FALSE; - if ( xModule.Is() ) + if ( XModule().Is() ) bIsCompiled = xModule->IsCompiled(); return bIsCompiled; @@ -551,11 +581,11 @@ BOOL ModulWindow::ImportDialog() BOOL ModulWindow::ToggleBreakPoint( ULONG nLine ) { - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); BOOL bNewBreakPoint = FALSE; - if ( xModule.Is() ) + if ( XModule().Is() ) { CheckCompileBasic(); if ( aStatus.bError ) @@ -597,9 +627,9 @@ BOOL ModulWindow::ToggleBreakPoint( ULONG nLine ) void ModulWindow::UpdateBreakPoint( const BreakPoint& rBrk ) { - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); - if ( xModule.Is() ) + if ( XModule().Is() ) { CheckCompileBasic(); @@ -823,9 +853,9 @@ void ModulWindow::BasicRemoveWatch() void ModulWindow::EditMacro( const String& rMacroName ) { DBG_CHKTHIS( ModulWindow, 0 ); - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); - if ( xModule.Is() ) + if ( XModule().Is() ) { CheckCompileBasic(); @@ -895,12 +925,12 @@ BOOL __EXPORT ModulWindow::AllowUndo() void __EXPORT ModulWindow::UpdateData() { DBG_CHKTHIS( ModulWindow, 0 ); - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); // UpdateData wird gerufen, wenn sich der Source von aussen // geaendert hat. // => Keine Unterbrechungen erwuenscht! - if ( xModule.Is() ) + if ( XModule().Is() ) { SetModule( xModule->GetSource32() ); @@ -1193,19 +1223,6 @@ void __EXPORT ModulWindow::DoScroll( ScrollBar* pCurScrollBar ) } -BOOL ModulWindow::RenameModule( const String& rNewName ) -{ - if ( !BasicIDE::RenameModule( this, GetDocument(), GetLibName(), GetName(), rNewName ) ) - return FALSE; - - SfxBindings* pBindings = BasicIDE::GetBindingsPtr(); - if ( pBindings ) - pBindings->Invalidate( SID_DOC_MODIFIED ); - - return TRUE; -} - - BOOL __EXPORT ModulWindow::IsModified() { return GetEditEngine() ? GetEditEngine()->IsModified() : FALSE; @@ -1221,7 +1238,7 @@ void __EXPORT ModulWindow::GoOnTop() String ModulWindow::GetSbModuleName() { String aModuleName; - if ( xModule.Is() ) + if ( XModule().Is() ) aModuleName = xModule->GetName(); return aModuleName; } @@ -1343,7 +1360,7 @@ USHORT __EXPORT ModulWindow::GetSearchOptions() void __EXPORT ModulWindow::BasicStarted() { - if ( xModule.Is() ) + if ( XModule().Is() ) { aStatus.bIsRunning = TRUE; BreakPointList& rList = GetBreakPoints(); @@ -1372,7 +1389,39 @@ BasicEntryDescriptor ModulWindow::CreateEntryDescriptor() ScriptDocument aDocument( GetDocument() ); String aLibName( GetLibName() ); LibraryLocation eLocation = aDocument.getLibraryLocation( aLibName ); - return BasicEntryDescriptor( aDocument, eLocation, aLibName, GetName(), OBJ_TYPE_MODULE ); + String aModName( GetName() ); + String aLibSubName; + if( xBasic.Is() && aDocument.isInVBAMode() && XModule().Is() ) + { + switch( xModule->GetModuleType() ) + { + case script::ModuleType::DOCUMENT: + { + aLibSubName = String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ); + uno::Reference< container::XNameContainer > xLib = aDocument.getOrCreateLibrary( E_SCRIPTS, aLibName ); + if( xLib.is() ) + { + String sObjName; + ModuleInfoHelper::getObjectName( xLib, aModName, sObjName ); + if( sObjName.Len() ) + { + aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")"); + } + } + break; + } + case script::ModuleType::FORM: + aLibSubName = String( IDEResId( RID_STR_USERFORMS ) ); + break; + case script::ModuleType::NORMAL: + aLibSubName = String( IDEResId( RID_STR_NORMAL_MODULES ) ); + break; + case script::ModuleType::CLASS: + aLibSubName = String( IDEResId( RID_STR_CLASS_MODULES ) ); + break; + } + } + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aModName, OBJ_TYPE_MODULE ); } void ModulWindow::SetReadOnly( BOOL b ) diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index 6d35f0a027a8..280bb6ee3ab6 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -357,6 +357,7 @@ private: void AssertValidEditEngine(); sal_Int32 FormatAndPrint( Printer* pPrinter, sal_Int32 nPage = -1 ); + SbModuleRef XModule(); protected: virtual void Resize(); virtual void GetFocus(); @@ -389,7 +390,7 @@ public: virtual void SetReadOnly( BOOL bReadOnly ); virtual BOOL IsReadOnly(); - StarBASIC* GetBasic() { return xBasic; } + StarBASIC* GetBasic() { XModule(); return xBasic; } SbModule* GetSbModule() { return xModule; } void SetSbModule( SbModule* pModule ) { xModule = pModule; } @@ -417,7 +418,6 @@ public: // void InsertFromObjectCatalog( ObjectCatalog* pObjDlg ); BOOL ToggleBreakPoint( ULONG nLine ); - BOOL RenameModule( const String& rNewName ); BasicStatus& GetBasicStatus() { return aStatus; } diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index afbe3daf5be1..f4a3c1d48fc7 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -1297,8 +1297,9 @@ BasicEntryDescriptor DialogWindow::CreateEntryDescriptor() { ScriptDocument aDocument( GetDocument() ); String aLibName( GetLibName() ); + String aLibSubName; LibraryLocation eLocation = aDocument.getLibraryLocation( aLibName ); - return BasicEntryDescriptor( aDocument, eLocation, aLibName, GetName(), OBJ_TYPE_DIALOG ); + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, GetName(), OBJ_TYPE_DIALOG ); } void DialogWindow::SetReadOnly( BOOL b ) diff --git a/basctl/source/basicide/baside4.cxx b/basctl/source/basicide/baside4.cxx deleted file mode 100644 index c080427ee013..000000000000 --- a/basctl/source/basicide/baside4.cxx +++ /dev/null @@ -1,31 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_basctl.hxx" - - diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 4432de9aa282..351186325b09 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -109,7 +109,6 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq ) { if ( aDocument.removeModule( aLibName, aName ) ) { - RemoveWindow( pCurWin, TRUE ); BasicIDE::MarkDocumentModified( aDocument ); } } @@ -430,11 +429,31 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq ) { String aNewName( rModName.GetValue() ); String aOldName( pWin->GetName() ); - if ( aNewName != aOldName ) { - if ( ( pWin->IsA( TYPE( ModulWindow ) ) && ((ModulWindow*)pWin)->RenameModule( aNewName ) ) - || ( pWin->IsA( TYPE( DialogWindow ) ) && ((DialogWindow*)pWin)->RenameDialog( aNewName ) ) ) + bool bRenameOk = false; + if ( pWin->IsA( TYPE( ModulWindow ) ) ) + { + ModulWindow* pModWin = (ModulWindow*)pWin; + String aLibName = ( pModWin->GetLibName() ); + ScriptDocument aDocument( pWin->GetDocument() ); + + if ( BasicIDE::RenameModule( pModWin, aDocument, aLibName, aOldName, aNewName ) ) + { + bRenameOk = true; + // Because we listen for container events for script + // modules, rename will delete the 'old' window + // pWin has been invalidated, restore now + pWin = FindBasWin( aDocument, aLibName, aNewName, TRUE ); + } + + } + else if ( pWin->IsA( TYPE( DialogWindow ) ) ) + { + DialogWindow* pDlgWin = (DialogWindow*)pWin; + bRenameOk = pDlgWin->RenameDialog( aNewName ); + } + if ( bRenameOk ) { BasicIDE::MarkDocumentModified( pWin->GetDocument() ); } diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx index 20de8e9aafba..bef969db9266 100644 --- a/basctl/source/basicide/basides2.cxx +++ b/basctl/source/basicide/basides2.cxx @@ -51,6 +51,10 @@ #include <tools/diagnose_ex.h> #include <sfx2/sfxdefs.hxx> #include <sfx2/signaturestate.hxx> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -235,7 +239,7 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const if ( !aLibName.Len() ) aLibName = String::CreateFromAscii( "Standard" ); - rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName ); + uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName ); if ( !aModName.Len() ) aModName = rDocument.createObjectName( E_SCRIPTS, aLibName ); @@ -254,9 +258,15 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const if ( bSuccess ) { - // new module window - pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule ); - nKey = InsertWindowInTable( pWin ); + pWin = FindBasWin( rDocument, aLibName, aModName, FALSE, TRUE ); + if( !pWin ) + { + // new module window + pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule ); + nKey = InsertWindowInTable( pWin ); + } + else // we've gotten called recursively ( via listener from createModule above ), get outta here + return pWin; } } else @@ -271,6 +281,17 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const } DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" ); } + if( nKey && xLib.is() && rDocument.isInVBAMode() ) + { + // display a nice friendly name in the ObjectModule tab, + // combining the objectname and module name, e.g. Sheet1 ( Financials ) + String sObjName; + ModuleInfoHelper::getObjectName( xLib, rModName, sObjName ); + if( sObjName.Len() ) + { + aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")"); + } + } pTabBar->InsertPage( (USHORT)nKey, aModName ); pTabBar->Sort(); pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar ); diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 23978f4df10b..2f9303756e09 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -77,6 +77,9 @@ #include <com/sun/star/script/XLibraryContainer.hpp> #include <com/sun/star/script/XLibraryContainerPassword.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XContainer.hpp> +#include <com/sun/star/container/XContainerListener.hpp> +#include <com/sun/star/script/XLibraryContainer.hpp> #include <svx/xmlsecctrl.hxx> @@ -84,6 +87,71 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star; using ::rtl::OUString; +static const rtl::OUString sStandardLibName( rtl::OUString::createFromAscii("Standard") ); + +typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListenerBASE; + +class ContainerListenerImpl : public ContainerListenerBASE +{ + BasicIDEShell* mpShell; +public: + + ContainerListenerImpl( BasicIDEShell* pShell ) : mpShell( pShell ) {} + + ~ContainerListenerImpl() + { + } + + void addContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName ) + { + try + { + uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, FALSE ), uno::UNO_QUERY ); + if ( xContainer.is() ) + { + uno::Reference< container::XContainerListener > xContainerListener( this ); + xContainer->addContainerListener( xContainerListener ); + } + } + catch( uno::Exception& ) {} + } + void removeContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName ) + { + try + { + uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, FALSE ), uno::UNO_QUERY ); + if ( xContainer.is() ) + { + uno::Reference< container::XContainerListener > xContainerListener( this ); + xContainer->removeContainerListener( xContainerListener ); + } + } + catch( uno::Exception& ) {} + } + + // XEventListener + virtual void SAL_CALL disposing( const lang::EventObject& ) throw( uno::RuntimeException ) {} + + // XContainerListener + virtual void SAL_CALL elementInserted( const container::ContainerEvent& Event ) throw( uno::RuntimeException ) + { + rtl::OUString sModuleName; + if( mpShell && ( Event.Accessor >>= sModuleName ) ) + mpShell->FindBasWin( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, TRUE, FALSE ); + } + virtual void SAL_CALL elementReplaced( const container::ContainerEvent& ) throw( com::sun::star::uno::RuntimeException ) { } + virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event ) throw( com::sun::star::uno::RuntimeException ) + { + rtl::OUString sModuleName; + if( mpShell && ( Event.Accessor >>= sModuleName ) ) + { + IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BASICIDE_TYPE_MODULE, TRUE ); + if( pWin ) + mpShell->RemoveWindow( pWin, TRUE, TRUE ); + } + } + +}; TYPEINIT1( BasicIDEShell, SfxViewShell ); @@ -121,6 +189,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFrame* pFrame_, SfxViewShell* /* pOldShell m_bAppBasicModified( FALSE ), m_aNotifier( *this ) { + m_xLibListener = new ContainerListenerImpl( this ); Init(); GnBasicIDEShellCount++; } @@ -212,6 +281,12 @@ __EXPORT BasicIDEShell::~BasicIDEShell() delete pTabBar; delete pObjectCatalog; DestroyModulWindowLayout(); + + ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() ); + // Destroy all ContainerListeners for Basic Container. + if ( pListener ) + pListener->removeContainerListener( m_aCurDocument, m_aCurLibName ); + // MI: Das gab einen GPF im SDT beim Schliessen da dann der ViewFrame die // ObjSh loslaesst. Es wusste auch keiner mehr wozu das gut war. // GetViewFrame()->GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_DYING ) ); @@ -828,9 +903,22 @@ void BasicIDEShell::RemoveWindow( IDEBaseWindow* pWindow_, BOOL bDestroy, BOOL b { pWindow_->AddStatus( BASWIN_TOBEKILLED ); pWindow_->Hide(); - StarBASIC::Stop(); - // Es kommt kein Notify... - pWindow_->BasicStopped(); + // In normal mode stop basic in windows to be deleted + // In VBA stop basic only if the running script is trying to delete + // its parent module + bool bStop = true; + if ( pWindow_->GetDocument().isInVBAMode() ) + { + SbModule* pMod = StarBASIC::GetActiveModule(); + if ( !pMod || ( pMod && ( pMod->GetName() != pWindow_->GetName() ) ) ) + bStop = false; + } + if ( bStop ) + { + StarBASIC::Stop(); + // Es kommt kein Notify... + pWindow_->BasicStopped(); + } aIDEWindowTable.Insert( nKey, pWindow_ ); // wieder einhaegen } } @@ -918,8 +1006,17 @@ void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, String aLibName, { if ( !bCheck || ( rDocument != m_aCurDocument || aLibName != m_aCurLibName ) ) { + ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() ); + + if ( pListener ) + pListener->removeContainerListener( m_aCurDocument, m_aCurLibName ); + m_aCurDocument = rDocument; + + pListener->addContainerListener( m_aCurDocument, aLibName ); + m_aCurLibName = aLibName; + if ( bUpdateWindows ) UpdateWindows(); diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src index f0c0727cd22f..556211f690af 100644 --- a/basctl/source/basicide/basidesh.src +++ b/basctl/source/basicide/basidesh.src @@ -636,6 +636,22 @@ String RID_STR_TRANSLATION_DEFAULT { Text [ en-US ] = "[Default Language]" ; }; +String RID_STR_DOCUMENT_OBJECTS +{ + Text [ en-US ] = "Document Objects" ; +}; +String RID_STR_USERFORMS +{ + Text [ en-US ] = "Forms" ; +}; +String RID_STR_NORMAL_MODULES +{ + Text [ en-US ] = "Modules" ; +}; +String RID_STR_CLASS_MODULES +{ + Text [ en-US ] = "Class Modules" ; +}; String RID_STR_DLGIMP_CLASH_RENAME diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index d2672f39928f..3604866b4202 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -191,7 +191,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); if ( pIDEShell ) { - IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rOldName, BASICIDE_TYPE_MODULE, FALSE ); + IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rNewName, BASICIDE_TYPE_MODULE, TRUE ); if ( pWin ) { // set new name in window diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index a37eb752e2ea..0709fe38cbe2 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -50,10 +50,51 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/componentcontext.hxx> +#include <map> +#include <com/sun/star/script/ModuleType.hpp> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XNamed.hpp> using namespace ::com::sun::star::uno; using namespace ::com::sun::star; +void ModuleInfoHelper::getObjectName( const uno::Reference< container::XNameContainer >& rLib, const String& rModName, String& rObjName ) +{ + try + { + uno::Reference< script::XVBAModuleInfo > xVBAModuleInfo( rLib, uno::UNO_QUERY ); + if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( rModName ) ) + { + script::ModuleInfo aModuleInfo = xVBAModuleInfo->getModuleInfo( rModName ); + uno::Any aObject( aModuleInfo.ModuleObject ); + uno::Reference< lang::XServiceInfo > xServiceInfo( aObject, uno::UNO_QUERY ); + if( xServiceInfo.is() && xServiceInfo->supportsService( rtl::OUString::createFromAscii( "ooo.vba.excel.Worksheet" ) ) ) + { + uno::Reference< container::XNamed > xNamed( aObject, uno::UNO_QUERY ); + if( xNamed.is() ) + rObjName = xNamed->getName(); + } + } + } + catch( uno::Exception& ) + { + } +} + +sal_Int32 ModuleInfoHelper::getModuleType( const uno::Reference< container::XNameContainer >& rLib, const String& rModName ) +{ + sal_Int32 nType = com::sun::star::script::ModuleType::NORMAL; + uno::Reference< script::XVBAModuleInfo > xVBAModuleInfo( rLib, uno::UNO_QUERY ); + if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( rModName ) ) + { + script::ModuleInfo aModuleInfo = xVBAModuleInfo->getModuleInfo( rModName ); + nType = aModuleInfo.ModuleType; + } + return nType; +} BasicEntry::~BasicEntry() { @@ -88,20 +129,22 @@ BasicEntryDescriptor::BasicEntryDescriptor() { } -BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, BasicEntryType eType ) +BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, BasicEntryType eType ) :m_aDocument( rDocument ) ,m_eLocation( eLocation ) ,m_aLibName( rLibName ) + ,m_aLibSubName( rLibSubName ) ,m_aName( rName ) ,m_eType( eType ) { OSL_ENSURE( m_aDocument.isValid(), "BasicEntryDescriptor::BasicEntryDescriptor: invalid document!" ); } -BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, const String& rMethodName, BasicEntryType eType ) +BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, const String& rMethodName, BasicEntryType eType ) :m_aDocument( rDocument ) ,m_eLocation( eLocation ) ,m_aLibName( rLibName ) + ,m_aLibSubName( rLibSubName ) ,m_aName( rName ) ,m_aMethodName( rMethodName ) ,m_eType( eType ) @@ -117,6 +160,7 @@ BasicEntryDescriptor::BasicEntryDescriptor( const BasicEntryDescriptor& rDesc ) :m_aDocument( rDesc.m_aDocument ) ,m_eLocation( rDesc.m_eLocation ) ,m_aLibName( rDesc.m_aLibName ) + ,m_aLibSubName( rDesc.m_aLibSubName ) ,m_aName( rDesc.m_aName ) ,m_aMethodName( rDesc.m_aMethodName ) ,m_eType( rDesc.m_eType ) @@ -128,6 +172,7 @@ BasicEntryDescriptor& BasicEntryDescriptor::operator=( const BasicEntryDescripto m_aDocument = rDesc.m_aDocument; m_eLocation = rDesc.m_eLocation; m_aLibName = rDesc.m_aLibName; + m_aLibSubName = rDesc.m_aLibSubName; m_aName = rDesc.m_aName; m_aMethodName = rDesc.m_aMethodName; m_eType = rDesc.m_eType; @@ -140,6 +185,7 @@ bool BasicEntryDescriptor::operator==( const BasicEntryDescriptor& rDesc ) const return m_aDocument == rDesc.m_aDocument && m_eLocation == rDesc.m_eLocation && m_aLibName == rDesc.m_aLibName && + m_aLibSubName == rDesc.m_aLibSubName && m_aName == rDesc.m_aName && m_aMethodName == rDesc.m_aMethodName && m_eType == rDesc.m_eType; @@ -284,41 +330,46 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const { try { - // get a sorted list of module names - Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName ); - sal_Int32 nModCount = aModNames.getLength(); - const ::rtl::OUString* pModNames = aModNames.getConstArray(); - - for ( sal_Int32 i = 0 ; i < nModCount ; i++ ) + if( rDocument.isInVBAMode() ) + ImpCreateLibSubEntriesInVBAMode( pLibRootEntry, rDocument, rLibName ); + else { - String aModName = pModNames[ i ]; - SvLBoxEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE ); - if ( !pModuleEntry ) - pModuleEntry = AddEntry( - aModName, - Image( IDEResId( RID_IMG_MODULE ) ), - Image( IDEResId( RID_IMG_MODULE_HC ) ), - pLibRootEntry, false, - std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); + // get a sorted list of module names + Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName ); + sal_Int32 nModCount = aModNames.getLength(); + const ::rtl::OUString* pModNames = aModNames.getConstArray(); - // methods - if ( nMode & BROWSEMODE_SUBS ) + for ( sal_Int32 i = 0 ; i < nModCount ; i++ ) { - Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName ); - sal_Int32 nCount = aNames.getLength(); - const ::rtl::OUString* pNames = aNames.getConstArray(); - - for ( sal_Int32 j = 0 ; j < nCount ; j++ ) + String aModName = pModNames[ i ]; + SvLBoxEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE ); + if ( !pModuleEntry ) + pModuleEntry = AddEntry( + aModName, + Image( IDEResId( RID_IMG_MODULE ) ), + Image( IDEResId( RID_IMG_MODULE_HC ) ), + pLibRootEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); + + // methods + if ( nMode & BROWSEMODE_SUBS ) { - String aName = pNames[ j ]; - SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); - if ( !pEntry ) - pEntry = AddEntry( - aName, - Image( IDEResId( RID_IMG_MACRO ) ), - Image( IDEResId( RID_IMG_MACRO_HC ) ), - pModuleEntry, false, - std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) ); + Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName ); + sal_Int32 nCount = aNames.getLength(); + const ::rtl::OUString* pNames = aNames.getConstArray(); + + for ( sal_Int32 j = 0 ; j < nCount ; j++ ) + { + String aName = pNames[ j ]; + SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); + if ( !pEntry ) + pEntry = AddEntry( + aName, + Image( IDEResId( RID_IMG_MACRO ) ), + Image( IDEResId( RID_IMG_MACRO_HC ) ), + pModuleEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) ); + } } } } @@ -365,6 +416,140 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const } } +void BasicTreeListBox::ImpCreateLibSubEntriesInVBAMode( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName ) +{ + + ::std::vector< std::pair< BasicEntryType, ::rtl::OUString > > aEntries; + aEntries.push_back( ::std::make_pair( OBJ_TYPE_DOCUMENT_OBJECTS, String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ); + aEntries.push_back( ::std::make_pair( OBJ_TYPE_USERFORMS, String( IDEResId( RID_STR_USERFORMS ) ) ) ); + aEntries.push_back( ::std::make_pair( OBJ_TYPE_NORMAL_MODULES, String( IDEResId( RID_STR_NORMAL_MODULES ) ) ) ); + aEntries.push_back( ::std::make_pair( OBJ_TYPE_CLASS_MODULES, String( IDEResId( RID_STR_CLASS_MODULES ) ) ) ); + + ::std::vector< std::pair< BasicEntryType, ::rtl::OUString > >::iterator iter; + for( iter = aEntries.begin(); iter != aEntries.end(); ++iter ) + { + BasicEntryType eType = iter->first; + ::rtl::OUString aEntryName = iter->second; + SvLBoxEntry* pLibSubRootEntry = FindEntry( pLibRootEntry, aEntryName, eType ); + if( pLibSubRootEntry ) + { + SetEntryBitmaps( pLibSubRootEntry, Image( IDEResId( RID_IMG_MODLIB ) ), Image( IDEResId( RID_IMG_MODLIB_HC ) ) ); + if ( IsExpanded( pLibSubRootEntry ) ) + ImpCreateLibSubSubEntriesInVBAMode( pLibSubRootEntry, rDocument, rLibName ); + } + else + { + pLibSubRootEntry = AddEntry( + aEntryName, + Image( IDEResId( RID_IMG_MODLIB ) ), + Image( IDEResId( RID_IMG_MODLIB_HC ) ), + pLibRootEntry, true, + std::auto_ptr< BasicEntry >( new BasicEntry( eType ) ) ); + } + } +} + +void BasicTreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvLBoxEntry* pLibSubRootEntry, const ScriptDocument& rDocument, const String& rLibName ) +{ + uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, rLibName ); + if( !xLib.is() ) + return; + + try + { + // get a sorted list of module names + Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName ); + sal_Int32 nModCount = aModNames.getLength(); + const ::rtl::OUString* pModNames = aModNames.getConstArray(); + + BasicEntryDescriptor aDesc( GetEntryDescriptor( pLibSubRootEntry ) ); + BasicEntryType eCurrentType( aDesc.GetType() ); + + for ( sal_Int32 i = 0 ; i < nModCount ; i++ ) + { + String aModName = pModNames[ i ]; + BasicEntryType eType = OBJ_TYPE_UNKNOWN; + switch( ModuleInfoHelper::getModuleType( xLib, aModName ) ) + { + case script::ModuleType::DOCUMENT: + eType = OBJ_TYPE_DOCUMENT_OBJECTS; + break; + case script::ModuleType::FORM: + eType = OBJ_TYPE_USERFORMS; + break; + case script::ModuleType::NORMAL: + eType = OBJ_TYPE_NORMAL_MODULES; + break; + case script::ModuleType::CLASS: + eType = OBJ_TYPE_CLASS_MODULES; + break; + } + if( eType != eCurrentType ) + continue; + + // display a nice friendly name in the ObjectModule tab, + // combining the objectname and module name, e.g. Sheet1 ( Financials ) + String aEntryName( aModName ); + if( eType == OBJ_TYPE_DOCUMENT_OBJECTS ) + { + String sObjName; + ModuleInfoHelper::getObjectName( xLib, aModName, sObjName ); + if( sObjName.Len() ) + { + aEntryName.AppendAscii(" (").Append(sObjName).AppendAscii(")"); + } + } + SvLBoxEntry* pModuleEntry = FindEntry( pLibSubRootEntry, aEntryName, OBJ_TYPE_MODULE ); + if ( !pModuleEntry ) + pModuleEntry = AddEntry( + aEntryName, + Image( IDEResId( RID_IMG_MODULE ) ), + Image( IDEResId( RID_IMG_MODULE_HC ) ), + pLibSubRootEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); + + // methods + if ( nMode & BROWSEMODE_SUBS ) + { + Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName ); + sal_Int32 nCount = aNames.getLength(); + const ::rtl::OUString* pNames = aNames.getConstArray(); + + for ( sal_Int32 j = 0 ; j < nCount ; j++ ) + { + String aName = pNames[ j ]; + SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); + if ( !pEntry ) + pEntry = AddEntry( + aName, + Image( IDEResId( RID_IMG_MACRO ) ), + Image( IDEResId( RID_IMG_MACRO_HC ) ), + pModuleEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) ); + } + } + } + } + catch ( const container::NoSuchElementException& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +SvLBoxEntry* BasicTreeListBox::ImpFindEntry( SvLBoxEntry* pParent, const String& rText ) +{ + ULONG nRootPos = 0; + SvLBoxEntry* pEntry = pParent ? FirstChild( pParent ) : GetEntry( nRootPos ); + while ( pEntry ) + { + if ( GetEntryText( pEntry ) == rText ) + return pEntry; + + pEntry = pParent ? NextSibling( pEntry ) : GetEntry( ++nRootPos ); + } + return 0; +} + void BasicTreeListBox::onDocumentCreated( const ScriptDocument& /*_rDocument*/ ) { UpdateEntries(); @@ -477,10 +662,11 @@ long BasicTreeListBox::ExpandingHdl() if ( aDocument.isAlive() ) { String aLibName( aDesc.GetLibName() ); + String aLibSubName( aDesc.GetLibSubName() ); String aName( aDesc.GetName() ); String aMethodName( aDesc.GetMethodName() ); - if ( aLibName.Len() && !aName.Len() && !aMethodName.Len() ) + if ( aLibName.Len() && !aLibSubName.Len() && !aName.Len() && !aMethodName.Len() ) { // check password, if library is password protected and not verified ::rtl::OUString aOULibName( aLibName ); @@ -633,7 +819,7 @@ void BasicTreeListBox::SetCurrentEntry( BasicEntryDescriptor& rDesc ) aDesc = BasicEntryDescriptor( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_USER, String::CreateFromAscii( "Standard" ), - String::CreateFromAscii( "." ), OBJ_TYPE_UNKNOWN ); + String(), String::CreateFromAscii( "." ), OBJ_TYPE_UNKNOWN ); } ScriptDocument aDocument( aDesc.GetDocument() ); OSL_ENSURE( aDocument.isValid(), "BasicTreeListBox::SetCurrentEntry: invalid document!" ); @@ -650,14 +836,24 @@ void BasicTreeListBox::SetCurrentEntry( BasicEntryDescriptor& rDesc ) if ( pLibEntry ) { pCurEntry = pLibEntry; + String aLibSubName( aDesc.GetLibSubName() ); + if( aLibSubName.Len() ) + { + Expand( pLibEntry ); + SvLBoxEntry* pLibSubEntry = ImpFindEntry( pLibEntry, aLibSubName ); + if( pLibSubEntry ) + { + pCurEntry = pLibSubEntry; + } + } String aName( aDesc.GetName() ); if ( aName.Len() ) { - Expand( pLibEntry ); + Expand( pCurEntry ); BasicEntryType eType = OBJ_TYPE_MODULE; if ( aDesc.GetType() == OBJ_TYPE_DIALOG ) eType = OBJ_TYPE_DIALOG; - SvLBoxEntry* pEntry = FindEntry( pLibEntry, aName, eType ); + SvLBoxEntry* pEntry = FindEntry( pCurEntry, aName, eType ); if ( pEntry ) { pCurEntry = pEntry; diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx index 401282f7e1bf..4b4d42f477d0 100644 --- a/basctl/source/basicide/bastype2.hxx +++ b/basctl/source/basicide/bastype2.hxx @@ -39,7 +39,7 @@ #include <sbxitem.hxx> #include "basobj.hxx" -enum BasicEntryType { OBJ_TYPE_UNKNOWN, OBJ_TYPE_DOCUMENT, OBJ_TYPE_LIBRARY, OBJ_TYPE_MODULE, OBJ_TYPE_DIALOG, OBJ_TYPE_METHOD }; +enum BasicEntryType { OBJ_TYPE_UNKNOWN, OBJ_TYPE_DOCUMENT, OBJ_TYPE_LIBRARY, OBJ_TYPE_MODULE, OBJ_TYPE_DIALOG, OBJ_TYPE_METHOD, OBJ_TYPE_DOCUMENT_OBJECTS, OBJ_TYPE_USERFORMS, OBJ_TYPE_NORMAL_MODULES, OBJ_TYPE_CLASS_MODULES }; #define BROWSEMODE_MODULES 0x01 #define BROWSEMODE_SUBS 0x02 @@ -98,14 +98,15 @@ class BasicEntryDescriptor ScriptDocument m_aDocument; LibraryLocation m_eLocation; String m_aLibName; + String m_aLibSubName; // for vba entry: Document Objects, Class Modules, Forms and Normal Modules String m_aName; String m_aMethodName; BasicEntryType m_eType; public: BasicEntryDescriptor(); - BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, BasicEntryType eType ); - BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, const String& rMethodName, BasicEntryType eType ); + BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, BasicEntryType eType ); + BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, const String& rMethodName, BasicEntryType eType ); virtual ~BasicEntryDescriptor(); BasicEntryDescriptor( const BasicEntryDescriptor& rDesc ); @@ -122,6 +123,9 @@ public: const String& GetLibName() const { return m_aLibName; } void SetLibName( const String& aLibName ) { m_aLibName = aLibName; } + const String& GetLibSubName() const { return m_aLibSubName; } + void SetLibSubName( const String& aLibSubName ) { m_aLibSubName = aLibSubName; } + const String& GetName() const { return m_aName; } void SetName( const String& aName ) { m_aName = aName; } @@ -161,6 +165,9 @@ protected: void ImpCreateLibEntries( SvLBoxEntry* pShellRootEntry, const ScriptDocument& rDocument, LibraryLocation eLocation ); void ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName ); + void ImpCreateLibSubEntriesInVBAMode( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName ); + void ImpCreateLibSubSubEntriesInVBAMode( SvLBoxEntry* pLibSubRootEntry, const ScriptDocument& rDocument, const String& rLibName ); + SvLBoxEntry* ImpFindEntry( SvLBoxEntry* pParent, const String& rText ); // DocumentEventListener virtual void onDocumentCreated( const ScriptDocument& _rDocument ); diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index a0320d89e88a..de9eff56ca24 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -131,6 +131,14 @@ void __EXPORT BasicTreeListBox::RequestingChilds( SvLBoxEntry* pEntry ) } } } + else if ( eType == OBJ_TYPE_DOCUMENT_OBJECTS + || eType == OBJ_TYPE_USERFORMS + || eType == OBJ_TYPE_NORMAL_MODULES + || eType == OBJ_TYPE_CLASS_MODULES ) + { + String aLibName( aDesc.GetLibName() ); + ImpCreateLibSubSubEntriesInVBAMode( pEntry, aDocument, aLibName ); + } else { DBG_ERROR( "BasicTreeListBox::RequestingChilds: Unknown Type!" ); } @@ -201,6 +209,7 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry ) } SbxVariable* pVar = 0; + bool bDocumentObjects = false; if ( aEntries.Count() ) { for ( USHORT n = 0; n < aEntries.Count(); n++ ) @@ -223,6 +232,12 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry ) case OBJ_TYPE_MODULE: { DBG_ASSERT( pVar && pVar->IsA( TYPE(StarBASIC) ), "FindVariable: Ungueltiges Basic" ); + // extract the module name from the string like "Sheet1 (Example1)" + if( bDocumentObjects ) + { + sal_uInt16 nIndex = 0; + aName = aName.GetToken( 0, ' ', nIndex ); + } pVar = ((StarBASIC*)pVar)->FindModule( aName ); } break; @@ -237,6 +252,15 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry ) // sbx dialogs removed } break; + case OBJ_TYPE_DOCUMENT_OBJECTS: + bDocumentObjects = true; + case OBJ_TYPE_USERFORMS: + case OBJ_TYPE_NORMAL_MODULES: + case OBJ_TYPE_CLASS_MODULES: + { + // skip, to find the child entry. + continue; + } default: { DBG_ERROR( "FindVariable: Unbekannter Typ!" ); @@ -257,12 +281,13 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry ) ScriptDocument aDocument( ScriptDocument::getApplicationScriptDocument() ); LibraryLocation eLocation = LIBRARY_LOCATION_UNKNOWN; String aLibName; + String aLibSubName; String aName; String aMethodName; BasicEntryType eType = OBJ_TYPE_UNKNOWN; if ( !pEntry ) - return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType ); + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType ); EntryArray aEntries; @@ -329,6 +354,15 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry ) eType = pBE->GetType(); } break; + case OBJ_TYPE_DOCUMENT_OBJECTS: + case OBJ_TYPE_USERFORMS: + case OBJ_TYPE_NORMAL_MODULES: + case OBJ_TYPE_CLASS_MODULES: + { + aLibSubName = GetEntryText( pLE ); + eType = pBE->GetType(); + } + break; default: { DBG_ERROR( "GetEntryDescriptor: Unbekannter Typ!" ); @@ -342,7 +376,7 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry ) } } - return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType ); + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType ); } USHORT BasicTreeListBox::ConvertType( BasicEntryType eType ) @@ -424,6 +458,14 @@ bool BasicTreeListBox::IsValidEntry( SvLBoxEntry* pEntry ) bIsValid = BasicIDE::HasMethod( aDocument, aLibName, aName, aMethodName ); } break; + case OBJ_TYPE_DOCUMENT_OBJECTS: + case OBJ_TYPE_USERFORMS: + case OBJ_TYPE_NORMAL_MODULES: + case OBJ_TYPE_CLASS_MODULES: + { + bIsValid = true; + } + break; default: ; } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index af42503a5dae..150e10a5a76f 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/script/XLibraryContainer2.hpp> #endif #include <com/sun/star/script/XLibraryContainerPassword.hpp> +#include <com/sun/star/script/ModuleType.hpp> using namespace ::com::sun::star::uno; using namespace ::com::sun::star; @@ -584,8 +585,32 @@ void __EXPORT BasicIDETabBar::Command( const CommandEvent& rCEvt ) aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE ); aPopup.RemoveDisabledEntries(); } + if ( aDocument.isInVBAMode() ) + { + // disable to delete or remove object modules in IDE + BasicManager* pBasMgr = aDocument.getBasicManager(); + if ( pBasMgr ) + { + StarBASIC* pBasic = pBasMgr->GetLib( aOULibName ); + if( pBasic ) + { + IDEWindowTable& aIDEWindowTable = pIDEShell->GetIDEWindowTable(); + IDEBaseWindow* pWin = aIDEWindowTable.Get( GetCurPageId() ); + if( pWin && pWin->ISA( ModulWindow ) ) + { + SbModule* pActiveModule = (SbModule*)pBasic->FindModule( pWin->GetName() ); + if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) ) + { + aPopup.EnableItem( SID_BASICIDE_DELETECURRENT, FALSE ); + aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE ); + } + } + } + } + } } + SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL; SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL; if ( pDispatcher ) diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index f3e41e60d34b..41a5fa488950 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -382,7 +382,15 @@ SbMethod* MacroChooser::CreateMacro() SbModule* pModule = 0; String aModName( aDesc.GetName() ); if ( aModName.Len() ) + { + // extract the module name from the string like "Sheet1 (Example1)" + if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) + { + sal_uInt16 nIndex = 0; + aModName = aModName.GetToken( 0, ' ', nIndex ); + } pModule = pBasic->FindModule( aModName ); + } else if ( pBasic->GetModules()->Count() ) pModule = (SbModule*)pBasic->GetModules()->Get( 0 ); @@ -710,6 +718,12 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) BasicManager* pBasMgr = aDocument.getBasicManager(); String aLib( aDesc.GetLibName() ); String aMod( aDesc.GetName() ); + // extract the module name from the string like "Sheet1 (Example1)" + if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) + { + sal_uInt16 nIndex = 0; + aMod = aMod.GetToken( 0, ' ', nIndex ); + } String aSub( aDesc.GetMethodName() ); SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLib, aMod, aSub, String() ); if ( pButton == &aEditButton ) diff --git a/basctl/source/basicide/makefile.mk b/basctl/source/basicide/makefile.mk index 6a08349b0979..62c4755112d1 100644 --- a/basctl/source/basicide/makefile.mk +++ b/basctl/source/basicide/makefile.mk @@ -90,11 +90,7 @@ $(INCCOM)$/dllname.hxx: makefile.mk $(RM) $@ echo \#define DLL_NAME \"libbasctl$(DLLPOSTFIX)$(DLLPOST)\" >$@ .ELSE -.IF "$(USE_SHELL)"!="4nt" echo \#define DLL_NAME \"basctl$(DLLPOSTFIX)$(DLLPOST)\" >$@ -.ELSE # "$(USE_SHELL)"!="4nt" - echo #define DLL_NAME "basctl$(DLLPOSTFIX)$(DLLPOST)" >$@ -.ENDIF # "$(USE_SHELL)"!="4nt" .ENDIF $(SLO)$/basiclib.obj : $(INCCOM)$/dllname.hxx diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 478d56546f41..0f66a6ebe120 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -84,7 +84,7 @@ BOOL __EXPORT ExtBasicTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& if ( pEntry ) { USHORT nDepth = GetModel()->GetDepth( pEntry ); - if ( nDepth == 2 ) + if ( nDepth >= 2 ) { BasicEntryDescriptor aDesc( GetEntryDescriptor( pEntry ) ); ScriptDocument aDocument( aDesc.GetDocument() ); @@ -162,7 +162,7 @@ DragDropMode __EXPORT ExtBasicTreeListBox::NotifyStartDrag( TransferDataContaine if ( pEntry ) { USHORT nDepth = GetModel()->GetDepth( pEntry ); - if ( nDepth == 2 ) + if ( nDepth >= 2 ) { nMode_ = SV_DRAGDROP_CTRL_COPY; BasicEntryDescriptor aDesc( GetEntryDescriptor( pEntry ) ); @@ -210,7 +210,7 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry ) // don't drop on a library, which is not loaded, readonly or password protected // or which already has a module/dialog with this name - if ( bValid && ( nDepth == 1 || nDepth == 2 ) ) + if ( bValid && ( nDepth > 0 ) ) { // get source module/dialog name BasicEntryDescriptor aSourceDesc( GetEntryDescriptor( pSelected ) ); @@ -348,7 +348,7 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyCopyingMoving( SvLBoxEntry* pTarget, Sv rpNewParent = pTarget; rNewChildPos = 0; } - else if ( nDepth == 2 ) + else if ( nDepth >= 2 ) { // Target = Modul/Dialog => Modul/Dialog unter das uebergeordnete Basic haengen... rpNewParent = GetParent( pTarget ); @@ -623,20 +623,29 @@ void ObjectPage::CheckButtons() { // enable/disable edit button SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) ); + ScriptDocument aDocument( aDesc.GetDocument() ); + ::rtl::OUString aOULibName( aDesc.GetLibName() ); + String aLibSubName( aDesc.GetLibSubName() ); + sal_Bool bVBAEnabled = aDocument.isInVBAMode(); + USHORT nMode = aBasicBox.GetMode(); + USHORT nDepth = pCurEntry ? aBasicBox.GetModel()->GetDepth( pCurEntry ) : 0; - if ( nDepth == 2 ) + if ( nDepth >= 2 ) + { + if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( nDepth == 2 ) ) + aEditButton.Disable(); + else aEditButton.Enable(); + } else aEditButton.Disable(); // enable/disable new module/dialog buttons - BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) ); LibraryLocation eLocation( aDesc.GetLocation() ); BOOL bReadOnly = FALSE; - if ( nDepth == 1 || nDepth == 2 ) + if ( nDepth > 0 ) { - ScriptDocument aDocument( aDesc.GetDocument() ); - ::rtl::OUString aOULibName( aDesc.GetLibName() ); Reference< script::XLibraryContainer2 > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryReadOnly( aOULibName ) ) || @@ -657,8 +666,13 @@ void ObjectPage::CheckButtons() } // enable/disable delete button - if ( nDepth == 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE ) + if ( nDepth >= 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE ) + { + if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( ( nDepth == 2 ) || aLibSubName.Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) ) + aDelButton.Disable(); + else aDelButton.Enable(); + } else aDelButton.Disable(); } @@ -685,13 +699,20 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton ) SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL; SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); DBG_ASSERT( pCurEntry, "Entry?!" ); - if ( aBasicBox.GetModel()->GetDepth( pCurEntry ) == 2 ) + if ( aBasicBox.GetModel()->GetDepth( pCurEntry ) >= 2 ) { BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) ); if ( pDispatcher ) { + String aModName( aDesc.GetName() ); + // extract the module name from the string like "Sheet1 (Example1)" + if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) + { + sal_uInt16 nIndex = 0; + aModName = aModName.GetToken( 0, ' ', nIndex ); + } SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDesc.GetDocument(), aDesc.GetLibName(), - aDesc.GetName(), aBasicBox.ConvertType( aDesc.GetType() ) ); + aModName, aBasicBox.ConvertType( aDesc.GetType() ) ); pDispatcher->Execute( SID_BASICIDE_SHOWSBX, SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); } } @@ -973,14 +994,14 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument, try { ::rtl::OUString sModuleCode; + // the module has existed + if( rDocument.hasModule( aLibName, aModName ) ) + return NULL; rDocument.createModule( aLibName, aModName, bMain, sModuleCode ); BasicManager* pBasMgr = rDocument.getBasicManager(); - if ( pBasMgr ) - { - StarBASIC* pBasic = pBasMgr->GetLib( aLibName ); + StarBASIC* pBasic = pBasMgr? pBasMgr->GetLib( aLibName ) : 0; if ( pBasic ) pModule = pBasic->FindModule( aModName ); - } SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BASICIDE_TYPE_MODULE ); BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL; @@ -1002,14 +1023,27 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument, { if ( !rBasicBox.IsExpanded( pLibEntry ) ) rBasicBox.Expand( pLibEntry ); - SvLBoxEntry* pEntry = rBasicBox.FindEntry( pLibEntry, aModName, OBJ_TYPE_MODULE ); + SvLBoxEntry* pSubRootEntry = pLibEntry; + if( pBasic && rDocument.isInVBAMode() ) + { + // add the new module in the "Modules" entry + SvLBoxEntry* pLibSubEntry = rBasicBox.FindEntry( pLibEntry, String( IDEResId( RID_STR_NORMAL_MODULES ) ) , OBJ_TYPE_NORMAL_MODULES ); + if( pLibSubEntry ) + { + if( !rBasicBox.IsExpanded( pLibSubEntry ) ) + rBasicBox.Expand( pLibSubEntry ); + pSubRootEntry = pLibSubEntry; + } + } + + SvLBoxEntry* pEntry = rBasicBox.FindEntry( pSubRootEntry, aModName, OBJ_TYPE_MODULE ); if ( !pEntry ) { pEntry = rBasicBox.AddEntry( aModName, Image( IDEResId( RID_IMG_MODULE ) ), Image( IDEResId( RID_IMG_MODULE_HC ) ), - pLibEntry, false, + pSubRootEntry, false, std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" ); } diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index dd10a00e2bde..a8c6d24a3ff5 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -53,6 +53,8 @@ #include <com/sun/star/frame/XModel2.hpp> #include <com/sun/star/awt/XWindow2.hpp> #include <com/sun/star/document/XEmbeddedScripts.hpp> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/script/XVBACompat.hpp> /** === end UNO includes === **/ #include <sfx2/objsh.hxx> @@ -139,6 +141,9 @@ namespace basctl using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::document::XEventBroadcaster; using ::com::sun::star::document::XEmbeddedScripts; + using ::com::sun::star::script::ModuleInfo; + using ::com::sun::star::script::XVBAModuleInfo; + using ::com::sun::star::script::XVBACompat; /** === end UNO using === **/ namespace MacroExecMode = ::com::sun::star::document::MacroExecMode; namespace FrameSearchFlag = ::com::sun::star::frame::FrameSearchFlag; @@ -272,6 +277,7 @@ namespace basctl // versions with the same signature/semantics as in ScriptDocument itself bool isReadOnly() const; + bool isInVBAMode() const; BasicManager* getBasicManager() const; Reference< XModel > @@ -444,6 +450,20 @@ namespace basctl return bIsReadOnly; } + bool ScriptDocument_Impl::isInVBAMode() const + { + bool bResult = false; +#ifdef FUTURE_VBA_CWS + if ( !isApplication() ) + { + Reference< XVBACompat > xVBACompat( getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); + if ( xVBACompat.is() ) + bResult = xVBACompat->getVBACompatModeOn(); + } +#endif + return bResult; + } + //-------------------------------------------------------------------- BasicManager* ScriptDocument_Impl::getBasicManager() const { @@ -671,6 +691,16 @@ namespace basctl } // insert element by new name in container + else if ( _eType == E_SCRIPTS ) + { + Reference< XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY ); + if ( xVBAModuleInfo->hasModuleInfo( _rOldName ) ) + { + ModuleInfo sModuleInfo = xVBAModuleInfo->getModuleInfo( _rOldName ); + xVBAModuleInfo->removeModuleInfo( _rOldName ); + xVBAModuleInfo->insertModuleInfo( _rNewName, sModuleInfo ); + } + } xLib->insertByName( _rNewName, aElement ); return true; } @@ -735,7 +765,6 @@ namespace basctl Reference< XNameContainer > xLib( getOrCreateLibrary( E_SCRIPTS, _rLibName ), UNO_QUERY_THROW ); if ( !xLib->hasByName( _rModName ) ) return false; - xLib->replaceByName( _rModName, makeAny( _rModuleCode ) ); return true; } @@ -1351,6 +1380,11 @@ namespace basctl return m_pImpl->isApplication(); } + bool ScriptDocument::isInVBAMode() const + { + return m_pImpl->isInVBAMode(); + } + //-------------------------------------------------------------------- BasicManager* ScriptDocument::getBasicManager() const { diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index cf21d3488dd3..07bc2dfa3149 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -46,6 +46,7 @@ #include <com/sun/star/io/XInputStreamProvider.hpp> #endif +#include <com/sun/star/container/XContainerListener.hpp> //---------------------------------------------------------------------------- @@ -105,6 +106,8 @@ friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const Strin BOOL m_bAppBasicModified; ::basctl::DocumentEventNotifier m_aNotifier; +friend class ContainerListenerImpl; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xLibListener; #if _SOLAR__PRIVATE void Init(); diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx index c9981001e456..bc588fccaf14 100644 --- a/basctl/source/inc/bastypes.hxx +++ b/basctl/source/inc/bastypes.hxx @@ -328,5 +328,13 @@ BOOL QueryDelModule( const String& rName, Window* pParent = 0 ); BOOL QueryDelLib( const String& rName, BOOL bRef = FALSE, Window* pParent = 0 ); BOOL QueryPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xLibContainer, const String& rLibName, String& rPassword, BOOL bRepeat = FALSE, BOOL bNewTitle = FALSE ); - +class ModuleInfoHelper +{ +ModuleInfoHelper(); +ModuleInfoHelper(const ModuleInfoHelper&); +ModuleInfoHelper& operator = (const ModuleInfoHelper&); +public: + static void getObjectName( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rLib, const String& rModName, String& rObjName ); + static sal_Int32 getModuleType( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rLib, const String& rModName ); +}; #endif // _BASTYPES_HXX diff --git a/basctl/source/inc/scriptdocument.hxx b/basctl/source/inc/scriptdocument.hxx index 34d1a72963ce..9439c05f7249 100644 --- a/basctl/source/inc/scriptdocument.hxx +++ b/basctl/source/inc/scriptdocument.hxx @@ -212,6 +212,7 @@ namespace basctl */ bool isAlive() const; + bool isInVBAMode() const; /// returns the BasicManager associated with this instance BasicManager* getBasicManager() const; diff --git a/basctl/uiconfig/basicide/accelerator/en-GB/default.xml b/basctl/uiconfig/basicide/accelerator/en-GB/default.xml deleted file mode 100644 index 94d5e84a8413..000000000000 --- a/basctl/uiconfig/basicide/accelerator/en-GB/default.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE accel:acceleratorlist PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "accelerator.dtd"> -<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink"> - <accel:item accel:code="KEY_F5" xlink:href=".uno:RunBasic"/> - <accel:item accel:code="KEY_F5" accel:shift="true" xlink:href=".uno:BasicStop"/> - <accel:item accel:code="KEY_F7" xlink:href=".uno:AddWatch"/> - <accel:item accel:code="KEY_F8" xlink:href=".uno:BasicStepInto"/> - <accel:item accel:code="KEY_F8" accel:shift="true" xlink:href=".uno:BasicStepOver"/> - <accel:item accel:code="KEY_F9" xlink:href=".uno:ToggleBreakPoint"/> - <accel:item accel:code="KEY_F9" accel:shift="true" xlink:href=".uno:ToggleBreakPointEnabled"/> -</accel:acceleratorlist> diff --git a/basctl/uiconfig/basicide/accelerator/en-US/default.xml b/basctl/uiconfig/basicide/accelerator/en-US/default.xml deleted file mode 100644 index 94d5e84a8413..000000000000 --- a/basctl/uiconfig/basicide/accelerator/en-US/default.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE accel:acceleratorlist PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "accelerator.dtd"> -<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink"> - <accel:item accel:code="KEY_F5" xlink:href=".uno:RunBasic"/> - <accel:item accel:code="KEY_F5" accel:shift="true" xlink:href=".uno:BasicStop"/> - <accel:item accel:code="KEY_F7" xlink:href=".uno:AddWatch"/> - <accel:item accel:code="KEY_F8" xlink:href=".uno:BasicStepInto"/> - <accel:item accel:code="KEY_F8" accel:shift="true" xlink:href=".uno:BasicStepOver"/> - <accel:item accel:code="KEY_F9" xlink:href=".uno:ToggleBreakPoint"/> - <accel:item accel:code="KEY_F9" accel:shift="true" xlink:href=".uno:ToggleBreakPointEnabled"/> -</accel:acceleratorlist> diff --git a/basctl/util/basctl.map b/basctl/util/basctl.map index 6b132e93cc3d..80359606ccc8 100755 --- a/basctl/util/basctl.map +++ b/basctl/util/basctl.map @@ -1,4 +1,4 @@ -BASCTL_1.0 { +UDK_3_0_0 { global: basicide_choose_macro; basicide_macro_organizer; diff --git a/crashrep/prj/d.lst b/crashrep/prj/d.lst index c7f78c8ca0c7..a53aacc4659c 100755 --- a/crashrep/prj/d.lst +++ b/crashrep/prj/d.lst @@ -1,4 +1,3 @@ ..\%__SRC%\bin\soreport.exe %_DEST%\bin%_EXT%\crashrep.exe ..\%__SRC%\bin\soreport.exe.manifest %_DEST%\bin%_EXT%\crashrep.exe.manifest -..\%__SRC%\bin\crash_report.bin %_DEST%\bin%_EXT%\crash_report.bin -..\%__SRC%\misc\crash_report.sh %_DEST%\bin%_EXT%\crash_report +..\%__SRC%\bin\crashrep %_DEST%\bin%_EXT%\crashrep diff --git a/crashrep/source/all/crashrep.ulf b/crashrep/source/all/crashrep.ulf index 4bc69015cb1d..2de1753918d2 100644 --- a/crashrep/source/all/crashrep.ulf +++ b/crashrep/source/all/crashrep.ulf @@ -7,7 +7,7 @@ en-US = "Welcome to the %PRODUCTNAME% %PRODUCTVERSION% Error Report" [%WELCOME_BODY1%] -en-US = "This error report tool gathers information about how %PRODUCTNAME% is working and sends it to Sun Microsystems to help improve future versions.\n\n" +en-US = "This error report tool gathers information about how %PRODUCTNAME% is working and sends it to Oracle to help improve future versions.\n\n" [%WELCOME_BODY2%] @@ -15,11 +15,11 @@ en-US = "It's easy - just send the report without any further effort on your par [%WELCOME_BODY3%] -en-US = "Customer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME% %PRODUCTVERSION% when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME% and will not be shared with third parties.\nFor more information on Sun Microsystems' privacy policy, visit\n" +en-US = "Customer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME% %PRODUCTVERSION% when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME% and will not be shared with third parties.\nFor more information on Oracle's privacy policy, visit\n" [%PRIVACY_URL%] -en-US = "http://www.sun.com/privacy/" +en-US = "http://www.oracle.com/html/services-privacy-policy.html" [%NEXT_BUTTON%] @@ -43,7 +43,7 @@ en-US = "An error occurred while running %PRODUCTNAME% %PRODUCTVERSION%" [%REPORT_BODY%] -en-US = "The %PRODUCTNAME% %PRODUCTVERSION% Error Report has gathered information that could help Sun Microsystems improve %PRODUCTNAME%.\nIn the spaces below, you can enter a title for your crash report and describe the action you were trying to carry out when the error occurred. Then click 'Send'.\n" +en-US = "The %PRODUCTNAME% %PRODUCTVERSION% Error Report has gathered information that could help Oracle improve %PRODUCTNAME%.\nIn the spaces below, you can enter a title for your crash report and describe the action you were trying to carry out when the error occurred. Then click 'Send'.\n" [%ENTER_TITLE%] @@ -51,7 +51,7 @@ en-US = "Which type of document (e.g. presentation) were you using when the erro [%ALLOW_CONTACT%] -en-US = "~I allow Sun Microsystems to contact me regarding this report." +en-US = "~I allow Oracle to contact me regarding this report." [%ENTER_EMAIL%] @@ -156,7 +156,7 @@ en-US = "Status: The error report has been sent successfully." [%ERROR_MSG_NOEMAILADDRESS%] -en-US = "You have marked the option 'I allow Sun Microsystems to contact me regarding this report.'\nPlease enter your e-mail address." +en-US = "You have marked the option 'I allow Oracle to contact me regarding this report.'\nPlease enter your e-mail address." [%MSG_CMDLINE_USAGE%] diff --git a/crashrep/source/unx/crash_report.sh b/crashrep/source/unx/crash_report.sh deleted file mode 100755 index 62c4bde5d578..000000000000 --- a/crashrep/source/unx/crash_report.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# 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. -# -#************************************************************************* - -#set -x - -# resolve installation directory -sd_cwd="`pwd`" -if [ -h "$0" ] ; then - sd_basename=`basename "$0"` - sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` - cd "`dirname "$0"`" - cd "`dirname "$sd_script"`" -else - cd "`dirname "$0"`" -fi - -sd_prog="`pwd`" -cd .. -sd_binary=`basename "$0"`".bin" -cd "$sd_cwd" -"$sd_prog/$sd_binary" "$@" - - diff --git a/crashrep/source/unx/makefile.mk b/crashrep/source/unx/makefile.mk index fb0465d329fc..8383f682443c 100755 --- a/crashrep/source/unx/makefile.mk +++ b/crashrep/source/unx/makefile.mk @@ -28,7 +28,7 @@ PRJ=..$/.. PRJNAME=crashrep -TARGET=crash_report.bin +TARGET=crashrep TARGETTYPE=CUI ENABLE_EXCEPTIONS=TRUE @@ -63,8 +63,6 @@ APP1STDLIBS+=-ldl -lnsl APP1STDLIBS+=-lsocket .ENDIF -UNIXTEXT = $(MISC)/crash_report.sh - .ENDIF # "$(ENABLE_CRASHDUMP)" != "" || "$(PRODUCT)" == "" # --- Targets ------------------------------------------------------ diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index d8e5878c3a8e..a87d7710f484 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -39,7 +39,6 @@ sal_Char __READONLY_DATA sHash[] = "#"; sal_Char __READONLY_DATA sFileScheme[] = INET_FILE_SCHEME; -sal_Char __READONLY_DATA sPortalFileScheme[] = "vnd.sun.star.wfs://"; sal_Char __READONLY_DATA sNewsSRVScheme[] = "news://"; // TODO news:// is nonsense sal_Char __READONLY_DATA sHTTPScheme[] = INET_HTTP_SCHEME; @@ -170,8 +169,7 @@ void SvxHyperlinkDocTp::GetCurentItemData ( String& aStrURL, String& aStrName, // get data from standard-fields aStrURL = GetCurrentURL(); - if( aStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - aStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) ) + if( aStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ) aStrURL=aEmptyStr; GetDataFromCommonFields( aStrName, aStrIntName, aStrFrame, eMode ); @@ -212,8 +210,7 @@ IMPL_LINK ( SvxHyperlinkDocTp, ClickFileopenHdl_Impl, void *, EMPTYARG ) com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0, GetParent() ); String aOldURL( GetCurrentURL() ); - if( aOldURL.EqualsIgnoreCaseAscii( sFileScheme, 0, sizeof( sFileScheme ) - 1 ) || - aOldURL.EqualsIgnoreCaseAscii( sPortalFileScheme, 0, sizeof( sFileScheme ) - 1 ) ) + if( aOldURL.EqualsIgnoreCaseAscii( sFileScheme, 0, sizeof( sFileScheme ) - 1 ) ) { aDlg.SetDisplayDirectory( aOldURL ); } @@ -250,15 +247,13 @@ IMPL_LINK ( SvxHyperlinkDocTp, ClickTargetHdl_Impl, void *, EMPTYARG ) if ( GetPathType ( maStrURL ) == Type_ExistsFile || maStrURL == aEmptyStr || maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) || maStrURL.SearchAscii( sHash ) == 0 ) { mpMarkWnd->SetError( LERR_NOERROR ); EnterWait(); - if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) ) + if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ) mpMarkWnd->RefreshTree ( aEmptyStr ); else mpMarkWnd->RefreshTree ( maStrURL ); @@ -305,8 +300,7 @@ IMPL_LINK ( SvxHyperlinkDocTp, TimeoutHdl_Impl, Timer *, EMPTYARG ) { EnterWait(); - if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) ) + if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ) mpMarkWnd->RefreshTree ( aEmptyStr ); else mpMarkWnd->RefreshTree ( maStrURL ); diff --git a/cui/source/options/dbregisterednamesconfig.cxx b/cui/source/options/dbregisterednamesconfig.cxx index 1c4f12b6eb75..38b9897ad4e9 100644 --- a/cui/source/options/dbregisterednamesconfig.cxx +++ b/cui/source/options/dbregisterednamesconfig.cxx @@ -38,8 +38,9 @@ #include <comphelper/processfactory.hxx> #include <svl/eitem.hxx> #include <svl/itemset.hxx> -#include <tools/diagnose_ex.h> +#include <unotools/pathoptions.hxx> #include <unotools/confignode.hxx> +#include <tools/diagnose_ex.h> //........................................................................ namespace svx diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index f1651b0bd1dd..b63d9afc647e 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -129,6 +129,13 @@ #include <svx/drawitem.hxx> #include <rtl/uri.hxx> +#ifdef LINUX +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#endif + using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; @@ -2195,6 +2202,28 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) if ( nPageId == RID_SVXPAGE_INET_MOZPLUGIN ) continue; #endif +#ifdef LINUX + // Disable Mozilla Plug-in tab-page on Linux if we find a + // globally installed plugin + if ( nPageId == RID_SVXPAGE_INET_MOZPLUGIN ) { + struct stat sb; + char *p; + bool bHaveSystemWidePlugin = false; + char mozpaths[]="/usr/lib/mozilla/plugins/libnpsoplugin.so:/usr/lib/firefox/plugins/libnpsoplugin.so:/usr/lib/mozilla-firefox/plugins/libnpsoplugin.so:/usr/lib/iceweasel/plugins/libnpsoplugin.so:/usr/lib/iceape/plugins/libnpsoplugin.so:/usr/lib/browser-plugins/libnpsoplugin.so:/usr/lib64/browser-plugins/libnpsoplugin.so"; + + p = strtok(mozpaths, ":"); + while (p != NULL) { + if (stat(p, &sb) != -1) { + bHaveSystemWidePlugin = true; + break; + } + p = strtok(NULL, ":"); + } + + if (bHaveSystemWidePlugin == true) + continue; + } +#endif AddTabPage( nPageId, rInetArray.GetString(i), nGroup ); } } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 696c1c62cb23..1f166b8f8d41 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -3386,11 +3386,6 @@ USHORT* SvxCharPositionPage::GetRanges() } // ----------------------------------------------------------------------- -#define ENABLE_AND_CHECK( aCheckBox ) \ - if ( !aCheckBox.IsEnabled() ) \ - aCheckBox.Enable(); \ - aCheckBox.Check( TRUE ) - void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) { String sUser = GetUserData(); @@ -3431,6 +3426,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_aFontSizeEdit.Enable(); short nFac; + sal_Bool bAutomatic(sal_False); if ( nEsc > 0 ) { @@ -3438,8 +3434,8 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_aHighPosBtn.Check( TRUE ); if ( nEsc == DFLT_ESC_AUTO_SUPER ) { - ENABLE_AND_CHECK( m_aHighLowRB ); nEsc = DFLT_ESC_SUPER; + bAutomatic = sal_True; } } else @@ -3448,10 +3444,15 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_aLowPosBtn.Check( TRUE ); if ( nEsc == DFLT_ESC_AUTO_SUB ) { - ENABLE_AND_CHECK( m_aHighLowRB ); nEsc = DFLT_ESC_SUB; + bAutomatic = sal_True; } } + if (!m_aHighLowRB.IsEnabled()) + { + m_aHighLowRB.Enable(); + } + m_aHighLowRB.Check(bAutomatic); if ( m_aHighLowRB.IsChecked() ) { diff --git a/cui/util/cui.map b/cui/util/cui.map index b43a11bd5096..06074d301dc3 100644 --- a/cui/util/cui.map +++ b/cui/util/cui.map @@ -1,4 +1,4 @@ -CUI_1_0 { +UDK_3_0_0 { global: CreateDialogFactory; GetSpecialCharsForEdit; diff --git a/extensions/qa/unoapi/Test.java b/extensions/qa/unoapi/Test.java new file mode 100644 index 000000000000..c997cb9ded32 --- /dev/null +++ b/extensions/qa/unoapi/Test.java @@ -0,0 +1,50 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* 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. +************************************************************************/ + +package org.openoffice.extensions.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "extensions.sce", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/extensions/qa/unoapi/makefile.mk b/extensions/qa/unoapi/makefile.mk index fef18c6d2ded..a869a3c1013e 100644 --- a/extensions/qa/unoapi/makefile.mk +++ b/extensions/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -22,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=extensions -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = extensions +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/extensions/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce $(PRJNAME).sce -THRCNT 1 +.END diff --git a/extensions/source/abpilot/abp.map b/extensions/source/abpilot/abp.map deleted file mode 100644 index 2b4747c38ff9..000000000000 --- a/extensions/source/abpilot/abp.map +++ /dev/null @@ -1,8 +0,0 @@ -EXTABP_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 07bca1490e35..178948ae0d3a 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -347,25 +347,6 @@ namespace abp //= ODataSource //===================================================================== //--------------------------------------------------------------------- - ODataSource::ODataSource( const Reference< XMultiServiceFactory >& _rxORB, const ::rtl::OUString& _rName ) - :m_pImpl(new ODataSourceImpl(_rxORB)) - { - try - { - // get the data source context - Reference< XNameAccess > xContext = lcl_getDataSourceContext( m_pImpl->xORB ); - - // retrieve the UNO data source - if (xContext.is()) - xContext->getByName( _rName ) >>= m_pImpl->xDataSource; - } - catch(const Exception&) - { - DBG_ERROR("ODataSource::ODataSource: could not access the requested data source (caught an exception)!"); - } - } - - //--------------------------------------------------------------------- ODataSource::ODataSource( const ODataSource& _rSource ) :m_pImpl( NULL ) { diff --git a/extensions/source/abpilot/datasourcehandling.hxx b/extensions/source/abpilot/datasourcehandling.hxx index bcd4e64fd885..54819b9b9628 100644 --- a/extensions/source/abpilot/datasourcehandling.hxx +++ b/extensions/source/abpilot/datasourcehandling.hxx @@ -125,17 +125,6 @@ namespace abp // ---------------------------------------------------------------- // - ctor/dtor/assignment // ---------------------------------------------------------------- - /** ctor - @param _rxORB - the service factory to use to access the UNO objects - @param _rName - the name of the data source the object should represent - */ - ODataSource( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, - const ::rtl::OUString& _rName - ); - /// constructs an object which is initially invalid ODataSource( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB diff --git a/extensions/source/abpilot/makefile.mk b/extensions/source/abpilot/makefile.mk index c5b25fc733f7..19477e1b6b2b 100644 --- a/extensions/source/abpilot/makefile.mk +++ b/extensions/source/abpilot/makefile.mk @@ -76,7 +76,7 @@ RESLIB1IMAGES=$(PRJ)$/res RESLIB1SRSFILES= $(SRS)$/abp.srs SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS= \ $(VCLLIB) \ diff --git a/extensions/source/activex/main/makefile.mk b/extensions/source/activex/main/makefile.mk index 53a54473ff49..e4770180886c 100644 --- a/extensions/source/activex/main/makefile.mk +++ b/extensions/source/activex/main/makefile.mk @@ -152,8 +152,4 @@ VERSIONOBJ_X64= $(MISC)$/envsettings.h : makefile.mk -$(RM) $@ # it looks wrong; but rc likes it that way... -.IF "$(USE_SHELL)"!="4nt" echo "#define MISC .\..\$(INPATH)\misc" > $@ -.ELSE # "$(USE_SHELL)"!="4nt" - echo #define MISC .\..\$(INPATH)\misc > $@ -.ENDIF # "$(USE_SHELL)"!="4nt" diff --git a/extensions/source/activex/main/so_activex.cpp b/extensions/source/activex/main/so_activex.cpp index 9c10fadadb06..b5793f6c7274 100644 --- a/extensions/source/activex/main/so_activex.cpp +++ b/extensions/source/activex/main/so_activex.cpp @@ -44,8 +44,10 @@ const REGSAM n32KeyAccess = KEY_ALL_ACCESS; #ifdef _AMD64_ const BOOL bX64 = TRUE; +#define REG_DELETE_KEY_A( key, aPath, nKeyAccess ) RegDeleteKeyExA( key, aPath, nKeyAccess, 0 ) #else const BOOL bX64 = FALSE; +#define REG_DELETE_KEY_A( key, aPath, nKeyAccess ) RegDeleteKeyA( key, aPath ) #endif // 10.11.2009 tkr: MinGW doesn't know anything about RegDeleteKeyExA if WINVER < 0x0502. @@ -363,7 +365,7 @@ HRESULT DeleteKeyTree( HKEY hkey, const char* pPath, REGSAM nKeyAccess ) RegCloseKey( hkey1 ),hkey1= NULL; // delete the key itself - return RegDeleteKeyExA( hkey, pPath, nKeyAccess & ( KEY_WOW64_64KEY | KEY_WOW64_32KEY ), 0 ); + return REG_DELETE_KEY_A( hkey, pPath, nKeyAccess & ( KEY_WOW64_64KEY | KEY_WOW64_32KEY ) ); } STDAPI DllUnregisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) diff --git a/extensions/source/bibliography/exports.map b/extensions/source/bibliography/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/extensions/source/bibliography/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/extensions/source/bibliography/makefile.mk b/extensions/source/bibliography/makefile.mk index efc1fbe222f3..f25dce11045b 100644 --- a/extensions/source/bibliography/makefile.mk +++ b/extensions/source/bibliography/makefile.mk @@ -82,7 +82,7 @@ SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1IMPLIB= i$(TARGET) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ diff --git a/extensions/source/dbpilots/dbp.map b/extensions/source/dbpilots/dbp.map deleted file mode 100644 index 1fe77064bd27..000000000000 --- a/extensions/source/dbpilots/dbp.map +++ /dev/null @@ -1,8 +0,0 @@ -EXTDBP_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 6e28567aef62..9e5d048eeab3 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -33,6 +33,7 @@ #include <comphelper/stl_types.hxx> #include <tools/string.hxx> #include <com/sun/star/form/XGridColumnFactory.hpp> +#include <com/sun/star/awt/MouseWheelBehavior.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <tools/debug.hxx> #include "dbptools.hxx" @@ -52,6 +53,7 @@ namespace dbp using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::form; + using namespace ::com::sun::star::awt; using namespace ::svt; //===================================================================== @@ -111,6 +113,7 @@ namespace dbp static const ::rtl::OUString s_sDataFieldProperty = ::rtl::OUString::createFromAscii("DataField"); static const ::rtl::OUString s_sLabelProperty = ::rtl::OUString::createFromAscii("Label"); static const ::rtl::OUString s_sWidthProperty = ::rtl::OUString::createFromAscii("Width"); + static const ::rtl::OUString s_sMouseWheelBehavior = ::rtl::OUString::createFromAscii("MouseWheelBehavior"); static const ::rtl::OUString s_sEmptyString; // collect "descriptors" for the to-be-created (grid)columns @@ -202,23 +205,24 @@ namespace dbp // create a (grid)column for the (resultset)column try { - Reference< XPropertySet > xColumn = xColumnFactory->createColumn(*pColumnServiceName); + Reference< XPropertySet > xColumn( xColumnFactory->createColumn(*pColumnServiceName), UNO_SET_THROW ); + Reference< XPropertySetInfo > xColumnPSI( xColumn->getPropertySetInfo(), UNO_SET_THROW ); ::rtl::OUString sColumnName(*pColumnServiceName); disambiguateName(xExistenceChecker, sColumnName); - if (xColumn.is()) - { - // the data field the column should be bound to - xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName)); - // the label - xColumn->setPropertyValue(s_sLabelProperty, makeAny(::rtl::OUString(*pFormFieldName) += *pColumnLabelPostfix)); - // the width (<void/> => column will be auto-sized) - xColumn->setPropertyValue(s_sWidthProperty, Any()); - - // insert the column - xColumnContainer->insertByName(sColumnName, makeAny(xColumn)); - } + // the data field the column should be bound to + xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName)); + // the label + xColumn->setPropertyValue(s_sLabelProperty, makeAny(::rtl::OUString(*pFormFieldName) += *pColumnLabelPostfix)); + // the width (<void/> => column will be auto-sized) + xColumn->setPropertyValue(s_sWidthProperty, Any()); + + if ( xColumnPSI->hasPropertyByName( s_sMouseWheelBehavior ) ) + xColumn->setPropertyValue( s_sMouseWheelBehavior, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ); + + // insert the column + xColumnContainer->insertByName(sColumnName, makeAny(xColumn)); } catch(Exception&) { diff --git a/extensions/source/dbpilots/makefile.mk b/extensions/source/dbpilots/makefile.mk index 8ef5ebae82e8..b5831e5fda0f 100644 --- a/extensions/source/dbpilots/makefile.mk +++ b/extensions/source/dbpilots/makefile.mk @@ -76,7 +76,7 @@ RESLIB1NAME=dbp RESLIB1SRSFILES= $(SRS)$/dbp.srs SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS= \ $(SVTOOLLIB) \ diff --git a/extensions/source/logging/log.map b/extensions/source/logging/log.map deleted file mode 100644 index 0bb561b5b067..000000000000 --- a/extensions/source/logging/log.map +++ /dev/null @@ -1,8 +0,0 @@ -LOG_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/extensions/source/logging/makefile.mk b/extensions/source/logging/makefile.mk index f3bfb2a4ea06..4a1fa9813cb0 100644 --- a/extensions/source/logging/makefile.mk +++ b/extensions/source/logging/makefile.mk @@ -68,7 +68,7 @@ SHL1STDLIBS= \ SHL1LIBS=$(LIB1TARGET) SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Targets ---------------------------------- diff --git a/extensions/source/nsplugin/source/nsplugin.rc b/extensions/source/nsplugin/source/nsplugin.rc index a97db09665e0..7d4b60b5bdad 100644 --- a/extensions/source/nsplugin/source/nsplugin.rc +++ b/extensions/source/nsplugin/source/nsplugin.rc @@ -26,5 +26,5 @@ ************************************************************************/ #define ADDITIONAL_VERINFO1 value "FileExtents", "sdc|sds|sda|sdd|sdp|smf|vor|sgl|sdw|sxc|stc|sxd|std|sxi|sti|sxm|sxw|sxg|stw|odt|ott|odm|oth|ods|ots|odg|otg|odp|otp|odf\0"\ value "FileOpenName", "StarCalc 3.0 - 5.0|StarChart 3.0 - 5.0|StarDraw 3.0 - 5.0|StarImpress 3.0 - 5.0|StarImpress-packed 3.0 - 5.0|StarMath 3.0 - 5.0|StarWriter Template 3.0 - 5.0|StarWriter Global 3.0 - 5.0|StarWriter 3.0 - 5.0|StarOffice 6.0/7 Spreadsheet|StarOffice 6.0/7 Spreadsheet Template|StarOffice 6.0/7 Drawing|StarOffice 6.0/7 Drawing Template|StarOffice 6.0/7 Presentation|StarOffice 6.0/7 Presentation Template|StarOffice 6.0/7 Formula|StarOffice 6.0/7 Text Document|StarOffice 6.0/7 Master Document|StarOffice 6.0/7 Text Document Template|OpenDocument Text|OpenDocument Text Template|OpenDocument Master Document|HTML Document Template|OpenDocument Spreadsheet|OpenDocument Spreadsheet Template|OpenDocument Drawing|OpenDocument Drawing Template|OpenDocument Presentation|OpenDocument Presentation Template|OpenDocument Formula\0" -#define ADDITIONAL_VERINFO2 value "FileDescription", "StarOffice/StarSuite Plug-in handles all its documents" value "ProductName", "StarOffice/StarSuite Plug-in" value "MIMEType", "application/vnd.stardivision.calc|application/vnd.stardivision.chart|application/vnd.stardivision.draw|application/vnd.stardivision.impress|application/vnd.stardivision.impress-packed|application/vnd.stardivision.math|application/vnd.stardivision.writer|application/vnd.stardivision.writer-global|application/vnd.staroffice.writer|application/vnd.sun.xml.calc|application/vnd.sun.xml.calc.template|application/vnd.sun.xml.draw|application/vnd.sun.xml.draw.template|" +#define ADDITIONAL_VERINFO2 value "FileDescription", "Oracle Open Office Plug-in handles all its documents" value "ProductName", "Oracle Open Office Plug-in" value "MIMEType", "application/vnd.stardivision.calc|application/vnd.stardivision.chart|application/vnd.stardivision.draw|application/vnd.stardivision.impress|application/vnd.stardivision.impress-packed|application/vnd.stardivision.math|application/vnd.stardivision.writer|application/vnd.stardivision.writer-global|application/vnd.staroffice.writer|application/vnd.sun.xml.calc|application/vnd.sun.xml.calc.template|application/vnd.sun.xml.draw|application/vnd.sun.xml.draw.template|" #define ADDITIONAL_VERINFO3 "application/vnd.sun.xml.impress|application/vnd.sun.xml.impress.template|application/vnd.sun.xml.math|application/vnd.sun.xml.writer|application/vnd.sun.xml.writer.global|application/vnd.sun.xml.writer.template|application/vnd.oasis.opendocument.text|application/vnd.oasis.opendocument.text-template|application/vnd.oasis.opendocument.text-master|application/vnd.oasis.opendocument.text-web|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.formula\0" diff --git a/extensions/source/nsplugin/source/so_env.cxx b/extensions/source/nsplugin/source/so_env.cxx index 36a2b3f3abec..5e86da9726b9 100644 --- a/extensions/source/nsplugin/source/so_env.cxx +++ b/extensions/source/nsplugin/source/so_env.cxx @@ -31,6 +31,9 @@ #ifdef UNIX #include <sys/types.h> #include <strings.h> +#ifdef LINUX +#include <dlfcn.h> +#endif #include <stdarg.h> // For vsnprintf() #define NSP_vsnprintf vsnprintf @@ -119,6 +122,113 @@ restoreUTF8(char *pPath) return 0; } +#ifdef LINUX +extern int nspluginOOoModuleHook (void** aResult); +int nspluginOOoModuleHook (void** aResult) +{ + void *dl_handle; + + dl_handle = dlopen(NULL, RTLD_NOW); + if (!dl_handle) + { + fprintf (stderr, "Can't open myself '%s'\n", dlerror()); + return 1; + } + + Dl_info dl_info = { 0,0,0,0 }; + if(!dladdr((void *)nspluginOOoModuleHook, &dl_info)) + { + fprintf (stderr, "Can't find my own address '%s'\n", dlerror()); + return 1; + } + + if (!dl_info.dli_fname) + { + fprintf (stderr, "Can't find my own file name\n"); + return 1; + } + + char cwdstr[NPP_PATH_MAX]; + if (!getcwd (cwdstr, sizeof(cwdstr))) + { + fprintf (stderr, "Can't get cwd\n"); + return 1; + } + + char libFileName[NPP_PATH_MAX]; + + if (dl_info.dli_fname[0] != '/') + { + if ((strlen(cwdstr) + 1 + strlen(dl_info.dli_fname)) >= NPP_PATH_MAX) + { + fprintf (stderr, "Plugin path too long\n"); + return 1; + } + strcpy (libFileName, cwdstr); + strcat (libFileName, "/"); + strcat (libFileName, dl_info.dli_fname); + } + else + { + if (strlen(dl_info.dli_fname) >= NPP_PATH_MAX) + { + fprintf (stderr, "Plugin path too long\n"); + return 1; + } + strcpy (libFileName, dl_info.dli_fname); + } + + char *clobber; + static char realFileName[NPP_PATH_MAX] = {0}; +# define SEARCH_SUFFIX "/program/libnpsoplug" + + if (!(clobber = strstr (libFileName, SEARCH_SUFFIX))) + { + ssize_t len = readlink(libFileName, realFileName, NPP_PATH_MAX-1); + if (len == -1) + { + fprintf (stderr, "Couldn't read link '%s'\n", libFileName); + return 1; + } + realFileName[len] = '\0'; + if (!(clobber = strstr (realFileName, SEARCH_SUFFIX))) + { + fprintf (stderr, "Couldn't find suffix in '%s'\n", realFileName); + return 1; + } + *clobber = '\0'; + } + else + { + *clobber = '\0'; + strcpy (realFileName, libFileName); + } + + fprintf (stderr, "OpenOffice path before fixup is '%s'\n", realFileName); + + if (realFileName[0] != '/') { + /* a relative sym-link and we need to get an absolute path */ + char scratch[NPP_PATH_MAX] = {0}; + if (strlen (realFileName) + strlen (libFileName) + 2 >= NPP_PATH_MAX - 1) + { + fprintf (stderr, "Paths too long to fix up.\n"); + return 1; + } + strcpy (scratch, libFileName); + if (strrchr (scratch, '/')) /* remove the last element */ + *(strrchr (scratch, '/') + 1) = '\0'; + strcat (scratch, realFileName); + strcpy (realFileName, scratch); + } + + *aResult = realFileName; + + fprintf (stderr, "OpenOffice path is '%s'\n", realFileName); + + return 0; +} +#endif + // *aResult points the static string holding "/opt/staroffice8" int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const char* /*entry*/) { @@ -131,9 +241,29 @@ int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const ch // Filename of lnk file, eg. "soffice" char lnkFileName[NPP_PATH_MAX] = {0}; char* pTempZero = NULL; + +#ifdef LINUX + /* try to fetch a 'self' pointer */ + if (!nspluginOOoModuleHook (aResult)) + return 0; + + /* .. now in $HOME */ +#endif sprintf(lnkFileName, "%s/.mozilla/plugins/libnpsoplugin%s", getenv("HOME"), SAL_DLLEXTENSION); +#ifdef LINUX + ssize_t len = readlink(lnkFileName, realFileName, NPP_PATH_MAX-1); + if (-1 == len) + { + *realFileName = 0; + return -1; + } + realFileName[len] = '\0'; + + if (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION))) +#else if ((0 > readlink(lnkFileName, realFileName, NPP_PATH_MAX)) || - (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION)))) + (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION)))) +#endif { *realFileName = 0; return -1; @@ -210,27 +340,6 @@ const char* findProgramDir() return sProgram; } -// Return: "/home/build/staroffice/program" + original system library path -const char* getNewLibraryPath() -{ - static char pLPATH[NPP_PATH_MAX*4] = {0}; - - if (!pLPATH[0]) - { - const char* pProgram = findProgramDir(); - strcpy(pLPATH, "LD_LIBRARY_PATH="); - strcat(pLPATH, pProgram); - - char* pLD = getenv("LD_LIBRARY_PATH"); - if (pLD) - { - strcat(pLPATH, ":"); - strcat(pLPATH, pLD); - } - } - return pLPATH; -} - #ifdef WNT // Return SO executable absolute path, like "/home/build/staroffice/program/soffice" const char* findSofficeExecutable() diff --git a/extensions/source/nsplugin/source/so_env.hxx b/extensions/source/nsplugin/source/so_env.hxx index a4e98a878f2a..0cf1194c2dc2 100644 --- a/extensions/source/nsplugin/source/so_env.hxx +++ b/extensions/source/nsplugin/source/so_env.hxx @@ -69,9 +69,6 @@ // return the install path of staroffice, return value like "/home/build/staroffice" const char* findInstallDir(); -// return original system library path + "/home/build/staroffice/program" -const char* getNewLibraryPath(); - // return SO program dir absolute path, like "/home/build/staroffice/program" const char* findProgramDir(); diff --git a/extensions/source/nsplugin/source/so_instance.cxx b/extensions/source/nsplugin/source/so_instance.cxx index 65e511dfcc35..4b1e41f724bd 100644 --- a/extensions/source/nsplugin/source/so_instance.cxx +++ b/extensions/source/nsplugin/source/so_instance.cxx @@ -366,14 +366,6 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) return sal_True; } -sal_Bool SoPluginInstance::SetSODir(char * sDir) -{ - if(strlen(sDir) >= NPP_PATH_MAX) return sal_False; - - strcpy(sSO_Dir, sDir); - return sal_True; -} - sal_Bool SoPluginInstance::SetWindow(NSP_HWND hParent, int x, int y, int w, int h) { sal_Bool bRetval(sal_True); diff --git a/extensions/source/nsplugin/source/so_instance.hxx b/extensions/source/nsplugin/source/so_instance.hxx index 17266fcefc71..e95bb7c024ec 100644 --- a/extensions/source/nsplugin/source/so_instance.hxx +++ b/extensions/source/nsplugin/source/so_instance.hxx @@ -103,7 +103,6 @@ public: virtual sal_Bool Print(void) ; static sal_Bool ShutDown(void); - static sal_Bool SetSODir(char * sDir); static char* GetSODir(void) {return sSO_Dir;}; long GetParent(void) {return m_pParent;}; }; diff --git a/extensions/source/nsplugin/source/so_main.cxx b/extensions/source/nsplugin/source/so_main.cxx index 7932f63d6d4d..49c899994424 100644 --- a/extensions/source/nsplugin/source/so_main.cxx +++ b/extensions/source/nsplugin/source/so_main.cxx @@ -126,7 +126,7 @@ int find_free_node() return -1; } -int find_cur_node(sal_Int32 cur_id) +int find_cur_node(long cur_id) { for(int i=0; i<MAX_NODE_NUM; i++) { @@ -148,16 +148,6 @@ sal_Bool dump_plugin_message(PLUGIN_MSG* pMsg) return sal_True; } -int prepareEnviron() -{ - // if child process inherit the chdir() property from parent process, if yes, no getNewLibraryPath() needed - const char* pNewLibraryPath = getNewLibraryPath(); - putenv( (char*) pNewLibraryPath ); - SoPluginInstance::SetSODir((char *)findProgramDir()); - - return 0; -} - int Set_Window(PLUGIN_MSG* pMsg) { dump_plugin_message(pMsg); diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index 79baf3c7d8df..ea9377ccf596 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -422,6 +422,46 @@ Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName ) { o2u_attachCurrentThread(); ITypeInfo * pInfo = getTypeInfo(); + // I was going to implement an XServiceInfo interface to allow the type + // of the automation object to be exposed.. but it seems + // from looking at comments in the code that it is possible for + // this object to actually wrap an UNO object ( I guess if automation is + // used from MSO to create Openoffice objects ) Therefore, those objects + // will more than likely already have their own XServiceInfo interface. + // Instead here I chose a name that should be illegal both in COM and + // UNO ( from an IDL point of view ) therefore I think this is a safe + // hack + if ( aPropertyName.equals( rtl::OUString::createFromAscii("$GetTypeName") )) + { + if ( pInfo && m_sTypeName.getLength() == 0 ) + { + m_sTypeName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") ); + CComBSTR sName; + + if ( SUCCEEDED( pInfo->GetDocumentation( -1, &sName, NULL, NULL, NULL ) ) ) + { + rtl::OUString sTmp( reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName))); + if ( sTmp.indexOf('_') == 0 ) + sTmp = sTmp.copy(1); + // do we own the memory for pTypeLib, msdn doco is vague + // I'll assume we do + CComPtr< ITypeLib > pTypeLib; + unsigned int index; + if ( SUCCEEDED( pInfo->GetContainingTypeLib( &pTypeLib.p, &index )) ) + { + if ( SUCCEEDED( pTypeLib->GetDocumentation( -1, &sName, NULL, NULL, NULL ) ) ) + { + rtl::OUString sLibName( reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName))); + m_sTypeName = sLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".") ) ).concat( sTmp ); + + } + } + } + + } + ret <<= m_sTypeName; + return ret; + } FuncDesc aDescGet(pInfo); FuncDesc aDescPut(pInfo); VarDesc aVarDesc(pInfo); diff --git a/extensions/source/ole/oleobjw.hxx b/extensions/source/ole/oleobjw.hxx index 6d46452eb088..230de2b7dcf8 100644 --- a/extensions/source/ole/oleobjw.hxx +++ b/extensions/source/ole/oleobjw.hxx @@ -234,6 +234,7 @@ protected: Sequence<Type> m_seqTypes; CComPtr<IUnknown> m_spUnknown; CComPtr<IDispatch> m_spDispatch; + rtl::OUString m_sTypeName; // is "" ( not initialised ), "IDispatch" ( we have no idea ) or "SomeLibrary.SomeTypeName" if we managed to get a type /** This value is set dureing XInitialization::initialize. It indicates that the COM interface was transported as VT_DISPATCH in a VARIANT rather then a VT_UNKNOWN */ diff --git a/extensions/source/oooimprovecore/makefile.mk b/extensions/source/oooimprovecore/makefile.mk index 977098af8049..97e130c3a644 100644 --- a/extensions/source/oooimprovecore/makefile.mk +++ b/extensions/source/oooimprovecore/makefile.mk @@ -69,7 +69,7 @@ SHL1STDLIBS= \ SHL1LIBS=$(LIB1TARGET) SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Targets ---------------------------------- diff --git a/extensions/source/oooimprovecore/oooimprovecore.map b/extensions/source/oooimprovecore/oooimprovecore.map deleted file mode 100644 index fe782c0d7737..000000000000 --- a/extensions/source/oooimprovecore/oooimprovecore.map +++ /dev/null @@ -1,8 +0,0 @@ -OOOIMPROVECORE_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/extensions/source/oooimprovement/makefile.mk b/extensions/source/oooimprovement/makefile.mk index ba8ff01a8c0e..6e5d7ab0d6a2 100644 --- a/extensions/source/oooimprovement/makefile.mk +++ b/extensions/source/oooimprovement/makefile.mk @@ -73,7 +73,7 @@ SHL1TARGET= oooimp$(DLLPOSTFIX) SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) -SHL1VERSIONMAP= oooimprovement.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map PACKAGEDIR=$(subst,.,$/ $(PACKAGE)) SPOOLDIR=$(MISC)$/registry$/spool diff --git a/extensions/source/oooimprovement/oooimprovement.map b/extensions/source/oooimprovement/oooimprovement.map deleted file mode 100644 index de08e5708ea5..000000000000 --- a/extensions/source/oooimprovement/oooimprovement.map +++ /dev/null @@ -1,11 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; - diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx index 1be5f9f42a03..387de8cde24d 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -482,7 +482,9 @@ int main( int argc, char **argv) medDebug( 1, "left plugin app main loop\n" ); + #ifdef ENABLE_GTK g_source_remove(xt_polling_timer_id); + #endif pNP_Shutdown(); medDebug( 1, "NP_Shutdown done\n" ); diff --git a/extensions/source/plugin/util/exports.map b/extensions/source/plugin/util/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/extensions/source/plugin/util/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/extensions/source/plugin/util/makefile.mk b/extensions/source/plugin/util/makefile.mk index 659e8f3acaed..7a8c46c01769 100644 --- a/extensions/source/plugin/util/makefile.mk +++ b/extensions/source/plugin/util/makefile.mk @@ -67,7 +67,7 @@ SHL1OWNLIBS = \ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1IMPLIB= i$(TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/extensions/source/preload/makefile.mk b/extensions/source/preload/makefile.mk index 4e4bab1bc71a..fb11a2bfd32c 100644 --- a/extensions/source/preload/makefile.mk +++ b/extensions/source/preload/makefile.mk @@ -57,7 +57,7 @@ RESLIB1IMAGES=$(PRJ)$/res RESLIB1SRSFILES= $(SRS)$/preload.srs SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS= \ $(SFXLIB) \ diff --git a/extensions/source/preload/preload.map b/extensions/source/preload/preload.map deleted file mode 100644 index ff4971857d69..000000000000 --- a/extensions/source/preload/preload.map +++ /dev/null @@ -1,8 +0,0 @@ -EXTDBI_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/extensions/source/preload/preload.src b/extensions/source/preload/preload.src index feea7249ce70..59805b768adf 100644 --- a/extensions/source/preload/preload.src +++ b/extensions/source/preload/preload.src @@ -86,10 +86,8 @@ TabPage RID_TP_WELCOME Text [ en-US ] = "Welcome to %PRODUCTNAME %PRODUCTVERSION OEM\n\nTo start the %PRODUCTNAME %PRODUCTVERSION OEM, " "please enter your personal data in the dialog following the license text. Important information is contained " "in the readme files which are located in the %PRODUCTNAME product directory. Please read these files carefully. " - "You can also find detailed information at the Sun website \n\n" - "http://www.sun.com/staroffice.\n\nSupport and Training:\n\nGet FREE software support valid for 60 days from date " - "of purchase. To take advantage of this offer, visit the website below.\n\n" - "http://www.sun.com/star/service\n\nWe hope you enjoy working with %PRODUCTNAME."; + "You can also find detailed information at the Oracle website \n\n" + "http://www.oracle.com/us/products/applications/open-office."; }; }; diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index 71a0bb2db3ce..108333076e19 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -320,12 +320,6 @@ namespace pcr } //------------------------------------------------------------------ - sal_Bool OBrowserLine::IsPropertyInputEnabled( ) const - { - return ( m_nEnableFlags & PropertyLineElement::InputControl ) != 0; - } - - //------------------------------------------------------------------ void OBrowserLine::SetReadOnly( bool _bReadOnly ) { if ( m_bReadOnly != _bReadOnly ) diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx index db747b4a6b99..7848b387d608 100644 --- a/extensions/source/propctrlr/browserline.hxx +++ b/extensions/source/propctrlr/browserline.hxx @@ -115,7 +115,6 @@ namespace pcr void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable ); void EnablePropertyLine( bool _bEnable ); - sal_Bool IsPropertyInputEnabled( ) const; void SetReadOnly( bool _bReadOnly ); diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 67257f960f5b..8a2885fc8c69 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -682,16 +682,6 @@ namespace pcr } //------------------------------------------------------------------------ - Any OBrowserListBox::GetPropertyValue( const ::rtl::OUString& _rEntryName ) const - { - Any aValue; - ListBoxLines::const_iterator line = m_aLines.find( _rEntryName ); - if ( line != m_aLines.end() ) - aValue = impl_getControlAsPropertyValue( line->second ); - return aValue; - } - - //------------------------------------------------------------------------ sal_uInt16 OBrowserListBox::GetPropertyPos( const ::rtl::OUString& _rEntryName ) const { sal_uInt16 nRet = LISTBOX_ENTRY_NOTFOUND; @@ -722,15 +712,6 @@ namespace pcr } //------------------------------------------------------------------------ - sal_Bool OBrowserListBox::IsPropertyInputEnabled( const ::rtl::OUString& _rEntryName ) const - { - BrowserLinePointer pLine; - if ( impl_getBrowserLineForName( _rEntryName, pLine ) ) - return pLine->IsPropertyInputEnabled(); - return sal_False; - } - - //------------------------------------------------------------------------ void OBrowserListBox::EnablePropertyControls( const ::rtl::OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable ) { BrowserLinePointer pLine; diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index de0ebc9dd6b6..edd9d9bd40eb 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -163,13 +163,11 @@ namespace pcr void ChangeEntry( const OLineDescriptor&, sal_uInt16 nPos ); void SetPropertyValue( const ::rtl::OUString& rEntryName, const ::com::sun::star::uno::Any& rValue, bool _bUnknownValue ); - ::com::sun::star::uno::Any GetPropertyValue( const ::rtl::OUString& rEntryName ) const; sal_uInt16 GetPropertyPos( const ::rtl::OUString& rEntryName ) const; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > GetPropertyControl( const ::rtl::OUString& rEntryName ); void EnablePropertyControls( const ::rtl::OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable ); void EnablePropertyLine( const ::rtl::OUString& _rEntryName, bool _bEnable ); - sal_Bool IsPropertyInputEnabled( const ::rtl::OUString& _rEntryName ) const; sal_Int32 GetMinimumWidth(); sal_Int32 GetMinimumHeight(); diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 5c3fdba085c3..282130daea0b 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -594,7 +594,7 @@ namespace pcr } catch( const Exception& ) { - OSL_ENSURE( false, "EventHandler::EventHandler: caught an exception while classifying the component!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -825,7 +825,7 @@ namespace pcr } catch( const Exception& ) { - DBG_ERROR( "EventHandler::getSupportedProperties: caught an exception !" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1048,7 +1048,7 @@ namespace pcr } catch( const Exception& ) { - OSL_ENSURE( false, "EventHandler::impl_getFormComponentScriptEvents_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1080,7 +1080,7 @@ namespace pcr } catch( const Exception& ) { - OSL_ENSURE( false, "EventHandler::impl_getCopmonentListenerTypes_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1105,7 +1105,7 @@ namespace pcr } catch( const Exception& ) { - OSL_ENSURE( false, "EventHandler::impl_getDialogElementScriptEvents_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1120,7 +1120,7 @@ namespace pcr { Reference< XTabControllerModel > xComponentAsTCModel( m_xComponent, UNO_QUERY_THROW ); Reference< XFormController > xController( - m_aContext.createComponent( (const rtl::OUString&)SERVICE_FORMCONTROLLER ), UNO_QUERY_THROW ); + m_aContext.createComponent( "com.sun.star.form.runtime.FormController" ), UNO_QUERY_THROW ); xController->setModel( xComponentAsTCModel ); xReturn = xController; @@ -1212,7 +1212,7 @@ namespace pcr } catch( const Exception& ) { - OSL_ENSURE( false, "EventHandler::impl_setFormComponentScriptEvent_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx index 0e82397dae2c..ae87a85a3722 100644 --- a/extensions/source/propctrlr/handlerhelper.cxx +++ b/extensions/source/propctrlr/handlerhelper.cxx @@ -161,14 +161,6 @@ namespace pcr //-------------------------------------------------------------------- Reference< XPropertyControl > PropertyHandlerHelper::createListBoxControl( const Reference< XPropertyControlFactory >& _rxControlFactory, - const Sequence< ::rtl::OUString >& _rInitialListEntries, sal_Bool _bReadOnlyControl, sal_Bool _bSorted ) - { - ::std::vector< ::rtl::OUString > aAsVector( _rInitialListEntries.getConstArray(), _rInitialListEntries.getConstArray() + _rInitialListEntries.getLength() ); - return lcl_implCreateListLikeControl( _rxControlFactory, aAsVector, _bReadOnlyControl, _bSorted, sal_True ); - } - - //-------------------------------------------------------------------- - Reference< XPropertyControl > PropertyHandlerHelper::createListBoxControl( const Reference< XPropertyControlFactory >& _rxControlFactory, const ::std::vector< ::rtl::OUString >& _rInitialListEntries, sal_Bool _bReadOnlyControl, sal_Bool _bSorted ) { return lcl_implCreateListLikeControl( _rxControlFactory, _rInitialListEntries, _bReadOnlyControl, _bSorted, sal_True ); diff --git a/extensions/source/propctrlr/handlerhelper.hxx b/extensions/source/propctrlr/handlerhelper.hxx index bf42c5555f1b..e55cbf207526 100644 --- a/extensions/source/propctrlr/handlerhelper.hxx +++ b/extensions/source/propctrlr/handlerhelper.hxx @@ -105,14 +105,6 @@ namespace pcr static ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > createListBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rInitialListEntries, - sal_Bool _bReadOnlyControl, - sal_Bool _bSorted - ); - - static ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > - createListBoxControl( - const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory, const ::std::vector< ::rtl::OUString >& _rInitialListEntries, sal_Bool _bReadOnlyControl, sal_Bool _bSorted diff --git a/extensions/source/propctrlr/makefile.mk b/extensions/source/propctrlr/makefile.mk index 27255c9e5f46..c69f47bcef1a 100644 --- a/extensions/source/propctrlr/makefile.mk +++ b/extensions/source/propctrlr/makefile.mk @@ -113,7 +113,7 @@ RESLIB1IMAGES=$(PRJ)$/res RESLIB1SRSFILES= $(SRS)$/$(TARGET).srs SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS= \ $(EDITENGLIB) \ diff --git a/extensions/source/propctrlr/pcr.map b/extensions/source/propctrlr/pcr.map deleted file mode 100644 index 6794fcdf213e..000000000000 --- a/extensions/source/propctrlr/pcr.map +++ /dev/null @@ -1,8 +0,0 @@ -EXTPCR_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/extensions/source/propctrlr/pcrstrings.hxx b/extensions/source/propctrlr/pcrstrings.hxx index 9a611f5fce7f..e2a81c9920ca 100644 --- a/extensions/source/propctrlr/pcrstrings.hxx +++ b/extensions/source/propctrlr/pcrstrings.hxx @@ -38,9 +38,6 @@ namespace pcr // properties PCR_CONSTASCII_STRING( PROPERTY_TABBINGMODEL, "TabbingModel" ); - // services - PCR_CONSTASCII_STRING( SERVICE_FORMCONTROLLER, "com.sun.star.form.FormController" ); - //............................................................................ } // namespace pcr //............................................................................ diff --git a/extensions/source/resource/exports.map b/extensions/source/resource/exports.map deleted file mode 100644 index 7c56baa9bd73..000000000000 --- a/extensions/source/resource/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/extensions/source/resource/makefile.mk b/extensions/source/resource/makefile.mk index 2502d8467f22..a89d690b7393 100644 --- a/extensions/source/resource/makefile.mk +++ b/extensions/source/resource/makefile.mk @@ -63,7 +63,7 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def SHL1DEF=$(MISC)$/$(SHL1TARGET).def SHL1IMPLIB=i$(TARGET) SHL1LIBS=$(SLB)$/$(TARGET).lib -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME= $(SHL1TARGET) DEF1EXPORTFILE= exports.dxp diff --git a/extensions/source/scanner/exports.map b/extensions/source/scanner/exports.map deleted file mode 100644 index 7c56baa9bd73..000000000000 --- a/extensions/source/scanner/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/extensions/source/scanner/makefile.mk b/extensions/source/scanner/makefile.mk index 347b1e1cfc26..ff42864e0496 100644 --- a/extensions/source/scanner/makefile.mk +++ b/extensions/source/scanner/makefile.mk @@ -88,7 +88,7 @@ SHL1STDLIBS+=$(SVTOOLLIB) -ldl SHL1DEF=$(MISC)$/$(SHL1TARGET).def SHL1IMPLIB=i$(TARGET) SHL1LIBS=$(SLB)$/$(TARGET).lib -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) DEF1EXPORTFILE=exports.dxp diff --git a/extensions/source/svg/exports.map b/extensions/source/svg/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/extensions/source/svg/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/extensions/source/svg/makefile.mk b/extensions/source/svg/makefile.mk index 543fbca73982..c46aede54920 100644 --- a/extensions/source/svg/makefile.mk +++ b/extensions/source/svg/makefile.mk @@ -47,7 +47,7 @@ SLOFILES= $(SLO)$/svgprinter.obj \ SHL1TARGET=$(TARGET)$(DLLPOSTFIX) SHL1IMPLIB=i$(SHL1TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/extensions/source/update/check/makefile.mk b/extensions/source/update/check/makefile.mk index b87eb0377803..9f5f544102dd 100644 --- a/extensions/source/update/check/makefile.mk +++ b/extensions/source/update/check/makefile.mk @@ -82,7 +82,7 @@ SHL1STDLIBS= \ $(SHELL32LIB) \ $(OLE32LIB) -SHL1VERSIONMAP=..$/exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index 3be38dd9888a..2444637515d4 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -28,6 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" +#include <memory> + #include "updatecheck.hxx" #include "updatecheckconfig.hxx" #include "updatehdl.hxx" @@ -55,16 +57,12 @@ class InitUpdateCheckJobThread : public osl::Thread { public: InitUpdateCheckJobThread( const uno::Reference< uno::XComponentContext > &xContext, - const uno::Sequence< beans::NamedValue > &xParameters ); + const uno::Sequence< beans::NamedValue > &xParameters, + bool bShowDialog ); virtual void SAL_CALL run(); - virtual void SAL_CALL onTerminated(); - - void showDialog(); - void setTerminating() { m_bTerminating = true; } -protected: - ~InitUpdateCheckJobThread(); + void setTerminating(); private: osl::Condition m_aCondition; @@ -115,7 +113,7 @@ public: private: uno::Reference<uno::XComponentContext> m_xContext; uno::Reference< frame::XDesktop > m_xDesktop; - InitUpdateCheckJobThread *m_pInitThread; + std::auto_ptr< InitUpdateCheckJobThread > m_pInitThread; void handleExtensionUpdates( const uno::Sequence< beans::NamedValue > &rListProp ); }; @@ -125,29 +123,25 @@ private: //------------------------------------------------------------------------------ InitUpdateCheckJobThread::InitUpdateCheckJobThread( const uno::Reference< uno::XComponentContext > &xContext, - const uno::Sequence< beans::NamedValue > &xParameters ) : + const uno::Sequence< beans::NamedValue > &xParameters, + bool bShowDialog ) : m_xContext( xContext ), m_xParameters( xParameters ), - m_bShowDialog( false ), + m_bShowDialog( bShowDialog ), m_bTerminating( false ) { create(); } //------------------------------------------------------------------------------ -InitUpdateCheckJobThread::~InitUpdateCheckJobThread() -{ -} - -//------------------------------------------------------------------------------ void SAL_CALL InitUpdateCheckJobThread::run() { - TimeValue tv = { 25, 0 }; - - m_aCondition.wait( &tv ); - - if ( m_bTerminating ) - return; + if (!m_bShowDialog) { + TimeValue tv = { 25, 0 }; + m_aCondition.wait( &tv ); + if ( m_bTerminating ) + return; + } rtl::Reference< UpdateCheck > aController( UpdateCheck::get() ); aController->initialize( m_xParameters, m_xContext ); @@ -156,16 +150,8 @@ void SAL_CALL InitUpdateCheckJobThread::run() aController->showDialog( true ); } -//------------------------------------------------------------------------------ -void SAL_CALL InitUpdateCheckJobThread::onTerminated() -{ - delete this; -} - -//------------------------------------------------------------------------------ -void InitUpdateCheckJobThread::showDialog() -{ - m_bShowDialog = true; +void InitUpdateCheckJobThread::setTerminating() { + m_bTerminating = true; m_aCondition.set(); } @@ -174,8 +160,7 @@ void InitUpdateCheckJobThread::showDialog() //------------------------------------------------------------------------------ UpdateCheckJob::UpdateCheckJob( const uno::Reference<uno::XComponentContext>& xContext ) : - m_xContext(xContext), - m_pInitThread( NULL ) + m_xContext(xContext) { m_xDesktop.set( xContext->getServiceManager()->createInstanceWithContext( UNISTRING("com.sun.star.frame.Desktop"), xContext ), uno::UNO_QUERY ); if ( m_xDesktop.is() ) @@ -234,7 +219,6 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues) uno::Sequence<beans::NamedValue> aConfig = getValue< uno::Sequence<beans::NamedValue> > (namedValues, "JobConfig"); - m_pInitThread = new InitUpdateCheckJobThread( m_xContext, aConfig ); /* Determine the way we got invoked here - * see Developers Guide Chapter "4.7.2 Jobs" to understand the magic @@ -245,10 +229,10 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues) rtl::OUString aEventName = getValue< rtl::OUString > (aEnvironment, "EventName"); - if( ! aEventName.equalsAscii("onFirstVisibleTask") ) - { - m_pInitThread->showDialog(); - } + m_pInitThread.reset( + new InitUpdateCheckJobThread( + m_xContext, aConfig, + !aEventName.equalsAscii("onFirstVisibleTask"))); return uno::Any(); } @@ -346,7 +330,7 @@ void SAL_CALL UpdateCheckJob::queryTermination( lang::EventObject const & ) void SAL_CALL UpdateCheckJob::notifyTermination( lang::EventObject const & rEvt ) throw ( uno::RuntimeException ) { - if ( m_pInitThread ) + if ( m_pInitThread.get() != 0 ) m_pInitThread->setTerminating(); disposing( rEvt ); diff --git a/extensions/source/update/exports.map b/extensions/source/update/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/extensions/source/update/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/extensions/source/update/feed/makefile.mk b/extensions/source/update/feed/makefile.mk index c7d15a2beb74..7e12970ddef1 100644 --- a/extensions/source/update/feed/makefile.mk +++ b/extensions/source/update/feed/makefile.mk @@ -54,7 +54,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=..$/exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/extensions/source/update/ui/makefile.mk b/extensions/source/update/ui/makefile.mk index 1cf95a52108d..c4826efba9ca 100644 --- a/extensions/source/update/ui/makefile.mk +++ b/extensions/source/update/ui/makefile.mk @@ -64,7 +64,7 @@ SHL1STDLIBS= \ $(VCLLIB) \ $(TOOLSLIB) -SHL1VERSIONMAP=..$/exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/extensions/source/xmlextract/exports.map b/extensions/source/xmlextract/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/extensions/source/xmlextract/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/extensions/source/xmlextract/makefile.mk b/extensions/source/xmlextract/makefile.mk index 8a24ac5313c1..0a021027f4b4 100644 --- a/extensions/source/xmlextract/makefile.mk +++ b/extensions/source/xmlextract/makefile.mk @@ -46,7 +46,7 @@ SLOFILES= $(SLO)$/xmxuno.obj \ SHL1TARGET=$(TARGET)$(DLLPOSTFIX) SHL1IMPLIB= i$(SHL1TARGET) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/forms/prj/build.lst b/forms/prj/build.lst index ec07ab8e243c..cc71868b734d 100644 --- a/forms/prj/build.lst +++ b/forms/prj/build.lst @@ -1,4 +1,4 @@ -fm forms : l10n oovbaapi svx sfx2 QADEVOOO:qadevOOo NULL +fm forms : l10n oovbaapi svx sfx2 qadevOOo NULL fm forms usr1 - all fm_mkofrm NULL fm forms\inc nmake - all fm_inc NULL fm forms\source\inc get - all fm_sinc NULL @@ -15,3 +15,4 @@ fm forms\source\richtext nmake - all fm_richtext fm_inc N fm forms\source\runtime nmake - all frm_runtime NULL fm forms\util nmake - all fm_util fm_component fm_solar_component fm_solar_control fm_helper fm_misc fm_resource fm_richtext frm_runtime fm_xforms NULL fm forms\qa nmake - all fm_qa NULL +fm forms\qa\unoapi nmake - all fm_qa_unoapi NULL diff --git a/forms/qa/makefile.mk b/forms/qa/makefile.mk index 1f12a8cf4a74..afafcca427aa 100644 --- a/forms/qa/makefile.mk +++ b/forms/qa/makefile.mk @@ -32,8 +32,6 @@ PRJNAME = forms # --- Settings ----------------------------------------------------- .INCLUDE: settings.mk - -.IF "$(BUILD_QADEVOOO)" == "YES" #----- compile .java files ----------------------------------------- JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar ConnectivityTools.jar @@ -54,7 +52,6 @@ JARCOMPRESS = TRUE # classpath and argument list RUNNER_CLASSPATH = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/ConnectivityTools.jar" RUNNER_ARGS = org.openoffice.Runner -TestBase java_complex -.END # --- Targets ------------------------------------------------------ @@ -72,7 +69,6 @@ ALL: ALLDEP test: echo $(SOLARBINDIR) -.IF "$(BUILD_QADEVOOO)" == "YES" show_targets: +@$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//)) @@ -81,11 +77,3 @@ run: run_%: +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o integration.$(PRJNAME).$(@:s/run_//) - -.ELSE -run: show_targets - -show_targets: - +@echo "Built without qadevOOo, no QA tests" - -.ENDIF diff --git a/forms/qa/unoapi/Test.java b/forms/qa/unoapi/Test.java new file mode 100644 index 000000000000..52130214cc78 --- /dev/null +++ b/forms/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* 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. +************************************************************************/ + +package org.openoffice.forms.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "forms.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/forms/qa/unoapi/forms.sce b/forms/qa/unoapi/forms.sce index 97e9c7422f35..073472f03126 100644 --- a/forms/qa/unoapi/forms.sce +++ b/forms/qa/unoapi/forms.sce @@ -1,5 +1,5 @@ -o forms.OButtonControl --o forms.OButtonModel +#i111285 -o forms.OButtonModel -o forms.OCheckBoxControl -o forms.OCheckBoxModel -o forms.OComboBoxControl @@ -11,10 +11,10 @@ -o forms.ODateModel -o forms.OEditControl -o forms.OEditModel --o forms.OFileControlModel +#i109939 -o forms.OFileControlModel -o forms.OFixedTextModel -o forms.OFormattedControl --o forms.OFormattedFieldWrapper +#i109939 -o forms.OFormattedFieldWrapper # LäSST EIN DOKUMENT OFFEN -o forms.OFormsCollection -o forms.OGridControlModel -o forms.OGroupBoxControl diff --git a/forms/qa/unoapi/knownissues.xcl b/forms/qa/unoapi/knownissues.xcl index 1cec8ac106a2..2e10a269c681 100644 --- a/forms/qa/unoapi/knownissues.xcl +++ b/forms/qa/unoapi/knownissues.xcl @@ -116,3 +116,14 @@ forms.OListBoxModel::com::sun::star::form::XUpdateBroadcaster forms.OFormattedFieldWrapper::com::sun::star::form::XUpdateBroadcaster forms.ODateModel::com::sun::star::form::XUpdateBroadcaster forms.OComboBoxModel::com::sun::star::form::XUpdateBroadcaster + +### i111006 ### +forms.OFileControlModel::com::sun::star::beans::XFastPropertySet +forms.OFileControlModel::com::sun::star::form::FormControlModel + +### i111148 ### +forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet +forms.OImageControlModel::com::sun::star::beans::XPropertySet + +### i111333 ### +forms.OImageControlControl::com::sun::star::awt::XControl diff --git a/forms/qa/unoapi/makefile.mk b/forms/qa/unoapi/makefile.mk index 9f033d058ce7..50c83e587db8 100644 --- a/forms/qa/unoapi/makefile.mk +++ b/forms/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -22,27 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=forms -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = forms +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/forms/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST - -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce forms.sce -xcl knownissues.xcl -DOCPTH $(PWD)$/testdocuments -THRCNT 1 -tdoc $(PWD)$/testdocuments - @echo ======================================================================= - @echo Problems with controls might me focus problems during the run of XView - @echo these seems to appear by chance ... just re-run those testcases with - @echo $(SOLARENV)$/bin$/checkapi -o componentName -xcl knownissues.xcl -DOCPTH $(PWD)$/testdocuments -THRCNT 1 -tdoc $(PWD)$/testdocuments - @echo ======================================================================= +ALLTAR : javatest -run_%: - +$(SOLARENV)$/bin$/checkapi -o $(PRJNAME).$(@:s/run_//) -xcl knownissues.xcl -DOCPTH $(PWD)$/testdocuments -THRCNT 1 -tdoc $(PWD)$/testdocuments +.END diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index ae1cbc2b7a5b..a93d121d4b99 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -32,6 +32,7 @@ #include "property.hrc" #endif #include "property.hxx" +#include "componenttools.hxx" #include "ids.hxx" #include "findpos.hxx" #include <com/sun/star/io/XPersistObject.hpp> @@ -169,11 +170,20 @@ Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(RuntimeExce //------------------------------------------------------------------ Sequence<Type> SAL_CALL OGridColumn::getTypes() throw(RuntimeException) { - Reference<XTypeProvider> xProv; - - if (query_aggregation(m_xAggregate, xProv)) - return concatSequences(OGridColumn_BASE::getTypes(), xProv->getTypes()); - return OGridColumn_BASE::getTypes(); + TypeBag aTypes( OGridColumn_BASE::getTypes() ); + // erase the types which we do not support + aTypes.removeType( XFormComponent::static_type() ); + aTypes.removeType( XServiceInfo::static_type() ); + aTypes.removeType( XBindableValue::static_type() ); + aTypes.removeType( XPropertyContainer::static_type() ); + // but re-add their base class(es) + aTypes.addType( XChild::static_type() ); + + Reference< XTypeProvider > xProv; + if ( query_aggregation( m_xAggregate, xProv )) + aTypes.addTypes( xProv->getTypes() ); + + return aTypes.getTypes(); } //------------------------------------------------------------------ diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 4dfdb61cbb2b..278e561de251 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -532,26 +532,11 @@ void OComboBoxModel::loadData( bool _bForce ) else { // otherwise look for the alias - Reference<XSQLQueryComposerFactory> xFactory(xConnection, UNO_QUERY); - if (!xFactory.is()) - break; - - Reference<XSQLQueryComposer> xComposer = xFactory->createQueryComposer(); - try - { - Reference<XPropertySet> xFormAsSet(xForm, UNO_QUERY); - ::rtl::OUString aStatement; - xFormAsSet->getPropertyValue(PROPERTY_ACTIVECOMMAND) >>= aStatement; - xComposer->setQuery(aStatement); - } - catch(Exception&) - { - disposeComponent(xComposer); - break; - } + Reference<XPropertySet> xFormProp(xForm,UNO_QUERY); + Reference< XColumnsSupplier > xSupplyFields; + xFormProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupplyFields; // search the field - Reference< XColumnsSupplier > xSupplyFields(xComposer, UNO_QUERY); DBG_ASSERT(xSupplyFields.is(), "OComboBoxModel::loadData : invalid query composer !"); Reference< XNameAccess > xFieldNames = xSupplyFields->getColumns(); @@ -562,8 +547,6 @@ void OComboBoxModel::loadData( bool _bForce ) if (hasProperty(PROPERTY_FIELDSOURCE, xComposerFieldAsSet)) xComposerFieldAsSet->getPropertyValue(PROPERTY_FIELDSOURCE) >>= aFieldName; } - - disposeComponent(xComposer); } if (!aFieldName.getLength()) diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 5f3f04d45618..154ed4b00272 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -2403,6 +2403,7 @@ void ODatabaseForm::_propertyChanged(const PropertyChangeEvent& evt) throw( Runt //------------------------------------------------------------------------------ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException) { + // SYNCHRONIZED -----> ::osl::ResettableMutexGuard aGuard(m_aMutex); Reference<XForm> xParentForm(getParent(), UNO_QUERY); @@ -2447,14 +2448,15 @@ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com } } + Reference< XPropertySet > xAggregateProperties( m_xAggregateSet ); + aGuard.clear(); + // <----- SYNCHRONIZED + Reference< XConnection > xOuterConnection; sal_Bool bIsEmbedded = ::dbtools::isEmbeddedInDatabase( Parent, xOuterConnection ); - // clear the guard before setting property values, because of the notifications - // which are triggered there - aGuard.clear(); if ( bIsEmbedded ) - m_xAggregateSet->setPropertyValue( PROPERTY_DATASOURCE, makeAny( ::rtl::OUString() ) ); + xAggregateProperties->setPropertyValue( PROPERTY_DATASOURCE, makeAny( ::rtl::OUString() ) ); } //============================================================================== diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index b4c7eddf81d8..9cbc5237cf95 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -397,17 +397,10 @@ namespace frm const Reference< XPropertySet > xFormProps( xForm, UNO_QUERY_THROW ); // create a query composer - const Reference< XConnection > xConnection( ::dbtools::getConnection( xForm ), UNO_SET_THROW ); - const Reference< XSQLQueryComposerFactory > xFactory( xConnection, UNO_QUERY_THROW ); - const Reference< XSQLQueryComposer > xComposer( xFactory->createQueryComposer(), UNO_SET_THROW ); - - // set the statement on the composer - ::rtl::OUString sStatement; - xFormProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sStatement; - xComposer->setQuery( sStatement ); + Reference< XColumnsSupplier > xSuppColumns; + xFormProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSuppColumns; - // the field we're bound to - const Reference< XColumnsSupplier > xSuppColumns( xComposer, UNO_QUERY_THROW ); + const Reference< XConnection > xConnection( ::dbtools::getConnection( xForm ), UNO_SET_THROW ); const Reference< XNameAccess > xFieldNames( xSuppColumns->getColumns(), UNO_SET_THROW ); if ( !xFieldNames->hasByName( sFieldName ) ) return; @@ -417,7 +410,7 @@ namespace frm xComposerFieldProps->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName; // obtain the table of the field - const Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW ); + const Reference< XTablesSupplier > xSuppTables( xSuppColumns, UNO_QUERY_THROW ); const Reference< XNameAccess > xTablesNames( xSuppTables->getTables(), UNO_SET_THROW ); const Reference< XNamed > xNamedTable( xTablesNames->getByName( sTableName ), UNO_QUERY_THROW ); sTableName = xNamedTable->getName(); diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 6e11fa7c9dbb..a35a300dda78 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -580,7 +580,7 @@ void OFormattedModel::_propertyChanged( const com::sun::star::beans::PropertyCha // as m_aSaveValue (which is used by commitControlValueToDbColumn) is format dependent we have // to recalc it, which is done by translateDbColumnToControlValue - if ( m_xColumn.is() && m_xAggregateFastSet.is() && !m_xCursor->isBeforeFirst() && !m_xCursor->isAfterLast()) + if ( m_xColumn.is() && m_xAggregateFastSet.is() && !m_xCursor->isBeforeFirst() && !m_xCursor->isAfterLast()) { setControlValue( translateDbColumnToControlValue(), eOther ); } diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 0aa90d9919cf..f2ad20613a22 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -41,7 +41,6 @@ /** === begin UNO includes === **/ #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> -#include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> @@ -167,7 +166,7 @@ namespace frm ,OErrorBroadcaster( OComponentHelper::rBHelper ) ,m_aListRowSet( getContext() ) ,m_nNULLPos(-1) - ,m_bBoundComponent(sal_False) + ,m_nBoundColumnType( DataType::SQLNULL ) { DBG_CTOR(OListBoxModel,NULL); @@ -189,7 +188,7 @@ namespace frm ,m_aBoundValues( _pOriginal->m_aBoundValues ) ,m_aDefaultSelectSeq( _pOriginal->m_aDefaultSelectSeq ) ,m_nNULLPos(-1) - ,m_bBoundComponent(sal_False) + ,m_nBoundColumnType( DataType::SQLNULL ) { DBG_CTOR(OListBoxModel,NULL); } @@ -629,7 +628,7 @@ namespace frm DBG_ASSERT( !hasExternalListSource(), "OListBoxModel::loadData: cannot load from DB when I have an external list source!" ); m_nNULLPos = -1; - m_bBoundComponent = sal_False; + m_nBoundColumnType = DataType::SQLNULL; // pre-requisites: // PRE1: connection @@ -701,25 +700,10 @@ namespace frm else { // otherwise look for the alias - Reference<XSQLQueryComposerFactory> xFactory(xConnection, UNO_QUERY); - if (!xFactory.is()) - break; - - Reference<XSQLQueryComposer> xComposer = xFactory->createQueryComposer(); - try - { - ::rtl::OUString aStatement; - xFormProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= aStatement; - xComposer->setQuery( aStatement ); - } - catch(Exception&) - { - disposeComponent(xComposer); - break; - } + Reference< XColumnsSupplier > xSupplyFields; + xFormProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupplyFields; // search the field - Reference<XColumnsSupplier> xSupplyFields(xComposer, UNO_QUERY); DBG_ASSERT(xSupplyFields.is(), "OListBoxModel::loadData : invalid query composer !"); Reference<XNameAccess> xFieldNames = xSupplyFields->getColumns(); @@ -730,7 +714,6 @@ namespace frm if (hasProperty(PROPERTY_FIELDSOURCE, xComposerFieldAsSet)) xComposerFieldAsSet->getPropertyValue(PROPERTY_FIELDSOURCE) >>= aFieldName; } - disposeComponent(xComposer); } } if (!aFieldName.getLength()) @@ -832,20 +815,19 @@ namespace frm ::dbtools::FormattedColumnValue aValueFormatter( getContext(), m_xCursor, xDataField ); // Feld der BoundColumn des ResultSets holen - sal_Int32 nBoundColumnType = DataType::SQLNULL; + m_nBoundColumnType = DataType::SQLNULL; if ( ( nBoundColumn > 0 ) && m_xColumn.is() ) { // don't look for a bound column if we're not connected to a field try { Reference< XPropertySet > xBoundField( xColumns->getByIndex( nBoundColumn ), UNO_QUERY_THROW ); - OSL_VERIFY( xBoundField->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) >>= nBoundColumnType ); + OSL_VERIFY( xBoundField->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) >>= m_nBoundColumnType ); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } } - m_bBoundComponent = ( nBoundColumnType != DataType::SQLNULL ); // Ist die LB an ein Feld gebunden und sind Leereintraege zulaessig // dann wird die Position fuer einen Leereintrag gemerkt @@ -860,9 +842,9 @@ namespace frm aStr = aValueFormatter.getFormattedValue(); aDisplayList.push_back( aStr ); - if ( m_bBoundComponent ) + if ( impl_hasBoundComponent() ) { - aBoundValue.fill( nBoundColumn + 1, nBoundColumnType, xCursorRow ); + aBoundValue.fill( nBoundColumn + 1, m_nBoundColumnType, xCursorRow ); aValueList.push_back( aBoundValue ); } @@ -907,7 +889,7 @@ namespace frm // NULL eintrag hinzufuegen if (bUseNULL && m_nNULLPos == -1) { - if ( m_bBoundComponent ) + if ( impl_hasBoundComponent() ) aValueList.insert( aValueList.begin(), ORowSetValue() ); aDisplayList.insert( aDisplayList.begin(), ORowSetValue( ::rtl::OUString() ) ); @@ -940,7 +922,7 @@ namespace frm { ValueList().swap(m_aBoundValues); m_nNULLPos = -1; - m_bBoundComponent = sal_False; + m_nBoundColumnType = DataType::SQLNULL; if ( !hasExternalListSource() ) setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( StringSequence() ) ); @@ -1035,7 +1017,7 @@ namespace frm Sequence< sal_Int16 > aSelectionIndicies; ORowSetValue aCurrentValue; - aCurrentValue.fill( getFieldType(), m_xColumn ); + aCurrentValue.fill( impl_hasBoundComponent() ? m_nBoundColumnType : getFieldType(), m_xColumn ); // reset selection for NULL values if ( aCurrentValue.isNull() ) diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index d2af81c1c52c..04db6069d89e 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -41,6 +41,7 @@ #include <com/sun/star/awt/XFocusListener.hpp> #include <com/sun/star/awt/XListBox.hpp> #include <com/sun/star/form/XChangeBroadcaster.hpp> +#include <com/sun/star/sdbc/DataType.hpp> /** === end UNO includes === **/ #include <comphelper/asyncnotification.hxx> @@ -82,7 +83,7 @@ class OListBoxModel :public OBoundControlModel // </properties> sal_Int16 m_nNULLPos; // position of the NULL value in our list - sal_Bool m_bBoundComponent : 1; + sal_Int32 m_nBoundColumnType; private: ::connectivity::ORowSetValue getFirstSelectedValue() const; @@ -177,6 +178,8 @@ private: void impl_refreshDbEntryList( bool _bForce ); ValueList impl_getValues() const; + + bool impl_hasBoundComponent() const { return m_nBoundColumnType != ::com::sun::star::sdbc::DataType::SQLNULL; } }; //================================================================== diff --git a/forms/source/inc/InterfaceContainer.hxx b/forms/source/inc/InterfaceContainer.hxx index 427d0c6ed190..90e508f43ca8 100644 --- a/forms/source/inc/InterfaceContainer.hxx +++ b/forms/source/inc/InterfaceContainer.hxx @@ -273,7 +273,7 @@ protected: private: // hack for Vba Events - void fakeVbaEventsHack( sal_Int32 _nIndex ); + void impl_addVbEvents_nolck_nothrow( const sal_Int32 i_nIndex ); // the runtime event format has changed from version SO5.2 to OOo enum EventFormat diff --git a/forms/source/inc/componenttools.hxx b/forms/source/inc/componenttools.hxx index 73771f19783a..e91573c43d2f 100644 --- a/forms/source/inc/componenttools.hxx +++ b/forms/source/inc/componenttools.hxx @@ -48,7 +48,7 @@ namespace frm typedef ::com::sun::star::uno::Type Type; public: - bool operator()( const Type& _rLHS, const Type& _rRHS ) + bool operator()( const Type& _rLHS, const Type& _rRHS ) const { return _rLHS.getTypeName() < _rRHS.getTypeName(); } @@ -85,7 +85,9 @@ namespace frm const TypeSequence& _rTypes3 ); - void addTypes( const TypeSequence& _rTypes ); + void addType( const Type& i_rType ); + void addTypes( const TypeSequence& _rTypes ); + void removeType( const Type& i_rType ); /** returns the types represented by this bag */ diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index b594df158d17..e494406f87ef 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -31,6 +31,7 @@ #include "frm_resource.hrc" #include "frm_resource.hxx" #include "InterfaceContainer.hxx" +#include "componenttools.hxx" #include "property.hrc" #include "services.hxx" @@ -40,6 +41,7 @@ #include <com/sun/star/io/XMarkableStream.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/form/XForm.hpp> #include <comphelper/container.hxx> #include <comphelper/enumhelper.hxx> @@ -119,54 +121,52 @@ lcl_stripVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents ) return sStripped; } -void -OInterfaceContainer::fakeVbaEventsHack( sal_Int32 _nIndex ) +void OInterfaceContainer::impl_addVbEvents_nolck_nothrow( const sal_Int32 i_nIndex ) { // we are dealing with form controls try { - Reference< XFormComponent > xForm( static_cast< XContainer* >(this), UNO_QUERY_THROW ); - // grand-parent should be the model, no parent ? if not - // we'll ignore, we'll get called back here anyway ) - Reference< XChild > xChild( xForm->getParent(), UNO_QUERY_THROW ); - Reference< XModel > xDocOwner( xChild->getParent(), UNO_QUERY ); - OSL_TRACE(" Is DOC ????? %s", xDocOwner.is() ? "true" : "false" ); - if ( xDocOwner.is() ) + do { - bool hasVBABindings = lcl_hasVbaEvents( m_xEventAttacher->getScriptEvents( _nIndex ) ); + Reference< XModel > xDoc( getXModel( static_cast< XContainer *> ( this ) ) ); + if ( !xDoc.is() ) + break; + + Reference< XMultiServiceFactory > xDocFac( xDoc, UNO_QUERY_THROW ); + Reference< XCodeNameQuery > xNameQuery( xDocFac->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBACodeNameProvider" ) ), UNO_QUERY ); + if ( !xNameQuery.is() ) + break; + + ::osl::MutexGuard aGuard( m_rMutex ); + bool hasVBABindings = lcl_hasVbaEvents( m_xEventAttacher->getScriptEvents( i_nIndex ) ); if ( hasVBABindings ) - { - OSL_TRACE("Has VBA bindings already, returning "); - return; - } - Reference< XMultiServiceFactory > xFac( comphelper::getProcessServiceFactory(), UNO_QUERY ); - Reference< XMultiServiceFactory > xDocFac( xDocOwner, UNO_QUERY ); - if ( xFac.is() && xDocFac.is() ) - { - try - { - Reference< ooo::vba::XVBAToOOEventDescGen > xDescSupplier( xFac->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBAToOOEventDesc" ) ), UNO_QUERY_THROW ); - Reference< XInterface > xIf( getByIndex( _nIndex ) , UNO_QUERY_THROW ); - Reference< XCodeNameQuery > xNameQuery( xDocFac->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBACodeNameProvider" ) ), UNO_QUERY_THROW ); - - rtl::OUString sCodeName; - sCodeName = xNameQuery->getCodeNameForObject( xIf ); - Reference< XPropertySet > xProps( xIf, UNO_QUERY ); - rtl::OUString sServiceName; - xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName; - - Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( xFac->createInstance( sServiceName ), sCodeName ); - // register the vba script events - if ( m_xEventAttacher.is() ) - m_xEventAttacher->registerScriptEvents( _nIndex, vbaEvents ); - } - catch( Exception& ){ OSL_TRACE("lcl_fakevbaevents - Caught Exception trying to create control eventstuff "); } - } + break; + + Reference< XInterface > xElement( getByIndex( i_nIndex ) , UNO_QUERY_THROW ); + Reference< XForm > xElementAsForm( xElement, UNO_QUERY ); + if ( xElementAsForm.is() ) + break; + ::rtl::OUString sCodeName( xNameQuery->getCodeNameForObject( xElement ) ); + + Reference< XPropertySet > xProps( xElement, UNO_QUERY_THROW ); + ::rtl::OUString sServiceName; + xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName; + + Reference< ooo::vba::XVBAToOOEventDescGen > xDescSupplier( m_xServiceFactory->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBAToOOEventDesc" ) ), UNO_QUERY_THROW ); + Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( m_xServiceFactory->createInstance( sServiceName ), sCodeName ); + // register the vba script events + m_xEventAttacher->registerScriptEvents( i_nIndex, vbaEvents ); } + while ( false ); + } + catch ( const ServiceNotRegisteredException& ) + { + // silence this, not all document types support the ooo.vba.VBACodeNameProvider service } - catch( Exception& ) + catch( const Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } @@ -827,8 +827,9 @@ void OInterfaceContainer::approveNewElement( const Reference< XPropertySet >& _r void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XPropertySet >& _rxElement, sal_Bool _bEvents, ElementDescription* _pApprovalResult, sal_Bool _bFire ) throw( IllegalArgumentException ) { - RTL_LOGFILE_CONTEXT( aLogger, "forms::OInterfaceContainer::implInsert" ); + const bool bHandleEvents = _bEvents && m_xEventAttacher.is(); + // SYNCHRONIZED -----> ::osl::ClearableMutexGuard aGuard( m_rMutex ); ::std::auto_ptr< ElementDescription > aAutoDeleteMetaData; @@ -866,17 +867,24 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper m_aMap.insert( ::std::pair< const ::rtl::OUString, InterfaceRef >( sName, pElementMetaData->xInterface ) ); // announce ourself as parent to the new element - { - RTL_LOGFILE_CONTEXT( aLogger, "forms::OInterfaceContainer::implInsert::settingParent" ); - pElementMetaData->xChild->setParent(static_cast<XContainer*>(this)); - } + pElementMetaData->xChild->setParent(static_cast<XContainer*>(this)); // handle the events - if ( _bEvents && m_xEventAttacher.is() ) + if ( bHandleEvents ) { m_xEventAttacher->insertEntry(_nIndex); m_xEventAttacher->attach( _nIndex, pElementMetaData->xInterface, makeAny( _rxElement ) ); - // insert fake events? + } + + // notify derived classes + implInserted( pElementMetaData ); + + aGuard.clear(); + // <----- SYNCHRONIZED + + // insert faked VBA events? + if ( bHandleEvents ) + { Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY ); if ( xMgr.is() ) { @@ -885,19 +893,16 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper for ( sal_Int32 i = 0; (i < nLen) && pIfcMgr ; ++i ) { // add fake events to the control at index i - pIfcMgr->fakeVbaEventsHack( i ); + pIfcMgr->impl_addVbEvents_nolck_nothrow( i ); } } else { // add fake events to the control at index i - fakeVbaEventsHack( _nIndex ); + impl_addVbEvents_nolck_nothrow( _nIndex ); } } - // notify derived classes - implInserted( pElementMetaData ); - // fire the notification about the change if ( _bFire ) { @@ -1187,29 +1192,30 @@ void SAL_CALL OInterfaceContainer::removeByName(const ::rtl::OUString& Name) thr //------------------------------------------------------------------------ void SAL_CALL OInterfaceContainer::registerScriptEvent( sal_Int32 nIndex, const ScriptEventDescriptor& aScriptEvent ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("*** registerScriptEvent %d", nIndex); + ::osl::ClearableMutexGuard aGuard( m_rMutex ); if ( m_xEventAttacher.is() ) { m_xEventAttacher->registerScriptEvent( nIndex, aScriptEvent ); - fakeVbaEventsHack( nIndex ); // add fake vba events + aGuard.clear(); + impl_addVbEvents_nolck_nothrow( nIndex ); // add fake vba events } } //------------------------------------------------------------------------ void SAL_CALL OInterfaceContainer::registerScriptEvents( sal_Int32 nIndex, const Sequence< ScriptEventDescriptor >& aScriptEvents ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("*** registerScriptEvent(s) %d", nIndex); + ::osl::ClearableMutexGuard aGuard( m_rMutex ); if ( m_xEventAttacher.is() ) { m_xEventAttacher->registerScriptEvents( nIndex, aScriptEvents ); - fakeVbaEventsHack( nIndex ); // add fake vba events + aGuard.clear(); + impl_addVbEvents_nolck_nothrow( nIndex ); // add fake vba events } } //------------------------------------------------------------------------ void SAL_CALL OInterfaceContainer::revokeScriptEvent( sal_Int32 nIndex, const ::rtl::OUString& aListenerType, const ::rtl::OUString& aEventMethod, const ::rtl::OUString& aRemoveListenerParam ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("*** revokeScriptEvent %d listenertype %s, eventMethod %s", nIndex, rtl::OUStringToOString( aListenerType, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aEventMethod, RTL_TEXTENCODING_UTF8 ).getStr()); if ( m_xEventAttacher.is() ) m_xEventAttacher->revokeScriptEvent( nIndex, aListenerType, aEventMethod, aRemoveListenerParam ); } @@ -1238,7 +1244,6 @@ void SAL_CALL OInterfaceContainer::removeEntry( sal_Int32 nIndex ) throw(Illegal //------------------------------------------------------------------------ Sequence< ScriptEventDescriptor > SAL_CALL OInterfaceContainer::getScriptEvents( sal_Int32 nIndex ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("getScriptEvents"); Sequence< ScriptEventDescriptor > aReturn; if ( m_xEventAttacher.is() ) { diff --git a/forms/source/misc/componenttools.cxx b/forms/source/misc/componenttools.cxx index 80e772dbd0da..bdba7456fa7f 100644 --- a/forms/source/misc/componenttools.cxx +++ b/forms/source/misc/componenttools.cxx @@ -84,6 +84,18 @@ namespace frm } //-------------------------------------------------------------------- + void TypeBag::addType( const Type& i_rType ) + { + m_aTypes.insert( i_rType ); + } + + //-------------------------------------------------------------------- + void TypeBag::removeType( const TypeBag::Type& i_rType ) + { + m_aTypes.erase( i_rType ); + } + + //-------------------------------------------------------------------- TypeBag::TypeSequence TypeBag::getTypes() const { TypeSequence aTypes( m_aTypes.size() ); diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index 48e6159585ab..68f3e0e7773f 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -48,6 +48,8 @@ #include <com/sun/star/form/XConfirmDeleteListener.hpp> #include <com/sun/star/sdb/RowChangeEvent.hpp> #include <com/sun/star/sdb/RowChangeAction.hpp> +#include <com/sun/star/sdb/SQLFilterOperator.hpp> +#include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/form/XReset.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> @@ -94,6 +96,7 @@ namespace frm using ::com::sun::star::form::runtime::FeatureState; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::sdbc::SQLException; + using namespace ::com::sun::star::sdbc; using ::com::sun::star::form::XForm; using ::com::sun::star::ucb::AlreadyInitializedException; using ::com::sun::star::util::XModifyBroadcaster; @@ -112,6 +115,7 @@ namespace frm using ::com::sun::star::sdbcx::XRowLocate; using ::com::sun::star::form::XConfirmDeleteListener; using ::com::sun::star::sdb::RowChangeEvent; + using namespace ::com::sun::star::sdb; using ::com::sun::star::form::XReset; using ::com::sun::star::beans::XMultiPropertySet; using ::com::sun::star::uno::makeAny; @@ -1684,7 +1688,23 @@ namespace frm void FormOperations::impl_appendFilterByColumn_throw( const void* _pActionParam ) const { const param_appendFilterByColumn* pParam = static_cast< const param_appendFilterByColumn* >( _pActionParam ); - m_xParser->appendFilterByColumn( pParam->xField, sal_True ); + sal_Int32 nOp = SQLFilterOperator::EQUAL; + if ( pParam->xField.is() ) + { + sal_Int32 nType = 0; + pParam->xField->getPropertyValue(PROPERTY_FIELDTYPE) >>= nType; + switch(nType) + { + case DataType::VARCHAR: + case DataType::CHAR: + case DataType::LONGVARCHAR: + nOp = SQLFilterOperator::LIKE; + break; + default: + nOp = SQLFilterOperator::EQUAL; + } + } + m_xParser->appendFilterByColumn( pParam->xField, sal_True,nOp ); } //------------------------------------------------------------------------------ diff --git a/forms/util/frm.map b/forms/util/frm.map deleted file mode 100644 index 7975644b139a..000000000000 --- a/forms/util/frm.map +++ /dev/null @@ -1,8 +0,0 @@ -FORMS_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/forms/util/makefile.mk b/forms/util/makefile.mk index 66de3cb83fb2..00d7a81d5a97 100644 --- a/forms/util/makefile.mk +++ b/forms/util/makefile.mk @@ -81,7 +81,7 @@ SHL1DEPN=$(LIB1TARGET) \ makefile.mk -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/javainstaller2/src/Helpfiles/makefile.mk b/javainstaller2/src/Helpfiles/makefile.mk index a45253613e5d..0f77f31a19ed 100755 --- a/javainstaller2/src/Helpfiles/makefile.mk +++ b/javainstaller2/src/Helpfiles/makefile.mk @@ -43,8 +43,15 @@ INPUT=java_ulffiles .INCLUDE : target.mk .IF "$(SOLAR_JAVA)"!="" +.IF "$(WITH_LANG)"=="" +ULFDIR:=$(PRJ)/src/Localization +.ELSE #"$(WITH_LANG)"=="" +ULFDIR:=$(COMMONMISC)/$(INPUT) +.ENDIF #"$(WITH_LANG)"=="" + + ALLTAR: $(BIN)$/Prologue.html -$(BIN)$/Prologue.html : create_helpfiles.pl helpfilenames.txt $(COMMONMISC)$/$(INPUT)$/setupstrings.ulf - $(PERL) create_helpfiles.pl $/ $(COMMONMISC)$/$(INPUT) $(BIN) +$(BIN)$/Prologue.html : create_helpfiles.pl helpfilenames.txt $(ULFDIR)/setupstrings.ulf + $(PERL) create_helpfiles.pl / $(ULFDIR) $(BIN) .ENDIF diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java index b9fa8f3af237..fa1ce919245c 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java @@ -163,6 +163,7 @@ public class LinuxInstaller extends Installer { File completePackage = new File(packagePath, packageName); packageName = completePackage.getPath(); + packageName = "\"" + packageName + "\""; // Quoting is necessary, if the path the the packages contains white spaces. if ( completePackage.exists() ) { String relocations = helper.getRelocationString(packageData, packageName); diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java index ccc1e7bf11df..ad3460159262 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java @@ -120,8 +120,8 @@ public class SolarisHelper { String mailLine = "mail="; adminFile.add(mailLine); - String conflictLine = "conflict=quit"; - if ( data.isUserInstallation() ) { conflictLine = "conflict=nocheck"; } + String conflictLine = "conflict=nochange"; + if ( data.isUserInstallation() ) { conflictLine = "conflict=nochange"; } adminFile.add(conflictLine); String runlevelLine = "runlevel=nocheck"; diff --git a/javainstaller2/src/Localization/makefile.mk b/javainstaller2/src/Localization/makefile.mk index 27f679318d85..30161590cdb8 100755 --- a/javainstaller2/src/Localization/makefile.mk +++ b/javainstaller2/src/Localization/makefile.mk @@ -30,7 +30,9 @@ PRJ=..$/.. PRJNAME=javainstaller2 TARGET=java_ulffiles +.IF "$(WITH_LANG)"!="" WITH_LANG!:=ALL +.ENDIF # "$(WITH_LANG)"!="" # --- Settings ----------------------------------------------------- diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphen.map b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphen.map deleted file mode 100644 index 1cc0ac1898a8..000000000000 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphen.map +++ /dev/null @@ -1,8 +0,0 @@ -LTH_1_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk index 415e76792b47..f3626c70312b 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/makefile.mk @@ -81,7 +81,7 @@ SHL1IMPLIB= i$(REALNAME) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP= $(REALNAME).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # build DEF file DEF1NAME =$(SHL1TARGET) diff --git a/lingucomponent/source/languageguessing/guesslang.map b/lingucomponent/source/languageguessing/guesslang.map deleted file mode 100644 index b34eff63c44f..000000000000 --- a/lingucomponent/source/languageguessing/guesslang.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/lingucomponent/source/languageguessing/makefile.mk b/lingucomponent/source/languageguessing/makefile.mk index f49e79060c4a..ebad4076b3ed 100644 --- a/lingucomponent/source/languageguessing/makefile.mk +++ b/lingucomponent/source/languageguessing/makefile.mk @@ -68,7 +68,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def .IF "$(OS)"!="MACOSX" -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF # build DEF file diff --git a/lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.map b/lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.map deleted file mode 100644 index bf1fbe0696c8..000000000000 --- a/lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.map +++ /dev/null @@ -1,8 +0,0 @@ -LEXPS_1_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/lingucomponent/source/spellcheck/macosxspell/makefile.mk b/lingucomponent/source/spellcheck/macosxspell/makefile.mk index f91ab46e1553..6414560e0f4a 100644 --- a/lingucomponent/source/spellcheck/macosxspell/makefile.mk +++ b/lingucomponent/source/spellcheck/macosxspell/makefile.mk @@ -81,7 +81,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Targets ------------------------------------------------------ diff --git a/lingucomponent/source/spellcheck/spell/makefile.mk b/lingucomponent/source/spellcheck/spell/makefile.mk index efedb6ad1008..4173d4dbae22 100644 --- a/lingucomponent/source/spellcheck/spell/makefile.mk +++ b/lingucomponent/source/spellcheck/spell/makefile.mk @@ -75,7 +75,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # build DEF file DEF1NAME =$(SHL1TARGET) diff --git a/lingucomponent/source/spellcheck/spell/spell.map b/lingucomponent/source/spellcheck/spell/spell.map deleted file mode 100644 index bf1fbe0696c8..000000000000 --- a/lingucomponent/source/spellcheck/spell/spell.map +++ /dev/null @@ -1,8 +0,0 @@ -LEXPS_1_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/lingucomponent/source/thesaurus/libnth/lnth.map b/lingucomponent/source/thesaurus/libnth/lnth.map deleted file mode 100644 index 1cc0ac1898a8..000000000000 --- a/lingucomponent/source/thesaurus/libnth/lnth.map +++ /dev/null @@ -1,8 +0,0 @@ -LTH_1_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/lingucomponent/source/thesaurus/libnth/makefile.mk b/lingucomponent/source/thesaurus/libnth/makefile.mk index dea6942bbef2..58e4d97e5561 100644 --- a/lingucomponent/source/thesaurus/libnth/makefile.mk +++ b/lingucomponent/source/thesaurus/libnth/makefile.mk @@ -95,7 +95,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # build DEF file DEF1NAME =$(SHL1TARGET) diff --git a/package/inc/PackageConstants.hxx b/package/inc/PackageConstants.hxx index e088dceef126..a23a22fcb888 100644 --- a/package/inc/PackageConstants.hxx +++ b/package/inc/PackageConstants.hxx @@ -33,10 +33,6 @@ const sal_Int32 n_ConstBufferSize = 32768; const sal_Int32 n_ConstMaxMemoryStreamSize = 20480; const sal_Int32 n_ConstDigestLength = 1024; -#define PACKAGE_FORMAT 1 -#define ZIP_FORMAT 2 -#define OFOPXML_FORMAT 3 - // the constants related to the manifest.xml entries #define PKG_MNFST_MEDIATYPE 0 #define PKG_MNFST_VERSION 1 diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 367bd1d80de5..e3b8d44be183 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -93,7 +93,7 @@ protected: sal_Bool m_bForceRecovery; sal_Bool m_bMediaTypeFallbackUsed; - sal_Int16 m_nFormat; + sal_Int32 m_nFormat; sal_Bool m_bAllowRemoveOnInsert; InitialisationMode m_eMode; @@ -125,7 +125,7 @@ public: virtual ~ZipPackage( void ); ZipFile& getZipFile() { return *m_pZipFile;} const com::sun::star::uno::Sequence < sal_Int8 > & getEncryptionKey ( ) {return m_aEncryptionKey;} - sal_Int16 getFormat() const { return m_nFormat; } + sal_Int32 getFormat() const { return m_nFormat; } SotMutexHolderRef GetSharedMutexRef() { return m_aMutexHolder; } diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx index 85823ba97c2c..89414f18ce65 100644 --- a/package/inc/ZipPackageFolder.hxx +++ b/package/inc/ZipPackageFolder.hxx @@ -58,13 +58,13 @@ class ZipPackageFolder : public cppu::ImplInheritanceHelper2 protected: ContentHash maContents; const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; - sal_Int16 m_nFormat; + sal_Int32 m_nFormat; ::rtl::OUString m_sVersion; public: ZipPackageFolder( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory, - sal_Int16 nFormat, + sal_Int32 nFormat, sal_Bool bAllowRemoveOnInsert ); virtual ~ZipPackageFolder(); @@ -87,7 +87,7 @@ public: return aImplementationId; } - void setPackageFormat_Impl( sal_Int16 nFormat ) { m_nFormat = nFormat; } + void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; } void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; } // Recursive functions diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 45bf7c01eb2f..fcb118f4b967 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -29,6 +29,7 @@ #include "precompiled_package.hxx" #include "ocompinstream.hxx" +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <osl/diagnose.h> @@ -41,7 +42,7 @@ using namespace ::com::sun::star; OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( &aImpl ) , m_rMutexRef( m_pImpl->m_rMutexRef ) , m_xStream( xStream ) @@ -60,7 +61,7 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, //----------------------------------------------- OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( NULL ) , m_rMutexRef( new SotMutexHolder ) , m_xStream( xStream ) @@ -107,7 +108,7 @@ uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) if ( aReturn.hasValue() == sal_True ) return aReturn ; - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface ( rType @@ -356,7 +357,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); try @@ -384,7 +385,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -409,7 +410,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -434,7 +435,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByI throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); // TODO/LATER: in future the unification of the ID could be checked @@ -464,7 +465,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; @@ -499,7 +500,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); // TODO/LATER: in future the information could be taken directly from m_pImpl when possible @@ -530,7 +531,7 @@ void SAL_CALL OInputCompStream::insertRelationshipByID( const ::rtl::OUString& throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied @@ -550,7 +551,7 @@ void SAL_CALL OInputCompStream::removeRelationshipByID( const ::rtl::OUString& throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied @@ -570,7 +571,7 @@ void SAL_CALL OInputCompStream::insertRelationships( const uno::Sequence< uno:: throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied @@ -589,7 +590,7 @@ void SAL_CALL OInputCompStream::clearRelationships() throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx index 047c8dc90758..fcb472e3f92a 100644 --- a/package/source/xstor/ocompinstream.hxx +++ b/package/source/xstor/ocompinstream.hxx @@ -60,17 +60,17 @@ protected: sal_Bool m_bDisposed; - sal_Int16 m_nStorageType; + sal_Int32 m_nStorageType; public: OInputCompStream( OWriteStream_Impl& pImpl, ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OInputCompStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); virtual ~OInputCompStream(); diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx index 6419889d9d11..0cd3f595c2b3 100644 --- a/package/source/xstor/oseekinstream.cxx +++ b/package/source/xstor/oseekinstream.cxx @@ -39,7 +39,7 @@ using namespace ::com::sun::star; OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl, uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : OInputCompStream( pImpl, xStream, aProps, nStorageType ) { if ( m_xStream.is() ) @@ -51,7 +51,7 @@ OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl, OInputSeekStream::OInputSeekStream( uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : OInputCompStream( xStream, aProps, nStorageType ) { if ( m_xStream.is() ) diff --git a/package/source/xstor/oseekinstream.hxx b/package/source/xstor/oseekinstream.hxx index f8572d717956..92a611af16aa 100644 --- a/package/source/xstor/oseekinstream.hxx +++ b/package/source/xstor/oseekinstream.hxx @@ -42,11 +42,11 @@ public: OInputSeekStream( OWriteStream_Impl& pImpl, ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OInputSeekStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); virtual ~OInputSeekStream(); diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index c5381a11cfea..2e81c80c4321 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -244,7 +245,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, const uno::Reference< lang::XSingleServiceFactory >& xPackage, const uno::Reference< lang::XMultiServiceFactory >& xFactory, sal_Bool bForceEncrypted, - sal_Int16 nStorageType, + sal_Int32 nStorageType, sal_Bool bDefaultCompress, const uno::Reference< io::XInputStream >& xRelInfoStream ) : m_pAntiImpl( NULL ) @@ -254,7 +255,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, , m_xFactory( xFactory ) , m_pParent( pParent ) , m_bForceEncrypted( bForceEncrypted ) -, m_bUseCommonPass( !bForceEncrypted && nStorageType == PACKAGE_STORAGE ) +, m_bUseCommonPass( !bForceEncrypted && nStorageType == embed::StorageFormats::PACKAGE ) , m_bHasCachedPassword( sal_False ) , m_bCompressedSetExplicit( !bDefaultCompress ) , m_xPackage( xPackage ) @@ -269,7 +270,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, OSL_ENSURE( xPackage.is(), "No package component is provided!\n" ); OSL_ENSURE( m_xFactory.is(), "No package stream is provided!\n" ); OSL_ENSURE( pParent, "No parent storage is provided!\n" ); - OSL_ENSURE( m_nStorageType == OFOPXML_STORAGE || !m_xOrigRelInfoStream.is(), "The Relations info makes sence only for OFOPXML format!\n" ); + OSL_ENSURE( m_nStorageType == embed::StorageFormats::OFOPXML || !m_xOrigRelInfoStream.is(), "The Relations info makes sence only for OFOPXML format!\n" ); } //----------------------------------------------- @@ -359,7 +360,7 @@ void OWriteStream_Impl::InsertIntoPackageFolder( const ::rtl::OUString& aName, //----------------------------------------------- sal_Bool OWriteStream_Impl::IsEncrypted() { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) return sal_False; if ( m_bForceEncrypted || m_bHasCachedPassword ) @@ -419,8 +420,8 @@ sal_Bool OWriteStream_Impl::IsEncrypted() //----------------------------------------------- void OWriteStream_Impl::SetDecrypted() { - OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE, "The encryption is supported only for package storages!\n" ); - if ( m_nStorageType != PACKAGE_STORAGE ) + OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE, "The encryption is supported only for package storages!\n" ); + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); GetStreamProperties(); @@ -444,8 +445,8 @@ void OWriteStream_Impl::SetDecrypted() //----------------------------------------------- void OWriteStream_Impl::SetEncryptedWithPass( const ::rtl::OUString& aPass ) { - OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE, "The encryption is supported only for package storages!\n" ); - if ( m_nStorageType != PACKAGE_STORAGE ) + OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE, "The encryption is supported only for package storages!\n" ); + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); GetStreamProperties(); @@ -789,12 +790,12 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt bCompressedIsSet = sal_True; aProps[nInd].Value >>= bCompressed; } - else if ( ( m_nStorageType == OFOPXML_STORAGE || m_nStorageType == PACKAGE_STORAGE ) + else if ( ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE ) && aProps[nInd].Name.equals( aMedTypePropName ) ) { xPropertySet->setPropertyValue( aProps[nInd].Name, aProps[nInd].Value ); } - else if ( m_nStorageType == PACKAGE_STORAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) + else if ( m_nStorageType == embed::StorageFormats::PACKAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) aProps[nInd].Value >>= m_bUseCommonPass; else throw lang::IllegalArgumentException(); @@ -816,7 +817,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt if ( m_bUseCommonPass ) { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); // set to be encrypted but do not use encryption key @@ -915,7 +916,7 @@ void OWriteStream_Impl::Commit() if ( m_bUseCommonPass ) { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); // set to be encrypted but do not use encryption key @@ -926,7 +927,7 @@ void OWriteStream_Impl::Commit() } else if ( m_bHasCachedPassword ) { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ), @@ -972,7 +973,7 @@ void OWriteStream_Impl::Revert() m_bHasCachedPassword = sal_False; m_aPass = ::rtl::OUString(); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // currently the relations storage is changed only on commit m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -1011,7 +1012,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( uno::Sequence< beans::PropertyValue > aResult( aProps ); sal_Int32 nLen = aResult.getLength(); - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) if ( aResult[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) @@ -1024,7 +1025,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( aResult[nLen - 1].Name = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ); aResult[nLen - 1].Value <<= bUseCommonPass; } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { ReadRelInfoIfNecessary(); @@ -1061,7 +1062,7 @@ sal_Bool OWriteStream_Impl::IsTransacted() void OWriteStream_Impl::ReadRelInfoIfNecessary() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( m_nRelInfoStatus == RELINFO_NO_INIT ) @@ -1114,24 +1115,24 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary() uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProperties() { sal_Int32 nPropNum = 0; - if ( m_nStorageType == ZIP_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::ZIP ) nPropNum = 2; - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) nPropNum = 3; - else if ( m_nStorageType == PACKAGE_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::PACKAGE ) nPropNum = 4; uno::Sequence< beans::PropertyValue > aResult( nPropNum ); // The "Compressed" property must be set after "MediaType" property, // since the setting of the last one can change the value of the first one - if ( m_nStorageType == OFOPXML_STORAGE || m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE ) { aResult[0].Name = ::rtl::OUString::createFromAscii("MediaType"); aResult[1].Name = ::rtl::OUString::createFromAscii("Compressed"); aResult[2].Name = ::rtl::OUString::createFromAscii("Size"); - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) aResult[3].Name = ::rtl::OUString::createFromAscii("Encrypted"); } else @@ -1177,7 +1178,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream OSL_ENSURE( !m_bUseCommonPass, "The stream can not be encrypted!" ); - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException(); if ( m_pAntiImpl ) @@ -1201,7 +1202,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream //----------------------------------------------- uno::Sequence< uno::Sequence< beans::StringPair > > OWriteStream_Impl::GetAllRelationshipsIfAny() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return uno::Sequence< uno::Sequence< beans::StringPair > >(); ReadRelInfoIfNecessary(); @@ -1516,7 +1517,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream() { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; - if ( m_nStorageType != PACKAGE_STORAGE || !m_pParent ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE || !m_pParent ) throw packages::NoEncryptionException(); return m_pParent->GetCommonRootPass(); @@ -1702,9 +1703,9 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStorage >& xRelStorage, const ::rtl::OUString& aOrigStreamName, const ::rtl::OUString& aNewStreamName ) { // at this point of time the old stream must be already cleaned - OSL_ENSURE( m_nStorageType == OFOPXML_STORAGE, "The method should be used only with OFOPXML format!\n" ); + OSL_ENSURE( m_nStorageType == embed::StorageFormats::OFOPXML, "The method should be used only with OFOPXML format!\n" ); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { OSL_ENSURE( aOrigStreamName.getLength() && aNewStreamName.getLength() && xRelStorage.is(), "Wrong relation persistence information is provided!\n" ); @@ -1972,12 +1973,12 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea // the order of the properties setting is not important for StorageStream API ::rtl::OUString aPropName = ::rtl::OUString::createFromAscii( "Compressed" ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); - if ( m_pData->m_nStorageType == PACKAGE_STORAGE || m_pData->m_nStorageType == OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aPropName = ::rtl::OUString::createFromAscii( "MediaType" ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { aPropName = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); @@ -2023,13 +2024,13 @@ uno::Any SAL_CALL OWriteStream::queryInterface( const uno::Type& rType ) if ( aReturn.hasValue() == sal_True ) return aReturn ; - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { aReturn <<= ::cppu::queryInterface ( rType , static_cast<embed::XEncryptionProtectedSource*> ( this ) ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface ( rType @@ -2077,7 +2078,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() { if ( m_bTransacted ) { - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2093,7 +2094,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2109,7 +2110,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else // if ( m_pData->m_nStorageType == ZIP_STORAGE ) + else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2127,7 +2128,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() } else { - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2140,7 +2141,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2153,7 +2154,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else // if ( m_pData->m_nStorageType == ZIP_STORAGE ) + else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2752,7 +2753,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); try @@ -2783,7 +2784,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -2808,7 +2809,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -2833,7 +2834,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID( throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); // TODO/LATER: in future the unification of the ID could be checked @@ -2863,7 +2864,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getRe throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; @@ -2898,7 +2899,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getAl throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); return m_pImpl->GetAllRelationshipsIfAny(); @@ -2918,7 +2919,7 @@ void SAL_CALL OWriteStream::insertRelationshipByID( const ::rtl::OUString& sID, throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -2983,7 +2984,7 @@ void SAL_CALL OWriteStream::removeRelationshipByID( const ::rtl::OUString& sID throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -3025,7 +3026,7 @@ void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequ throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -3107,7 +3108,7 @@ void SAL_CALL OWriteStream::clearRelationships() throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); m_pImpl->m_aNewRelInfo.realloc( 0 ); @@ -3144,7 +3145,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa m_pImpl->GetStreamProperties(); ::rtl::OUString aCompressedString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ); ::rtl::OUString aMediaTypeString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); - if ( m_pData->m_nStorageType == PACKAGE_STORAGE && aPropertyName.equals( aMediaTypeString ) ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equals( aMediaTypeString ) ) { // if the "Compressed" property is not set explicitly, the MediaType can change the default value sal_Bool bCompressedValueFromType = sal_True; @@ -3177,7 +3178,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa m_pImpl->m_aProps[nInd].Value = aValue; } } - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) { sal_Bool bUseCommonPass = sal_False; @@ -3202,7 +3203,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa else throw lang::IllegalArgumentException(); //TODO } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equals( aMediaTypeString ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equals( aMediaTypeString ) ) { for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { @@ -3210,7 +3211,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa m_pImpl->m_aProps[nInd].Value = aValue; } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equalsAscii( "RelationsInfoStream" ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfoStream" ) ) { uno::Reference< io::XInputStream > xInRelStream; if ( ( aValue >>= xInRelStream ) && xInRelStream.is() ) @@ -3231,7 +3232,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa else throw lang::IllegalArgumentException(); // TODO } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equalsAscii( "RelationsInfo" ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfo" ) ) { if ( aValue >>= m_pImpl->m_aNewRelInfo ) { @@ -3241,7 +3242,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa } else if ( aPropertyName.equalsAscii( "Size" ) ) throw beans::PropertyVetoException(); // TODO - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "IsEncrypted" ) || aPropertyName.equalsAscii( "Encrypted" ) ) ) throw beans::PropertyVetoException(); // TODO else @@ -3277,9 +3278,9 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) else aPropertyName = aProp; - if ( ( ( m_pData->m_nStorageType == PACKAGE_STORAGE || m_pData->m_nStorageType == OFOPXML_STORAGE ) + if ( ( ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) && aPropertyName.equalsAscii( "MediaType" ) ) - || m_pData->m_nStorageType == PACKAGE_STORAGE && aPropertyName.equalsAscii( "Encrypted" ) + || m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "Encrypted" ) || aPropertyName.equalsAscii( "Compressed" ) ) { m_pImpl->GetStreamProperties(); @@ -3290,7 +3291,7 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) return m_pImpl->m_aProps[nInd].Value; } } - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) return uno::makeAny( m_pImpl->m_bUseCommonPass ); else if ( aPropertyName.equalsAscii( "Size" ) ) diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx index 94b97fb09eb2..0d4a29893887 100644 --- a/package/source/xstor/owriteablestream.hxx +++ b/package/source/xstor/owriteablestream.hxx @@ -83,10 +83,10 @@ struct WSInternalData_Impl SotMutexHolderRef m_rSharedMutexRef; ::cppu::OTypeCollection* m_pTypeCollection; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners - sal_Int16 m_nStorageType; + sal_Int32 m_nStorageType; // the mutex reference MUST NOT be empty - WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int16 nStorageType ) + WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int32 nStorageType ) : m_rSharedMutexRef( rMutexRef ) , m_pTypeCollection( NULL ) , m_aListenersContainer( rMutexRef->GetMutex() ) @@ -137,7 +137,7 @@ struct OWriteStream_Impl : public PreCreationStruct sal_Bool m_bHasInsertedStreamOptimization; - sal_Int16 m_nStorageType; + sal_Int32 m_nStorageType; // Relations info related data, stored in *.rels file in OFOPXML format ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xOrigRelInfoStream; @@ -175,7 +175,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >& xPackage, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, sal_Bool bForceEncrypted, - sal_Int16 nStorageType, + sal_Int32 nStorageType, sal_Bool bDefaultCompress, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xRelInfoStream = ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >() ); diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index e78742641a0b..68c393fed08b 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -29,9 +29,11 @@ #include "precompiled_package.hxx" #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/io/XSeekable.hpp> +#include <comphelper/storagehelper.hxx> #include "xfactory.hxx" #include "xstorage.hxx" @@ -101,7 +103,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstance() embed::ElementModes::READWRITE, uno::Sequence< beans::PropertyValue >(), m_xFactory, - PACKAGE_STORAGE ) ), + embed::StorageFormats::PACKAGE ) ), uno::UNO_QUERY ); } @@ -184,7 +186,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr uno::Sequence< beans::PropertyValue > aDescr; uno::Sequence< beans::PropertyValue > aPropsToSet; - sal_Int16 nStorageType = PACKAGE_STORAGE; + sal_Int32 nStorageType = embed::StorageFormats::PACKAGE; if ( nArgNum >= 3 ) { @@ -212,15 +214,29 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr else if ( aDescr[nInd].Name.equalsAscii( "StorageFormat" ) ) { ::rtl::OUString aFormatName; - aDescr[nInd].Value >>= aFormatName; - if ( aFormatName.equalsAscii( "PackageFormat" ) ) - nStorageType = PACKAGE_STORAGE; - else if ( aFormatName.equalsAscii( "ZipFormat" ) ) - nStorageType = ZIP_STORAGE; - else if ( aFormatName.equalsAscii( "OFOPXMLFormat" ) ) - nStorageType = OFOPXML_STORAGE; + sal_Int32 nFormatID = 0; + if ( aDescr[nInd].Value >>= aFormatName ) + { + if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) ) + nStorageType = embed::StorageFormats::PACKAGE; + else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) ) + nStorageType = embed::StorageFormats::ZIP; + else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) + nStorageType = embed::StorageFormats::OFOPXML; + else + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + } + else if ( aDescr[nInd].Value >>= nFormatID ) + { + if ( nFormatID != embed::StorageFormats::PACKAGE + && nFormatID != embed::StorageFormats::ZIP + && nFormatID != embed::StorageFormats::OFOPXML ) + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + + nStorageType = nFormatID; + } else - throw lang::IllegalArgumentException(); // TODO: + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); } else OSL_ENSURE( sal_False, "Unacceptable property, will be ignored!\n" ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 55ff5a87e78d..007f199332c5 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/UseBackupException.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -72,7 +73,7 @@ struct StorInternalData_Impl ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners ::cppu::OTypeCollection* m_pTypeCollection; sal_Bool m_bIsRoot; - sal_Int16 m_nStorageType; // the mode in wich the storage is used + sal_Int32 m_nStorageType; // the mode in wich the storage is used sal_Bool m_bReadOnlyWrap; OChildDispListener_Impl* m_pSubElDispListener; @@ -82,12 +83,12 @@ struct StorInternalData_Impl ::rtl::Reference< OHierarchyHolder_Impl > m_rHierarchyHolder; // the mutex reference MUST NOT be empty - StorInternalData_Impl( const SotMutexHolderRef& rMutexRef, sal_Bool bRoot, sal_Int16 nStorType, sal_Bool bReadOnlyWrap ) + StorInternalData_Impl( const SotMutexHolderRef& rMutexRef, sal_Bool bRoot, sal_Int32 nStorageType, sal_Bool bReadOnlyWrap ) : m_rSharedMutexRef( rMutexRef ) , m_aListenersContainer( rMutexRef->GetMutex() ) , m_pTypeCollection( NULL ) , m_bIsRoot( bRoot ) - , m_nStorageType( nStorType ) + , m_nStorageType( nStorageType ) , m_bReadOnlyWrap( bReadOnlyWrap ) , m_pSubElDispListener( NULL ) {} @@ -102,7 +103,7 @@ struct StorInternalData_Impl void OStorage_Impl::completeStorageStreamCopy_Impl( const uno::Reference< io::XStream >& xSource, const uno::Reference< io::XStream >& xDest, - sal_Int16 nStorageType, + sal_Int32 nStorageType, const uno::Sequence< uno::Sequence< beans::StringPair > >& aRelInfo ) { uno::Reference< beans::XPropertySet > xSourceProps( xSource, uno::UNO_QUERY ); @@ -124,13 +125,13 @@ void OStorage_Impl::completeStorageStreamCopy_Impl( uno::Sequence< ::rtl::OUString > aPropNames( 1 ); aPropNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ); - if ( nStorageType == PACKAGE_STORAGE ) + if ( nStorageType == embed::StorageFormats::PACKAGE ) { aPropNames.realloc( 3 ); aPropNames[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); aPropNames[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ); } - else if ( nStorageType == OFOPXML_STORAGE ) + else if ( nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: in future it might make sence to provide the stream if there is one uno::Reference< embed::XRelationshipAccess > xRelAccess( xDest, uno::UNO_QUERY_THROW ); @@ -195,7 +196,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_rMutexRef( new SotMutexHolder ) , m_pAntiImpl( NULL ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) @@ -235,7 +236,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_rMutexRef( new SotMutexHolder ) , m_pAntiImpl( NULL ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) @@ -278,7 +279,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, uno::Reference< container::XNameContainer > xPackageFolder, uno::Reference< lang::XSingleServiceFactory > xPackage, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_rMutexRef( new SotMutexHolder ) , m_pAntiImpl( NULL ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) @@ -356,7 +357,7 @@ OStorage_Impl::~OStorage_Impl() m_aDeletedList.clear(); - if ( m_nStorageType == OFOPXML_STORAGE && m_pRelStorElement ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_pRelStorElement ) { delete m_pRelStorElement; m_pRelStorElement = NULL; @@ -500,7 +501,7 @@ void OStorage_Impl::OpenOwnPackage() } } - if ( m_nStorageType == ZIP_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::ZIP ) { // let the package support only plain zip format beans::NamedValue aNamedValue; @@ -509,7 +510,7 @@ void OStorage_Impl::OpenOwnPackage() aArguments.realloc( ++nArgNum ); aArguments[nArgNum-1] <<= aNamedValue; } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // let the package support OFOPXML media type handling beans::NamedValue aNamedValue; @@ -562,7 +563,7 @@ SotElementList_Impl& OStorage_Impl::GetChildrenList() //----------------------------------------------- void OStorage_Impl::GetStorageProperties() { - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { uno::Reference< beans::XPropertySet > xProps( m_xPackageFolder, uno::UNO_QUERY_THROW ); @@ -588,7 +589,7 @@ void OStorage_Impl::GetStorageProperties() //----------------------------------------------- void OStorage_Impl::ReadRelInfoIfNecessary() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( m_nRelInfoStatus == RELINFO_NO_INIT ) @@ -662,7 +663,7 @@ void OStorage_Impl::ReadContents() uno::Reference< container::XNameContainer > xNameContainer( xNamed, uno::UNO_QUERY ); SotElement_Impl* pNewElement = new SotElement_Impl( aName, xNameContainer.is(), sal_False ); - if ( m_nStorageType == OFOPXML_STORAGE && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) { if ( !pNewElement->m_bIsStorage ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: Unexpected format @@ -730,7 +731,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes } // move storage properties to the destination one ( means changeable properties ) - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { ::rtl::OUString aMediaTypeString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); ::rtl::OUString aVersionString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ); @@ -738,7 +739,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes xPropSet->setPropertyValue( aVersionString, uno::makeAny( m_aVersion ) ); } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { // if this is a root storage, the common key from current one should be moved there sal_Bool bIsRoot = sal_False; @@ -759,7 +760,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes } } } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: currently the optimization is not active @@ -850,13 +851,13 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, } } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { aStrProps.realloc( ++nNum ); aStrProps[nNum-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ); aStrProps[nNum-1].Value <<= (sal_Bool)( pElement->m_pStream->UsesCommonPass_Impl() ); } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: currently the optimization is not active // uno::Reference< io::XInputStream > xInStream = GetRelInfoStreamForName( ::rtl::OUString() ); // own rels stream @@ -907,7 +908,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, pElement->m_pStream->CopyInternallyTo_Impl( xSubStr ); } } - else if ( m_nStorageType != PACKAGE_STORAGE ) + else if ( m_nStorageType != embed::StorageFormats::PACKAGE ) { OSL_ENSURE( sal_False, "Encryption is only supported in package storage!\n" ); throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -994,7 +995,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, //----------------------------------------------- uno::Sequence< uno::Sequence< beans::StringPair > > OStorage_Impl::GetAllRelationshipsIfAny() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return uno::Sequence< uno::Sequence< beans::StringPair > >(); ReadRelInfoIfNecessary(); @@ -1088,7 +1089,7 @@ void OStorage_Impl::Commit() pDeletedIter++ ) { - if ( m_nStorageType == OFOPXML_STORAGE && !(*pDeletedIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pDeletedIter)->m_bIsStorage ) RemoveStreamRelInfo( (*pDeletedIter)->m_aOriginalName ); // the removed elements are not in new temporary storage @@ -1108,7 +1109,7 @@ void OStorage_Impl::Commit() if ( (*pElementIter)->m_bIsRemoved ) { - if ( m_nStorageType == OFOPXML_STORAGE && !(*pElementIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pElementIter)->m_bIsStorage ) RemoveStreamRelInfo( (*pElementIter)->m_aOriginalName ); // the removed elements are not in new temporary storage @@ -1158,7 +1159,7 @@ void OStorage_Impl::Commit() } else if ( !(*pElementIter)->m_bIsStorage && (*pElementIter)->m_pStream && (*pElementIter)->m_pStream->m_bFlushed ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitStreamRelInfo( *pElementIter ); // the renamed elements are not in new temporary storage @@ -1184,7 +1185,7 @@ void OStorage_Impl::Commit() xNewPackageFolder->removeByName( (*pElementIter)->m_aOriginalName ); xNewPackageFolder->insertByName( (*pElementIter)->m_aName, aPackageElement ); - if ( m_nStorageType == OFOPXML_STORAGE && !(*pElementIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pElementIter)->m_bIsStorage ) { if ( !(*pElementIter)->m_pStream ) { @@ -1233,7 +1234,7 @@ void OStorage_Impl::Commit() if ( (*pElementIter)->m_pStream->m_bFlushed ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitStreamRelInfo( *pElementIter ); (*pElementIter)->m_pStream->InsertIntoPackageFolder( (*pElementIter)->m_aName, xNewPackageFolder ); @@ -1244,7 +1245,7 @@ void OStorage_Impl::Commit() } } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { // move properties to the destination package folder uno::Reference< beans::XPropertySet > xProps( xNewPackageFolder, uno::UNO_QUERY ); @@ -1255,7 +1256,7 @@ void OStorage_Impl::Commit() xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), uno::makeAny( m_aVersion ) ); } - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitRelInfo( xNewPackageFolder ); // store own relations and commit complete relations storage if ( m_bIsRoot ) @@ -1349,7 +1350,7 @@ void OStorage_Impl::Revert() GetStorageProperties(); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // currently the relations storage is changed only on commit m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -1364,7 +1365,7 @@ void OStorage_Impl::Revert() { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( m_bIsRoot ) @@ -1422,8 +1423,8 @@ SotElement_Impl* OStorage_Impl::InsertStream( ::rtl::OUString aName, sal_Bool bE if ( !xPackageSubStream.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE || !bEncr, "Only package storage supports encryption!\n" ); - if ( m_nStorageType != PACKAGE_STORAGE && bEncr ) + OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE || !bEncr, "Only package storage supports encryption!\n" ); + if ( m_nStorageType != embed::StorageFormats::PACKAGE && bEncr ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the mode is not needed for storage stream internal implementation @@ -1445,7 +1446,7 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( ::rtl::OUString aName, const un if ( !m_xPackage.is() ) throw embed::InvalidStorageException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Reference< io::XSeekable > xSeek( xInStream, uno::UNO_QUERY ); @@ -1726,7 +1727,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName ) // this method should be used only in OStorage_Impl::Commit() method // the aOriginalName can be empty, in this case the storage relation info should be removed - if ( m_nStorageType == OFOPXML_STORAGE && m_xRelStorage.is() ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_xRelStorage.is() ) { ::rtl::OUString aRelStreamName = aOriginalName; aRelStreamName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".rels" ) ); @@ -1739,7 +1740,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName ) //----------------------------------------------- void OStorage_Impl::CreateRelStorage() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( !m_xRelStorage.is() ) @@ -1772,7 +1773,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) if ( !pStreamElement ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType == OFOPXML_STORAGE && pStreamElement->m_pStream ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && pStreamElement->m_pStream ) { OSL_ENSURE( pStreamElement->m_aName.getLength(), "The name must not be empty!\n" ); @@ -1789,7 +1790,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) //----------------------------------------------- uno::Reference< io::XInputStream > OStorage_Impl::GetRelInfoStreamForName( const ::rtl::OUString& aName ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { ReadContents(); if ( m_xRelStorage.is() ) @@ -1817,7 +1818,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain if ( !xNewPackageFolder.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( m_nRelInfoStatus == RELINFO_BROKEN || m_nRelInfoStatus == RELINFO_CHANGED_BROKEN ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -1923,7 +1924,7 @@ OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( new OStorage_Impl( xInputStream, nMode, xProperties, xFactory, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; @@ -1935,7 +1936,7 @@ OStorage::OStorage( uno::Reference< io::XStream > xStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( new OStorage_Impl( xStream, nMode, xProperties, xFactory, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; @@ -2259,7 +2260,7 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) if ( aReturn.hasValue() == sal_True ) return aReturn ; - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( m_pData->m_bIsRoot ) { @@ -2275,7 +2276,7 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) , static_cast<embed::XStorageRawAccess*> ( this ) ); } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface ( rType @@ -2314,7 +2315,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() if ( m_pData->m_pTypeCollection == NULL ) { - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( m_pData->m_bIsRoot ) { @@ -2340,7 +2341,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2482,7 +2483,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name @@ -2583,7 +2584,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap ) @@ -2693,7 +2694,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( if ( !aStorName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -2848,7 +2849,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const ::rtl if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -2930,7 +2931,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( !aPass.getLength() ) @@ -3087,7 +3088,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( !aStorName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -3181,7 +3182,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const ::rtl::OUString& aElementName if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable name @@ -3250,7 +3251,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const ::rtl::OUString& aElementNam if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); @@ -3323,7 +3324,7 @@ void SAL_CALL OStorage::removeElement( const ::rtl::OUString& aElementName ) if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name @@ -3418,7 +3419,7 @@ void SAL_CALL OStorage::renameElement( const ::rtl::OUString& aElementName, cons || !aNewName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // TODO: unacceptable element name @@ -3529,7 +3530,7 @@ void SAL_CALL OStorage::copyElementTo( const ::rtl::OUString& aElementName, // || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name @@ -3633,7 +3634,7 @@ void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName, if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name @@ -3743,7 +3744,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface is not supported and must not be accessible if ( !sStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) @@ -3853,7 +3854,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !sStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) @@ -3973,7 +3974,7 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const ::rtl::OUString& aStre throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) @@ -4334,7 +4335,7 @@ uno::Any SAL_CALL OStorage::getByName( const ::rtl::OUString& aName ) if ( !aName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name @@ -4439,7 +4440,7 @@ sal_Bool SAL_CALL OStorage::hasByName( const ::rtl::OUString& aName ) if ( !aName.getLength() ) return sal_False; - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) return sal_False; @@ -4616,7 +4617,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage OSL_ENSURE( m_pData->m_bIsRoot, "setEncryptionPassword() method is not available for nonroot storages!\n" ); @@ -4682,7 +4683,7 @@ void SAL_CALL OStorage::removeEncryption() throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage OSL_ENSURE( m_pData->m_bIsRoot, "removeEncryption() method is not available for nonroot storages!\n" ); @@ -4783,9 +4784,9 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, if ( m_pData->m_bReadOnlyWrap && !aPropertyName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: Access denied - if ( m_pData->m_nStorageType == ZIP_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( aPropertyName.equalsAscii( "MediaType" ) ) { @@ -4818,7 +4819,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, else throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( aPropertyName.equalsAscii( "RelationsInfoStream" ) ) { @@ -4885,7 +4886,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType == PACKAGE_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "MediaType" ) || aPropertyName.equalsAscii( "MediaTypeFallbackUsed" ) || aPropertyName.equalsAscii( "Version" ) ) ) @@ -4943,7 +4944,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa return uno::makeAny( sal_False ); // RepairPackage } - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "HasEncryptedEntries" ) || aPropertyName.equalsAscii( "HasNonEncryptedEntries" ) || aPropertyName.equalsAscii( "IsInconsistent" ) ) ) @@ -5078,7 +5079,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); try @@ -5109,7 +5110,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -5134,7 +5135,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -5159,7 +5160,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO/LATER: in future the unification of the ID could be checked @@ -5189,7 +5190,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelati throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; @@ -5225,7 +5226,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getAllRel throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return m_pImpl->GetAllRelationshipsIfAny(); @@ -5245,7 +5246,7 @@ void SAL_CALL OStorage::insertRelationshipByID( const ::rtl::OUString& sID, con throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -5310,7 +5311,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -5352,7 +5353,7 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -5434,7 +5435,7 @@ void SAL_CALL OStorage::clearRelationships() throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); m_pImpl->m_aRelInfo.realloc( 0 ); @@ -5487,7 +5488,7 @@ void SAL_CALL OStorage::insertStreamElementDirect( if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -5584,7 +5585,7 @@ void SAL_CALL OStorage::copyElementDirectlyTo( if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable name @@ -5840,7 +5841,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const ::rtl::OUString& aEle if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name @@ -5851,7 +5852,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const ::rtl::OUString& aEle throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO/LATER: Currently it is only implemented for MediaType property of substorages, might be changed in future - if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != PACKAGE_STORAGE || !aPropertyName.equalsAscii( "MediaType" ) ) + if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != embed::StorageFormats::PACKAGE || !aPropertyName.equalsAscii( "MediaType" ) ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStorage ) @@ -5943,7 +5944,7 @@ void SAL_CALL OStorage::copyStreamElementData( const ::rtl::OUString& aStreamNam if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable name @@ -6090,7 +6091,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !aStreamPath.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) ) diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index bc90b71e4d93..f1c50e4d67bd 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -57,11 +57,6 @@ #include "mutexholder.hxx" - -#define PACKAGE_STORAGE 0 -#define ZIP_STORAGE 1 -#define OFOPXML_STORAGE 2 - #define RELINFO_NO_INIT 1 #define RELINFO_READ 2 #define RELINFO_CHANGED 3 @@ -177,9 +172,9 @@ struct OStorage_Impl SwitchablePersistenceStream* m_pSwitchStream; - sal_Int16 m_nStorageType; // the mode in wich the storage is used + sal_Int32 m_nStorageType; // the mode in wich the storage is used - // the _rels substorage that is handled in a special way in OFOPXML_STORAGE + // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML SotElement_Impl* m_pRelStorElement; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo; @@ -193,13 +188,13 @@ struct OStorage_Impl sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); // constructor for a substorage OStorage_Impl( OStorage_Impl* pParent, @@ -207,7 +202,7 @@ struct OStorage_Impl ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); ~OStorage_Impl(); @@ -287,7 +282,7 @@ struct OStorage_Impl static void completeStorageStreamCopy_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSource, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDest, - sal_Int16 nStorageType, + sal_Int32 nStorageType, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aRelInfo ); }; @@ -330,13 +325,13 @@ public: sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap ); diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 14ef46190f3d..2238cf870d02 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -787,14 +787,14 @@ sal_Int32 ZipFile::readCEN() aEntry.nOffset += nLocPos; aEntry.nOffset *= -1; - if ( aEntry.nPathLen < 0 || aEntry.nPathLen > ZIP_MAXNAMELEN ) - throw ZipException( OUString( RTL_CONSTASCII_USTRINGPARAM ( "name length exceeds ZIP_MAXNAMELEN bytes" ) ), Reference < XInterface > () ); + if ( aEntry.nPathLen < 0 ) + throw ZipException( OUString( RTL_CONSTASCII_USTRINGPARAM ( "unexpected name length" ) ), Reference < XInterface > () ); - if ( nCommentLen < 0 || nCommentLen > ZIP_MAXNAMELEN ) - throw ZipException( OUString( RTL_CONSTASCII_USTRINGPARAM ( "comment length exceeds ZIP_MAXNAMELEN bytes" ) ), Reference < XInterface > () ); + if ( nCommentLen < 0 ) + throw ZipException( OUString( RTL_CONSTASCII_USTRINGPARAM ( "unexpected comment length" ) ), Reference < XInterface > () ); - if ( aEntry.nExtraLen < 0 || aEntry.nExtraLen > ZIP_MAXEXTRA ) - throw ZipException( OUString( RTL_CONSTASCII_USTRINGPARAM ( "extra header info exceeds ZIP_MAXEXTRA bytes") ), Reference < XInterface > () ); + if ( aEntry.nExtraLen < 0 ) + throw ZipException( OUString( RTL_CONSTASCII_USTRINGPARAM ( "unexpected extra header info length") ), Reference < XInterface > () ); // read always in UTF8, some tools seem not to set UTF8 bit aEntry.sPath = rtl::OUString::intern ( (sal_Char *) aMemGrabber.getCurrentPos(), @@ -879,7 +879,7 @@ sal_Int32 ZipFile::recover() sal_Int32 nDataSize = ( aEntry.nMethod == DEFLATED ) ? aEntry.nCompressedSize : aEntry.nSize; sal_Int32 nBlockLength = nDataSize + aEntry.nPathLen + aEntry.nExtraLen + 30 + nDescrLength; - if ( aEntry.nPathLen <= ZIP_MAXNAMELEN && aEntry.nExtraLen < ZIP_MAXEXTRA + if ( aEntry.nPathLen >= 0 && aEntry.nExtraLen >= 0 && ( nGenPos + nPos + nBlockLength ) <= nLength ) { // read always in UTF8, some tools seem not to set UTF8 bit diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 5c22bad46a6a..9ba26e0100c5 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -61,6 +61,7 @@ #include <com/sun/star/io/XActiveDataStreamer.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/UseBackupException.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <cppuhelper/implbase1.hxx> #include <ContentInfo.hxx> @@ -183,7 +184,7 @@ ZipPackage::ZipPackage (const uno::Reference < XMultiServiceFactory > &xNewFacto , m_bUseManifest ( sal_True ) , m_bForceRecovery ( sal_False ) , m_bMediaTypeFallbackUsed ( sal_False ) -, m_nFormat( PACKAGE_FORMAT ) // package is the default format +, m_nFormat( embed::StorageFormats::PACKAGE ) // package is the default format , m_bAllowRemoveOnInsert( sal_True ) , m_eMode ( e_IMode_None ) , m_xFactory( xNewFactory ) @@ -217,7 +218,7 @@ ZipPackage::~ZipPackage( void ) void ZipPackage::parseManifest() { - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) { sal_Bool bManifestParsed = sal_False; const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) ); @@ -427,7 +428,7 @@ void ZipPackage::parseManifest() void ZipPackage::parseContentType() { - if ( m_nFormat == OFOPXML_FORMAT ) + if ( m_nFormat == embed::StorageFormats::OFOPXML ) { const ::rtl::OUString aContentTypes( RTL_CONSTASCII_USTRINGPARAM ( "[Content_Types].xml" ) ); try { @@ -507,7 +508,14 @@ void ZipPackage::getZipFileContents() nIndex = nOldIndex = 0; pCurrent = m_pRootFolder; const ZipEntry & rEntry = *pEnum->nextElement(); - const OUString & rName = rEntry.sPath; + OUString rName = rEntry.sPath; + + if ( m_bForceRecovery ) + { + // the PKZIP Application note version 6.2 does not allows to use '\' as separator + // unfortunately it is used by some implementations, so we have to support it in recovery mode + rName = rName.replace( '\\', '/' ); + } nStreamIndex = rName.lastIndexOf ( '/' ); if ( nStreamIndex != -1 ) @@ -551,9 +559,9 @@ void ZipPackage::getZipFileContents() } } - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) parseManifest(); - else if ( m_nFormat == OFOPXML_FORMAT ) + else if ( m_nFormat == embed::StorageFormats::OFOPXML ) parseContentType(); } @@ -593,13 +601,13 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) } else if ( aCommand.equals( OUString::createFromAscii( "purezip" ) ) ) { - m_nFormat = ZIP_FORMAT; + m_nFormat = embed::StorageFormats::ZIP; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); break; } else if ( aCommand.equals( OUString::createFromAscii( "ofopxml" ) ) ) { - m_nFormat = OFOPXML_FORMAT; + m_nFormat = embed::StorageFormats::OFOPXML; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); break; } @@ -654,20 +662,34 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) sal_Bool bPackFormat = sal_True; aNamedValue.Value >>= bPackFormat; if ( !bPackFormat ) - m_nFormat = ZIP_FORMAT; + m_nFormat = embed::StorageFormats::ZIP; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } else if ( aNamedValue.Name.equalsAscii( "StorageFormat" ) ) { ::rtl::OUString aFormatName; - aNamedValue.Value >>= aFormatName; - if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) ) - m_nFormat = PACKAGE_FORMAT; - else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) ) - m_nFormat = ZIP_FORMAT; - else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) - m_nFormat = OFOPXML_FORMAT; + sal_Int32 nFormatID = 0; + if ( aNamedValue.Value >>= aFormatName ) + { + if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) ) + m_nFormat = embed::StorageFormats::PACKAGE; + else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) ) + m_nFormat = embed::StorageFormats::ZIP; + else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) + m_nFormat = embed::StorageFormats::OFOPXML; + else + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + } + else if ( aNamedValue.Value >>= nFormatID ) + { + if ( nFormatID != embed::StorageFormats::PACKAGE + && nFormatID != embed::StorageFormats::ZIP + && nFormatID != embed::StorageFormats::OFOPXML ) + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + + m_nFormat = nFormatID; + } else throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); @@ -1135,7 +1157,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() try { - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) { // Remove the old manifest.xml file as the // manifest will be re-generated and the @@ -1157,7 +1179,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // Write a magic file with mimetype WriteMimetypeMagicFile( aZipOut ); } - else if ( m_nFormat == OFOPXML_FORMAT ) + else if ( m_nFormat == embed::StorageFormats::OFOPXML ) { // Remove the old [Content_Types].xml file as the // file will be re-generated @@ -1175,7 +1197,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() const OUString sVersion ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ); const OUString sFullPath ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) { Sequence < PropertyValue > aPropSeq ( PKG_SIZE_NOENCR_MNFST ); aPropSeq [PKG_MNFST_MEDIATYPE].Name = sMediaType; @@ -1204,11 +1226,11 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // Clean up random pool memory rtl_random_destroyPool ( aRandomPool ); - if( m_bUseManifest && m_nFormat == PACKAGE_FORMAT ) + if( m_bUseManifest && m_nFormat == embed::StorageFormats::PACKAGE ) { WriteManifest( aZipOut, aManList ); } - else if( m_nFormat == OFOPXML_FORMAT ) + else if( m_nFormat == embed::StorageFormats::OFOPXML ) { WriteContentTypes( aZipOut, aManList ); } @@ -1618,7 +1640,7 @@ uno::Reference< XPropertySetInfo > SAL_CALL ZipPackage::getPropertySetInfo( ) void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - if ( m_nFormat != PACKAGE_FORMAT ) + if ( m_nFormat != embed::StorageFormats::PACKAGE ) throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasEncryptedEntries") ) @@ -1643,7 +1665,7 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { // TODO/LATER: Activate the check when zip-ucp is ready - // if ( m_nFormat != PACKAGE_FORMAT ) + // if ( m_nFormat != embed::StorageFormats::PACKAGE ) // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); Any aAny; diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 0bed74128467..b4648426049e 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -34,6 +34,7 @@ #include <PackageConstants.hxx> #include <ZipPackageFolderEnumeration.hxx> #include <com/sun/star/packages/zip/ZipConstants.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <vos/diagnose.hxx> #include <osl/time.h> #include <rtl/digest.h> @@ -61,7 +62,7 @@ using vos::ORef; Sequence < sal_Int8 > ZipPackageFolder::aImplementationId = Sequence < sal_Int8 > (); ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xFactory, - sal_Int16 nFormat, + sal_Int32 nFormat, sal_Bool bAllowRemoveOnInsert ) : m_xFactory( xFactory ) , m_nFormat( nFormat ) @@ -317,7 +318,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr sal_Bool bHaveEncryptionKey = rEncryptionKey.getLength() ? sal_True : sal_False; - if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != OFOPXML_FORMAT ) + if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != embed::StorageFormats::OFOPXML ) { // it is an empty subfolder, use workaround to store it ZipEntry* pTempEntry = new ZipEntry(); @@ -539,11 +540,11 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr // If the entry is already stored in the zip file in the format we // want for this write...copy it raw - if ( !bUseNonSeekableAccess && - ( bRawStream || bTransportOwnEncrStreamAsRaw || - ( pStream->IsPackageMember() && !bToBeEncrypted && - ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed ) || - ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) + if ( !bUseNonSeekableAccess + && ( bRawStream || bTransportOwnEncrStreamAsRaw + || ( pStream->IsPackageMember() && !bToBeEncrypted + && ( ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed ) + || ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) ) { // If it's a PackageMember, then it's an unbuffered stream and we need // to get a new version of it as we can't seek backwards. @@ -689,7 +690,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr } // folder can have a mediatype only in package format - if ( m_nFormat == PACKAGE_FORMAT || ( m_nFormat == OFOPXML_FORMAT && !rInfo.bFolder ) ) + if ( m_nFormat == embed::StorageFormats::PACKAGE || ( m_nFormat == embed::StorageFormats::OFOPXML && !rInfo.bFolder ) ) rManList.push_back( aPropSet ); } @@ -741,7 +742,7 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType"))) { // TODO/LATER: activate when zip ucp is ready - // if ( m_nFormat != PACKAGE_FORMAT ) + // if ( m_nFormat != embed::StorageFormats::PACKAGE ) // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); aValue >>= sMediaType; @@ -759,7 +760,7 @@ Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName ) if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) { // TODO/LATER: activate when zip ucp is ready - // if ( m_nFormat != PACKAGE_FORMAT ) + // if ( m_nFormat != embed::StorageFormats::PACKAGE ) // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return makeAny ( sMediaType ); diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index b6893b5cb2ad..6343607c8711 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -28,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_package.hxx" #include <com/sun/star/packages/zip/ZipConstants.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/packages/zip/ZipIOException.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp> @@ -611,7 +612,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, { if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType"))) { - if ( rZipPackage.getFormat() != PACKAGE_FORMAT && rZipPackage.getFormat() != OFOPXML_FORMAT ) + if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE && rZipPackage.getFormat() != embed::StorageFormats::OFOPXML ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( aValue >>= sMediaType ) @@ -640,7 +641,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, } else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Encrypted") ) ) { - if ( rZipPackage.getFormat() != PACKAGE_FORMAT ) + if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); sal_Bool bEnc = sal_False; @@ -664,7 +665,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, } else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EncryptionKey") ) ) { - if ( rZipPackage.getFormat() != PACKAGE_FORMAT ) + if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); Sequence < sal_Int8 > aNewKey; diff --git a/package/util/exports.map b/package/util/exports.map deleted file mode 100644 index 7e12f34d1b86..000000000000 --- a/package/util/exports.map +++ /dev/null @@ -1,8 +0,0 @@ -PKG_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/setup_native/prj/d.lst b/setup_native/prj/d.lst index 9d429454ebba..6aa6460d1823 100644 --- a/setup_native/prj/d.lst +++ b/setup_native/prj/d.lst @@ -1,4 +1,5 @@ mkdir: %_DEST%\bin%_EXT%\osl +mkdir: %_DEST%\bin%_EXT%\broffice ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll ..\%__SRC%\bin\*.exe %_DEST%\bin%_EXT%\*.exe ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar @@ -31,7 +32,15 @@ mkdir: %_DEST%\bin%_EXT%\osolsmf ..\source\linux\*.dat %_DEST%\bin%_EXT%\*.dat ..\source\mac\*.icns %_DEST%\bin%_EXT%\*.icns ..\source\mac\Info.plist.langpack %_DEST%\bin%_EXT%\Info.plist.langpack +..\source\mac\ooo\osxdndinstall.png %_DEST%\bin%_EXT%\osl\osxdndinstall.png +..\source\mac\ooo\osxdndinstall_nologo.png %_DEST%\bin%_EXT%\osl\osxdndinstall_nologo.png +..\source\mac\ooo\DS_Store %_DEST%\bin%_EXT%\osl\DS_Store +..\source\mac\ooo\DS_Store_Langpack %_DEST%\bin%_EXT%\osl\DS_Store_Langpack +..\source\mac\broffice\osxdndinstall.png %_DEST%\bin%_EXT%\broffice\osxdndinstall.png +..\source\mac\broffice\osxdndinstall_nologo.png %_DEST%\bin%_EXT%\broffice\osxdndinstall_nologo.png +..\source\mac\broffice\DS_Store %_DEST%\bin%_EXT%\broffice\DS_Store ..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif +..\source\java\brofficeorg_setup.gif %_DEST%\bin%_EXT%\broffice\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 @@ -39,6 +48,7 @@ mkdir: %_DEST%\bin%_EXT%\osolsmf ..\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\linuxcopyrightfile %_DEST%\bin%_EXT%\linuxcopyrightfile ..\source\packinfo\*.txt %_DEST%\bin%_EXT%\*.txt ..\source\packinfo\*.pcp %_DEST%\bin%_EXT%\*.pcp ..\scripts\admin.pl %_DEST%\bin%_EXT%\admin.pl diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index 77a7f18fbc7d..89588d0c4d03 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -190,13 +190,11 @@ sub convert_stringlist_into_array { $first = $1; $last = $2; - if ( defined($ENV{'USE_SHELL'}) && $ENV{'USE_SHELL'} eq "4nt" ) { $first =~ s/\//\\/g; } # Problem with two directly following listseparators. For example a path with two ";;" directly behind each other $first =~ s/^$listseparator//; push(@newarray, "$first\n"); } - if ( defined($ENV{'USE_SHELL'}) && $ENV{'USE_SHELL'} eq "4nt" ) { $last =~ s/\//\\/g; } push(@newarray, "$last\n"); return \@newarray; @@ -382,11 +380,8 @@ sub try_to_create_directory { $created_directory = 1; - if ( defined $ENV{'USE_SHELL'} && $ENV{'USE_SHELL'} ne "4nt" ) - { - my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1"; - system($localcall); - } + my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1"; + system($localcall); } else { @@ -837,20 +832,14 @@ sub create_directory_with_privileges if ($returnvalue) { - if ( defined $ENV{'USE_SHELL'} && $ENV{'USE_SHELL'} ne "4nt" ) - { - my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; - system($localcall); - } + my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; + system($localcall); } } else { - if ( defined $ENV{'USE_SHELL'} && $ENV{'USE_SHELL'} ne "4nt" ) - { - my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; - system($localcall); - } + my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1"; + system($localcall); } } diff --git a/setup_native/scripts/makefile.mk b/setup_native/scripts/makefile.mk index b8fc6649eddf..de91bd011efe 100644 --- a/setup_native/scripts/makefile.mk +++ b/setup_native/scripts/makefile.mk @@ -50,7 +50,8 @@ UNIXTEXT= \ UNIXTEXT+= $(BIN)$/stclient_wrapper.sh .ENDIF -FAKEDB=$(BIN)$/noarch/fake-db-1.0-0.noarch.rpm +NOARCH=$(BIN)$/noarch +FAKEDB=$(NOARCH)/fake-db-1.0-0.noarch.rpm FAKEDBROOT=$(COMMONMISC)/$(TARGET)/fake-db-root # --- Targets ------------------------------------------------------ @@ -58,7 +59,7 @@ FAKEDBROOT=$(COMMONMISC)/$(TARGET)/fake-db-root .ENDIF # L10N_framework .INCLUDE : target.mk .IF "$(L10N_framework)"=="" -.IF "$(OS)" == "SOLARIS" || "$(OS)" == "LINUX" +.IF "$(OS)" == "SOLARIS" || ( "$(OS)" == "LINUX" && "$(PKGFORMAT)"!="$(PKGFORMAT:s/rpm//)" ) ALLTAR: $(BIN)$/install $(BIN)$/uninstall @@ -69,18 +70,21 @@ $(BIN)$/install: install_$(OS:l).sh .ENDIF .IF "$(OS)" == "LINUX" +.IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/rpm//)" $(FAKEDB) : fake-db.spec $(MKDIRHIER) $(FAKEDBROOT) $(RPM) --define "_builddir $(shell @cd $(FAKEDBROOT) && pwd)" --define "_rpmdir $(shell @cd $(BIN) && pwd)" -bb $< + chmod g+w $(NOARCH) $(BIN)$/install: $(FAKEDB) +.ENDIF # "$(PKGFORMAT)"!="$(PKGFORMAT:s/rpm//)" $(BIN)$/uninstall: uninstall_linux.sh $(TYPE) $< | tr -d "\015" > $@ -chmod 775 $@ -.ENDIF +.ENDIF # "$(OS)" == "LINUX" .IF "$(OS)" == "SOLARIS" diff --git a/setup_native/source/java/brofficeorg_setup.gif b/setup_native/source/java/brofficeorg_setup.gif Binary files differnew file mode 100644 index 000000000000..570d8e462a27 --- /dev/null +++ b/setup_native/source/java/brofficeorg_setup.gif diff --git a/setup_native/source/java/javaversion.dat b/setup_native/source/java/javaversion.dat index 17084cc92234..a629a4037269 100755 --- a/setup_native/source/java/javaversion.dat +++ b/setup_native/source/java/javaversion.dat @@ -26,30 +26,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 18 -WINDOWSJAVAVERSION=Java 6 Update 18 +JAVAVERSION=Java 6 Update 20 +WINDOWSJAVAVERSION=Java 6 Update 20 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u18-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_18 +WINDOWSJAVAFILENAME=jre-6u20-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_20 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u18-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u20-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp <filename> ) -LINUXJAVANAME=jre-1.6.0_18-fcs +LINUXJAVANAME=jre-1.6.0_20-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u18-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u20-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_18_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_18_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_18_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_20_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_20_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_20_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_18_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_18_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_18_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_20_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_20_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_20_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 17084cc92234..a629a4037269 100644 --- a/setup_native/source/java/javaversion2.dat +++ b/setup_native/source/java/javaversion2.dat @@ -26,30 +26,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 18 -WINDOWSJAVAVERSION=Java 6 Update 18 +JAVAVERSION=Java 6 Update 20 +WINDOWSJAVAVERSION=Java 6 Update 20 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u18-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_18 +WINDOWSJAVAFILENAME=jre-6u20-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_20 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u18-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u20-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp <filename> ) -LINUXJAVANAME=jre-1.6.0_18-fcs +LINUXJAVANAME=jre-1.6.0_20-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u18-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u20-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_18_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_18_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_18_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_20_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_20_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_20_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_18_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_18_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_18_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_20_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_20_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_20_x86.tar.gz # Solaris (pkgUnit.xml, needs only to be changed in major changes) SOLARISJAVART=SUNWj6rt diff --git a/setup_native/source/mac/broffice/DS_Store b/setup_native/source/mac/broffice/DS_Store Binary files differnew file mode 100644 index 000000000000..06aad72c93a0 --- /dev/null +++ b/setup_native/source/mac/broffice/DS_Store diff --git a/setup_native/source/mac/broffice/osxdndinstall.png b/setup_native/source/mac/broffice/osxdndinstall.png Binary files differnew file mode 100644 index 000000000000..233d4bbc84b9 --- /dev/null +++ b/setup_native/source/mac/broffice/osxdndinstall.png diff --git a/setup_native/source/mac/broffice/osxdndinstall_nologo.png b/setup_native/source/mac/broffice/osxdndinstall_nologo.png Binary files differnew file mode 100644 index 000000000000..8c5636ec05ca --- /dev/null +++ b/setup_native/source/mac/broffice/osxdndinstall_nologo.png diff --git a/setup_native/source/mac/ooo/DS_Store b/setup_native/source/mac/ooo/DS_Store Binary files differnew file mode 100644 index 000000000000..632e6aff95be --- /dev/null +++ b/setup_native/source/mac/ooo/DS_Store diff --git a/setup_native/source/mac/ooo/DS_Store_Langpack b/setup_native/source/mac/ooo/DS_Store_Langpack Binary files differnew file mode 100644 index 000000000000..1b53eba75b74 --- /dev/null +++ b/setup_native/source/mac/ooo/DS_Store_Langpack diff --git a/setup_native/source/mac/ooo/osxdndinstall.png b/setup_native/source/mac/ooo/osxdndinstall.png Binary files differnew file mode 100644 index 000000000000..7eb5c76649bb --- /dev/null +++ b/setup_native/source/mac/ooo/osxdndinstall.png diff --git a/setup_native/source/mac/ooo/osxdndinstall_nologo.png b/setup_native/source/mac/ooo/osxdndinstall_nologo.png Binary files differnew file mode 100644 index 000000000000..7133e7387ac1 --- /dev/null +++ b/setup_native/source/mac/ooo/osxdndinstall_nologo.png diff --git a/setup_native/source/packinfo/linuxcopyrightfile b/setup_native/source/packinfo/linuxcopyrightfile new file mode 100644 index 000000000000..6e2c0ef08e79 --- /dev/null +++ b/setup_native/source/packinfo/linuxcopyrightfile @@ -0,0 +1,2 @@ +Copyright 2000, 2010 Oracle and/or its affiliates. All rights reserved. +Use is subject to license terms. diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt index b9c26f9f9572..fb04b347fcdf 100755 --- a/setup_native/source/packinfo/packinfo_office.txt +++ b/setup_native/source/packinfo/packinfo_office.txt @@ -732,6 +732,22 @@ packageversion = "%PACKAGEVERSION" End Start +module = "gid_Module_Root_Extension_Dictionary_Ku_Tr" +script = "shellscripts_extensions.txt" +solarispackagename = "%PACKAGEPREFIX%WITHOUTDOTUNIXPRODUCTNAME%BRANDPACKAGEVERSION-dict-ku-TR" +solarisrequires = "%SOLSUREPACKAGEPREFIX-ure, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07, %PACKAGEPREFIX%WITHOUTDOTUNIXPRODUCTNAME%BRANDPACKAGEVERSION" +packagename = "%UNIXPRODUCTNAME%BRANDPACKAGEVERSION-dict-ku-TR" +requires = "%UREPACKAGEPREFIX-ure,%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07,%UNIXPRODUCTNAME%BRANDPACKAGEVERSION" +linuxpatchrequires = "" +copyright = "1999-2009 by Sun Microsystems" +solariscopyright = "solariscopyrightfile" +vendor = "Sun Microsystems, Inc." +description = "Ku-TR dictionary for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start module = "gid_Module_Root_Extension_Dictionary_Lt" script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-lt" diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index 526058086f67..8d5cb0fc83b8 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -25,6 +25,7 @@ hu = "hu,de-DE,en-US" it = "it,de-DE,en-US,fr" ja = "EMPTY,en-US" ko = "EMPTY,en-US" +ku = "ku-TR,en-US" lt = "lt,en-US" nb = "no,en-US,fr,de-DE,es" ne = "ne,en-US" diff --git a/setup_native/source/win32/customactions/reg4allmsdoc/exports.dxp b/setup_native/source/win32/customactions/reg4allmsdoc/exports.dxp index 364ebc705df8..566981ba569e 100644 --- a/setup_native/source/win32/customactions/reg4allmsdoc/exports.dxp +++ b/setup_native/source/win32/customactions/reg4allmsdoc/exports.dxp @@ -1 +1,3 @@ FindRegisteredExtensions +LookForRegisteredExtensions +RegisterSomeExtensions
\ No newline at end of file diff --git a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx index 1be921ca5846..3aba597098fb 100644 --- a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx +++ b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx @@ -68,6 +68,11 @@ static const CHAR* g_Extensions[] = 0 }; +static const int WORD_START = 0; +static const int EXCEL_START = 7; +static const int POWERPOINT_START = 15; +static const int POWERPOINT_END = 23; + // ".xlam", // Office Excel 2007 XML macro-enabled add-in // ".ppam", // Office PowerPoint 2007 macro-enabled XML add-in // ".ppsm", // Office PowerPoint 2007 macro-enabled XML show @@ -90,15 +95,6 @@ static inline void OutputDebugStringFormat( LPCSTR, ... ) #endif //---------------------------------------------------------- -static bool IsModuleSelectedForInstallation( MSIHANDLE handle, LPCTSTR name ) -{ - INSTALLSTATE current_state; - INSTALLSTATE future_state; - MsiGetFeatureState(handle, name, ¤t_state, &future_state); - return (future_state == INSTALLSTATE_LOCAL); -} - -//---------------------------------------------------------- static BOOL CheckExtensionInRegistry( LPCSTR lpSubKey ) { BOOL bRet = false; @@ -264,6 +260,23 @@ bool IsSetMsiProp( MSIHANDLE handle, LPCSTR name ) } //---------------------------------------------------------- +static void registerForExtension( MSIHANDLE handle, const int nIndex, bool bRegister ) +{ + CHAR sPropName[256]; + StringCchCopyA( sPropName, 256, "REGISTER_" ); + StringCchCatA( sPropName, 256, (g_Extensions[nIndex])+1 ); + CharUpperBuffA( sPropName+9, 4 ); + + if ( bRegister ) { + MsiSetPropertyA( handle, sPropName, "1" ); + OutputDebugStringFormat( "Set MSI property %s.\n", sPropName ); + } else { + MsiSetPropertyA( handle, sPropName, "0" ); + OutputDebugStringFormat( "Unset MSI property %s.\n", sPropName ); + } +} + +//---------------------------------------------------------- static void registerForExtensions( MSIHANDLE handle, BOOL bRegisterAll ) { // Check all file extensions int nIndex = 0; @@ -271,23 +284,180 @@ static void registerForExtensions( MSIHANDLE handle, BOOL bRegisterAll ) { BOOL bRegister = bRegisterAll || CheckExtensionInRegistry( g_Extensions[nIndex] ); if ( bRegister ) - { - CHAR sPropName[256]; - StringCchCopyA( sPropName, 256, "REGISTER_" ); - StringCchCatA( sPropName, 256, (g_Extensions[nIndex])+1 ); - CharUpperBuffA( sPropName+9, 4 ); - MsiSetPropertyA( handle, sPropName, "1" ); - OutputDebugStringFormat( "Set MSI property %s.\n", sPropName ); - } + registerForExtension( handle, nIndex, true ); + ++nIndex; + } +} + +//---------------------------------------------------------- +static bool checkSomeExtensionInRegistry( const int nStart, const int nEnd ) +{ // Check all file extensions + int nIndex = nStart; + bool bFound = false; + + while ( !bFound && ( g_Extensions[nIndex] != 0 ) && ( nIndex < nEnd ) ) + { + bFound = ! CheckExtensionInRegistry( g_Extensions[nIndex] ); + + if ( bFound ) + OutputDebugStringFormat( "Found registration for [%s].\n", g_Extensions[nIndex] ); + ++nIndex; } + return bFound; } //---------------------------------------------------------- +static void registerSomeExtensions( MSIHANDLE handle, const int nStart, const int nEnd, bool bRegister ) +{ // Check all file extensions + int nIndex = nStart; + + while ( ( g_Extensions[nIndex] != 0 ) && ( nIndex < nEnd ) ) + { + registerForExtension( handle, nIndex++, bRegister ); + } +} + //---------------------------------------------------------- //---------------------------------------------------------- +//---------------------------------------------------------- +extern "C" UINT __stdcall LookForRegisteredExtensions( MSIHANDLE handle ) +{ + OutputDebugStringFormat( "LookForRegisteredExtensions: " ); + + INSTALLSTATE current_state; + INSTALLSTATE future_state; + + bool bWriterEnabled = false; + bool bCalcEnabled = false; + bool bImpressEnabled = false; + bool bRegisterNone = IsSetMsiProp( handle, "REGISTER_NO_MSO_TYPES" ); + + if ( ( ERROR_SUCCESS == MsiGetFeatureState( handle, L"gm_p_Wrt", ¤t_state, &future_state ) ) && + ( (future_state == INSTALLSTATE_LOCAL) || ((current_state == INSTALLSTATE_LOCAL) && (future_state == INSTALLSTATE_UNKNOWN) ) ) ) + bWriterEnabled = true; + + OutputDebugStringFormat( "LookForRegisteredExtensions: Install state Writer is [%d], will be [%d]", current_state, future_state ); + if ( bWriterEnabled ) + OutputDebugStringFormat( "LookForRegisteredExtensions: Writer is enabled" ); + else + OutputDebugStringFormat( "LookForRegisteredExtensions: Writer is NOT enabled" ); + + if ( ( ERROR_SUCCESS == MsiGetFeatureState( handle, L"gm_p_Calc", ¤t_state, &future_state ) ) && + ( (future_state == INSTALLSTATE_LOCAL) || ((current_state == INSTALLSTATE_LOCAL) && (future_state == INSTALLSTATE_UNKNOWN) ) ) ) + bCalcEnabled = true; + + OutputDebugStringFormat( "LookForRegisteredExtensions: Install state Calc is [%d], will be [%d]", current_state, future_state ); + if ( bCalcEnabled ) + OutputDebugStringFormat( "LookForRegisteredExtensions: Calc is enabled" ); + else + OutputDebugStringFormat( "LookForRegisteredExtensions: Calc is NOT enabled" ); + + if ( ( ERROR_SUCCESS == MsiGetFeatureState( handle, L"gm_p_Impress", ¤t_state, &future_state ) ) && + ( (future_state == INSTALLSTATE_LOCAL) || ((current_state == INSTALLSTATE_LOCAL) && (future_state == INSTALLSTATE_UNKNOWN) ) ) ) + bImpressEnabled = true; + + OutputDebugStringFormat( "LookForRegisteredExtensions: Install state Impress is [%d], will be [%d]", current_state, future_state ); + if ( bImpressEnabled ) + OutputDebugStringFormat( "LookForRegisteredExtensions: Impress is enabled" ); + else + OutputDebugStringFormat( "LookForRegisteredExtensions: Impress is NOT enabled" ); + + MsiSetPropertyA( handle, "SELECT_WORD", "" ); + MsiSetPropertyA( handle, "SELECT_EXCEL", "" ); + MsiSetPropertyA( handle, "SELECT_POWERPOINT", "" ); + + if ( ! bRegisterNone ) + { + if ( IsSetMsiProp( handle, "REGISTER_ALL_MSO_TYPES" ) ) + { + if ( bWriterEnabled ) + MsiSetPropertyA( handle, "SELECT_WORD", "1" ); + if ( bCalcEnabled ) + MsiSetPropertyA( handle, "SELECT_EXCEL", "1" ); + if ( bImpressEnabled ) + MsiSetPropertyA( handle, "SELECT_POWERPOINT", "1" ); + } + else + { + if ( bWriterEnabled && ! checkSomeExtensionInRegistry( WORD_START, EXCEL_START ) ) + { + MsiSetPropertyA( handle, "SELECT_WORD", "1" ); + OutputDebugStringFormat( "LookForRegisteredExtensions: Register for MicroSoft Word" ); + } + if ( bCalcEnabled && ! checkSomeExtensionInRegistry( EXCEL_START, POWERPOINT_START ) ) + { + MsiSetPropertyA( handle, "SELECT_EXCEL", "1" ); + OutputDebugStringFormat( "LookForRegisteredExtensions: Register for MicroSoft Excel" ); + } + if ( bImpressEnabled && ! checkSomeExtensionInRegistry( POWERPOINT_START, POWERPOINT_END ) ) + { + MsiSetPropertyA( handle, "SELECT_POWERPOINT", "1" ); + OutputDebugStringFormat( "LookForRegisteredExtensions: Register for MicroSoft PowerPoint" ); + } + } + } + + MsiSetPropertyA( handle, "FILETYPEDIALOGUSED", "1" ); + + return ERROR_SUCCESS; +} + +//---------------------------------------------------------- +extern "C" UINT __stdcall RegisterSomeExtensions( MSIHANDLE handle ) +{ + OutputDebugStringFormat( "RegisterSomeExtensions: " ); + + if ( IsSetMsiProp( handle, "SELECT_WORD" ) ) + { + registerSomeExtensions( handle, WORD_START, EXCEL_START, true ); + MsiSetFeatureState( handle, L"gm_p_Wrt_MSO_Reg", INSTALLSTATE_LOCAL ); + OutputDebugStringFormat( "RegisterSomeExtensions: Register for MicroSoft Word" ); + } + else + { + registerSomeExtensions( handle, WORD_START, EXCEL_START, false ); + MsiSetFeatureState( handle, L"gm_p_Wrt_MSO_Reg", INSTALLSTATE_ABSENT ); + } + + if ( IsSetMsiProp( handle, "SELECT_EXCEL" ) ) + { + registerSomeExtensions( handle, EXCEL_START, POWERPOINT_START, true ); + MsiSetFeatureState( handle, L"gm_p_Calc_MSO_Reg", INSTALLSTATE_LOCAL ); + OutputDebugStringFormat( "RegisterSomeExtensions: Register for MicroSoft Excel" ); + } + else + { + registerSomeExtensions( handle, EXCEL_START, POWERPOINT_START, false ); + MsiSetFeatureState( handle, L"gm_p_Calc_MSO_Reg", INSTALLSTATE_ABSENT ); + } + + if ( IsSetMsiProp( handle, "SELECT_POWERPOINT" ) ) + { + registerSomeExtensions( handle, POWERPOINT_START, POWERPOINT_END, true ); + MsiSetFeatureState( handle, L"gm_p_Impress_MSO_Reg", INSTALLSTATE_LOCAL ); + OutputDebugStringFormat( "RegisterSomeExtensions: Register for MicroSoft PowerPoint" ); + } + else + { + registerSomeExtensions( handle, POWERPOINT_START, POWERPOINT_END, false ); + MsiSetFeatureState( handle, L"gm_p_Impress_MSO_Reg", INSTALLSTATE_ABSENT ); + } + + return ERROR_SUCCESS; +} + +//---------------------------------------------------------- extern "C" UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle ) { + if ( IsSetMsiProp( handle, "FILETYPEDIALOGUSED" ) ) + { + OutputDebugStringFormat( "FindRegisteredExtensions: FILETYPEDIALOGUSED!" ); + return ERROR_SUCCESS; + } + + OutputDebugStringFormat( "FindRegisteredExtensions:" ); + bool bRegisterAll = IsSetMsiProp( handle, "REGISTER_ALL_MSO_TYPES" ); if ( IsSetMsiProp( handle, "REGISTER_NO_MSO_TYPES" ) ) @@ -300,6 +470,15 @@ extern "C" UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle ) else OutputDebugStringFormat( "FindRegisteredExtensions: " ); + // setting the msi properties SELECT_* will force registering for all corresponding + // file types + if ( IsSetMsiProp( handle, "SELECT_WORD" ) ) + registerSomeExtensions( handle, WORD_START, EXCEL_START, true ); + if ( IsSetMsiProp( handle, "SELECT_EXCEL" ) ) + registerSomeExtensions( handle, EXCEL_START, POWERPOINT_START, true ); + if ( IsSetMsiProp( handle, "SELECT_POWERPOINT" ) ) + registerSomeExtensions( handle, POWERPOINT_START, POWERPOINT_END, true ); + registerForExtensions( handle, bRegisterAll ); return ERROR_SUCCESS; diff --git a/setup_native/source/win32/msi-encodinglist.txt b/setup_native/source/win32/msi-encodinglist.txt index 81258d61f38b..5185a9ea642e 100644 --- a/setup_native/source/win32/msi-encodinglist.txt +++ b/setup_native/source/win32/msi-encodinglist.txt @@ -42,7 +42,6 @@ gu 0 1095 # Gujarati gu-IN 0 1095 # Gujarati he 1255 1037 hi 0 1081 -hi-IN 0 1081 # hindi hr 1250 1050 # Croatian hu 1250 1038 hy 0 1067 # Armenian @@ -93,6 +92,7 @@ pt 1252 2070 pt-BR 1252 1046 pt-PT 1252 2070 ps 0 2171 +ca-XV 1252 32771 # Catalan Valencian rm 0 1047 # Raeto-Romance ro 1250 1048 # Romanian ru 1251 1049 diff --git a/setup_native/source/win32/nsis/brobanner.bmp b/setup_native/source/win32/nsis/brobanner.bmp Binary files differindex 37f517176524..7ab14d2a6245 100644 --- a/setup_native/source/win32/nsis/brobanner.bmp +++ b/setup_native/source/win32/nsis/brobanner.bmp diff --git a/setup_native/source/win32/nsis/brobitmap.bmp b/setup_native/source/win32/nsis/brobitmap.bmp Binary files differindex 0c5e11da76d5..f9e9e9b2d44b 100644 --- a/setup_native/source/win32/nsis/brobitmap.bmp +++ b/setup_native/source/win32/nsis/brobitmap.bmp diff --git a/wizards/com/sun/star/wizards/common/NumberFormatter.java b/wizards/com/sun/star/wizards/common/NumberFormatter.java index c8471214ec46..cb183eb29c25 100644 --- a/wizards/com/sun/star/wizards/common/NumberFormatter.java +++ b/wizards/com/sun/star/wizards/common/NumberFormatter.java @@ -201,6 +201,7 @@ public class NumberFormatter Locale oLocale = (Locale) Helper.getUnoPropertyValue(xNumberFormat, "Locale"); int NewFormatKey = defineNumberFormat(FormatString, oLocale); XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _xFormatObject); + xPSet.setPropertyValue("FormatsSupplier", _oNumberFormatter.xNumberFormatter.getNumberFormatsSupplier()); if (xPSet.getPropertySetInfo().hasPropertyByName("NumberFormat")) { xPSet.setPropertyValue("NumberFormat", new Integer(NewFormatKey)); diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 16f8587e535c..f46c3fd657d4 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -108,7 +108,6 @@ public class DBMetaData public com.sun.star.sdb.tools.XConnectionTools ConnectionTools; public com.sun.star.lang.XMultiServiceFactory xMSF; public XComponent xConnectionComponent; - public SQLQueryComposer oSQLQueryComposer; private XNameAccess m_xTableNames; private XInteractionHandler oInteractionHandler; @@ -1117,7 +1116,6 @@ public class DBMetaData ConnectionTools = null; xMSF = null; xConnectionComponent = null; - oSQLQueryComposer = null; CommandObjects = null; } } diff --git a/wizards/com/sun/star/wizards/db/QueryMetaData.java b/wizards/com/sun/star/wizards/db/QueryMetaData.java index 2c49de15696b..bad14c2faa20 100644 --- a/wizards/com/sun/star/wizards/db/QueryMetaData.java +++ b/wizards/com/sun/star/wizards/db/QueryMetaData.java @@ -36,6 +36,7 @@ import com.sun.star.wizards.common.*; public class QueryMetaData extends CommandMetaData { + private SQLQueryComposer oSQLQueryComposer = null; FieldColumn CurFieldColumn; public String Command; // Vector CommandNamesV; @@ -290,4 +291,10 @@ public class QueryMetaData extends CommandMetaData } return iAggregate; } + public SQLQueryComposer getSQLQueryComposer() + { + if ( oSQLQueryComposer == null ) + oSQLQueryComposer = new SQLQueryComposer(this); + return oSQLQueryComposer; + } } diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index a6a63c5a4fc7..0a52f6a3a7a9 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -60,7 +60,7 @@ public class SQLQueryComposer // String m_sFromClause; public XSingleSelectQueryAnalyzer m_xQueryAnalyzer; Vector composedCommandNames = new Vector(1); - public XSingleSelectQueryComposer m_xQueryComposer; + private XSingleSelectQueryComposer m_xQueryComposer; XMultiServiceFactory xMSF; boolean bincludeGrouping = true; @@ -160,10 +160,8 @@ public class SQLQueryComposer { for (int i = 0; i < CurDBMetaData.getFilterConditions().length; i++) { - String sCurFieldName = CurDBMetaData.getFilterConditions()[i][0].Name; m_xQueryComposer.setStructuredFilter(CurDBMetaData.getFilterConditions()); } - String s = m_xQueryAnalyzer.getQuery(); } catch (Exception exception) { @@ -270,9 +268,10 @@ public class SQLQueryComposer return m_xQueryAnalyzer.getQuery(); } - private String getFromClause() + public String getFromClause() { String sFromClause = "FROM"; + composedCommandNames.clear(); String[] sCommandNames = CurDBMetaData.getIncludedCommandNames(); for (int i = 0; i < sCommandNames.length; i++) { @@ -291,20 +290,27 @@ public class SQLQueryComposer public boolean setQueryCommand(XWindow _xParentWindow, boolean _bincludeGrouping, boolean _baddAliasFieldNames) { + return setQueryCommand(_xParentWindow,_bincludeGrouping, _baddAliasFieldNames,true); + } + public boolean setQueryCommand(XWindow _xParentWindow, boolean _bincludeGrouping, boolean _baddAliasFieldNames, boolean addQuery) + { try { String s; bincludeGrouping = _bincludeGrouping; - String sFromClause = getFromClause(); - String sSelectClause = getSelectClause(_baddAliasFieldNames); - String queryclause = sSelectClause + " " + sFromClause; - m_xQueryAnalyzer.setQuery(queryclause); - if (CurDBMetaData.getFilterConditions() != null) + if ( addQuery ) { - if (CurDBMetaData.getFilterConditions().length > 0) + String sFromClause = getFromClause(); + String sSelectClause = getSelectClause(_baddAliasFieldNames); + String queryclause = sSelectClause + " " + sFromClause; + m_xQueryAnalyzer.setQuery(queryclause); + if (CurDBMetaData.getFilterConditions() != null) { - CurDBMetaData.setFilterConditions(replaceConditionsByAlias(CurDBMetaData.getFilterConditions())); - m_xQueryComposer.setStructuredFilter(CurDBMetaData.getFilterConditions()); + if (CurDBMetaData.getFilterConditions().length > 0) + { + CurDBMetaData.setFilterConditions(replaceConditionsByAlias(CurDBMetaData.getFilterConditions())); + m_xQueryComposer.setStructuredFilter(CurDBMetaData.getFilterConditions()); + } } } s = m_xQueryAnalyzer.getQuery(); @@ -333,6 +339,8 @@ public class SQLQueryComposer { FieldColumn CurFieldColumn = CurDBMetaData.getFieldColumnByDisplayName(_fieldname); CommandName curComposedCommandName = getComposedCommandByDisplayName(CurFieldColumn.getCommandName()); + if ( curComposedCommandName == null ) + return _fieldname; String curAliasName = curComposedCommandName.getAliasName(); return quoteName(curAliasName) + "." + quoteName(CurFieldColumn.getFieldName()); } @@ -418,4 +426,8 @@ public class SQLQueryComposer typeexception.printStackTrace(System.out); } } + public XSingleSelectQueryComposer getQueryComposer() + { + return m_xQueryComposer; + } } diff --git a/wizards/com/sun/star/wizards/document/Control.java b/wizards/com/sun/star/wizards/document/Control.java index 3ed03e47b1ee..fb4191277b8c 100644 --- a/wizards/com/sun/star/wizards/document/Control.java +++ b/wizards/com/sun/star/wizards/document/Control.java @@ -33,6 +33,7 @@ import com.sun.star.awt.XControlModel; import com.sun.star.awt.XLayoutConstrains; import com.sun.star.awt.XWindowPeer; import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.XPropertySetInfo; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; import com.sun.star.container.XNamed; @@ -97,8 +98,13 @@ public class Control extends Shape icontroltype = _icontroltype; sServiceName = oFormHandler.sModelServices[getControlType()]; Object oControlModel = oFormHandler.xMSFDoc.createInstance(sServiceName); - xControlModel = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, oControlModel); - xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oControlModel); + xControlModel = UnoRuntime.queryInterface( XControlModel.class, oControlModel ); + xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, oControlModel ); + + XPropertySetInfo xPSI = xPropertySet.getPropertySetInfo(); + if ( xPSI.hasPropertyByName( "MouseWheelBehavior" ) ) + xPropertySet.setPropertyValue( "MouseWheelBehavior", new Short( com.sun.star.awt.MouseWheelBehavior.SCROLL_DISABLED ) ); + insertControlInContainer(_FieldName); xControlShape.setControl(xControlModel); if (_xGroupShapes == null) @@ -110,7 +116,7 @@ public class Control extends Shape _xGroupShapes.add(xShape); } xControl = oFormHandler.xControlAccess.getControl(xControlModel); - xControlPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControl); + xControlPropertySet = UnoRuntime.queryInterface( XPropertySet.class, xControl ); xWindowPeer = xControl.getPeer(); } catch (Exception e) diff --git a/wizards/com/sun/star/wizards/document/DatabaseControl.java b/wizards/com/sun/star/wizards/document/DatabaseControl.java index 66d9195c0c2f..b0b1523840a9 100644 --- a/wizards/com/sun/star/wizards/document/DatabaseControl.java +++ b/wizards/com/sun/star/wizards/document/DatabaseControl.java @@ -29,6 +29,7 @@ package com.sun.star.wizards.document; import com.sun.star.awt.Point; import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.XPropertySetInfo; import com.sun.star.container.XNameContainer; import com.sun.star.drawing.XShapes; import com.sun.star.sdbc.DataType; @@ -92,6 +93,11 @@ public class DatabaseControl extends Control xPropColumn.setPropertyValue("DataField", sFieldName); xPropColumn.setPropertyValue("Label", _columntitle); xPropColumn.setPropertyValue("Width", new Integer(0)); // Width of column is adjusted to Columname + + XPropertySetInfo xPSI = xPropColumn.getPropertySetInfo(); + if ( xPSI.hasPropertyByName( "MouseWheelBehavior" ) ) + xPropColumn.setPropertyValue( "MouseWheelBehavior", new Short( com.sun.star.awt.MouseWheelBehavior.SCROLL_DISABLED ) ); + setNumericLimits(); _oGridControl.xNameContainer.insertByName(sFieldName, xPropColumn); } diff --git a/wizards/com/sun/star/wizards/document/GridControl.java b/wizards/com/sun/star/wizards/document/GridControl.java index d946d592ffc0..66bae37e1ed3 100644 --- a/wizards/com/sun/star/wizards/document/GridControl.java +++ b/wizards/com/sun/star/wizards/document/GridControl.java @@ -60,15 +60,15 @@ public class GridControl extends Shape { fieldcolumns = _fieldcolumns; Object oGridModel = oFormHandler.xMSFDoc.createInstance(oFormHandler.sModelServices[FormHandler.SOGRIDCONTROL]); - xNameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oGridModel); - xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oGridModel); + xNameContainer = UnoRuntime.queryInterface( XNameContainer.class, oGridModel ); + xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, oGridModel ); _xFormName.insertByName(_sname, oGridModel); - xControlModel = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, oGridModel); + xControlModel = UnoRuntime.queryInterface( XControlModel.class, oGridModel ); xControlShape.setControl(xControlModel); - xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oGridModel); + xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, oGridModel ); oFormHandler.xDrawPage.add(xShape); - xGridColumnFactory = (XGridColumnFactory) UnoRuntime.queryInterface(XGridColumnFactory.class, oGridModel); - xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, oGridModel); + xGridColumnFactory = UnoRuntime.queryInterface( XGridColumnFactory.class, oGridModel ); + xComponent = UnoRuntime.queryInterface( XComponent.class, oGridModel ); // Helper.setUnoPropertyValue(oGridModel, "Name", _sname); for (int i = 0; i < fieldcolumns.length; i++) diff --git a/wizards/com/sun/star/wizards/letter/LocaleCodes.java b/wizards/com/sun/star/wizards/letter/LocaleCodes.java index bf0292c4d6af..82994f40dc6b 100644 --- a/wizards/com/sun/star/wizards/letter/LocaleCodes.java +++ b/wizards/com/sun/star/wizards/letter/LocaleCodes.java @@ -41,7 +41,7 @@ public class LocaleCodes extends Resource public LocaleCodes(XMultiServiceFactory xmsf) { super(xmsf, UNIT_NAME, MODULE_NAME); - allLanguageStrings = getStringList(16750); // STR_ARR_SVT_LANGUAGE_TABLE from svtools/source/misc/langtab.src + allLanguageStrings = getStringList(16635); // STR_ARR_SVT_LANGUAGE_TABLE from svtools/source/misc/langtab.src } public String getLanguageString(String MSID) diff --git a/wizards/com/sun/star/wizards/makefile.mk b/wizards/com/sun/star/wizards/makefile.mk index 50dc0713945c..fb9c3e18558d 100644 --- a/wizards/com/sun/star/wizards/makefile.mk +++ b/wizards/com/sun/star/wizards/makefile.mk @@ -37,7 +37,7 @@ PACKAGE = com$/sun$/star$/wizards JARFILES= unoil.jar jurt.jar ridl.jar juh.jar jut.jar java_uno.jar java_uno_accessbridge .IF "$(SYSTEM_SAXON)" == "YES" -XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(SAXON_JAR) +EXTRAJARFILES = $(SAXON_JAR) .ELSE JARFILES += saxon9.jar .ENDIF diff --git a/wizards/com/sun/star/wizards/query/Finalizer.java b/wizards/com/sun/star/wizards/query/Finalizer.java index ca2a232c8ef8..35d1edf37bde 100644 --- a/wizards/com/sun/star/wizards/query/Finalizer.java +++ b/wizards/com/sun/star/wizards/query/Finalizer.java @@ -169,10 +169,9 @@ public class Finalizer public String finish() { - CurDBMetaData.oSQLQueryComposer = new SQLQueryComposer(CurDBMetaData); String queryName = getTitle(); - if ( CurDBMetaData.oSQLQueryComposer.setQueryCommand( m_queryWizard.xWindow, true, true ) - && CurDBMetaData.createQuery( CurDBMetaData.oSQLQueryComposer, queryName ) + if ( CurDBMetaData.getSQLQueryComposer().setQueryCommand( m_queryWizard.xWindow, true, true ) + && CurDBMetaData.createQuery( CurDBMetaData.getSQLQueryComposer(), queryName ) ) return queryName; diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java index 9c8180a05c2d..05f7ad2a6a5b 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java +++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java @@ -256,13 +256,12 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme if ((getRecordParser().getCommandType() == CommandType.QUERY) && (getRecordParser().Command.equals(""))) { - getRecordParser().oSQLQueryComposer = new SQLQueryComposer(getRecordParser()); DBMetaData.CommandObject oCommand = getRecordParser().getQueryByName(sQueryName); if (getRecordParser().hasEscapeProcessing(oCommand.getPropertySet())) { getRecordParser().Command = (String) oCommand.getPropertySet().getPropertyValue("Command"); - getRecordParser().oSQLQueryComposer.m_xQueryAnalyzer.setQuery(getRecordParser().Command); - getRecordParser().oSQLQueryComposer.prependSortingCriteria(); + getRecordParser().getSQLQueryComposer().m_xQueryAnalyzer.setQuery(getRecordParser().Command); + getRecordParser().getSQLQueryComposer().prependSortingCriteria(); } else { diff --git a/wizards/com/sun/star/wizards/report/ReportWizard.java b/wizards/com/sun/star/wizards/report/ReportWizard.java index 61ab85c6094d..2bffd2b4bea3 100644 --- a/wizards/com/sun/star/wizards/report/ReportWizard.java +++ b/wizards/com/sun/star/wizards/report/ReportWizard.java @@ -268,10 +268,10 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, boolean bQueryCreated = false; if (this.CurDBCommandFieldSelection.getSelectedCommandType() == CommandType.TABLE) { - bQueryCreated = m_reportDocument.getRecordParser().oSQLQueryComposer.setQueryCommand(this.xWindow, false, false); + bQueryCreated = m_reportDocument.getRecordParser().getSQLQueryComposer().setQueryCommand(this.xWindow, false, false); m_reportDocument.setCommandType(CommandType.COMMAND); - String sQuery = m_reportDocument.getRecordParser().oSQLQueryComposer.getQuery(); + String sQuery = m_reportDocument.getRecordParser().getSQLQueryComposer().getQuery(); m_reportDocument.setCommand(sQuery); } else @@ -286,11 +286,11 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener, { // String sCommand = (String) oCommand.xPropertySet.getPropertyValue("Command"); bQueryCreated = (!sCommand.equals("")); - m_reportDocument.getRecordParser().oSQLQueryComposer.m_xQueryAnalyzer.setQuery(sCommand); - m_reportDocument.getRecordParser().oSQLQueryComposer.prependSortingCriteria(); + m_reportDocument.getRecordParser().getSQLQueryComposer().m_xQueryAnalyzer.setQuery(sCommand); + m_reportDocument.getRecordParser().getSQLQueryComposer().prependSortingCriteria(); // TODO: check with query m_reportDocument.setCommandType(CommandType.COMMAND); - m_reportDocument.setCommand(m_reportDocument.getRecordParser().oSQLQueryComposer.getQuery()); + m_reportDocument.setCommand(m_reportDocument.getRecordParser().getSQLQueryComposer().getQuery()); bQueryCreated = true; } else @@ -479,7 +479,6 @@ public static XLogger getLogger() if ( m_reportDocument.getRecordParser().getConnection( m_wizardContext ) ) { - m_reportDocument.getRecordParser().oSQLQueryComposer = new SQLQueryComposer(m_reportDocument.getRecordParser()); buildSteps(); m_reportDocument.checkInvariants(); diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java index 8b40528fe832..85b797d3b640 100644 --- a/wizards/com/sun/star/wizards/ui/FilterComponent.java +++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java @@ -33,13 +33,19 @@ import com.sun.star.awt.VclWindowPeerAttribute; import com.sun.star.awt.XControl; import com.sun.star.awt.XListBox; import com.sun.star.awt.XRadioButton; +import com.sun.star.beans.PropertyAttribute; import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.XPropertyContainer; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.EventObject; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.lib.uno.helper.PropertySet; import com.sun.star.sdbc.DataType; +import com.sun.star.uno.Any; import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.Exception; +import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.wizards.common.NumberFormatter; @@ -48,6 +54,8 @@ import com.sun.star.wizards.common.JavaTools; import com.sun.star.wizards.common.Properties; import com.sun.star.wizards.db.FieldColumn; import com.sun.star.wizards.db.QueryMetaData; +import java.util.logging.Level; +import java.util.logging.Logger; public class FilterComponent { @@ -112,10 +120,10 @@ public class FilterComponent final int SO_SECONDBOOLFIELDNAME = 256 + 2; final int SO_THIRDBOOLFIELDNAME = 256 + 3; final int SO_FOURTHBOOLFIELDNAME = 256 + 4; - int SO_BOOLEANLIST[] = { + int SO_BOOLEANLIST[] = + { SO_FIRSTBOOLFIELDNAME, SO_SECONDBOOLFIELDNAME, SO_THIRDBOOLFIELDNAME, SO_FOURTHBOOLFIELDNAME }; - final int SO_OPTQUERYMODE = 5; int SOI_MATCHALL = 0; int SOI_MATCHANY = 1; @@ -127,25 +135,23 @@ public class FilterComponent public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject) { - try + int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); + String sControlName = ""; + switch (iKey) { - int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList); - String sControlName = ""; - switch (iKey) - { - // case SOOPTQUERYMODE: - // getfilterstate(); - case SO_FIRSTFIELDNAME: - case SO_SECONDFIELDNAME: - case SO_THIRDFIELDNAME: - case SO_FOURTHFIELDNAME: - sControlName = getControlName(EventObject.Source); - String sControlNameSuffix = sIncSuffix + "_" + getIndexNumber(sControlName); - XListBox xCurFieldListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, CurUnoDialog.xDlgContainer.getControl(sControlName)); - String CurDisplayFieldName = xCurFieldListBox.getSelectedItem(); - FieldColumn CurFieldColumn = new FieldColumn(oQueryMetaData, CurDisplayFieldName); - - String sControlNameTextValue = "txtValue" + sControlNameSuffix; + // case SOOPTQUERYMODE: + // getfilterstate(); + case SO_FIRSTFIELDNAME: + case SO_SECONDFIELDNAME: + case SO_THIRDFIELDNAME: + case SO_FOURTHFIELDNAME: + sControlName = getControlName(EventObject.Source); + String sControlNameSuffix = sIncSuffix + "_" + getIndexNumber(sControlName); + XListBox xCurFieldListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, CurUnoDialog.xDlgContainer.getControl(sControlName)); + String CurDisplayFieldName = xCurFieldListBox.getSelectedItem(); + FieldColumn CurFieldColumn = new FieldColumn(oQueryMetaData, CurDisplayFieldName); + + String sControlNameTextValue = "txtValue" + sControlNameSuffix; // String sControlNameBooleanList = "lstBoolean" + sControlNameSuffix; // if (aFieldColumn.FieldType == DataType.BOOLEAN) // { @@ -158,41 +164,36 @@ public class FilterComponent // CurUnoDialog.setControlVisible(sControlNameTextValue, true); // CurUnoDialog.setControlVisible(sControlNameBooleanList, false); - XControl xValueControl = CurUnoDialog.xDlgContainer.getControl(sControlNameTextValue); - XInterface xValueModel = (XInterface) UnoDialog.getModel(xValueControl); - Helper.setUnoPropertyValue(xValueModel, "TreatAsNumber", Boolean.valueOf(CurFieldColumn.isNumberFormat())); - final NumberFormatter aNumberFormatter = oQueryMetaData.getNumberFormatter(); - aNumberFormatter.setNumberFormat(xValueModel, CurFieldColumn.getDBFormatKey(), aNumberFormatter); + XControl xValueControl = CurUnoDialog.xDlgContainer.getControl(sControlNameTextValue); + XInterface xValueModel = (XInterface) UnoDialog.getModel(xValueControl); + Helper.setUnoPropertyValue(xValueModel, "TreatAsNumber", Boolean.valueOf(CurFieldColumn.isNumberFormat())); + final NumberFormatter aNumberFormatter = oQueryMetaData.getNumberFormatter(); + aNumberFormatter.setNumberFormat(xValueModel, CurFieldColumn.getDBFormatKey(), aNumberFormatter); // } - break; - case SO_FIRSTCONDITION: - case SO_SECONDCONDITION: - case SO_THIRDCONDITION: - case SO_FOURTHCONDITION: - sControlName = getControlName(EventObject.Source); - break; - case SOOPTORMODE: - case SOOPTANDMODE: - // getfilterstate(); - return; + break; + case SO_FIRSTCONDITION: + case SO_SECONDCONDITION: + case SO_THIRDCONDITION: + case SO_FOURTHCONDITION: + sControlName = getControlName(EventObject.Source); + break; + case SOOPTORMODE: + case SOOPTANDMODE: + // getfilterstate(); + return; case SO_FIRSTBOOLFIELDNAME: case SO_SECONDBOOLFIELDNAME: case SO_THIRDBOOLFIELDNAME: case SO_FOURTHBOOLFIELDNAME: - sControlName = getControlName(EventObject.Source); + sControlName = getControlName(EventObject.Source); break; - default: - break; - } - togglefollowingControlRow(sControlName); - } - catch (Exception exception) - { - exception.printStackTrace(System.out); + default: + break; } + togglefollowingControlRow(sControlName); } public void disposing(com.sun.star.lang.EventObject eventObject) @@ -205,15 +206,8 @@ public class FilterComponent public void textChanged(TextEvent EventObject) { - try - { - String sName = getControlName(EventObject.Source); - togglefollowingControlRow(sName); - } - catch (Exception exception) - { - exception.printStackTrace(System.out); - } + String sName = getControlName(EventObject.Source); + togglefollowingControlRow(sName); } public void disposing(EventObject EventObject) @@ -245,10 +239,10 @@ public class FilterComponent } public static String getIndexNumber(String _sStr) - { - String sLastNumber = _sStr.substring(_sStr.length() - 1, _sStr.length()); - return sLastNumber; - } + { + String sLastNumber = _sStr.substring(_sStr.length() - 1, _sStr.length()); + return sLastNumber; + } /** * Enable the next ControlRow if the Condition is complete in the current line @@ -290,102 +284,67 @@ public class FilterComponent int nFilterCount = getFilterCount(); if (nFilterCount > 0) { - if (this.getfilterstate() == this.SOI_MATCHALL) - { - filterconditions = new PropertyValue[1][nFilterCount]; - } - else - { - filterconditions = new PropertyValue[nFilterCount][1]; - } - int a = 0; - for (int i = 0; i < RowCount; i++) + try { - ControlRow CurControlRow = oControlRows[i]; - if (CurControlRow.isEnabled()) + final String serviceName = "com.sun.star.beans.PropertyBag"; + final XPropertyContainer column = (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, oQueryMetaData.xMSF.createInstance(serviceName)); + + column.addProperty("Type", PropertyAttribute.BOUND, DataType.VARCHAR); + column.addProperty("Name", PropertyAttribute.BOUND, ""); + final XPropertySet columnSet = UnoRuntime.queryInterface(XPropertySet.class, column); + + if ( oQueryMetaData.getSQLQueryComposer().getQuery().length() == 0) + { + final String fromClause = oQueryMetaData.getSQLQueryComposer().getFromClause(); + StringBuffer sql = new StringBuffer(); + sql.append(oQueryMetaData.getSQLQueryComposer().getSelectClause(true)); + sql.append(' '); + sql.append(fromClause); + oQueryMetaData.getSQLQueryComposer().getQueryComposer().setElementaryQuery(sql.toString()); + } + int a = 0; + for (int i = 0; i < RowCount; i++) { - if (CurControlRow.isConditionComplete()) + ControlRow CurControlRow = oControlRows[i]; + if (CurControlRow.isEnabled()) { - Object aValue; - String sFieldName = CurControlRow.getSelectedFieldName(); - int nOperator = (int) CurControlRow.getSelectedOperator(); - FieldColumn aFieldColumn = oQueryMetaData.getFieldColumnByDisplayName(sFieldName); - if (aFieldColumn.getStandardFormatKey() == oQueryMetaData.getNumberFormatter().getTextFormatKey()) - { - aValue = "'" + CurControlRow.getValue() + "'"; - } -//// TODO the following code is bound to be deprecated as soon as the query composer is able to handle date/time values as numbers - else if ((aFieldColumn.getStandardFormatKey() == oQueryMetaData.getNumberFormatter().getDateFormatKey()) || - (aFieldColumn.getStandardFormatKey() == oQueryMetaData.getNumberFormatter().getDateTimeFormatKey())) - { - String sDate = CurControlRow.getDateTimeString(true); - aValue = "{D '" + sDate + "' }"; // FormatsSupplier - } - else if (aFieldColumn.getStandardFormatKey() == oQueryMetaData.getNumberFormatter().getTimeFormatKey()) - { - String sTime = CurControlRow.getDateTimeString(true); - aValue = "'{T '" + sTime + "' }"; - } - else - { - aValue = CurControlRow.getValue(); - // if void - if (! AnyConverter.isVoid(aValue)) - { - switch (aFieldColumn.getFieldType()) - { - case DataType.TINYINT: - case DataType.BIGINT: - case DataType.INTEGER: - case DataType.SMALLINT: - if ( AnyConverter.isDouble(aValue) ) - aValue = String.valueOf(((Double) aValue).intValue()); - break; - case DataType.BIT: - case DataType.BOOLEAN: - // curValue = CurControlRow.getText(); // wrong! (creates something like 'WAHR'/'FALSCH' if german locale is used. - - // double dblvalue = ((Double) curValue).doubleValue(); - //curValue = new Boolean(dblvalue == 1.0); // wrong! we need a string, not a boolean value - - // converts the '1.0'/'0.0' (EffectiveValue) to a 'boolean' String like 'true'/'false' - if ( AnyConverter.isDouble(aValue) ) - aValue = String.valueOf(((Double) aValue).intValue() == 1); - break; - default: - aValue = String.valueOf(aValue); - break; - } - } - } - - PropertyValue oPropertyValue = Properties.createProperty(sFieldName, aValue, nOperator); - if (getfilterstate()/*this.ifilterstate*/ == this.SOI_MATCHALL) + if (CurControlRow.isConditionComplete()) { - if (i == 0) + String sFieldName = CurControlRow.getSelectedFieldName(); + int nOperator = (int) CurControlRow.getSelectedOperator(); + FieldColumn aFieldColumn = oQueryMetaData.getFieldColumnByDisplayName(sFieldName); + columnSet.setPropertyValue("Name", aFieldColumn.getFieldName()); + columnSet.setPropertyValue("Type", aFieldColumn.getXColumnPropertySet().getPropertyValue("Type")); + Object value = CurControlRow.getValue(); + switch(aFieldColumn.getFieldType()) { - filterconditions[0] = new PropertyValue[nFilterCount]; + case DataType.TIMESTAMP: + case DataType.DATE: + value = ((Double)value) - oQueryMetaData.getNullDateCorrection(); + break; } - filterconditions[0][a] = oPropertyValue; + column.addProperty("Value", PropertyAttribute.MAYBEVOID, value); + columnSet.setPropertyValue("Value", value); + oQueryMetaData.getSQLQueryComposer().getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL,nOperator); } - else - { - filterconditions[a][0] = oPropertyValue; - } - a++; } } + filterconditions = oQueryMetaData.getSQLQueryComposer().getQueryComposer().getStructuredFilter(); + int[] iduplicate = JavaTools.getDuplicateFieldIndex(filterconditions); + if (iduplicate[0] != -1) + { + PropertyValue aduplicatecondition = filterconditions[iduplicate[0]][iduplicate[1]]; + String smsgDuplicateCondition = getDisplayCondition(sDuplicateCondition, aduplicatecondition, null); + CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, smsgDuplicateCondition); + CurUnoDialog.vetoableChange(new java.beans.PropertyChangeEvent(CurUnoDialog, "Steps", Integer.valueOf(1), Integer.valueOf(2))); + return new PropertyValue[][] + { + }; + } } - int[] iduplicate = JavaTools.getDuplicateFieldIndex(filterconditions); - if (iduplicate[0] != -1) + catch (Exception ex) { - PropertyValue aduplicatecondition = filterconditions[iduplicate[0]][iduplicate[1]]; - String smsgDuplicateCondition = getDisplayCondition(sDuplicateCondition, aduplicatecondition, null); - CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, smsgDuplicateCondition); - CurUnoDialog.vetoableChange(new java.beans.PropertyChangeEvent(CurUnoDialog, "Steps", Integer.valueOf(1), Integer.valueOf(2))); - return new PropertyValue[][] - { - }; + Logger.getLogger(FilterComponent.class.getName()).log(Level.SEVERE, null, ex); } } else @@ -413,8 +372,10 @@ public class FilterComponent String soperator = sLogicOperators[_filtercondition.Handle - 1]; sreturn = JavaTools.replaceSubString(sreturn, soperator, "<LOGICOPERATOR>"); String sDisplayValue = ""; - if ( !AnyConverter.isVoid(_filtercondition.Value) ) + if (!AnyConverter.isVoid(_filtercondition.Value)) + { sDisplayValue = AnyConverter.toString(_filtercondition.Value); + } sreturn = JavaTools.replaceSubString(sreturn, sDisplayValue, "<VALUE>"); return sreturn; } @@ -443,24 +404,17 @@ public class FilterComponent private void addfiltercondition(int _index, String _curFieldName, Object _curValue, int _curOperator) { - try + String ValString = String.valueOf(_curValue); + PropertyValue oPropertyValue = Properties.createProperty(_curFieldName, ValString, _curOperator); + getfilterstate(); + if (getfilterstate() == this.SOI_MATCHALL) { - String ValString = String.valueOf(_curValue); - PropertyValue oPropertyValue = Properties.createProperty(_curFieldName, ValString, _curOperator); - getfilterstate(); - if (getfilterstate() == this.SOI_MATCHALL) + if (_index == 0) { - if (_index == 0) - { - filterconditions[0] = new PropertyValue[getFilterCount()]; - } - filterconditions[0][_index] = new PropertyValue(); - filterconditions[0][_index] = oPropertyValue; + filterconditions[0] = new PropertyValue[getFilterCount()]; } - } - catch (Exception exception) - { - exception.printStackTrace(System.out); + filterconditions[0][_index] = new PropertyValue(); + filterconditions[0][_index] = oPropertyValue; } } @@ -475,8 +429,8 @@ public class FilterComponent } } return a; - // FilterCount = a; - // return FilterCount; + // FilterCount = a; + // return FilterCount; } /** Creates a new instance of FilterComponent @@ -492,95 +446,88 @@ public class FilterComponent */ public FilterComponent(WizardDialog CurUnoDialog, XMultiServiceFactory _xMSF, int iStep, int iPosX, int iPosY, int iWidth, int FilterCount, QueryMetaData _oQueryMetaData, int _firstHelpID) { - try - { - this.curHelpID = _firstHelpID; - this.xMSF = _xMSF; - this.IStep = Integer.valueOf(iStep); - - curtabindex = UnoDialog.setInitialTabindex(iStep); - this.CurUnoDialog = CurUnoDialog; - this.RowCount = FilterCount; - this.oQueryMetaData = _oQueryMetaData; - boolean bEnabled; - sIncSuffix = com.sun.star.wizards.common.Desktop.getIncrementSuffix(CurUnoDialog.getDlgNameAccess(), "optMatchAll"); - // iStartPosX = iPosX; - // iStartPosY = iPosY; - - String soptMatchAll = CurUnoDialog.m_oResource.getResText(BaseID + 9); - String soptMatchAny = CurUnoDialog.m_oResource.getResText(BaseID + 10); - slblFieldNames = CurUnoDialog.m_oResource.getResText(BaseID + 17); - slblOperators = CurUnoDialog.m_oResource.getResText(BaseID + 24); - slblValue = CurUnoDialog.m_oResource.getResText(BaseID + 25); - sLogicOperators = CurUnoDialog.m_oResource.getResArray(BaseID + 26, 10 /* 7 */); // =, <>, <, >, <=, >=, like, !like, is null, !is null - sBooleanValues = CurUnoDialog.m_oResource.getResArray(BaseID + 36, 2); // true, false - - sDuplicateCondition = CurUnoDialog.m_oResource.getResText(BaseID + 89); - - // create Radiobuttons - // * match all - // * match one - optMatchAll = CurUnoDialog.insertRadioButton("optMatchAll" + sIncSuffix, SOOPTANDMODE, new ItemListenerImpl(), - new String[] - { - "Height", - "HelpURL", - "Label", - "PositionX", - "PositionY", - "State", - "Step", - "TabIndex", - "Width" - }, - new Object[] - { - Integer.valueOf(9), - "HID:" + curHelpID++, - soptMatchAll, - Integer.valueOf(iPosX), - Integer.valueOf(iPosY), - Short.valueOf((short) 1), - IStep, - Short.valueOf(curtabindex++), - Integer.valueOf(203) - }); - optMatchAny = CurUnoDialog.insertRadioButton("optMatchAny" + sIncSuffix, SOOPTORMODE, new ItemListenerImpl(), - new String[] - { - "Height", - "HelpURL", - "Label", - "PositionX", - "PositionY", - "Step", - "TabIndex", - "Width" - }, - new Object[] - { - Integer.valueOf(9), - "HID:" + curHelpID++, - soptMatchAny, - Integer.valueOf(iPosX), - Integer.valueOf(iPosY + 12), - IStep, - Short.valueOf(curtabindex++), - Integer.valueOf(203) - }); - getfilterstate(); - - oControlRows = new ControlRow[FilterCount]; - for (int i = 0; i < FilterCount; i++) - { - bEnabled = (i == 0); - oControlRows[i] = new ControlRow(iPosX, iPosY + 20, i, bEnabled, (this.curHelpID + (i * 3))); - iPosY += 43; - } - } - catch (Exception exception) + this.curHelpID = _firstHelpID; + this.xMSF = _xMSF; + this.IStep = Integer.valueOf(iStep); + + curtabindex = UnoDialog.setInitialTabindex(iStep); + this.CurUnoDialog = CurUnoDialog; + this.RowCount = FilterCount; + this.oQueryMetaData = _oQueryMetaData; + boolean bEnabled; + sIncSuffix = com.sun.star.wizards.common.Desktop.getIncrementSuffix(CurUnoDialog.getDlgNameAccess(), "optMatchAll"); + // iStartPosX = iPosX; + // iStartPosY = iPosY; + + String soptMatchAll = CurUnoDialog.m_oResource.getResText(BaseID + 9); + String soptMatchAny = CurUnoDialog.m_oResource.getResText(BaseID + 10); + slblFieldNames = CurUnoDialog.m_oResource.getResText(BaseID + 17); + slblOperators = CurUnoDialog.m_oResource.getResText(BaseID + 24); + slblValue = CurUnoDialog.m_oResource.getResText(BaseID + 25); + sLogicOperators = CurUnoDialog.m_oResource.getResArray(BaseID + 26, 10 /* 7 */); // =, <>, <, >, <=, >=, like, !like, is null, !is null + sBooleanValues = CurUnoDialog.m_oResource.getResArray(BaseID + 36, 2); // true, false + + sDuplicateCondition = CurUnoDialog.m_oResource.getResText(BaseID + 89); + + // create Radiobuttons + // * match all + // * match one + optMatchAll = CurUnoDialog.insertRadioButton("optMatchAll" + sIncSuffix, SOOPTANDMODE, new ItemListenerImpl(), + new String[] + { + "Height", + "HelpURL", + "Label", + "PositionX", + "PositionY", + "State", + "Step", + "TabIndex", + "Width" + }, + new Object[] + { + Integer.valueOf(9), + "HID:" + curHelpID++, + soptMatchAll, + Integer.valueOf(iPosX), + Integer.valueOf(iPosY), + Short.valueOf((short) 1), + IStep, + Short.valueOf(curtabindex++), + Integer.valueOf(203) + }); + optMatchAny = CurUnoDialog.insertRadioButton("optMatchAny" + sIncSuffix, SOOPTORMODE, new ItemListenerImpl(), + new String[] + { + "Height", + "HelpURL", + "Label", + "PositionX", + "PositionY", + "Step", + "TabIndex", + "Width" + }, + new Object[] + { + Integer.valueOf(9), + "HID:" + curHelpID++, + soptMatchAny, + Integer.valueOf(iPosX), + Integer.valueOf(iPosY + 12), + IStep, + Short.valueOf(curtabindex++), + Integer.valueOf(203) + }); + getfilterstate(); + + oControlRows = new ControlRow[FilterCount]; + for (int i = 0; i < FilterCount; i++) { - exception.printStackTrace(System.out); + bEnabled = (i == 0); + oControlRows[i] = new ControlRow(iPosX, iPosY + 20, i, bEnabled, (this.curHelpID + (i * 3))); + iPosY += 43; } } @@ -636,29 +583,21 @@ public class FilterComponent public void addNumberFormats() { - try - { - iDateFormat = oQueryMetaData.getNumberFormatter().defineNumberFormat("YYYY-MM-DD"); - iTimeFormat = oQueryMetaData.getNumberFormatter().defineNumberFormat("HH:MM:SS"); - iDateTimeFormat = oQueryMetaData.getNumberFormatter().defineNumberFormat("YYYY-MM-DD HH:MM:SS"); - } - catch (Exception e) - { - e.printStackTrace(System.out); - } + iDateFormat = oQueryMetaData.getNumberFormatter().defineNumberFormat("YYYY-MM-DD"); + iTimeFormat = oQueryMetaData.getNumberFormatter().defineNumberFormat("HH:MM:SS"); + iDateTimeFormat = oQueryMetaData.getNumberFormatter().defineNumberFormat("YYYY-MM-DD HH:MM:SS"); } // ------------------------------------------------------------------------- // // // ------------------------------------------------------------------------- - class ControlRow { + private final static int SOLSTFIELDNAME = 3; private final static int SOLSTOPERATOR = 4; private final static int SOTXTVALUE = 5; - protected XInterface[] ControlElements = new XInterface[6]; private boolean m_bEnabled; String[] FieldNames; @@ -775,7 +714,7 @@ public class FilterComponent Boolean.TRUE, Integer.valueOf(13), "HID:" + _firstRowHelpID++, - Short.valueOf(UnoDialog.getListBoxLineCount() /* 7 */) , + Short.valueOf(UnoDialog.getListBoxLineCount() /* 7 */), Integer.valueOf(nPosX1), Integer.valueOf(iCompPosY + 23), IStep, @@ -805,7 +744,7 @@ public class FilterComponent Boolean.TRUE, Integer.valueOf(13), "HID:" + _firstRowHelpID++, - Short.valueOf((short) sLogicOperators.length /* 7 */ ), + Short.valueOf((short) sLogicOperators.length /* 7 */), Integer.valueOf(nPosX2), Integer.valueOf(iCompPosY + 23), IStep, @@ -880,8 +819,9 @@ public class FilterComponent { int nSelOperator = getSelectedOperator(); // short[] SelOperator = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems")); - if (nSelOperator == com.sun.star.sdb.SQLFilterOperator.SQLNULL || /* is null */ - nSelOperator == com.sun.star.sdb.SQLFilterOperator.NOT_SQLNULL) /* is not null */ + if (nSelOperator == com.sun.star.sdb.SQLFilterOperator.SQLNULL + || /* is null */ nSelOperator == com.sun.star.sdb.SQLFilterOperator.NOT_SQLNULL) /* is not null */ + { // disable value field Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), "Enabled", Boolean.FALSE); @@ -943,13 +883,27 @@ public class FilterComponent { sValue = JavaTools.replaceSubString(sValue, "", "{D '"); sValue = JavaTools.replaceSubString(sValue, "", "' }"); - oQueryMetaData.getNumberFormatter().convertStringToNumber(iDateFormat, sValue); + try + { + oQueryMetaData.getNumberFormatter().convertStringToNumber(iDateFormat, sValue); + } + catch (java.lang.Exception ex) + { + Logger.getLogger(FilterComponent.class.getName()).log(Level.SEVERE, null, ex); + } } else if (sValue.indexOf("{T '") > -1) { sValue = JavaTools.replaceSubString(sValue, "", "{T '"); sValue = JavaTools.replaceSubString(sValue, "", "' }"); - oQueryMetaData.getNumberFormatter().convertStringToNumber(iTimeFormat, sValue); + try + { + oQueryMetaData.getNumberFormatter().convertStringToNumber(iTimeFormat, sValue); + } + catch (java.lang.Exception ex) + { + Logger.getLogger(FilterComponent.class.getName()).log(Level.SEVERE, null, ex); + } } } else if (AnyConverter.isBoolean(_filtercondition.Value)) @@ -1001,7 +955,9 @@ public class FilterComponent m_bEnabled = _bEnabled; if (isEnabled()) { - short[] iselected = new short[] {}; + short[] iselected = new short[] + { + }; try { iselected = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems")); @@ -1012,7 +968,10 @@ public class FilterComponent } if ((iselected.length) == 0) { - Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems", new short[] { 0 }); + Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems", new short[] + { + 0 + }); } } else if (!isConditionComplete()) @@ -1044,28 +1003,28 @@ public class FilterComponent short[] SelFields = (short[]) AnyConverter.toArray(Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOLSTOPERATOR]), "SelectedItems")); switch (SelFields[0]) { - case 0: - return com.sun.star.sdb.SQLFilterOperator.EQUAL; - case 1: - return com.sun.star.sdb.SQLFilterOperator.NOT_EQUAL; - case 2: - return com.sun.star.sdb.SQLFilterOperator.LESS; - case 3: - return com.sun.star.sdb.SQLFilterOperator.GREATER; - case 4: - return com.sun.star.sdb.SQLFilterOperator.LESS_EQUAL; - case 5: - return com.sun.star.sdb.SQLFilterOperator.GREATER_EQUAL; - case 6: - return com.sun.star.sdb.SQLFilterOperator.LIKE; - case 7: - return com.sun.star.sdb.SQLFilterOperator.NOT_LIKE; - case 8: - return com.sun.star.sdb.SQLFilterOperator.SQLNULL; - case 9: - return com.sun.star.sdb.SQLFilterOperator.NOT_SQLNULL; - default: - return -1; + case 0: + return com.sun.star.sdb.SQLFilterOperator.EQUAL; + case 1: + return com.sun.star.sdb.SQLFilterOperator.NOT_EQUAL; + case 2: + return com.sun.star.sdb.SQLFilterOperator.LESS; + case 3: + return com.sun.star.sdb.SQLFilterOperator.GREATER; + case 4: + return com.sun.star.sdb.SQLFilterOperator.LESS_EQUAL; + case 5: + return com.sun.star.sdb.SQLFilterOperator.GREATER_EQUAL; + case 6: + return com.sun.star.sdb.SQLFilterOperator.LIKE; + case 7: + return com.sun.star.sdb.SQLFilterOperator.NOT_LIKE; + case 8: + return com.sun.star.sdb.SQLFilterOperator.SQLNULL; + case 9: + return com.sun.star.sdb.SQLFilterOperator.NOT_SQLNULL; + default: + return -1; } } catch (Exception exception) @@ -1078,43 +1037,19 @@ public class FilterComponent // TODO make a difference between Text and Numbers protected Object getValue() { - try - { - return (Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "EffectiveValue")); - } - catch (Exception exception) - { - exception.printStackTrace(System.out); - } - return null; + return (Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "EffectiveValue")); } protected Object getText() { - try - { - return (Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "Text")); - } - catch (Exception exception) - { - exception.printStackTrace(System.out); - } - return null; + return (Helper.getUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "Text")); } protected String getDateTimeString(boolean bgetDate) { - try - { double dblValue = ((Double) getValue()).doubleValue(); NumberFormatter oNumberFormatter = oQueryMetaData.getNumberFormatter(); return oNumberFormatter.convertNumberToString(iDateTimeFormat, dblValue); - } - catch (Exception exception) - { - exception.printStackTrace(System.out); - return null; - } } } } diff --git a/wizards/com/sun/star/wizards/web/data/makefile.mk b/wizards/com/sun/star/wizards/web/data/makefile.mk index 89362269fadc..1bfc02cf8351 100644 --- a/wizards/com/sun/star/wizards/web/data/makefile.mk +++ b/wizards/com/sun/star/wizards/web/data/makefile.mk @@ -38,7 +38,7 @@ PACKAGE = com$/sun$/star$/wizards$/web$/data JARFILES= unoil.jar jurt.jar ridl.jar juh.jar jut.jar java_uno.jar java_uno_accessbridge commonwizards.jar .IF "$(SYSTEM_SAXON)" == "YES" -XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(SAXON_JAR) +EXTRAJARFILES = $(SAXON_JAR) .ELSE JARFILES += saxon9.jar .ENDIF diff --git a/wizards/com/sun/star/wizards/web/export/makefile.mk b/wizards/com/sun/star/wizards/web/export/makefile.mk index b123fdc6d255..46cd65044e81 100644 --- a/wizards/com/sun/star/wizards/web/export/makefile.mk +++ b/wizards/com/sun/star/wizards/web/export/makefile.mk @@ -38,7 +38,7 @@ PACKAGE = com$/sun$/star$/wizards$/web$/export JARFILES= unoil.jar jurt.jar ridl.jar juh.jar java_uno.jar java_uno_accessbridge commonwizards.jar .IF "$(SYSTEM_SAXON)" == "YES" -XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(SAXON_JAR) +EXTRAJARFILES = $(SAXON_JAR) .ELSE JARFILES += saxon9.jar .ENDIF diff --git a/wizards/com/sun/star/wizards/web/makefile.mk b/wizards/com/sun/star/wizards/web/makefile.mk index a452e7683d21..9cc97e1b88ab 100644 --- a/wizards/com/sun/star/wizards/web/makefile.mk +++ b/wizards/com/sun/star/wizards/web/makefile.mk @@ -37,7 +37,7 @@ PACKAGE = com$/sun$/star$/wizards$/web JARFILES= unoil.jar jurt.jar ridl.jar juh.jar jut.jar java_uno.jar java_uno_accessbridge commonwizards.jar .IF "$(SYSTEM_SAXON)" == "YES" -XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(SAXON_JAR) +EXTRAJARFILES = $(SAXON_JAR) .ELSE JARFILES += saxon9.jar .ENDIF diff --git a/wizards/prj/build.lst b/wizards/prj/build.lst index c98f4561577c..c4d635a921a8 100644 --- a/wizards/prj/build.lst +++ b/wizards/prj/build.lst @@ -1,4 +1,4 @@ -wz wizards : l10n rsc javaunohelper unoil QADEVOOO:qadevOOo NULL +wz wizards : l10n rsc javaunohelper unoil NULL wz wizards\util nmake - all wz_util NULL wz wizards\source\config nmake - all wz_config NULL wz wizards\source\configshare nmake - all wz_configshare NULL diff --git a/wizards/source/formwizard/dbwizres.src b/wizards/source/formwizard/dbwizres.src index 065008c40cec..c04d77b9fcdd 100644 --- a/wizards/source/formwizard/dbwizres.src +++ b/wizards/source/formwizard/dbwizres.src @@ -2856,7 +2856,7 @@ String RID_WEBWIZARDDIALOG_START +110 String RID_WEBWIZARDDIALOG_START +111 { - Text [ en-US ] = "A security error acoccurred while exporting the document '%FILENAME'."; + Text [ en-US ] = "A security error occurred while exporting the document '%FILENAME'."; }; String RID_WEBWIZARDDIALOG_START +112 diff --git a/xmlsecurity/source/xmlsec/diagnose.cxx b/xmlsecurity/source/xmlsec/diagnose.cxx index 1f17b12650b2..4c10d2f7d576 100644 --- a/xmlsecurity/source/xmlsec/diagnose.cxx +++ b/xmlsecurity/source/xmlsec/diagnose.cxx @@ -39,7 +39,7 @@ namespace xmlsecurity { struct UseDiagnose : public rtl::StaticWithInit< const bool, UseDiagnose> { - const bool operator () () + bool operator () () const { ::rtl::OUString value; sal_Bool res = rtl::Bootstrap::get( diff --git a/xmlsecurity/util/makefile.mk b/xmlsecurity/util/makefile.mk index 1030fbbd10c3..6ef221c7e309 100644 --- a/xmlsecurity/util/makefile.mk +++ b/xmlsecurity/util/makefile.mk @@ -158,7 +158,7 @@ SHL4STDLIBS=\ $(XMLOFFLIB) \ $(SVXCORELIB) -SHL4VERSIONMAP = xmlsecurity.map +SHL4VERSIONMAP = $(SOLARENV)/src/component.map SHL4DEPN= SHL4IMPLIB=i$(TARGET) SHL4DEF=$(MISC)$/$(SHL4TARGET).def diff --git a/xmlsecurity/util/xmlsecurity.map b/xmlsecurity/util/xmlsecurity.map deleted file mode 100644 index ac2c3750bfe0..000000000000 --- a/xmlsecurity/util/xmlsecurity.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; |