From b0e177a0328fe46a08e0da9b4b468466c5bf4ba1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 27 Apr 2010 12:34:19 +0200 Subject: fs33a: #111181# ImplSign: proper check whether the doc can be signed (only bail out if the document is no new) --- sfx2/source/doc/objserv.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index c063546da1c7..e06773f7f178 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1337,8 +1337,13 @@ sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent ) void SfxObjectShell::ImplSign( sal_Bool bScriptingContent ) { // Check if it is stored in OASIS format... - if ( GetMedium() && GetMedium()->GetFilter() - && ( !GetMedium()->GetFilter()->IsOwnFormat() || !GetMedium()->HasStorage_Impl() ) ) + if ( GetMedium() + && GetMedium()->GetFilter() + && GetMedium()->GetName().Len() + && ( !GetMedium()->GetFilter()->IsOwnFormat() + || !GetMedium()->HasStorage_Impl() + ) + ) { // Only OASIS and OOo6.x formats will be handled further InfoBox( NULL, SfxResId( RID_XMLSEC_INFO_WRONGDOCFORMAT ) ).Execute(); -- cgit From f1687933b4b380774871fdeeb0985209e63b430d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 10:05:04 +0200 Subject: fs33a: #i111238# add support for images to AWT's ListBoxControl/Model --- offapi/com/sun/star/awt/ItemListEvent.idl | 76 ++++++++ offapi/com/sun/star/awt/XItemList.idl | 246 ++++++++++++++++++++++++++ offapi/com/sun/star/awt/XItemListListener.idl | 85 +++++++++ offapi/com/sun/star/awt/makefile.mk | 5 +- 4 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 offapi/com/sun/star/awt/ItemListEvent.idl create mode 100644 offapi/com/sun/star/awt/XItemList.idl create mode 100644 offapi/com/sun/star/awt/XItemListListener.idl diff --git a/offapi/com/sun/star/awt/ItemListEvent.idl b/offapi/com/sun/star/awt/ItemListEvent.idl new file mode 100644 index 000000000000..f9d2658bd5bd --- /dev/null +++ b/offapi/com/sun/star/awt/ItemListEvent.idl @@ -0,0 +1,76 @@ +/************************************************************************* + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __offapi_com_sun_star_awt_ListItemEvent_idl__ +#define __offapi_com_sun_star_awt_ListItemEvent_idl__ + +#include +#include + +//================================================================================================================== + +module com { module sun { module star { module awt { + +//================================================================================================================== + +/** is the event broadcasted by a XListItems implementation for changes + in its item list. + */ +struct ItemListEvent : ::com::sun::star::lang::EventObject +{ + /** specifies the position of the item which is affected by the event + +

In case the event is not related to a single item, but to the complete list, the value of this + member is undefined.

+ */ + long ItemPosition; + + /** the text of the item. + +

If the event being notified did not touch the text of an item, this member is empty. For instance, upon + invocation of XItemList::setItemImage, only ItemImageURL will be set, and + ItemText will be empty.

+ */ + ::com::sun::star::beans::Optional< string > + ItemText; + + /** the URL of the image of the item + +

If the event being notified did not touch the image of an item, this member is empty. For instance, upon + invocation of XItemList::setItemText, only ItemText will be set, and + ItemImageURL will be empty.

+ */ + ::com::sun::star::beans::Optional< string > + ItemImageURL; +}; + +//================================================================================================================== + +}; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/awt/XItemList.idl b/offapi/com/sun/star/awt/XItemList.idl new file mode 100644 index 000000000000..55721bf0af36 --- /dev/null +++ b/offapi/com/sun/star/awt/XItemList.idl @@ -0,0 +1,246 @@ +/************************************************************************* + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __offapi_com_sun_star_awt_XItemList_idl__ +#define __offapi_com_sun_star_awt_XItemList_idl__ + +#include +#include + +//================================================================================================================== + +module com { module sun { module star { module awt { + +interface XItemListListener; + +//================================================================================================================== + +/** provides convenient access to the list of items in a list box + */ +interface XItemList +{ + /** is the number of items in the list + */ + [attribute, readonly] long ItemCount; + + /** inserts a new item into the list + + @param Position + the position at which the item should be inserted. Must be greater or equal to 0, and + lesser than or equal to ItemCount. + + @param ItemText + the text of the item to be inserted. + + @param ItemImageURL + the URL of the image to display for the item + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + void insertItem( + [in] long Position, + [in] string ItemText, + [in] string ItemImageURL + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** inserts an item which has only a text, but no image + + @param Position + the position at which the item should be inserted. Must be greater or equal to 0, and + lesser than or equal to ItemCount. + + @param ItemText + the text of the item to be inserted. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + void insertItemText( + [in] long Position, + [in] string ItemText + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** inserts an item which has only an image, but no text + + @param Position + the position at which the item should be inserted. Must be greater or equal to 0, and + lesser than or equal to ItemCount. + + @param ItemImageURL + the URL of the image to display for the item + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + void insertItemImage( + [in] long Position, + [in] string ItemImageURL + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** removes an item from the list + + @param Position + the position of the item which should be removed. Must be greater or equal to 0, and + lesser than ItemCount. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + void removeItem( + [in] long Position + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** removes all items from the list + */ + void removeAllItems(); + + /** sets a new text for an existing item + + @param Position + the position of the item whose text is to be changed. Must be greater or equal to 0, and + lesser than ItemCount. + + @param ItemText + the new text of the item + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + void setItemText( + [in] long Position, + [in] string ItemText + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** sets a new image for an existing item + + @param Position + the position of the item whose image is to be changed. Must be greater or equal to 0, and + lesser than ItemCount. + + @param ItemImageURL + the new URL of the image to display for the item + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + void setItemImage( + [in] long Position, + [in] string ItemImageURL + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** sets both a new position and text for an existing item + + @param Position + the position of the item whose text and image is to be changed. Must be greater or equal to 0, and + lesser than ItemCount. + + @param ItemText + the new text of the item + + @param ItemImageURL + the new URL of the image to display for the item + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + void setItemTextAndImage( + [in] long Position, + [in] string ItemText, + [in] string ItemImageURL + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves the text of an existing item + + @param Position + the position of the item whose text should be retrieved. Must be greater or equal to 0, and + lesser than ItemCount. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + string getItemText( + [in] long Position + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves the URL of the image of an existing item + + @param Position + the position of the item whose image should be retrieved. Must be greater or equal to 0, and + lesser than ItemCount. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + string getItemImage( + [in] long Position + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves both the text and the image URL of an existing item + + @param Position + the position of the item whose text and image should be retrieved. Must be greater or equal to 0, and + lesser than ItemCount. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + */ + ::com::sun::star::beans::Pair< string, string > + getItemTextAndImage( + [in] long Position + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves the texts and images of all items in the list + */ + sequence< ::com::sun::star::beans::Pair< string, string > > + getAllItems(); + + /** registers a listener which is notified about changes in the item list. + */ + void addItemListListener( [in] XItemListListener Listener ); + + /** revokes a listener which is notified about changes in the item list. + */ + void removeItemListListener( [in] XItemListListener Listener ); +}; + +//================================================================================================================== + +}; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/awt/XItemListListener.idl b/offapi/com/sun/star/awt/XItemListListener.idl new file mode 100644 index 000000000000..d41d8b104a02 --- /dev/null +++ b/offapi/com/sun/star/awt/XItemListListener.idl @@ -0,0 +1,85 @@ +/************************************************************************* + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __offapi_com_sun_star_awt_XItemListListener_idl__ +#define __offapi_com_sun_star_awt_XItemListListener_idl__ + +#include +#include + +//================================================================================================================== + +module com { module sun { module star { module awt { + +//================================================================================================================== + +/** describes a listener for changes in a item list + @see XListItems + */ +interface XItemListListener : ::com::sun::star::lang::XEventListener +{ + /** is called when an item is inserted into the list + */ + void listItemInserted( + [in] ItemListEvent Event + ); + + /** is called when an item is removed from the list + */ + void listItemRemoved( + [in] ItemListEvent Event + ); + + /** is called when an item in the list is modified, i.e. its text or image changed + */ + void listItemModified( + [in] ItemListEvent Event + ); + /** is called when the list has been completely cleared, i.e. after an invocation of + XItemList::removeAllItems + */ + void allItemsRemoved( + [in] ::com::sun::star::lang::EventObject Event + ); + + /** is called when the changes to the item list which occured are too complex to be notified + in single events. + +

Consumers of this event should discard their cached information about the current item list, + and completely refresh it from the XItemList's current state.

+ */ + void itemListChanged( + [in] ::com::sun::star::lang::EventObject Event + ); +}; + +//================================================================================================================== + +}; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/awt/makefile.mk b/offapi/com/sun/star/awt/makefile.mk index 1e2350a3a1d3..55734fd75ca6 100644 --- a/offapi/com/sun/star/awt/makefile.mk +++ b/offapi/com/sun/star/awt/makefile.mk @@ -328,7 +328,10 @@ IDLFILES=\ MenuLogo.idl \ XMenuExtended2.idl \ XMenuBarExtended.idl \ - XPopupMenuExtended.idl + XPopupMenuExtended.idl \ + XItemList.idl \ + XItemListListener.idl \ + ItemListEvent.idl # ------------------------------------------------------------------ -- cgit From 4c4cca5a49da75f24e860a7612cd45f552de8f7d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 10:05:04 +0200 Subject: fs33a: #i111238# add support for images to AWT's ListBoxControl/Model --- toolkit/inc/toolkit/awt/vclxwindows.hxx | 31 +- toolkit/inc/toolkit/controls/roadmapcontrol.hxx | 6 - toolkit/inc/toolkit/controls/unocontrol.hxx | 2 +- toolkit/inc/toolkit/controls/unocontrolmodel.hxx | 1 - toolkit/inc/toolkit/controls/unocontrols.hxx | 123 +++-- toolkit/source/awt/vclxwindows.cxx | 136 +++++- toolkit/source/controls/unocontrolmodel.cxx | 21 +- toolkit/source/controls/unocontrols.cxx | 558 +++++++++++++++++++++-- vcl/inc/vcl/lstbox.hxx | 1 + vcl/source/control/lstbox.cxx | 9 + 10 files changed, 759 insertions(+), 129 deletions(-) diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx index c334e4d9af65..8efe01b526ba 100644 --- a/toolkit/inc/toolkit/awt/vclxwindows.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx @@ -83,7 +83,9 @@ #include #include #include +#include #include +#include #include #include "toolkit/awt/vclxwindow.hxx" @@ -677,9 +679,12 @@ public: // ---------------------------------------------------- // class VCLXListBox // ---------------------------------------------------- -class VCLXListBox : public ::com::sun::star::awt::XListBox, - public ::com::sun::star::awt::XTextLayoutConstrains, - public VCLXWindow +typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow + , ::com::sun::star::awt::XListBox + , ::com::sun::star::awt::XTextLayoutConstrains + , ::com::sun::star::awt::XItemListListener + > VCLXListBox_Base; +class VCLXListBox : public VCLXListBox_Base { private: ActionListenerMultiplexer maActionListeners; @@ -694,16 +699,6 @@ protected: public: VCLXListBox(); - // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::release(); } - - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::lang::XComponent void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); @@ -744,6 +739,16 @@ public: void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException); + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } }; diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx index 7ac858a6a7b7..46f31947b276 100644 --- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx +++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx @@ -132,15 +132,9 @@ namespace toolkit{ // ::com::sun::star::io::XPersistObject ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::beans::XMultiPropertySet -// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlModel, szServiceName2_UnoControlRoadmapModel ) -// void ImplPropertyChanged( sal_uInt16 nPropId ); - sal_Int32 SAL_CALL getCount() throw (RuntimeException); virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx index 578b5070e8e8..19d498ef2a85 100644 --- a/toolkit/inc/toolkit/controls/unocontrol.hxx +++ b/toolkit/inc/toolkit/controls/unocontrol.hxx @@ -119,7 +119,7 @@ protected: ::osl::Mutex& GetMutex() { return maMutex; } ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParentPeer() const; - void updateFromModel(); + virtual void updateFromModel(); void peerCreated(); bool ImplCheckLocalize( ::rtl::OUString& _rPossiblyLocalizable ); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplGetCompatiblePeer( sal_Bool bAcceptExistingPeer ); diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx index 2de5e36aa02c..a443cb4d2d6b 100644 --- a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx +++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx @@ -74,7 +74,6 @@ protected: void ImplRegisterProperties( const std::list< sal_uInt16 > &rIds ); void ImplRegisterProperty( sal_uInt16 nPropId, const ::com::sun::star::uno::Any& rDefault ); ::com::sun::star::uno::Sequence ImplGetPropertyIds() const; - virtual void ImplPropertyChanged( sal_uInt16 nPropId ); virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; sal_Bool ImplHasProperty( sal_uInt16 nPropId ) const; diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index a4015dfd3b44..5c612c887859 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -58,12 +59,17 @@ #include #include #include +#include #include #include #include #include #include +#include + +#include +#include #define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:" #define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:" @@ -751,19 +757,18 @@ public: // ---------------------------------------------------- // class UnoControlListBoxModel // ---------------------------------------------------- -class UnoControlListBoxModel : public UnoControlModel +struct UnoControlListBoxModel_Data; +typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel + , ::com::sun::star::awt::XItemList + > UnoControlListBoxModel_Base; +class UnoControlListBoxModel :public UnoControlListBoxModel_Base { -protected: - ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; - ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - public: UnoControlListBoxModel(); - UnoControlListBoxModel( const UnoControlListBoxModel& rModel ) : UnoControlModel( rModel ) {;} + UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); UnoControlModel* Clone() const { return new UnoControlListBoxModel( *this ); } - void ImplPropertyChanged( sal_uInt16 nPropId ); virtual void ImplNormalizePropertySequence( const sal_Int32 _nCount, /// the number of entries in the arrays sal_Int32* _pHandles, /// the handles of the properties to set @@ -780,41 +785,85 @@ public: // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) + // ::com::sun::star::awt::XItemList + virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItem( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItem( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeAllItems( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + + // OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +private: + void impl_notifyItemListEvent_nolck( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + void ( SAL_CALL ::com::sun::star::awt::XItemListListener::*NotificationMethod )( const ::com::sun::star::awt::ItemListEvent& ) + ); + + void impl_handleInsert( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_handleRemove( + const sal_Int32 i_nItemPosition, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_handleModify( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const; + void impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ); + +private: + ::boost::scoped_ptr< UnoControlListBoxModel_Data > m_pData; + ::cppu::OInterfaceContainerHelper m_aItemListListeners; }; // ---------------------------------------------------- // class UnoListBoxControl // ---------------------------------------------------- -class UnoListBoxControl : public UnoControlBase, - public ::com::sun::star::awt::XListBox, - public ::com::sun::star::awt::XItemListener, - public ::com::sun::star::awt::XLayoutConstrains, - public ::com::sun::star::awt::XTextLayoutConstrains +typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase + , ::com::sun::star::awt::XListBox + , ::com::sun::star::awt::XItemListener + , ::com::sun::star::awt::XLayoutConstrains + , ::com::sun::star::awt::XTextLayoutConstrains + , ::com::sun::star::awt::XItemListListener + > UnoListBoxControl_Base; +class UnoListBoxControl : public UnoListBoxControl_Base { -private: - ActionListenerMultiplexer maActionListeners; - ItemListenerMultiplexer maItemListeners; - public: - UnoListBoxControl(); ::rtl::OUString GetComponentServiceName(); - void ImplUpdateSelectedItemsProperty(); - void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); - - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } - ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } - void SAL_CALL release() throw() { OWeakAggObject::release(); } void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::XListBox void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); @@ -851,9 +900,27 @@ public: ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); + // XUnoControl + sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) +protected: + void ImplUpdateSelectedItemsProperty(); + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + virtual void updateFromModel(); + +private: + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; }; // ---------------------------------------------------- diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index e2fc78421d5e..ff4dc6fb5ec4 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -29,7 +29,7 @@ #include "precompiled_toolkit.hxx" #include #include -#include +#include #include #include #include @@ -43,6 +43,9 @@ #include #include #include +#include +#include +#include #include #ifndef _SV_BUTTON_HXX @@ -58,12 +61,17 @@ #include #include #include -#include +#include using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::makeAny; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::lang::EventObject; +using ::com::sun::star::awt::ItemListEvent; +using ::com::sun::star::awt::XItemList; using ::com::sun::star::graphic::XGraphic; +using ::com::sun::star::graphic::XGraphicProvider; using namespace ::com::sun::star; using namespace ::com::sun::star::awt::VisualEffect; @@ -1550,22 +1558,6 @@ VCLXListBox::VCLXListBox() { } -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXListBox::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XListBox*, this ), - SAL_STATIC_CAST( ::com::sun::star::awt::XTextLayoutConstrains*, this ) ); - return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXListBox ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XListBox>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ), - VCLXWindow::getTypes() -IMPL_XTYPEPROVIDER_END - void VCLXListBox::dispose() throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -2096,6 +2088,114 @@ void VCLXListBox::ImplCallItemListeners() } } +namespace +{ + Image lcl_getImageFromURL( const ::rtl::OUString& i_rImageURL ) + { + if ( !i_rImageURL.getLength() ) + return Image(); + + try + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XGraphicProvider > xProvider; + if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) ) + { + ::comphelper::NamedValueCollection aMediaProperties; + aMediaProperties.put( "URL", i_rImageURL ); + Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() ); + return Image( xGraphic ); + } + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return Image(); + } +} + +void SAL_CALL VCLXListBox::listItemInserted( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemInserted: no ListBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition <= sal_Int32( pListBox->GetEntryCount() ) ), + "VCLXListBox::listItemInserted: illegal (inconsistent) item position!" ); + pListBox->InsertEntry( + i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString(), + i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(), + i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXListBox::listItemRemoved( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemRemoved: no ListBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pListBox->GetEntryCount() ) ), + "VCLXListBox::listItemRemoved: illegal (inconsistent) item position!" ); + + pListBox->RemoveEntry( i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXListBox::listItemModified( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pListBox->GetEntryCount() ) ), + "VCLXListBox::listItemModified: illegal (inconsistent) item position!" ); + + // VCL's ListBox does not support changing an entry's text or image, so remove and re-insert + + const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : pListBox->GetEntry( i_rEvent.ItemPosition ); + const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) ); + + pListBox->RemoveEntry( i_rEvent.ItemPosition ); + pListBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXListBox::allItemsRemoved( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" ); + + pListBox->Clear(); + + (void)i_rEvent; +} + +void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ListBox* pListBox = dynamic_cast< ListBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pListBox, "VCLXListBox::listItemModified: no ListBox?!" ); + + pListBox->Clear(); + + Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW ); + uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems(); + for ( sal_Int32 i=0; iInsertEntry( aItems[i].First, lcl_getImageFromURL( aItems[i].Second ) ); + } +} + +void SAL_CALL VCLXListBox::disposing( const EventObject& i_rEvent ) throw (RuntimeException) +{ + // just disambiguate + VCLXWindow::disposing( i_rEvent ); +} // ---------------------------------------------------- // class VCLXMessageBox diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 29b683a5ed40..d34f5d9d9006 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -216,10 +216,6 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const return mpData->Get( nPropId ) ? sal_True : sal_False; } -void UnoControlModel::ImplPropertyChanged( sal_uInt16 ) -{ -} - ::com::sun::star::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { ::com::sun::star::uno::Any aDefault; @@ -1259,22 +1255,13 @@ sal_Bool UnoControlModel::convertFastPropertyValue( Any & rConvertedValue, Any & void UnoControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nPropId, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); - // Fehlt: Die gefakten Einzelproperties des FontDescriptors... ImplControlProperty* pProp = mpData->Get( nPropId ); - if ( pProp ) - { - DBG_ASSERT( ( rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID ) || ( GetPropertyAttribs( (sal_uInt16)nPropId ) & ::com::sun::star::beans::PropertyAttribute::MAYBEVOID ), "Property darf nicht VOID sein!" ); - ImplPropertyChanged( (sal_uInt16)nPropId ); - pProp->SetValue( rValue ); - } - else - { - // exception... - DBG_ERROR( "SetPropertyValues: Invalid Property!" ); - } + ENSURE_OR_RETURN_VOID( pProp, "UnoControlModel::setFastPropertyValue_NoBroadcast: invalid property id!" ); + + DBG_ASSERT( ( rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID ) || ( GetPropertyAttribs( (sal_uInt16)nPropId ) & ::com::sun::star::beans::PropertyAttribute::MAYBEVOID ), "Property darf nicht VOID sein!" ); + pProp->SetValue( rValue ); } void UnoControlModel::getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nPropId ) const diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index ae9e59d045e7..a4b7037b3b73 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -73,8 +73,11 @@ #include #include +#include using namespace ::com::sun::star; +using ::com::sun::star::graphic::XGraphic; +using ::com::sun::star::uno::Reference; using namespace ::toolkit; @@ -1841,19 +1844,100 @@ sal_Bool UnoGroupBoxControl::isTransparent() throw(uno::RuntimeException) return sal_True; } -// ---------------------------------------------------- -// class UnoControlListBoxModel -// ---------------------------------------------------- +// ===================================================================================================================== +// = UnoControlListBoxModel_Data +// ===================================================================================================================== +typedef beans::Pair< ::rtl::OUString, ::rtl::OUString > ListItem; +struct UnoControlListBoxModel_Data +{ + UnoControlListBoxModel_Data( UnoControlListBoxModel& i_rAntiImpl ) + :m_rAntiImpl( i_rAntiImpl ) + ,m_aListItems() + ,m_bSettingLegacyProperty( false ) + { + } + + sal_Int32 getItemCount() const { return sal_Int32( m_aListItems.size() ); } + + const ListItem& getItem( const sal_Int32 i_nIndex ) const + { + if ( ( i_nIndex < 0 ) || ( i_nIndex >= sal_Int32( m_aListItems.size() ) ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), m_rAntiImpl ); + return m_aListItems[ i_nIndex ]; + } + + ListItem& getItem( const sal_Int32 i_nIndex ) + { + return const_cast< ListItem& >( static_cast< const UnoControlListBoxModel_Data* >( this )->getItem( i_nIndex ) ); + } + + ListItem& insertItem( const sal_Int32 i_nIndex ) + { + if ( ( i_nIndex < 0 ) || ( i_nIndex > sal_Int32( m_aListItems.size() ) ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), m_rAntiImpl ); + return *m_aListItems.insert( m_aListItems.begin() + i_nIndex, ListItem() ); + } + + Sequence< ListItem > getAllItems() const + { + Sequence< ListItem > aItems( sal_Int32( m_aListItems.size() ) ); + ::std::copy( m_aListItems.begin(), m_aListItems.end(), aItems.getArray() ); + return aItems; + } + + void setAllItems( const ::std::vector< ListItem >& i_rItems ) + { + m_aListItems = i_rItems; + } + + void removeItem( const sal_Int32 i_nIndex ) + { + if ( ( i_nIndex < 0 ) || ( i_nIndex >= sal_Int32( m_aListItems.size() ) ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), m_rAntiImpl ); + m_aListItems.erase( m_aListItems.begin() + i_nIndex ); + } + + void removeAllItems() + { + ::std::vector< ListItem > aEmpty; + m_aListItems.swap( aEmpty ); + } + +public: + bool m_bSettingLegacyProperty; + +private: + UnoControlListBoxModel& m_rAntiImpl; + ::std::vector< ListItem > m_aListItems; +}; + +// ===================================================================================================================== +// = UnoControlListBoxModel +// ===================================================================================================================== +// --------------------------------------------------------------------------------------------------------------------- UnoControlListBoxModel::UnoControlListBoxModel() + :UnoControlListBoxModel_Base() + ,m_pData( new UnoControlListBoxModel_Data( *this ) ) + ,m_aItemListListeners( GetMutex() ) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox ); } +// --------------------------------------------------------------------------------------------------------------------- +UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ) + :UnoControlListBoxModel_Base( i_rSource ) + ,m_pData( new UnoControlListBoxModel_Data( *this ) ) + ,m_aItemListListeners( GetMutex() ) +{ +} + +// --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) { return ::rtl::OUString::createFromAscii( szServiceName_UnoControlListBoxModel ); } +// --------------------------------------------------------------------------------------------------------------------- uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) @@ -1865,6 +1949,7 @@ uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return UnoControlModel::ImplGetDefaultValue( nPropId ); } +// --------------------------------------------------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper& UnoControlListBoxModel::getInfoHelper() { static UnoPropertyArrayHelper* pHelper = NULL; @@ -1876,6 +1961,7 @@ uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return *pHelper; } +// --------------------------------------------------------------------------------------------------------------------- // beans::XMultiPropertySet uno::Reference< beans::XPropertySetInfo > UnoControlListBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) { @@ -1883,19 +1969,61 @@ uno::Reference< beans::XPropertySetInfo > UnoControlListBoxModel::getPropertySet return xInfo; } -void UnoControlListBoxModel::ImplPropertyChanged( sal_uInt16 nPropId ) +// --------------------------------------------------------------------------------------------------------------------- +namespace +{ + struct CreateListItem : public ::std::unary_function< ::rtl::OUString, ListItem > + { + ListItem operator()( const ::rtl::OUString& i_rItemText ) + { + return ListItem( i_rItemText, ::rtl::OUString() ); + } + }; +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue ) throw (uno::Exception) { - if ( nPropId == BASEPROPERTY_STRINGITEMLIST ) + UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue ); + + if ( nHandle == BASEPROPERTY_STRINGITEMLIST ) { + // reset selection uno::Sequence aSeq; uno::Any aAny; aAny <<= aSeq; setPropertyValue( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ), aAny ); - } - UnoControlModel::ImplPropertyChanged( nPropId ); + if ( !m_pData->m_bSettingLegacyProperty ) + { + // synchronize the legacy StringItemList property with our list items + Sequence< ::rtl::OUString > aStringItemList; + Any aPropValue; + getFastPropertyValue( aPropValue, BASEPROPERTY_STRINGITEMLIST ); + OSL_VERIFY( aPropValue >>= aStringItemList ); + + ::std::vector< ListItem > aItems( aStringItemList.getLength() ); + ::std::transform( + aStringItemList.getConstArray(), + aStringItemList.getConstArray() + aStringItemList.getLength(), + aItems.begin(), + CreateListItem() + ); + m_pData->setAllItems( aItems ); + + // since an XItemListListener does not have a "all items modified" or some such method, + // we simulate this by notifying removal of all items, followed by insertion of all new + // items + lang::EventObject aEvent; + aEvent.Source = *this; + m_aItemListListeners.notifyEach( &XItemListListener::itemListChanged, aEvent ); + // TODO: OPropertySetHelper calls into this method with the mutex locked ... + // which is wrong for the above notifications ... + } + } } +// --------------------------------------------------------------------------------------------------------------------- void UnoControlListBoxModel::ImplNormalizePropertySequence( const sal_Int32 _nCount, sal_Int32* _pHandles, uno::Any* _pValues, sal_Int32* _pValidHandles ) const SAL_THROW(()) { @@ -1906,12 +2034,311 @@ void UnoControlListBoxModel::ImplNormalizePropertySequence( const sal_Int32 _nCo UnoControlModel::ImplNormalizePropertySequence( _nCount, _pHandles, _pValues, _pValidHandles ); } +// --------------------------------------------------------------------------------------------------------------------- +::sal_Int32 SAL_CALL UnoControlListBoxModel::getItemCount() throw (RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + return m_pData->getItemCount(); +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::insertItem( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->insertItem( i_nPosition ) ); + rItem.First = i_rItemText; + rItem.Second = i_rItemImageURL; + + impl_handleInsert( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::insertItemText( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->insertItem( i_nPosition ) ); + rItem.First = i_rItemText; + + impl_handleInsert( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::insertItemImage( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->insertItem( i_nPosition ) ); + rItem.Second = i_rItemImageURL; + + impl_handleInsert( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::removeItem( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + m_pData->removeItem( i_nPosition ); + + impl_handleRemove( i_nPosition, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::removeAllItems( ) throw (::com::sun::star::uno::RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + m_pData->removeAllItems(); + + impl_handleRemove( -1, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setItemText( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.First = i_rItemText; + + impl_handleModify( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setItemImage( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.Second = i_rItemImageURL; + + impl_handleModify( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setItemTextAndImage( ::sal_Int32 i_nPosition, const ::rtl::OUString& i_rItemText, const ::rtl::OUString& i_rItemImageURL ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + // SYNCHRONIZED -----> + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.First = i_rItemText; + rItem.Second = i_rItemImageURL; + + impl_handleModify( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); + // <----- SYNCHRONIZED +} + +// --------------------------------------------------------------------------------------------------------------------- +::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemText( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.First; +} + +// --------------------------------------------------------------------------------------------------------------------- +::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.Second; +} + +// --------------------------------------------------------------------------------------------------------------------- +beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL UnoControlListBoxModel::getItemTextAndImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem; +} + +// --------------------------------------------------------------------------------------------------------------------- +Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL UnoControlListBoxModel::getAllItems( ) throw (RuntimeException) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + return m_pData->getAllItems(); +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::addItemListListener( const uno::Reference< awt::XItemListListener >& i_Listener ) throw (uno::RuntimeException) +{ + if ( i_Listener.is() ) + m_aItemListListeners.addInterface( i_Listener ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::removeItemListListener( const uno::Reference< awt::XItemListListener >& i_Listener ) throw (uno::RuntimeException) +{ + if ( i_Listener.is() ) + m_aItemListListeners.removeInterface( i_Listener ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const +{ + Sequence< ::rtl::OUString > aStringItemList; + Any aPropValue; + getFastPropertyValue( aPropValue, BASEPROPERTY_STRINGITEMLIST ); + OSL_VERIFY( aPropValue >>= aStringItemList ); + + o_rStringItems.resize( size_t( aStringItemList.getLength() ) ); + ::std::copy( + aStringItemList.getConstArray(), + aStringItemList.getConstArray() + aStringItemList.getLength(), + o_rStringItems.begin() + ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ) +{ + Sequence< ::rtl::OUString > aStringItems( i_rStringItems.size() ); + ::std::copy( + i_rStringItems.begin(), + i_rStringItems.end(), + aStringItems.getArray() + ); + m_pData->m_bSettingLegacyProperty = true; + try + { + setFastPropertyValue( BASEPROPERTY_STRINGITEMLIST, uno::makeAny( aStringItems ) ); + } + catch( const Exception& ) + { + m_pData->m_bSettingLegacyProperty = false; + throw; + } + m_pData->m_bSettingLegacyProperty = false; +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_handleInsert( const sal_Int32 i_nItemPosition, const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, ::osl::ClearableMutexGuard& i_rClearBeforeNotify ) +{ + // SYNCHRONIZED -----> + // sync with legacy StringItemList property + ::std::vector< ::rtl::OUString > aStringItems; + impl_getStringItemList( aStringItems ); + OSL_ENSURE( size_t( i_nItemPosition ) <= aStringItems.size(), "UnoControlListBoxModel::impl_handleInsert" ); + if ( size_t( i_nItemPosition ) <= aStringItems.size() ) + { + const ::rtl::OUString sItemText( !!i_rItemText ? *i_rItemText : ::rtl::OUString() ); + aStringItems.insert( aStringItems.begin() + i_nItemPosition, sItemText ); + } + + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + impl_setStringItemList_nolck( aStringItems ); + + // notify ItemListListeners + impl_notifyItemListEvent_nolck( i_nItemPosition, i_rItemText, i_rItemImageURL, &XItemListListener::listItemInserted ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_handleRemove( const sal_Int32 i_nItemPosition, ::osl::ClearableMutexGuard& i_rClearBeforeNotify ) +{ + // SYNCHRONIZED -----> + const bool bAllItems = ( i_nItemPosition < 0 ); + // sync with legacy StringItemList property + ::std::vector< ::rtl::OUString > aStringItems; + impl_getStringItemList( aStringItems ); + if ( !bAllItems ) + { + OSL_ENSURE( size_t( i_nItemPosition ) < aStringItems.size(), "UnoControlListBoxModel::impl_handleRemove" ); + if ( size_t( i_nItemPosition ) < aStringItems.size() ) + { + aStringItems.erase( aStringItems.begin() + i_nItemPosition ); + } + } + else + { + aStringItems.resize(0); + } + + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + impl_setStringItemList_nolck( aStringItems ); + + // notify ItemListListeners + if ( bAllItems ) + { + EventObject aEvent( *this ); + m_aItemListListeners.notifyEach( &XItemListListener::allItemsRemoved, aEvent ); + } + else + { + impl_notifyItemListEvent_nolck( i_nItemPosition, ::boost::optional< ::rtl::OUString >(), ::boost::optional< ::rtl::OUString >(), + &XItemListListener::listItemRemoved ); + } +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_handleModify( const sal_Int32 i_nItemPosition, const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, ::osl::ClearableMutexGuard& i_rClearBeforeNotify ) +{ + // SYNCHRONIZED -----> + if ( !!i_rItemText ) + { + // sync with legacy StringItemList property + ::std::vector< ::rtl::OUString > aStringItems; + impl_getStringItemList( aStringItems ); + OSL_ENSURE( size_t( i_nItemPosition ) < aStringItems.size(), "UnoControlListBoxModel::impl_handleModify" ); + if ( size_t( i_nItemPosition ) < aStringItems.size() ) + { + aStringItems[ i_nItemPosition] = *i_rItemText; + } + + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + impl_setStringItemList_nolck( aStringItems ); + } + else + { + i_rClearBeforeNotify.clear(); + // <----- SYNCHRONIZED + } + + // notify ItemListListeners + impl_notifyItemListEvent_nolck( i_nItemPosition, i_rItemText, i_rItemImageURL, &XItemListListener::listItemModified ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void UnoControlListBoxModel::impl_notifyItemListEvent_nolck( const sal_Int32 i_nItemPosition, const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + void ( SAL_CALL XItemListListener::*NotificationMethod )( const ItemListEvent& ) ) +{ + ItemListEvent aEvent; + aEvent.Source = *this; + aEvent.ItemPosition = i_nItemPosition; + if ( !!i_rItemText ) + { + aEvent.ItemText.IsPresent = sal_True; + aEvent.ItemText.Value = *i_rItemText; + } + if ( !!i_rItemImageURL ) + { + aEvent.ItemImageURL.IsPresent = sal_True; + aEvent.ItemImageURL.Value = *i_rItemImageURL; + } + + m_aItemListListeners.notifyEach( NotificationMethod, aEvent ); +} + // ---------------------------------------------------- // class UnoListBoxControl // ---------------------------------------------------- UnoListBoxControl::UnoListBoxControl() - : maActionListeners( *this ), - maItemListeners( *this ) + :maActionListeners( *this ) + ,maItemListeners( *this ) { maComponentInfos.nWidth = 100; maComponentInfos.nHeight = 12; @@ -1922,27 +2349,6 @@ UnoListBoxControl::UnoListBoxControl() return ::rtl::OUString::createFromAscii( "listbox" ); } -// uno::XInterface -uno::Any UnoListBoxControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) -{ - uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( awt::XListBox*, this ), - SAL_STATIC_CAST( awt::XItemListener*, this ), - SAL_STATIC_CAST( lang::XEventListener*, SAL_STATIC_CAST( awt::XItemListener*, this ) ), - SAL_STATIC_CAST( awt::XLayoutConstrains*, this ), - SAL_STATIC_CAST( awt::XTextLayoutConstrains*, this ) ); - return (aRet.hasValue() ? aRet : UnoControlBase::queryAggregation( rType )); -} - -// lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( UnoListBoxControl ) - getCppuType( ( uno::Reference< awt::XListBox>* ) NULL ), - getCppuType( ( uno::Reference< awt::XItemListener>* ) NULL ), - getCppuType( ( uno::Reference< awt::XLayoutConstrains>* ) NULL ), - getCppuType( ( uno::Reference< awt::XTextLayoutConstrains>* ) NULL ), - UnoControlBase::getTypes() -IMPL_XTYPEPROVIDER_END - void UnoListBoxControl::dispose() throw(uno::RuntimeException) { lang::EventObject aEvt; @@ -1966,24 +2372,26 @@ void UnoListBoxControl::ImplUpdateSelectedItemsProperty() } } -void UnoListBoxControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) +void UnoListBoxControl::updateFromModel() { - UnoControl::ImplSetPeerProperty( rPropName, rVal ); + UnoControlBase::updateFromModel(); + + Reference< XItemListListener > xItemListListener( getPeer(), UNO_QUERY ); + ENSURE_OR_RETURN_VOID( xItemListListener.is(), "UnoListBoxControl::updateFromModel: a peer which is no ItemListListener?!" ); + + EventObject aEvent( getModel() ); + xItemListListener->itemListChanged( aEvent ); +} - // Wenn die SelectedItems vor der StringItemList gesetzt werden, - // hat das keine Auswirkung... +void UnoListBoxControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) +{ if ( rPropName == GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) ) - { - ::rtl::OUString aSelPropName = GetPropertyName( BASEPROPERTY_SELECTEDITEMS ); - uno::Any aVal = ImplGetPropertyValue( aSelPropName ); - if ( !( aVal.getValueType().getTypeClass() == uno::TypeClass_VOID ) ) - { - uno::Reference< awt::XVclWindowPeer > xW( getPeer(), uno::UNO_QUERY ); - if (xW.is()) - // same comment as in UnoControl::ImplSetPeerProperty - see there - xW->setProperty( aSelPropName, aVal ); - } - } + // do not forward this to our peer. We are a XItemListListener at our model, and changes in the string item + // list (which is a legacy property) will, later, arrive as changes in the ItemList. Those latter changes + // will be forwarded to the peer, which will update itself accordingly. + return; + + UnoControl::ImplSetPeerProperty( rPropName, rVal ); } void UnoListBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException) @@ -2281,6 +2689,66 @@ void UnoListBoxControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines Impl_getColumnsAndLines( nCols, nLines ); } +sal_Bool SAL_CALL UnoListBoxControl::setModel( const uno::Reference< awt::XControlModel >& i_rModel ) throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + + const Reference< XItemList > xOldItems( getModel(), UNO_QUERY ); + OSL_ENSURE( xOldItems.is() || !getModel().is(), "UnoListBoxControl::setModel: illegal old model!" ); + const Reference< XItemList > xNewItems( i_rModel, UNO_QUERY ); + OSL_ENSURE( xNewItems.is() || !i_rModel.is(), "UnoListBoxControl::setModel: illegal new model!" ); + + if ( !UnoListBoxControl_Base::setModel( i_rModel ) ) + return sal_False; + + if ( xOldItems.is() ) + xOldItems->removeItemListListener( this ); + if ( xNewItems.is() ) + xNewItems->addItemListListener( this ); + + return sal_True; +} + +void SAL_CALL UnoListBoxControl::listItemInserted( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemInserted: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemInserted( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::listItemRemoved( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemRemoved( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::listItemModified( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::listItemModified: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemModified( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::allItemsRemoved( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::allItemsRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->allItemsRemoved( i_rEvent ); +} + +void SAL_CALL UnoListBoxControl::itemListChanged( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoListBoxControl::itemListChanged: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->itemListChanged( i_rEvent ); +} + // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx index 98cd05d999dd..3659e5aee485 100644 --- a/vcl/inc/vcl/lstbox.hxx +++ b/vcl/inc/vcl/lstbox.hxx @@ -130,6 +130,7 @@ public: virtual USHORT GetEntryPos( const XubString& rStr ) const; virtual USHORT GetEntryPos( const void* pData ) const; + Image GetEntryImage( USHORT nPos ) const; virtual XubString GetEntry( USHORT nPos ) const; virtual USHORT GetEntryCount() const; diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 70b67c0a3d57..dde34d52806c 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1081,6 +1081,15 @@ void ListBox::RemoveEntry( USHORT nPos ) // ----------------------------------------------------------------------- +Image ListBox::GetEntryImage( USHORT nPos ) const +{ + if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) ) + return mpImplLB->GetEntryList()->GetEntryImage( nPos ); + return Image(); +} + +// ----------------------------------------------------------------------- + USHORT ListBox::GetEntryPos( const XubString& rStr ) const { USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr ); -- cgit From 11553bcd8eacca6cda02ea0e32c5d5bcf611638e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 10:15:25 +0200 Subject: fs33a: #i111238# add (optional, since the thing is published) support for XItemList --- offapi/com/sun/star/awt/UnoControlListBoxModel.idl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl index 5017b05635ad..1cd36de93231 100644 --- a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl +++ b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl @@ -39,6 +39,8 @@ #include #endif +#include + //============================================================================= @@ -208,6 +210,11 @@ published service UnoControlListBoxModel this is possible.

*/ [optional, property] short MouseWheelBehavior; + + /** allows mmanipulating the list of items in the list box more fine-grained than the + StringItemList property. + */ + [optional] interface XItemList; }; //============================================================================= -- cgit From 850d1272686417389b67794ace4a01d3269ea2e6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 14:10:03 +0200 Subject: fs33a: #i111238# now with UserData support --- toolkit/inc/toolkit/controls/unocontrols.hxx | 2 + toolkit/source/controls/unocontrols.cxx | 84 +++++++++++++++++++++------- 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 5c612c887859..71e0a915788d 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -795,9 +795,11 @@ public: virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setUserData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getUserData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index a4b7037b3b73..975040ca9070 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1847,7 +1847,37 @@ sal_Bool UnoGroupBoxControl::isTransparent() throw(uno::RuntimeException) // ===================================================================================================================== // = UnoControlListBoxModel_Data // ===================================================================================================================== -typedef beans::Pair< ::rtl::OUString, ::rtl::OUString > ListItem; +struct ListItem +{ + ::rtl::OUString ItemText; + ::rtl::OUString ItemImageURL; + Any ItemUserData; + + ListItem() + :ItemText() + ,ItemImageURL() + ,ItemUserData() + { + } + + ListItem( const ::rtl::OUString& i_rItemText ) + :ItemText( i_rItemText ) + ,ItemImageURL() + ,ItemUserData() + { + } +}; + +typedef beans::Pair< ::rtl::OUString, ::rtl::OUString > UnoListItem; + +struct StripItemData : public ::std::unary_function< ListItem, UnoListItem > +{ + UnoListItem operator()( const ListItem& i_rItem ) + { + return UnoListItem( i_rItem.ItemText, i_rItem.ItemImageURL ); + } +}; + struct UnoControlListBoxModel_Data { UnoControlListBoxModel_Data( UnoControlListBoxModel& i_rAntiImpl ) @@ -1878,10 +1908,10 @@ struct UnoControlListBoxModel_Data return *m_aListItems.insert( m_aListItems.begin() + i_nIndex, ListItem() ); } - Sequence< ListItem > getAllItems() const + Sequence< UnoListItem > getAllItems() const { - Sequence< ListItem > aItems( sal_Int32( m_aListItems.size() ) ); - ::std::copy( m_aListItems.begin(), m_aListItems.end(), aItems.getArray() ); + Sequence< UnoListItem > aItems( sal_Int32( m_aListItems.size() ) ); + ::std::transform( m_aListItems.begin(), m_aListItems.end(), aItems.getArray(), StripItemData() ); return aItems; } @@ -1976,7 +2006,7 @@ namespace { ListItem operator()( const ::rtl::OUString& i_rItemText ) { - return ListItem( i_rItemText, ::rtl::OUString() ); + return ListItem( i_rItemText ); } }; } @@ -2047,8 +2077,8 @@ void SAL_CALL UnoControlListBoxModel::insertItem( ::sal_Int32 i_nPosition, const ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->insertItem( i_nPosition ) ); - rItem.First = i_rItemText; - rItem.Second = i_rItemImageURL; + rItem.ItemText = i_rItemText; + rItem.ItemImageURL = i_rItemImageURL; impl_handleInsert( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED @@ -2060,7 +2090,7 @@ void SAL_CALL UnoControlListBoxModel::insertItemText( ::sal_Int32 i_nPosition, c ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->insertItem( i_nPosition ) ); - rItem.First = i_rItemText; + rItem.ItemText = i_rItemText; impl_handleInsert( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); // <----- SYNCHRONIZED @@ -2072,7 +2102,7 @@ void SAL_CALL UnoControlListBoxModel::insertItemImage( ::sal_Int32 i_nPosition, ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->insertItem( i_nPosition ) ); - rItem.Second = i_rItemImageURL; + rItem.ItemImageURL = i_rItemImageURL; impl_handleInsert( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED @@ -2106,7 +2136,7 @@ void SAL_CALL UnoControlListBoxModel::setItemText( ::sal_Int32 i_nPosition, cons ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.First = i_rItemText; + rItem.ItemText = i_rItemText; impl_handleModify( i_nPosition, i_rItemText, ::boost::optional< ::rtl::OUString >(), aGuard ); // <----- SYNCHRONIZED @@ -2118,7 +2148,7 @@ void SAL_CALL UnoControlListBoxModel::setItemImage( ::sal_Int32 i_nPosition, con ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.Second = i_rItemImageURL; + rItem.ItemImageURL = i_rItemImageURL; impl_handleModify( i_nPosition, ::boost::optional< ::rtl::OUString >(), i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED @@ -2130,35 +2160,51 @@ void SAL_CALL UnoControlListBoxModel::setItemTextAndImage( ::sal_Int32 i_nPositi ::osl::ClearableMutexGuard aGuard( GetMutex() ); // SYNCHRONIZED -----> ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.First = i_rItemText; - rItem.Second = i_rItemImageURL; + rItem.ItemText = i_rItemText; + rItem.ItemImageURL = i_rItemImageURL; impl_handleModify( i_nPosition, i_rItemText, i_rItemImageURL, aGuard ); // <----- SYNCHRONIZED } +// --------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoControlListBoxModel::setUserData( ::sal_Int32 i_nPosition, const Any& i_rDataValue ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + ListItem& rItem( m_pData->getItem( i_nPosition ) ); + rItem.ItemUserData = i_rDataValue; +} + // --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemText( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( GetMutex() ); - ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem.First; + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.ItemText; } // --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString SAL_CALL UnoControlListBoxModel::getItemImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( GetMutex() ); - ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem.Second; + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.ItemImageURL; } // --------------------------------------------------------------------------------------------------------------------- beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL UnoControlListBoxModel::getItemTextAndImage( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard( GetMutex() ); - ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem; + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return beans::Pair< ::rtl::OUString, ::rtl::OUString >( rItem.ItemText, rItem.ItemImageURL ); +} + +// --------------------------------------------------------------------------------------------------------------------- +Any SAL_CALL UnoControlListBoxModel::getUserData( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +{ + ::osl::ClearableMutexGuard aGuard( GetMutex() ); + const ListItem& rItem( m_pData->getItem( i_nPosition ) ); + return rItem.ItemUserData; } // --------------------------------------------------------------------------------------------------------------------- -- cgit From a41a0230c9c56f4f21c8ca5c4b7fd898678e30bb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 14:10:03 +0200 Subject: fs33a: #i111238# now with UserData support --- offapi/com/sun/star/awt/XItemList.idl | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/offapi/com/sun/star/awt/XItemList.idl b/offapi/com/sun/star/awt/XItemList.idl index 55721bf0af36..3d618d760322 100644 --- a/offapi/com/sun/star/awt/XItemList.idl +++ b/offapi/com/sun/star/awt/XItemList.idl @@ -180,6 +180,26 @@ interface XItemList ) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** associates an implementation dependend value with the given list item. + +

You can use this to store data for an item which does not interfere with the displayed + text and image, but can be used by the client of the list box for an arbitrary purpose.

+ + @param Position + the position of the item whose data value should be set. Must be greater or equal to 0, and + lesser than ItemCount. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + + @see getUserData + */ + void setUserData( + [in] long Position, + [in] any DataValue + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** retrieves the text of an existing item @param Position @@ -223,6 +243,23 @@ interface XItemList ) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** retrieves the implementation dependend value associated with the given list item. + @see setUserData + + @param Position + the position of the item whose data value should be retrieved. Must be greater or equal to 0, and + lesser than ItemCount. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Position is invalid. + + @see getUserData + */ + any getUserData( + [in] long Position + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** retrieves the texts and images of all items in the list */ sequence< ::com::sun::star::beans::Pair< string, string > > -- cgit From 6b310decbc330847cd88bd001e6120f3042d1b7c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 15:29:46 +0200 Subject: fs33a: #i111238# [s|g]etUserData -> [s|g]etItemData --- toolkit/inc/toolkit/controls/unocontrols.hxx | 4 ++-- toolkit/source/controls/unocontrols.cxx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 71e0a915788d..88449418c70a 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -795,11 +795,11 @@ public: virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setUserData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getUserData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getItemData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 975040ca9070..8b37978c58e6 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1851,19 +1851,19 @@ struct ListItem { ::rtl::OUString ItemText; ::rtl::OUString ItemImageURL; - Any ItemUserData; + Any ItemData; ListItem() :ItemText() ,ItemImageURL() - ,ItemUserData() + ,ItemData() { } ListItem( const ::rtl::OUString& i_rItemText ) :ItemText( i_rItemText ) ,ItemImageURL() - ,ItemUserData() + ,ItemData() { } }; @@ -2168,11 +2168,11 @@ void SAL_CALL UnoControlListBoxModel::setItemTextAndImage( ::sal_Int32 i_nPositi } // --------------------------------------------------------------------------------------------------------------------- -void SAL_CALL UnoControlListBoxModel::setUserData( ::sal_Int32 i_nPosition, const Any& i_rDataValue ) throw (IndexOutOfBoundsException, RuntimeException) +void SAL_CALL UnoControlListBoxModel::setItemData( ::sal_Int32 i_nPosition, const Any& i_rDataValue ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::ClearableMutexGuard aGuard( GetMutex() ); ListItem& rItem( m_pData->getItem( i_nPosition ) ); - rItem.ItemUserData = i_rDataValue; + rItem.ItemData = i_rDataValue; } // --------------------------------------------------------------------------------------------------------------------- @@ -2200,11 +2200,11 @@ beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL UnoControlListBoxModel: } // --------------------------------------------------------------------------------------------------------------------- -Any SAL_CALL UnoControlListBoxModel::getUserData( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) +Any SAL_CALL UnoControlListBoxModel::getItemData( ::sal_Int32 i_nPosition ) throw (IndexOutOfBoundsException, RuntimeException) { ::osl::ClearableMutexGuard aGuard( GetMutex() ); const ListItem& rItem( m_pData->getItem( i_nPosition ) ); - return rItem.ItemUserData; + return rItem.ItemData; } // --------------------------------------------------------------------------------------------------------------------- -- cgit From cc27b5e0d42b9773d2657a7f405f09007e64b134 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 29 Apr 2010 15:29:46 +0200 Subject: fs33a: #i111238# [s|g]etUserData -> [s|g]etItemData --- offapi/com/sun/star/awt/XItemList.idl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/offapi/com/sun/star/awt/XItemList.idl b/offapi/com/sun/star/awt/XItemList.idl index 3d618d760322..6419ea94d0b0 100644 --- a/offapi/com/sun/star/awt/XItemList.idl +++ b/offapi/com/sun/star/awt/XItemList.idl @@ -189,14 +189,17 @@ interface XItemList the position of the item whose data value should be set. Must be greater or equal to 0, and lesser than ItemCount. + @param ItemData + the data to associate with the list item + @throws ::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid. - @see getUserData + @see getItemData */ - void setUserData( + void setItemData( [in] long Position, - [in] any DataValue + [in] any ItemData ) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); @@ -244,7 +247,7 @@ interface XItemList raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); /** retrieves the implementation dependend value associated with the given list item. - @see setUserData + @see setItemData @param Position the position of the item whose data value should be retrieved. Must be greater or equal to 0, and @@ -253,9 +256,9 @@ interface XItemList @throws ::com::sun::star::lang::IndexOutOfBoundsException if Position is invalid. - @see getUserData + @see setItemData */ - any getUserData( + any getItemData( [in] long Position ) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); -- cgit From 3bb8f0226dca5c1e565feaed3aeff7c1ee1a6042 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 2 May 2010 13:19:38 +0200 Subject: fs33a: compile errors on unxlngi6.pro / unxmacxi.pro --- toolkit/source/awt/vclxwindows.cxx | 2 +- toolkit/source/controls/unocontrols.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index ff4dc6fb5ec4..43e0e50c315d 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2155,7 +2155,7 @@ void SAL_CALL VCLXListBox::listItemModified( const ItemListEvent& i_rEvent ) thr // VCL's ListBox does not support changing an entry's text or image, so remove and re-insert - const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : pListBox->GetEntry( i_rEvent.ItemPosition ); + const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString( pListBox->GetEntry( i_rEvent.ItemPosition ) ); const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) ); pListBox->RemoveEntry( i_rEvent.ItemPosition ); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 8b37978c58e6..3b037e3ca0d3 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1881,9 +1881,9 @@ struct StripItemData : public ::std::unary_function< ListItem, UnoListItem > struct UnoControlListBoxModel_Data { UnoControlListBoxModel_Data( UnoControlListBoxModel& i_rAntiImpl ) - :m_rAntiImpl( i_rAntiImpl ) + :m_bSettingLegacyProperty( false ) + ,m_rAntiImpl( i_rAntiImpl ) ,m_aListItems() - ,m_bSettingLegacyProperty( false ) { } -- cgit From 00647682535858694ab42cc90e0db6142053df3b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Jun 2010 09:53:37 +0200 Subject: fs33a: fixed supportsService --- toolkit/source/controls/unocontrol.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 1abe0b34004f..4db6dbb17b81 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1463,7 +1463,7 @@ sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName ) thro Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames(); const ::rtl::OUString* pArray = aSNL.getConstArray(); - const ::rtl::OUString* pArrayEnd = aSNL.getConstArray(); + const ::rtl::OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength(); for (; pArray != pArrayEnd; ++pArray ) if( *pArray == rServiceName ) break; -- cgit From ad1eb0b34015402650dce8b3d25987519c50c39a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Jun 2010 14:29:22 +0200 Subject: fs33a: oops, forgot this addition to the documentation of the UnoControlListBoxModel in CWS unoawt --- offapi/com/sun/star/awt/UnoControlListBoxModel.idl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl index 1cd36de93231..1ecf338bf095 100644 --- a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl +++ b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl @@ -213,8 +213,19 @@ published service UnoControlListBoxModel /** allows mmanipulating the list of items in the list box more fine-grained than the StringItemList property. + + @since OOo 3.3 */ [optional] interface XItemList; + + /** specifies where an item separator - a horizontal line - is drawn. + +

If this is not , then a horizontal line will be drawn between the item at the given position, + and the following item.

+ + @since OOo 3.3 + */ + [optional, property, maybevoid] short ItemSeparatorPos; }; //============================================================================= -- cgit From 90f2e0f4128d9fa122957a5657d16308ce7af3c0 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Jun 2010 14:30:30 +0200 Subject: fs33a: fixed VCLXFixedText::calcAdjustedSize to respect the given size --- toolkit/source/awt/vclxwindows.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 43e0e50c315d..8b8cb23e1276 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2965,16 +2965,15 @@ short VCLXFixedText::getAlignment() throw(::com::sun::star::uno::RuntimeExceptio return getMinimumSize(); } -::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException) +::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rMaxSize ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); - ::com::sun::star::awt::Size aSz = rNewSize; - ::com::sun::star::awt::Size aMinSz = getMinimumSize(); - if ( aSz.Height != aMinSz.Height ) - aSz.Height = aMinSz.Height; - - return aSz; + Size aAdjustedSize( VCLUnoHelper::ConvertToVCLSize( rMaxSize ) ); + FixedText* pFixedText = (FixedText*)GetWindow(); + if ( pFixedText ) + aAdjustedSize = pFixedText->CalcMinimumSize( rMaxSize.Width ); + return VCLUnoHelper::ConvertToAWTSize( aAdjustedSize ); } // ---------------------------------------------------- -- cgit From 35f1ab35bf27e4122e6875ef53c6256ce4126f21 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 23 Jun 2010 13:31:43 +0200 Subject: fs33a: #i112617# fixed typo (thanks sophie) --- dbaccess/source/ext/macromigration/macromigration.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src index 9742dcdfec71..cfe27f5783d8 100644 --- a/dbaccess/source/ext/macromigration/macromigration.src +++ b/dbaccess/source/ext/macromigration/macromigration.src @@ -445,7 +445,7 @@ String STR_INVALID_NUMBER_ARGS }; String STR_NO_DATABASE { - Text [ en-US ] = "No database document found in the initializatin arguments."; + Text [ en-US ] = "No database document found in the initialization arguments."; }; String STR_NOT_READONLY { -- cgit From b2d41aee0de65be4cc2e906316f6fb590a6921a1 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 1 Jul 2010 11:46:35 +0200 Subject: unoawt2: add missing GetEntryImage, same as listbox --- vcl/inc/vcl/combobox.hxx | 1 + vcl/source/control/combobox.cxx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx index e35474a84d53..640c70e7116f 100644 --- a/vcl/inc/vcl/combobox.hxx +++ b/vcl/inc/vcl/combobox.hxx @@ -138,6 +138,7 @@ public: USHORT GetEntryPos( const XubString& rStr ) const; USHORT GetEntryPos( const void* pData ) const; + Image GetEntryImage( USHORT nPos ) const; XubString GetEntry( USHORT nPos ) const; USHORT GetEntryCount() const; diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index f5c04b7c3cfa..ebdfeae0f1d9 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1011,6 +1011,14 @@ void ComboBox::Clear() mpImplLB->Clear(); CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(-1) ); } +// ----------------------------------------------------------------------- + +Image ComboBox::GetEntryImage( USHORT nPos ) const +{ + if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) ) + return mpImplLB->GetEntryList()->GetEntryImage( nPos ); + return Image(); +} // ----------------------------------------------------------------------- -- cgit From 297f3ea4c0b7772cd6b0e4720ea4ee751a932605 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 1 Jul 2010 11:50:54 +0200 Subject: unoawt2: add XItemList to combobox as well, the sma eas for listbox --- toolkit/inc/toolkit/awt/vclxwindows.hxx | 24 +-- toolkit/inc/toolkit/controls/unocontrols.hxx | 41 +++++- toolkit/source/awt/vclxwindows.cxx | 128 +++++++++++++--- toolkit/source/controls/unocontrols.cxx | 209 +++++++++++++++++++++++---- 4 files changed, 331 insertions(+), 71 deletions(-) diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx index 80e3a37279d3..fb110cb74391 100644 --- a/toolkit/inc/toolkit/awt/vclxwindows.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx @@ -747,8 +747,10 @@ public: // ---------------------------------------------------- // class VCLXComboBox // ---------------------------------------------------- -class VCLXComboBox : public ::com::sun::star::awt::XComboBox, - public VCLXEdit +typedef ::cppu::ImplInheritanceHelper2 < VCLXEdit + , ::com::sun::star::awt::XComboBox + , ::com::sun::star::awt::XItemListListener > VCLXComboBox_Base; +class VCLXComboBox : public VCLXComboBox_Base { private: ActionListenerMultiplexer maActionListeners; @@ -763,15 +765,6 @@ public: VCLXComboBox(); ~VCLXComboBox(); - // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::release(); } - - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::lang::XComponent void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); @@ -802,6 +795,15 @@ public: void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException); + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } }; diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 6223e47a6871..1bcbfec7a556 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -727,6 +727,8 @@ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel > UnoControlListBoxModel_Base; class TOOLKIT_DLLPUBLIC UnoControlListBoxModel :public UnoControlListBoxModel_Base { +protected: + UnoControlListBoxModel(bool asComboBox); public: UnoControlListBoxModel(); UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); @@ -806,7 +808,7 @@ private: void impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const; void impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ); -private: +protected: ::boost::scoped_ptr< UnoControlListBoxModel_Data > m_pData; ::cppu::OInterfaceContainerHelper m_aItemListListeners; }; @@ -895,7 +897,7 @@ private: // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- -class UnoControlComboBoxModel : public UnoControlModel +class UnoControlComboBoxModel : public UnoControlListBoxModel { protected: ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; @@ -903,7 +905,7 @@ protected: public: UnoControlComboBoxModel(); - UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlModel( rModel ) {;} + UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;} UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); } @@ -912,6 +914,8 @@ public: // ::com::sun::star::beans::XMultiPropertySet ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + // OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) @@ -921,8 +925,10 @@ public: // ---------------------------------------------------- // class UnoComboBoxControl // ---------------------------------------------------- -class UnoComboBoxControl : public UnoEditControl, - public ::com::sun::star::awt::XComboBox +class UnoComboBoxControl : public UnoEditControl + , public ::com::sun::star::awt::XComboBox + , public ::com::sun::star::awt::XItemListener + , public ::com::sun::star::awt::XItemListListener { private: ActionListenerMultiplexer maActionListeners; @@ -933,12 +939,15 @@ public: UnoComboBoxControl(); ::rtl::OUString GetComponentServiceName(); + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoEditControl::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); } ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } void SAL_CALL release() throw() { OWeakAggObject::release(); } - void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + // ::com::sun::star::lang::XTypeProvider ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); @@ -958,8 +967,26 @@ public: sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + // XUnoControl + virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XItemListener + virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) +protected: + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + virtual void updateFromModel(); + ActionListenerMultiplexer& getActionListeners(); + ItemListenerMultiplexer& getItemListeners(); }; diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 4a68b4c80e3f..8b00cd450ab6 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -3896,20 +3896,6 @@ VCLXComboBox::~VCLXComboBox() #endif } -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXComboBox::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XComboBox*, this ) ); - return (aRet.hasValue() ? aRet : VCLXEdit::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXComboBox ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XComboBox>* ) NULL ), - VCLXEdit::getTypes() -IMPL_XTYPEPROVIDER_END - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXComboBox::CreateAccessibleContext() { ::vos::OGuard aGuard( GetMutex() ); @@ -3973,8 +3959,12 @@ void VCLXComboBox::addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUStr for ( sal_uInt16 n = 0; n < aItems.getLength(); n++ ) { pBox->InsertEntry( aItems.getConstArray()[n], nP ); - if ( (sal_uInt16)nPos < 0xFFFF ) // Nicht wenn 0xFFFF, weil LIST_APPEND - nP++; + if ( nP == 0xFFFF ) + { + OSL_ENSURE( false, "VCLXComboBox::addItems: too many entries!" ); + // skip remaining entries, list cannot hold them, anyway + break; + } } } } @@ -4078,14 +4068,8 @@ void VCLXComboBox::setProperty( const ::rtl::OUString& PropertyName, const ::com ::com::sun::star::uno::Sequence< ::rtl::OUString> aItems; if ( Value >>= aItems ) { - sal_Bool bUpdate = pComboBox->IsUpdateMode(); - pComboBox->SetUpdateMode( sal_False ); pComboBox->Clear(); - const ::rtl::OUString* pStrings = aItems.getConstArray(); - sal_Int32 nItems = aItems.getLength(); - for ( sal_Int32 n = 0; n < nItems; n++ ) - pComboBox->InsertEntry( pStrings[n], LISTBOX_APPEND ); - pComboBox->SetUpdateMode( bUpdate ); + addItems( aItems, 0 ); } } break; @@ -4255,6 +4239,104 @@ void VCLXComboBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) thr nLines = nL; } } +void SAL_CALL VCLXComboBox::listItemInserted( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemInserted: no ComboBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition <= sal_Int32( pComboBox->GetEntryCount() ) ), + "VCLXComboBox::listItemInserted: illegal (inconsistent) item position!" ); + pComboBox->InsertEntry( + i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString(), + i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(), + i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXComboBox::listItemRemoved( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemRemoved: no ComboBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pComboBox->GetEntryCount() ) ), + "VCLXComboBox::listItemRemoved: illegal (inconsistent) item position!" ); + + pComboBox->RemoveEntry( i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXComboBox::listItemModified( const ItemListEvent& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" ); + ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pComboBox->GetEntryCount() ) ), + "VCLXComboBox::listItemModified: illegal (inconsistent) item position!" ); + + // VCL's ComboBox does not support changing an entry's text or image, so remove and re-insert + + const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString( pComboBox->GetEntry( i_rEvent.ItemPosition ) ); + const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pComboBox->GetEntryImage( i_rEvent.ItemPosition ) ); + + pComboBox->RemoveEntry( i_rEvent.ItemPosition ); + pComboBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition ); +} + +void SAL_CALL VCLXComboBox::allItemsRemoved( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" ); + + pComboBox->Clear(); + + (void)i_rEvent; +} + +void SAL_CALL VCLXComboBox::itemListChanged( const EventObject& i_rEvent ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" ); + + pComboBox->Clear(); + + uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW ); + // bool localize = xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ); + uno::Reference< resource::XStringResourceResolver > xStringResourceResolver; + if ( xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ) ) + { + xStringResourceResolver.set( + xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ), + uno::UNO_QUERY + ); + } + + + Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW ); + uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems(); + for ( sal_Int32 i=0; iresolveString(aLocalizationKey.copy( 1 )); + } + pComboBox->InsertEntry( aLocalizationKey, lcl_getImageFromURL( aItems[i].Second ) ); + } +} +void SAL_CALL VCLXComboBox::disposing( const EventObject& i_rEvent ) throw (RuntimeException) +{ + // just disambiguate + VCLXEdit::disposing( i_rEvent ); +} // ---------------------------------------------------- // class VCLXFormattedSpinField diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 6599b039600f..b6f654a02145 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -1826,6 +1826,13 @@ UnoControlListBoxModel::UnoControlListBoxModel() { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox ); } +// --------------------------------------------------------------------------------------------------------------------- +UnoControlListBoxModel::UnoControlListBoxModel(bool) + :UnoControlListBoxModel_Base() + ,m_pData( new UnoControlListBoxModel_Data( *this ) ) + ,m_aItemListListeners( GetMutex() ) +{ +} // --------------------------------------------------------------------------------------------------------------------- UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ) @@ -1842,7 +1849,6 @@ UnoControlListBoxModel::~UnoControlListBoxModel() { return ::rtl::OUString::createFromAscii( szServiceName_UnoControlListBoxModel ); } - // --------------------------------------------------------------------------------------------------------------------- uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const { @@ -2687,28 +2693,16 @@ ItemListenerMultiplexer& UnoListBoxControl::getItemListeners() // ---------------------------------------------------- // class UnoControlComboBoxModel // ---------------------------------------------------- -UnoControlComboBoxModel::UnoControlComboBoxModel() +UnoControlComboBoxModel::UnoControlComboBoxModel() : UnoControlListBoxModel(true) { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox ); } - -::rtl::OUString UnoControlComboBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) -{ - return ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBoxModel ); -} - -uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const +uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) { - if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) - { - uno::Any aAny; - aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBox ); - return aAny; - } - return UnoControlModel::ImplGetDefaultValue( nPropId ); + static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; } - - +// --------------------------------------------------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper& UnoControlComboBoxModel::getInfoHelper() { static UnoPropertyArrayHelper* pHelper = NULL; @@ -2720,14 +2714,53 @@ uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) cons return *pHelper; } -// beans::XMultiPropertySet -uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) + +::rtl::OUString UnoControlComboBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); - return xInfo; + return ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBoxModel ); } +void SAL_CALL UnoControlComboBoxModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue ) throw (uno::Exception) +{ + UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue ); + if ( nHandle == BASEPROPERTY_STRINGITEMLIST && !m_pData->m_bSettingLegacyProperty) + { + // synchronize the legacy StringItemList property with our list items + Sequence< ::rtl::OUString > aStringItemList; + Any aPropValue; + getFastPropertyValue( aPropValue, BASEPROPERTY_STRINGITEMLIST ); + OSL_VERIFY( aPropValue >>= aStringItemList ); + + ::std::vector< ListItem > aItems( aStringItemList.getLength() ); + ::std::transform( + aStringItemList.getConstArray(), + aStringItemList.getConstArray() + aStringItemList.getLength(), + aItems.begin(), + CreateListItem() + ); + m_pData->setAllItems( aItems ); + + // since an XItemListListener does not have a "all items modified" or some such method, + // we simulate this by notifying removal of all items, followed by insertion of all new + // items + lang::EventObject aEvent; + aEvent.Source = *this; + m_aItemListListeners.notifyEach( &XItemListListener::itemListChanged, aEvent ); + // TODO: OPropertySetHelper calls into this method with the mutex locked ... + // which is wrong for the above notifications ... + } +} +uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const +{ + if ( nPropId == BASEPROPERTY_DEFAULTCONTROL ) + { + uno::Any aAny; + aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBox ); + return aAny; + } + return UnoControlModel::ImplGetDefaultValue( nPropId ); +} // ---------------------------------------------------- // class UnoComboBoxControl @@ -2745,29 +2778,58 @@ UnoComboBoxControl::UnoComboBoxControl() return ::rtl::OUString::createFromAscii( "combobox" ); } -// uno::XInterface +void UnoComboBoxControl::dispose() throw(uno::RuntimeException) +{ + lang::EventObject aEvt; + aEvt.Source = (::cppu::OWeakObject*)this; + maActionListeners.disposeAndClear( aEvt ); + maItemListeners.disposeAndClear( aEvt ); + UnoControl::dispose(); +} uno::Any UnoComboBoxControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) { uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XComboBox*, this ) ); + if ( !aRet.hasValue() ) + { + aRet = ::cppu::queryInterface( rType, + SAL_STATIC_CAST( awt::XItemListener*, this ) ); + if ( !aRet.hasValue() ) + { + aRet = ::cppu::queryInterface( rType, + SAL_STATIC_CAST( awt::XItemListListener*, this ) ); + } + } return (aRet.hasValue() ? aRet : UnoEditControl::queryAggregation( rType )); } - // lang::XTypeProvider IMPL_XTYPEPROVIDER_START( UnoComboBoxControl ) getCppuType( ( uno::Reference< awt::XComboBox>* ) NULL ), + getCppuType( ( uno::Reference< awt::XItemListener>* ) NULL ), + getCppuType( ( uno::Reference< awt::XItemListListener>* ) NULL ), UnoEditControl::getTypes() IMPL_XTYPEPROVIDER_END -void UnoComboBoxControl::dispose() throw(uno::RuntimeException) +void UnoComboBoxControl::updateFromModel() { - lang::EventObject aEvt; - aEvt.Source = (::cppu::OWeakObject*)this; - maActionListeners.disposeAndClear( aEvt ); - maItemListeners.disposeAndClear( aEvt ); - UnoControl::dispose(); + UnoEditControl::updateFromModel(); + + Reference< XItemListListener > xItemListListener( getPeer(), UNO_QUERY ); + ENSURE_OR_RETURN_VOID( xItemListListener.is(), "UnoComboBoxControl::updateFromModel: a peer which is no ItemListListener?!" ); + + EventObject aEvent( getModel() ); + xItemListListener->itemListChanged( aEvent ); } +void UnoComboBoxControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal ) +{ + if ( rPropName == GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) ) + // do not forward this to our peer. We are a XItemListListener at our model, and changes in the string item + // list (which is a legacy property) will, later, arrive as changes in the ItemList. Those latter changes + // will be forwarded to the peer, which will update itself accordingly. + return; + UnoEditControl::ImplSetPeerProperty( rPropName, rVal ); +} void UnoComboBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException) { UnoEditControl::createPeer( rxToolkit, rParentPeer ); @@ -2818,6 +2880,93 @@ void UnoComboBoxControl::removeItemListener(const uno::Reference < awt::XItemLis } maItemListeners.removeInterface( l ); } +void UnoComboBoxControl::itemStateChanged( const awt::ItemEvent& rEvent ) throw(uno::RuntimeException) +{ + if ( maItemListeners.getLength() ) + { + try + { + maItemListeners.itemStateChanged( rEvent ); + } + catch( const Exception& e ) + { +#if OSL_DEBUG_LEVEL == 0 + (void) e; // suppress warning +#else + ::rtl::OString sMessage( "UnoComboBoxControl::itemStateChanged: caught an exception:\n" ); + sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US ); + OSL_ENSURE( sal_False, sMessage.getStr() ); +#endif + } + } +} +sal_Bool SAL_CALL UnoComboBoxControl::setModel( const uno::Reference< awt::XControlModel >& i_rModel ) throw ( uno::RuntimeException ) +{ + ::osl::MutexGuard aGuard( GetMutex() ); + + const Reference< XItemList > xOldItems( getModel(), UNO_QUERY ); + OSL_ENSURE( xOldItems.is() || !getModel().is(), "UnoComboBoxControl::setModel: illegal old model!" ); + const Reference< XItemList > xNewItems( i_rModel, UNO_QUERY ); + OSL_ENSURE( xNewItems.is() || !i_rModel.is(), "UnoComboBoxControl::setModel: illegal new model!" ); + + if ( !UnoEditControl::setModel( i_rModel ) ) + return sal_False; + + if ( xOldItems.is() ) + xOldItems->removeItemListListener( this ); + if ( xNewItems.is() ) + xNewItems->addItemListListener( this ); + + return sal_True; +} + +void SAL_CALL UnoComboBoxControl::listItemInserted( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemInserted: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemInserted( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::listItemRemoved( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemRemoved( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::listItemModified( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemModified: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->listItemModified( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::allItemsRemoved( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::allItemsRemoved: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->allItemsRemoved( i_rEvent ); +} + +void SAL_CALL UnoComboBoxControl::itemListChanged( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException) +{ + const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY ); + OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::itemListChanged: invalid peer!" ); + if ( xPeerListener.is() ) + xPeerListener->itemListChanged( i_rEvent ); +} +ActionListenerMultiplexer& UnoComboBoxControl::getActionListeners() +{ + return maActionListeners; +} +ItemListenerMultiplexer& UnoComboBoxControl::getItemListeners() +{ + return maItemListeners; +} void UnoComboBoxControl::addItem( const ::rtl::OUString& aItem, sal_Int16 nPos ) throw(uno::RuntimeException) { -- cgit From f938ba01accd59845de858c77a6825d37e2bc5a2 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 1 Jul 2010 11:52:27 +0200 Subject: unoawt2: add XItemList same as for listbox model --- offapi/com/sun/star/awt/UnoControlComboBoxModel.idl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl b/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl index 83057417edbf..eedd7b78c346 100644 --- a/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl +++ b/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl @@ -39,6 +39,7 @@ #include #endif +#include //============================================================================= @@ -225,6 +226,11 @@ published service UnoControlComboBoxModel this is possible.

*/ [optional, property] short MouseWheelBehavior; + + /** allows mmanipulating the list of items in the combo box more fine-grained than the + StringItemList property. + */ + [optional] interface XItemList; }; //============================================================================= -- cgit From 88d0d8d5ccf1999ec7dc2f464b1e3a60f1b88cc5 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 1 Jul 2010 13:01:22 +0200 Subject: jl154: #i112673# ensure that client-facing PID remains the same across internal OOo restart on Mac OS X --- desktop/source/app/app.cxx | 109 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 82 insertions(+), 27 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index bba615e0ebbc..41d4406e03cd 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -28,6 +28,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_desktop.hxx" +#include +#include + #include #include #include "app.hxx" @@ -155,6 +158,11 @@ #include "langselect.hxx" +#if defined MACOSX +#include +#include +#endif + #define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII)) #define U2S(STRING) ::rtl::OUStringToOString(STRING, RTL_TEXTENCODING_UTF8) @@ -1101,28 +1109,79 @@ sal_Bool Desktop::SaveTasks() sal_False); } -#ifdef MACOSX -static void DoRestart() -{ - oslProcess process; - oslProcessError error; - OUString sExecutableFile; - - osl_getExecutableFile( &sExecutableFile.pData ); - - error = osl_executeProcess( - sExecutableFile.pData, - NULL, - 0, - 0, - NULL, - NULL, - NULL, - 0, - &process - ); -} +namespace { + +void restartOnMac(bool passArguments) { +#if defined MACOSX + OfficeIPCThread::DisableOfficeIPCThread(); + rtl::OUString execUrl; + OSL_VERIFY(osl_getExecutableFile(&execUrl.pData) == osl_Process_E_None); + rtl::OUString execPath; + rtl::OString execPath8; + if ((osl::FileBase::getSystemPathFromFileURL(execUrl, execPath) + != osl::FileBase::E_None) || + !execPath.convertToString( + &execPath8, osl_getThreadTextEncoding(), + (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) + { + std::abort(); + } + std::vector< rtl::OString > args; + args.push_back(execPath8); + bool wait = false; + if (passArguments) { + sal_uInt32 n = osl_getCommandArgCount(); + for (sal_uInt32 i = 0; i < n; ++i) { + rtl::OUString arg; + OSL_VERIFY(osl_getCommandArg(i, &arg.pData) == osl_Process_E_None); + if (arg.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("-accept="))) { + wait = true; + } + rtl::OString arg8; + if (!arg.convertToString( + &arg8, osl_getThreadTextEncoding(), + (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) + { + std::abort(); + } + args.push_back(arg8); + } + } + std::vector< char const * > argPtrs; + for (std::vector< rtl::OString >::iterator i(args.begin()); i != args.end(); + ++i) + { + argPtrs.push_back(i->getStr()); + } + argPtrs.push_back(0); + execv(execPath8.getStr(), const_cast< char ** >(&argPtrs[0])); + if (errno == ENOTSUP) { // happens when multithreaded on OS X < 10.6 + pid_t pid = fork(); + if (pid == 0) { + execv(execPath8.getStr(), const_cast< char ** >(&argPtrs[0])); + } else if (pid > 0) { + // Two simultaneously running soffice processes lead to two dock + // icons, so avoid waiting here unless it must be assumed that the + // process invoking soffice itself wants to wait for soffice to + // finish: + if (!wait) { + return; + } + int stat; + if (waitpid(pid, &stat, 0) == pid && WIFEXITED(stat)) { + _exit(WEXITSTATUS(stat)); + } + } + } + std::abort(); +#else + (void) passArguments; // avoid warnings #endif +} + +} USHORT Desktop::Exception(USHORT nError) { @@ -1193,9 +1252,7 @@ USHORT Desktop::Exception(USHORT nError) OfficeIPCThread::DisableOfficeIPCThread(); if( pSignalHandler ) DELETEZ( pSignalHandler ); -#ifdef MACOSX - DoRestart(); -#endif + restartOnMac(false); _exit( ExitHelper::E_CRASH_WITH_RESTART ); } else @@ -1693,9 +1750,7 @@ void Desktop::Main() RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::Main" ); if ( bRestartRequested ) { -#ifdef MACOSX - DoRestart(); -#endif + restartOnMac(true); // wouldn't the solution be more clean if SalMain returns the exit code to the system? _exit( ExitHelper::E_NORMAL_RESTART ); } -- cgit From 1b191d8cb9c0412c17d00323fcca66552372e888 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 1 Jul 2010 13:01:22 +0200 Subject: jl154: #i112673# ensure that client-facing PID remains the same across internal OOo restart on Mac OS X --- comphelper/source/misc/officerestartmanager.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx index 974b8d65e7ae..1a98ddfce8da 100644 --- a/comphelper/source/misc/officerestartmanager.cxx +++ b/comphelper/source/misc/officerestartmanager.cxx @@ -87,9 +87,9 @@ void SAL_CALL OOfficeRestartManager::requestRestart( const uno::Reference< task: // if the restart already running there is no need to trigger it again if ( m_bRestartRequested ) return; -#ifndef MACOSX + m_bRestartRequested = sal_True; -#endif + // the office is still not initialized, no need to terminate, changing the state is enough if ( !m_bOfficeInitialized ) return; -- cgit From 29996eb2ffd0239accf1ea425cd737bf4ce78ccf Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 1 Jul 2010 15:52:47 +0200 Subject: unoawt2: do not inline methods of exported classes --- toolkit/inc/toolkit/controls/unocontrols.hxx | 16 ++++++++++++---- toolkit/source/controls/unocontrols.cxx | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx index 1bcbfec7a556..01ff047ee3de 100644 --- a/toolkit/inc/toolkit/controls/unocontrols.hxx +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -750,7 +750,9 @@ public: ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) + //DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // ::com::sun::star::awt::XItemList virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException); @@ -880,7 +882,9 @@ public: virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) + // DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); protected: void ImplUpdateSelectedItemsProperty(); @@ -918,7 +922,9 @@ public: void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + // DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) }; @@ -981,7 +987,9 @@ public: virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + //DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) protected: virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); virtual void updateFromModel(); diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index b6f654a02145..d0961188d06c 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -80,6 +80,18 @@ using ::com::sun::star::graphic::XGraphic; using ::com::sun::star::uno::Reference; using namespace ::toolkit; +#define IMPL_SERVICEINFO_DERIVED( ImplName, BaseClass, ServiceName ) \ + ::rtl::OUString SAL_CALL ImplName::getImplementationName( ) throw(::com::sun::star::uno::RuntimeException) { return ::rtl::OUString::createFromAscii( "stardiv.Toolkit." #ImplName ); } \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL ImplName::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames = BaseClass::getSupportedServiceNames( ); \ + aNames.realloc( aNames.getLength() + 1 ); \ + aNames[ aNames.getLength() - 1 ] = ::rtl::OUString::createFromAscii( ServiceName ); \ + return aNames; \ + } \ + + + // ---------------------------------------------------- // class UnoControlEditModel // ---------------------------------------------------- @@ -1844,6 +1856,7 @@ UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_ UnoControlListBoxModel::~UnoControlListBoxModel() { } +IMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) // --------------------------------------------------------------------------------------------------------------------- ::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) { @@ -2276,6 +2289,7 @@ UnoListBoxControl::UnoListBoxControl() { return ::rtl::OUString::createFromAscii( "listbox" ); } +IMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) void UnoListBoxControl::dispose() throw(uno::RuntimeException) { @@ -2697,6 +2711,9 @@ UnoControlComboBoxModel::UnoControlComboBoxModel() : UnoControlListBoxModel(true { UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox ); } + +IMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) + uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo( ) throw(uno::RuntimeException) { static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); @@ -2772,6 +2789,7 @@ UnoComboBoxControl::UnoComboBoxControl() maComponentInfos.nWidth = 100; maComponentInfos.nHeight = 12; } +IMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) ::rtl::OUString UnoComboBoxControl::GetComponentServiceName() { -- cgit From d10b4bd6d31b59033804783def3a79652c90792c Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 2 Jul 2010 14:21:42 +0200 Subject: jl154 #i112883# prevent extension synchronization at OOo startup --- desktop/source/deployment/misc/dp_misc.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index fe3490903043..cfdac4068130 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -589,6 +589,11 @@ void TRACE(::rtl::OString const & sText) void syncRepositories(Reference const & xCmdEnv) { + OUString sDisable; + ::rtl::Bootstrap::get( OUSTR( "DISABLE_EXTENSION_SYNCHRONIZATION" ), sDisable, OUString() ); + if (sDisable.getLength() > 0) + return; + Reference xExtensionManager; //synchronize shared before bundled otherewise there are //more revoke and registration calls. -- cgit From 2bf85bbf3fee31633ed398b5e3aa631f28e7c62d Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 5 Jul 2010 15:46:50 +0200 Subject: jl154 #i112934# replace old license headers introduced by CWS jl152 --- desktop/source/deployment/manager/dp_properties.cxx | 2 +- desktop/source/deployment/manager/dp_properties.hxx | 5 +---- .../deployment/registry/configuration/dp_configurationbackenddb.cxx | 5 +---- .../deployment/registry/configuration/dp_configurationbackenddb.hxx | 5 +---- .../source/deployment/registry/executable/dp_executablebackenddb.cxx | 5 +---- .../source/deployment/registry/executable/dp_executablebackenddb.hxx | 5 +---- desktop/source/deployment/registry/help/dp_helpbackenddb.cxx | 5 +---- desktop/source/deployment/registry/help/dp_helpbackenddb.hxx | 5 +---- desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx | 5 +---- desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx | 5 +---- desktop/source/migration/services/cexportsoo3.cxx | 5 +---- desktop/source/migration/services/oo3extensionmigration.cxx | 5 +---- desktop/source/migration/services/oo3extensionmigration.hxx | 5 +---- 13 files changed, 13 insertions(+), 49 deletions(-) mode change 100644 => 100755 desktop/source/migration/services/oo3extensionmigration.cxx mode change 100644 => 100755 desktop/source/migration/services/oo3extensionmigration.hxx diff --git a/desktop/source/deployment/manager/dp_properties.cxx b/desktop/source/deployment/manager/dp_properties.cxx index df579944c6e4..9a181d1573e5 100644 --- a/desktop/source/deployment/manager/dp_properties.cxx +++ b/desktop/source/deployment/manager/dp_properties.cxx @@ -2,7 +2,7 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * diff --git a/desktop/source/deployment/manager/dp_properties.hxx b/desktop/source/deployment/manager/dp_properties.hxx index 97fc8b8c5394..a1b953ce8376 100644 --- a/desktop/source/deployment/manager/dp_properties.hxx +++ b/desktop/source/deployment/manager/dp_properties.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_manager.h,v $ - * $Revision: 1.17 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx index 845ba88cb813..2a02c6d8efa0 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx index 1b6c4f8973a4..7023897bd8de 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx index 976a6281a2bd..ff1044910985 100644 --- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx +++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx index 4f17eeda24a6..80cd33771a34 100644 --- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx +++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx index 3bf67e0c050b..8ec9a39d5050 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx index edf7dfdfc284..c7b730fd1b99 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx index ce0d3029084d..9a84a7286027 100644 --- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx +++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx index 9d227f8b64b8..7feaeba5568b 100644 --- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx +++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/migration/services/cexportsoo3.cxx b/desktop/source/migration/services/cexportsoo3.cxx index 20b8232044e9..695b6b810808 100755 --- a/desktop/source/migration/services/cexportsoo3.cxx +++ b/desktop/source/migration/services/cexportsoo3.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cexports.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx old mode 100644 new mode 100755 index 2e3a8d1d518c..3e9836fa2e84 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: extensionmigration.cxx,v $ - * $Revision: 1.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx old mode 100644 new mode 100755 index 03995652888c..fb58692c81ee --- a/desktop/source/migration/services/oo3extensionmigration.hxx +++ b/desktop/source/migration/services/oo3extensionmigration.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: extensionmigration.hxx,v $ - * $Revision: 1.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify -- cgit From 9a2205a1fce5b1ccae5a6a9bac7aff88caa251fe Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 5 Jul 2010 15:46:50 +0200 Subject: jl154 #i112934# replace old license headers introduced by CWS jl152 --- offapi/com/sun/star/deployment/ExtensionRemovedException.idl | 5 +---- offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl | 5 +---- offapi/com/sun/star/deployment/Prerequisites.idl | 5 +---- offapi/com/sun/star/script/XLibraryContainer3.idl | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/offapi/com/sun/star/deployment/ExtensionRemovedException.idl b/offapi/com/sun/star/deployment/ExtensionRemovedException.idl index bb3116c9f554..1cd400e248d6 100644 --- a/offapi/com/sun/star/deployment/ExtensionRemovedException.idl +++ b/offapi/com/sun/star/deployment/ExtensionRemovedException.idl @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: VersionException.idl,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl b/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl index 3a2cb5e330cc..0f0407b0e989 100644 --- a/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl +++ b/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: VersionException.idl,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/offapi/com/sun/star/deployment/Prerequisites.idl b/offapi/com/sun/star/deployment/Prerequisites.idl index 52987ad9bd77..82999ef4a41c 100644 --- a/offapi/com/sun/star/deployment/Prerequisites.idl +++ b/offapi/com/sun/star/deployment/Prerequisites.idl @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: KeyUsage.idl,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/offapi/com/sun/star/script/XLibraryContainer3.idl b/offapi/com/sun/star/script/XLibraryContainer3.idl index cb3f2a5e0f6c..1045fc7a295c 100644 --- a/offapi/com/sun/star/script/XLibraryContainer3.idl +++ b/offapi/com/sun/star/script/XLibraryContainer3.idl @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: XLibraryContainer2.idl,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify -- cgit From ed07c51161b6ac904a42a6ce14ba52283ccbde0b Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 7 Jul 2010 13:51:44 +0200 Subject: jl154: #i112449# Fix flicker on restart. Backing window won't get created if restart is required --- desktop/source/app/app.cxx | 262 ++++++++++++++++++++++----------------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 41d4406e03cd..7e78d7e43ec2 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1335,6 +1335,9 @@ void Desktop::Main() std::auto_ptr pLanguageOptions; std::auto_ptr pPathOptions; + sal_Bool bRestartRequested( sal_False ); + sal_Bool bUseSystemFileDialog(sal_True); + int nAcquireCount( 0 ); Reference < css::document::XEventListener > xGlobalBroadcaster; try { @@ -1528,58 +1531,80 @@ void Desktop::Main() impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" ); - if ( - (pCmdLineArgs->IsEmptyOrAcceptOnly() ) && - (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && - (!bExistsRecoveryData ) && - (!bExistsSessionData ) && - (!Application::AnyInput( INPUT_APPEVENT ) ) - ) + Reference< ::com::sun::star::task::XRestartManager > xRestartManager; { - RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" ); - Reference< XFrame > xDesktopFrame( xSMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); - if (xDesktopFrame.is()) + ::comphelper::ComponentContext aContext( xSMgr ); + xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); + } + + // check whether the shutdown is caused by restart + bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + + if ( pCmdLineArgs->IsHeadless() ) + { + // Ensure that we use not the system file dialogs as + // headless mode relies on Application::EnableHeadlessMode() + // which does only work for VCL dialogs!! + SvtMiscOptions aMiscOptions; + bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog(); + aMiscOptions.SetUseSystemFileDialog( sal_False ); + } + + if ( !bRestartRequested ) + { + if ( + (pCmdLineArgs->IsEmptyOrAcceptOnly() ) && + (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && + (!bExistsRecoveryData ) && + (!bExistsSessionData ) && + (!Application::AnyInput( INPUT_APPEVENT ) ) + ) { -// SetSplashScreenProgress(60); - Reference< XFrame > xBackingFrame; - Reference< ::com::sun::star::awt::XWindow > xContainerWindow; - - xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0); - if (xBackingFrame.is()) - xContainerWindow = xBackingFrame->getContainerWindow(); - if (xContainerWindow.is()) + RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" ); + Reference< XFrame > xDesktopFrame( xSMgr->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); + if (xDesktopFrame.is()) { - // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank" - // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior, - // otherwise documents loaded into this frame will later on miss functionality depending on the style. - Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); - OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" ); - pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); - - SetSplashScreenProgress(75); - Sequence< Any > lArgs(1); - lArgs[0] <<= xContainerWindow; - - Reference< XController > xBackingComp( - xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), - UNO_QUERY); -// SetSplashScreenProgress(80); - if (xBackingComp.is()) + // SetSplashScreenProgress(60); + Reference< XFrame > xBackingFrame; + Reference< ::com::sun::star::awt::XWindow > xContainerWindow; + + xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0); + if (xBackingFrame.is()) + xContainerWindow = xBackingFrame->getContainerWindow(); + if (xContainerWindow.is()) { - Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY); - // Attention: You MUST(!) call setComponent() before you call attachFrame(). - // Because the backing component set the property "IsBackingMode" of the frame - // to true inside attachFrame(). But setComponent() reset this state everytimes ... - xBackingFrame->setComponent(xBackingWin, xBackingComp); - SetSplashScreenProgress(100); - xBackingComp->attachFrame(xBackingFrame); - CloseSplashScreen(); - xContainerWindow->setVisible(sal_True); + // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank" + // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior, + // otherwise documents loaded into this frame will later on miss functionality depending on the style. + Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); + OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" ); + pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); + + SetSplashScreenProgress(75); + Sequence< Any > lArgs(1); + lArgs[0] <<= xContainerWindow; + + Reference< XController > xBackingComp( + xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), + UNO_QUERY); + // SetSplashScreenProgress(80); + if (xBackingComp.is()) + { + Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY); + // Attention: You MUST(!) call setComponent() before you call attachFrame(). + // Because the backing component set the property "IsBackingMode" of the frame + // to true inside attachFrame(). But setComponent() reset this state everytimes ... + xBackingFrame->setComponent(xBackingWin, xBackingComp); + SetSplashScreenProgress(100); + xBackingComp->attachFrame(xBackingFrame); + CloseSplashScreen(); + xContainerWindow->setVisible(sal_True); + } } } + RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create BackingComponent" ); } - RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create BackingComponent" ); } } catch ( com::sun::star::lang::WrappedTargetException& wte ) @@ -1614,107 +1639,82 @@ void Desktop::Main() aOptions.SetVCLSettings(); // SetSplashScreenProgress(60); - Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) ); - - sal_Bool bTerminateRequested = sal_False; - - // Preload function depends on an initialized sfx application! - SetSplashScreenProgress(75); - - sal_Bool bUseSystemFileDialog(sal_True); - if ( pCmdLineArgs->IsHeadless() ) + if ( !bRestartRequested ) { - // Ensure that we use not the system file dialogs as - // headless mode relies on Application::EnableHeadlessMode() - // which does only work for VCL dialogs!! - SvtMiscOptions aMiscOptions; - bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog(); - aMiscOptions.SetUseSystemFileDialog( sal_False ); - } + Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) ); - // use system window dialogs - Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG ); + sal_Bool bTerminateRequested = sal_False; -// SetSplashScreenProgress(80); + // Preload function depends on an initialized sfx application! + SetSplashScreenProgress(75); - if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() && - !pCmdLineArgs->IsNoQuickstart() ) - InitializeQuickstartMode( xSMgr ); + // use system window dialogs + Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG ); - RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" ); - try - { - Reference< XDesktop > xDesktop( xSMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); - if ( xDesktop.is() ) - xDesktop->addTerminateListener( new OfficeIPCThreadController ); - SetSplashScreenProgress(100); - } - catch ( com::sun::star::uno::Exception& e ) - { - FatalError( MakeStartupErrorMessage(e.Message) ); - return; - } - /* - catch ( ... ) - { - FatalError( MakeStartupErrorMessage( - OUString::createFromAscii( - "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged."))); - return; - } - */ + // SetSplashScreenProgress(80); - // Release solar mutex just before we wait for our client to connect - int nAcquireCount = 0; - ::vos::IMutex& rMutex = Application::GetSolarMutex(); - if ( rMutex.tryToAcquire() ) - nAcquireCount = Application::ReleaseSolarMutex() - 1; + if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() && + !pCmdLineArgs->IsNoQuickstart() ) + InitializeQuickstartMode( xSMgr ); - // Post user event to startup first application component window - // We have to send this OpenClients message short before execute() to - // minimize the risk that this message overtakes type detection contruction!! - Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) ); + RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" ); + try + { + Reference< XDesktop > xDesktop( xSMgr->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); + if ( xDesktop.is() ) + xDesktop->addTerminateListener( new OfficeIPCThreadController ); + SetSplashScreenProgress(100); + } + catch ( com::sun::star::uno::Exception& e ) + { + FatalError( MakeStartupErrorMessage(e.Message) ); + return; + } + /* + catch ( ... ) + { + FatalError( MakeStartupErrorMessage( + OUString::createFromAscii( + "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged."))); + return; + } + */ - // Post event to enable acceptors - Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) ); + // Post user event to startup first application component window + // We have to send this OpenClients message short before execute() to + // minimize the risk that this message overtakes type detection contruction!! + Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) ); - // The configuration error handler currently is only for startup - aConfigErrHandler.deactivate(); + // Post event to enable acceptors + Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) ); - // Acquire solar mutex just before we enter our message loop - if ( nAcquireCount ) - Application::AcquireSolarMutex( nAcquireCount ); + // The configuration error handler currently is only for startup + aConfigErrHandler.deactivate(); - // call Application::Execute to process messages in vcl message loop - RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" ); + // call Application::Execute to process messages in vcl message loop + RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" ); - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; - try - { - // The JavaContext contains an interaction handler which is used when - // the creation of a Java Virtual Machine fails - com::sun::star::uno::ContextLayer layer2( - new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); + try + { + // The JavaContext contains an interaction handler which is used when + // the creation of a Java Virtual Machine fails + com::sun::star::uno::ContextLayer layer2( + new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); - ::comphelper::ComponentContext aContext( xSMgr ); - xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); - if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) ) Execute(); + } + catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg) + { + OfficeIPCThread::SetDowning(); + FatalError( MakeStartupErrorMessage(exFilterCfg.Message) ); + } + catch(const com::sun::star::configuration::CorruptedConfigurationException& exAnyCfg) + { + OfficeIPCThread::SetDowning(); + FatalError( MakeStartupErrorMessage(exAnyCfg.Message) ); + } } - catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg) - { - OfficeIPCThread::SetDowning(); - FatalError( MakeStartupErrorMessage(exFilterCfg.Message) ); - } - catch(const com::sun::star::configuration::CorruptedConfigurationException& exAnyCfg) - { - OfficeIPCThread::SetDowning(); - FatalError( MakeStartupErrorMessage(exAnyCfg.Message) ); - } - - // check whether the shutdown is caused by restart - sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); if (xGlobalBroadcaster.is()) { -- cgit From 068a5d9293e092cbe73d8a707e4f45a623d99ccc Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:29:56 +0200 Subject: txtl10n: #i113008# add support for xtx files --- l10ntools/source/localize.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 6cecb0972cb7..8e2fbee2bc85 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -56,7 +56,7 @@ const char *ExeTable[][5] = { //{ "src", "transex3", "-UTF8 -e", "negative", "noiso" }, //{ "hrc", "transex3", "-UTF8 -e", "positive", "noiso" }, - //{ "lng", "lngex", "-UTF8 -e", "negative", "noiso" }, + { "xtx", "xtxex", "", "negative", "noiso" }, { "ulf", "ulfex", " -e", "negative", "noiso" }, { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, { "xxl", "xmlex", "-UTF8 -e", "negative", "iso" }, @@ -326,7 +326,7 @@ void SourceTreeLocalizer::WorkOnFile( } if( bQuiet2 ){ - sCommand +=" -QQ "; + //sCommand +=" -QQ "; } //printf("DBG: %s\n",sCommand.GetBuffer()); if (system(sCommand.GetBuffer()) == -1) -- cgit From bb7dd792818f8404d6e756505469d17350eebd83 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:30:32 +0200 Subject: txtl10n: remove some noisy output / code cleanup --- l10ntools/source/cfglex.l | 16 +--------------- l10ntools/source/cfgmerge.cxx | 6 ++---- l10ntools/source/export.cxx | 1 - l10ntools/source/helpmerge.cxx | 11 ----------- l10ntools/source/lngex.cxx | 10 ---------- l10ntools/source/srclex.l | 6 ------ l10ntools/source/xrmlex.l | 5 ----- l10ntools/source/xrmmerge.cxx | 2 -- 8 files changed, 3 insertions(+), 54 deletions(-) diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l index cc92632620be..d1b076d493b9 100644 --- a/l10ntools/source/cfglex.l +++ b/l10ntools/source/cfglex.l @@ -169,10 +169,6 @@ main( int argc, char* argv[]) FILE *pFile; pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nCfgEx 0.9 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "===================================================================================\n" ); - } if ( !pOutput ) { fprintf( stdout, "Syntax: CFGEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-f][-d DoneFile][-g[:dtd] ][-L l1,l2,...]\n" ); @@ -213,20 +209,10 @@ main( int argc, char* argv[]) nRetValue = GetError(); EndCfgExport(); - if( !isQuiet() ){ - fprintf( stdout, "\n===================================\n\n" ); - } removeTempFile(); /* return error level */ return nRetValue; } -/*""]*"-->" { - bText = 0; - WorkOnTokenSet( COMMEND, yytext ); -}*/ -/*" { - bText = 0; - WorkOnTokenSet( CFG_TAG, yytext ); -}*/ + diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 170c2922d9ce..3e421d2d1046 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -247,7 +247,7 @@ extern FILE *GetCfgFile() if ( !pFile ){ fprintf( stderr, "Error: Could not open file %s\n", sInputFileName.GetBuffer()); - exit( 13 ); + exit( -13 ); } else { // this is a valid file which can be opened, so @@ -264,8 +264,6 @@ extern FILE *GetCfgFile() // printf("sFullEntry = %s\n",sFullEntry.GetBuffer()); sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); // printf("sActFileName = %s\n",sActFileName.GetBuffer()); - if( !bQuiet ) - fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer()); sActFileName.SearchAndReplaceAll( "/", "\\" ); @@ -615,7 +613,7 @@ CfgOutputParser::CfgOutputParser( const ByteString &rOutputFile ) Error( sError ); delete pOutputStream; pOutputStream = NULL; - exit( 13 ); + exit( -13 ); } } diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 59f29525eda4..589c962c112c 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -282,7 +282,6 @@ extern FILE *GetNextFile() // (e.g.: source\ui\src\menue.src) sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); - if( !bQuiet ) fprintf( stdout, "\nProcessing File %s ...\n", sOrigFile.GetBuffer()); sActFileName.SearchAndReplaceAll( "/", "\\" ); sFile = sActFileName; diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 0ab7e6eb5c2e..15cb1e311002 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -181,17 +181,6 @@ bool HelpParser::CreateSDF( ByteString sActFileName = makeAbsolutePath( sHelpFile , rRoot_in ); -/* DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - String sFullEntry = aEntry.GetFull(); - aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( rRoot_in ); - ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); - ByteString sActFileName( - sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); - - sActFileName.SearchAndReplaceAll( "/", "\\" ); -*/ XMLHashMap* aXMLStrHM = file->GetStrings(); LangHashMap* pElem; XMLElement* pXMLElement = NULL; diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx index c593b85d4932..27136dc8797f 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -170,7 +170,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) void Help() /*****************************************************************************/ { - //fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-e][-b][-u][-NOUTF8][-ULF][-L l1,l2,...]\n" ); fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-L l1,l2,...]\n" ); fprintf( stdout, " Prj: Project\n" ); fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); @@ -199,15 +198,8 @@ int _cdecl main( int argc, char *argv[] ) Help(); return 1; } - if( !bQuiet ){ - fprintf( stdout, "\nUlfEx 1 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "=================================================================================\n" ); - fprintf( stdout, "\nProcessing File %s ...\n", sInputFile.GetBuffer()); - }else - { fprintf(stdout, "."); fflush( stdout ); - } if ( sOutputFile.Len()) { LngParser aParser( sInputFile, bUTF8, bULF , bQuiet ); @@ -217,7 +209,5 @@ int _cdecl main( int argc, char *argv[] ) aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot ); } - if( !bQuiet ) fprintf( stdout, "\n=================================================\n\n" ); - return 0; } diff --git a/l10ntools/source/srclex.l b/l10ntools/source/srclex.l index 473da8b5d511..eb2b6af78b34 100644 --- a/l10ntools/source/srclex.l +++ b/l10ntools/source/srclex.l @@ -259,10 +259,6 @@ main( int argc, char* argv[]) FILE *pFile; pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nTransEx 3.1 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "=====================================================================================\n" ); - } if ( !pOutput ) { fprintf( stdout, "Syntax:TRANSEX[-p Prj][-r PrjRoot]-i FileIn...[-o FileOut][-m DataBase][-e][-b][-u][-L l1,l2,...]\n" ); @@ -301,8 +297,6 @@ main( int argc, char* argv[]) nRetValue = GetError(); EndExport(); - if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" ); - /* return error level */ return nRetValue; } diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l index 4770a851c741..6229525d7e84 100644 --- a/l10ntools/source/xrmlex.l +++ b/l10ntools/source/xrmlex.l @@ -180,10 +180,6 @@ main( int argc, char* argv[]) FILE *pFile; pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nXrmEx 0.9 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" ); - fprintf( stdout, "===================================================================================\n" ); - } if ( !pOutput ) { fprintf( stdout, "Syntax: XRMEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-NOUTF8][-L l1,l2,...]\n" ); @@ -222,7 +218,6 @@ main( int argc, char* argv[]) nRetValue = GetError(); EndXrmExport(); - if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" ); removeTempFile(); /* return error level */ return nRetValue; diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index b77f75ea04e5..dc3d2fe6a283 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -252,8 +252,6 @@ extern FILE *GetXrmFile() // (e.g.: source\ui\src\menue.src) sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); - if( !bQuiet ) - fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer()); sActFileName.SearchAndReplaceAll( "/", "\\" ); -- cgit From fb9f27fc9881ad5670bfe4d9f96438bf2322b24d Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:35:17 +0200 Subject: l10ntxt: #i113008# add support for xtx files (single text files) --- l10ntools/scripts/const.py | 39 +++++++ l10ntools/scripts/l10ntool.py | 188 +++++++++++++++++++++++++++++++++ l10ntools/scripts/sdf.py | 240 ++++++++++++++++++++++++++++++++++++++++++ l10ntools/scripts/xtxex | 47 +++++++++ l10ntools/scripts/xtxex.py | 92 ++++++++++++++++ 5 files changed, 606 insertions(+) create mode 100644 l10ntools/scripts/const.py create mode 100644 l10ntools/scripts/l10ntool.py create mode 100644 l10ntools/scripts/sdf.py create mode 100755 l10ntools/scripts/xtxex create mode 100644 l10ntools/scripts/xtxex.py diff --git a/l10ntools/scripts/const.py b/l10ntools/scripts/const.py new file mode 100644 index 000000000000..2d514eabdab6 --- /dev/null +++ b/l10ntools/scripts/const.py @@ -0,0 +1,39 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# Pseudo const +class _const: + class ConstError(TypeError): pass + def __setattr__(self, name, value): + if self.__dict__.has_key(name): + raise self.ConstError, "Can't rebind const(%s)"%name + self.__dict__[name] = value + +import sys +sys.modules[__name__] = _const() + + diff --git a/l10ntools/scripts/l10ntool.py b/l10ntools/scripts/l10ntool.py new file mode 100644 index 000000000000..caa15b7efd17 --- /dev/null +++ b/l10ntools/scripts/l10ntool.py @@ -0,0 +1,188 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from optparse import OptionParser +from sdf import SdfData +import string , sys , os + +class abstractL10nTool: + _options = {} + _args = "" + _resource_type = "" + _source_language = "en-US" + + ##### Implement these abstract methods + + ##### Nameing scheme for the output files + def get_outputfile_format_str(self): + # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path + return "{path}/{fileNoExt}_{language}.{extension}" + + ################################# Merge single files ########################################### + + ##### Merge a single file + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + pass + + ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here + def parse_file(self, filename): + return None + + ################### Merge one big file containing all strings in all languages ################# + def merge_one_big_file(self, inputfile, outputfilename, parsed_file_ref, lang, sdfdata): + pass + + ################### Extract a single File ###################################################### + def extract_file(self, inputfile): + pass + + ################################################################################################ + + def format_outputfile(self, filename, language): + extension = filename[filename.rfind('.')+1:] + file = filename[:filename.rfind('.')] + return self.get_outputfile_format_str().format( + filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, + path_postfix=self._options.path_postfix, path=self.get_path()) + + def get_path(self): + if self._options.outputfile.find('/') == -1: + return "" + else: + return self._options.outputfile[:self._options.outputfile.rfind('/')] + + def merge(self, sdfdata): + langset,forcedset, foundset = set(), set() , set() + + if self._options.languages: langset = set(self._options.languages) + if self._options.forcedlanguages: forcedset = set(self._options.forcedlanguages) + if sdfdata.get_languages_found_in_sdf(): foundset = sdfdata.get_languages_found_in_sdf() + + if self.has_multi_inputfiles(): + filelist = self.read_inputfile_list() + else: + filelist = self._options.inputfile + + for inputfile in filelist: + ref = self.parse_file(inputfile) + # Don't write that files if there is no l10n present + if ((langset & foundset) - forcedset): # all langs given and found in sdf without enforced + [self.merge_file(inputfile,self.format_outputfile(inputfile, lang), ref, lang, False, sdfdata) for lang in ((langset & foundset) - forcedset)] + # Always write those files even if there is no l10n available + if forcedset: # all enforced langs + [self.merge_file(inputfile, self.format_outputfile(inputfile, lang), ref, lang, True, sdfdata) for lang in forcedset] + # In case a big file have to be written + if ((langset & foundset) | forcedset): # all langs given ,found in sdf and enforced ones + self.merge_one_big_file(inputfile, self.format_outputfile(inputfile, lang), ref, ((langset & foundset) | forcedset), sdfdata) + + def has_multi_inputfiles(self): + return self._options.inputfile[0] == '@' + + def extract(self): + try: + f = open(self._options.outputfile, "w+") + f.write(self.extract_file(self._options.inputfile)) + except IOError: + print "ERROR: Can not write file " + self._options.outputfile + else: + f.close() + + # Parse the common options + def parse_options(self): + parser = OptionParser() + parser.add_option("-i", "--inputfile", dest="inputfile", metavar="FILE", help="resource file to read" ) + parser.add_option("-o", "--outputfile", dest="outputfile", metavar="FILE", help="extracted sdf or merged file" ) + parser.add_option("-m", "--inputsdffile", dest="input_sdf_file", metavar="FILE", help="merge this sdf file" ) + parser.add_option("-x", "--pathprefix", dest="path_prefix", metavar="PATH", help="" ) + parser.add_option("-y", "--pathpostfix", dest="path_postfix", metavar="PATH", help="" ) + parser.add_option("-p", "--projectname", dest="project_name", metavar="NAME", help="" ) + parser.add_option("-r", "--projectroot", dest="project_root", metavar="PATH", help="" ) + parser.add_option("-f", "--forcedlanguages", dest="forcedlanguages", metavar="ISOCODE[,ISOCODE]", help="Always merge those langs even if no l10n is available for those langs" ) + parser.add_option("-l", "--languages", dest="languages", metavar="ISOCODE[,ISOCODE]", help="Merge those langs if l10n is found for each") + parser.add_option("-q", "--quiet", action="store_true", dest="quietmode", help="",default=False) + (self._options, self.args) = parser.parse_args() + + # -l "de,pr,pt-BR" => [ "de" , "pt" , "pt-BR" ] + parse_complex_arg = lambda arg: arg.split(",") + if self._options.forcedlanguages: self._options.forcedlanguages = parse_complex_arg(self._options.forcedlanguages) + if self._options.languages: self._options.languages = parse_complex_arg(self._options.languages) + self.test_options() + + def __init__(self): + self.parse_options() + if self._options.input_sdf_file != None and len(self._options.input_sdf_file): + sdfdata = SdfData(self._options.input_sdf_file) + sdfdata.read() + self.merge(sdfdata) + else: + self.extract() + + def make_dirs(self, filename): + dir = filename[:filename.rfind('/')] + if os.path.exists(dir): + if os.path.isfile(dir): + print "ERROR: There is a file '"+dir+"' where I want create a directory" + sys.exit(-1) + else: + return + else: + try: + print "DBG: make_dir " + str(dir) + os.makedirs(dir) + except IOError: + print "Error: Can not create dir " + dir + sys.exit(-1) + + def test_options(self): + opt = self._options + is_valid = lambda x: x != None and len(x) > 0 + return is_valid(opt.project_root) and is_valid(opt.project_name) and is_valid(opt.languages) and \ + ( is_valid(opt.inputfile) and (( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or is_valid(opt.outputfile)) and \ + ( ( is_valid(opt.input_sdf_file) and ( is_valid(opt.outputfile) or ( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or \ + ( is_valid(opt.inputfile) and is_valid(opt.outputFile)) )))) + print "Strange options ..." + sys.exit( -1 ) + + + def read_inputfile_list(self): + if self.has_multi_inputfiles(): + lines = [] + try: + f = open(self._options.inputfile[1:], "r") + lines = [line.strip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Can not read file list " + self._options.inputfile[2:] + sys.exit(-1) + else: + f.close() + return lines + + def get_filename_string(self, inputfile): + absfile = os.path.realpath(os.path.abspath(inputfile)) + absroot = os.path.realpath(os.path.abspath(self._options.project_root)) + return absfile[len(absroot):].replace('/','\\') + diff --git a/l10ntools/scripts/sdf.py b/l10ntools/scripts/sdf.py new file mode 100644 index 000000000000..ce1077197622 --- /dev/null +++ b/l10ntools/scripts/sdf.py @@ -0,0 +1,240 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +import string + +class MyOrderedDict(dict): + _keylist = [] + _valuelist = [] + + #correct?!? + def __init__(self, defaults={}): + dict.__init__(self) + for n,v in defaults.items(): + self[n] = v + #def __getitem__(self): + # pass + + def __setitem__(self, key, value): + self._keylist.append(key) + self._valuelist.append(value) + return dict.__setitem__(self, key, value) + + def __delattr__(self, key): + self._keylist.__delattr__(key) + self._valuelist.__delattr__(dict[key]) + return dict.__delattr__(self, key) + + def __delitem__(self, key): + self._keylist.__delitem__(key) + self._valuelist.__delitem__(dict[key]) + return dict.__delitem__(self, key) + + def __iter(self): + return zip(self._keylist, self._valuelist) + + def __iterkeys__(self): + return self._keylist + + def __iteritems__(self): + return self._valuelist + + def items(self): + return zip(self._keylist,self._valuelist) + + def keys(self): + return self._keylist + + def __keysattr__(self): + return self._keylist + + def pop(self, key): + self._keylist.pop(key) + self._valuelist.pop(key) + return dict.__pop__(self, key) + + def popitem(self): + raise NotImplementedError("popitem") + + def clear(self): + self._keylist.clear() + self._valuelist.clear() + return dict.clear() + + def copy(self): + # correct?!? + newobj = MyOrderedDict(self) + newobj._keylist = self._keylist + newobj._valuelist = self._valuelist + return newobj + +class SdfData: + _filename = ""; + _dict = MyOrderedDict() + #_dict = {} + _languages_found = []; + + def __init__ (self, filename=""): + self._filename = filename + + def __getitem__(self, key): + if self._dict.has_key(key): + return self._dict[key] + else: + return None + + def has_key(self, key): + return self._dict.has_key(key) + + def __setitem__(self, key, value): + self._dict[key] = value + + def get_languages_found_in_sdf(self): + return set(self._languages_found) + + def read(self): + try: + f = open(self._filename, "r") + lines = [line.rstrip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Trying to read "+ self._filename + raise + else: + f.close() + for line in lines: + entity = SdfEntity() + entity.set_properties(line) + self._dict[entity.get_id()] = entity + self._languages_found.append(entity.langid) + + def write(self, filename): + try: + f = open(filename, "w+") + for value in self._dict.itervalues(): + #f.write( repr(value)+"\n" ) + f.write(value + "\n") + except IOError: + print "ERROR: Trying to write " + filename + raise + else: + f.close() + + + +import sys +class SdfEntity: + # Sdf format columns + project = "" + source_file = "" + dummy1 = "" + resource_type = "" + gid = "" + lid = "" + helpid = "" + platform = "" + dummy2 = "" + langid = "" + text = "" + helptext = "" + quickhelptext = "" + title = "" + date = "" + + import const + const._PROJECT_POS = 0 + const._SOURCE_FILE_POS = 1 + const._DUMMY1_POS = 2 + const._RESOURCE_TYPE_POS = 3 + const._GID_POS = 4 + const._LID_POS = 5 + const._HELPID_POS = 6 + const._PLATFORM_POS = 7 + const._DUMMY2_POS = 8 + const._LANGID_POS = 9 + const._TEXT_POS = 10 + const._HELPTEXT_POS = 11 + const._QUICKHELPTEXT_POS = 12 + const._TITLE_POS = 13 + const._DATE_POS = 14 + + + + def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", + text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): + self.project = project; + self.source_file = source_file; + self.dummy1 = dummy1; + self.resource_type = resource_type; + self.gid = gid; + self.lid = lid; + self.helpid = helpid; + self.platform = platform; + self.dummy2 = dummy2; + self.langid = langid; + self.text = text; + self.helptext = helptext; + self.quickhelptext = quickhelptext; + self.title = title; + self.date = date; + + def set_properties(self, line): + splitted = line.split("\t") + if len(splitted) == 15: + self.project = splitted[ self.const._PROJECT_POS ] + self.source_file = splitted[ self.const._SOURCE_FILE_POS ] + self.dummy1 = splitted[ self.const._DUMMY1_POS ] + self.resource_type = splitted[ self.const._RESOURCE_TYPE_POS ] + self.gid = splitted[ self.const._GID_POS ] + self.lid = splitted[ self.const._LID_POS ] + self.helpid = splitted[ self.const._HELPID_POS ] + self.platform = splitted[ self.const._PLATFORM_POS ] + self.dummy2 = splitted[ self.const._DUMMY2_POS ] + self.langid = splitted[ self.const._LANGID_POS ] + self.text = splitted[ self.const._TEXT_POS ] + self.helptext = splitted[ self.const._HELPTEXT_POS ] + self.quickhelptext = splitted[ self.const._QUICKHELPTEXT_POS ] + self.title = splitted[ self.const._TITLE_POS ] + self.date = splitted[ self.const._DATE_POS ] + #else: + # print "Offending line '"+line+"'" + # print "ERROR: Something is broken here! Line has {0} tabs".format( len(splitted) ) + # sys.exit( -1 ) + + def get_file_id(self): + return self.project + "\\" + self.source_file + + def get_resource_path(self): + return self.source_file[0:self.source_file.rfind( "\\" )-1] + + #def __repr__(self): + def __str__(self): + return ''.join([self.project, "\t", self.source_file, "\t", self.dummy1, "\t", self.resource_type, "\t" , + self.gid, "\t", self.lid, "\t", self.helpid, "\t", self.platform, "\t", self.dummy2, "\t" , self.langid, + "\t", self.text, "\t", self.helptext, "\t", self.quickhelptext, "\t" , self.title, "\t", self.date ]) + + def get_id(self): + return ''.join([self.project, self.gid, self.lid, self.source_file, self.resource_type, self.platform, self.helpid, self.langid]) diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex new file mode 100755 index 000000000000..cc9dac01fca2 --- /dev/null +++ b/l10ntools/scripts/xtxex @@ -0,0 +1,47 @@ +#!/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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +if [ x${SOLARENV}x = xx ]; then + echo No environment found, please use 'setsolar' +exit 1 +fi + +# localize.pl calls localize_sl in solver bin directory which depends on dynamic +# libraries in solver lib directory but has no correct RPATH (or equivalent): +if [ "${OS?}" = MACOSX ]; then + export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +else + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +fi + +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" +fi + diff --git a/l10ntools/scripts/xtxex.py b/l10ntools/scripts/xtxex.py new file mode 100644 index 000000000000..98ec1e86b596 --- /dev/null +++ b/l10ntools/scripts/xtxex.py @@ -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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from l10ntool import abstractL10nTool +from sdf import SdfEntity +import sys +import shutil + +class xtxex(abstractL10nTool): + _resourceType = "xtx" + + def __init__(self): + abstractL10nTool.__init__(self) + + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): + print "merge_file lang " + lang +" file " + outputfilename + sdfline = self.prepare_sdf_line(inputfilename,lang) + if sdfdata.has_key(sdfline.get_id()): + line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') + self.make_dirs(outputfilename) + try: + f = open(outputfilename, "w+") + f.write(line) + except IOError: + print "ERROR: Can not write file " + outputfilename + sys.exit(-1) + else: + f.close() + return + if is_forced_lang: + try: + shutil.copy(inputfilename, outputfilename) + except IOError: + print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" + sys.exit(-1) + + ##### Extract a single File + def extract_file(self, inputfile): + lines = [] + try: + f = open(inputfile, "r") + lines = f.readlines() + except IOError: + print "ERROR: Can not open file " + inputfile + sys.exit(-1) + else: + f.close() + # remove legal header + lines = [line for line in lines if len(line) > 0 and not line[0] == '#'] + # escape all returns + lines = [line.replace('\n', "\\n") for line in lines] + line = ''.join(lines) + sdf_entity = self.prepare_sdf_line(inputfile); + sdf_entity.text = line + return str(sdf_entity) + + ##### Nameing scheme for the output files + def get_outputfile_format_str(self): + # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path + return "{path}/{fileNoExt}_{language}.{extension}" + + def prepare_sdf_line(self, inputfile="", lang=""): + if lang == "": + lang = self._source_language + return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), + resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") + +run = xtxex() -- cgit From 71d0aa83c9a1330c27b47cc836f4754a007815ae Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 7 Jul 2010 15:36:02 +0200 Subject: l10ntxt: #i113008# add support for xtx files (single text files) --- l10ntools/prj/d.lst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index 0b6a43444613..e20114a1ed0d 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -47,6 +47,11 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\localize %_DEST%\bin%_EXT%\localize ..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl ..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl +..\scripts\const.py %_DEST%\bin%_EXT%\const.py +..\scripts\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py +..\scripts\xtxex.py %_DEST%\bin%_EXT%\xtxex.py +..\scripts\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex ..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx ..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx -- cgit From aea943b27855a9f3f3795f092139947d3ee02b65 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 12 Jul 2010 10:26:26 +0200 Subject: jl154 #162868# additional private sub-command for unopkg for use in setup --- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index a9a0c8271373..9434b69653a1 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -587,6 +587,15 @@ extern "C" int unopkg_main() xDialog->startExecuteModal(xListener); dialogEnded.wait(); } + else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("sync"))) + { + //This sub command may be removed later and is only there to have a + //possibility to start extension synching without any output. + //This is just here so we do not get an error, because of an unknown + //sub-command. We do synching before + //the sub-commands are processed. + + } else { dp_misc::writeConsoleError( -- cgit From 096e86da1c50f53c798d61801ac2643962160631 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 12 Jul 2010 14:04:55 +0200 Subject: jl154 #162868# OOo Improvement dialog will now show at the second start --- .../registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs index 7b0b221f15a9..7ff91464727d 100755 --- a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs @@ -15,7 +15,7 @@ OpenOffice.org Improvement Program. If this is zero the user will get asked. - 2 + 1 -- cgit From 85ce1d366eb685c655fc5f7ec2d45fbc05aad722 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 12 Jul 2010 15:31:50 +0200 Subject: txtl10n: #i113008# add support for xtx files (single text files) --- l10ntools/scripts/l10ntool.py | 4 ++-- l10ntools/scripts/sdf.py | 2 -- l10ntools/scripts/xtxex.py | 29 ++++++++++++++++++++++------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/l10ntools/scripts/l10ntool.py b/l10ntools/scripts/l10ntool.py index caa15b7efd17..e98a8189e9b7 100644 --- a/l10ntools/scripts/l10ntool.py +++ b/l10ntools/scripts/l10ntool.py @@ -27,7 +27,7 @@ from optparse import OptionParser from sdf import SdfData -import string , sys , os +import sys , os class abstractL10nTool: _options = {} @@ -184,5 +184,5 @@ class abstractL10nTool: def get_filename_string(self, inputfile): absfile = os.path.realpath(os.path.abspath(inputfile)) absroot = os.path.realpath(os.path.abspath(self._options.project_root)) - return absfile[len(absroot):].replace('/','\\') + return absfile[len(absroot)+1:].replace('/','\\') diff --git a/l10ntools/scripts/sdf.py b/l10ntools/scripts/sdf.py index ce1077197622..1d7cc27f0733 100644 --- a/l10ntools/scripts/sdf.py +++ b/l10ntools/scripts/sdf.py @@ -25,8 +25,6 @@ # #************************************************************************* -import string - class MyOrderedDict(dict): _keylist = [] _valuelist = [] diff --git a/l10ntools/scripts/xtxex.py b/l10ntools/scripts/xtxex.py index 98ec1e86b596..a8677b10bf86 100644 --- a/l10ntools/scripts/xtxex.py +++ b/l10ntools/scripts/xtxex.py @@ -36,13 +36,21 @@ class xtxex(abstractL10nTool): def __init__(self): abstractL10nTool.__init__(self) - def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): - print "merge_file lang " + lang +" file " + outputfilename + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + # Special handling for en-US files + if lang == "en-US": + mod_outputfilename = outputfilename.replace("_en-US",'') + #print "DBG: merge_file lang " + lang +" file " + mod_outputfilename + self.copy_file(inputfilename, mod_outputfilename) + return + + # merge usual lang sdfline = self.prepare_sdf_line(inputfilename,lang) if sdfdata.has_key(sdfline.get_id()): line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') self.make_dirs(outputfilename) try: + #print "DBG: merge_file lang " + lang +" file " + outputfilename f = open(outputfilename, "w+") f.write(line) except IOError: @@ -51,12 +59,19 @@ class xtxex(abstractL10nTool): else: f.close() return + + # no sdf data found then copy en-US source file if is_forced_lang: - try: - shutil.copy(inputfilename, outputfilename) - except IOError: - print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" - sys.exit(-1) + #print "DBG: merge_file lang " + lang +" file " + outputfilename + self.copy_file(inputfilename, outputfilename) + + def copy_file(self, inputfilename, outputfilename): + try: + #print "DBG: copy " + inputfilename + " to " + outputfilename + shutil.copy(inputfilename, outputfilename) + except IOError: + print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" + sys.exit(-1) ##### Extract a single File def extract_file(self, inputfile): -- cgit From 70943ed84a1495a144e2cd61de57d332a0ac66be Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Mon, 12 Jul 2010 16:20:39 +0200 Subject: jl154 #162868# unopkg is back in packaging and installation --- setup_native/scripts/admin.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index 89588d0c4d03..c69888299c6d 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -43,6 +43,7 @@ BEGIN $msiinfo_available = 0; $path_displayed = 0; $localmsidbpath = ""; + $bundleddir = ""; $plat = $^O; @@ -761,6 +762,7 @@ sub create_directory_tree # Create the directory my $newdir = $fulldir . $separator . $dirname; if ( ! -f $newdir ) { mkdir $newdir; } + if (( $bundleddir eq "" ) && ( $newdir =~ /\Wbundled\s*$/ )) { $bundleddir = $newdir; } # Saving in collector $pathcollector->{$dir} = $newdir; # Iteration @@ -1020,12 +1022,12 @@ sub get_temppath } #################################################################################### -# Registering one extension +# Registering extensions #################################################################################### -sub register_one_extension +sub do_register_extensions { - my ($unopkgfile, $extension, $temppath) = @_; + my ($unopkgfile, $extension, $localtemppath) = @_; my $from = cwd(); @@ -1045,8 +1047,8 @@ sub register_one_extension $path_displayed = 1; } - $temppath =~ s/\\/\//g; - $temppath = "/".$temppath; + $localtemppath =~ s/\\/\//g; + $localtemppath = "/".$localtemppath; # Converting path of $extension for cygwin @@ -1060,7 +1062,7 @@ sub register_one_extension $executable = "./" . $executable; } - my $systemcall = $executable . " add --shared --verbose --suppress-license " . "\"" . $localextension . "\"" . " -env:UserInstallation=file://" . $temppath . " 2\>\&1 |"; + my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file://" . $bundleddir . "\"" . " -env:UserInstallation=file://" . $localtemppath . " 2\>\&1 |"; print "... $systemcall\n"; @@ -1100,7 +1102,7 @@ sub register_extensions } else { - foreach $extension ( @{$extensions} ) { register_one_extension($unopkgfile, $extension, $temppath); } + do_register_extensions($unopkgfile, $extension, $temppath); } remove_complete_directory($temppath, 1) } } -- cgit From 00d5cdc080f6381c0b42f231763195298bbca5ba Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Mon, 12 Jul 2010 18:02:39 +0200 Subject: jl154 #162868# unopkg is back in packaging and installation --- setup_native/scripts/admin.pl | 120 +++++++++++++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 32 deletions(-) diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index c69888299c6d..49b36fbe2f2d 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -299,6 +299,68 @@ sub get_sourcepath_from_filename_and_includepath return \$onefile; } +############################################################## +# Removing all empty directories below a specified directory +############################################################## + +sub remove_empty_dirs_in_folder +{ + my ( $dir, $firstrun ) = @_; + + if ( $firstrun ) + { + print "Removing superfluous directories\n"; + } + + my @content = (); + + $dir =~ s/\Q$separator\E\s*$//; + + if ( -d $dir ) + { + opendir(DIR, $dir); + @content = readdir(DIR); + closedir(DIR); + + my $oneitem; + + foreach $oneitem (@content) + { + if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) + { + my $item = $dir . $separator . $oneitem; + + if ( -d $item ) # recursive + { + remove_empty_dirs_in_folder($item, 0); + } + } + } + + # try to remove empty directory + my $returnvalue = rmdir $dir; + + # if ( $returnvalue ) { print "Successfully removed empty dir $dir\n"; } + } +} + +#################################################### +# Detecting the directory with extensions +#################################################### + +sub get_extensions_dir +{ + my ( $unopkgfile ) = @_; + + my $localbranddir = $unopkgfile; + get_path_from_fullqualifiedname(\$localbranddir); # "program" dir in brand layer + get_path_from_fullqualifiedname(\$localbranddir); # root dir in brand layer + $localbranddir =~ s/\Q$separator\E\s*$//; + my $extensiondir = $localbranddir . $separator . "share" . $separator . "extensions"; + + return $extensiondir; +} + ######################################################## # Finding all files with a specified file extension # in a specified directory. @@ -787,6 +849,12 @@ sub create_directory_structure foreach $dir (@startparents) { create_directory_tree($dir, \%fullpathhash, $targetdir, $dirhash); } + # Also adding the pathes of the startparents + foreach $dir (@startparents) + { + if ( ! exists($fullpathhash{$dir}) ) { $fullpathhash{$dir} = $targetdir; } + } + return \%fullpathhash; } @@ -876,7 +944,6 @@ sub copy_files_into_directory_structure print "Copying files\n"; my $unopkgfile = ""; - my @extensions = (); for ( my $i = 1; $i <= $maxsequence; $i++ ) { @@ -919,8 +986,6 @@ sub copy_files_into_directory_structure if ( ! $copyreturn) { exit_program("ERROR: Could not copy $source to $dest\n"); } - # Collecting all extensions - if ( $destfile =~ /\.oxt\s*$/ ) { push(@extensions, $destfile); } # Searching unopkg.exe if ( $destfile =~ /unopkg\.exe\s*$/ ) { $unopkgfile = $destfile; } # if (( $^O =~ /cygwin/i ) && ( $destfile =~ /\.exe\s*$/ )) { change_privileges($destfile, "775"); } @@ -931,7 +996,7 @@ sub copy_files_into_directory_structure # } } - return ($unopkgfile, \@extensions); + return ($unopkgfile); } ###################################################### @@ -1025,9 +1090,9 @@ sub get_temppath # Registering extensions #################################################################################### -sub do_register_extensions +sub register_extensions_sync { - my ($unopkgfile, $extension, $localtemppath) = @_; + my ($unopkgfile, $localtemppath) = @_; my $from = cwd(); @@ -1048,21 +1113,14 @@ sub do_register_extensions } $localtemppath =~ s/\\/\//g; - $localtemppath = "/".$localtemppath; - - # Converting path of $extension for cygwin - - my $localextension = $extension; - if ( $^O =~ /cygwin/i ) { - $localextension = qx{cygpath -w "$extension"}; - $localextension =~ s/\\/\\\\/g; - } if ( $^O =~ /cygwin/i ) { $executable = "./" . $executable; + $bundleddir = qx{cygpath -m "$bundleddir"}; + chomp($bundleddir); } - my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file://" . $bundleddir . "\"" . " -env:UserInstallation=file://" . $localtemppath . " 2\>\&1 |"; + my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file:///" . $bundleddir . "\"" . " -env:UserInstallation=file:///" . $localtemppath . " 2\>\&1 |"; print "... $systemcall\n"; @@ -1090,26 +1148,20 @@ sub do_register_extensions sub register_extensions { - my ($unopkgfile, $extensions, $temppath) = @_; + my ($unopkgfile, $temppath) = @_; - if ( $#{$extensions} > -1 ) - { - print "Registering extensions:\n"; + print "Registering extensions:\n"; - if (( ! -f $unopkgfile ) || ( $unopkgfile eq "" )) - { - print("WARNING: Could not find unopkg.exe (Language Pack?)!\n"); - } - else - { - do_register_extensions($unopkgfile, $extension, $temppath); } - remove_complete_directory($temppath, 1) - } + if (( ! -f $unopkgfile ) || ( $unopkgfile eq "" )) + { + print("WARNING: Could not find unopkg.exe (Language Pack?)!\n"); } else { - print "No extensions to register.\n"; + register_extensions_sync($unopkgfile, $temppath); + remove_complete_directory($temppath, 1); } + } #################################################################################### @@ -1353,7 +1405,7 @@ my ( $filehash, $fileorder, $maxsequence ) = analyze_file_file($filecontent); my $fullpathhash = create_directory_structure($dirhash, $targetdir); # Copying files -my ($unopkgfile, $extensions) = copy_files_into_directory_structure($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash); +my ($unopkgfile) = copy_files_into_directory_structure($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash); if ( $^O =~ /cygwin/i ) { change_privileges_full($targetdir); } my $msidatabase = $targetdir . $separator . $databasefilename; @@ -1365,10 +1417,14 @@ $filename = $helperdir . $separator . "CustomAction.idt"; $filecontent = read_file($filename); my $register_extensions_exists = analyze_customaction_file($filecontent); +# Removing empty dirs in extension folder +my $extensionfolder = get_extensions_dir($unopkgfile); +if ( -d $extensionfolder ) { remove_empty_dirs_in_folder($extensionfolder, 1); } + if ( $register_extensions_exists ) { # Registering extensions - register_extensions($unopkgfile, $extensions, $temppath); + register_extensions($unopkgfile, $temppath); } # Saving info in Summary Information Stream of msi database (required for following patches) -- cgit From f51ed65827e68e8bd549cfedf1d499d3dc226065 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Mon, 12 Jul 2010 18:24:42 +0200 Subject: jl154 #162868# unopkg is back in packaging and installation --- setup_native/source/win32/customactions/languagepacks/exports.dxp | 3 +++ setup_native/source/win32/customactions/languagepacks/makefile.mk | 1 + setup_native/source/win32/customactions/shellextensions/exports.dxp | 3 +++ setup_native/source/win32/customactions/shellextensions/makefile.mk | 1 + 4 files changed, 8 insertions(+) diff --git a/setup_native/source/win32/customactions/languagepacks/exports.dxp b/setup_native/source/win32/customactions/languagepacks/exports.dxp index d01befd5d0d9..7461090d7233 100644 --- a/setup_native/source/win32/customactions/languagepacks/exports.dxp +++ b/setup_native/source/win32/customactions/languagepacks/exports.dxp @@ -2,3 +2,6 @@ SetProductInstallationPath RegisterLanguagePack GetUserInstallMode IsOfficeRunning +RegisterExtensions +DeregisterExtensions +RemoveExtensions diff --git a/setup_native/source/win32/customactions/languagepacks/makefile.mk b/setup_native/source/win32/customactions/languagepacks/makefile.mk index 69526077c509..8da47ab1cc4f 100644 --- a/setup_native/source/win32/customactions/languagepacks/makefile.mk +++ b/setup_native/source/win32/customactions/languagepacks/makefile.mk @@ -77,6 +77,7 @@ STDSHL+= \ #SHL1LIBS = $(SLB)$/$(TARGET).lib SHL1OBJS = $(SLOFILES) \ + $(SLO)$/registerextensions.obj \ $(SLO)$/seterror.obj SHL1TARGET = $(TARGET) diff --git a/setup_native/source/win32/customactions/shellextensions/exports.dxp b/setup_native/source/win32/customactions/shellextensions/exports.dxp index 0e53492e460f..cafa011057c9 100644 --- a/setup_native/source/win32/customactions/shellextensions/exports.dxp +++ b/setup_native/source/win32/customactions/shellextensions/exports.dxp @@ -6,6 +6,9 @@ SetProductInstallMode RebuildShellIconCache ExecutePostUninstallScript MigrateInstallPath +RegisterExtensions +DeregisterExtensions +RemoveExtensions CheckInstallDirectory SetAdminInstallProperty CreateLayerLinks diff --git a/setup_native/source/win32/customactions/shellextensions/makefile.mk b/setup_native/source/win32/customactions/shellextensions/makefile.mk index 9eef136a82a4..220ac727b774 100644 --- a/setup_native/source/win32/customactions/shellextensions/makefile.mk +++ b/setup_native/source/win32/customactions/shellextensions/makefile.mk @@ -62,6 +62,7 @@ SLOFILES = \ $(SLO)$/setadmininstall.obj \ $(SLO)$/layerlinks.obj \ $(SLO)$/dotnetcheck.obj \ + $(SLO)$/registerextensions.obj \ $(SLO)$/copyeditiondata.obj \ $(SLO)$/vistaspecial.obj \ $(SLO)$/checkrunningoffice.obj \ -- cgit From cd9c760cfb830cdc991ae5d2c8bee15a6166f496 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 17:42:44 +0200 Subject: txtl10n: #113125# Support of help tree files in the L10N process --- l10ntools/source/localize.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 8e2fbee2bc85..420fa3a8d484 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -53,9 +53,7 @@ namespace transex3 const char *ExeTable[][5] = { { "src", "transex3", " -UTF8 -e", "negative", "noiso" }, { "hrc", "transex3", " -UTF8 -e", "positive", "noiso" }, - //{ "src", "transex3", "-UTF8 -e", "negative", "noiso" }, - //{ "hrc", "transex3", "-UTF8 -e", "positive", "noiso" }, - + { "xht", "xhtex", "", "negative", "noiso" }, { "xtx", "xtxex", "", "negative", "noiso" }, { "ulf", "ulfex", " -e", "negative", "noiso" }, { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, -- cgit From 17022b70d98093f0d33e119f6c59725c66674561 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 17:56:32 +0200 Subject: txtl10n: #i113008# #i113125# Support of help tree files and single txt files in the L10N process --- l10ntools/prj/d.lst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index e20114a1ed0d..9594dc416c8e 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -47,11 +47,13 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\localize %_DEST%\bin%_EXT%\localize ..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl ..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl -..\scripts\const.py %_DEST%\bin%_EXT%\const.py -..\scripts\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py -..\scripts\xtxex.py %_DEST%\bin%_EXT%\xtxex.py -..\scripts\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\scripts\tool\const.py %_DEST%\bin%_EXT%\const.py +..\scripts\tool\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py +..\scripts\tool\xtxex.py %_DEST%\bin%_EXT%\xtxex.py +..\scripts\tool\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\scripts\tool\xhtex.py %_DEST%\bin%_EXT%\xhtex.py ..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex +..\scripts\xhtex %_DEST%\bin%_EXT%\xhtex ..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx ..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx -- cgit From a25f2a7a55a7611b75dc6721fa52426c466d4be0 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 17:58:25 +0200 Subject: txtl10n: #i113008# #i113125# Support of help tree files and single txt files in the L10N process --- l10ntools/scripts/tool/const.py | 39 +++++++ l10ntools/scripts/tool/l10ntool.py | 204 +++++++++++++++++++++++++++++++++ l10ntools/scripts/tool/sdf.py | 224 +++++++++++++++++++++++++++++++++++++ l10ntools/scripts/tool/xhtex.py | 133 ++++++++++++++++++++++ l10ntools/scripts/tool/xtxex.py | 89 +++++++++++++++ 5 files changed, 689 insertions(+) create mode 100644 l10ntools/scripts/tool/const.py create mode 100644 l10ntools/scripts/tool/l10ntool.py create mode 100644 l10ntools/scripts/tool/sdf.py create mode 100644 l10ntools/scripts/tool/xhtex.py create mode 100644 l10ntools/scripts/tool/xtxex.py diff --git a/l10ntools/scripts/tool/const.py b/l10ntools/scripts/tool/const.py new file mode 100644 index 000000000000..2d514eabdab6 --- /dev/null +++ b/l10ntools/scripts/tool/const.py @@ -0,0 +1,39 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# Pseudo const +class _const: + class ConstError(TypeError): pass + def __setattr__(self, name, value): + if self.__dict__.has_key(name): + raise self.ConstError, "Can't rebind const(%s)"%name + self.__dict__[name] = value + +import sys +sys.modules[__name__] = _const() + + diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py new file mode 100644 index 000000000000..66afc309a1fb --- /dev/null +++ b/l10ntools/scripts/tool/l10ntool.py @@ -0,0 +1,204 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from optparse import OptionParser +from sdf import SdfData +import sys +import os +import shutil + +class abstractL10nTool: + _options = {} + _args = "" + _resource_type = "" + _source_language = "en-US" + + ##### Implement these abstract methods + + ##### Nameing scheme for the output files + def get_outputfile_format_str(self): + # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path + #return "{path}/{fileNoExt}_{language}.{extension}" + return self._options.pattern + + ################################# Merge single files ########################################### + + ##### Merge a single file + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + pass + + ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here + def parse_file(self, filename): + return None + + ################### Merge one big file containing all strings in all languages ################# + def merge_one_big_file(self, inputfile, outputfilename, parsed_file_ref, lang, sdfdata): + pass + + ################### Extract a single File ###################################################### + def extract_file(self, inputfile): + pass + + ################################################################################################ + + def format_outputfile(self, filename, language): + extension = filename[filename.rfind('.')+1:] + file = filename[:filename.rfind('.')] + return self.get_outputfile_format_str().replace('[', '{').replace(']','}').format( + filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, + path_postfix=self._options.path_postfix, path=self.get_path()) + + def get_path(self): + if self._options.outputfile.find('/') == -1: + return "" + else: + return self._options.outputfile[:self._options.outputfile.rfind('/')] + + def merge(self, sdfdata): + langset,forcedset, foundset = set(), set() , set() + + if self._options.languages: + langset = set(self._options.languages) + if self._options.forcedlanguages: + forcedset = set(self._options.forcedlanguages) + if sdfdata.get_languages_found_in_sdf(): + foundset = sdfdata.get_languages_found_in_sdf() + + if self.has_multi_inputfiles(): + filelist = self.read_inputfile_list() + else: + filelist = self._options.inputfile + + for inputfile in filelist: + ref = self.parse_file(inputfile) + # Don't write that files if there is no l10n present + if ((langset & foundset) - forcedset): # all langs given and found in sdf without enforced + [self.merge_file(inputfile,self.format_outputfile(inputfile, lang), ref, lang, False, sdfdata) for lang in ((langset & foundset) - forcedset)] + # Always write those files even if there is no l10n available + if forcedset: # all enforced langs + [self.merge_file(inputfile, self.format_outputfile(inputfile, lang), ref, lang, True, sdfdata) for lang in forcedset] + # In case a big file have to be written + if ((langset & foundset) | forcedset): # all langs given ,found in sdf and enforced ones + self.merge_one_big_file(inputfile, self.format_outputfile(inputfile, lang), ref, ((langset & foundset) | forcedset), sdfdata) + + def has_multi_inputfiles(self): + return self._options.inputfile[0] == '@' + + def copy_file(self, inputfilename, outputfilename): + try: + shutil.copy(inputfilename, outputfilename) + except IOError: + print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" + sys.exit(-1) + + def extract(self): + try: + f = open(self._options.outputfile, "w+") + f.write(self.extract_file(self._options.inputfile)) + except IOError: + print "ERROR: Can not write file " + self._options.outputfile + else: + f.close() + + # Parse the common options + def parse_options(self): + parser = OptionParser() + parser.add_option("-i", "--inputfile", dest="inputfile", metavar="FILE", help="resource file to read" ) + parser.add_option("-o", "--outputfile", dest="outputfile", metavar="FILE", help="extracted sdf or merged file" ) + parser.add_option("-m", "--inputsdffile", dest="input_sdf_file", metavar="FILE", help="merge this sdf file" ) + parser.add_option("-x", "--pathprefix", dest="path_prefix", metavar="PATH", help="" ) + parser.add_option("-y", "--pathpostfix", dest="path_postfix", metavar="PATH", help="" ) + parser.add_option("-p", "--projectname", dest="project_name", metavar="NAME", help="" ) + parser.add_option("-r", "--projectroot", dest="project_root", metavar="PATH", help="" ) + parser.add_option("-f", "--forcedlanguages", dest="forcedlanguages", metavar="ISOCODE[,ISOCODE]", help="Always merge those langs even if no l10n is available for those langs" ) + parser.add_option("-l", "--languages", dest="languages", metavar="ISOCODE[,ISOCODE]", help="Merge those langs if l10n is found for each") + parser.add_option("-s", "--pattern", dest="pattern", metavar="", help="" ) + parser.add_option("-q", "--quiet", action="store_true", dest="quietmode", help="",default=False) + (self._options, self.args) = parser.parse_args() + + # -l "de,pr,pt-BR" => [ "de" , "pt" , "pt-BR" ] + parse_complex_arg = lambda arg: arg.split(",") + + if self._options.forcedlanguages: + self._options.forcedlanguages = parse_complex_arg(self._options.forcedlanguages) + if self._options.languages: + self._options.languages = parse_complex_arg(self._options.languages) + self.test_options() + + def __init__(self): + self.parse_options() + if self._options.input_sdf_file != None and len(self._options.input_sdf_file): + sdfdata = SdfData(self._options.input_sdf_file) + sdfdata.read() + self.merge(sdfdata) + else: + self.extract() + + def make_dirs(self, filename): + dir = filename[:filename.rfind('/')] + if os.path.exists(dir): + if os.path.isfile(dir): + print "ERROR: There is a file '"+dir+"' where I want create a directory" + sys.exit(-1) + else: + return + else: + try: + print "DBG: make_dir " + str(dir) + os.makedirs(dir) + except IOError: + print "Error: Can not create dir " + dir + sys.exit(-1) + + def test_options(self): + opt = self._options + is_valid = lambda x: x != None and len(x) > 0 + return is_valid(opt.project_root) and is_valid(opt.project_name) and is_valid(opt.languages) and \ + ( is_valid(opt.inputfile) and (( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or is_valid(opt.outputfile)) and \ + ( ( is_valid(opt.input_sdf_file) and ( is_valid(opt.outputfile) or ( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or \ + ( is_valid(opt.inputfile) and is_valid(opt.outputFile)) )))) + print "Strange options ..." + sys.exit( -1 ) + + def read_inputfile_list(self): + if self.has_multi_inputfiles(): + lines = [] + try: + f = open(self._options.inputfile[1:], "r") + lines = [line.strip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Can not read file list " + self._options.inputfile[2:] + sys.exit(-1) + else: + f.close() + return lines + + def get_filename_string(self, inputfile): + absfile = os.path.realpath(os.path.abspath(inputfile)) + absroot = os.path.realpath(os.path.abspath(self._options.project_root)) + return absfile[len(absroot)+1:].replace('/','\\') + diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py new file mode 100644 index 000000000000..33bf90b4ea68 --- /dev/null +++ b/l10ntools/scripts/tool/sdf.py @@ -0,0 +1,224 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +class MyOrderedDict(dict): + _keylist = [] + _valuelist = [] + + def __init__(self, defaults={}): + dict.__init__(self) + for n,v in defaults.items(): + self[n] = v + + def __setitem__(self, key, value): + self._keylist.append(key) + self._valuelist.append(value) + return dict.__setitem__(self, key, value) + + def __delattr__(self, key): + self._keylist.__delattr__(key) + self._valuelist.__delattr__(dict[key]) + return dict.__delattr__(self, key) + + def __delitem__(self, key): + self._keylist.__delitem__(key) + self._valuelist.__delitem__(dict[key]) + return dict.__delitem__(self, key) + + def __iter(self): + return zip(self._keylist, self._valuelist) + + def __iterkeys__(self): + return self._keylist + + def __iteritems__(self): + return self._valuelist + + def items(self): + return zip(self._keylist,self._valuelist) + + def keys(self): + return self._keylist + + def __keysattr__(self): + return self._keylist + + def pop(self, key): + self._keylist.pop(key) + self._valuelist.pop(key) + return dict.__pop__(self, key) + + def popitem(self): + raise NotImplementedError("popitem") + + def clear(self): + self._keylist.clear() + self._valuelist.clear() + return dict.clear() + + def copy(self): + newobj = MyOrderedDict(self) + newobj._keylist = self._keylist + newobj._valuelist = self._valuelist + return newobj + +class SdfData: + _filename = ""; + _dict = MyOrderedDict() + _languages_found = []; + + def __init__ (self, filename=""): + self._filename = filename + + def __getitem__(self, key): + if self._dict.has_key(key): + return self._dict[key] + else: + return None + + def has_key(self, key): + return self._dict.has_key(key) + + def __setitem__(self, key, value): + self._dict[key] = value + + def get_languages_found_in_sdf(self): + return set(self._languages_found) + + def read(self): + try: + f = open(self._filename, "r") + lines = [line.rstrip('\n') for line in f.readlines()] + except IOError: + print "ERROR: Trying to read "+ self._filename + raise + else: + f.close() + for line in lines: + entity = SdfEntity() + entity.set_properties(line) + self._dict[entity.get_id()] = entity + self._languages_found.append(entity.langid) + + def write(self, filename): + try: + f = open(filename, "w+") + for value in self._dict.itervalues(): + #f.write( repr(value)+"\n" ) + f.write(value + "\n") + except IOError: + print "ERROR: Trying to write " + filename + raise + else: + f.close() + +import sys +class SdfEntity: + # Sdf format columns + project = "" + source_file = "" + dummy1 = "" + resource_type = "" + gid = "" + lid = "" + helpid = "" + platform = "" + dummy2 = "" + langid = "" + text = "" + helptext = "" + quickhelptext = "" + title = "" + date = "" + + import const + const._PROJECT_POS = 0 + const._SOURCE_FILE_POS = 1 + const._DUMMY1_POS = 2 + const._RESOURCE_TYPE_POS = 3 + const._GID_POS = 4 + const._LID_POS = 5 + const._HELPID_POS = 6 + const._PLATFORM_POS = 7 + const._DUMMY2_POS = 8 + const._LANGID_POS = 9 + const._TEXT_POS = 10 + const._HELPTEXT_POS = 11 + const._QUICKHELPTEXT_POS = 12 + const._TITLE_POS = 13 + const._DATE_POS = 14 + + def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", + text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): + self.project = project; + self.source_file = source_file; + self.dummy1 = dummy1; + self.resource_type = resource_type; + self.gid = gid; + self.lid = lid; + self.helpid = helpid; + self.platform = platform; + self.dummy2 = dummy2; + self.langid = langid; + self.text = text; + self.helptext = helptext; + self.quickhelptext = quickhelptext; + self.title = title; + self.date = date; + + def set_properties(self, line): + splitted = line.split("\t") + if len(splitted) == 15: + self.project = splitted[ self.const._PROJECT_POS ] + self.source_file = splitted[ self.const._SOURCE_FILE_POS ] + self.dummy1 = splitted[ self.const._DUMMY1_POS ] + self.resource_type = splitted[ self.const._RESOURCE_TYPE_POS ] + self.gid = splitted[ self.const._GID_POS ] + self.lid = splitted[ self.const._LID_POS ] + self.helpid = splitted[ self.const._HELPID_POS ] + self.platform = splitted[ self.const._PLATFORM_POS ] + self.dummy2 = splitted[ self.const._DUMMY2_POS ] + self.langid = splitted[ self.const._LANGID_POS ] + self.text = splitted[ self.const._TEXT_POS ] + self.helptext = splitted[ self.const._HELPTEXT_POS ] + self.quickhelptext = splitted[ self.const._QUICKHELPTEXT_POS ] + self.title = splitted[ self.const._TITLE_POS ] + self.date = splitted[ self.const._DATE_POS ] + + def get_file_id(self): + return self.project + "\\" + self.source_file + + def get_resource_path(self): + return self.source_file[0:self.source_file.rfind( "\\" )-1] + + def __str__(self): + return ''.join([self.project, "\t", self.source_file, "\t", self.dummy1, "\t", self.resource_type, "\t" , + self.gid, "\t", self.lid, "\t", self.helpid, "\t", self.platform, "\t", self.dummy2, "\t" , self.langid, + "\t", self.text, "\t", self.helptext, "\t", self.quickhelptext, "\t" , self.title, "\t", self.date ]) + + def get_id(self): + return ''.join([self.project, self.gid, self.lid, self.source_file, self.resource_type, self.platform, self.helpid, self.langid]) diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py new file mode 100644 index 000000000000..99e0f39259a2 --- /dev/null +++ b/l10ntools/scripts/tool/xhtex.py @@ -0,0 +1,133 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from l10ntool import abstractL10nTool +from sdf import SdfEntity +import sys +import xml.dom.minidom + +class xhtex(abstractL10nTool): + _resource_type = "xht" + _sdfdata = () + _lang = "" + + # Extract methods + def extract_topic(self, list, inputfile): + topics = [] + for elem in list: + if elem.childNodes[0].nodeType == elem.TEXT_NODE: + topics.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.childNodes[0].data, inputfile=inputfile)) + return topics + + def extract_title(self, list, inputfile): + titles = [] + for elem in list: + titles.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.getAttribute("title").strip(), inputfile=inputfile)) + return titles + + # Merge methods + def merge_topic(self, list, sdfdata, lang, inputfilename, dom): + for elem in list: + if elem.childNodes[0].nodeType == elem.TEXT_NODE and elem.getAttribute("id").strip(): + obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip()) + if sdfdata[obj.get_id()]: + elem.childNodes[0].data = str(sdfdata[obj.get_id()].text) + + def merge_title(self, list, sdfdata, lang, inputfilename): + for elem in list: + obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip()) + if elem.getAttribute("id").strip() and sdfdata[obj.get_id()]: + elem.setAttribute("title", str(sdfdata[obj.get_id()].text)) + + # L10N tool + def __init__(self): + abstractL10nTool.__init__(self) + + def parse_file(self, filename): + document = "" + try: + f = open(filename, "r+") + document = f.read() + except IOError: + print "ERROR: Can not read file " + filename + sys.exit(-1) + else: + f.close() + return xml.dom.minidom.parseString(document) + + + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): + if lang == "en-US": + mod_outputfilename = outputfilename.replace("_en-US",'') + self.copy_file(inputfilename, mod_outputfilename) + return + dom = parsed_file_ref.cloneNode(True) + #dom = self.parse_file(inputfilename) # in case cloneNode is buggy just parse it always + + self.merge_topic(dom.getElementsByTagName("topic"), sdfdata, lang, inputfilename, dom) + self.merge_title(dom.getElementsByTagName("node"), sdfdata, lang, inputfilename) + self.merge_title(dom.getElementsByTagName("help_section"), sdfdata, lang, inputfilename) + self.make_dirs(outputfilename) + try: + f = open(outputfilename, "w+") + str = dom.toxml() + f.write(str) + except IOError: + print "ERROR: Can not write file " + outputfilename + sys.exit(-1) + else: + f.close() + + ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here + def parse_file(self, filename): + document = "" + try: + f = open(filename,"r+") + document = f.read() + except IOError: + print "ERROR: Can not read file " + filename + else: + f.close() + return xml.dom.minidom.parseString(document) + + ##### Extract a single File + def extract_file(self, inputfile): + sdf_data = [] + dom = self.parse_file(inputfile) + sdf_data.extend(self.extract_topic(dom.getElementsByTagName("topic"), inputfile)) + sdf_data.extend(self.extract_title(dom.getElementsByTagName("help_section"), inputfile)) + sdf_data.extend(self.extract_title(dom.getElementsByTagName("node"), inputfile)) + return ''.join([str(line)+"\n" for line in sdf_data]) + + def prepare_sdf_line(self, inputfile="", lang="" , id="" , text=""): + if lang == "": + lang = self._source_language + return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), + resource_type=self._resource_type, gid=id, lid="", langid=lang,text=text) + +run = xhtex() + diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py new file mode 100644 index 000000000000..bb11e337d37a --- /dev/null +++ b/l10ntools/scripts/tool/xtxex.py @@ -0,0 +1,89 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +from l10ntool import abstractL10nTool +from sdf import SdfEntity +import sys +import shutil + +class xtxex(abstractL10nTool): + _resource_type = "xtx" + + def __init__(self): + abstractL10nTool.__init__(self) + + def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): + # Special handling for en-US files + if lang == "en-US": + mod_outputfilename = outputfilename.replace("_en-US",'') + self.copy_file(inputfilename, mod_outputfilename) + return + # merge usual lang + sdfline = self.prepare_sdf_line(inputfilename,lang) + if sdfdata.has_key(sdfline.get_id()): + line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') + self.make_dirs(outputfilename) + try: + f = open(outputfilename, "w+") + f.write(line) + except IOError: + print "ERROR: Can not write file " + outputfilename + sys.exit(-1) + else: + f.close() + return + # no sdf data found then copy en-US source file + if is_forced_lang: + self.copy_file(inputfilename, outputfilename) + + ##### Extract a single File + def extract_file(self, inputfile): + lines = [] + try: + f = open(inputfile, "r") + lines = f.readlines() + except IOError: + print "ERROR: Can not open file " + inputfile + sys.exit(-1) + else: + f.close() + # remove legal header + lines = [line for line in lines if len(line) > 0 and not line[0] == '#'] + # escape all returns + lines = [line.replace('\n', "\\n") for line in lines] + line = ''.join(lines) + sdf_entity = self.prepare_sdf_line(inputfile); + sdf_entity.text = line + return str(sdf_entity) + + def prepare_sdf_line(self, inputfile="", lang=""): + if lang == "": + lang = self._source_language + return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), + resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") + +run = xtxex() -- cgit From 81864751ef5e6e51906d5bae7de39cf19505e868 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 13 Jul 2010 18:00:06 +0200 Subject: txtl10n: #i113008# #i113125# Support of help tree files and single txt files in the L10N process --- l10ntools/scripts/const.py | 39 ------- l10ntools/scripts/l10ntool.py | 188 --------------------------------- l10ntools/scripts/sdf.py | 238 ------------------------------------------ l10ntools/scripts/xhtex | 47 +++++++++ l10ntools/scripts/xtxex.py | 107 ------------------- 5 files changed, 47 insertions(+), 572 deletions(-) delete mode 100644 l10ntools/scripts/const.py delete mode 100644 l10ntools/scripts/l10ntool.py delete mode 100644 l10ntools/scripts/sdf.py create mode 100755 l10ntools/scripts/xhtex delete mode 100644 l10ntools/scripts/xtxex.py diff --git a/l10ntools/scripts/const.py b/l10ntools/scripts/const.py deleted file mode 100644 index 2d514eabdab6..000000000000 --- a/l10ntools/scripts/const.py +++ /dev/null @@ -1,39 +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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -# Pseudo const -class _const: - class ConstError(TypeError): pass - def __setattr__(self, name, value): - if self.__dict__.has_key(name): - raise self.ConstError, "Can't rebind const(%s)"%name - self.__dict__[name] = value - -import sys -sys.modules[__name__] = _const() - - diff --git a/l10ntools/scripts/l10ntool.py b/l10ntools/scripts/l10ntool.py deleted file mode 100644 index e98a8189e9b7..000000000000 --- a/l10ntools/scripts/l10ntool.py +++ /dev/null @@ -1,188 +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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -from optparse import OptionParser -from sdf import SdfData -import sys , os - -class abstractL10nTool: - _options = {} - _args = "" - _resource_type = "" - _source_language = "en-US" - - ##### Implement these abstract methods - - ##### Nameing scheme for the output files - def get_outputfile_format_str(self): - # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path - return "{path}/{fileNoExt}_{language}.{extension}" - - ################################# Merge single files ########################################### - - ##### Merge a single file - def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): - pass - - ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here - def parse_file(self, filename): - return None - - ################### Merge one big file containing all strings in all languages ################# - def merge_one_big_file(self, inputfile, outputfilename, parsed_file_ref, lang, sdfdata): - pass - - ################### Extract a single File ###################################################### - def extract_file(self, inputfile): - pass - - ################################################################################################ - - def format_outputfile(self, filename, language): - extension = filename[filename.rfind('.')+1:] - file = filename[:filename.rfind('.')] - return self.get_outputfile_format_str().format( - filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, - path_postfix=self._options.path_postfix, path=self.get_path()) - - def get_path(self): - if self._options.outputfile.find('/') == -1: - return "" - else: - return self._options.outputfile[:self._options.outputfile.rfind('/')] - - def merge(self, sdfdata): - langset,forcedset, foundset = set(), set() , set() - - if self._options.languages: langset = set(self._options.languages) - if self._options.forcedlanguages: forcedset = set(self._options.forcedlanguages) - if sdfdata.get_languages_found_in_sdf(): foundset = sdfdata.get_languages_found_in_sdf() - - if self.has_multi_inputfiles(): - filelist = self.read_inputfile_list() - else: - filelist = self._options.inputfile - - for inputfile in filelist: - ref = self.parse_file(inputfile) - # Don't write that files if there is no l10n present - if ((langset & foundset) - forcedset): # all langs given and found in sdf without enforced - [self.merge_file(inputfile,self.format_outputfile(inputfile, lang), ref, lang, False, sdfdata) for lang in ((langset & foundset) - forcedset)] - # Always write those files even if there is no l10n available - if forcedset: # all enforced langs - [self.merge_file(inputfile, self.format_outputfile(inputfile, lang), ref, lang, True, sdfdata) for lang in forcedset] - # In case a big file have to be written - if ((langset & foundset) | forcedset): # all langs given ,found in sdf and enforced ones - self.merge_one_big_file(inputfile, self.format_outputfile(inputfile, lang), ref, ((langset & foundset) | forcedset), sdfdata) - - def has_multi_inputfiles(self): - return self._options.inputfile[0] == '@' - - def extract(self): - try: - f = open(self._options.outputfile, "w+") - f.write(self.extract_file(self._options.inputfile)) - except IOError: - print "ERROR: Can not write file " + self._options.outputfile - else: - f.close() - - # Parse the common options - def parse_options(self): - parser = OptionParser() - parser.add_option("-i", "--inputfile", dest="inputfile", metavar="FILE", help="resource file to read" ) - parser.add_option("-o", "--outputfile", dest="outputfile", metavar="FILE", help="extracted sdf or merged file" ) - parser.add_option("-m", "--inputsdffile", dest="input_sdf_file", metavar="FILE", help="merge this sdf file" ) - parser.add_option("-x", "--pathprefix", dest="path_prefix", metavar="PATH", help="" ) - parser.add_option("-y", "--pathpostfix", dest="path_postfix", metavar="PATH", help="" ) - parser.add_option("-p", "--projectname", dest="project_name", metavar="NAME", help="" ) - parser.add_option("-r", "--projectroot", dest="project_root", metavar="PATH", help="" ) - parser.add_option("-f", "--forcedlanguages", dest="forcedlanguages", metavar="ISOCODE[,ISOCODE]", help="Always merge those langs even if no l10n is available for those langs" ) - parser.add_option("-l", "--languages", dest="languages", metavar="ISOCODE[,ISOCODE]", help="Merge those langs if l10n is found for each") - parser.add_option("-q", "--quiet", action="store_true", dest="quietmode", help="",default=False) - (self._options, self.args) = parser.parse_args() - - # -l "de,pr,pt-BR" => [ "de" , "pt" , "pt-BR" ] - parse_complex_arg = lambda arg: arg.split(",") - if self._options.forcedlanguages: self._options.forcedlanguages = parse_complex_arg(self._options.forcedlanguages) - if self._options.languages: self._options.languages = parse_complex_arg(self._options.languages) - self.test_options() - - def __init__(self): - self.parse_options() - if self._options.input_sdf_file != None and len(self._options.input_sdf_file): - sdfdata = SdfData(self._options.input_sdf_file) - sdfdata.read() - self.merge(sdfdata) - else: - self.extract() - - def make_dirs(self, filename): - dir = filename[:filename.rfind('/')] - if os.path.exists(dir): - if os.path.isfile(dir): - print "ERROR: There is a file '"+dir+"' where I want create a directory" - sys.exit(-1) - else: - return - else: - try: - print "DBG: make_dir " + str(dir) - os.makedirs(dir) - except IOError: - print "Error: Can not create dir " + dir - sys.exit(-1) - - def test_options(self): - opt = self._options - is_valid = lambda x: x != None and len(x) > 0 - return is_valid(opt.project_root) and is_valid(opt.project_name) and is_valid(opt.languages) and \ - ( is_valid(opt.inputfile) and (( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or is_valid(opt.outputfile)) and \ - ( ( is_valid(opt.input_sdf_file) and ( is_valid(opt.outputfile) or ( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or \ - ( is_valid(opt.inputfile) and is_valid(opt.outputFile)) )))) - print "Strange options ..." - sys.exit( -1 ) - - - def read_inputfile_list(self): - if self.has_multi_inputfiles(): - lines = [] - try: - f = open(self._options.inputfile[1:], "r") - lines = [line.strip('\n') for line in f.readlines()] - except IOError: - print "ERROR: Can not read file list " + self._options.inputfile[2:] - sys.exit(-1) - else: - f.close() - return lines - - def get_filename_string(self, inputfile): - absfile = os.path.realpath(os.path.abspath(inputfile)) - absroot = os.path.realpath(os.path.abspath(self._options.project_root)) - return absfile[len(absroot)+1:].replace('/','\\') - diff --git a/l10ntools/scripts/sdf.py b/l10ntools/scripts/sdf.py deleted file mode 100644 index 1d7cc27f0733..000000000000 --- a/l10ntools/scripts/sdf.py +++ /dev/null @@ -1,238 +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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -class MyOrderedDict(dict): - _keylist = [] - _valuelist = [] - - #correct?!? - def __init__(self, defaults={}): - dict.__init__(self) - for n,v in defaults.items(): - self[n] = v - #def __getitem__(self): - # pass - - def __setitem__(self, key, value): - self._keylist.append(key) - self._valuelist.append(value) - return dict.__setitem__(self, key, value) - - def __delattr__(self, key): - self._keylist.__delattr__(key) - self._valuelist.__delattr__(dict[key]) - return dict.__delattr__(self, key) - - def __delitem__(self, key): - self._keylist.__delitem__(key) - self._valuelist.__delitem__(dict[key]) - return dict.__delitem__(self, key) - - def __iter(self): - return zip(self._keylist, self._valuelist) - - def __iterkeys__(self): - return self._keylist - - def __iteritems__(self): - return self._valuelist - - def items(self): - return zip(self._keylist,self._valuelist) - - def keys(self): - return self._keylist - - def __keysattr__(self): - return self._keylist - - def pop(self, key): - self._keylist.pop(key) - self._valuelist.pop(key) - return dict.__pop__(self, key) - - def popitem(self): - raise NotImplementedError("popitem") - - def clear(self): - self._keylist.clear() - self._valuelist.clear() - return dict.clear() - - def copy(self): - # correct?!? - newobj = MyOrderedDict(self) - newobj._keylist = self._keylist - newobj._valuelist = self._valuelist - return newobj - -class SdfData: - _filename = ""; - _dict = MyOrderedDict() - #_dict = {} - _languages_found = []; - - def __init__ (self, filename=""): - self._filename = filename - - def __getitem__(self, key): - if self._dict.has_key(key): - return self._dict[key] - else: - return None - - def has_key(self, key): - return self._dict.has_key(key) - - def __setitem__(self, key, value): - self._dict[key] = value - - def get_languages_found_in_sdf(self): - return set(self._languages_found) - - def read(self): - try: - f = open(self._filename, "r") - lines = [line.rstrip('\n') for line in f.readlines()] - except IOError: - print "ERROR: Trying to read "+ self._filename - raise - else: - f.close() - for line in lines: - entity = SdfEntity() - entity.set_properties(line) - self._dict[entity.get_id()] = entity - self._languages_found.append(entity.langid) - - def write(self, filename): - try: - f = open(filename, "w+") - for value in self._dict.itervalues(): - #f.write( repr(value)+"\n" ) - f.write(value + "\n") - except IOError: - print "ERROR: Trying to write " + filename - raise - else: - f.close() - - - -import sys -class SdfEntity: - # Sdf format columns - project = "" - source_file = "" - dummy1 = "" - resource_type = "" - gid = "" - lid = "" - helpid = "" - platform = "" - dummy2 = "" - langid = "" - text = "" - helptext = "" - quickhelptext = "" - title = "" - date = "" - - import const - const._PROJECT_POS = 0 - const._SOURCE_FILE_POS = 1 - const._DUMMY1_POS = 2 - const._RESOURCE_TYPE_POS = 3 - const._GID_POS = 4 - const._LID_POS = 5 - const._HELPID_POS = 6 - const._PLATFORM_POS = 7 - const._DUMMY2_POS = 8 - const._LANGID_POS = 9 - const._TEXT_POS = 10 - const._HELPTEXT_POS = 11 - const._QUICKHELPTEXT_POS = 12 - const._TITLE_POS = 13 - const._DATE_POS = 14 - - - - def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", - text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): - self.project = project; - self.source_file = source_file; - self.dummy1 = dummy1; - self.resource_type = resource_type; - self.gid = gid; - self.lid = lid; - self.helpid = helpid; - self.platform = platform; - self.dummy2 = dummy2; - self.langid = langid; - self.text = text; - self.helptext = helptext; - self.quickhelptext = quickhelptext; - self.title = title; - self.date = date; - - def set_properties(self, line): - splitted = line.split("\t") - if len(splitted) == 15: - self.project = splitted[ self.const._PROJECT_POS ] - self.source_file = splitted[ self.const._SOURCE_FILE_POS ] - self.dummy1 = splitted[ self.const._DUMMY1_POS ] - self.resource_type = splitted[ self.const._RESOURCE_TYPE_POS ] - self.gid = splitted[ self.const._GID_POS ] - self.lid = splitted[ self.const._LID_POS ] - self.helpid = splitted[ self.const._HELPID_POS ] - self.platform = splitted[ self.const._PLATFORM_POS ] - self.dummy2 = splitted[ self.const._DUMMY2_POS ] - self.langid = splitted[ self.const._LANGID_POS ] - self.text = splitted[ self.const._TEXT_POS ] - self.helptext = splitted[ self.const._HELPTEXT_POS ] - self.quickhelptext = splitted[ self.const._QUICKHELPTEXT_POS ] - self.title = splitted[ self.const._TITLE_POS ] - self.date = splitted[ self.const._DATE_POS ] - #else: - # print "Offending line '"+line+"'" - # print "ERROR: Something is broken here! Line has {0} tabs".format( len(splitted) ) - # sys.exit( -1 ) - - def get_file_id(self): - return self.project + "\\" + self.source_file - - def get_resource_path(self): - return self.source_file[0:self.source_file.rfind( "\\" )-1] - - #def __repr__(self): - def __str__(self): - return ''.join([self.project, "\t", self.source_file, "\t", self.dummy1, "\t", self.resource_type, "\t" , - self.gid, "\t", self.lid, "\t", self.helpid, "\t", self.platform, "\t", self.dummy2, "\t" , self.langid, - "\t", self.text, "\t", self.helptext, "\t", self.quickhelptext, "\t" , self.title, "\t", self.date ]) - - def get_id(self): - return ''.join([self.project, self.gid, self.lid, self.source_file, self.resource_type, self.platform, self.helpid, self.langid]) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex new file mode 100755 index 000000000000..e6f7cf9f2003 --- /dev/null +++ b/l10ntools/scripts/xhtex @@ -0,0 +1,47 @@ +#!/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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +if [ x${SOLARENV}x = xx ]; then + echo No environment found, please use 'setsolar' +exit 1 +fi + +# localize.pl calls localize_sl in solver bin directory which depends on dynamic +# libraries in solver lib directory but has no correct RPATH (or equivalent): +if [ "${OS?}" = MACOSX ]; then + export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +else + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +fi + +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" +fi + diff --git a/l10ntools/scripts/xtxex.py b/l10ntools/scripts/xtxex.py deleted file mode 100644 index a8677b10bf86..000000000000 --- a/l10ntools/scripts/xtxex.py +++ /dev/null @@ -1,107 +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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -from l10ntool import abstractL10nTool -from sdf import SdfEntity -import sys -import shutil - -class xtxex(abstractL10nTool): - _resourceType = "xtx" - - def __init__(self): - abstractL10nTool.__init__(self) - - def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): - # Special handling for en-US files - if lang == "en-US": - mod_outputfilename = outputfilename.replace("_en-US",'') - #print "DBG: merge_file lang " + lang +" file " + mod_outputfilename - self.copy_file(inputfilename, mod_outputfilename) - return - - # merge usual lang - sdfline = self.prepare_sdf_line(inputfilename,lang) - if sdfdata.has_key(sdfline.get_id()): - line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n') - self.make_dirs(outputfilename) - try: - #print "DBG: merge_file lang " + lang +" file " + outputfilename - f = open(outputfilename, "w+") - f.write(line) - except IOError: - print "ERROR: Can not write file " + outputfilename - sys.exit(-1) - else: - f.close() - return - - # no sdf data found then copy en-US source file - if is_forced_lang: - #print "DBG: merge_file lang " + lang +" file " + outputfilename - self.copy_file(inputfilename, outputfilename) - - def copy_file(self, inputfilename, outputfilename): - try: - #print "DBG: copy " + inputfilename + " to " + outputfilename - shutil.copy(inputfilename, outputfilename) - except IOError: - print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'" - sys.exit(-1) - - ##### Extract a single File - def extract_file(self, inputfile): - lines = [] - try: - f = open(inputfile, "r") - lines = f.readlines() - except IOError: - print "ERROR: Can not open file " + inputfile - sys.exit(-1) - else: - f.close() - # remove legal header - lines = [line for line in lines if len(line) > 0 and not line[0] == '#'] - # escape all returns - lines = [line.replace('\n', "\\n") for line in lines] - line = ''.join(lines) - sdf_entity = self.prepare_sdf_line(inputfile); - sdf_entity.text = line - return str(sdf_entity) - - ##### Nameing scheme for the output files - def get_outputfile_format_str(self): - # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path - return "{path}/{fileNoExt}_{language}.{extension}" - - def prepare_sdf_line(self, inputfile="", lang=""): - if lang == "": - lang = self._source_language - return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), - resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") - -run = xtxex() -- cgit From ecde3e0e683f5969e8a770c0ec0634459b257778 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Tue, 13 Jul 2010 18:57:19 +0200 Subject: jl154 #162868# unopkg is back in packaging and installation --- setup_native/scripts/admin.pl | 7 ++ setup_native/source/packinfo/packinfo_office.txt | 33 ++++++ .../source/packinfo/shellscripts_extensions.txt | 129 +++------------------ 3 files changed, 56 insertions(+), 113 deletions(-) diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index 49b36fbe2f2d..2e16c7c89c5b 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -1094,6 +1094,13 @@ sub register_extensions_sync { my ($unopkgfile, $localtemppath) = @_; + if ( $bundleddir eq "" ) + { + my $logtext = "ERROR: Failed to determine directory \"bundled\" in \"presets\" folder for extension registration! Please check your installation set."; + print $logtext . "\n"; + exit_program($logtext); + } + my $from = cwd(); my $path = $unopkgfile; diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt index 903e1834e764..fb04b347fcdf 100755 --- a/setup_native/source/packinfo/packinfo_office.txt +++ b/setup_native/source/packinfo/packinfo_office.txt @@ -477,6 +477,7 @@ End Start module = "gid_Module_Root_Extension_Oooimprovement" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-oooimprovement" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-oooimprovement" @@ -492,6 +493,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Af" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-af" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-af" @@ -507,6 +509,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Ca" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-ca" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-ca" @@ -522,6 +525,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Cs" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-cs" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-cs" @@ -537,6 +541,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Da" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-da" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-da" @@ -552,6 +557,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_De_AT" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-de-AT" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-de-AT" @@ -567,6 +573,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_De_CH" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-de-CH" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-de-CH" @@ -582,6 +589,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_De_DE" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-de-DE" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-de-DE" @@ -597,6 +605,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_En" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-en" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-en" @@ -612,6 +621,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Es" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-es" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-es" @@ -627,6 +637,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Et" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-et" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-et" @@ -642,6 +653,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Fr" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-fr" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-fr" @@ -657,6 +669,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Gl" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-gl" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-dict-gl" @@ -672,6 +685,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_He" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-he" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-he" @@ -687,6 +701,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Hu" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-hu" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-hu" @@ -702,6 +717,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_It" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-it" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-it" @@ -717,6 +733,7 @@ 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" @@ -732,6 +749,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Lt" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-lt" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-lt" @@ -747,6 +765,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Ne" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-ne" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-ne" @@ -762,6 +781,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Nl" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-nl" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-nl" @@ -777,6 +797,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_No" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-no" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-no" @@ -792,6 +813,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Pl" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pl" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pl" @@ -807,6 +829,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Pt" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt" @@ -822,6 +845,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Ro" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-ro" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-ro" @@ -837,6 +861,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Ru" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-ru" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-ru" @@ -852,6 +877,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Sk" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-sk" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-sk" @@ -867,6 +893,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Sl" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-sl" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-sl" @@ -882,6 +909,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Sr" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-sr" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-sr" @@ -897,6 +925,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Sv" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-sv" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-sv" @@ -912,6 +941,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Sw" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-sw" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-sw" @@ -927,6 +957,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Th" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-th" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-th" @@ -942,6 +973,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Vi" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-vi" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-dict-vi" @@ -957,6 +989,7 @@ End Start module = "gid_Module_Root_Extension_Dictionary_Zu" +script = "shellscripts_extensions.txt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-zu" 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%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-zu" diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index 424962e3d874..8cff03191a70 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -27,7 +27,7 @@ fi # DISKLESS_SRVC=`echo $$BASEDIR | /usr/bin/grep export/Solaris_[1-9][0-9]/usr_$${ARCH}.all` if [ "$$DISKLESS_SRVC" ]; then - UNOPKG=/export/Solaris_11/usr_`uname -p`.all/opt/staroffice9/program/unopkg + UNOPKG=/export/Solaris_11/usr_`uname -p`.allPRODUCTDIRECTORYNAME/program/unopkg POSTRUN=$$PKG_INSTALL_ROOT/usr_`uname -p`.all/usr/lib/postrun CLIENT_BASEDIR=$$PKG_INSTALL_ROOT/usr_$${ARCH}.all else @@ -38,18 +38,18 @@ fi if [ -x $$POSTRUN ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" add --shared --suppress-license --bundled \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" ) | $$POSTRUN -b -c UNOPKG if [ "$$?" != "0" ]; then - echo "\nERROR: Installation of UNO extension ${OXTFILENAME}" + echo "\nERROR: Installation of UNO extensions" echo " through $$POSTRUN failed." exit 1 fi else # No postrun available, try running unopkg directly - "$$UNOPKG" add --shared --suppress-license --bundled "$$BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then - echo "\nERROR: Installation of UNO extension ${OXTFILENAME} failed." + echo "\nERROR: Installation of UNO extensions failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed" echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.' exit 1 @@ -63,7 +63,7 @@ fi exit 0 END -%preremove << END +%postremove << END if [ -n "$$TMPDIR" ]; then UNOPKGTMP="$$TMPDIR" elif [ -n "$$TMP" ]; then @@ -89,15 +89,15 @@ if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\"" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" remove --shared --bundled \"${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" echo "rm -rf \"$$INSTDIR\"" ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG else # No postrun available, try running unopkg directly test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0 - "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then - echo "\nERROR: Removal of UNO extension ${OXTFILENAME} failed." + echo "\nERROR: Removal of UNO extension failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed" echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.' exit 1 @@ -115,44 +115,6 @@ END %format rpm -# As remove does not need the oxt file, this could potentially -# be done in the postinstall script as well. -%preinstall << END -# if this is an update, remove the old package instance first -test "$$1" = "2" || exit 0 - -#Find the temp dir -if [ -n "$$TMPDIR" ]; then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ]; then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ]; then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - -#Create the command which creates a temporary directory -if [ -x "/bin/mktemp" ] -then - INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi - -if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' -fi - -if [ -n "$$INSTDIR" ]; then - rm -rf "$$INSTDIR" -fi - -exit 0 -END - %postinstall << END #Find the temp dir if [ -n "$$TMPDIR" ]; then @@ -176,7 +138,7 @@ else fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" add --shared --suppress-license --shared "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ]; then @@ -185,13 +147,9 @@ fi exit 0 - END -%preremove << END -# if this is an update, just do nothing -test "$$1" = "0" || exit 0 - +%postremove << END #Find the temp dir if [ -n "$$TMPDIR" ]; then UNOPKGTMP="$$TMPDIR" @@ -214,7 +172,7 @@ else fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ]; then @@ -226,53 +184,6 @@ END %format deb -# As remove does not need the oxt file, this could potentially -# be done in the postinstall script as well. -%preinstall << END -# if this is an update, remove the old package instance first -if [ "$$1" != "upgrade" ] -then - exit 0 -fi - -#Find the temp dir -if [ -n "$$TMPDIR" ] -then - UNOPKGTMP="$$TMPDIR" -elif [ -n "$$TMP" ] -then - UNOPKGTMP="$$TMP" -elif [ -d "/tmp" ] -then - UNOPKGTMP="/tmp" -else - echo "No tmp directory found!" - exit 1 -fi - - -#Create the command which creates a temporary directory -if [ -x "/bin/mktemp" ] -then - INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"` -else - INSTDIR="$${UNOPKGTMP}/userinstall.$$$$" - mkdir "$$INSTDIR" -fi - -if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ] -then - "PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' -fi - -if [ -n "$$INSTDIR" ] -then - rm -rf "$$INSTDIR" -fi - -exit 0 -END - %postinstall << END #Find the temp dir if [ -n "$$TMPDIR" ] @@ -299,7 +210,7 @@ else fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "PRODUCTDIRECTORYNAME/program/unopkg" add --shared --suppress-license --bundled "PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ] @@ -309,18 +220,10 @@ fi exit 0 - END -%preremove << END -# if this is an update, just do nothing - -if [ "$$1" = "upgrade" ] -then - exit 0 -fi - -#Find the temp dir +%postremove << END +# Find the temp dir if [ -n "$$TMPDIR" ] then UNOPKGTMP="$$TMPDIR" @@ -346,7 +249,7 @@ fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ] then - "PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ] -- cgit From c8505273af04f35d0ff69f2c38f098d77a18f0b7 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 14 Jul 2010 09:23:58 +0200 Subject: jl154 #162868# windows custom action for running unopkg sync --- .../win32/customactions/languagepacks/exports.dxp | 3 +- .../source/win32/customactions/patch/exports.dxp | 2 + .../source/win32/customactions/patch/makefile.mk | 1 + .../shellextensions/registerextensions.cxx | 196 +++------------------ 4 files changed, 29 insertions(+), 173 deletions(-) diff --git a/setup_native/source/win32/customactions/languagepacks/exports.dxp b/setup_native/source/win32/customactions/languagepacks/exports.dxp index 7461090d7233..c098a38d547f 100644 --- a/setup_native/source/win32/customactions/languagepacks/exports.dxp +++ b/setup_native/source/win32/customactions/languagepacks/exports.dxp @@ -3,5 +3,4 @@ RegisterLanguagePack GetUserInstallMode IsOfficeRunning RegisterExtensions -DeregisterExtensions -RemoveExtensions + diff --git a/setup_native/source/win32/customactions/patch/exports.dxp b/setup_native/source/win32/customactions/patch/exports.dxp index b57f2838bf34..dd5eb4dcf7c8 100755 --- a/setup_native/source/win32/customactions/patch/exports.dxp +++ b/setup_native/source/win32/customactions/patch/exports.dxp @@ -7,3 +7,5 @@ IsOfficeRunning SetFeatureState SetNewFeatureState ShowOnlineUpdateDialog +RegisterExtensions +RemoveExtensions diff --git a/setup_native/source/win32/customactions/patch/makefile.mk b/setup_native/source/win32/customactions/patch/makefile.mk index cb8733de20b6..57705389248f 100755 --- a/setup_native/source/win32/customactions/patch/makefile.mk +++ b/setup_native/source/win32/customactions/patch/makefile.mk @@ -76,6 +76,7 @@ SHL1OBJS = $(SLOFILES) \ $(SLO)$/shutdown_quickstart.obj \ $(SLO)$/quickstarter.obj \ $(SLO)$/upgrade.obj \ + $(SLO)$/registerextensions.obj \ $(SLO)$/seterror.obj SHL1TARGET = $(TARGET) diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index 3906d2584fd1..001b99c02fa3 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -319,203 +319,57 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) { std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ); std::_tstring sUnoPkgFile = sInstDir + TEXT("program\\unopkg.exe"); - std::_tstring sShareInstallDir = sInstDir + TEXT("share\\extension\\install\\"); - std::_tstring sPattern = sShareInstallDir + TEXT("*.oxt"); std::_tstring mystr; WIN32_FIND_DATA aFindFileData; mystr = "unopkg file: " + sUnoPkgFile; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - - mystr = "oxt file directory: " + sShareInstallDir; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); + MessageBox(NULL, mystr.c_str(), "Command", MB_OK); // Find unopkg.exe - HANDLE hFindUnopkg = FindFirstFile( sUnoPkgFile.c_str(), &aFindFileData ); if ( hFindUnopkg != INVALID_HANDLE_VALUE ) { // unopkg.exe exists in program directory - // Finding all oxt files in sShareInstallDir - - HANDLE hFindOxt = FindFirstFile( sPattern.c_str(), &aFindFileData ); - - if ( hFindOxt != INVALID_HANDLE_VALUE ) - { - bool fNextFile = false; - - do - { - const std::_tstring sTempFolder(createTempFolder()); - std::_tstring sOxtFile = sShareInstallDir + aFindFileData.cFileName; - std::_tstring sCommandPart1 = sUnoPkgFile + " add --shared --suppress-license --bundled " + "\"" + sOxtFile + "\""; - std::_tstring sCommand = sCommandPart1 - + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml") - + TEXT(" -env:UserInstallation=") + sTempFolder; - mystr = "Command: " + sCommand; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - - DWORD exitCode = 0; - bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); - // unopkg in OOo 2.2.1 and early had a bug that it failed when receiving - // a bootstrap parameter (-env:...) then it exited with a value != 0. - if (fSuccess && exitCode != 0) - { - std::_tstring sCommand = sCommandPart1; - mystr = "Command: " + sCommand; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); - } - deleteTempFolder(sTempFolder); - - // if ( fSuccess ) - // { - // mystr = "Executed successfully!"; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - // } - // else - // { - // mystr = "An error occured during execution!"; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - // } - - fNextFile = FindNextFile( hFindOxt, &aFindFileData ); - - } while ( fNextFile ); - - FindClose( hFindOxt ); - } - } - // else - // { - // mystr = "Error: Did not find " + sUnoPkgFile; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - // } - - return ERROR_SUCCESS; -} - -extern "C" UINT __stdcall DeregisterExtensions(MSIHANDLE handle) -{ - std::_tstring mystr; - - // Finding the product with the help of the propery FINDPRODUCT, - // that contains a Windows Registry key, that points to the install location. + const std::_tstring sTempFolder(createTempFolder()); + std::_tstring sCommandPart1 = sUnoPkgFile + " sync"; + std::_tstring sCommand = sCommandPart1 + + TEXT(" -env:BUNDLED_EXTENSIONS_USER=$OOO_BASE_DIR/presets/bundled") + + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml") + + TEXT(" -env:UserInstallation=") + sTempFolder; + mystr = "Command: " + sCommand; + MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - TCHAR szValue[8192]; - DWORD nValueSize = sizeof(szValue); - HKEY hKey; - std::_tstring sInstDir; + DWORD exitCode = 0; + bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); - std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") ); - // MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK ); + deleteTempFolder(sTempFolder); - if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) ) - { - if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) ) + if ( fSuccess ) { - sInstDir = szValue; + mystr = "Executed successfully!"; + MessageBox(NULL, mystr.c_str(), "Command", MB_OK); } - RegCloseKey( hKey ); - } - else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) ) - { - if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) ) + else { - sInstDir = szValue; + mystr = "An error occured during execution!"; + MessageBox(NULL, mystr.c_str(), "Command", MB_OK); } - RegCloseKey( hKey ); + + FindClose( hFindUnopkg ); } else { - return ERROR_SUCCESS; + mystr = "Error: Did not find " + sUnoPkgFile; + MessageBox(NULL, mystr.c_str(), "Command", MB_OK); } - // MessageBox( NULL, sInstDir.c_str(), "install location", MB_OK ); - - // Searching for the unopkg.exe - - std::_tstring sUnoPkgFile = sInstDir + TEXT("program\\unopkg.exe"); - std::_tstring sShareInstallDir = sInstDir + TEXT("share\\extension\\install\\"); - std::_tstring sPattern = sShareInstallDir + TEXT("*.oxt"); - - WIN32_FIND_DATA aFindFileData; - - // Find unopkg.exe - - HANDLE hFindUnopkg = FindFirstFile( sUnoPkgFile.c_str(), &aFindFileData ); - - if ( hFindUnopkg != INVALID_HANDLE_VALUE ) - { - // unopkg.exe exists in program directory - - // Finding all oxt files in sShareInstallDir - - HANDLE hFindOxt = FindFirstFile( sPattern.c_str(), &aFindFileData ); - - if ( hFindOxt != INVALID_HANDLE_VALUE ) - { - bool fNextFile = false; - - do - { - const std::_tstring sTempFolder(createTempFolder()); - // When removing extensions, only the oxt file name is required, without path - // Therefore no quoting is required - // std::_tstring sOxtFile = sShareInstallDir + aFindFileData.cFileName; - std::_tstring sOxtFile = aFindFileData.cFileName; - std::_tstring sCommandPart1 = sUnoPkgFile + " remove --shared --bundled " + "\"" - + sOxtFile + "\""; - std::_tstring sCommand = sCommandPart1 - + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml") - + TEXT(" -env:UserInstallation=") + sTempFolder; - - mystr = "Command: " + sCommand; - //MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - DWORD exitCode = 0; - bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); - // unopkg in OOo 2.2.1 and early had a bug that it failed when receiving - // a bootstrap parameter (-env:...) then it exited with a value != 0. - if (fSuccess && exitCode != 0) - { - std::_tstring sCommand = sCommandPart1; - mystr = "Command: " + sCommand; - //MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); - } - - deleteTempFolder(sTempFolder); - - if ( fSuccess ) - { - mystr = "Executed successfully!"; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - } - else - { - mystr = "An error occured during execution!"; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - } - - fNextFile = FindNextFile( hFindOxt, &aFindFileData ); - - } while ( fNextFile ); - - FindClose( hFindOxt ); - } - } - // else - // { - // mystr = "Not found: " + sUnoPkgFile; - // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - // } - return ERROR_SUCCESS; } + extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle) { std::_tstring mystr; @@ -552,9 +406,9 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle) return ERROR_SUCCESS; } - // Removing complete directory "share\uno_packages\cache" + // Removing complete directory "Basis\presets\bundled" - std::_tstring sCacheDir = sInstDir + TEXT("share\\uno_packages\\cache"); + std::_tstring sCacheDir = sInstDir + TEXT("Basis\\presets\\bundled"); bool fSuccess = RemoveCompleteDirectory( sCacheDir ); -- cgit From 7bb8a22407ca8cce2a23bfbdda12319ece6e1928 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Wed, 14 Jul 2010 11:10:14 +0200 Subject: jl154 #162868# unopkg is back in packaging and installation --- setup_native/source/win32/customactions/shellextensions/exports.dxp | 1 - 1 file changed, 1 deletion(-) diff --git a/setup_native/source/win32/customactions/shellextensions/exports.dxp b/setup_native/source/win32/customactions/shellextensions/exports.dxp index cafa011057c9..8194ddc8b9c5 100644 --- a/setup_native/source/win32/customactions/shellextensions/exports.dxp +++ b/setup_native/source/win32/customactions/shellextensions/exports.dxp @@ -7,7 +7,6 @@ RebuildShellIconCache ExecutePostUninstallScript MigrateInstallPath RegisterExtensions -DeregisterExtensions RemoveExtensions CheckInstallDirectory SetAdminInstallProperty -- cgit From 1994888550bf52767e668d3b7f08fb01204e764c Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 14 Jul 2010 14:09:08 +0200 Subject: jl154: #162868# Added sync code to improve startup time with bundled extensions --- desktop/source/app/app.cxx | 220 +++++++++++++++++++++++++++++++++++++ desktop/source/app/userinstall.cxx | 6 +- desktop/source/app/userinstall.hxx | 2 + 3 files changed, 227 insertions(+), 1 deletion(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 7e78d7e43ec2..01c07b9d3e4a 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -122,6 +122,7 @@ #include #include #include +#include #include #include #include @@ -468,6 +469,208 @@ void ReplaceStringHookProc( UniString& rStr ) } } +static const char pPresetsFolder[] = "presets"; +static const char pBundledFolder[] = BUNDLED_FOLDER_NAME; +static const char pLastSyncFileName[] = "lastsynchronized"; +static const sal_Int32 nStrLenLastSync = 16; + +static bool needsSynchronization( + ::rtl::OUString const & baseSynchronizedURL, ::rtl::OUString const & userSynchronizedURL ) +{ + bool bNeedsSync( false ); + + ::osl::DirectoryItem itemUserFile; + ::osl::File::RC err1 = + ::osl::DirectoryItem::get(userSynchronizedURL, itemUserFile); + + //If it does not exist, then there is nothing to be done + if (err1 == ::osl::File::E_NOENT) + { + return true; + } + else if (err1 != ::osl::File::E_None) + { + OSL_ENSURE(0, "Cannot access lastsynchronized in user layer"); + return true; //sync just in case + } + + //If last synchronized does not exist in base layer, then do nothing + ::osl::DirectoryItem itemBaseFile; + ::osl::File::RC err2 = ::osl::DirectoryItem::get(baseSynchronizedURL, itemBaseFile); + if (err2 == ::osl::File::E_NOENT) + { + return true; + + } + else if (err2 != ::osl::File::E_None) + { + OSL_ENSURE(0, "Cannot access file lastsynchronized in base layer"); + return true; //sync just in case + } + + //compare the modification time of the extension folder and the last + //modified file + ::osl::FileStatus statUser(FileStatusMask_ModifyTime); + ::osl::FileStatus statBase(FileStatusMask_ModifyTime); + if (itemUserFile.getFileStatus(statUser) == ::osl::File::E_None) + { + if (itemBaseFile.getFileStatus(statBase) == ::osl::File::E_None) + { + TimeValue timeUser = statUser.getModifyTime(); + TimeValue timeBase = statBase.getModifyTime(); + + if (timeUser.Seconds < timeBase.Seconds) + bNeedsSync = true; + } + else + { + OSL_ASSERT(0); + bNeedsSync = true; + } + } + else + { + OSL_ASSERT(0); + bNeedsSync = true; + } + + return bNeedsSync; +} + +static ::rtl::OUString getBasePresetsPathURL() +{ + ::rtl::OUString aBaseInstallURL; + ::utl::Bootstrap::PathStatus aBaseInstallStatus = ::utl::Bootstrap::locateBaseInstallation( aBaseInstallURL ); + + if ( aBaseInstallStatus == ::utl::Bootstrap::PATH_EXISTS ) + { + ::rtl::OUStringBuffer aTmp( aBaseInstallURL ); + ::sal_uInt32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); + + if ( nLastIndex != aBaseInstallURL.getLength()-1 ) + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pPresetsFolder ); + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pBundledFolder ); + aBaseInstallURL = aTmp.makeStringAndClear(); + } + + return aBaseInstallURL; +} + +static ::rtl::OUString getUserBundledExtPathURL() +{ + ::rtl::OUString folder( RTL_CONSTASCII_USTRINGPARAM( "$BUNDLED_EXTENSIONS_USER" )); + ::rtl::Bootstrap::expandMacros(folder); + + return folder; +} + +static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() +{ + ::rtl::OUString aBasePresetPathURL = getBasePresetsPathURL(); + ::sal_uInt32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); + + ::rtl::OUStringBuffer aTmp( aBasePresetPathURL ); + + if ( nLastIndex != aBasePresetPathURL.getLength()-1 ) + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pLastSyncFileName ); + + return aTmp.makeStringAndClear(); +} + +static ::rtl::OUString getLastSyncFileURLFromUserInstallation() +{ + ::rtl::OUString aUserBundledPathURL = getUserBundledExtPathURL(); + ::sal_uInt32 nLastIndex = aUserBundledPathURL.lastIndexOf('/'); + + ::rtl::OUStringBuffer aTmp( aUserBundledPathURL ); + + if ( nLastIndex != aUserBundledPathURL.getLength()-1 ) + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pLastSyncFileName ); + + return aTmp.makeStringAndClear(); +} + +static osl::FileBase::RC copy_bundled_recursive( + const rtl::OUString& srcUnqPath, + const rtl::OUString& dstUnqPath, + sal_Int32 TypeToCopy ) +throw() +{ + osl::FileBase::RC err = osl::FileBase::E_None; + + if( TypeToCopy == -1 ) // Document + { + err = osl::File::copy( srcUnqPath,dstUnqPath ); + } + else if( TypeToCopy == +1 ) // Folder + { + osl::Directory aDir( srcUnqPath ); + aDir.open(); + + err = osl::Directory::create( dstUnqPath ); + osl::FileBase::RC next = err; + if( err == osl::FileBase::E_None || + err == osl::FileBase::E_EXIST ) + { + err = osl::FileBase::E_None; + sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type; + + osl::DirectoryItem aDirItem; + + while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None ) + { + sal_Bool IsDoc = false; + sal_Bool bFilter = false; + osl::FileStatus aFileStatus( n_Mask ); + aDirItem.getFileStatus( aFileStatus ); + if( aFileStatus.isValid( FileStatusMask_Type ) ) + IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular; + + // Getting the information for the next recursive copy + sal_Int32 newTypeToCopy = IsDoc ? -1 : +1; + + rtl::OUString newSrcUnqPath; + if( aFileStatus.isValid( FileStatusMask_FileURL ) ) + newSrcUnqPath = aFileStatus.getFileURL(); + + rtl::OUString newDstUnqPath = dstUnqPath; + rtl::OUString tit; + if( aFileStatus.isValid( FileStatusMask_FileName ) ) + { + ::rtl::OUString aFileName = aFileStatus.getFileName(); + tit = rtl::Uri::encode( aFileName, + rtl_UriCharClassPchar, + rtl_UriEncodeIgnoreEscapes, + RTL_TEXTENCODING_UTF8 ); + + // Special treatment for "lastsychronized" file. Must not be + // copied from the bundled folder! + if ( IsDoc && aFileName.equalsAscii( pLastSyncFileName )) + bFilter = true; + } + + if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 ) + newDstUnqPath += rtl::OUString::createFromAscii( "/" ); + + newDstUnqPath += tit; + + if (( newSrcUnqPath != dstUnqPath ) && !bFilter ) + err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy ); + } + + if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT ) + err = next; + } + aDir.close(); + } + + return err; +} + Desktop::Desktop() : m_bServicesRegistered( false ) , m_aBootstrapError( BE_OK ) @@ -485,6 +688,23 @@ void Desktop::Init() RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" ); SetBootstrapStatus(BS_OK); + // Check for lastsynchronized file for bundled extensions in the user directory + // and test if synchronzation is necessary! + { + ::rtl::OUString aUserLastSyncFilePathURL = getLastSyncFileURLFromUserInstallation(); + ::rtl::OUString aBaseLastSyncFilePathURL = getLastSyncFileURLFromBaseInstallation(); + + if ( needsSynchronization( aBaseLastSyncFilePathURL, aUserLastSyncFilePathURL )) + { + rtl::OUString aUserPath = getUserBundledExtPathURL(); + rtl::OUString aBasePresetsBundledPath = getBasePresetsPathURL(); + + // copy bundled folder to the user directory + osl::FileBase::RC rc = osl::Directory::createPath(aUserPath); + copy_bundled_recursive( aBasePresetsBundledPath, aUserPath, +1 ); + } + } + // create service factory... Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager(); if( rSMgr.is() ) diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx index 546a6f0ad13c..0a31bed791ec 100644 --- a/desktop/source/app/userinstall.cxx +++ b/desktop/source/app/userinstall.cxx @@ -207,8 +207,12 @@ namespace desktop { if (newDstUnqPath.lastIndexOf(sal_Unicode('/')) != newDstUnqPath.getLength()-1) newDstUnqPath += rtl::OUString::createFromAscii("/"); newDstUnqPath += itemname; + // recursion - err = copy_recursive(newSrcUnqPath, newDstUnqPath); + // Filer out bundled folder which is treated by a special + // implementation. + if ( !itemname.equalsAscii( BUNDLED_FOLDER_NAME )) + err = copy_recursive(newSrcUnqPath, newDstUnqPath); } aDir.close(); diff --git a/desktop/source/app/userinstall.hxx b/desktop/source/app/userinstall.hxx index 8d6a51cd66be..8a8740eaa28b 100644 --- a/desktop/source/app/userinstall.hxx +++ b/desktop/source/app/userinstall.hxx @@ -29,6 +29,8 @@ #include #include +#define BUNDLED_FOLDER_NAME "bundled" + namespace desktop { -- cgit From 68eea8200bde2d0d7228579b3eefe01451ff0ddd Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 14 Jul 2010 15:17:57 +0200 Subject: jl154 #162868# removing registration data folder if the last extension was removed --- desktop/source/deployment/manager/dp_manager.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 44bc4d469f2f..f42940d5c21b 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -949,6 +949,15 @@ void PackageManagerImpl::removePackage( contentRemoved.writeStream( xData, true /* replace existing */ ); } m_activePackagesDB->erase( id, fileName ); // to be removed upon next start + //Remove the database folder (user installation) completely if this was + //the last extension. Do not do this for tmp because it is used often + ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); + if (id2temp.size() && !m_context.equals(OUSTR("tmp"))) + { + erase_path( m_registrationData, + Reference(), + false /* no throw: ignore errors */ ); + } } try_dispose( xPackage ); -- cgit From 79984799a19156dd63393bf3533f7b9bf6b597e6 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 14 Jul 2010 15:17:57 +0200 Subject: jl154 #162868# removing registration data folder if the last extension was removed --- .../shellextensions/registerextensions.cxx | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index 001b99c02fa3..359b300bdba3 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -324,7 +324,7 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) WIN32_FIND_DATA aFindFileData; mystr = "unopkg file: " + sUnoPkgFile; - MessageBox(NULL, mystr.c_str(), "Command", MB_OK); + //MessageBox(NULL, mystr.c_str(), "Command", MB_OK); // Find unopkg.exe HANDLE hFindUnopkg = FindFirstFile( sUnoPkgFile.c_str(), &aFindFileData ); @@ -340,31 +340,31 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml") + TEXT(" -env:UserInstallation=") + sTempFolder; mystr = "Command: " + sCommand; - MessageBox(NULL, mystr.c_str(), "Command", MB_OK); + //MessageBox(NULL, mystr.c_str(), "Command", MB_OK); DWORD exitCode = 0; bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); deleteTempFolder(sTempFolder); - if ( fSuccess ) - { - mystr = "Executed successfully!"; - MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - } - else - { - mystr = "An error occured during execution!"; - MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - } +// if ( fSuccess ) +// { +// mystr = "Executed successfully!"; +// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); +// } +// else +// { +// mystr = "An error occured during execution!"; +// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); +// } FindClose( hFindUnopkg ); } - else - { - mystr = "Error: Did not find " + sUnoPkgFile; - MessageBox(NULL, mystr.c_str(), "Command", MB_OK); - } +// else +// { +// mystr = "Error: Did not find " + sUnoPkgFile; +// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); +// } return ERROR_SUCCESS; } @@ -383,7 +383,7 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle) std::_tstring sInstDir; std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") ); - // MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK ); + //MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK ); if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) ) { @@ -412,16 +412,16 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle) bool fSuccess = RemoveCompleteDirectory( sCacheDir ); - if ( fSuccess ) - { - mystr = "Executed successfully!"; - // MessageBox(NULL, mystr.c_str(), "Main methode", MB_OK); - } - else - { - mystr = "An error occured during execution!"; - // MessageBox(NULL, mystr.c_str(), "Main methode", MB_OK); - } +// if ( fSuccess ) +// { +// mystr = "Executed successfully!"; +// MessageBox(NULL, mystr.c_str(), "Main methode", MB_OK); +// } +// else +// { +// mystr = "An error occured during execution!"; +// MessageBox(NULL, mystr.c_str(), "Main methode", MB_OK); +// } return ERROR_SUCCESS; } -- cgit From 31236973b376567a7acf33962385329855f89665 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 16:59:49 +0200 Subject: txtl10n: #i113008# #i113125# Python 2.3.x compatible --- l10ntools/scripts/tool/l10ntool.py | 20 ++-- l10ntools/scripts/tool/pseudo.py | 184 +++++++++++++++++++++++++++++++++++++ l10ntools/scripts/tool/sdf.py | 65 +------------ l10ntools/scripts/tool/xhtex.py | 1 + 4 files changed, 202 insertions(+), 68 deletions(-) create mode 100644 l10ntools/scripts/tool/pseudo.py diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py index 66afc309a1fb..42e8a6b4e428 100644 --- a/l10ntools/scripts/tool/l10ntool.py +++ b/l10ntools/scripts/tool/l10ntool.py @@ -27,6 +27,8 @@ from optparse import OptionParser from sdf import SdfData +from pseudo import PseudoSet + import sys import os import shutil @@ -68,9 +70,15 @@ class abstractL10nTool: def format_outputfile(self, filename, language): extension = filename[filename.rfind('.')+1:] file = filename[:filename.rfind('.')] - return self.get_outputfile_format_str().replace('[', '{').replace(']','}').format( - filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, - path_postfix=self._options.path_postfix, path=self.get_path()) + + # Python 2.3.x friendly + return self.get_outputfile_format_str().replace('[', '%(').replace(']',')s') % \ + { 'filename': filename, 'fileNoExt': file, 'language': language, 'extension': extension, 'path_prefix': self._options.path_prefix, + 'path_postfix': self._options.path_postfix, 'path': self.get_path() } + + #return self.get_outputfile_format_str().replace('[', '{').replace(']','}').format( + # filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix, + # path_postfix=self._options.path_postfix, path=self.get_path()) def get_path(self): if self._options.outputfile.find('/') == -1: @@ -79,12 +87,12 @@ class abstractL10nTool: return self._options.outputfile[:self._options.outputfile.rfind('/')] def merge(self, sdfdata): - langset,forcedset, foundset = set(), set() , set() + langset,forcedset, foundset = PseudoSet(), PseudoSet() , PseudoSet() if self._options.languages: - langset = set(self._options.languages) + langset = PseudoSet(self._options.languages) if self._options.forcedlanguages: - forcedset = set(self._options.forcedlanguages) + forcedset = PseudoSet(self._options.forcedlanguages) if sdfdata.get_languages_found_in_sdf(): foundset = sdfdata.get_languages_found_in_sdf() diff --git a/l10ntools/scripts/tool/pseudo.py b/l10ntools/scripts/tool/pseudo.py new file mode 100644 index 000000000000..ee23b22f4e79 --- /dev/null +++ b/l10ntools/scripts/tool/pseudo.py @@ -0,0 +1,184 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# to support macosx baseline machines from Cretaceous period + +# incomplete set() class implementation of Python 2.4 +class PseudoSet: + _list = [] + + def __str__(self): + return str(self._list) + + def __init__(self, newlist=[]): + self._list = self._remove_dupes(newlist) + + def __or__(self, other): + tmplist = [] + if self._list != None and other != None: + tmplist.extend(self._list) + tmplist.extend(other) + return PseudoSet(self._remove_dupes(tmplist)) + else: + print "__or__(None)" + + def __sub__(self,other): + tmplist = [] + if self._list != None and other != None: + tmplist.extend(self._list) + [tmplist.remove(key) for key in other if key in tmplist] + else: + print __sub__(none) + return PseudoSet(tmplist) + + def __and__(self, other): + tmplist = [] + if other != None and self._list != None: + [tmplist.append(key) for key in self._list if key in other] + return PseudoSet(tmplist) + else: + print "__and__(None)" + + def __iter__(self): + return self._list.__iter__() + + def __items__(self): + return self._list.items() + + def __keys__(self): + return keys(self._list) + + def _remove_dupes(self, list): + tmpdict = {} + for key in list: + tmpdict[key] = 1 + return tmpdict.keys() + +# incomplete OrderedDict() class implementation +class PseudoOrderedDict(dict): + _keylist = [] + _valuelist = [] + + def __init__(self, defaults={}): + dict.__init__(self) + for n,v in defaults.items(): + self[n] = v + + def __setitem__(self, key, value): + self._keylist.append(key) + self._valuelist.append(value) + return dict.__setitem__(self, key, value) + + def __delattr__(self, key): + self._keylist.__delattr__(key) + self._valuelist.__delattr__(dict[key]) + return dict.__delattr__(self, key) + + def __delitem__(self, key): + self._keylist.__delitem__(key) + self._valuelist.__delitem__(dict[key]) + return dict.__delitem__(self, key) + + def __iter__(self): + raise NotImplementedError("__iter__") + + def __iterkeys__(self): + return self._keylist + + def iteritems(self): + #return self._valuelist + return zip(self._keylist, self._valuelist) + + def items(self): + return zip(self._keylist,self._valuelist) + + def __keys__(self): + return self._keylist + + def keys(self): + return self._keylist + + def __keysattr__(self): + return self._keylist + + def pop(self, key): + self._keylist.pop(key) + self._valuelist.pop(key) + return dict.__pop__(self, key) + + def popitem(self): + raise NotImplementedError("popitem") + +def _testdriver_set(): + list, list1 = [] ,[] + list.append("a") + list.append("b") + list.append("c") + + list1.append("a") + list1.append("b") + list1.append("d") + list1.append("e") + list1.append("e") + + if "a" in list: + print "YEAH!" + + a = PseudoSet(list) + b = PseudoSet(list1) + + print "a="+str(a) + print "b="+str(b) + print "a|b=" + str(a|b) + print "a="+str(a) + print "b="+str(b) + print "a&b=" + str(a&b) + print "a="+str(a) + print "b="+str(b) + print "a-b" + str(a-b) + + for key in a: + print key + +def _testdriver_dict(): + d = PseudoOrderedDict() + d["a"] = 1 + d["b"] = 2 + d["c"] = 3 + d["d"] = 4 + d["e"] = 5 + d["f"] = 6 + + print "a="+str(d["a"]) + print "e="+str(d["e"]) + for key,value in d.iteritems(): + print "d["+key+"]="+str(d[key]) + print "key="+str(key)+" value="+str(value) + + print "keys="+str(d.keys()) + +#_testdriver_dict() diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py index 33bf90b4ea68..2afcbaf4bb1f 100644 --- a/l10ntools/scripts/tool/sdf.py +++ b/l10ntools/scripts/tool/sdf.py @@ -25,70 +25,11 @@ # #************************************************************************* -class MyOrderedDict(dict): - _keylist = [] - _valuelist = [] - - def __init__(self, defaults={}): - dict.__init__(self) - for n,v in defaults.items(): - self[n] = v - - def __setitem__(self, key, value): - self._keylist.append(key) - self._valuelist.append(value) - return dict.__setitem__(self, key, value) - - def __delattr__(self, key): - self._keylist.__delattr__(key) - self._valuelist.__delattr__(dict[key]) - return dict.__delattr__(self, key) +from pseudo import PseudoSet,PseudoOrderedDict - def __delitem__(self, key): - self._keylist.__delitem__(key) - self._valuelist.__delitem__(dict[key]) - return dict.__delitem__(self, key) - - def __iter(self): - return zip(self._keylist, self._valuelist) - - def __iterkeys__(self): - return self._keylist - - def __iteritems__(self): - return self._valuelist - - def items(self): - return zip(self._keylist,self._valuelist) - - def keys(self): - return self._keylist - - def __keysattr__(self): - return self._keylist - - def pop(self, key): - self._keylist.pop(key) - self._valuelist.pop(key) - return dict.__pop__(self, key) - - def popitem(self): - raise NotImplementedError("popitem") - - def clear(self): - self._keylist.clear() - self._valuelist.clear() - return dict.clear() - - def copy(self): - newobj = MyOrderedDict(self) - newobj._keylist = self._keylist - newobj._valuelist = self._valuelist - return newobj - class SdfData: _filename = ""; - _dict = MyOrderedDict() + _dict = PseudoOrderedDict() _languages_found = []; def __init__ (self, filename=""): @@ -107,7 +48,7 @@ class SdfData: self._dict[key] = value def get_languages_found_in_sdf(self): - return set(self._languages_found) + return PseudoSet(self._languages_found) def read(self): try: diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index 99e0f39259a2..c876b9f7c2a0 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -83,6 +83,7 @@ class xhtex(abstractL10nTool): def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata): if lang == "en-US": mod_outputfilename = outputfilename.replace("_en-US",'') + self.make_dirs(mod_outputfilename) self.copy_file(inputfilename, mod_outputfilename) return dom = parsed_file_ref.cloneNode(True) -- cgit From a1b4b65e3514c8ac3c21bae04ceeccc90eb29bfa Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:00:39 +0200 Subject: txtl10n: #i113008# #i113125# Python 2.3.x compatible --- l10ntools/prj/d.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index 9594dc416c8e..53c846832fca 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -52,6 +52,7 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\tool\xtxex.py %_DEST%\bin%_EXT%\xtxex.py ..\scripts\tool\sdf.py %_DEST%\bin%_EXT%\sdf.py ..\scripts\tool\xhtex.py %_DEST%\bin%_EXT%\xhtex.py +..\scripts\tool\pseudo.py %_DEST%\bin%_EXT%\pseudo.py ..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex ..\scripts\xhtex %_DEST%\bin%_EXT%\xhtex -- cgit From f72e6b7a877f3d5326bb3c9dad53aa1913b0ed2e Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:06:23 +0200 Subject: txtl10n: #i113008# #i113125# cleanup --- l10ntools/scripts/tool/l10ntool.py | 3 +-- l10ntools/scripts/tool/xhtex.py | 8 ++++---- l10ntools/scripts/tool/xtxex.py | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py index 42e8a6b4e428..70d88674f07b 100644 --- a/l10ntools/scripts/tool/l10ntool.py +++ b/l10ntools/scripts/tool/l10ntool.py @@ -33,7 +33,7 @@ import sys import os import shutil -class abstractL10nTool: +class AbstractL10nTool: _options = {} _args = "" _resource_type = "" @@ -176,7 +176,6 @@ class abstractL10nTool: return else: try: - print "DBG: make_dir " + str(dir) os.makedirs(dir) except IOError: print "Error: Can not create dir " + dir diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index c876b9f7c2a0..ab6e1dd14631 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -25,12 +25,12 @@ # #************************************************************************* -from l10ntool import abstractL10nTool +from l10ntool import AbstractL10nTool from sdf import SdfEntity import sys import xml.dom.minidom -class xhtex(abstractL10nTool): +class Xhtex(AbstractL10nTool): _resource_type = "xht" _sdfdata = () _lang = "" @@ -65,7 +65,7 @@ class xhtex(abstractL10nTool): # L10N tool def __init__(self): - abstractL10nTool.__init__(self) + AbstractL10nTool.__init__(self) def parse_file(self, filename): document = "" @@ -130,5 +130,5 @@ class xhtex(abstractL10nTool): return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), resource_type=self._resource_type, gid=id, lid="", langid=lang,text=text) -run = xhtex() +run = Xhtex() diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py index bb11e337d37a..317fb5cc7ff0 100644 --- a/l10ntools/scripts/tool/xtxex.py +++ b/l10ntools/scripts/tool/xtxex.py @@ -25,16 +25,16 @@ # #************************************************************************* -from l10ntool import abstractL10nTool +from l10ntool import AbstractL10nTool from sdf import SdfEntity import sys import shutil -class xtxex(abstractL10nTool): +class Xtxex(AbstractL10nTool): _resource_type = "xtx" def __init__(self): - abstractL10nTool.__init__(self) + AbstractL10nTool.__init__(self) def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): # Special handling for en-US files @@ -86,4 +86,4 @@ class xtxex(abstractL10nTool): return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile), resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="") -run = xtxex() +run = Xtxex() -- cgit From 420279385334ce45af842ac28b66146029e56c83 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:08:59 +0200 Subject: txtl10n: #i113008# #i113125# cleanup --- l10ntools/scripts/tool/pseudo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/pseudo.py b/l10ntools/scripts/tool/pseudo.py index ee23b22f4e79..0956325e31db 100644 --- a/l10ntools/scripts/tool/pseudo.py +++ b/l10ntools/scripts/tool/pseudo.py @@ -52,7 +52,7 @@ class PseudoSet: tmplist.extend(self._list) [tmplist.remove(key) for key in other if key in tmplist] else: - print __sub__(none) + print "__sub__(none)" return PseudoSet(tmplist) def __and__(self, other): -- cgit From 2c40a12f3307ac3a72f6036a9a2f8939fd7b77c8 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:39:22 +0200 Subject: txtl10n: #i113008# #i113125# skip on empty string --- l10ntools/scripts/tool/xhtex.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index ab6e1dd14631..c427a7feccdd 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -39,14 +39,15 @@ class Xhtex(AbstractL10nTool): def extract_topic(self, list, inputfile): topics = [] for elem in list: - if elem.childNodes[0].nodeType == elem.TEXT_NODE: + if elem.childNodes[0].nodeType == elem.TEXT_NODE and len(elem.childNodes[0].data.strip()): topics.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.childNodes[0].data, inputfile=inputfile)) return topics def extract_title(self, list, inputfile): titles = [] for elem in list: - titles.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.getAttribute("title").strip(), inputfile=inputfile)) + if len(elem.getAttribute("title").strip()): + titles.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.getAttribute("title").strip(), inputfile=inputfile)) return titles # Merge methods -- cgit From 9edb131f425e23ea9e9645fee441975959cfd02b Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 14 Jul 2010 17:46:14 +0200 Subject: txtl10n: #i113008# #i113125# skip on empty string --- l10ntools/scripts/tool/xtxex.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py index 317fb5cc7ff0..2c5f132530a6 100644 --- a/l10ntools/scripts/tool/xtxex.py +++ b/l10ntools/scripts/tool/xtxex.py @@ -76,10 +76,14 @@ class Xtxex(AbstractL10nTool): # escape all returns lines = [line.replace('\n', "\\n") for line in lines] line = ''.join(lines) - sdf_entity = self.prepare_sdf_line(inputfile); - sdf_entity.text = line - return str(sdf_entity) - + test = str(line) + if len(test.strip()): + sdf_entity = self.prepare_sdf_line(inputfile); + sdf_entity.text = line + return str(sdf_entity) + else: + return "" + def prepare_sdf_line(self, inputfile="", lang=""): if lang == "": lang = self._source_language -- cgit From a186784b389b90d15976d84172682927080f1197 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 15 Jul 2010 15:38:43 +0200 Subject: jl154 #162868# fix warnings caused by 990df1d5ff27 --- desktop/source/app/app.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 01c07b9d3e4a..65059555ba35 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -545,7 +545,7 @@ static ::rtl::OUString getBasePresetsPathURL() if ( aBaseInstallStatus == ::utl::Bootstrap::PATH_EXISTS ) { ::rtl::OUStringBuffer aTmp( aBaseInstallURL ); - ::sal_uInt32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); + ::sal_Int32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); if ( nLastIndex != aBaseInstallURL.getLength()-1 ) aTmp.appendAscii( "/" ); @@ -569,7 +569,7 @@ static ::rtl::OUString getUserBundledExtPathURL() static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() { ::rtl::OUString aBasePresetPathURL = getBasePresetsPathURL(); - ::sal_uInt32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); + ::sal_Int32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); ::rtl::OUStringBuffer aTmp( aBasePresetPathURL ); @@ -583,7 +583,7 @@ static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() static ::rtl::OUString getLastSyncFileURLFromUserInstallation() { ::rtl::OUString aUserBundledPathURL = getUserBundledExtPathURL(); - ::sal_uInt32 nLastIndex = aUserBundledPathURL.lastIndexOf('/'); + ::sal_Int32 nLastIndex = aUserBundledPathURL.lastIndexOf('/'); ::rtl::OUStringBuffer aTmp( aUserBundledPathURL ); @@ -701,6 +701,7 @@ void Desktop::Init() // copy bundled folder to the user directory osl::FileBase::RC rc = osl::Directory::createPath(aUserPath); + (void) rc; copy_bundled_recursive( aBasePresetsBundledPath, aUserPath, +1 ); } } -- cgit From eafd07c25e04d525d726ac5427ea4f619b95daae Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 15 Jul 2010 11:11:50 +0200 Subject: jl154 #162868# undoing: removing registration data folder if the last extension was removed, which was instroduced with eaf4b98ce57a --- desktop/source/deployment/manager/dp_manager.cxx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index f42940d5c21b..44bc4d469f2f 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -949,15 +949,6 @@ void PackageManagerImpl::removePackage( contentRemoved.writeStream( xData, true /* replace existing */ ); } m_activePackagesDB->erase( id, fileName ); // to be removed upon next start - //Remove the database folder (user installation) completely if this was - //the last extension. Do not do this for tmp because it is used often - ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); - if (id2temp.size() && !m_context.equals(OUSTR("tmp"))) - { - erase_path( m_registrationData, - Reference(), - false /* no throw: ignore errors */ ); - } } try_dispose( xPackage ); -- cgit From ca2b860c30d873e6c2f0dc265c503126290faff3 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 15 Jul 2010 16:28:33 +0200 Subject: jl154 #162868# remove basis/presets/bundled/bundled.ini, and create always share/extensions folder --- setup_native/scripts/admin.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index 2e16c7c89c5b..842d57b645fb 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -43,7 +43,7 @@ BEGIN $msiinfo_available = 0; $path_displayed = 0; $localmsidbpath = ""; - $bundleddir = ""; + $presetsdir = ""; $plat = $^O; @@ -824,7 +824,7 @@ sub create_directory_tree # Create the directory my $newdir = $fulldir . $separator . $dirname; if ( ! -f $newdir ) { mkdir $newdir; } - if (( $bundleddir eq "" ) && ( $newdir =~ /\Wbundled\s*$/ )) { $bundleddir = $newdir; } + if (( $presetsdir eq "" ) && ( $newdir =~ /\Wpresets\s*$/ )) { $presetsdir = $newdir; } # Saving in collector $pathcollector->{$dir} = $newdir; # Iteration @@ -1094,9 +1094,9 @@ sub register_extensions_sync { my ($unopkgfile, $localtemppath) = @_; - if ( $bundleddir eq "" ) + if ( $presetsdir eq "" ) { - my $logtext = "ERROR: Failed to determine directory \"bundled\" in \"presets\" folder for extension registration! Please check your installation set."; + my $logtext = "ERROR: Failed to determine directory \"presets\" folder for extension registration! Please check your installation set."; print $logtext . "\n"; exit_program($logtext); } @@ -1123,10 +1123,13 @@ sub register_extensions_sync if ( $^O =~ /cygwin/i ) { $executable = "./" . $executable; - $bundleddir = qx{cygpath -m "$bundleddir"}; - chomp($bundleddir); + $presetsdir = qx{cygpath -m "$presetsdir"}; + chomp($presetsdir); } + $presetsdir =~ s/\/\s*$//g; + my $bundleddir = $presetsdir . "/bundled"; + my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file:///" . $bundleddir . "\"" . " -env:UserInstallation=file:///" . $localtemppath . " 2\>\&1 |"; print "... $systemcall\n"; -- cgit From 134ae5da1cc6a5dfa4432063f930235c1a872bc0 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 15 Jul 2010 17:22:01 +0200 Subject: jl154 #162868# remove basis/presets/bundled/bundled.ini, and create always share/extensions folder --- setup_native/source/packinfo/package.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 setup_native/source/packinfo/package.txt diff --git a/setup_native/source/packinfo/package.txt b/setup_native/source/packinfo/package.txt new file mode 100644 index 000000000000..4ec319646932 --- /dev/null +++ b/setup_native/source/packinfo/package.txt @@ -0,0 +1 @@ +DO NOT DELETE THIS FILE \ No newline at end of file -- cgit From 4c333e8ac7f6135fb4e62e4960c826b278e8cc63 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 16 Jul 2010 11:52:44 +0200 Subject: jl154 #162868# removing the package.txt from the extensions folder. Extensions folder will be created in a different way than installing a dummy file --- setup_native/source/packinfo/package.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 setup_native/source/packinfo/package.txt diff --git a/setup_native/source/packinfo/package.txt b/setup_native/source/packinfo/package.txt deleted file mode 100644 index 4ec319646932..000000000000 --- a/setup_native/source/packinfo/package.txt +++ /dev/null @@ -1 +0,0 @@ -DO NOT DELETE THIS FILE \ No newline at end of file -- cgit From 8f4cf9a16eb9936ef1e862ecdec7d30c9e240987 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Mon, 19 Jul 2010 14:23:27 +0200 Subject: jl154 #162868# guarantee existence of extensions folder --- setup_native/source/packinfo/package.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 setup_native/source/packinfo/package.txt diff --git a/setup_native/source/packinfo/package.txt b/setup_native/source/packinfo/package.txt new file mode 100644 index 000000000000..4ec319646932 --- /dev/null +++ b/setup_native/source/packinfo/package.txt @@ -0,0 +1 @@ +DO NOT DELETE THIS FILE \ No newline at end of file -- cgit From a7a69a2a901654928b90ba40202612d778126682 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 20 Jul 2010 13:11:02 +0200 Subject: txtl10n: #i113008# #i113125# rename .xht to .tree --- l10ntools/source/localize.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 420fa3a8d484..853dcc97dc3e 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -53,7 +53,7 @@ namespace transex3 const char *ExeTable[][5] = { { "src", "transex3", " -UTF8 -e", "negative", "noiso" }, { "hrc", "transex3", " -UTF8 -e", "positive", "noiso" }, - { "xht", "xhtex", "", "negative", "noiso" }, + { "tree", "xhtex", "", "negative", "noiso" }, { "xtx", "xtxex", "", "negative", "noiso" }, { "ulf", "ulfex", " -e", "negative", "noiso" }, { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, -- cgit From 3752b1f31f8ae2603c9887b348346f80c86270c6 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Tue, 20 Jul 2010 14:54:39 +0200 Subject: jl154 #i113285# fixing deadlock when starting OOo by the testtool --- desktop/source/app/app.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index d701516ac361..3ab5c6cacc88 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1704,6 +1704,13 @@ void Desktop::Main() ( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY ); + /* ensure existance of a default window that messages can be dispatched to + This is for the benefit of testtool which uses PostUserEvent extensively + and else can deadlock while creating this window from another tread while + the main thread is not yet in the event loop. + */ + Application::GetDefaultDevice(); + // initialize test-tool library (if available) RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ tools::InitTestToolLib" ); tools::InitTestToolLib(); -- cgit From 66cb95ef2af34f6d2b2723fa3221183e7c2ce206 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Wed, 21 Jul 2010 12:04:31 +0200 Subject: jl154 #162868# new share/prereg folder --- setup_native/scripts/admin.pl | 28 ++++++++++------------ .../source/packinfo/shellscripts_extensions.txt | 16 ++++++------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index 842d57b645fb..50a913ea20a9 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -43,7 +43,6 @@ BEGIN $msiinfo_available = 0; $path_displayed = 0; $localmsidbpath = ""; - $presetsdir = ""; $plat = $^O; @@ -357,8 +356,9 @@ sub get_extensions_dir get_path_from_fullqualifiedname(\$localbranddir); # root dir in brand layer $localbranddir =~ s/\Q$separator\E\s*$//; my $extensiondir = $localbranddir . $separator . "share" . $separator . "extensions"; + my $preregdir = $localbranddir . $separator . "share" . $separator . "prereg"; - return $extensiondir; + return ($extensiondir, $preregdir); } ######################################################## @@ -824,7 +824,6 @@ sub create_directory_tree # Create the directory my $newdir = $fulldir . $separator . $dirname; if ( ! -f $newdir ) { mkdir $newdir; } - if (( $presetsdir eq "" ) && ( $newdir =~ /\Wpresets\s*$/ )) { $presetsdir = $newdir; } # Saving in collector $pathcollector->{$dir} = $newdir; # Iteration @@ -1092,11 +1091,11 @@ sub get_temppath sub register_extensions_sync { - my ($unopkgfile, $localtemppath) = @_; + my ($unopkgfile, $localtemppath, $preregdir) = @_; - if ( $presetsdir eq "" ) + if ( $preregdir eq "" ) { - my $logtext = "ERROR: Failed to determine directory \"presets\" folder for extension registration! Please check your installation set."; + my $logtext = "ERROR: Failed to determine \"prereg\" folder for extension registration! Please check your installation set."; print $logtext . "\n"; exit_program($logtext); } @@ -1123,14 +1122,13 @@ sub register_extensions_sync if ( $^O =~ /cygwin/i ) { $executable = "./" . $executable; - $presetsdir = qx{cygpath -m "$presetsdir"}; - chomp($presetsdir); + $preregdir = qx{cygpath -m "$presetsdir"}; + chomp($preregdir); } - $presetsdir =~ s/\/\s*$//g; - my $bundleddir = $presetsdir . "/bundled"; + $preregdir =~ s/\/\s*$//g; - my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file:///" . $bundleddir . "\"" . " -env:UserInstallation=file:///" . $localtemppath . " 2\>\&1 |"; + my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file:///" . $preregdir . "\"" . " -env:UserInstallation=file:///" . $localtemppath . " 2\>\&1 |"; print "... $systemcall\n"; @@ -1158,7 +1156,7 @@ sub register_extensions_sync sub register_extensions { - my ($unopkgfile, $temppath) = @_; + my ($unopkgfile, $temppath, $preregdir) = @_; print "Registering extensions:\n"; @@ -1168,7 +1166,7 @@ sub register_extensions } else { - register_extensions_sync($unopkgfile, $temppath); + register_extensions_sync($unopkgfile, $temppath, $preregdir); remove_complete_directory($temppath, 1); } @@ -1428,13 +1426,13 @@ $filecontent = read_file($filename); my $register_extensions_exists = analyze_customaction_file($filecontent); # Removing empty dirs in extension folder -my $extensionfolder = get_extensions_dir($unopkgfile); +my ( $extensionfolder, $preregdir ) = get_extensions_dir($unopkgfile); if ( -d $extensionfolder ) { remove_empty_dirs_in_folder($extensionfolder, 1); } if ( $register_extensions_exists ) { # Registering extensions - register_extensions($unopkgfile, $temppath); + register_extensions($unopkgfile, $temppath, $preregdir); } # Saving info in Summary Information Stream of msi database (required for following patches) diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index 8cff03191a70..a678316c2ce3 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -38,7 +38,7 @@ fi if [ -x $$POSTRUN ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" ) | $$POSTRUN -b -c UNOPKG if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions" @@ -47,7 +47,7 @@ if [ -x $$POSTRUN ]; then fi else # No postrun available, try running unopkg directly - "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed" @@ -89,13 +89,13 @@ if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\"" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" echo "rm -rf \"$$INSTDIR\"" ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG else # No postrun available, try running unopkg directly test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0 - "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then echo "\nERROR: Removal of UNO extension failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed" @@ -138,7 +138,7 @@ else fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ]; then @@ -172,7 +172,7 @@ else fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ]; then @@ -210,7 +210,7 @@ else fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ] @@ -249,7 +249,7 @@ fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ] then - "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////opt/${UNIXBASISROOTNAME}/basis${OOOBASEVERSION}/presets/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ] -- cgit From ca861ef74799d9f21d37bc5f832a905c04ad4499 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 21 Jul 2010 13:29:14 +0200 Subject: jl154 #i162868# unopkg sync removes share/prereg/bundled, changing registerExtensions --- .../source/win32/customactions/shellextensions/registerextensions.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index 359b300bdba3..a37d24548bb7 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -336,7 +336,7 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) const std::_tstring sTempFolder(createTempFolder()); std::_tstring sCommandPart1 = sUnoPkgFile + " sync"; std::_tstring sCommand = sCommandPart1 - + TEXT(" -env:BUNDLED_EXTENSIONS_USER=$OOO_BASE_DIR/presets/bundled") + + TEXT(" -env:BUNDLED_EXTENSIONS_USER=$BRAND_BASE_DIR/share/prereg/bundled") + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml") + TEXT(" -env:UserInstallation=") + sTempFolder; mystr = "Command: " + sCommand; -- cgit From 62fdc1868672bba91b1976261b1f6b21605e6ac2 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 21 Jul 2010 13:29:14 +0200 Subject: jl154 #i162868# unopkg sync removes share/prereg/bundled, changing registerExtensions --- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 21 ++++++ desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 105 +++++++++++++++++++++++++++ desktop/source/pkgchk/unopkg/unopkg_shared.h | 6 ++ 3 files changed, 132 insertions(+) diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 9434b69653a1..9115cd32cbd4 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -39,6 +39,7 @@ #include "osl/thread.h" #include "osl/process.h" #include "osl/conditn.hxx" +#include "osl/file.hxx" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/exc_hlp.hxx" #include "comphelper/anytostring.hxx" @@ -377,6 +378,26 @@ extern "C" int unopkg_main() if (e != osl_File_E_None && e != osl_File_E_NOENT) throw Exception(OUSTR("Could not delete ") + extensionUnorc, 0); } + else if (subCommand.equals(OUSTR("sync"))) + { + //sync is private!!!! Only for bundled extensions!!! + //For performance reasons unopkg sync is called during the setup and + //creates the registration data for the repository of the bundled + //extensions. It is then copied to the user installation during + //startup of OOo (userdata/extensions/bundled). The registration + //data is in the brand installation and must be removed when + //uninstalling OOo. We do this here, before UNO is + //bootstrapped. Otherwies files could be locked by this process. + + //If there is no folder left in + //$BRAND_BASE_DIR/share/extensions + //then we can delete the registration data at + //$BUNDLED_EXTENSIONS_USER + if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions"))) + removeFolder(OUSTR("$BUNDLED_EXTENSIONS_USER")); + return 0; + + } xComponentContext = getUNO( disposeGuard, option_verbose, option_shared, subcmd_gui, diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 3272810afee2..d7b6e1ca2336 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -528,5 +528,110 @@ Reference getUNO( return xComponentContext; } +//Determines if a folder does not contains a folder. +//Return false may also mean that the status could not be determined +//because some error occurred. +bool hasNoFolder(OUString const & folderUrl) +{ + bool ret = false; + OUString url = folderUrl; + ::rtl::Bootstrap::expandMacros(url); + ::osl::Directory dir(url); + osl::File::RC rc = dir.open(); + if (rc == osl::File::E_None) + { + bool bFolderExist = false; + osl::DirectoryItem i; + osl::File::RC rcNext = osl::File::E_None; + while ( (rcNext = dir.getNextItem(i)) == osl::File::E_None) + { + osl::FileStatus stat(FileStatusMask_Type); + if (i.getFileStatus(stat) == osl::File::E_None) + { + if (stat.getFileType() == osl::FileStatus::Directory) + { + bFolderExist = true; + break; + } + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + break; + } + i = osl::DirectoryItem(); + } + + if (rcNext == osl::File::E_NOENT || + rcNext == osl::File::E_None) + { + if (!bFolderExist) + ret = true; + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + } + + dir.close(); + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + } + return ret; } +void removeFolder(OUString const & folderUrl) +{ + OUString url = folderUrl; + ::rtl::Bootstrap::expandMacros(url); + ::osl::Directory dir(url); + ::osl::File::RC rc = dir.open(); + if (rc == osl::File::E_None) + { + ::osl::DirectoryItem i; + ::osl::File::RC rcNext = ::osl::File::E_None; + while ( (rcNext = dir.getNextItem(i)) == ::osl::File::E_None) + { + ::osl::FileStatus stat(FileStatusMask_Type | FileStatusMask_FileURL); + if (i.getFileStatus(stat) == ::osl::File::E_None) + { + ::osl::FileStatus::Type t = stat.getFileType(); + if (t == ::osl::FileStatus::Directory) + { + //remove folder + removeFolder(stat.getFileURL()); + } + else if (t == ::osl::FileStatus::Regular) + { + //remove file + ::osl::File::remove(stat.getFileURL()); + } + else + { + OSL_ASSERT(0); + } + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + break; + } + i = ::osl::DirectoryItem(); + } + dir.close(); + ::osl::Directory::remove(url); + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while removing ") + url + OUSTR("\n")); + } +} + +} diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index 43f77513b10c..4975cc4c087b 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -178,5 +178,11 @@ css::uno::Reference getUNO( DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui, css::uno::Reference & out_LocalComponentContext); +bool hasNoFolder(::rtl::OUString const & folderUrl); + +void removeFolder(::rtl::OUString const & folderUrl); + } + + -- cgit From d4b8b3e046e5f9c8ce30fbca054159f3cdb76956 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 21 Jul 2010 14:15:34 +0200 Subject: jl154 #i162868# changed RemoveExtensions custom action (windows) to delete brand/share/prereg/bundled --- .../source/win32/customactions/shellextensions/registerextensions.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index a37d24548bb7..9eaad6959a63 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -408,7 +408,7 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle) // Removing complete directory "Basis\presets\bundled" - std::_tstring sCacheDir = sInstDir + TEXT("Basis\\presets\\bundled"); + std::_tstring sCacheDir = sInstDir + TEXT("share\\prereg\\bundled"); bool fSuccess = RemoveCompleteDirectory( sCacheDir ); -- cgit From 031cd19797688ee3e3eb5ccd12e6e6abfa8bca88 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 21 Jul 2010 19:07:24 +0200 Subject: txtl10n: #i113008# #i113125# don't die by empty sdf file --- l10ntools/java/jpropex/java/SdfEntity.java | 41 +++++++++++++++++------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java index 52dc61ca40ca..a05ddf7c2304 100644 --- a/l10ntools/java/jpropex/java/SdfEntity.java +++ b/l10ntools/java/jpropex/java/SdfEntity.java @@ -98,23 +98,30 @@ public class SdfEntity implements Cloneable{ public void setProperties( String line ){ - String[] splitted = line.split("\t"); - - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); + String test = new String( line ); + test.trim(); + if( line != null && test.length()>0 ) + { + String[] splitted = line.split("\t"); + if( splitted.length == 15 ) + { + setProject( splitted[ SdfEntity.PROJECT_POS ] ); + setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); + setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); + setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); + setGid( splitted[ SdfEntity.GID_POS ] ); + setLid( splitted[ SdfEntity.LID_POS ] ); + setHelpid( splitted[ SdfEntity.HELPID_POS ] ); + setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); + setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); + setLangid( splitted[ SdfEntity.LANGID_POS ] ); + setText( splitted[ SdfEntity.TEXT_POS ] ); + setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); + setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); + setTitle( splitted[ SdfEntity.TITLE_POS ] ); + setDate( splitted[ SdfEntity.DATE_POS ] ); + } + } } public String getFileId(){ -- cgit From 6d40e92dcf681213d86fbadbe1c7fc65fbe88ad7 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 09:48:43 +0200 Subject: txtl10n: #i113008# #i113125# don't die by empty sdf file --- l10ntools/java/jpropex/java/SdfEntity.java | 39 +++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java index a05ddf7c2304..c2f6a5d788b1 100644 --- a/l10ntools/java/jpropex/java/SdfEntity.java +++ b/l10ntools/java/jpropex/java/SdfEntity.java @@ -98,29 +98,24 @@ public class SdfEntity implements Cloneable{ public void setProperties( String line ){ - String test = new String( line ); - test.trim(); - if( line != null && test.length()>0 ) + if( line != null ) { - String[] splitted = line.split("\t"); - if( splitted.length == 15 ) - { - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); - } + String[] splitted = line.split("\t",15); + setProject( splitted[ SdfEntity.PROJECT_POS ] ); + setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); + setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); + setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); + setGid( splitted[ SdfEntity.GID_POS ] ); + setLid( splitted[ SdfEntity.LID_POS ] ); + setHelpid( splitted[ SdfEntity.HELPID_POS ] ); + setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); + setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); + setLangid( splitted[ SdfEntity.LANGID_POS ] ); + setText( splitted[ SdfEntity.TEXT_POS ] ); + setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); + setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); + setTitle( splitted[ SdfEntity.TITLE_POS ] ); + setDate( splitted[ SdfEntity.DATE_POS ] ); } } -- cgit From 6fc85e3c5c85d0fc2e5e9f9516bcce8b8eaf94a6 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 22 Jul 2010 14:10:02 +0200 Subject: jl154 #i162868# unopkg sync now removes the folder when it does no contain a folder --- desktop/source/app/app.cxx | 42 ++++++++++------------------- desktop/source/app/userinstall.cxx | 6 +---- desktop/source/app/userinstall.hxx | 2 -- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 5 +++- 4 files changed, 19 insertions(+), 36 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 3ab5c6cacc88..ace2149036c9 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -469,8 +469,6 @@ void ReplaceStringHookProc( UniString& rStr ) } } -static const char pPresetsFolder[] = "presets"; -static const char pBundledFolder[] = BUNDLED_FOLDER_NAME; static const char pLastSyncFileName[] = "lastsynchronized"; static const sal_Int32 nStrLenLastSync = 16; @@ -537,25 +535,13 @@ static bool needsSynchronization( return bNeedsSync; } -static ::rtl::OUString getBasePresetsPathURL() +static ::rtl::OUString getBrandSharePreregBundledPathURL() { - ::rtl::OUString aBaseInstallURL; - ::utl::Bootstrap::PathStatus aBaseInstallStatus = ::utl::Bootstrap::locateBaseInstallation( aBaseInstallURL ); + ::rtl::OUString url( + RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/share/prereg/bundled")); - if ( aBaseInstallStatus == ::utl::Bootstrap::PATH_EXISTS ) - { - ::rtl::OUStringBuffer aTmp( aBaseInstallURL ); - ::sal_Int32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); - - if ( nLastIndex != aBaseInstallURL.getLength()-1 ) - aTmp.appendAscii( "/" ); - aTmp.appendAscii( pPresetsFolder ); - aTmp.appendAscii( "/" ); - aTmp.appendAscii( pBundledFolder ); - aBaseInstallURL = aTmp.makeStringAndClear(); - } - - return aBaseInstallURL; + ::rtl::Bootstrap::expandMacros(url); + return url; } static ::rtl::OUString getUserBundledExtPathURL() @@ -566,14 +552,14 @@ static ::rtl::OUString getUserBundledExtPathURL() return folder; } -static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() +static ::rtl::OUString getLastSyncFileURLFromBrandInstallation() { - ::rtl::OUString aBasePresetPathURL = getBasePresetsPathURL(); - ::sal_Int32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); + ::rtl::OUString aURL = getBrandSharePreregBundledPathURL(); + ::sal_Int32 nLastIndex = aURL.lastIndexOf('/'); - ::rtl::OUStringBuffer aTmp( aBasePresetPathURL ); + ::rtl::OUStringBuffer aTmp( aURL ); - if ( nLastIndex != aBasePresetPathURL.getLength()-1 ) + if ( nLastIndex != aURL.getLength()-1 ) aTmp.appendAscii( "/" ); aTmp.appendAscii( pLastSyncFileName ); @@ -692,17 +678,17 @@ void Desktop::Init() // and test if synchronzation is necessary! { ::rtl::OUString aUserLastSyncFilePathURL = getLastSyncFileURLFromUserInstallation(); - ::rtl::OUString aBaseLastSyncFilePathURL = getLastSyncFileURLFromBaseInstallation(); + ::rtl::OUString aPreregSyncFilePathURL = getLastSyncFileURLFromBrandInstallation(); - if ( needsSynchronization( aBaseLastSyncFilePathURL, aUserLastSyncFilePathURL )) + if ( needsSynchronization( aPreregSyncFilePathURL, aUserLastSyncFilePathURL )) { rtl::OUString aUserPath = getUserBundledExtPathURL(); - rtl::OUString aBasePresetsBundledPath = getBasePresetsPathURL(); + rtl::OUString aPreregBundledPath = getBrandSharePreregBundledPathURL(); // copy bundled folder to the user directory osl::FileBase::RC rc = osl::Directory::createPath(aUserPath); (void) rc; - copy_bundled_recursive( aBasePresetsBundledPath, aUserPath, +1 ); + copy_bundled_recursive( aPreregBundledPath, aUserPath, +1 ); } } diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx index 0a31bed791ec..546a6f0ad13c 100644 --- a/desktop/source/app/userinstall.cxx +++ b/desktop/source/app/userinstall.cxx @@ -207,12 +207,8 @@ namespace desktop { if (newDstUnqPath.lastIndexOf(sal_Unicode('/')) != newDstUnqPath.getLength()-1) newDstUnqPath += rtl::OUString::createFromAscii("/"); newDstUnqPath += itemname; - // recursion - // Filer out bundled folder which is treated by a special - // implementation. - if ( !itemname.equalsAscii( BUNDLED_FOLDER_NAME )) - err = copy_recursive(newSrcUnqPath, newDstUnqPath); + err = copy_recursive(newSrcUnqPath, newDstUnqPath); } aDir.close(); diff --git a/desktop/source/app/userinstall.hxx b/desktop/source/app/userinstall.hxx index 8a8740eaa28b..8d6a51cd66be 100644 --- a/desktop/source/app/userinstall.hxx +++ b/desktop/source/app/userinstall.hxx @@ -29,8 +29,6 @@ #include #include -#define BUNDLED_FOLDER_NAME "bundled" - namespace desktop { diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 9115cd32cbd4..4545ed862271 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -394,8 +394,11 @@ extern "C" int unopkg_main() //then we can delete the registration data at //$BUNDLED_EXTENSIONS_USER if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions"))) + { removeFolder(OUSTR("$BUNDLED_EXTENSIONS_USER")); - return 0; + //return otherwise we create the registration data again + return 0; + } } -- cgit From 92fe5813fbcedeb034c6fa85f56bafa2113f142d Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 15:13:04 +0200 Subject: txtl10n: removed obsolete dir --- transex3/java/jpropex/build.xml | 169 ---------- transex3/java/jpropex/java/JPropEx.java | 400 ----------------------- transex3/java/jpropex/java/Main.java | 38 --- transex3/java/jpropex/java/NoLocalizeFilter.java | 55 ---- transex3/java/jpropex/java/OrderedHashMap.java | 96 ------ transex3/java/jpropex/java/SdfData.java | 108 ------ transex3/java/jpropex/java/SdfEntity.java | 254 -------------- transex3/java/jpropex/jpropex | 10 - transex3/java/jpropex/jpropex.MF | 1 - transex3/java/jpropex/makefile.mk | 36 -- 10 files changed, 1167 deletions(-) delete mode 100755 transex3/java/jpropex/build.xml delete mode 100644 transex3/java/jpropex/java/JPropEx.java delete mode 100644 transex3/java/jpropex/java/Main.java delete mode 100644 transex3/java/jpropex/java/NoLocalizeFilter.java delete mode 100644 transex3/java/jpropex/java/OrderedHashMap.java delete mode 100644 transex3/java/jpropex/java/SdfData.java delete mode 100644 transex3/java/jpropex/java/SdfEntity.java delete mode 100755 transex3/java/jpropex/jpropex delete mode 100755 transex3/java/jpropex/jpropex.MF delete mode 100755 transex3/java/jpropex/makefile.mk diff --git a/transex3/java/jpropex/build.xml b/transex3/java/jpropex/build.xml deleted file mode 100755 index d74fb3975d0f..000000000000 --- a/transex3/java/jpropex/build.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/transex3/java/jpropex/java/JPropEx.java b/transex3/java/jpropex/java/JPropEx.java deleted file mode 100644 index 20175febe5d5..000000000000 --- a/transex3/java/jpropex/java/JPropEx.java +++ /dev/null @@ -1,400 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.util.*; -import java.io.*; - -public class JPropEx -{ - private String inputFileArg; - private String outputFileArg; - private String pathPrefixArg; - private String pathPostfixArg; - private String projectArg; - private String rootArg; - private Vector forcedLangsArg; - private Vector langsArg; - private String inputSdfFileArg; - private boolean isQuiet = false; - private final String resourceType = "javaproperties"; - private final String sourceLanguage = "en-US"; - //private SdfData data; - - public JPropEx() - { - //data = new SdfData(); - } - - public JPropEx( String args[] ) - { - super(); - parseArguments( args ); - testArguments(); - if( inputSdfFileArg != null && inputSdfFileArg.length() > 0 ) - merge(); - else - extract(); - } - - private String getSimpleArg( String[] args , int x ) - { - if( x < args.length ) x++; - else - { - System.err.println("ERROR: Missing arg for "+args[ x ]+"\n"); - help(); - } - return args[ x ]; - } - private Vector getComplexArg( String[] args , int x ) - { - if( x < args.length ) x++; - else - { - System.err.println("ERROR: Missing arg for "+args[ x ]+"\n"); - help(); - } - String value = args[ x ]; - Vector values = new Vector( Arrays.asList( value.split(",") ) ); - return values; - } - - private void help() - { - System.out.println("jpropex extract / merge java properties files"); - System.exit( -1 ); - } - - private void extract() - { - SdfData data = new SdfData(); - java.util.Properties prop = loadProp( inputFileArg ); - - // Get a prototype that already contains the most common settings - SdfEntity dolly = prepareSdfObj(); - String key; - SdfEntity currentStr; - String value; - for( Enumeration e = prop.propertyNames() ; e.hasMoreElements() ; ) - { - key = (String) e.nextElement(); - currentStr = (SdfEntity) dolly.clone(); - // Set the new LID and the string text - currentStr.setLid( key ); - value = prop.getProperty( key , "" ); - //if( value.equals("") ) System.err.println("Warning: in file "+inputFileArg+" the string with the key "+key+" has a empty string!"); - currentStr.setText( (prop.getProperty( key )).replaceAll("\t" , " " ) ); // TODO: Quoting!!!! - data.add( currentStr ); - } - data.write( outputFileArg ); - } - - private SdfEntity prepareSdfObj() - { - String path = makeAbs( inputFileArg ); - path = path.replace( rootArg + "/" , "" ); - path = path.replace("/","\\"); - return new SdfEntity( projectArg , path , "" /* dummy1 */ , resourceType , "", "" , "" , "" , "" /* dummy2 */ , - sourceLanguage , "", "" , "" , "" , "2002-02-02 02:02:02" ); - } - - private void merge() - { - SdfData data = getSdfData(); - if( inputFileArg.startsWith("@") ) - { - // Read files - Vector fileList = readFileList( inputFileArg ); - for( Enumeration e = fileList.elements(); e.hasMoreElements(); ) - mergeFile( (String) e.nextElement() , data ); - } - else - { - // Single file - mergeFile( inputFileArg , data ); - } - } - - private Vector readFileList( String filename ) - { - Vector lines = new Vector(); - try - { - BufferedReader in = new BufferedReader( new FileReader( filename.substring( 1 ) ) ); - while( in.ready() ) - lines.add( in.readLine() ); - } - catch( IOException e ) - { - System.out.println("ERROR: Can't open file '"+filename.substring( 1 )+"'"); - System.exit( -1 ); - } - return lines; - } - - private void mergeFile( String filename , SdfData data ) - { - java.util.Properties sourceProp = loadProp( filename ); - Vector langs = getLanguages( data ); - HashMap props = new HashMap(); - // Create a properties object for every language - for( Enumeration e = langs.elements(); e.hasMoreElements();) - { - - props.put( (String)e.nextElement() , new java.util.Properties() ); - } - // Get a prototype that already contains the most common settings - - SdfEntity dolly = prepareSdfObj(); - String key; - String sourceString; - SdfEntity curStr; - SdfEntity curEntity; - SdfEntity mergedEntity; - String curLang; - for( Enumeration e = sourceProp.propertyNames() ; e.hasMoreElements() ; ) // For all property keys - { - key = (String) e.nextElement(); - sourceString = sourceProp.getProperty( key ); - curStr = (SdfEntity) dolly.clone(); - curStr.setLid( key ); - for( Enumeration lang = langs.elements(); lang.hasMoreElements(); ) // merge in every language - { - curEntity = (SdfEntity) curStr.clone(); - curLang = (String) lang.nextElement(); - curEntity.setLangid( curLang ); - mergedEntity = data.get( curEntity ); - if( mergedEntity == null ) - { - // if case there is not translation the fallback to the en-US source string - ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getLid() , sourceString ); - } - else - { - // Set the merged text from the sdf file - ( (java.util.Properties) props.get( curLang )).setProperty( mergedEntity.getLid() , mergedEntity.getText() ); // TODO: Quoting ??? - } - } - - } - // Now write them out - String lang; - for( Iterator i = props.keySet().iterator() ; i.hasNext() ; ) - { - lang = (String) i.next(); - writeSinglePropertiesFile( filename , (java.util.Properties) props.get( lang ) , lang ); - } - } - private void writeSinglePropertiesFile( String filename , java.util.Properties prop , String lang ) - { - // Prepare path to file - int filenameIdx = filename.lastIndexOf( "/" ) > 0 ? filename.lastIndexOf( "/" )+1 : 0 ; - String path = new String(); - String name = new String(); - if( pathPrefixArg != null && pathPrefixArg.length()>0 && pathPostfixArg != null && pathPostfixArg.length()>0 ) - { - path = new StringBuffer().append( pathPrefixArg ).append( "/" ).append( lang ).append( "/" ).append( pathPostfixArg ).append( "/" ).toString(); - name = new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) - .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString(); - } - else if( outputFileArg != null && outputFileArg.length()>0 ) - { - name = outputFileArg; - name += new StringBuffer().append( inputFileArg.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) - .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString(); - - //name = outputFileArg; - } - else - { - System.err.println("ERROR: No outputfile specified .. either -o or -x -y !"); - System.exit( -1 ); - } - - File dir = new File( path ); - try - { - if( !dir.exists() && path.length()>0 ) - { - if( !dir.mkdirs() ) - { - System.out.println("ERROR: Can't create directory '"+path+"' !!!"); - System.exit( -1 ); - } - } - } - catch( SecurityException e ) - { - System.out.println("ERROR: Can't create directory '"+path+"'!!!Wrong Permissions?"); - System.exit( -1 ); - } - path += name; - // Write the properties file - System.out.println("DBG: Writing to "+path); - try{ - BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( path ) ); - if( prop == null ) - System.out.println("DBG: prop == null!!!"); - prop.store( out , "" ); // Legal headers? - } - catch( IOException e ) - { - System.out.println("ERROR: Can't write file '"+path+"' !!!!"); - System.exit( -1 ); - } - } - - private SdfData getSdfData() - { - SdfData data = new SdfData( inputSdfFileArg ); - data.read(); - return data; - } - private Vector getLanguages( SdfData data ) - { - Vector langs = new Vector(); - - if( ((String)langsArg.get( 0 )).equalsIgnoreCase( "all" ) ) // for "-l all" use all languages found in the -m sdf file - langs.addAll( data.getLanguages() ); - else - langs.addAll( langsArg ); // use the langs giving by -l - - if( forcedLangsArg != null ) - langs.addAll( forcedLangsArg ); - - return removeDupes( langs ); - } - private Vector removeDupes( Vector vec ) - { - Collection coll = new LinkedHashSet( vec ); - return new Vector( coll ); - } - private java.util.Properties loadProp( String filename ) - { - java.util.Properties prop = new java.util.Properties(); - try - { - prop.load( new BufferedInputStream( new NoLocalizeFilter( new FileInputStream( filename ) ) ) ); - } - catch( IOException e ) - { - System.err.println("ERROR: Can't read file '"+filename+"'!!!"); - } - return prop; - } - private void parseArguments( String[] args ) - { - - if( args.length == 0 ) - { - System.out.println("ERROR: No args???"); - help(); - System.exit( -1 ); - } - for( int x = 0; x < args.length ; x++ ) - { - if( args[ x ].equalsIgnoreCase("-i") ) - { - // Input resource file - inputFileArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-o") ) - { - // Output sdf file - outputFileArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-x") ) - { - // path prefix - pathPrefixArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-y") ) - { - // path postfix - pathPostfixArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-p") ) - { - // project - projectArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-r") ) - { - // root - rootArg = getSimpleArg( args , x ); - rootArg = makeAbs( rootArg ); - } - else if( args[ x ].equalsIgnoreCase("-lf") ) - { - // forced langs - forcedLangsArg = getComplexArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-l") ) - { - // langs - langsArg = getComplexArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-m") ) - { - // input sdf file - inputSdfFileArg = getSimpleArg( args , x ); - } - else if( args[ x ].equalsIgnoreCase("-qq") ) - { - isQuiet = true; - } - } - } - private String makeAbs( String path ) - { - File file; - try - { - file = new File( path ); - return file.getCanonicalPath(); - }catch( IOException e ) - { - e.printStackTrace(); - System.exit( -1 ); - } - return null; - } - private boolean testArguments() - { - // nice merge - if( inputSdfFileArg != null && inputSdfFileArg.length()>0 ) - // nice merge - return projectArg != null && rootArg != null && inputFileArg != null && pathPrefixArg != null && pathPostfixArg != null && langsArg != null && - projectArg.length()>0 && rootArg.length()>0 && inputFileArg.length()>0 && pathPrefixArg.length()>0 && pathPostfixArg.length()>0 && langsArg.size()>0 ; - else - // nice extract - return projectArg != null && rootArg != null && inputFileArg != null && outputFileArg != null && langsArg != null && - projectArg.length()>0 && rootArg.length()>0 && inputFileArg.length()>0 && outputFileArg.length()>0 && langsArg.size()>0; - } - -} diff --git a/transex3/java/jpropex/java/Main.java b/transex3/java/jpropex/java/Main.java deleted file mode 100644 index 23dc477ddec3..000000000000 --- a/transex3/java/jpropex/java/Main.java +++ /dev/null @@ -1,38 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -class Main -{ - - public static void main( String args[] ) - { - JPropEx jpropex = new JPropEx( args ); - //jpropex.init(); - } -} - diff --git a/transex3/java/jpropex/java/NoLocalizeFilter.java b/transex3/java/jpropex/java/NoLocalizeFilter.java deleted file mode 100644 index c1e62fc951a8..000000000000 --- a/transex3/java/jpropex/java/NoLocalizeFilter.java +++ /dev/null @@ -1,55 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.io.*; -import java.util.regex.*; - -// exit if the sequence x-no-localize is found in stream! -public class NoLocalizeFilter extends FilterInputStream -{ - InputStream in; -// Pattern p = Pattern.compile("[\\s]*#[\\s]*x-no-translate"); - - public NoLocalizeFilter( InputStream in ) { - super(in); - this.in = in; - } - public int read(byte[] b, int off, int len) throws IOException - { - String search = new String( b ); -// Matcher m = p.matcher( search ); - if( search.contains("x-no-translate" ) ) // TODO: fixme! - { -// System.out.println("found x-no-translate"); - in.close(); - close(); - System.exit( 0 ); - } - return in.read( b , off , len ); - } -} diff --git a/transex3/java/jpropex/java/OrderedHashMap.java b/transex3/java/jpropex/java/OrderedHashMap.java deleted file mode 100644 index a462d598b307..000000000000 --- a/transex3/java/jpropex/java/OrderedHashMap.java +++ /dev/null @@ -1,96 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.util.*; - -// LinkedHashMap implrementation -public class OrderedHashMap -{ - private HashMap hm = new HashMap(); - private LinkedList list = new LinkedList(); - - public Iterator iterator() { return list.iterator(); } - - public boolean isEmpty() { return hm.isEmpty(); } - public Object get( Object key ) { return hm.get( key ); } - public Object get( int index ) { return hm.get( list.get( index ) ); } - public Iterator keys() { return list.iterator(); } - public Object add( Object key , Object value ) - { - list.add( key ); - return hm.put( key, value ); - } - public Object add( int index , Object key , Object value ) - { - list.add( index , key ); - return hm.put( key, value ); - } - public Object remove( Object key ) - { - list.remove( list.indexOf( key ) ); - return hm.remove( key ); - } - public void move( int idxFrom , int idxTo ) - { - Object key = list.get( idxFrom ); - list.remove( idxFrom ); - list.add( idxTo , key ); - } - public void move( Object key , int idxTo ) - { - move( list.indexOf( key ) , idxTo ); - } - public int size() - { - return hm.size(); - } - public Enumeration elements() - { - return new OHMenum( this ); - } -} - -final class OHMenum implements Enumeration -{ - OrderedHashMap ohm; - int index = 0; - - private OHMenum(){}; - public OHMenum( OrderedHashMap ohm ){ - this.ohm = ohm ; - } - - public boolean hasMoreElements() - { - return index < ohm.size(); - } - public Object nextElement() - { - return ohm.get( index++ ); - } -} diff --git a/transex3/java/jpropex/java/SdfData.java b/transex3/java/jpropex/java/SdfData.java deleted file mode 100644 index 60f218c0ae15..000000000000 --- a/transex3/java/jpropex/java/SdfData.java +++ /dev/null @@ -1,108 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -import java.util.*; -import java.io.*; - -public class SdfData -{ - private String filename; - private OrderedHashMap ohm; - private LinkedHashSet languagesFound; - - public SdfData() - { - languagesFound = new LinkedHashSet(); - ohm = new OrderedHashMap(); - languagesFound = new LinkedHashSet(); - } - public SdfData( String filename ){ - this(); - this.filename = filename; - } - - public LinkedHashSet getLanguages() - { - return languagesFound; - } - public SdfEntity get( SdfEntity obj ) - { - return (SdfEntity) ohm.get( (String)obj.getId() ); - } - public SdfEntity get( String key ){ - return (SdfEntity) ohm.get( key ); - } - public void add( SdfEntity obj ) - { - ohm.add( obj.getId() , obj ); - } - - public void read() - { - BufferedReader in; - try - { - in = new BufferedReader( new FileReader( filename ) ); - SdfEntity entity; - while( in.ready() ) - { - String line = in.readLine(); - if( line.length() > 0 ) - { - entity = new SdfEntity( line ); - ohm.add( entity.getId() , entity ); // test if is valid - languagesFound.add( entity.getLangid() ); - } - } - in.close(); - } - catch( IOException e ) - { - System.out.println("Error: reading file " + filename); - System.exit( -1 ); - } - } - public void write( String filename ) - { - FileWriter out; - try - { - out = new FileWriter( filename , true ); // Always append - for( Enumeration e = ohm.elements(); e.hasMoreElements(); ) - { - out.write( ( (SdfEntity) e.nextElement() ).toString() + "\n" ); - } - out.close(); - } - catch( IOException e ) - { - System.out.println("Error: Can't write to file " + filename); - System.exit( -1 ); - } - } -} diff --git a/transex3/java/jpropex/java/SdfEntity.java b/transex3/java/jpropex/java/SdfEntity.java deleted file mode 100644 index e2c1606ee7c2..000000000000 --- a/transex3/java/jpropex/java/SdfEntity.java +++ /dev/null @@ -1,254 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -public class SdfEntity implements Cloneable{ - private String project = new String(""); - private String source_file = new String(""); - private String dummy1 = new String(""); - private String resource_type= new String(""); - private String gid = new String(""); - private String lid = new String(""); - private String helpid = new String(""); - private String platform = new String(""); - private String dummy2 = new String(""); - private String langid = new String(""); - private String text = new String(""); - private String helptext = new String(""); - private String quickhelptext= new String(""); - private String title = new String(""); - private String date = new String(""); - - public static int PROJECT_POS = 0; - public static int SOURCE_FILE_POS = 1; - public static int DUMMY1_POS = 2; - public static int RESOURCE_TYPE_POS = 3; - public static int GID_POS = 4; - public static int LID_POS = 5; - public static int HELPID_POS = 6; - public static int PLATFORM_POS = 7; - public static int DUMMY2_POS = 8; - public static int LANGID_POS = 9; - public static int TEXT_POS = 10; - public static int HELPTEXT_POS = 11; - public static int QUICKHELPTEXT_POS = 12; - public static int TITLE_POS = 13; - public static int DATE_POS = 14; - - public Object clone() - { - try - { - return super.clone(); - } - catch( CloneNotSupportedException e ) - { - System.out.println("ERROR: Can not clone, soemthing is broken here ...."); - System.exit( -1 ); - } - return null; // dummy - } - - public SdfEntity( String line ){ - // isValid? - setProperties( line ) ; - } - public SdfEntity(String project, String source_file, String dummy1, String resource_type, String gid, String lid, String helpid, String platform, String dummy2, String langid, String text, String helptext, String quickhelptext, String title , String date) { - super(); - this.project = project; - this.source_file = source_file; - this.dummy1 = dummy1; - this.resource_type = resource_type; - this.gid = gid; - this.lid = lid; - this.helpid = helpid; - this.platform = platform; - this.dummy2 = dummy2; - this.langid = langid; - this.text = text; - this.helptext = helptext; - this.quickhelptext = quickhelptext; - this.title = title; - this.date = date; - } - - public void setProperties( String line ){ - - String[] splitted = line.split("\t"); - - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); - } - - public String getFileId(){ - return project+"\\"+source_file; - } - public String getResourcePath(){ - return source_file.substring(0 , source_file.lastIndexOf( "\\" )-1 ); - } - public String toString(){ - return project+"\t"+source_file+"\t"+dummy1+"\t"+resource_type+"\t"+gid+"\t" - +lid+"\t"+helpid+"\t"+platform+"\t"+dummy2+"\t"+langid+"\t" - +text+"\t"+helptext+"\t"+quickhelptext+"\t"+title+"\t"+date; - } - public String getId(){ - return project+gid+lid+source_file+resource_type+platform+helpid; - } - - public String getDummy1() { - return dummy1; - } - - public void setDummy1(String dummy1) { - this.dummy1 = dummy1; - } - - public String getPlatform() { - return platform; - } - - public void setPlatform(String platform) { - this.platform = platform; - } - - public String getDummy2() { - return dummy2; - } - - public void setDummy2(String dummy2) { - this.dummy2 = dummy2; - } - - public String getGid() { - return gid; - } - - public void setGid(String gid) { - this.gid = gid; - } - - public String getHelpid() { - return helpid; - } - - public void setHelpid(String helpid) { - this.helpid = helpid; - } - - public String getHelptext() { - return helptext; - } - - public void setHelptext(String helptext) { - this.helptext = helptext; - } - - public String getLangid() { - return langid; - } - - public void setLangid(String langid) { - this.langid = langid; - } - - public String getLid() { - return lid; - } - - public void setLid(String lid) { - this.lid = lid; - } - - public String getProject() { - return project; - } - - public void setProject(String project) { - this.project = project; - } - - public String getQuickhelptext() { - return quickhelptext; - } - - public void setQuickhelptext(String quickhelptext) { - this.quickhelptext = quickhelptext; - } - - public String getResource_type() { - return resource_type; - } - - public void setResource_type(String resource_type) { - this.resource_type = resource_type; - } - - public String getSource_file() { - return source_file; - } - - public void setSource_file(String source_file) { - this.source_file = source_file; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - public String getDate() { - return date; - } - public void setDate(String date) { - this.date = date; - } - - -} diff --git a/transex3/java/jpropex/jpropex b/transex3/java/jpropex/jpropex deleted file mode 100755 index 2d62d13b093e..000000000000 --- a/transex3/java/jpropex/jpropex +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -if [ x${SOLARENV}x = xx ]; then - echo No environment found, please use 'configure' or 'setsolar' - exit 1 -fi -if [ x${JAVA_HOME}x = xx ]; then - echo No Java found! - exit 1 -fi -exec java -DSOLARSRC=${SOLARSRC} -DWORK_STAMP=${WORK_STAMP} -DUSE_SHELL= -jar ${SOLARVER}/${INPATH}/bin${UPDMINOREXT}/jpropex.jar "$@" diff --git a/transex3/java/jpropex/jpropex.MF b/transex3/java/jpropex/jpropex.MF deleted file mode 100755 index 3e22e7e9bfbf..000000000000 --- a/transex3/java/jpropex/jpropex.MF +++ /dev/null @@ -1 +0,0 @@ -Main-Class: Main diff --git a/transex3/java/jpropex/makefile.mk b/transex3/java/jpropex/makefile.mk deleted file mode 100755 index f86d2c830025..000000000000 --- a/transex3/java/jpropex/makefile.mk +++ /dev/null @@ -1,36 +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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - - -PRJ=../.. -PRJNAME=transex3 -TARGET=jpropex - -.INCLUDE : ant.mk - -ALLTAR : ANTBUILD - -- cgit From 5ddf16d8358a38c0098d3060dcee90c518f0dd85 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 17:13:19 +0200 Subject: txtl10n: #i113008# #i113125# cleanup / removed unused lines --- l10ntools/scripts/xhtex | 8 -------- l10ntools/scripts/xtxex | 8 -------- 2 files changed, 16 deletions(-) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index e6f7cf9f2003..659cd06e16d4 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -31,14 +31,6 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -# localize.pl calls localize_sl in solver bin directory which depends on dynamic -# libraries in solver lib directory but has no correct RPATH (or equivalent): -if [ "${OS?}" = MACOSX ]; then - export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -else - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -fi - if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index cc9dac01fca2..28529506e3a2 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -31,14 +31,6 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -# localize.pl calls localize_sl in solver bin directory which depends on dynamic -# libraries in solver lib directory but has no correct RPATH (or equivalent): -if [ "${OS?}" = MACOSX ]; then - export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -else - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} -fi - if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else -- cgit From ad251e6894d339e8ac066e6c30c132da32cb5e62 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Thu, 22 Jul 2010 17:26:25 +0200 Subject: jl154 #162868# unopkg in shell script with several quotes --- setup_native/source/packinfo/shellscripts_extensions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index a678316c2ce3..ab0e3d0ac7be 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -47,7 +47,7 @@ if [ -x $$POSTRUN ]; then fi else # No postrun available, try running unopkg directly - "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed" @@ -95,7 +95,7 @@ if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then else # No postrun available, try running unopkg directly test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0 - "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then echo "\nERROR: Removal of UNO extension failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed" -- cgit From d60b211a12e9798fc674df1234f72a232b9c114f Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Thu, 22 Jul 2010 17:43:35 +0200 Subject: jl154 #162868# unopkg in shell script with several quotes --- setup_native/scripts/admin.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index 50a913ea20a9..c7083a616b15 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -1122,7 +1122,7 @@ sub register_extensions_sync if ( $^O =~ /cygwin/i ) { $executable = "./" . $executable; - $preregdir = qx{cygpath -m "$presetsdir"}; + $preregdir = qx{cygpath -m "$preregdir"}; chomp($preregdir); } -- cgit From 3a7826b9ff0ddcfc9032c5ef707f754ae4abd3d2 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 22 Jul 2010 17:53:11 +0200 Subject: txtl10n: cleanup / remove all -QQ and quiet parts --- l10ntools/inc/lngmerge.hxx | 2 +- l10ntools/source/cfglex.l | 1 - l10ntools/source/cfgmerge.cxx | 9 --------- l10ntools/source/export.cxx | 11 ----------- l10ntools/source/helpex.cxx | 8 +------- l10ntools/source/lngex.cxx | 10 +--------- l10ntools/source/lngmerge.cxx | 5 ++--- l10ntools/source/localize.cxx | 38 +++++++++----------------------------- l10ntools/source/xrmmerge.cxx | 9 --------- 9 files changed, 14 insertions(+), 79 deletions(-) diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx index 923da89988b6..843d1a6de3d2 100644 --- a/l10ntools/inc/lngmerge.hxx +++ b/l10ntools/inc/lngmerge.hxx @@ -58,7 +58,7 @@ private: const ByteString &rPrj , const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID ); public: - LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat, bool bQuiet_in ); + LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat ); ~LngParser(); BOOL CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot ); diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l index d1b076d493b9..3fc3aa5b965c 100644 --- a/l10ntools/source/cfglex.l +++ b/l10ntools/source/cfglex.l @@ -177,7 +177,6 @@ main( int argc, char* argv[]) fprintf( stdout, " FileIn: Source files (*.src)\n" ); fprintf( stdout, " FileOut: Destination file (*.*)\n" ); fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quiet output\n" ); fprintf( stdout, " -e: Disable writing errorlog\n" ); fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" ); fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" ); diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 3e421d2d1046..e8feee1fe3c8 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -59,7 +59,6 @@ BOOL bMergeMode; BOOL bErrorLog; BOOL bForce; BOOL bUTF8; -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sInputFileName; @@ -83,7 +82,6 @@ extern char *GetOutputFile( int argc, char* argv[]) bErrorLog = TRUE; bForce = FALSE; bUTF8 = TRUE; - bQuiet = false; sPrj = ""; sPrjRoot = ""; sInputFileName = ""; @@ -128,9 +126,6 @@ extern char *GetOutputFile( int argc, char* argv[]) nState = STATE_FORCE; bForce = TRUE; } - else if ( sSwitch == "-QQ" ) { - bQuiet = true; - } else if ( sSwitch == "-L" ) { nState = STATE_LANGUAGES; } @@ -184,10 +179,6 @@ extern char *GetOutputFile( int argc, char* argv[]) // command line is not valid return NULL; } -int isQuiet(){ - if( bQuiet ) return 1; - else return 0; -} /*****************************************************************************/ int InitCfgExport( char *pOutput , char* pFilename ) /*****************************************************************************/ diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 589c962c112c..d6c7a9533309 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -62,7 +62,6 @@ BOOL bErrorLog; BOOL bBreakWhenHelpText; BOOL bUnmerge; BOOL bUTF8; -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sActFileName; @@ -98,7 +97,6 @@ extern char *GetOutputFile( int argc, char* argv[]) Export::sForcedLanguages = ""; sTempFile = ""; pTempFile = NULL; - bQuiet = false; USHORT nState = STATE_NON; BOOL bInput = FALSE; @@ -115,9 +113,6 @@ extern char *GetOutputFile( int argc, char* argv[]) else if (sSwitch == "-p" || sSwitch == "-P" ) { nState = STATE_PRJ; // next token specifies the cur. project } - else if (sSwitch == "-qq" || sSwitch == "-QQ" ) { - bQuiet = true; - } else if (sSwitch == "-r" || sSwitch == "-R" ) { nState = STATE_ROOT; // next token specifies path to project root @@ -196,12 +191,6 @@ extern char *GetOutputFile( int argc, char* argv[]) return NULL; } /*****************************************************************************/ -int isQuiet(){ -/*****************************************************************************/ - if( bQuiet ) return 1; - else return 0; -} -/*****************************************************************************/ int InitExport( char *pOutput , char* pFilename ) /*****************************************************************************/ { diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 49a59266a85d..15239db5d9bd 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -61,7 +61,6 @@ ByteString sOutputFile; ByteString sOutputFileX; ByteString sOutputFileY; ByteString sSDFFile; -bool bQuiet; /*****************************************************************************/ BOOL ParseCommandLine( int argc, char* argv[]) @@ -73,7 +72,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) bUTF8 = TRUE; sPrj = ""; sPrjRoot = ""; - bQuiet = false; Export::sLanguages = ""; Export::sForcedLanguages = ""; @@ -111,9 +109,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) nState = STATE_ERRORLOG; bErrorLog = FALSE; } - else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) { - bQuiet = true; - } else if ( ByteString( argv[ i ]).ToUpperAscii() == "-UTF8" ) { nState = STATE_UTF8; bUTF8 = TRUE; @@ -188,13 +183,12 @@ BOOL ParseCommandLine( int argc, char* argv[]) void Help() /*****************************************************************************/ { - fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...][-QQ] -LF l1,l2 \n" ); + fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...] -LF l1,l2 \n" ); fprintf( stdout, " Prj: Project\n" ); fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); fprintf( stdout, " FileIn: Source file (*.lng)\n" ); fprintf( stdout, " FileOut: Destination file (*.*)\n" ); fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quiet output\n" ); fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (en-US,fr,de...)\n" ); fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); fprintf( stdout, " f1, f2,... are also elements of (en-US,fr,de...)\n" ); diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx index 27136dc8797f..4ec069a810f5 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -53,7 +53,6 @@ BOOL bMergeMode; BOOL bErrorLog; BOOL bUTF8; BOOL bULF; // ULF = Unicode Language File -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sOutputFile; @@ -68,7 +67,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) bErrorLog = TRUE; bUTF8 = TRUE; bULF = FALSE; - bQuiet = false; sPrj = ""; sPrjRoot = ""; Export::sLanguages = ""; @@ -92,9 +90,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) else if ( sSwitch == "-R" ) { nState = STATE_ROOT; // next token specifies path to project root } - else if ( sSwitch == "-QQ" ) { - bQuiet = true; - } else if ( sSwitch == "-M" ) { nState = STATE_MERGESRC; // next token specifies the merge database } @@ -176,9 +171,6 @@ void Help() fprintf( stdout, " FileIn: Source file (*.lng)\n" ); fprintf( stdout, " FileOut: Destination file (*.*)\n" ); fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quite output\n" ); - //fprintf( stdout, " -NOUTF8: disable UTF8 as language independent encoding\n" ); - //fprintf( stdout, " -ULF: enables Unicode Language File format, leads to UTF8 encoded version of lng files" ); fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); @@ -202,7 +194,7 @@ int _cdecl main( int argc, char *argv[] ) fflush( stdout ); if ( sOutputFile.Len()) { - LngParser aParser( sInputFile, bUTF8, bULF , bQuiet ); + LngParser aParser( sInputFile, bUTF8, bULF ); if ( bMergeMode ) aParser.Merge( sMergeSrc, sOutputFile , sPrj ); else diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 5f40a4346f53..f0093bbccea7 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -38,15 +38,14 @@ using namespace std; // class LngParser // /*****************************************************************************/ -LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat , bool bQuiet_in ) +LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat ) /*****************************************************************************/ : nError( LNG_OK ), pLines( NULL ), sSource( rLngFile ), bDBIsUTF8( bUTF8 ), - bULF( bULFFormat ), - bQuiet( bQuiet_in ) + bULF( bULFFormat ) { pLines = new LngLineList( 100, 100 ); DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US )); diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 853dcc97dc3e..bbc27dc229e7 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -134,7 +134,6 @@ private: ByteString sLanguageRestriction; ByteString sOutputFile; - bool bQuiet2; int nFileCnt; @@ -167,7 +166,7 @@ private: ); public: - SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool bQuiet2_in , bool skip_links ); + SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool skip_links ); ~SourceTreeLocalizer(); ByteString getSourceLanguages( ByteString sLanguageRestriction , ByteString sCommand ); @@ -183,11 +182,10 @@ public: /*****************************************************************************/ SourceTreeLocalizer::SourceTreeLocalizer( - const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool bQuiet2_in , bool skip_links ) + const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool skip_links ) /*****************************************************************************/ : SourceTreeIterator( rRoot, rVersion , bLocal_in ), nMode( LOCALIZE_NONE ), - bQuiet2( bQuiet2_in ), nFileCnt( 0 ) { bSkipLinks = skip_links ; @@ -323,9 +321,6 @@ void SourceTreeLocalizer::WorkOnFile( sCommand += getSourceLanguages( sLanguageRestriction , sCommand ); } - if( bQuiet2 ){ - //sCommand +=" -QQ "; - } //printf("DBG: %s\n",sCommand.GetBuffer()); if (system(sCommand.GetBuffer()) == -1) fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); @@ -485,7 +480,6 @@ void SourceTreeLocalizer::OnExecuteDirectory( const rtl::OUString &aDirectory ) { ByteString rDirectory( rtl::OUStringToOString( aDirectory , RTL_TEXTENCODING_UTF8 , aDirectory.getLength() ) ) ; if ( nMode == LOCALIZE_NONE ){ - if( !bQuiet2 ) fprintf( stdout, "%s\n", rDirectory.GetBuffer()); } else WorkOnDirectory( rDirectory ); @@ -541,7 +535,6 @@ BOOL SourceTreeLocalizer::MergeSingleFile( ByteString sFile( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - if( !bQuiet2 ) fprintf( stdout, "##### %s #####\n", sBCur.GetBuffer()); ULONG nIndex = 0; ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US ); @@ -589,9 +582,6 @@ BOOL SourceTreeLocalizer::MergeSingleFile( sCommand += " -l "; sCommand += sLanguageRestriction; } - if( bQuiet2 ){ - sCommand +=" -QQ "; - } DirEntry aPath( aEntry.GetPath()); DirEntry aOldCWD; @@ -601,7 +591,6 @@ BOOL SourceTreeLocalizer::MergeSingleFile( fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); nFileCnt++; printf("."); - //if( bQuiet2 ){ printf("."); } SvFileStream aInStream( aOut.GetFull(), STREAM_READ ); if ( !aInStream.IsOpen()) { fprintf( stderr, @@ -792,12 +781,11 @@ void Help() fprintf( stdout, "As part of the L10N framework, localize extracts and merges translations\n" "out of and into the whole source tree.\n\n" - "Syntax: localize -e -l en-US -f FileName [-QQ]\n" + "Syntax: localize -e -l en-US -f FileName \n" "Parameter:\n" "\t-e: Extract mode\n" "\tFileName: Output file when extract mode, input file when merge mode\n" "\tl1...ln: supported languages (\"all\" for all languages).\n" - "\tQQ: quiet output)" ); fprintf( stdout, @@ -840,15 +828,12 @@ int _cdecl main( int argc, char *argv[] ) BOOL bExport = FALSE; BOOL bMerge = FALSE; - bool bQuiet = false; - bool bQuiet2 = false; bool bSkipLinks = false; ByteString sLanguages; ByteString sFileName; ByteString sOutput; - bQuiet2 = true; bExport = TRUE; for( int i = 1; i < argc; i++ ) { @@ -861,17 +846,12 @@ int _cdecl main( int argc, char *argv[] ) return Error(); bExport = TRUE; } - else if( sSwitch.Equals( "-Q" )) { - bQuiet = true; - } else if ( sSwitch.Equals( "-I" ) ) nState = STATE_ISOCODE; else if ( sSwitch.Equals( "-L" ) ) nState = STATE_LANGUAGES; else if ( sSwitch.Equals( "-F" ) ) nState = STATE_FILENAME; - else if ( sSwitch.Equals( "-QQ" )) - bQuiet2 = true; else if ( ByteString( argv[ i ]).ToUpperAscii().Equals( "-O" ) ) nState = STATE_OUTPUT; else { @@ -954,10 +934,10 @@ int _cdecl main( int argc, char *argv[] ) else curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; cout << "Localizing repository " << curRepository << "\n"; - SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); + SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks ); aIter.SetLanguageRestriction( sLanguages ); if ( bExport ){ - if( bQuiet2 ){ /*printf("");*/fflush( stdout );} + fflush( stdout ); if( *iter == "ooo" ) aIter.Extract( sFileName ); else @@ -967,7 +947,7 @@ int _cdecl main( int argc, char *argv[] ) sFileNameWithExt += ByteString( (*iter).c_str() ); aIter.Extract( sFileNameWithExt ); } - if( bQuiet2 ){ printf("\n%d files found!\n",aIter.GetFileCnt());} + printf("\n%d files found!\n",aIter.GetFileCnt()); } } if( hasPwd ) @@ -975,12 +955,12 @@ int _cdecl main( int argc, char *argv[] ) string pwd; Export::getCurrentDir( pwd ); cout << "Localizing repository " << pwd << "\n"; - SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); + SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks ); aIter.SetLanguageRestriction( sLanguages ); if ( bExport ){ - if( bQuiet2 ){ /*printf("");*/fflush( stdout );} + fflush( stdout ); aIter.Extract( sFileName ); - if( bQuiet2 ){ printf("\n%d files found!\n",aIter.GetFileCnt());} + printf("\n%d files found!\n",aIter.GetFileCnt()); } } diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index dc3d2fe6a283..fa7fdb4b4376 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -61,7 +61,6 @@ BOOL bEnableExport; BOOL bMergeMode; BOOL bErrorLog; BOOL bUTF8; -bool bQuiet; ByteString sPrj; ByteString sPrjRoot; ByteString sInputFileName; @@ -87,7 +86,6 @@ extern char *GetOutputFile( int argc, char* argv[]) sInputFileName = ""; sActFileName = ""; Export::sLanguages = ""; - bQuiet = false; USHORT nState = STATE_NON; BOOL bInput = FALSE; @@ -108,9 +106,6 @@ extern char *GetOutputFile( int argc, char* argv[]) else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-M" ) { nState = STATE_MERGESRC; // next token specifies the merge database } - else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) { - bQuiet = true; - } else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-E" ) { nState = STATE_ERRORLOG; bErrorLog = FALSE; @@ -199,10 +194,6 @@ int InitXrmExport( char *pOutput , char* pFilename) return 1; } -int isQuiet(){ - if( bQuiet ) return 1; - else return 0; -} /*****************************************************************************/ int EndXrmExport() /*****************************************************************************/ -- cgit From 74544584d1fd6cfb7b059d5915f6a69da5ec189e Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Fri, 23 Jul 2010 09:25:32 +0200 Subject: jl154:#i133370# Remove 'disable' from popup menu for shared extensions --- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 87f70e449b9d..78b29624b16e 100755 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -372,11 +372,13 @@ MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long if ( ! GetEntryData( nPos )->m_bLocked ) { - if ( GetEntryData( nPos )->m_eState == REGISTERED ) - aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); - else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE ) - aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); - + if ( GetEntryData( nPos )->m_bUser ) + { + if ( GetEntryData( nPos )->m_eState == REGISTERED ) + aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); + else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE ) + aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); + } aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) ); } -- cgit From a13422099bfdb9697410d82a0f58a77689876021 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Fri, 23 Jul 2010 10:37:24 +0200 Subject: jl154 #162868# bundled folder in prereg folder --- setup_native/scripts/admin.pl | 2 +- setup_native/source/packinfo/shellscripts_extensions.txt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl index c7083a616b15..3e058af172f6 100644 --- a/setup_native/scripts/admin.pl +++ b/setup_native/scripts/admin.pl @@ -356,7 +356,7 @@ sub get_extensions_dir get_path_from_fullqualifiedname(\$localbranddir); # root dir in brand layer $localbranddir =~ s/\Q$separator\E\s*$//; my $extensiondir = $localbranddir . $separator . "share" . $separator . "extensions"; - my $preregdir = $localbranddir . $separator . "share" . $separator . "prereg"; + my $preregdir = $localbranddir . $separator . "share" . $separator . "prereg" . $separator . "bundled"; return ($extensiondir, $preregdir); } diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index ab0e3d0ac7be..6161600d9b07 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -38,7 +38,7 @@ fi if [ -x $$POSTRUN ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" ) | $$POSTRUN -b -c UNOPKG if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions" @@ -47,7 +47,7 @@ if [ -x $$POSTRUN ]; then fi else # No postrun available, try running unopkg directly - "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed" @@ -89,13 +89,13 @@ if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\"" echo "umask 022" - echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" echo "rm -rf \"$$INSTDIR\"" ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG else # No postrun available, try running unopkg directly test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0 - "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' if [ "$$?" != "0" ]; then echo "\nERROR: Removal of UNO extension failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed" @@ -138,7 +138,7 @@ else fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ]; then @@ -172,7 +172,7 @@ else fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ]; then @@ -210,7 +210,7 @@ else fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then - "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ] @@ -249,7 +249,7 @@ fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ] then - "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' fi if [ -n "$$INSTDIR" ] -- cgit From 640b52c5bd3d1e86b14d4357807b47a7ba994993 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 23 Jul 2010 13:02:53 +0200 Subject: txtl10n: removal of verbose switch --- swext/mediawiki/help/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swext/mediawiki/help/makefile.mk b/swext/mediawiki/help/makefile.mk index 010533be5689..1cb200a1860f 100644 --- a/swext/mediawiki/help/makefile.mk +++ b/swext/mediawiki/help/makefile.mk @@ -68,6 +68,6 @@ $(OUT_HELP)$/{$(MEDIAWIKI_LANG)}$/$(PACKAGE)$/%.xhp :| %.xhp $(OUT_MEDIAWIKI)$/$(TARGET).done : $(LOCALIZESDF) $(XHPFILES) $(HLANGXHPFILES) - @$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(HELPEX) -QQ -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(OUT_HELP) -y $(PACKAGE) -l all -lf $(MEDIAWIKI_LANG:t",") -m $(LOCALIZESDF) && $(TOUCH) $@ + @$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(OUT_HELP) -y $(PACKAGE) -l all -lf $(MEDIAWIKI_LANG:t",") -m $(LOCALIZESDF) && $(TOUCH) $@ .ENDIF -- cgit From 46bd6d1bdf98f9c6f8a9e143bf98200d9638f1fd Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Fri, 23 Jul 2010 18:25:10 +0200 Subject: jl154 #162868# solaris postinstall script --- setup_native/source/packinfo/shellscripts_extensions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index 6161600d9b07..e959b3adbd5e 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -64,6 +64,7 @@ exit 0 END %postremove << END + if [ -n "$$TMPDIR" ]; then UNOPKGTMP="$$TMPDIR" elif [ -n "$$TMP" ]; then -- cgit From 25291f60b2d3626cbf289233af1a9f796bcf227b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Tue, 27 Jul 2010 14:38:42 +0200 Subject: jl154 #i113463# unopkg sync fails on solaris, when there was one extension removed --- desktop/source/deployment/registry/dp_registry.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index c5e440a2a825..0f309a5b729f 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -129,7 +129,9 @@ public: virtual Reference SAL_CALL bindPackage( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, OUString const & identifier, Reference const & xCmdEnv ) - throw (deployment::DeploymentException, CommandFailedException, + throw (deployment::DeploymentException, + deployment::InvalidRemovedParameterException, + CommandFailedException, lang::IllegalArgumentException, RuntimeException); virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -461,7 +463,8 @@ void PackageRegistryImpl::update() throw (RuntimeException) Reference PackageRegistryImpl::bindPackage( OUString const & url, OUString const & mediaType_, sal_Bool bRemoved, OUString const & identifier, Reference const & xCmdEnv ) - throw (deployment::DeploymentException, CommandFailedException, + throw (deployment::DeploymentException, deployment::InvalidRemovedParameterException, + CommandFailedException, lang::IllegalArgumentException, RuntimeException) { check(); -- cgit From 7492878a15774e9741ea2fefbf183fbec557c1c1 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 27 Jul 2010 18:11:00 +0200 Subject: fwk151: Fixed problems that configuration changes notifications were not correctly sent/processed --- configmgr/source/rootaccess.cxx | 5 +++-- .../source/accelerators/acceleratorconfiguration.cxx | 19 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx index 95a346d720c2..f5d0bb137202 100644 --- a/configmgr/source/rootaccess.cxx +++ b/configmgr/source/rootaccess.cxx @@ -96,11 +96,12 @@ void RootAccess::initBroadcaster( for (ChangesListeners::iterator i(changesListeners_.begin()); i != changesListeners_.end(); ++i) { + cppu::OWeakObject* pSource = static_cast< cppu::OWeakObject * >(this); + css::uno::Reference< css::uno::XInterface > xBase( pSource, css::uno::UNO_QUERY ); broadcaster->addChangesNotification( *i, css::util::ChangesEvent( - static_cast< cppu::OWeakObject * >(this), - css::uno::makeAny(pathRepresentation_), set)); + pSource, makeAny( xBase ), set)); } } } diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 15070eed7c98..e63c41173df6 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1264,26 +1264,21 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: aChange.Accessor >>= sOrgPath; sPath = sOrgPath; - ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sPrimarySecondary); - - ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sGlobalModules); + ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); if ( sGlobalModules.equals(CFG_ENTRY_GLOBAL) ) { ::rtl::OUString sModule; - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } else if ( sGlobalModules.equals(CFG_ENTRY_MODULES) ) { - ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath); - ::rtl::OUString sDropModule = ::rtl::OUString::createFromAscii("Module['") + sModule + ::rtl::OUString::createFromAscii("']"); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sDropModule); - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } } -- cgit From b3a5ee2e9cc75c522abc81f7a6e0dd8e963b2a96 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 27 Jul 2010 18:11:00 +0200 Subject: fwk151: Fixed problems that configuration changes notifications were not correctly sent/processed --- configmgr/source/rootaccess.cxx | 5 +++-- .../source/accelerators/acceleratorconfiguration.cxx | 19 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx index 95a346d720c2..f5d0bb137202 100644 --- a/configmgr/source/rootaccess.cxx +++ b/configmgr/source/rootaccess.cxx @@ -96,11 +96,12 @@ void RootAccess::initBroadcaster( for (ChangesListeners::iterator i(changesListeners_.begin()); i != changesListeners_.end(); ++i) { + cppu::OWeakObject* pSource = static_cast< cppu::OWeakObject * >(this); + css::uno::Reference< css::uno::XInterface > xBase( pSource, css::uno::UNO_QUERY ); broadcaster->addChangesNotification( *i, css::util::ChangesEvent( - static_cast< cppu::OWeakObject * >(this), - css::uno::makeAny(pathRepresentation_), set)); + pSource, makeAny( xBase ), set)); } } } diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 15070eed7c98..e63c41173df6 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1264,26 +1264,21 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: aChange.Accessor >>= sOrgPath; sPath = sOrgPath; - ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sPrimarySecondary); - - ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sGlobalModules); + ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); if ( sGlobalModules.equals(CFG_ENTRY_GLOBAL) ) { ::rtl::OUString sModule; - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } else if ( sGlobalModules.equals(CFG_ENTRY_MODULES) ) { - ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath); - ::rtl::OUString sDropModule = ::rtl::OUString::createFromAscii("Module['") + sModule + ::rtl::OUString::createFromAscii("']"); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sDropModule); - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } } -- cgit From 64910a778a9a37dee885fca38af04205367bae9f Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 27 Jul 2010 18:11:00 +0200 Subject: fwk151: Fixed problems that configuration changes notifications were not correctly sent/processed --- unotools/inc/unotools/configpathes.hxx | 6 +++++- unotools/source/config/configpathes.cxx | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/unotools/inc/unotools/configpathes.hxx b/unotools/inc/unotools/configpathes.hxx index 2a1e76abf1fc..4e537193b22f 100644 --- a/unotools/inc/unotools/configpathes.hxx +++ b/unotools/inc/unotools/configpathes.hxx @@ -76,6 +76,9 @@ namespace utl If this is not a valid configuration path, it is interpreted as a single name of a node. + @param _sOutPath + If non-null, contains the remainder of the path upon return. + @returns The plain (non-escaped) name of the node that is the first step when traversing _sInPath.
@@ -83,7 +86,8 @@ namespace utl configuration path, it is returned unaltered. */ - UNOTOOLS_DLLPUBLIC ::rtl::OUString extractFirstFromConfigurationPath(::rtl::OUString const& _sInPath); + UNOTOOLS_DLLPUBLIC ::rtl::OUString extractFirstFromConfigurationPath( + ::rtl::OUString const& _sInPath, ::rtl::OUString* _sOutPath = 0); //---------------------------------------------------------------------------- /** check whether a path is to a nested node with respect to a parent path. diff --git a/unotools/source/config/configpathes.cxx b/unotools/source/config/configpathes.cxx index dc66854a8d43..5e7a4c80813e 100644 --- a/unotools/source/config/configpathes.cxx +++ b/unotools/source/config/configpathes.cxx @@ -154,7 +154,7 @@ sal_Bool splitLastFromConfigurationPath(OUString const& _sInPath, } //---------------------------------------------------------------------------- -OUString extractFirstFromConfigurationPath(OUString const& _sInPath) +OUString extractFirstFromConfigurationPath(OUString const& _sInPath, OUString* _sOutPath) { sal_Int32 nSep = _sInPath.indexOf('/'); sal_Int32 nBracket = _sInPath.indexOf('['); @@ -179,8 +179,7 @@ OUString extractFirstFromConfigurationPath(OUString const& _sInPath) nBracket = nEnd; } OSL_ENSURE(nEnd > nStart && _sInPath[nBracket] == ']', "Invalid config path: improper mismatch of quote or bracket"); - OSL_DEBUG_ONLY(nSep = nBracket+1); - OSL_ENSURE(nSep == _sInPath.getLength() || _sInPath[nSep] == '/', "Invalid config path: brackets not followed by slash"); + OSL_ENSURE((nBracket+1 == _sInPath.getLength() && nSep == -1) || (_sInPath[nBracket+1] == '/' && nSep == nBracket+1), "Invalid config path: brackets not followed by slash"); } else // ... but our initial element name is in simple form nStart = 0; @@ -188,6 +187,12 @@ OUString extractFirstFromConfigurationPath(OUString const& _sInPath) OUString sResult = (nEnd >= 0) ? _sInPath.copy(nStart, nEnd-nStart) : _sInPath; lcl_resolveCharEntities(sResult); + + if (_sOutPath != 0) + { + *_sOutPath = (nSep >= 0) ? _sInPath.copy(nSep + 1) : OUString(); + } + return sResult; } -- cgit From ac751d3424a43ef3729a14036473bfda71280ef9 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 28 Jul 2010 12:19:34 +0200 Subject: jl154 #i113463# processPackage_ in dp_configuration.cxx threw an IOException when revoking xcs files --- .../registry/configuration/dp_configuration.cxx | 62 +++++++++------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 9ea6e8227340..3c6680065db5 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -359,16 +359,11 @@ void BackendImpl::configmgrini_verify_init( do { OUString token( line.getToken( 0, ' ', index ).trim() ); if (token.getLength() > 0) { - // cleanup, check if existing: - if (create_ucb_content( - 0, expandUnoRcTerm(token), xCmdEnv, - false /* no throw */ )) { - //The file may not exist anymore if a shared or bundled - //extension was removed, but it can still be in the configmgrini. - //After running XExtensionManager::synchronize, the configmgrini is - //cleaned up - m_xcs_files.push_back( token ); - } + //The file may not exist anymore if a shared or bundled + //extension was removed, but it can still be in the configmgrini. + //After running XExtensionManager::synchronize, the configmgrini is + //cleaned up + m_xcs_files.push_back( token ); } } while (index >= 0); @@ -378,31 +373,15 @@ void BackendImpl::configmgrini_verify_init( sal_Int32 index = sizeof ("DATA=") - 1; do { OUString token( line.getToken( 0, ' ', index ).trim() ); - if (token.getLength() > 0) { + if (token.getLength() > 0) + { if (token[ 0 ] == '?') token = token.copy( 1 ); - // cleanup, check if existing: - if (create_ucb_content( - 0, expandUnoRcTerm(token), - xCmdEnv, false /* no throw */ )) { - //The file may not exist anymore if a shared or bundled - //extension was removed, but it can still be in the configmgrini. - //After running XExtensionManager::synchronize, the configmgrini is - //cleaned up - m_xcu_files.push_back( token ); - } - else - { - //Check if it was removed. Only when the file contained %origin, so that - //a new file was writen in the user installation (e.g. $BUNDLED_EXTENSIONS_USER) - //See also ConfigurationBackendDb.iniEntry - ::std::list iniEntries = getAllIniEntries(); - if (::std::find(iniEntries.begin(), iniEntries.end(), token) - != iniEntries.end()) - m_xcu_files.push_back( token ); - else - OSL_ENSURE(0, "Extension manager: Invalid configmgr.ini entry."); - } + //The file may not exist anymore if a shared or bundled + //extension was removed, but it can still be in the configmgrini. + //After running XExtensionManager::synchronize, the configmgrini is + //cleaned up + m_xcu_files.push_back( token ); } } while (index >= 0); @@ -502,6 +481,8 @@ bool BackendImpl::removeFromConfigmgrIni( { //in case the xcu contained %origin% then the configmr.ini contains the //url to the file in the user installation (e.g. $BUNDLED_EXTENSIONS_USER) + //However, m_url (getURL()) contains the URL for the file in the actual + //extension installatation. ::boost::optional data = readDataFromDb(url_); if (data) i = std::find(rSet.begin(), rSet.end(), data->iniEntry); @@ -757,10 +738,17 @@ void BackendImpl::PackageImpl::processPackage_( } that->m_registeredPackages->erase(i->first); } - ::ucbhelper::Content( - makeURL( that->getCachePath(), OUSTR("registry") ), - xCmdEnv ).executeCommand( - OUSTR("delete"), Any( true /* delete physically */ ) ); + try + { + ::ucbhelper::Content( + makeURL( that->getCachePath(), OUSTR("registry") ), + xCmdEnv ).executeCommand( + OUSTR("delete"), Any( true /* delete physically */ ) ); + } + catch(Exception&) + { + OSL_ASSERT(0); + } } that->deleteDataFromDb(getURL()); -- cgit From de9172871b29cea2fddbce9d5c55730f6d64754b Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 28 Jul 2010 13:01:55 +0200 Subject: fwk152: #i113454# accept broken .xcs files containing empty --- configmgr/source/xcsparser.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 79e122759fc8..37b46494c6a7 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -321,15 +321,19 @@ void XcsParser::endElement(XmlReader const & reader) { } else { switch (state_) { case STATE_COMPONENT_SCHEMA: + // To support old, broken extensions with .xcs files that contain + // empty elements: + state_ = STATE_COMPONENT_DONE; + break; + case STATE_TEMPLATES: + state_ = STATE_TEMPLATES_DONE; + break; case STATE_TEMPLATES_DONE: throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("no component element in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); - case STATE_TEMPLATES: - state_ = STATE_TEMPLATES_DONE; - break; case STATE_COMPONENT_DONE: break; default: -- cgit From 5136d89453c5a28a7143afcf58c547517d4b6758 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 28 Jul 2010 13:54:38 +0200 Subject: fwk152: #i113249# Fix broken HTML clipboard --- editeng/source/editeng/eehtml.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index 569b80639b6b..e8a2aaad22e2 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -43,7 +43,7 @@ #include #include #include - +#include #define ACTION_INSERTTEXT 1 #define ACTION_INSERTPARABRK 2 @@ -66,6 +66,16 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu nNumberingLevel = 0; bFieldsInserted = FALSE; + DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ), "EditHTMLParser::EditHTMLParser: Where does the encoding come from?" ); + DBG_ASSERT( !IsSwitchToUCS2(), "EditHTMLParser::::EditHTMLParser: Switch to UCS2?" ); + + // Altough the real default encoding is ISO8859-1, we use MS-1252 + // als default encoding. + SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); + + // If the file starts with a BOM, switch to UCS2. + SetSwitchToUCS2( TRUE ); + if ( pHTTPHeaderAttrs ) SetEncodingByHTTPHeader( pHTTPHeaderAttrs ); } -- cgit From 0a9d3dfbb7083398a3950b273bd09d1a8d4ffbcb Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 28 Jul 2010 14:49:14 +0200 Subject: #i113301# avoid problems with hyphenation within graphite ligature (thanks kstribley) --- vcl/source/glyphs/graphite_layout.cxx | 67 +++++++++++++++++++++++++++++------ vcl/win/source/gdi/winlayout.cxx | 5 +++ 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index ae7ec8246e33..2a56d4517e0b 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -594,21 +594,39 @@ bool GraphiteLayout::LayoutText(ImplLayoutArgs & rArgs) { #ifdef GRCACHE GrSegRecord * pSegRecord = NULL; - gr::Segment * pSegment = CreateSegment(rArgs, &pSegRecord); - if (!pSegment) - return false; - + gr::Segment * pSegment = NULL; + // Graphite can in rare cases crash with a zero length + if (rArgs.mnMinCharPos < rArgs.mnEndCharPos) + { + pSegment = CreateSegment(rArgs, &pSegRecord); + if (!pSegment) + return false; + } + else + { + clear(); + return true; + } // layout the glyphs as required by OpenOffice bool success = LayoutGlyphs(rArgs, pSegment, pSegRecord); if (pSegRecord) pSegRecord->unlock(); else delete pSegment; #else - gr::Segment * pSegment = CreateSegment(rArgs); - if (!pSegment) - return false; - bool success = LayoutGlyphs(rArgs, pSegment); - delete pSegment; + gr::Segment * pSegment = NULL; + bool success = true; + if (rArgs.mnMinCharPos < rArgs.mnEndCharPos) + { + pSegment = CreateSegment(rArgs); + if (!pSegment) + return false; + success = LayoutGlyphs(rArgs, pSegment); + if (pSegment) delete pSegment; + } + else + { + clear(); + } #endif return success; } @@ -722,7 +740,7 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) (GraphiteCacheHandler::instance).getCache(aFontHash); if (pCache) { - *pSegRecord = pCache->getSegment(rArgs, bRtl, nSegCharLimit); + *pSegRecord = pCache->getSegment(rArgs, bRtl, limit); if (*pSegRecord) { pSegment = (*pSegRecord)->getSegment(); @@ -736,7 +754,34 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs) (*pSegRecord)->clearVectors(); } mpTextSrc->switchLayoutArgs(rArgs); - return pSegment; + if (limit > rArgs.mnMinCharPos && limit == rArgs.mnEndCharPos + && pSegment->stopCharacter() != limit) + { + // check that the last character is not part of a ligature + glyph_set_range_t aGlyphSet = pSegment->charToGlyphs(limit - 1); + if (aGlyphSet.first == aGlyphSet.second) + { + // no glyphs associated with this glyph - occurs mid ligature + pSegment = NULL; + *pSegRecord = NULL; + } + else + { + while (aGlyphSet.first != aGlyphSet.second) + { + int lastChar = static_cast((*aGlyphSet.first).lastChar()); + if (lastChar >= limit) + { + pSegment = NULL; + *pSegRecord = NULL; + break; + } + aGlyphSet.first++; + } + } + } + if (pSegment) + return pSegment; } } #endif diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 6f0c98279e7b..806d3b420b33 100755 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2894,6 +2894,11 @@ void GraphiteWinLayout::RestoreDC(gr::Segment & segment) const bool GraphiteWinLayout::LayoutText( ImplLayoutArgs & args) { + if (args.mnMinCharPos >= args.mnEndCharPos) + { + maImpl.clear(); + return true; + } HFONT hUnRotatedFont; if (args.mnOrientation) { -- cgit From d4853323d5834584b360b5874643ea719471a49b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 28 Jul 2010 16:27:07 +0200 Subject: jl154 #i113463# some comments and rollback even when runtime exception is thrown --- .../deployment/manager/dp_extensionmanager.cxx | 8 ++++++++ .../deployment/registry/package/dp_package.cxx | 22 ++++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index de9d97db2b48..c82973f1b680 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -1136,6 +1136,14 @@ sal_Bool ExtensionManager::synchronize( bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv); progressBundled.update(OUSTR("\n\n")); + //Always determine the active extension. This is necessary for the + //first-start optimization. The setup creates the registration data for the + //bundled extensions (brand_layer/share/prereg/bundled), which is copied to the user + //installation (user_installation/extension/bundled) when a user starts OOo + //for the first time after running setup. All bundled extensions are registered + //at that moment. However, extensions with the same identifier can be in the + //shared or user repository, in which case the respective bundled extensions must + //be revoked. try { const uno::Sequence > > diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 2ad6478b665c..feb55d0af3bf 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -866,14 +866,10 @@ void BackendImpl::PackageImpl::processPackage_( try { xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv ); } - catch (RuntimeException &) { - throw; - } - catch (ucb::CommandAbortedException &) { - throw; - } - catch (Exception &) { - // CommandFailedException, DeploymentException: + catch (Exception &) + { + //We even try a rollback if the user cancelled the action (CommandAbortedException) + //in order to prevent invalid database entries. Any exc( ::cppu::getCaughtException() ); // try to handle exception, notify: bool approve = false, abort = false; @@ -904,14 +900,8 @@ void BackendImpl::PackageImpl::processPackage_( bundle[ pos ]->revokePackage( xSubAbortChannel, xCmdEnv ); } - catch (RuntimeException &) { - throw; - } - catch (ucb::CommandAbortedException &) { - throw; - } - catch (Exception &) { - // bundle rollback error: + catch (Exception &) + { OSL_ENSURE( 0, ::rtl::OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), -- cgit From 603d34f5ae0fe8cd63a1b16452432991bfa29f29 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 29 Jul 2010 14:57:46 +0200 Subject: sw33bf08: #i113461#: SvxAutoCorrect::AutoCorrect(): apply patch by dtardon: do not freeze after erasing non-breaking space inserted by French AutoCorrection --- editeng/source/misc/svxacorr.cxx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 64343517c69f..f969a8033f08 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1243,27 +1243,25 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, else if ( bIsNextRun && !IsAutoCorrectChar( cChar ) ) { // Remove the NBSP if it wasn't an autocorrection - if ( NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) && + if ( nInsPos != 0 && NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) && cChar != ' ' && cChar != '\t' && cChar != CHAR_HARDBLANK ) { // Look for the last HARD_SPACE xub_StrLen nPos = nInsPos - 1; - bool bFound = false; - while ( nPos != STRING_NOTFOUND && !bFound ) + bool bContinue = true; + while ( bContinue ) { - sal_Unicode cTmpChar = rTxt.GetChar( nPos ); + const sal_Unicode cTmpChar = rTxt.GetChar( nPos ); if ( cTmpChar == CHAR_HARDBLANK ) - bFound = true; - else if ( !NeedsHardspaceAutocorr( cTmpChar ) ) - nPos = STRING_NOTFOUND; + { + rDoc.Delete( nPos, nPos + 1 ); + nRet = AddNonBrkSpace; + bContinue = false; + } + else if ( !NeedsHardspaceAutocorr( cTmpChar ) || nPos == 0 ) + bContinue = false; nPos--; } - - if ( bFound && nPos != STRING_NOTFOUND ) - { - rDoc.Delete( nPos + 1, nPos + 2 ); - nRet = AddNonBrkSpace; - } } } } -- cgit From c37ca17cabcbaaedf59e819d5e272bc49b1d68c7 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 29 Jul 2010 16:18:26 +0200 Subject: jl154 #i162868# Copying from prereg/bundled to user/extensions/bundled failed because of file access right of temporary files in the registry data. The scripts run now chmod after unopkg sync --- setup_native/source/packinfo/shellscripts_extensions.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index e959b3adbd5e..c73e7fae5838 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -39,6 +39,7 @@ if [ -x $$POSTRUN ]; then ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0" echo "umask 022" echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;" ) | $$POSTRUN -b -c UNOPKG if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions" @@ -48,6 +49,7 @@ if [ -x $$POSTRUN ]; then else # No postrun available, try running unopkg directly "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + find "$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; if [ "$$?" != "0" ]; then echo "\nERROR: Installation of UNO extensions failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed" @@ -91,12 +93,14 @@ if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\"" echo "umask 022" echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'" + echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;" echo "rm -rf \"$$INSTDIR\"" ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG else # No postrun available, try running unopkg directly test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0 "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + echo "find \"$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;" if [ "$$?" != "0" ]; then echo "\nERROR: Removal of UNO extension failed." test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed" @@ -140,6 +144,7 @@ fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi if [ -n "$$INSTDIR" ]; then @@ -174,6 +179,7 @@ fi if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi if [ -n "$$INSTDIR" ]; then @@ -212,6 +218,7 @@ fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi if [ -n "$$INSTDIR" ] @@ -251,6 +258,7 @@ fi if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ] then "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1' + find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi if [ -n "$$INSTDIR" ] -- cgit From df927c57ac0c1843d180902eb746a572fdabbc17 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 2 Aug 2010 09:02:35 +0200 Subject: #i113563# fix compile with system-graphite (thanks cmc) --- vcl/source/glyphs/graphite_layout.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 2a56d4517e0b..5d971d4bc985 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -677,7 +677,7 @@ public: return hash; }; protected: - virtual void UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic) + virtual void UniqueCacheInfo( ext_std::wstring& stuFace, bool& fBold, bool& fItalic ) { #ifdef WIN32 dynamic_cast(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic); -- cgit From 6e027a4662f04e311670ec5f36344d931b75a589 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 3 Aug 2010 18:06:21 +0200 Subject: sw33bf08: #i113623#: stgio.cxx: fix operator delete mismatch --- sot/source/sdstor/stgio.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 00dd454233e2..2c18429b9d64 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -158,7 +158,7 @@ class EasyFat public: EasyFat( StgIo & rIo, StgStrm *pFatStream, INT32 nPSize ); - ~EasyFat() { delete pFat; delete pFree; } + ~EasyFat() { delete[] pFat; delete[] pFree; } INT32 GetPageSize() { return nPageSize; } INT32 Count() { return nPages; } INT32 operator[]( INT32 nOffset ) { return pFat[ nOffset ]; } -- cgit From fdaebfd0adb0a35d2b5a09a4ed1f93a4bb2dcbfe Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 09:54:13 +0200 Subject: mib18: #162039# clear covered cells when merging via VBA MergeCells symbol --- sc/source/ui/vba/vbarange.cxx | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index b50199f025d0..3d541fadf5d4 100755 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1206,6 +1206,14 @@ inline table::CellRangeAddress lclGetRangeAddress( const uno::Reference< RangeTy return uno::Reference< sheet::XCellRangeAddressable >( rxCellRange, uno::UNO_QUERY_THROW )->getRangeAddress(); } +void lclClearRange( const uno::Reference< table::XCellRange >& rxCellRange ) throw (uno::RuntimeException) +{ + using namespace ::com::sun::star::sheet::CellFlags; + sal_Int32 nFlags = VALUE | DATETIME | STRING | ANNOTATION | FORMULA | HARDATTR | STYLES | EDITATTR | FORMATTED; + uno::Reference< sheet::XSheetOperation > xSheetOperation( rxCellRange, uno::UNO_QUERY_THROW ); + xSheetOperation->clearContents( nFlags ); +} + uno::Reference< sheet::XSheetCellRange > lclExpandToMerged( const uno::Reference< table::XCellRange >& rxCellRange, bool bRecursive ) throw (uno::RuntimeException) { uno::Reference< sheet::XSheetCellRange > xNewCellRange( rxCellRange, uno::UNO_QUERY_THROW ); @@ -1251,15 +1259,27 @@ void lclExpandAndMerge( const uno::Reference< table::XCellRange >& rxCellRange, // Calc cannot merge over merged ranges, always unmerge first xMerge->merge( sal_False ); if( bMerge ) + { + // clear all contents of the covered cells (not the top-left cell) + table::CellRangeAddress aRangeAddr = lclGetRangeAddress( rxCellRange ); + sal_Int32 nLastColIdx = aRangeAddr.EndColumn - aRangeAddr.StartColumn; + sal_Int32 nLastRowIdx = aRangeAddr.EndRow - aRangeAddr.StartRow; + // clear cells of top row, right of top-left cell + if( nLastColIdx > 0 ) + lclClearRange( rxCellRange->getCellRangeByPosition( 1, 0, nLastColIdx, 0 ) ); + // clear all rows below top row + if( nLastRowIdx > 0 ) + lclClearRange( rxCellRange->getCellRangeByPosition( 0, 1, nLastColIdx, nLastRowIdx ) ); + // merge the range xMerge->merge( sal_True ); - // FIXME need to check whether all the cell contents are retained or lost by popping up a dialog + } } util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxCellRange ) throw (uno::RuntimeException) { /* 1) Check if range is completely inside one single merged range. To do this, try to extend from top-left cell only (not from entire range). - This will excude cases where this range consists of several merged + This will exclude cases where this range consists of several merged ranges (or parts of them). */ table::CellRangeAddress aRangeAddr = lclGetRangeAddress( rxCellRange ); uno::Reference< table::XCellRange > xTopLeft( rxCellRange->getCellRangeByPosition( 0, 0, 0, 0 ), uno::UNO_SET_THROW ); @@ -1508,7 +1528,8 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException) void ScVbaRange::Clear() throw (uno::RuntimeException) { - sal_Int32 nFlags = sheet::CellFlags::VALUE | sheet::CellFlags::STRING | sheet::CellFlags::HARDATTR | sheet::CellFlags::FORMATTED | sheet::CellFlags::EDITATTR | sheet::CellFlags::FORMULA; + using namespace ::com::sun::star::sheet::CellFlags; + sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED; ClearContents( nFlags ); } -- cgit From 403e06a2806cacd8765666f2e85b3647624bc0e6 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 09:56:54 +0200 Subject: mib18: #162937# extract all integer and floating values from an 'Any' for Boolean parameters --- sc/source/ui/vba/vbarange.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 3d541fadf5d4..fef118277d3b 100755 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -2315,8 +2315,7 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException) void ScVbaRange::setMergeCells( const uno::Any& aIsMerged ) throw (script::BasicErrorException, uno::RuntimeException) { - bool bMerge = false; - aIsMerged >>= bMerge; + bool bMerge = extractBoolFromAny( aIsMerged ); if( mxRanges.is() ) { @@ -2517,7 +2516,8 @@ ScVbaRange::setWrapText( const uno::Any& aIsWrapped ) throw (script::BasicErrorE } uno::Reference< beans::XPropertySet > xProps(mxRange, ::uno::UNO_QUERY_THROW ); - xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTextWrapped" ) ), aIsWrapped ); + bool bIsWrapped = extractBoolFromAny( aIsWrapped ); + xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTextWrapped" ) ), uno::Any( bIsWrapped ) ); } uno::Any @@ -2896,13 +2896,11 @@ ScVbaRange::setHidden( const uno::Any& _hidden ) throw (uno::RuntimeException) return; } - sal_Bool bHidden = sal_False; - _hidden >>= bHidden; - + bool bHidden = extractBoolFromAny( _hidden ); try { uno::Reference< beans::XPropertySet > xProps = getRowOrColumnProps( mxRange, mbIsRows ); - xProps->setPropertyValue( ISVISIBLE, uno::makeAny( !bHidden ) ); + xProps->setPropertyValue( ISVISIBLE, uno::Any( !bHidden ) ); } catch( uno::Exception& e ) { @@ -4931,8 +4929,7 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru if( m_Areas->getCount() > 1 ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can not set Range.ShowDetail attribute ")), uno::Reference< uno::XInterface >() ); - sal_Bool bShowDetail = sal_False; - aShowDetail >>= bShowDetail; + bool bShowDetail = extractBoolFromAny( aShowDetail ); RangeHelper helper( mxRange ); uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor(); -- cgit From d5bb7f0a4a1b9e6a0fbc1f597a1c30ddea67838a Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 09:56:54 +0200 Subject: mib18: #162937# extract all integer and floating values from an 'Any' for Boolean parameters --- vbahelper/inc/vbahelper/vbahelper.hxx | 7 +++++++ vbahelper/source/vbahelper/vbahelper.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx index a1eca84bbdf8..ccabb9114f2d 100644 --- a/vbahelper/inc/vbahelper/vbahelper.hxx +++ b/vbahelper/inc/vbahelper/vbahelper.hxx @@ -90,6 +90,13 @@ namespace ooo VBAHELPER_DLLPUBLIC void PrintOutHelper( SfxViewShell* pViewShell, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, sal_Bool bSelection ); VBAHELPER_DLLPUBLIC void PrintPreviewHelper( const css::uno::Any& EnableChanges, SfxViewShell* ); + /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value. + Returns false, if the Any is empty or contains an incompatible type. */ + VBAHELPER_DLLPUBLIC bool extractBoolFromAny( bool& rbValue, const css::uno::Any& rAny ); + /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value. + Throws, if the Any is empty or contains an incompatible type. */ + VBAHELPER_DLLPUBLIC bool extractBoolFromAny( const css::uno::Any& rAny ) throw (css::uno::RuntimeException); + VBAHELPER_DLLPUBLIC rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException ); VBAHELPER_DLLPUBLIC rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic ) VBAHELPER_DLLPUBLIC double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical); diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 7cd82dff9536..14f4e3ff1363 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -625,6 +625,30 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: dispatchExecute( pViewShell, SID_VIEWSHELL1 ); } +bool extractBoolFromAny( bool& rbValue, const uno::Any& rAny ) +{ + if( rAny >>= rbValue ) return true; + + sal_Int64 nSigned = 0; + if( rAny >>= nSigned ) { rbValue = nSigned != 0; return true; } + + sal_uInt64 nUnsigned = 0; + if( rAny >>= nUnsigned ) { rbValue = nUnsigned > 0; return true; } + + double fDouble = 0.0; + if( rAny >>= fDouble ) { rbValue = fDouble != 0.0; return true; } + + return false; +} + +bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) +{ + bool bValue = false; + if( extractBoolFromAny( bValue, rAny ) ) + return bValue; + throw uno::RuntimeException(); +} + rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException ) { uno::Type aType = pvargItem.getValueType(); -- cgit From 0140f7e96cc04269253d8e60894fa0f7ee892154 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 09:58:00 +0200 Subject: mib18: #163195# set correct parent for range returned by VBA ActiveCell symbol --- sc/source/ui/vba/vbaapplication.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 8f5aba5c4acb..af02398e5a0f 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -302,7 +302,8 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException ) sal_Int32 nCursorX = pTabView->GetCurX(); sal_Int32 nCursorY = pTabView->GetCurY(); - return new ScVbaRange( this, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) ); + uno::Reference< XHelperInterface > xParent( excel::getUnoSheetModuleObj( xRange ), uno::UNO_QUERY_THROW ); + return new ScVbaRange( xParent, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) ); } uno::Any SAL_CALL -- cgit From 84a60bade63e78c873a5fa124ccf16050b147d09 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 09:59:00 +0200 Subject: mib18: #163198# VBA Names collection must return VBA Name objects --- sc/source/ui/vba/vbanames.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index 2304874bdb1b..9fd22bf89f7a 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -173,11 +173,6 @@ ScVbaNames::getElementType() throw( css::uno::RuntimeException ) uno::Reference< container::XEnumeration > ScVbaNames::createEnumeration() throw (uno::RuntimeException) { - if ( mxNames.is() ) - { - uno::Reference< container::XEnumerationAccess > xAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); - return xAccess->createEnumeration(); - } uno::Reference< container::XEnumerationAccess > xEnumAccess( mxNames, uno::UNO_QUERY_THROW ); return new NamesEnumeration( this, mxContext, xEnumAccess->createEnumeration(), mxModel , mxNames ); } -- cgit From 20b1e3a3858913b6f63773ff5a42a972c415134d Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 4 Aug 2010 10:48:35 +0200 Subject: #i113603# only change layout shape size on init or of user call is set --- sd/source/core/sdpage.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 82a841a199c8..971bb2340069 100755 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2355,7 +2355,7 @@ SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind, } } - if ( pObj && ( pObj->IsEmptyPresObj() || !pObj->ISA(SdrGrafObj) ) ) + if ( pObj && (pObj->GetUserCall() || bInit) && ( pObj->IsEmptyPresObj() || !pObj->ISA(SdrGrafObj) ) ) pObj->AdjustToMaxRect( aRect ); return pObj; -- cgit From c7821efc469f4bff0fd2a7ddfa922088111a0408 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 4 Aug 2010 12:21:22 +0200 Subject: mib18: #163185# avoid crash when document is closed and a modal dialog is active --- toolkit/source/awt/vclxwindows.cxx | 10 +++++++++- toolkit/source/helper/unowrapper.cxx | 15 ++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 4a68b4c80e3f..68f09abfdb78 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2363,15 +2363,23 @@ sal_Int16 VCLXDialog::execute() throw(::com::sun::star::uno::RuntimeException) Dialog* pDlg = (Dialog*) GetWindow(); Window* pParent = pDlg->GetWindow( WINDOW_PARENTOVERLAP ); Window* pOldParent = NULL; + Window* pSetParent = NULL; if ( pParent && !pParent->IsReallyVisible() ) { pOldParent = pDlg->GetParent(); Window* pFrame = pDlg->GetWindow( WINDOW_FRAME ); if( pFrame != pDlg ) + { pDlg->SetParent( pFrame ); + pSetParent = pFrame; + } } + nRet = pDlg->Execute(); - if ( pOldParent ) + + // set the parent back only in case no new parent was set from outside + // in other words, revert only own changes + if ( pOldParent && pDlg->GetParent() == pSetParent ) pDlg->SetParent( pOldParent ); } return nRet; diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index d7cec7c17354..c36ae29d4531 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -318,12 +318,17 @@ void UnoWrapper::WindowDestroyed( Window* pWindow ) Window* pTopWindowChild = pWindow->GetWindow( WINDOW_FIRSTTOPWINDOWCHILD ); while ( pTopWindowChild ) { - OSL_ENSURE( pTopWindowChild->GetParent() == pWindow, "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" ); + OSL_ENSURE( pTopWindowChild->GetParent() == pWindow, + "UnoWrapper::WindowDestroyed: inconsistency in the SystemWindow relationship!" ); - uno::Reference< lang::XComponent > xComp( pTopWindowChild->GetComponentInterface( FALSE ), uno::UNO_QUERY ); - pTopWindowChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING ); - if ( xComp.is() ) - xComp->dispose(); + Window* pNextTopChild = pTopWindowChild->GetWindow( WINDOW_NEXTTOPWINDOWSIBLING ); + + //the window still could be on the stack, so we have to + // use lazy delete ( it will automatically + // disconnect from the currently destroyed parent window ) + pTopWindowChild->doLazyDelete(); + + pTopWindowChild = pNextTopChild; } } } -- cgit From 22e60c73ba7dd3b8a7dae727d5682578c6677217 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 4 Aug 2010 13:56:16 +0200 Subject: fwk151: #i110127# Better formatting --- framework/source/accelerators/acceleratorconfiguration.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index e63c41173df6..b81ef5aecf0e 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -96,6 +96,8 @@ #include +#include + //_______________________________________________ // const @@ -1248,7 +1250,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: const sal_Int32 c = aEvent.Changes.getLength(); sal_Int32 i = 0; - for (i=0; i 0 ) && ( sPath.getLength() > 0 )) + { reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); + } } } } @@ -1380,8 +1384,8 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD1; else if (sToken[k].equalsAscii("MOD2")) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD2; - else if (sToken[k].equalsAscii("MOD3")) - aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3; + else if (sToken[k].equalsAscii("MOD3")) + aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3; else { bValid = sal_False; -- cgit From 5a6f0aa8c775d3e33ee6b6eb52afe8720c4b5377 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 16:00:21 +0200 Subject: mib18: #163200# full rework of VBA symbols Application.Intersect and Application.Union --- sc/source/ui/vba/makefile.mk | 92 +++--- sc/source/ui/vba/vbaapplication.cxx | 607 ++++++++++++++---------------------- 2 files changed, 285 insertions(+), 414 deletions(-) diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk index 4cb7e3eb064b..92bb3fd39db0 100644 --- a/sc/source/ui/vba/makefile.mk +++ b/sc/source/ui/vba/makefile.mk @@ -47,63 +47,63 @@ INCPRE=$(INCCOM)$/$(TARGET) # ------------------------------------------------------------------ SLOFILES= \ - $(SLO)$/vbaglobals.obj \ - $(SLO)$/vbaworkbook.obj \ - $(SLO)$/vbaworksheets.obj \ + $(SLO)$/excelvbahelper.obj \ + $(SLO)$/service.obj \ $(SLO)$/vbaapplication.obj \ - $(SLO)$/vbarange.obj \ - $(SLO)$/vbaname.obj \ - $(SLO)$/vbanames.obj \ - $(SLO)$/vbacomment.obj \ - $(SLO)$/vbacomments.obj \ - $(SLO)$/vbaworkbooks.obj \ - $(SLO)$/vbaworksheet.obj \ - $(SLO)$/vbaoutline.obj \ - $(SLO)$/vbafont.obj\ - $(SLO)$/excelvbahelper.obj\ - $(SLO)$/vbainterior.obj\ - $(SLO)$/vbawsfunction.obj\ - $(SLO)$/vbawindow.obj\ - $(SLO)$/vbachart.obj\ - $(SLO)$/vbachartobject.obj\ - $(SLO)$/vbachartobjects.obj\ - $(SLO)$/vbaseriescollection.obj\ - $(SLO)$/vbadialogs.obj \ - $(SLO)$/vbadialog.obj \ - $(SLO)$/vbapivottable.obj \ - $(SLO)$/vbapivotcache.obj \ - $(SLO)$/vbapivottables.obj \ - $(SLO)$/vbawindows.obj \ - $(SLO)$/vbapalette.obj \ + $(SLO)$/vbaassistant.obj \ + $(SLO)$/vbaaxes.obj \ + $(SLO)$/vbaaxis.obj \ + $(SLO)$/vbaaxistitle.obj \ $(SLO)$/vbaborders.obj \ $(SLO)$/vbacharacters.obj \ - $(SLO)$/vbavalidation.obj \ - $(SLO)$/vbasheetobject.obj \ - $(SLO)$/vbasheetobjects.obj \ - $(SLO)$/vbaoleobject.obj \ - $(SLO)$/vbaoleobjects.obj \ - $(SLO)$/vbatextboxshape.obj \ - $(SLO)$/vbapane.obj \ - $(SLO)$/vbatextframe.obj \ - $(SLO)$/vbacharttitle.obj \ + $(SLO)$/vbachart.obj \ + $(SLO)$/vbachartobject.obj \ + $(SLO)$/vbachartobjects.obj \ $(SLO)$/vbacharts.obj \ - $(SLO)$/vbaaxistitle.obj \ - $(SLO)$/vbaaxes.obj \ - $(SLO)$/vbaaxis.obj \ - $(SLO)$/vbaformat.obj \ + $(SLO)$/vbacharttitle.obj \ + $(SLO)$/vbacomment.obj \ + $(SLO)$/vbacomments.obj \ $(SLO)$/vbacondition.obj \ + $(SLO)$/vbadialog.obj \ + $(SLO)$/vbadialogs.obj \ + $(SLO)$/vbaeventshelper.obj \ + $(SLO)$/vbafont.obj \ + $(SLO)$/vbaformat.obj \ $(SLO)$/vbaformatcondition.obj \ $(SLO)$/vbaformatconditions.obj \ - $(SLO)$/vbastyle.obj \ - $(SLO)$/vbastyles.obj \ - $(SLO)$/vbaassistant.obj \ + $(SLO)$/vbaglobals.obj \ $(SLO)$/vbahyperlink.obj \ $(SLO)$/vbahyperlinks.obj \ - $(SLO)$/vbapagesetup.obj \ + $(SLO)$/vbainterior.obj \ + $(SLO)$/vbaname.obj \ + $(SLO)$/vbanames.obj \ + $(SLO)$/vbaoleobject.obj \ + $(SLO)$/vbaoleobjects.obj \ + $(SLO)$/vbaoutline.obj \ $(SLO)$/vbapagebreak.obj \ $(SLO)$/vbapagebreaks.obj \ - $(SLO)$/vbaeventshelper.obj \ - $(SLO)$/service.obj + $(SLO)$/vbapagesetup.obj \ + $(SLO)$/vbapalette.obj \ + $(SLO)$/vbapane.obj \ + $(SLO)$/vbapivotcache.obj \ + $(SLO)$/vbapivottable.obj \ + $(SLO)$/vbapivottables.obj \ + $(SLO)$/vbarange.obj \ + $(SLO)$/vbaseriescollection.obj \ + $(SLO)$/vbasheetobject.obj \ + $(SLO)$/vbasheetobjects.obj \ + $(SLO)$/vbastyle.obj \ + $(SLO)$/vbastyles.obj \ + $(SLO)$/vbatextboxshape.obj \ + $(SLO)$/vbatextframe.obj \ + $(SLO)$/vbavalidation.obj \ + $(SLO)$/vbawindow.obj \ + $(SLO)$/vbawindows.obj \ + $(SLO)$/vbaworkbook.obj \ + $(SLO)$/vbaworkbooks.obj \ + $(SLO)$/vbaworksheet.obj \ + $(SLO)$/vbaworksheets.obj \ + $(SLO)$/vbawsfunction.obj .ENDIF # --- Targets ------------------------------------------------------ diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index af02398e5a0f..f3965393e919 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -88,12 +88,6 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -// Enable our own join detection for Intersection and Union -// should be more efficient than using ScRangeList::Join ( because -// we already are testing the same things ) - -#define OWN_JOIN 1 - // #TODO is this defined somewhere else? #if ( defined UNX ) || ( defined OS2 ) //unix #define FILE_PATH_SEPERATOR "/" @@ -806,412 +800,289 @@ ScVbaApplication::PathSeparator( ) throw (script::BasicErrorException, uno::Run return sPathSep; } -typedef std::list< ScRange > Ranges; -typedef std::list< ScRangeList > RangesList; +// ---------------------------------------------------------------------------- +// Helpers for Intersect and Union + +namespace { + +typedef ::std::list< ScRange > ListOfScRange; -void lcl_addRangesToVec( RangesList& vRanges, const uno::Any& aArg ) throw ( script::BasicErrorException, uno::RuntimeException ) +/** Appends all ranges of a VBA Range object in the passed Any to the list of ranges. */ +void lclAddToListOfScRange( ListOfScRange& rList, const uno::Any& rArg ) + throw (script::BasicErrorException, uno::RuntimeException) { - ScRangeList theRanges; - uno::Reference< excel::XRange > xRange( aArg, uno::UNO_QUERY_THROW ); - uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW ); - sal_Int32 nCount = xCol->getCount(); - for( sal_Int32 i = 1; i <= nCount; ++i ) + if( rArg.hasValue() ) { - uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::makeAny( sal_Int32(i) ), uno::Any() ), uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW ); - table::CellRangeAddress addr = xAddressable->getRangeAddress(); - ScRange refRange; - ScUnoConversion::FillScRange( refRange, addr ); - theRanges.Append( refRange ); + uno::Reference< excel::XRange > xRange( rArg, uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW ); + for( sal_Int32 nIdx = 1, nCount = xCol->getCount(); nIdx <= nCount; ++nIdx ) + { + uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::Any( nIdx ), uno::Any() ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW ); + ScRange aScRange; + ScUnoConversion::FillScRange( aScRange, xAddressable->getRangeAddress() ); + rList.push_back( aScRange ); + } } - vRanges.push_back( theRanges ); } -void lcl_addRangeToVec( Ranges& vRanges, const uno::Any& aArg ) throw ( script::BasicErrorException, uno::RuntimeException ) +/** Returns true, if the passed ranges can be expressed by a single range. The + new range will be contained in r1 then, the range r2 can be removed. */ +bool lclTryJoin( ScRange& r1, const ScRange& r2 ) { - uno::Reference< excel::XRange > xRange( aArg, uno::UNO_QUERY_THROW ); - uno::Reference< XCollection > xCol( xRange->Areas( uno::Any() ), uno::UNO_QUERY_THROW ); - sal_Int32 nCount = xCol->getCount(); - for( sal_Int32 i = 1; i <= nCount; ++i ) + // 1) r2 is completely inside r1 + if( r1.In( r2 ) ) + return true; + + // 2) r1 is completely inside r2 + if( r2.In( r1 ) ) { - uno::Reference< excel::XRange > xAreaRange( xCol->Item( uno::makeAny( sal_Int32(i) ), uno::Any() ), uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xAreaRange->getCellRange(), uno::UNO_QUERY_THROW ); - table::CellRangeAddress addr = xAddressable->getRangeAddress(); - ScRange refRange; - ScUnoConversion::FillScRange( refRange, addr ); - vRanges.push_back( refRange ); + r1 = r2; + return true; } -} -bool lcl_canJoin( ScRange& r1, ScRange& r2 ) -{ - bool bCanJoin = false; - SCCOL startEndColDiff = r2.aStart.Col() - r1.aEnd.Col(); - SCROW startEndRowDiff = r2.aStart.Row() - r1.aEnd.Row(); - SCCOL startColDiff = r2.aStart.Col() - r1.aStart.Col(); - SCCOL endColDiff = r2.aEnd.Col() - r1.aEnd.Col(); - SCROW startRowDiff = r2.aStart.Row() - r1.aStart.Row(); - SCROW endRowDiff = r2.aEnd.Row() - r1.aEnd.Row(); - if ( ( startRowDiff == endRowDiff ) && startRowDiff == 0 && startColDiff >=0 && endColDiff > 0 && ( startEndColDiff <= 1 && startEndColDiff >= -r1.aEnd.Col() ) ) - bCanJoin = true; - else if ( ( startColDiff == endColDiff ) && startColDiff == 0 && startRowDiff >= 0 && endRowDiff > 0 && ( startEndRowDiff <= 1 && startEndRowDiff >= -r1.aEnd.Row() ) ) - bCanJoin = true; -#ifdef DEBUG - String sr1; - String sr2; - r1.Format( sr1, SCA_VALID ) ; - r2.Format( sr2, SCA_VALID ) ; - OSL_TRACE(" canJoin address %s with %s %s ( startRowDiff(%d), endRowDiff(%d), startColDiff(%d) endColDiff(%d) startEndRowDiff(%d), startEndColDiff(%d) ", - rtl::OUStringToOString( sr1, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( sr2, RTL_TEXTENCODING_UTF8 ).getStr(), bCanJoin ? "true" : "false", startRowDiff, endRowDiff, startColDiff, endColDiff, startEndRowDiff, startEndColDiff ); -#endif - return bCanJoin; -} -// strips out ranges that contain other ranges, also -// if the borders of the intersecting ranges are alligned -// then the the range is extended to the larger -// e.g. Range("A4:D10"), Range("B4:E10") would be combined -// to Range("A4:E10") -void lcl_strip_containedRanges( Ranges& vRanges ) -{ - // get rid of ranges that are surrounded by other ranges - Ranges::iterator it_outer = vRanges.begin(); - while( it_outer != vRanges.end() ) + SCCOL n1L = r1.aStart.Col(); + SCCOL n1R = r1.aEnd.Col(); + SCROW n1T = r1.aStart.Row(); + SCROW n1B = r1.aEnd.Row(); + SCCOL n2L = r2.aStart.Col(); + SCCOL n2R = r2.aEnd.Col(); + SCROW n2T = r2.aStart.Row(); + SCROW n2B = r2.aEnd.Row(); + + // 3) r1 and r2 have equal upper and lower border + if( (n1T == n2T) && (n1B == n2B) ) { - bool it_outer_erased = false; // true = it_outer erased from vRanges - Ranges::iterator it_inner = vRanges.begin(); - /* Exit the inner loop if outer iterator has been erased in its last - iteration (this means it has been joined to last it_inner, or that - the it_inner contains it completely). The inner loop will restart - with next element of the outer loop, and all elements (from the - beginning of the list) will be checked against that new element. */ - while( !it_outer_erased && (it_inner != vRanges.end()) ) + // check that r1 overlaps or touches r2 + if( ((n1L < n2L) && (n2L - 1 <= n1R)) || ((n2L < n1L) && (n1L - 1 <= n2R)) ) { - bool it_inner_erased = false; // true = it_inner erased from vRanges - if ( it_outer != it_inner ) - { -#ifdef DEBUG - String r1; - String r2; - it_outer->Format( r1, SCA_VALID ) ; - it_inner->Format( r2, SCA_VALID ) ; - OSL_TRACE( "try strip/join address %s with %s ", - rtl::OUStringToOString( r1, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( r2, RTL_TEXTENCODING_UTF8 ).getStr() ); -#endif - if ( it_outer->In( *it_inner ) ) - { - it_inner = vRanges.erase( it_inner ); - it_inner_erased = true; - } - else if ( it_inner->In( *it_outer ) ) - { - it_outer = vRanges.erase( it_outer ); - it_outer_erased = true; - } -#ifndef OWN_JOIN - else if ( (*it_inner).aStart.Row() == (*it_outer).aStart.Row() - && (*it_inner).aEnd.Row() == (*it_outer).aEnd.Row() ) - { - it_outer->ExtendTo( *it_inner ); - it_inner = vRanges.erase( it_inner ); - it_inner_erased = true; - } -#else - else if ( lcl_canJoin( *it_outer, *it_inner ) ) - { - it_outer->ExtendTo( *it_inner ); - it_inner = vRanges.erase( it_inner ); - it_inner_erased = true; - } - else if ( lcl_canJoin( *it_inner, *it_outer) ) - { - it_inner->ExtendTo( *it_outer ); - it_outer = vRanges.erase( it_outer ); - it_outer_erased = true; - } -#endif - } - /* If it_inner has not been erased from vRanges, continue inner - loop with next element. Otherwise, it_inner already points to - the next element (return value of list::erase()). */ - if( !it_inner_erased ) - ++it_inner; + r1.aStart.SetCol( ::std::min( n1L, n2L ) ); + r1.aEnd.SetCol( ::std::max( n1R, n2R ) ); + return true; } - /* If it_outer has not been erased from vRanges, continue outer loop - with next element. Otherwise, it_outer already points to the next - element (return value of list::erase()). */ - if( !it_outer_erased ) - ++it_outer; + return false; } + // 4) r1 and r2 have equal left and right border + if( (n1L == n2L) && (n1R == n2R) ) + { + // check that r1 overlaps or touches r2 + if( ((n1T < n2T) && (n2T + 1 <= n1B)) || ((n2T < n1T) && (n1T + 1 <= n2B)) ) + { + r1.aStart.SetRow( ::std::min( n1T, n2T ) ); + r1.aEnd.SetRow( ::std::max( n1B, n2B ) ); + return true; + } + return false; + } + + // 5) cannot join these ranges + return false; } -Ranges -lcl_intersectionImpl( ScRangeList& rl1, ScRangeList& rl2 ) +/** Strips out ranges that are contained by other ranges, joins ranges that can be joined + together (aligned borders, e.g. A4:D10 and B4:E10 would be combined to A4:E10. */ +void lclJoinRanges( ListOfScRange& rList ) { - Ranges intersections; - for ( USHORT x = 0 ; x < rl1.Count(); ++x ) + ListOfScRange::iterator aOuterIt = rList.begin(); + while( aOuterIt != rList.end() ) { - for ( USHORT y = 0 ; y < rl2.Count(); ++y ) + bool bAnyErased = false; // true = any range erased from rList + ListOfScRange::iterator aInnerIt = rList.begin(); + while( aInnerIt != rList.end() ) { -#ifdef DEBUG - String r1; - String r2; - rl1.GetObject( x )->Format( r1, SCA_VALID ) ; - rl2.GetObject( y )->Format( r2, SCA_VALID ) ; - OSL_TRACE( "comparing address %s with %s ", - rtl::OUStringToOString( r1, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( r2, RTL_TEXTENCODING_UTF8 ).getStr() ); -#endif - if( rl1.GetObject( x )->Intersects( *rl2.GetObject( y ) ) ) + bool bInnerErased = false; // true = aInnerIt erased from rList + // do not compare a range with itself + if( (aOuterIt != aInnerIt) && lclTryJoin( *aOuterIt, *aInnerIt ) ) { - ScRange aIntersection = ScRange( Max( rl1.GetObject( x )->aStart.Col(), rl2.GetObject( y )->aStart.Col() ), - Max( rl1.GetObject( x )->aStart.Row(), rl2.GetObject( y )->aStart.Row() ), - Max( rl1.GetObject( x )->aStart.Tab(), rl2.GetObject( y )->aStart.Tab() ), - Min( rl1.GetObject( x )->aEnd.Col(), rl2.GetObject( y )->aEnd.Col() ), - Min( rl1.GetObject( x )->aEnd.Row(), rl2.GetObject( y )->aEnd.Row() ), - Min( rl1.GetObject( x )->aEnd.Tab(), rl2.GetObject( y )->aEnd.Tab() ) ); - intersections.push_back( aIntersection ); + // aOuterIt points to joined range, aInnerIt will be removed + aInnerIt = rList.erase( aInnerIt ); + bInnerErased = bAnyErased = true; } + /* If aInnerIt has been erased from rList, it already points to + the next element (return value of list::erase()). */ + if( !bInnerErased ) + ++aInnerIt; } + // if any range has been erased, repeat outer loop with the same range + if( !bAnyErased ) + ++aOuterIt; } - lcl_strip_containedRanges( intersections ); - return intersections; } -// Intersection of a set of ranges ( where each range is represented by a ScRangeList e.g. -// any range can be a multi-area range ) -// An intersection is performed between each range in the set of ranges. -// The resulting set of intersections is then processed to strip out any -// intersections that contain other intersections ( and also ranges that directly line up -// are joined ) ( see lcl_strip_containedRanges ) -RangesList lcl_intersections( RangesList& vRanges ) +/** Intersects the passed list with all ranges of a VBA Range object in the passed Any. */ +void lclIntersectRanges( ListOfScRange& rList, const uno::Any& rArg ) + throw (script::BasicErrorException, uno::RuntimeException) { - RangesList intersections; - RangesList::iterator it = vRanges.begin(); - while( it != vRanges.end() ) + // extract the ranges from the passed argument, will throw on invalid data + ListOfScRange aList2; + lclAddToListOfScRange( aList2, rArg ); + // do nothing, if the passed list is already empty + if( !rList.empty() && !aList2.empty() ) { - Ranges intermediateList; - for( RangesList::iterator it_inner = vRanges.begin(); it_inner != vRanges.end(); ++it_inner ) + // save original list in a local + ListOfScRange aList1; + aList1.swap( rList ); + // join ranges from passed argument + lclJoinRanges( aList2 ); + // calculate intersection of the ranges in both lists + for( ListOfScRange::const_iterator aOuterIt = aList1.begin(), aOuterEnd = aList1.end(); aOuterIt != aOuterEnd; ++aOuterIt ) { - if ( it != it_inner ) + for( ListOfScRange::const_iterator aInnerIt = aList2.begin(), aInnerEnd = aList2.end(); aInnerIt != aInnerEnd; ++aInnerIt ) { - Ranges ranges = lcl_intersectionImpl( *it, *it_inner ); - for ( Ranges::iterator range_it = ranges.begin(); range_it != ranges.end(); ++range_it ) - intermediateList.push_back( *range_it ); + if( aOuterIt->Intersects( *aInnerIt ) ) + { + ScRange aIsectRange( + Max( aOuterIt->aStart.Col(), aInnerIt->aStart.Col() ), + Max( aOuterIt->aStart.Row(), aInnerIt->aStart.Row() ), + Max( aOuterIt->aStart.Tab(), aInnerIt->aStart.Tab() ), + Min( aOuterIt->aEnd.Col(), aInnerIt->aEnd.Col() ), + Min( aOuterIt->aEnd.Row(), aInnerIt->aEnd.Row() ), + Min( aOuterIt->aEnd.Tab(), aInnerIt->aEnd.Tab() ) ); + rList.push_back( aIsectRange ); + } } } - it = vRanges.erase( it ); // remove it so we don't include it in the next pass. - // 'it' is removed uncontidionally from vRanges, so the while loop will terminate - - ScRangeList argIntersect; - lcl_strip_containedRanges( intermediateList ); - - for( Ranges::iterator it_inter = intermediateList.begin(); it_inter != intermediateList.end(); ++it_inter ) -#ifndef OWN_JOIN - argIntersect.Join( *it_inter ); -#else - argIntersect.Append( *it_inter ); -#endif - - intersections.push_back( argIntersect ); - } - return intersections; -} - -uno::Reference< excel::XRange > SAL_CALL -ScVbaApplication::Intersect( const uno::Reference< excel::XRange >& Arg1, const uno::Reference< excel::XRange >& Arg2, const uno::Any& Arg3, const uno::Any& Arg4, const uno::Any& Arg5, const uno::Any& Arg6, const uno::Any& Arg7, const uno::Any& Arg8, const uno::Any& Arg9, const uno::Any& Arg10, const uno::Any& Arg11, const uno::Any& Arg12, const uno::Any& Arg13, const uno::Any& Arg14, const uno::Any& Arg15, const uno::Any& Arg16, const uno::Any& Arg17, const uno::Any& Arg18, const uno::Any& Arg19, const uno::Any& Arg20, const uno::Any& Arg21, const uno::Any& Arg22, const uno::Any& Arg23, const uno::Any& Arg24, const uno::Any& Arg25, const uno::Any& Arg26, const uno::Any& Arg27, const uno::Any& Arg28, const uno::Any& Arg29, const uno::Any& Arg30 ) throw (script::BasicErrorException, uno::RuntimeException) -{ - if ( !Arg1.is() || !Arg2.is() ) - DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); - - RangesList vRanges; - lcl_addRangesToVec( vRanges, uno::makeAny( Arg1 ) ); - lcl_addRangesToVec( vRanges, uno::makeAny( Arg2 ) ); - - if ( Arg3.hasValue() ) - lcl_addRangesToVec( vRanges, Arg3 ); - if ( Arg4.hasValue() ) - lcl_addRangesToVec( vRanges, Arg4 ); - if ( Arg5.hasValue() ) - lcl_addRangesToVec( vRanges, Arg5 ); - if ( Arg6.hasValue() ) - lcl_addRangesToVec( vRanges, Arg6 ); - if ( Arg7.hasValue() ) - lcl_addRangesToVec( vRanges, Arg7 ); - if ( Arg8.hasValue() ) - lcl_addRangesToVec( vRanges, Arg8 ); - if ( Arg9.hasValue() ) - lcl_addRangesToVec( vRanges, Arg9 ); - if ( Arg10.hasValue() ) - lcl_addRangesToVec( vRanges, Arg10 ); - if ( Arg11.hasValue() ) - lcl_addRangesToVec( vRanges, Arg11 ); - if ( Arg12.hasValue() ) - lcl_addRangesToVec( vRanges, Arg12 ); - if ( Arg13.hasValue() ) - lcl_addRangesToVec( vRanges, Arg13 ); - if ( Arg14.hasValue() ) - lcl_addRangesToVec( vRanges, Arg14 ); - if ( Arg15.hasValue() ) - lcl_addRangesToVec( vRanges, Arg15 ); - if ( Arg16.hasValue() ) - lcl_addRangesToVec( vRanges, Arg16 ); - if ( Arg17.hasValue() ) - lcl_addRangesToVec( vRanges, Arg17 ); - if ( Arg18.hasValue() ) - lcl_addRangesToVec( vRanges, Arg18 ); - if ( Arg19.hasValue() ) - lcl_addRangesToVec( vRanges, Arg19 ); - if ( Arg20.hasValue() ) - lcl_addRangesToVec( vRanges, Arg20 ); - if ( Arg21.hasValue() ) - lcl_addRangesToVec( vRanges, Arg21 ); - if ( Arg22.hasValue() ) - lcl_addRangesToVec( vRanges, Arg22 ); - if ( Arg23.hasValue() ) - lcl_addRangesToVec( vRanges, Arg23 ); - if ( Arg24.hasValue() ) - lcl_addRangesToVec( vRanges, Arg24 ); - if ( Arg25.hasValue() ) - lcl_addRangesToVec( vRanges, Arg25 ); - if ( Arg26.hasValue() ) - lcl_addRangesToVec( vRanges, Arg26 ); - if ( Arg27.hasValue() ) - lcl_addRangesToVec( vRanges, Arg27 ); - if ( Arg28.hasValue() ) - lcl_addRangesToVec( vRanges, Arg28 ); - if ( Arg29.hasValue() ) - lcl_addRangesToVec( vRanges, Arg29 ); - if ( Arg30.hasValue() ) - lcl_addRangesToVec( vRanges, Arg30 ); - - uno::Reference< excel::XRange > xRefRange; - - ScRangeList aCellRanges; - // first pass - gets the set of all possible interections of Arg1..ArgN - RangesList intersections = lcl_intersections( vRanges ); - // second pass - gets the intersections of the intersections ( don't ask, but this - // is what seems to happen ) - if ( intersections.size() > 1) - intersections = lcl_intersections( intersections ); - for( RangesList::iterator it = intersections.begin(); it != intersections.end(); ++it ) - { - for ( USHORT x = 0 ; x < it->Count(); ++x ) -#ifndef OWN_JOIN - aCellRanges.Join( *it->GetObject(x) ); -#else - aCellRanges.Append( *it->GetObject(x) ); -#endif + // again, join the result ranges + lclJoinRanges( rList ); } - - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - ScDocShell* pDocShell = excel::getDocShell( xModel ); - if ( aCellRanges.Count() == 1 ) - { - uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() )); - xRefRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), mxContext, xRange ); - } - else if ( aCellRanges.Count() > 1 ) - { - uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) ); - xRefRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ) , mxContext, xRanges ); - - } - return xRefRange; } -uno::Reference< excel::XRange > SAL_CALL -ScVbaApplication::Union( const uno::Reference< excel::XRange >& Arg1, const uno::Reference< excel::XRange >& Arg2, const uno::Any& Arg3, const uno::Any& Arg4, const uno::Any& Arg5, const uno::Any& Arg6, const uno::Any& Arg7, const uno::Any& Arg8, const uno::Any& Arg9, const uno::Any& Arg10, const uno::Any& Arg11, const uno::Any& Arg12, const uno::Any& Arg13, const uno::Any& Arg14, const uno::Any& Arg15, const uno::Any& Arg16, const uno::Any& Arg17, const uno::Any& Arg18, const uno::Any& Arg19, const uno::Any& Arg20, const uno::Any& Arg21, const uno::Any& Arg22, const uno::Any& Arg23, const uno::Any& Arg24, const uno::Any& Arg25, const uno::Any& Arg26, const uno::Any& Arg27, const uno::Any& Arg28, const uno::Any& Arg29, const uno::Any& Arg30 ) throw (script::BasicErrorException, uno::RuntimeException) +/** Creates a VBA Range object from the passed list of ranges. */ +uno::Reference< excel::XRange > lclCreateVbaRange( + const uno::Reference< uno::XComponentContext >& rxContext, + const uno::Reference< frame::XModel >& rxModel, + const ListOfScRange& rList ) throw (uno::RuntimeException) { - if ( !Arg1.is() || !Arg2.is() ) - DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); - - uno::Reference< excel::XRange > xRange; - Ranges vRanges; - lcl_addRangeToVec( vRanges, uno::makeAny( Arg1 ) ); - lcl_addRangeToVec( vRanges, uno::makeAny( Arg2 ) ); - - if ( Arg3.hasValue() ) - lcl_addRangeToVec( vRanges, Arg3 ); - if ( Arg4.hasValue() ) - lcl_addRangeToVec( vRanges, Arg4 ); - if ( Arg5.hasValue() ) - lcl_addRangeToVec( vRanges, Arg5 ); - if ( Arg6.hasValue() ) - lcl_addRangeToVec( vRanges, Arg6 ); - if ( Arg7.hasValue() ) - lcl_addRangeToVec( vRanges, Arg7 ); - if ( Arg8.hasValue() ) - lcl_addRangeToVec( vRanges, Arg8 ); - if ( Arg9.hasValue() ) - lcl_addRangeToVec( vRanges, Arg9 ); - if ( Arg10.hasValue() ) - lcl_addRangeToVec( vRanges, Arg10 ); - if ( Arg11.hasValue() ) - lcl_addRangeToVec( vRanges, Arg11 ); - if ( Arg12.hasValue() ) - lcl_addRangeToVec( vRanges, Arg12 ); - if ( Arg13.hasValue() ) - lcl_addRangeToVec( vRanges, Arg13 ); - if ( Arg14.hasValue() ) - lcl_addRangeToVec( vRanges, Arg14 ); - if ( Arg15.hasValue() ) - lcl_addRangeToVec( vRanges, Arg15 ); - if ( Arg16.hasValue() ) - lcl_addRangeToVec( vRanges, Arg16 ); - if ( Arg17.hasValue() ) - lcl_addRangeToVec( vRanges, Arg17 ); - if ( Arg18.hasValue() ) - lcl_addRangeToVec( vRanges, Arg18 ); - if ( Arg19.hasValue() ) - lcl_addRangeToVec( vRanges, Arg19 ); - if ( Arg20.hasValue() ) - lcl_addRangeToVec( vRanges, Arg20 ); - if ( Arg21.hasValue() ) - lcl_addRangeToVec( vRanges, Arg21 ); - if ( Arg22.hasValue() ) - lcl_addRangeToVec( vRanges, Arg22 ); - if ( Arg23.hasValue() ) - lcl_addRangeToVec( vRanges, Arg23 ); - if ( Arg24.hasValue() ) - lcl_addRangeToVec( vRanges, Arg24 ); - if ( Arg25.hasValue() ) - lcl_addRangeToVec( vRanges, Arg25 ); - if ( Arg26.hasValue() ) - lcl_addRangeToVec( vRanges, Arg26 ); - if ( Arg27.hasValue() ) - lcl_addRangeToVec( vRanges, Arg27 ); - if ( Arg28.hasValue() ) - lcl_addRangeToVec( vRanges, Arg28 ); - if ( Arg29.hasValue() ) - lcl_addRangeToVec( vRanges, Arg29 ); - if ( Arg30.hasValue() ) - lcl_addRangeToVec( vRanges, Arg30 ); + ScDocShell* pDocShell = excel::getDocShell( rxModel ); + if( !pDocShell ) throw uno::RuntimeException(); ScRangeList aCellRanges; - lcl_strip_containedRanges( vRanges ); + for( ListOfScRange::const_iterator aIt = rList.begin(), aEnd = rList.end(); aIt != aEnd; ++aIt ) + aCellRanges.Append( *aIt ); - for( Ranges::iterator it = vRanges.begin(); it != vRanges.end(); ++it ) - aCellRanges.Append( *it ); - - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - ScDocShell* pDocShell = excel::getDocShell( xModel ); - if ( aCellRanges.Count() == 1 ) + if( aCellRanges.Count() == 1 ) { - // normal range - uno::Reference< table::XCellRange > xCalcRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ) ); - xRange = new ScVbaRange( excel::getUnoSheetModuleObj( xCalcRange ), mxContext, xCalcRange ); + uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ) ); + return new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), rxContext, xRange ); } - else if ( aCellRanges.Count() > 1 ) // Multi-Area + if( aCellRanges.Count() > 1 ) { uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) ); - xRange = new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), mxContext, xRanges ); + return new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), rxContext, xRanges ); } - - // #FIXME need proper (WorkSheet) parent - return xRange; + return 0; +} + +} // namespace + +// ---------------------------------------------------------------------------- + +uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Intersect( + const uno::Reference< excel::XRange >& rArg1, const uno::Reference< excel::XRange >& rArg2, + const uno::Any& rArg3, const uno::Any& rArg4, const uno::Any& rArg5, const uno::Any& rArg6, + const uno::Any& rArg7, const uno::Any& rArg8, const uno::Any& rArg9, const uno::Any& rArg10, + const uno::Any& rArg11, const uno::Any& rArg12, const uno::Any& rArg13, const uno::Any& rArg14, + const uno::Any& rArg15, const uno::Any& rArg16, const uno::Any& rArg17, const uno::Any& rArg18, + const uno::Any& rArg19, const uno::Any& rArg20, const uno::Any& rArg21, const uno::Any& rArg22, + const uno::Any& rArg23, const uno::Any& rArg24, const uno::Any& rArg25, const uno::Any& rArg26, + const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 ) + throw (script::BasicErrorException, uno::RuntimeException) +{ + if( !rArg1.is() || !rArg2.is() ) + DebugHelper::exception( SbERR_BAD_PARAMETER, rtl::OUString() ); + + // initialize the result list with 1st parameter, join its ranges together + ListOfScRange aList; + lclAddToListOfScRange( aList, uno::Any( rArg1 ) ); + lclJoinRanges( aList ); + + // process all other parameters, this updates the list with intersection + lclIntersectRanges( aList, uno::Any( rArg2 ) ); + lclIntersectRanges( aList, rArg3 ); + lclIntersectRanges( aList, rArg4 ); + lclIntersectRanges( aList, rArg5 ); + lclIntersectRanges( aList, rArg6 ); + lclIntersectRanges( aList, rArg7 ); + lclIntersectRanges( aList, rArg8 ); + lclIntersectRanges( aList, rArg9 ); + lclIntersectRanges( aList, rArg10 ); + lclIntersectRanges( aList, rArg11 ); + lclIntersectRanges( aList, rArg12 ); + lclIntersectRanges( aList, rArg13 ); + lclIntersectRanges( aList, rArg14 ); + lclIntersectRanges( aList, rArg15 ); + lclIntersectRanges( aList, rArg16 ); + lclIntersectRanges( aList, rArg17 ); + lclIntersectRanges( aList, rArg18 ); + lclIntersectRanges( aList, rArg19 ); + lclIntersectRanges( aList, rArg20 ); + lclIntersectRanges( aList, rArg21 ); + lclIntersectRanges( aList, rArg22 ); + lclIntersectRanges( aList, rArg23 ); + lclIntersectRanges( aList, rArg24 ); + lclIntersectRanges( aList, rArg25 ); + lclIntersectRanges( aList, rArg26 ); + lclIntersectRanges( aList, rArg27 ); + lclIntersectRanges( aList, rArg28 ); + lclIntersectRanges( aList, rArg29 ); + lclIntersectRanges( aList, rArg30 ); + + // create the VBA Range object + return lclCreateVbaRange( mxContext, getCurrentDocument(), aList ); +} + +uno::Reference< excel::XRange > SAL_CALL ScVbaApplication::Union( + const uno::Reference< excel::XRange >& rArg1, const uno::Reference< excel::XRange >& rArg2, + const uno::Any& rArg3, const uno::Any& rArg4, const uno::Any& rArg5, const uno::Any& rArg6, + const uno::Any& rArg7, const uno::Any& rArg8, const uno::Any& rArg9, const uno::Any& rArg10, + const uno::Any& rArg11, const uno::Any& rArg12, const uno::Any& rArg13, const uno::Any& rArg14, + const uno::Any& rArg15, const uno::Any& rArg16, const uno::Any& rArg17, const uno::Any& rArg18, + const uno::Any& rArg19, const uno::Any& rArg20, const uno::Any& rArg21, const uno::Any& rArg22, + const uno::Any& rArg23, const uno::Any& rArg24, const uno::Any& rArg25, const uno::Any& rArg26, + const uno::Any& rArg27, const uno::Any& rArg28, const uno::Any& rArg29, const uno::Any& rArg30 ) + throw (script::BasicErrorException, uno::RuntimeException) +{ + if( !rArg1.is() || !rArg2.is() ) + DebugHelper::exception( SbERR_BAD_PARAMETER, rtl::OUString() ); + + ListOfScRange aList; + lclAddToListOfScRange( aList, uno::Any( rArg1 ) ); + lclAddToListOfScRange( aList, uno::Any( rArg2 ) ); + lclAddToListOfScRange( aList, rArg3 ); + lclAddToListOfScRange( aList, rArg4 ); + lclAddToListOfScRange( aList, rArg5 ); + lclAddToListOfScRange( aList, rArg6 ); + lclAddToListOfScRange( aList, rArg7 ); + lclAddToListOfScRange( aList, rArg8 ); + lclAddToListOfScRange( aList, rArg9 ); + lclAddToListOfScRange( aList, rArg10 ); + lclAddToListOfScRange( aList, rArg11 ); + lclAddToListOfScRange( aList, rArg12 ); + lclAddToListOfScRange( aList, rArg13 ); + lclAddToListOfScRange( aList, rArg14 ); + lclAddToListOfScRange( aList, rArg15 ); + lclAddToListOfScRange( aList, rArg16 ); + lclAddToListOfScRange( aList, rArg17 ); + lclAddToListOfScRange( aList, rArg18 ); + lclAddToListOfScRange( aList, rArg19 ); + lclAddToListOfScRange( aList, rArg20 ); + lclAddToListOfScRange( aList, rArg21 ); + lclAddToListOfScRange( aList, rArg22 ); + lclAddToListOfScRange( aList, rArg23 ); + lclAddToListOfScRange( aList, rArg24 ); + lclAddToListOfScRange( aList, rArg25 ); + lclAddToListOfScRange( aList, rArg26 ); + lclAddToListOfScRange( aList, rArg27 ); + lclAddToListOfScRange( aList, rArg28 ); + lclAddToListOfScRange( aList, rArg29 ); + lclAddToListOfScRange( aList, rArg30 ); + + // simply join together all ranges as much as possible, strip out covered ranges etc. + lclJoinRanges( aList ); + + // create the VBA Range object + return lclCreateVbaRange( mxContext, getCurrentDocument(), aList ); } void -- cgit From 2ecf87efeb1ec5f4185b80cdb333b84f352a011e Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 18:13:02 +0200 Subject: mib18: #162938# add VBA symbol Worksheet.AutoFilterMode --- oovbaapi/ooo/vba/excel/XWorksheet.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl index fb6261bc06c0..1907fb004cab 100644 --- a/oovbaapi/ooo/vba/excel/XWorksheet.idl +++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl @@ -72,6 +72,7 @@ interface XWorksheet [attribute, readonly] string CodeName; [attribute, readonly] short Index; [attribute] long EnableSelection; + [attribute] boolean AutoFilterMode; void Activate(); void Calculate( ); -- cgit From 8eab4b9f3c47d857bc7ffb7080ba02e7f46fdb78 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 18:13:02 +0200 Subject: mib18: #162938# add VBA symbol Worksheet.AutoFilterMode --- sc/source/ui/vba/vbaworksheet.cxx | 35 +++++++++++++++++++++++++++++++++++ sc/source/ui/vba/vbaworksheet.hxx | 5 +++++ 2 files changed, 40 insertions(+) diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 4eab79813474..1655d1ff181a 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -319,6 +320,40 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeEx } +uno::Reference< beans::XPropertySet > ScVbaWorksheet::getFirstDBRangeProperties() throw (uno::RuntimeException) +{ + uno::Reference< beans::XPropertySet > xModelProps( mxModel, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xDBRangesIA( xModelProps->getPropertyValue( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DatabaseRanges" ) ) ), uno::UNO_QUERY_THROW ); + + for( sal_Int32 nIndex = 0, nCount = xDBRangesIA->getCount(); nIndex < nCount; ++nIndex ) + { + uno::Reference< sheet::XCellRangeReferrer > xDBRange( xDBRangesIA->getByIndex( nIndex ), uno::UNO_QUERY_THROW ); + // check if the database area is on this sheet + uno::Reference< sheet::XCellRangeAddressable > xRangeAddr( xDBRange->getReferredCells(), uno::UNO_QUERY_THROW ); + if( getSheetID() == xRangeAddr->getRangeAddress().Sheet ) + return uno::Reference< beans::XPropertySet >( xDBRange, uno::UNO_QUERY_THROW ); + } + return uno::Reference< beans::XPropertySet >(); +} + +sal_Bool SAL_CALL ScVbaWorksheet::getAutoFilterMode() throw (uno::RuntimeException) +{ + uno::Reference< beans::XPropertySet > xDBRangeProps = getFirstDBRangeProperties(); + sal_Bool bAutoFilterMode = sal_False; + return + xDBRangeProps.is() && + (xDBRangeProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoFilter" ) ) ) >>= bAutoFilterMode) && + bAutoFilterMode; +} + +void SAL_CALL ScVbaWorksheet::setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (uno::RuntimeException) +{ + uno::Reference< beans::XPropertySet > xDBRangeProps = getFirstDBRangeProperties(); + if( xDBRangeProps.is() ) + xDBRangeProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoFilter" ) ), uno::Any( bAutoFilterMode ) ); +} + uno::Reference< excel::XRange > ScVbaWorksheet::getUsedRange() throw (uno::RuntimeException) { diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx index 196a195258d7..fd65c7d698be 100644 --- a/sc/source/ui/vba/vbaworksheet.hxx +++ b/sc/source/ui/vba/vbaworksheet.hxx @@ -68,6 +68,9 @@ class ScVbaWorksheet : public WorksheetImpl_BASE css::uno::Reference< css::container::XNameAccess > getFormControls(); css::uno::Any getControlShape( const rtl::OUString& sName ); + + css::uno::Reference< css::beans::XPropertySet > getFirstDBRangeProperties() throw (css::uno::RuntimeException); + protected: ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ); @@ -106,6 +109,8 @@ public: virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getEnableSelection() throw (css::uno::RuntimeException); virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getAutoFilterMode() throw (css::uno::RuntimeException); + virtual void SAL_CALL setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (css::uno::RuntimeException); // Methods virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); -- cgit From 51bd6db07fa01758f183643f5c6d218087c96510 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 18:55:53 +0200 Subject: mib18: fix broken d.lst --- oox/prj/d.lst | 1 - 1 file changed, 1 deletion(-) diff --git a/oox/prj/d.lst b/oox/prj/d.lst index 482a270926a3..f20db064d7b2 100644 --- a/oox/prj/d.lst +++ b/oox/prj/d.lst @@ -36,7 +36,6 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls ..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx ..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx ..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx -..\inc\oox\xls\excelvbaproject.hxx %_DEST%\inc%_EXT%\oox\xls\excelvbaproject.hxx dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi" -- cgit From b78085151418f4cf0a643cce26701a728b2a00f0 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 5 Aug 2010 10:53:45 +0200 Subject: impress197: #i112420# Create accessibility object of ToolPanelViewShell in constructor. --- sd/source/ui/toolpanel/ToolPanelViewShell.cxx | 17 +++++++++++++++-- sd/source/ui/view/sdwindow.cxx | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx index c62faf29ca50..f193b2ece851 100755 --- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx +++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx @@ -512,12 +512,20 @@ ToolPanelViewShell::ToolPanelViewShell( SfxViewFrame* pFrame, ViewShellBase& rVi SetName( String( RTL_CONSTASCII_USTRINGPARAM( "ToolPanelViewShell" ) ) ); + // Some recent changes to the toolpanel make it necessary to create the + // accessibility object now. Creating it on demand would lead to a + // pointer cycle in the tree of accessibility objects and would lead + // e.g. the accerciser AT tool into an infinite loop. + // It would be nice to get rid of this workaround in the future. + if (mpContentWindow.get()) + mpContentWindow->SetAccessible(mpImpl->CreateAccessible(*mpContentWindow)); + // For accessibility we have to shortly hide the content window. This // triggers the construction of a new accessibility object for the new // view shell. (One is created earlier while the construtor of the base // class is executed. At that time the correct accessibility object can // not be constructed.) - if ( mpContentWindow.get() ) + if (mpContentWindow.get()) { mpContentWindow->Hide(); mpContentWindow->Show(); @@ -633,7 +641,12 @@ DockingWindow* ToolPanelViewShell::GetDockingWindow() Reference< XAccessible > ToolPanelViewShell::CreateAccessibleDocumentView( ::sd::Window* i_pWindow ) { ENSURE_OR_RETURN( i_pWindow, "ToolPanelViewShell::CreateAccessibleDocumentView: illegal window!", NULL ); - return mpImpl->CreateAccessible( *i_pWindow ); + // As said above, we have to create the accessibility object + // (unconditionally) in the constructor, not here on demand, or + // otherwise we would create a cycle in the tree of accessible objects + // which could lead to infinite loops in AT tools. + // return mpImpl->CreateAccessible( *i_pWindow ); + return Reference(); } // --------------------------------------------------------------------------------------------------------------------- diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 28873b3946a3..ed5dda39037c 100755 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -1165,11 +1165,11 @@ void Window::DropScroll(const Point& rMousePos) Window::CreateAccessible (void) { if (mpViewShell != NULL) - return mpViewShell->CreateAccessibleDocumentView (this); + return mpViewShell->CreateAccessibleDocumentView (this); else { OSL_TRACE ("::sd::Window::CreateAccessible: no view shell"); - return ::Window::CreateAccessible (); + return ::Window::CreateAccessible (); } } -- cgit From f4f1756a4c4cd35d77ccd2b9ca0f38799e6555af Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Thu, 5 Aug 2010 11:52:07 +0200 Subject: mib18: #163025# Changed RunInit handling for class modules to get right order --- basic/inc/basic/sbmod.hxx | 4 +- basic/source/classes/sb.cxx | 93 ++++++++++++++++++++++++++++++++++++++- basic/source/comp/codegen.cxx | 8 ++-- basic/source/comp/dim.cxx | 3 ++ basic/source/inc/parser.hxx | 5 ++- basic/source/inc/sbintern.hxx | 6 +++ basic/source/runtime/methods1.cxx | 2 - 7 files changed, 112 insertions(+), 9 deletions(-) diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index bccf8212f10e..abb482f7bfe5 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -44,6 +44,7 @@ class SbProcedureProperty; class SbIfaceMapperMethod; class SbClassModuleObject; +struct ClassModuleRunInitItem; struct SbClassData; class SbModuleImpl; @@ -71,6 +72,7 @@ protected: SbxObjectRef pDocObject; // an impl object ( used by Document Modules ) bool bIsProxyModule; + static void implProcessModuleRunInit( ClassModuleRunInitItem& rItem ); void StartDefinitions(); SbMethod* GetMethod( const String&, SbxDataType ); SbProperty* GetProperty( const String&, SbxDataType ); @@ -134,7 +136,7 @@ public: void SetVBACompat( BOOL bCompat ); INT32 GetModuleType() { return mnType; } void SetModuleType( INT32 nType ) { mnType = nType; } - bool GetIsProxyModule() { return bIsProxyModule; } + bool isProxyModule() { return bIsProxyModule; } void AddVarName( const String& aName ); void RemoveVars(); ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule(); diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index e28b0a304f28..d4520025953e 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -57,6 +57,7 @@ #include #include #include "errobject.hxx" +#include #include #include @@ -726,6 +727,7 @@ SbClassData::SbClassData( void ) void SbClassData::clear( void ) { mxIfaces->Clear(); + maRequiredTypes.clear(); } SbClassFactory::SbClassFactory( void ) @@ -981,6 +983,72 @@ SbModule* StarBASIC::FindModule( const String& rName ) return NULL; } + +struct ClassModuleRunInitItem +{ + SbModule* m_pModule; + bool m_bProcessing; + bool m_bRunInitDone; + //ModuleVector m_vModulesDependingOnThisModule; + + ClassModuleRunInitItem( void ) + : m_pModule( NULL ) + , m_bProcessing( false ) + , m_bRunInitDone( false ) + {} + ClassModuleRunInitItem( SbModule* pModule ) + : m_pModule( pModule ) + , m_bProcessing( false ) + , m_bRunInitDone( false ) + {} +}; + +typedef std::hash_map< ::rtl::OUString, ClassModuleRunInitItem, + ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap; + +static ModuleInitDependencyMap* GpMIDMap = NULL; + +void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem ) +{ + ModuleInitDependencyMap& rMIDMap = *GpMIDMap; + + rItem.m_bProcessing = true; + + //bool bAnyDependencies = true; + SbModule* pModule = rItem.m_pModule; + if( pModule->pClassData != NULL ) + { + StringVector& rReqTypes = pModule->pClassData->maRequiredTypes; + if( rReqTypes.size() > 0 ) + { + for( StringVector::iterator it = rReqTypes.begin() ; it != rReqTypes.end() ; ++it ) + { + String& rStr = *it; + + // Is required type a class module? + ModuleInitDependencyMap::iterator itFind = rMIDMap.find( rStr ); + if( itFind != rMIDMap.end() ) + { + ClassModuleRunInitItem& rParentItem = itFind->second; + if( rParentItem.m_bProcessing ) + { + // TODO: raise error? + DBG_ERROR( "Cyclic module dependency detected" ); + continue; + } + + if( !rParentItem.m_bRunInitDone ) + implProcessModuleRunInit( rParentItem ); + } + } + } + } + + pModule->RunInit(); + rItem.m_bRunInitDone = true; + rItem.m_bProcessing = false; +} + // Run Init-Code of all modules (including inserted libraries) void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) { @@ -994,10 +1062,33 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) // compile modules first then RunInit ( otherwise there is // can be order dependency, e.g. classmodule A has a member // of of type classmodule B and classmodule B hasn't been compiled yet ) + + // Consider required types to init in right order. Class modules + // that are required by other modules have to be initialized first. + ModuleInitDependencyMap aMIDMap; + GpMIDMap = &aMIDMap; + for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + { + SbModule* pModule = (SbModule*)pModules->Get( nMod ); + String aModuleName = pModule->GetName(); + if( pModule->isProxyModule() ) + aMIDMap[aModuleName] = ClassModuleRunInitItem( pModule ); + } + + ModuleInitDependencyMap::iterator it; + for( it = aMIDMap.begin() ; it != aMIDMap.end(); ++it ) + { + ClassModuleRunInitItem& rItem = it->second; + SbModule::implProcessModuleRunInit( rItem ); + } + GpMIDMap = NULL; + + // Call RunInit on standard modules for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); - pModule->RunInit(); + if( !pModule->isProxyModule() ) + pModule->RunInit(); } // Check all objects if they are BASIC, diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 46f829b382e8..e0f23c15d224 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -138,11 +138,10 @@ void SbiCodeGen::Save() pCLASSFAC->AddClassModule( &rMod ); nIfaceCount = pParser->aIfaceVector.size(); + if( !rMod.pClassData ) + rMod.pClassData = new SbClassData; if( nIfaceCount ) { - if( !rMod.pClassData ) - rMod.pClassData = new SbClassData; - for( int i = 0 ; i < nIfaceCount ; i++ ) { const String& rIfaceName = pParser->aIfaceVector[i]; @@ -152,6 +151,8 @@ void SbiCodeGen::Save() pIfaces->Insert( pIfaceVar, pIfaces->Count() ); } } + + rMod.pClassData->maRequiredTypes = pParser->aRequiredTypes; } else { @@ -161,6 +162,7 @@ void SbiCodeGen::Save() rMod.mnType = com::sun::star::script::ModuleType::NORMAL; rMod.bIsProxyModule = false; } + if( pParser->bText ) p->SetFlag( SBIMG_COMPARETEXT ); // GlobalCode-Flag diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index bff3d22dd9b0..b8fa3c089fd8 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -161,6 +161,9 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed ) // In den String-Pool uebernehmen rDef.SetTypeId( aGblStrings.Add( aCompleteName ) ); + + if( rDef.IsNew() && pProc == NULL ) + aRequiredTypes.push_back( aCompleteName ); } eType = SbxOBJECT; break; diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index 1161c4ed259d..733a65db7f61 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -34,7 +34,7 @@ #include -typedef ::std::vector< String > IfaceVector; +typedef ::std::vector< String > StringVector; struct SbiParseStack; @@ -81,7 +81,8 @@ public: BOOL bText; // OPTION COMPARE TEXT BOOL bExplicit; // TRUE: OPTION EXPLICIT BOOL bClassModule; // TRUE: OPTION ClassModule - IfaceVector aIfaceVector; // Holds all interfaces implemented by a class module + StringVector aIfaceVector; // Holds all interfaces implemented by a class module + StringVector aRequiredTypes; // Types used in Dim As New outside subs SbxDataType eDefTypes[26]; // DEFxxx-Datentypen SbiParser( StarBASIC*, SbModule* ); diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx index 59cfe21d25a8..4c54e2301bd5 100644 --- a/basic/source/inc/sbintern.hxx +++ b/basic/source/inc/sbintern.hxx @@ -50,10 +50,16 @@ public: virtual SbxObject* CreateObject( const String& ); }; +typedef ::std::vector< String > StringVector; + struct SbClassData { SbxArrayRef mxIfaces; + // types this module depends on because of use in Dim As New + // needed for initialization order of class modules + StringVector maRequiredTypes; + SbClassData( void ); ~SbClassData( void ) { clear(); } diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 8c7da2403705..9d806cac933a 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -1586,8 +1586,6 @@ RTLFUNC(Join) } -typedef ::std::vector< String > StringVector; - RTLFUNC(Split) { (void)pBasic; -- cgit From 048631266fa9fafc357dfb02eb023b409c93e5b1 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 5 Aug 2010 11:53:41 +0200 Subject: fwk152: #i112452# let restart functionality restart quickstarter as well --- desktop/inc/app.hxx | 3 + desktop/source/app/app.cxx | 7 ++ desktop/source/app/appfirststart.cxx | 104 +++++++++++++++------ desktop/win32/source/officeloader/officeloader.cxx | 1 + officecfg/registry/schema/org/openoffice/Setup.xcs | 9 +- 5 files changed, 94 insertions(+), 30 deletions(-) diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 8867a940a6ad..fa7550812bbe 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -134,6 +134,9 @@ class Desktop : public Application static sal_Bool IsFirstStartWizardNeeded(); static sal_Bool CheckExtensionDependencies(); + static void DoRestartActionsIfNecessary( sal_Bool bQuickStart ); + static void SetRestartState(); + void SynchronizeExtensionRepositories(); void SetSplashScreenText( const ::rtl::OUString& rText ); void SetSplashScreenProgress( sal_Int32 ); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 731ffe85d83b..cabec4a05691 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1659,7 +1659,12 @@ void Desktop::Main() ::comphelper::ComponentContext aContext( xSMgr ); xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) ) + { + // if this run of the office is triggered by restart, some additional actions should be done + DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() ); + Execute(); + } } catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg) { @@ -1674,6 +1679,8 @@ void Desktop::Main() // check whether the shutdown is caused by restart sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + if ( bRestartRequested ) + SetRestartState(); if (xGlobalBroadcaster.is()) { diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx index 2f0d4ab9e538..43c88e6eaa8a 100644 --- a/desktop/source/app/appfirststart.cxx +++ b/desktop/source/app/appfirststart.cxx @@ -36,12 +36,14 @@ #include #include #include +#include #include "app.hxx" -using rtl::OUString; -using namespace desktop; -using namespace com::sun::star::beans; +using ::rtl::OUString; +using namespace ::desktop; +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ); static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ); @@ -128,24 +130,29 @@ sal_Bool Desktop::LicenseNeedsAcceptance() */ } -/* Local function - was the wizard completed already? */ -static sal_Bool impl_isFirstStart() +/* Local function - get access to the configuration */ +static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath ) { - try { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - // get configuration provider - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( - xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); + // get configuration provider + Reference< XMultiServiceFactory > xConfigProvider = Reference< XMultiServiceFactory >( + xFactory->createInstance( sConfigSrvc ), UNO_QUERY_THROW ); - Sequence< Any > theArgs(1); - NamedValue v(OUString::createFromAscii("NodePath"), makeAny(OUString::createFromAscii("org.openoffice.Setup/Office"))); - theArgs[0] <<= v; + Sequence< Any > aArgs( 1 ); + NamedValue aValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NodePath" ) ), makeAny( rPath ) ); + aArgs[0] <<= aValue; + return Reference< XPropertySet >( + xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW ); +} - Reference< XPropertySet > pset = Reference< XPropertySet >( - theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); +/* Local function - was the wizard completed already? */ +static sal_Bool impl_isFirstStart() +{ + try { + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); - Any result = pset->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted")); + Any result = xPSet->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted")); sal_Bool bCompleted = sal_False; if ((result >>= bCompleted) && bCompleted) return sal_False; // wizard was already completed @@ -219,20 +226,9 @@ static sal_Bool impl_isLicenseAccepted() try { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - - // get configuration provider - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( - xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); - Sequence< Any > theArgs(1); - NamedValue v(OUString::createFromAscii("NodePath"), - makeAny(OUString::createFromAscii("org.openoffice.Setup/Office"))); - theArgs[0] <<= v; - Reference< XPropertySet > pset = Reference< XPropertySet >( - theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); - - Any result = pset->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate")); + Any result = xPSet->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate")); OUString aAcceptDate; if (result >>= aAcceptDate) @@ -272,3 +268,53 @@ sal_Bool Desktop::IsFirstStartWizardNeeded() return impl_isFirstStart() || !impl_isLicenseAccepted(); } +void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart ) +{ + if ( bQuickStart ) + { + try + { + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); + + OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) ); + Any aRestart = xPSet->getPropertyValue( sPropName ); + sal_Bool bRestart = sal_False; + if ( ( aRestart >>= bRestart ) && bRestart ) + { + xPSet->setPropertyValue( sPropName, makeAny( sal_False ) ); + Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges(); + + sal_Bool bQuickstart = sal_True; + sal_Bool bAutostart = sal_True; + Sequence< Any > aSeq( 2 ); + aSeq[0] <<= sal_True; + aSeq[1] <<= sal_True; + + Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Quickstart" ) ) ),UNO_QUERY_THROW ); + xQuickstart->initialize( aSeq ); + } + } + catch( uno::Exception& ) + { + // this is no critical operation so it should not prevent office from starting + } + } +} + +void Desktop::SetRestartState() +{ + try + { + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); + OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) ); + xPSet->setPropertyValue( sPropName, makeAny( sal_True ) ); + Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges(); + } + catch( uno::Exception& ) + { + // this is no critical operation, ignore the exception + } + +} + diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx index 7c2dafc79bbb..b85a72555935 100644 --- a/desktop/win32/source/officeloader/officeloader.cxx +++ b/desktop/win32/source/officeloader/officeloader.cxx @@ -339,6 +339,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int ) p = desktop_win32::commandLineAppend(p, argv[i]); } } + p = desktop_win32::commandLineAppend( p, MY_STRING(L"\" \"-env:OOO_CWD=")); if (cwdLen == 0) { diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs index 76c4bb17782b..62d3fdcce85d 100644 --- a/officecfg/registry/schema/org/openoffice/Setup.xcs +++ b/officecfg/registry/schema/org/openoffice/Setup.xcs @@ -395,7 +395,14 @@ AS Contains all of the document factories that were installed during setup.
- + + + + MAV + The entry specifies that we are in restart process + + false + -- cgit From 1c5011a89faf5cc8990e6e7b0cff3922a7fd9888 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 5 Aug 2010 12:22:22 +0200 Subject: jl157 #161910# make access to static map in unoxml threadsafe --- unoxml/source/dom/node.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 2a03896502a9..41d7c253d534 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -43,13 +43,18 @@ #include "attr.hxx" #include - +#include "rtl/instance.hxx" +#include "osl/mutex.hxx" #include "../events/eventdispatcher.hxx" #include "../events/mutationevent.hxx" #include #include +namespace { + struct NodeMutex: public ::rtl::Static {}; +} + namespace DOM { void pushContext(Context& io_rContext) @@ -131,6 +136,7 @@ namespace DOM void CNode::remove(const xmlNodePtr aNode) { + ::osl::MutexGuard guard(NodeMutex::get()); nodemap_t::iterator i = CNode::theNodeMap.find(aNode); if (i != CNode::theNodeMap.end()) { @@ -145,7 +151,7 @@ namespace DOM CNode* pNode = 0; if (aNode == NULL) return 0; - + ::osl::MutexGuard guard(NodeMutex::get()); //check whether there is already an instance for this node nodemap_t::const_iterator i = CNode::theNodeMap.find(aNode); if (i != CNode::theNodeMap.end()) -- cgit From 5b8f17063e11b53c7c4f7eb978afb05e3da7ac40 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 5 Aug 2010 12:54:16 +0200 Subject: fwk152: #i112895# integrate the patch --- filter/source/config/fragments/filters/MathML_XML__Math_.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filter/source/config/fragments/filters/MathML_XML__Math_.xcu b/filter/source/config/fragments/filters/MathML_XML__Math_.xcu index b6ab09ac89cd..7c80e41f6030 100644 --- a/filter/source/config/fragments/filters/MathML_XML__Math_.xcu +++ b/filter/source/config/fragments/filters/MathML_XML__Math_.xcu @@ -1,5 +1,5 @@ - IMPORT EXPORT TEMPLATE ENCRYPTION + IMPORT EXPORT TEMPLATE -- cgit From 2f19a7db1f8b7a03b52b1e18c31b3ac9b62a7de9 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 5 Aug 2010 15:43:06 +0200 Subject: mib18: #162503# do not create a new Worksheet object in Workbook.ActiveSheet but return existing object supporting VBA module access --- sc/source/ui/vba/vbaworkbook.cxx | 19 +++++++++++-------- sc/source/ui/vba/vbaworksheets.cxx | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index 365c8b35a00c..28469c4685a2 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -50,6 +50,7 @@ #include "vbanames.hxx" // Amelia Wang #include "nameuno.hxx" #include "docoptio.hxx" +#include "unonames.hxx" // Much of the impl. for the equivalend UNO module is // sc/source/ui/unoobj/docuno.cxx, viewuno.cxx @@ -208,7 +209,6 @@ ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args, uno::Reference< uno::XComponentContext> const & xContext ) : ScVbaWorkbook_BASE( args, xContext ) - { init(); } @@ -216,21 +216,24 @@ ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args, uno::Reference< excel::XWorksheet > ScVbaWorkbook::getActiveSheet() throw (uno::RuntimeException) { - uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ) ); - uno::Reference< sheet::XSpreadsheet > xSheet; + uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ), uno::UNO_SET_THROW ); uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - if ( xView.is() ) - xSheet = xView->getActiveSheet(); - return new ScVbaWorksheet( this, mxContext, xSheet, xModel ); + uno::Reference< beans::XPropertySet > xSheetProps( xView->getActiveSheet(), uno::UNO_QUERY_THROW ); + // #162503# return the original document module wrapper object, instead of a new instance + ::rtl::OUString aCodeName; + xSheetProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_CODENAME ) ) ) >>= aCodeName; + ScDocShell* pShell = excel::getDocShell( xModel ); + if( !pShell ) + throw uno::RuntimeException(); + return uno::Reference< excel::XWorksheet >( getUnoDocModule( aCodeName, pShell ), uno::UNO_QUERY_THROW ); } + uno::Any SAL_CALL ScVbaWorkbook::Sheets( const uno::Any& aIndex ) throw (uno::RuntimeException) { return Worksheets( aIndex ); } - - uno::Any SAL_CALL ScVbaWorkbook::Worksheets( const uno::Any& aIndex ) throw (uno::RuntimeException) { diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 5344e6b3a9be..7fa5196a6b04 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -52,7 +52,7 @@ #include "vbaglobals.hxx" #include "vbaworksheet.hxx" #include "vbaworkbook.hxx" -#include +#include "unonames.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; -- cgit From e3aa7efeb72001b0264947d962d0bf29077c5f0c Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 5 Aug 2010 16:09:11 +0200 Subject: jl157 #161910# inserting comments --- unoxml/source/dom/node.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 41d7c253d534..fb4a6bf508b3 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -52,6 +52,7 @@ #include namespace { +//see CNode::remove struct NodeMutex: public ::rtl::Static {}; } @@ -136,6 +137,17 @@ namespace DOM void CNode::remove(const xmlNodePtr aNode) { + //Using the guard here protects against races when at the same time + //CNode::get() is called. This fix helps in many cases but is still + //incorrect. remove is called from ~CNode. That is, while the object + //is being destructed it can still be obtained by calling CNode::get(). + //Another bug currently prevents the correct destruction of CNodes. So + //the destructor is rarely called. + // + //Doing this right would probably mean to store WeakReferences in the + //map and also guard oder functions. To keep the risk at a minimum + //we keep this imperfect fix for the upcoming release and fix it later + //properly (http://qa.openoffice.org/issues/show_bug.cgi?id=113682) ::osl::MutexGuard guard(NodeMutex::get()); nodemap_t::iterator i = CNode::theNodeMap.find(aNode); if (i != CNode::theNodeMap.end()) @@ -151,6 +163,7 @@ namespace DOM CNode* pNode = 0; if (aNode == NULL) return 0; + //see CNode::remove ::osl::MutexGuard guard(NodeMutex::get()); //check whether there is already an instance for this node nodemap_t::const_iterator i = CNode::theNodeMap.find(aNode); -- cgit From e2b85f96b67ac4bb9f26a60c11cedc98ec52206f Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 6 Aug 2010 09:35:51 +0200 Subject: mib18: #163121# Declare Rework --- basic/source/comp/codegen.cxx | 4 ++ basic/source/comp/dim.cxx | 61 ++++++++++++++++++++++++++++- basic/source/comp/exprgen.cxx | 69 +++++++++------------------------ basic/source/comp/exprtree.cxx | 10 ----- basic/source/inc/expr.hxx | 3 -- basic/source/inc/symtbl.hxx | 3 +- scripting/source/basprov/basmodnode.cxx | 14 +++++-- scripting/source/basprov/basprov.cxx | 2 +- 8 files changed, 96 insertions(+), 70 deletions(-) diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index e0f23c15d224..93fb18baf86e 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -259,6 +259,10 @@ void SbiCodeGen::Save() if( !pProc->IsPublic() ) pMeth->SetFlag( SBX_PRIVATE ); + // Declare? -> Hidden + if( pProc->GetLib().Len() > 0 ) + pMeth->SetFlag( SBX_HIDDEN ); + pMeth->nStart = pProc->GetAddr(); pMeth->nLine1 = pProc->GetLine1(); pMeth->nLine2 = pProc->GetLine2(); diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index b8fa3c089fd8..27b6e0e51871 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -877,7 +877,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) } if( bCompatible && Peek() == PARAMARRAY ) { - if( bByVal || bByVal || bOptional ) + if( bByVal || bOptional ) Error( SbERR_UNEXPECTED, PARAMARRAY ); Next(); bParamArray = TRUE; @@ -949,6 +949,8 @@ void SbiParser::DefDeclare( BOOL bPrivate ) Error( SbERR_UNEXPECTED, eCurTok ); else { + bool bFunction = (eCurTok == FUNCTION); + SbiProcDef* pDef = ProcDecl( TRUE ); if( pDef ) { @@ -973,7 +975,64 @@ void SbiParser::DefDeclare( BOOL bPrivate ) aPublics.Add( pDef ); if ( pDef ) + { pDef->SetPublic( !bPrivate ); + + // New declare handling + if( pDef->GetLib().Len() > 0 ) + { + USHORT nSavLine = nLine; + aGen.Statement(); + pDef->Define(); + pDef->SetLine1( nSavLine ); + pDef->SetLine2( nSavLine ); + + SbiSymPool& rPool = pDef->GetParams(); + USHORT nParCount = rPool.GetSize(); + + SbxDataType eType = pDef->GetType(); + if( bFunction ) + aGen.Gen( _PARAM, 0, sal::static_int_cast< UINT16 >( eType ) ); + + if( nParCount > 1 ) + { + aGen.Gen( _ARGC ); + + for( USHORT i = 1 ; i < nParCount ; ++i ) + { + SbiSymDef* pParDef = rPool.Get( i ); + SbxDataType eParType = pParDef->GetType(); + + aGen.Gen( _PARAM, i, sal::static_int_cast< UINT16 >( eParType ) ); + aGen.Gen( _ARGV ); + + USHORT nTyp = sal::static_int_cast< USHORT >( pParDef->GetType() ); + if( pParDef->IsByVal() ) + { + // Reset to avoid additional byval in call to wrapper function + pParDef->SetByVal( FALSE ); + nTyp |= 0x8000; + } + aGen.Gen( _ARGTYP, nTyp ); + } + } + + aGen.Gen( _LIB, aGblStrings.Add( pDef->GetLib() ) ); + + SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL; + USHORT nId = pDef->GetId(); + if( pDef->GetAlias().Len() ) + nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() ); + if( nParCount > 1 ) + nId |= 0x8000; + aGen.Gen( eOp, nId, sal::static_int_cast< UINT16 >( eType ) ); + + if( bFunction ) + aGen.Gen( _PUT ); + + aGen.Gen( _LEAVE ); + } + } } } } diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index 60869307aecf..dc4fda0a4682 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -115,13 +115,8 @@ void SbiExprNode::Gen( RecursiveMode eRecMode ) } else { - SbiProcDef* pProc = aVar.pDef->GetProcDef(); - // per DECLARE definiert? - if( pProc && pProc->GetLib().Len() ) - eOp = pProc->IsCdecl() ? _CALLC : _CALL; - else - eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL : - (aVar.pDef->IsGlobal() ? _FIND_G : _FIND); + eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL : + (aVar.pDef->IsGlobal() ? _FIND_G : _FIND); } if( eOp == _FIND ) @@ -187,17 +182,6 @@ void SbiExprNode::GenElement( SbiOpcode eOp ) aVar.pPar->Gen(); } - SbiProcDef* pProc = aVar.pDef->GetProcDef(); - // per DECLARE definiert? - if( pProc ) - { - // Dann evtl. einen LIB-Befehl erzeugen - if( pProc->GetLib().Len() ) - pGen->Gen( _LIB, pGen->GetParser()->aGblStrings.Add( pProc->GetLib() ) ); - // und den Aliasnamen nehmen - if( pProc->GetAlias().Len() ) - nId = ( nId & 0x8000 ) | pGen->GetParser()->aGblStrings.Add( pProc->GetAlias() ); - } pGen->Gen( eOp, nId, sal::static_int_cast< UINT16 >( GetType() ) ); if( aVar.pvMorePar ) @@ -225,11 +209,6 @@ void SbiExprList::Gen() // AB 10.1.96: Typ-Anpassung bei DECLARE USHORT nCount = 1, nParAnz = 0; SbiSymPool* pPool = NULL; - if( pProc ) - { - pPool = &pProc->GetParams(); - nParAnz = pPool->GetSize(); - } for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ ) { pExpr->Gen(); @@ -239,6 +218,7 @@ void SbiExprList::Gen() USHORT nSid = pParser->aGblStrings.Add( pExpr->GetName() ); pParser->aGen.Gen( _ARGN, nSid ); + /* TODO: Check after Declare concept change // AB 10.1.96: Typanpassung bei named -> passenden Parameter suchen if( pProc ) { @@ -246,39 +226,26 @@ void SbiExprList::Gen() pParser->Error( SbERR_NO_NAMED_ARGS ); // Spaeter, wenn Named Args bei DECLARE moeglich - /* - for( USHORT i = 1 ; i < nParAnz ; i++ ) - { - SbiSymDef* pDef = pPool->Get( i ); - const String& rName = pDef->GetName(); - if( rName.Len() ) - { - if( pExpr->GetName().ICompare( rName ) - == COMPARE_EQUAL ) - { - pParser->aGen.Gen( _ARGTYP, pDef->GetType() ); - break; - } - } - } - */ + //for( USHORT i = 1 ; i < nParAnz ; i++ ) + //{ + // SbiSymDef* pDef = pPool->Get( i ); + // const String& rName = pDef->GetName(); + // if( rName.Len() ) + // { + // if( pExpr->GetName().ICompare( rName ) + // == COMPARE_EQUAL ) + // { + // pParser->aGen.Gen( _ARGTYP, pDef->GetType() ); + // break; + // } + // } + //} } + */ } else { pParser->aGen.Gen( _ARGV ); - - // Funktion mit DECLARE -> Typ-Anpassung - if( pProc && nCount < nParAnz ) - { - SbiSymDef* pDef = pPool->Get( nCount ); - USHORT nTyp = sal::static_int_cast< USHORT >( - pDef->GetType() ); - // Zustzliches Flag fr BYVAL einbauen - if( pDef->IsByVal() ) - nTyp |= 0x8000; - pParser->aGen.Gen( _ARGTYP, nTyp ); - } } } } diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 42969b98d0d8..7a4ea5965558 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -338,15 +338,6 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) // damit erwischen wir n% = 5 : print n eType = eDefType; } - // Funktion? - if( pDef->GetProcDef() ) - { - SbiProcDef* pProc = pDef->GetProcDef(); - if( pPar && pProc->GetLib().Len() ) // DECLARE benutzt? - pPar->SetProc( pProc ); - // Wenn keine Pars, vorerst nichts machen - // Pruefung auf Typ-Anzahl waere denkbar - } // Typcheck bei Variablen: // ist explizit im Scanner etwas anderes angegeben? // Bei Methoden ist dies OK! @@ -868,7 +859,6 @@ SbiExprList::SbiExprList( SbiParser* p ) { pParser = p; pFirst = NULL; - pProc = NULL; nExpr = nDim = 0; bError = diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx index 9b8f51d09dea..851d0d6f1fe5 100644 --- a/basic/source/inc/expr.hxx +++ b/basic/source/inc/expr.hxx @@ -234,7 +234,6 @@ class SbiExprList { // Basisklasse fuer Parameter und Dims protected: SbiParser* pParser; // Parser SbiExpression* pFirst; // Expressions - SbiProcDef* pProc; // DECLARE-Funktion (Parameter-Anpassung) short nExpr; // Anzahl Expressions short nDim; // Anzahl Dimensionen BOOL bError; // TRUE: Fehler @@ -249,8 +248,6 @@ public: SbiExpression* Get( short ); BOOL Test( const SbiProcDef& ); // Parameter-Checks void Gen(); // Code-Erzeugung - // Setzen einer Funktionsdefinition zum Abgleich der Parameter - void SetProc( SbiProcDef* p ) { pProc = p; } void addExpression( SbiExpression* pExpr ); }; diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx index 9bd8cfd49754..f2fbaa0ac1f1 100644 --- a/basic/source/inc/symtbl.hxx +++ b/basic/source/inc/symtbl.hxx @@ -159,7 +159,8 @@ public: void SetOptional() { bOpt = TRUE; } void SetParamArray() { bParamArray = TRUE; } void SetWithEvents() { bWithEvents = TRUE; } - void SetByVal() { bByVal = TRUE; } + void SetByVal( BOOL bByVal_ = TRUE ) + { bByVal = bByVal_; } void SetStatic( BOOL bAsStatic = TRUE ) { bStatic = bAsStatic; } void SetNew() { bNew = TRUE; } void SetDefinedAs() { bAs = TRUE; } diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx index 22f9e40571a4..fe6ed69fccab 100644 --- a/scripting/source/basprov/basmodnode.cxx +++ b/scripting/source/basprov/basmodnode.cxx @@ -97,14 +97,22 @@ namespace basprov if ( pMethods ) { sal_Int32 nCount = pMethods->Count(); - aChildNodes.realloc( nCount ); + sal_Int32 nRealCount = 0; + for ( sal_Int32 i = 0; i < nCount; ++i ) + { + SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) ); + if ( pMethod && !pMethod->IsHidden() ) + ++nRealCount; + } + aChildNodes.realloc( nRealCount ); Reference< browse::XBrowseNode >* pChildNodes = aChildNodes.getArray(); + sal_Int32 iTarget = 0; for ( sal_Int32 i = 0; i < nCount; ++i ) { SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) ); - if ( pMethod ) - pChildNodes[i] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) ); + if ( pMethod && !pMethod->IsHidden() ) + pChildNodes[iTarget++] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) ); } } } diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index abd61f6c1285..69cc6f40cd3d 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -412,7 +412,7 @@ namespace basprov if ( pMethods ) { SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( aMethod, SbxCLASS_METHOD ) ); - if ( pMethod ) + if ( pMethod && !pMethod->IsHidden() ) { if ( m_pDocBasicManager == pBasicMgr ) xScript = new BasicScriptImpl( aDescription, pMethod, *m_pDocBasicManager, m_xInvocationContext ); -- cgit From c8852505f8bb9d94214250bf398c5c232dce8e43 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 6 Aug 2010 09:35:51 +0200 Subject: mib18: #163121# Declare Rework --- basctl/source/basicide/baside2.cxx | 2 +- basctl/source/basicide/basobj2.cxx | 18 ++++++++++++++---- basctl/source/basicide/macrodlg.cxx | 16 ++++++++++------ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 9f97e1766c3b..d0a8ca1a6ddb 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -365,7 +365,7 @@ BOOL ModulWindow::BasicExecute() break; } } - else if ( !pMethod || ( nStart < nCurMethodStart ) ) + else if ( !pMethod || ( nStart < nCurMethodStart && !pM->IsHidden() ) ) { pMethod = pM; nCurMethodStart = nStart; diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index 3604866b4202..9604a8bd9933 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -364,13 +364,23 @@ Sequence< ::rtl::OUString > GetMethodNames( const ScriptDocument& rDocument, con SbModuleRef xModule = new SbModule( rModName ); xModule->SetSource32( aOUSource ); USHORT nCount = xModule->GetMethods()->Count(); - aSeqMethods.realloc( nCount ); - + USHORT nRealCount = nCount; for ( USHORT i = 0; i < nCount; i++ ) { SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i ); + if( pMethod->IsHidden() ) + --nRealCount; + } + aSeqMethods.realloc( nRealCount ); + + USHORT iTarget = 0; + for ( USHORT i = 0 ; i < nCount; ++i ) + { + SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i ); + if( pMethod->IsHidden() ) + continue; DBG_ASSERT( pMethod, "Method not found! (NULL)" ); - aSeqMethods.getArray()[ i ] = pMethod->GetName(); + aSeqMethods.getArray()[ iTarget++ ] = pMethod->GetName(); } } @@ -392,7 +402,7 @@ BOOL HasMethod( const ScriptDocument& rDocument, const String& rLibName, const S if ( pMethods ) { SbMethod* pMethod = (SbMethod*)pMethods->Find( rMethName, SbxCLASS_METHOD ); - if ( pMethod ) + if ( pMethod && !pMethod->IsHidden() ) bHasMethod = TRUE; } } diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 41a5fa488950..24bc5beacb30 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -554,11 +554,15 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) // Die Macros sollen in der Reihenfolge angezeigt werden, // wie sie im Modul stehen. MacroList aMacros; - USHORT nMacros = pModule->GetMethods()->Count(); - USHORT nMethod; - for ( nMethod = 0; nMethod < nMacros; nMethod++ ) + USHORT nMacroCount = pModule->GetMethods()->Count(); + USHORT nRealMacroCount = 0; + USHORT iMeth; + for ( iMeth = 0; iMeth < nMacroCount; iMeth++ ) { - SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); + SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( iMeth ); + if( pMethod->IsHidden() ) + continue; + ++nRealMacroCount; DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); ULONG nPos = LIST_APPEND; // Eventuell weiter vorne ? @@ -580,8 +584,8 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) } aMacroBox.SetUpdateMode( FALSE ); - for ( nMethod = 0; nMethod < nMacros; nMethod++ ) - aMacroBox.InsertEntry( aMacros.GetObject( nMethod )->GetName() ); + for ( iMeth = 0; iMeth < nRealMacroCount; iMeth++ ) + aMacroBox.InsertEntry( aMacros.GetObject( iMeth )->GetName() ); aMacroBox.SetUpdateMode( TRUE ); if ( aMacroBox.GetEntryCount() ) -- cgit From df1e6343ba123c0a45b25eb7ed3ae6d53749b33f Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 6 Aug 2010 11:14:17 +0200 Subject: mib18: #163175# Implement DoEvents empty --- basic/source/runtime/methods1.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 9d806cac933a..62e9c388f5c5 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -528,11 +528,13 @@ RTLFUNC(DoEvents) (void)pBasic; (void)bWrite; (void)rPar; - Timer aTimer; - aTimer.SetTimeout( 1 ); - aTimer.Start(); - while ( aTimer.IsActive() ) - Application::Yield(); + // Dummy implementation as the following code leads + // to performance problems for unknown reasons + //Timer aTimer; + //aTimer.SetTimeout( 1 ); + //aTimer.Start(); + //while ( aTimer.IsActive() ) + // Application::Reschedule(); } RTLFUNC(GetGUIVersion) -- cgit From 08e2fc04ba183a19609518c7f4fb1c210bfe826e Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 9 Aug 2010 10:47:38 +0200 Subject: fwk152: #i108004# check the URLs correctly --- framework/source/loadenv/loadenv.cxx | 3 ++- sfx2/inc/sfx2/docfile.hxx | 1 - sfx2/source/doc/docfile.cxx | 47 ------------------------------------ sfx2/source/doc/doctemplates.cxx | 2 +- sfx2/source/doc/objmisc.cxx | 2 +- sfx2/source/doc/objstor.cxx | 2 +- sfx2/source/doc/sfxbasemodel.cxx | 3 ++- 7 files changed, 7 insertions(+), 53 deletions(-) diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 99dd3107f162..75bcc4c4587f 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -103,6 +103,7 @@ #include #include #include +#include #include #include #include @@ -1407,7 +1408,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded() // don't check the complete URL here. // use its main part - ignore optional jumpmarks! const ::rtl::OUString sURL = xModel->getURL(); - if (!m_aURL.Main.equals(sURL)) + if (!::utl::UCBContentHelper::EqualURLs( m_aURL.Main, sURL )) { xTask.clear (); continue; diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index e4d3ff023b3b..24885fc27363 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -323,7 +323,6 @@ public: static com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag > GetVersionList( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); - static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ); static ::rtl::OUString CreateTempCopyWithExt( const ::rtl::OUString& aURL ); static sal_Bool CallApproveHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler, ::com::sun::star::uno::Any aRequest, sal_Bool bAllowAbort ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 1dea202e0d0e..29081e8e8418 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3717,53 +3717,6 @@ void SfxMedium::SetCachedSignatureState_Impl( sal_uInt16 nState ) pImp->m_nSignatureState = nState; } -//---------------------------------------------------------------- -sal_Bool SfxMedium::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ) -{ - sal_Bool bResult = sal_False; - - if ( aFirstURL.getLength() && aSecondURL.getLength() ) - { - INetURLObject aFirst( aFirstURL ); - INetURLObject aSecond( aSecondURL ); - - if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID ) - { - try - { - ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); - if ( !pBroker ) - throw uno::RuntimeException(); - - uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac - = pBroker->getContentIdentifierFactoryInterface(); - if ( !xIdFac.is() ) - throw uno::RuntimeException(); - - uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst - = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) ); - uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond - = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) ); - - if ( xIdFirst.is() && xIdSecond.is() ) - { - uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider = - pBroker->getContentProviderInterface(); - if ( !xProvider.is() ) - throw uno::RuntimeException(); - bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond ); - } - } - catch( uno::Exception& ) - { - OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" ); - } - } - } - - return bResult; -} - BOOL SfxMedium::HasStorage_Impl() const { return pImp->xStorage.is(); diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index b921f2d97f1f..71f3683c0006 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1919,7 +1919,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, aStoreArgs[1].Value <<= rTemplateName; ::rtl::OUString aCurrentDocumentURL = rStorable->getLocation(); - if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() )) + if( !::utl::UCBContentHelper::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() )) rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs ); else rStorable->store(); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index addb648ef2e9..e386b2382acf 100755 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -732,7 +732,7 @@ void SfxObjectShell::FreeSharedFile( const ::rtl::OUString& aTempFileURL ) SetSharedXMLFlag( sal_False ); if ( IsDocShared() && aTempFileURL.getLength() - && !SfxMedium::EqualURLs( aTempFileURL, GetSharedFileURL() ) ) + && !::utl::UCBContentHelper::EqualURLs( aTempFileURL, GetSharedFileURL() ) ) { if ( pImp->m_bAllowShareControlFileClean ) { diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 49188defc4f1..bfe27ee71d97 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1182,7 +1182,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( pMedium && pMedium->GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL && rMedium.GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL - && SfxMedium::EqualURLs( pMedium->GetName(), rMedium.GetName() ) ) + && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) ) { bStoreToSameLocation = sal_True; AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b5a9536b12c5..9e9e09ebcdf5 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -95,6 +95,7 @@ #include #include #include +#include //________________________________________________________________________________________________________ // includes of my own project @@ -2642,7 +2643,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL sal_Bool bSaved = sal_False; if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength() && sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL - && SfxMedium::EqualURLs( getLocation(), sURL ) ) + && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) ) { // this is the same file URL as the current document location, try to use storeOwn if possible -- cgit From 6fad3bbef4e10023962b2fb8b5157af13148e76c Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 9 Aug 2010 10:47:38 +0200 Subject: fwk152: #i108004# check the URLs correctly --- unotools/inc/unotools/ucbhelper.hxx | 1 + unotools/source/ucbhelper/ucbhelper.cxx | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/unotools/inc/unotools/ucbhelper.hxx b/unotools/inc/unotools/ucbhelper.hxx index 687868adbdb4..38b355439c2b 100644 --- a/unotools/inc/unotools/ucbhelper.hxx +++ b/unotools/inc/unotools/ucbhelper.hxx @@ -80,6 +80,7 @@ namespace utl static sal_Bool FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim = ';', BOOL bAllowWildCards = TRUE ); static sal_Bool Find( const String& rFolder, const String& rName, String& rFile, BOOL bAllowWildCards = FALSE ); static sal_Bool IsSubPath( const ::rtl::OUString& rPath, const ::rtl::OUString& rChildCandidate, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >& xContentProvider = ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >() ); + static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ); }; } diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 4160f2f2f443..8befb8a0f209 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -872,5 +872,54 @@ sal_Bool UCBContentHelper::IsSubPath( const ::rtl::OUString& rPath, const ::rtl: return bResult; } +// ----------------------------------------------------------------------- +sal_Bool UCBContentHelper::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ) +{ + sal_Bool bResult = sal_False; + + if ( aFirstURL.getLength() && aSecondURL.getLength() ) + { + INetURLObject aFirst( aFirstURL ); + INetURLObject aSecond( aSecondURL ); + + if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID ) + { + try + { + ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); + if ( !pBroker ) + throw uno::RuntimeException(); + + uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac + = pBroker->getContentIdentifierFactoryInterface(); + if ( !xIdFac.is() ) + throw uno::RuntimeException(); + + uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst + = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) ); + uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond + = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) ); + + if ( xIdFirst.is() && xIdSecond.is() ) + { + uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider = + pBroker->getContentProviderInterface(); + if ( !xProvider.is() ) + throw uno::RuntimeException(); + bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond ); + } + } + catch( uno::Exception& ) + { + OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" ); + } + } + } + + return bResult; +} + + + } // namespace utl -- cgit From a65f403bfdd25572330b1a7a6142ae2ce3e30031 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 9 Aug 2010 12:27:56 +0200 Subject: #i113731# fix compile warning on an pre-4.0-release gcc version --- vcl/source/glyphs/graphite_layout.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 5d971d4bc985..0f7d2f5f3005 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -1103,7 +1103,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector & rDelt { nXOffset = args.mpDXArray[nChars - 1] - mvCharDxs[nChars - 1]; } - int nPrevClusterGlyph = (bRtl)? mvGlyphs.size() : -1; + int nPrevClusterGlyph = (bRtl)? (signed)mvGlyphs.size() : -1; int nPrevClusterLastChar = -1; for (size_t i = 0; i < nChars; i++) { -- cgit From 57534c0d9f60b454bdfb7bd488443b42afb67658 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 9 Aug 2010 14:11:58 +0200 Subject: impress197: #163250# fixed string handling, improved polygon splitting --- tools/source/generic/poly.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 2290cfdbe7c2..e9f98b07adbd 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -243,6 +243,11 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize ) void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly ) { const ULONG nSpaceSize = nSpace * sizeof( Point ); + + //Can't fit this in :-(, throw ? + if (mnPoints + nSpace > USHRT_MAX) + return; + const USHORT nNewSize = mnPoints + nSpace; if( nPos >= mnPoints ) -- cgit From f56e0994b98659de89b632ec04dfc2f8ff6b3e31 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 9 Aug 2010 14:11:58 +0200 Subject: impress197: #163250# fixed string handling, improved polygon splitting --- sd/source/filter/ppt/propread.cxx | 128 ++++++++++++++++++++++++-------------- 1 file changed, 83 insertions(+), 45 deletions(-) mode change 100644 => 100755 sd/source/filter/ppt/propread.cxx diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx old mode 100644 new mode 100755 index 54acab192cb5..ff1250bdf090 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -29,6 +29,7 @@ #include "precompiled_sd.hxx" #include #include +#include "tools/debug.hxx" #include "rtl/tencinfo.h" #include "rtl/textenc.h" @@ -90,6 +91,17 @@ void PropItem::Clear() // ----------------------------------------------------------------------- +static xub_StrLen lcl_getMaxSafeStrLen(sal_uInt32 nSize) +{ + nSize -= 1; //Drop NULL terminator + + //If it won't fit in a string, clip it to the max size that does + if (nSize > STRING_MAXLEN) + nSize = STRING_MAXLEN; + + return nSize; +} + BOOL PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign ) { sal_uInt32 i, nItemSize, nType, nItemPos; @@ -108,36 +120,43 @@ BOOL PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign ) { case VT_LPSTR : { - if ( (sal_uInt16)nItemSize ) + if ( nItemSize ) { - sal_Char* pString = new sal_Char[ (sal_uInt16)nItemSize ]; - if ( mnTextEnc == RTL_TEXTENCODING_UCS2 ) + try { - nItemSize >>= 1; - if ( (sal_uInt16)nItemSize > 1 ) + sal_Char* pString = new sal_Char[ nItemSize ]; + if ( mnTextEnc == RTL_TEXTENCODING_UCS2 ) { - sal_Unicode* pWString = (sal_Unicode*)pString; - for ( i = 0; i < (sal_uInt16)nItemSize; i++ ) - *this >> pWString[ i ]; - rString = String( pWString, (sal_uInt16)nItemSize - 1 ); - } - else - rString = String(); - bRetValue = sal_True; - } - else - { - SvMemoryStream::Read( pString, (sal_uInt16)nItemSize ); - if ( pString[ (sal_uInt16)nItemSize - 1 ] == 0 ) - { - if ( (sal_uInt16)nItemSize > 1 ) - rString = String( ByteString( pString ), mnTextEnc ); + nItemSize >>= 1; + if ( nItemSize > 1 ) + { + sal_Unicode* pWString = (sal_Unicode*)pString; + for ( i = 0; i < nItemSize; i++ ) + *this >> pWString[ i ]; + rString = String( pWString, lcl_getMaxSafeStrLen(nItemSize) ); + } else rString = String(); bRetValue = sal_True; } + else + { + SvMemoryStream::Read( pString, nItemSize ); + if ( pString[ nItemSize - 1 ] == 0 ) + { + if ( nItemSize > 1 ) + rString = String( ByteString( pString ), mnTextEnc ); + else + rString = String(); + bRetValue = sal_True; + } + } + delete[] pString; + } + catch( const std::bad_alloc& ) + { + DBG_ERROR( "sd PropItem::Read bad alloc" ); } - delete[] pString; } if ( bAlign ) SeekRel( ( 4 - ( nItemSize & 3 ) ) & 3 ); // dword align @@ -148,18 +167,25 @@ BOOL PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign ) { if ( nItemSize ) { - sal_Unicode* pString = new sal_Unicode[ (sal_uInt16)nItemSize ]; - for ( i = 0; i < (sal_uInt16)nItemSize; i++ ) - *this >> pString[ i ]; - if ( pString[ i - 1 ] == 0 ) + try { - if ( (sal_uInt16)nItemSize > 1 ) - rString = String( pString, (sal_uInt16)nItemSize - 1 ); - else - rString = String(); - bRetValue = sal_True; + sal_Unicode* pString = new sal_Unicode[ nItemSize ]; + for ( i = 0; i < nItemSize; i++ ) + *this >> pString[ i ]; + if ( pString[ i - 1 ] == 0 ) + { + if ( (sal_uInt16)nItemSize > 1 ) + rString = String( pString, lcl_getMaxSafeStrLen(nItemSize) ); + else + rString = String(); + bRetValue = sal_True; + } + delete[] pString; + } + catch( const std::bad_alloc& ) + { + DBG_ERROR( "sd PropItem::Read bad alloc" ); } - delete[] pString; } if ( bAlign && ( nItemSize & 1 ) ) SeekRel( 2 ); // dword align @@ -349,24 +375,31 @@ sal_Bool Section::GetDictionary( Dictionary& rDict ) for ( sal_uInt32 i = 0; i < nDictCount; i++ ) { aStream >> nId >> nSize; - if ( (sal_uInt16)nSize ) + if ( nSize ) { String aString; nPos = aStream.Tell(); - sal_Char* pString = new sal_Char[ (sal_uInt16)nSize ]; - aStream.Read( pString, (sal_uInt16)nSize ); - if ( mnTextEnc == RTL_TEXTENCODING_UCS2 ) + try { - nSize >>= 1; - aStream.Seek( nPos ); - sal_Unicode* pWString = (sal_Unicode*)pString; - for ( i = 0; i < (sal_uInt16)nSize; i++ ) - aStream >> pWString[ i ]; - aString = String( pWString, (sal_uInt16)nSize - 1 ); + sal_Char* pString = new sal_Char[ nSize ]; + aStream.Read( pString, nSize ); + if ( mnTextEnc == RTL_TEXTENCODING_UCS2 ) + { + nSize >>= 1; + aStream.Seek( nPos ); + sal_Unicode* pWString = (sal_Unicode*)pString; + for ( i = 0; i < nSize; i++ ) + aStream >> pWString[ i ]; + aString = String( pWString, lcl_getMaxSafeStrLen(nSize) ); + } + else + aString = String( ByteString( pString, lcl_getMaxSafeStrLen(nSize) ), mnTextEnc ); + delete[] pString; + } + catch( const std::bad_alloc& ) + { + DBG_ERROR( "sd Section::GetDictionary bad alloc" ); } - else - aString = String( ByteString( pString, (sal_uInt16)nSize - 1 ), mnTextEnc ); - delete[] pString; if ( !aString.Len() ) break; aDict.AddProperty( nId, aString ); @@ -500,6 +533,11 @@ void Section::Read( SvStorageStream *pStrm ) } if ( nPropSize ) { + if ( nPropSize > nStrmSize ) + { + nPropCount = 0; + break; + } pStrm->Seek( nPropOfs + nSecOfs ); sal_uInt8* pBuf = new sal_uInt8[ nPropSize ]; pStrm->Read( pBuf, nPropSize ); -- cgit From fefe083877e478d7a09299524ffdde85948a2bff Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Mon, 9 Aug 2010 15:50:34 +0200 Subject: mib18: #163059# Ignore introspection based COM object members --- basic/source/classes/sbunoobj.cxx | 14 ++++++++++++-- basic/source/inc/sbunoobj.hxx | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index df13bc7ec571..7de2d0c02320 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -71,6 +71,7 @@ #include #include #include +#include using com::sun::star::uno::Reference; @@ -2265,6 +2266,7 @@ Reference< XInvocation > createDynamicInvocationFor( const Any& aAny ); SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) : SbxObject( aName_ ) , bNeedIntrospection( TRUE ) + , bIgnoreNativeCOMObjectMembers( FALSE ) { static Reference< XIntrospection > xIntrospection; @@ -2310,6 +2312,12 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) bNeedIntrospection = FALSE; return; } + + // Ignore introspection based members for COM objects to avoid + // hiding of equally named COM symbols, e.g. XInvocation::getValue + Reference< oleautomation::XAutomationObject > xAutomationObject( aUnoObj_, UNO_QUERY ); + if( xAutomationObject.is() ) + bIgnoreNativeCOMObjectMembers = TRUE; } maTmpUnoObj = aUnoObj_; @@ -2553,7 +2561,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) if( !pRes ) { ::rtl::OUString aUName( rName ); - if( mxUnoAccess.is() ) + if( mxUnoAccess.is() && !bIgnoreNativeCOMObjectMembers ) { if( mxExactName.is() ) { @@ -2713,10 +2721,12 @@ void SbUnoObject::implCreateAll( void ) // Instrospection besorgen Reference< XIntrospectionAccess > xAccess = mxUnoAccess; - if( !xAccess.is() ) + if( !xAccess.is() || bIgnoreNativeCOMObjectMembers ) { if( mxInvocation.is() ) xAccess = mxInvocation->getIntrospection(); + else if( bIgnoreNativeCOMObjectMembers ) + return; } if( !xAccess.is() ) return; diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx index 2d9836e3530e..78afa9783ca8 100644 --- a/basic/source/inc/sbunoobj.hxx +++ b/basic/source/inc/sbunoobj.hxx @@ -52,6 +52,7 @@ class SbUnoObject: public SbxObject ::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactName; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactNameInvocation; BOOL bNeedIntrospection; + BOOL bIgnoreNativeCOMObjectMembers; ::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection! // Hilfs-Methode zum Anlegen der dbg_-Properties -- cgit From 2e6db5ef3ba5c811cdab813beec4451ba28c78b1 Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 10 Aug 2010 06:57:53 +0200 Subject: mib18: #163148# creation og basic modules in library Standard during Workbooks.add --- sc/source/ui/vba/vbaworkbooks.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx index 5298f60e0943..7efee1505dcb 100644 --- a/sc/source/ui/vba/vbaworkbooks.cxx +++ b/sc/source/ui/vba/vbaworkbooks.cxx @@ -76,7 +76,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >& uno::Reference xLibContainer = pShell->GetBasicContainer(); uno::Reference xVBACompat( xLibContainer, uno::UNO_QUERY_THROW ); xVBACompat->setVBACompatibilityMode( sal_True ); - String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "VBAProject" ) ); + String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); pShell->GetBasicManager()->SetName( aPrjName ); if( xLibContainer.is() ) -- cgit From 9dac2d24f39818d94fe23f642129f87b74d79263 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 10 Aug 2010 10:27:30 +0200 Subject: mib18: #163246# add VBA symbol Worksheet.ProtectScenarios --- sc/source/ui/vba/vbaworksheet.cxx | 10 ++++++++-- sc/source/ui/vba/vbaworksheet.hxx | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 1655d1ff181a..6ee6fa1f6b19 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -414,7 +414,7 @@ ScVbaWorksheet::getStandardHeight() throw (uno::RuntimeException) sal_Bool ScVbaWorksheet::getProtectionMode() throw (uno::RuntimeException) { - return false; + return sal_False; } sal_Bool @@ -427,7 +427,13 @@ ScVbaWorksheet::getProtectContents()throw (uno::RuntimeException) sal_Bool ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException) { - return false; + return sal_False; +} + +sal_Bool +ScVbaWorksheet::getProtectScenarios() throw (uno::RuntimeException) +{ + return sal_False; } void diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx index fd65c7d698be..78bcc2503a49 100644 --- a/sc/source/ui/vba/vbaworksheet.hxx +++ b/sc/source/ui/vba/vbaworksheet.hxx @@ -98,6 +98,7 @@ public: virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getProtectContents() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getProtectDrawingObjects() throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getProtectScenarios() throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() throw (css::uno::RuntimeException) ; virtual css::uno::Any SAL_CALL ChartObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException); -- cgit From 476aa1795b08ffeb43e35823e78442a51a04304b Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 10 Aug 2010 10:27:30 +0200 Subject: mib18: #163246# add VBA symbol Worksheet.ProtectScenarios --- oovbaapi/ooo/vba/excel/XWorksheet.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl index 1907fb004cab..3eb8337798d6 100644 --- a/oovbaapi/ooo/vba/excel/XWorksheet.idl +++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl @@ -66,6 +66,7 @@ interface XWorksheet [attribute, readonly] boolean ProtectionMode; [attribute, readonly] boolean ProtectContents; [attribute, readonly] boolean ProtectDrawingObjects; + [attribute, readonly] boolean ProtectScenarios; [attribute, readonly] XRange UsedRange; [attribute, readonly] XWorksheet Next; [attribute, readonly] XWorksheet Previous; -- cgit From 284ee8838d76f1f2d9db52a8b3f70876daba97ad Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 10 Aug 2010 11:05:20 +0200 Subject: mav56: #163253# tread invalid path segments correctly --- filter/source/xsltdialog/xmlfilterjar.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx index 5592c331713f..0a01310b3b40 100644 --- a/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/filter/source/xsltdialog/xmlfilterjar.cxx @@ -101,6 +101,10 @@ static OUString encodeZipUri( const OUString& rURI ) static Reference< XInterface > addFolder( Reference< XInterface >& xRootFolder, Reference< XSingleServiceFactory >& xFactory, const OUString& rName ) throw( Exception ) { + if ( rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) + throw lang::IllegalArgumentException(); + Sequence< Any > aArgs(1); aArgs[0] <<= (sal_Bool)sal_True; @@ -362,6 +366,10 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU { OUString szPackagePath( encodeZipUri( rURL.copy( sVndSunStarPackage.getLength() ) ) ); + if ( ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) + throw lang::IllegalArgumentException(); + if( xIfc->hasByHierarchicalName( szPackagePath ) ) { Reference< XActiveDataSink > xFileEntry; -- cgit From 823d3cc493c8654a294ff45329c0514d2cc953d3 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 10 Aug 2010 11:05:20 +0200 Subject: mav56: #163253# tread invalid path segments correctly --- comphelper/inc/comphelper/storagehelper.hxx | 2 ++ comphelper/source/misc/storagehelper.cxx | 31 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx index b613ddd2c5f1..b7e5704c4d68 100644 --- a/comphelper/inc/comphelper/storagehelper.hxx +++ b/comphelper/inc/comphelper/storagehelper.hxx @@ -161,6 +161,8 @@ public: static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed ); static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed ); + + static sal_Bool PathHasSegment( const ::rtl::OUString& aPath, const ::rtl::OUString& aSegment ); }; } diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index e2557523f674..db5ba71cd876 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -452,5 +452,36 @@ sal_Bool OStorageHelper::IsValidZipEntryFileName( return sal_True; } +// ---------------------------------------------------------------------- +sal_Bool OStorageHelper::PathHasSegment( const ::rtl::OUString& aPath, const ::rtl::OUString& aSegment ) +{ + sal_Bool bResult = sal_False; + const sal_Int32 nPathLen = aPath.getLength(); + const sal_Int32 nSegLen = aSegment.getLength(); + + if ( nSegLen && nPathLen >= nSegLen ) + { + ::rtl::OUString aEndSegment( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + aEndSegment += aSegment; + + ::rtl::OUString aInternalSegment( aEndSegment ); + aInternalSegment += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + + if ( aPath.indexOf( aInternalSegment ) >= 0 ) + bResult = sal_True; + + if ( !bResult && !aPath.compareTo( aSegment, nSegLen ) ) + { + if ( nPathLen == nSegLen || aPath.getStr()[nSegLen] == (sal_Unicode)'/' ) + bResult = sal_True; + } + + if ( !bResult && nPathLen > nSegLen && aPath.copy( nPathLen - nSegLen - 1, nSegLen + 1 ).equals( aEndSegment ) ) + bResult = sal_True; + } + + return bResult; +} + } -- cgit From 7c457734f3e76c7f9b5eb69d7a917dee9bab6bc3 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 10 Aug 2010 11:05:20 +0200 Subject: mav56: #163253# tread invalid path segments correctly --- ucb/source/ucp/package/makefile.mk | 1 + ucb/source/ucp/package/pkguri.cxx | 36 ++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk index 8c6dcda31829..a8cdf7430703 100644 --- a/ucb/source/ucp/package/makefile.mk +++ b/ucb/source/ucp/package/makefile.mk @@ -68,6 +68,7 @@ SHL1IMPLIB=i$(TARGET) SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ + $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) \ diff --git a/ucb/source/ucp/package/pkguri.cxx b/ucb/source/ucp/package/pkguri.cxx index feb8daec7905..8424ed906e92 100644 --- a/ucb/source/ucp/package/pkguri.cxx +++ b/ucb/source/ucp/package/pkguri.cxx @@ -36,6 +36,7 @@ #include "rtl/ustrbuf.hxx" #include "osl/diagnose.h" +#include "comphelper/storagehelper.hxx" #include "../inc/urihelper.hxx" @@ -85,7 +86,7 @@ void PackageUri::init() const if ( ( m_aUri.getLength() < PACKAGE_URL_SCHEME_LENGTH + 4 ) ) { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -100,7 +101,7 @@ void PackageUri::init() const != sal_Unicode( '/' ) ) ) { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -128,8 +129,8 @@ void PackageUri::init() const { m_aParam += ( m_aParam.getLength() - ? ::rtl::OUString::createFromAscii( "&purezip" ) - : ::rtl::OUString::createFromAscii( "?purezip" ) ); + ? ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "&purezip" ) ) + : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "?purezip" ) ) ); } aPureUri = aPureUri.replaceAt( 0, @@ -143,7 +144,7 @@ void PackageUri::init() const // Only :/// - Empty authority // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } else if ( nEnd == ( aPureUri.getLength() - 1 ) ) @@ -154,7 +155,7 @@ void PackageUri::init() const // Only ://// or ://// // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -175,7 +176,7 @@ void PackageUri::init() const nStart, aPureUri.getLength() - nStart, aNormPackage ); m_aPackage = ::ucb_impl::urihelper::decodeSegment( aNormPackage ); - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); m_aUri = m_aUri.replaceAt( 0, ( nParam >= 0 ) ? nParam @@ -193,16 +194,19 @@ void PackageUri::init() const { m_aPath = aPureUri.copy( nEnd + 1 ); - // Empty path segments or encoded slashes? - if ( m_aPath.indexOf( - rtl::OUString::createFromAscii( "//" ) ) != -1 - || m_aPath.indexOf( - rtl::OUString::createFromAscii( "%2F" ) ) != -1 - || m_aPath.indexOf( - rtl::OUString::createFromAscii( "%2f" ) ) != -1 ) + // Unexpected sequences of characters: + // - empty path segments + // - encoded slashes + // - parent folder segments ".." + // - current folder segments "." + if ( m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "//" ) ) ) != -1 + || m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%2F" ) ) ) != -1 + || m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%2f" ) ) ) != -1 + || ::comphelper::OStorageHelper::PathHasSegment( m_aPath, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || ::comphelper::OStorageHelper::PathHasSegment( m_aPath, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -239,7 +243,7 @@ void PackageUri::init() const else { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); } } } -- cgit From 061332d81d98aa8d3099830e16233b83b37a51f9 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 10 Aug 2010 11:52:54 +0200 Subject: mib18: #163243# enable regular expressions in VBA symbol Range.Find --- sc/source/ui/vba/vbarange.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index fef118277d3b..455af075306c 100755 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -2997,7 +2997,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L // return a Range object that represents the first cell where that information is found. rtl::OUString sWhat; sal_Int32 nWhat = 0; - float fWhat = 0.0; + double fWhat = 0.0; // string. if( What >>= sWhat ) @@ -3029,6 +3029,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L { uno::Reference< util::XSearchDescriptor > xDescriptor = xSearch->createSearchDescriptor(); xDescriptor->setSearchString( sSearch ); + xDescriptor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SRCHREGEXP ) ), uno::Any( true ) ); uno::Reference< excel::XRange > xAfterRange; uno::Reference< table::XCellRange > xStartCell; @@ -3134,8 +3135,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L ScGlobal::SetSearchItem( newOptions ); - uno::Reference< util::XSearchDescriptor > xSearchDescriptor( xDescriptor, uno::UNO_QUERY ); - uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xSearchDescriptor) : xSearch->findFirst( xSearchDescriptor ); + uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xDescriptor) : xSearch->findFirst( xDescriptor ); uno::Reference< table::XCellRange > xCellRange( xInterface, uno::UNO_QUERY ); if ( xCellRange.is() ) { -- cgit From a1f6f3ec0728d2877c96ee8e2bba5a03f6bdc945 Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 10 Aug 2010 16:55:52 +0200 Subject: mib18: #163120# adding the entrypoint for symbol Debug --- sc/source/ui/vba/vbaglobals.cxx | 19 +++++++++++++++++++ sc/source/ui/vba/vbaglobals.hxx | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 03f3ecd3c50c..db3558bdf34a 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -219,6 +219,25 @@ ScVbaGlobals::Rows( const uno::Any& aIndex ) throw (uno::RuntimeException) } + +uno::Any SAL_CALL +ScVbaGlobals::getDebug() throw (uno::RuntimeException) +{ + try // return empty object on error + { + uno::Sequence< uno::Any > aArgs( 1 ); + aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this ); + uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); + uno::Reference< uno::XInterface > xVBADebug = xServiceManager->createInstanceWithArgumentsAndContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VbaDebug" ) ), aArgs, mxContext ); + return uno::Any( xVBADebug ); + } + catch( uno::Exception& ) + { + } + return uno::Any(); +} + uno::Sequence< ::rtl::OUString > SAL_CALL ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException) { diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx index ae34d710240f..c56c62fdb573 100644 --- a/sc/source/ui/vba/vbaglobals.hxx +++ b/sc/source/ui/vba/vbaglobals.hxx @@ -82,7 +82,7 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw ( css::uno::RuntimeException ); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - + virtual css::uno::Any SAL_CALL getDebug() throw (css::uno::RuntimeException); // XMultiServiceFactory -- cgit From 7c2b94d0a3352ee92e0202b1eba64254583798ae Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 10 Aug 2010 16:55:52 +0200 Subject: mib18: #163120# adding the entrypoint for symbol Debug --- oovbaapi/ooo/vba/excel/XGlobals.idl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oovbaapi/ooo/vba/excel/XGlobals.idl b/oovbaapi/ooo/vba/excel/XGlobals.idl index 6ed51b2aa4c4..d05d7a75fefa 100644 --- a/oovbaapi/ooo/vba/excel/XGlobals.idl +++ b/oovbaapi/ooo/vba/excel/XGlobals.idl @@ -55,6 +55,8 @@ interface XGlobals: com::sun::star::uno::XInterface [attribute, readonly] ooo::vba::XAssistant Assistant; [attribute, readonly] any Selection; [attribute, readonly] XWorkbook ThisWorkbook; + [attribute, readonly] any Debug; + void Calculate() raises(com::sun::star::script::BasicErrorException); XRange Cells([in] any RowIndex, [in] any ColumnIndex); -- cgit From 47c57a6a16a01121e2c04574652068be4a1acbe2 Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 10 Aug 2010 18:14:58 +0200 Subject: mib18: #163259# implementation of global symbol Excel --- sc/source/ui/vba/vbaglobals.cxx | 9 +++++++++ sc/source/ui/vba/vbaglobals.hxx | 1 + 2 files changed, 10 insertions(+) diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index db3558bdf34a..d1c97ae2291e 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -80,6 +80,15 @@ ScVbaGlobals::getApplication() throw (uno::RuntimeException) return mxApplication; } + +uno::Reference SAL_CALL +ScVbaGlobals::getExcel() throw (uno::RuntimeException) +{ + return getApplication(); +} + + + uno::Reference< excel::XWorkbook > SAL_CALL ScVbaGlobals::getActiveWorkbook() throw (uno::RuntimeException) { diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx index c56c62fdb573..f22e5b19faa4 100644 --- a/sc/source/ui/vba/vbaglobals.hxx +++ b/sc/source/ui/vba/vbaglobals.hxx @@ -82,6 +82,7 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw ( css::uno::RuntimeException ); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XApplication > SAL_CALL getExcel() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getDebug() throw (css::uno::RuntimeException); -- cgit From a72754d198aeaf328100c4d9cd340ffbb759796e Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 10 Aug 2010 18:14:58 +0200 Subject: mib18: #163259# implementation of global symbol Excel --- oovbaapi/ooo/vba/excel/XGlobals.idl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oovbaapi/ooo/vba/excel/XGlobals.idl b/oovbaapi/ooo/vba/excel/XGlobals.idl index d05d7a75fefa..d79196b00927 100644 --- a/oovbaapi/ooo/vba/excel/XGlobals.idl +++ b/oovbaapi/ooo/vba/excel/XGlobals.idl @@ -42,6 +42,10 @@ #ifndef __ooo_vba_XAssistant_idl__ #include #endif +#ifndef __ooo_vba_excel_XApplication_idl__ +#include +#endif + module ooo { module vba { module excel { interface XRange; @@ -55,6 +59,7 @@ interface XGlobals: com::sun::star::uno::XInterface [attribute, readonly] ooo::vba::XAssistant Assistant; [attribute, readonly] any Selection; [attribute, readonly] XWorkbook ThisWorkbook; + [attribute, readonly] ooo::vba::excel::XApplication Excel; [attribute, readonly] any Debug; -- cgit From de0ee2cfcf30e2675fb64e02704a277bedf31545 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 10 Aug 2010 20:18:10 +0200 Subject: mib18: adjusted service name to match VBA symbol --- sc/source/ui/vba/vbaglobals.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index d1c97ae2291e..c70a7f83726d 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -238,7 +238,7 @@ ScVbaGlobals::getDebug() throw (uno::RuntimeException) aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this ); uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< uno::XInterface > xVBADebug = xServiceManager->createInstanceWithArgumentsAndContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VbaDebug" ) ), aArgs, mxContext ); + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.Debug" ) ), aArgs, mxContext ); return uno::Any( xVBADebug ); } catch( uno::Exception& ) -- cgit From c28503c38aec7fdc4cc528fac116f8eac798c6de Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Wed, 11 Aug 2010 08:24:45 +0200 Subject: mib18: #163121# Fixed back chain handling for new declare implementation --- basic/source/comp/dim.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 27b6e0e51871..59d77e3f3757 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -981,6 +981,12 @@ void SbiParser::DefDeclare( BOOL bPrivate ) // New declare handling if( pDef->GetLib().Len() > 0 ) { + if( bNewGblDefs && nGblChain == 0 ) + { + nGblChain = aGen.Gen( _JUMP, 0 ); + bNewGblDefs = FALSE; + } + USHORT nSavLine = nLine; aGen.Statement(); pDef->Define(); -- cgit From 949e63c1f4ecb4ef61310cf1c1713fb20854c578 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 11 Aug 2010 09:10:07 +0200 Subject: mib18: #163215# handle the closed dialog correctly --- vbahelper/source/msforms/vbauserform.cxx | 47 ++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx index 2a4cecfc2338..a1333e0a655b 100644 --- a/vbahelper/source/msforms/vbauserform.cxx +++ b/vbahelper/source/msforms/vbauserform.cxx @@ -153,28 +153,41 @@ void SAL_CALL ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) { uno::Any aObject = getValue( aPropertyName ); - // The Object *must* support XDefaultProperty here because getValue will - // only return properties that are Objects ( e.g. controls ) - // e.g. Userform1.aControl = something - // 'aControl' has to support XDefaultProperty to make sense here - uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW ); - rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName(); - uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) ); - uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW ); - xPropSet->setPropertyValue( aDfltPropName, aValue ); + + // in case the dialog is already closed the VBA implementation should not throw exceptions + if ( aObject.hasValue() ) + { + // The Object *must* support XDefaultProperty here because getValue will + // only return properties that are Objects ( e.g. controls ) + // e.g. Userform1.aControl = something + // 'aControl' has to support XDefaultProperty to make sense here + uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW ); + rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName(); + uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) ); + uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW ); + xPropSet->setPropertyValue( aDfltPropName, aValue ); + } } uno::Any SAL_CALL ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException) { - uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName ); - ScVbaControlFactory aFac( mxContext, xControl, m_xModel ); - uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) ); - ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); - pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) ); - return uno::makeAny( xVBAControl ); + uno::Any aResult; + + // in case the dialog is already closed the VBA implementation should not throw exceptions + if ( m_xDialog.is() ) + { + uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); + uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW ); + uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName ); + ScVbaControlFactory aFac( mxContext, xControl, m_xModel ); + uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) ); + ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); + pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) ); + aResult = uno::makeAny( xVBAControl ); + } + + return aResult; } ::sal_Bool SAL_CALL -- cgit From 3fb28911c53d6e156f56a159f458a58fe1b6842f Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 11 Aug 2010 11:11:45 +0200 Subject: mib18: unx compiler warnings --- basic/source/comp/exprgen.cxx | 4 ++-- basic/source/comp/makefile.mk | 33 ++++++++++----------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index dc4fda0a4682..3e034af204f5 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -207,8 +207,8 @@ void SbiExprList::Gen() { pParser->aGen.Gen( _ARGC ); // AB 10.1.96: Typ-Anpassung bei DECLARE - USHORT nCount = 1, nParAnz = 0; - SbiSymPool* pPool = NULL; + USHORT nCount = 1 /*, nParAnz = 0*/; +// SbiSymPool* pPool = NULL; for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ ) { pExpr->Gen(); diff --git a/basic/source/comp/makefile.mk b/basic/source/comp/makefile.mk index bd3c750df355..d65f6a431e43 100644 --- a/basic/source/comp/makefile.mk +++ b/basic/source/comp/makefile.mk @@ -34,39 +34,26 @@ TARGET=comp .INCLUDE : settings.mk -CXXFILES= \ - sbcomp.cxx \ - dim.cxx \ - exprtree.cxx \ - exprnode.cxx \ - exprgen.cxx \ - codegen.cxx \ - io.cxx \ - loops.cxx \ - parser.cxx \ - scanner.cxx \ - token.cxx \ - symtbl.cxx \ - buffer.cxx - SLOFILES= \ - $(SLO)$/sbcomp.obj \ + $(SLO)$/buffer.obj \ + $(SLO)$/codegen.obj \ $(SLO)$/dim.obj \ - $(SLO)$/exprtree.obj \ - $(SLO)$/exprnode.obj \ $(SLO)$/exprgen.obj \ - $(SLO)$/codegen.obj \ + $(SLO)$/exprnode.obj \ + $(SLO)$/exprtree.obj \ $(SLO)$/io.obj \ $(SLO)$/loops.obj \ $(SLO)$/parser.obj \ + $(SLO)$/sbcomp.obj \ $(SLO)$/scanner.obj \ - $(SLO)$/token.obj \ $(SLO)$/symtbl.obj \ - $(SLO)$/buffer.obj + $(SLO)$/token.obj EXCEPTIONSFILES= \ - $(SLO)$/parser.obj \ - $(SLO)$/exprtree.obj + $(SLO)$/codegen.obj \ + $(SLO)$/dim.obj \ + $(SLO)$/exprtree.obj \ + $(SLO)$/parser.obj # --- Targets -------------------------------------------------------------- -- cgit From 73e504b3e526fe7bbb01e8947d329f1687d84011 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Wed, 11 Aug 2010 14:18:10 +0200 Subject: mib18: #163237# Changed error handling in StepSET --- basic/source/runtime/step0.cxx | 223 ++++++++++++++++++++--------------------- 1 file changed, 111 insertions(+), 112 deletions(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 29965c7e9da5..596b30b9d691 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -431,144 +431,143 @@ void SbiRuntime::StepPUT() void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp ) { // #67733 Typen mit Array-Flag sind auch ok - SbxDataType eValType = refVal->GetType(); + + // Check var, !object is no error for sure if, only if type is fixed SbxDataType eVarType = refVar->GetType(); - if( (eValType != SbxOBJECT - && eValType != SbxEMPTY -// seems like when using the default method its possible for objects -// to be empty ( no broadcast has taken place yet ) or the actual value is - - && !bHandleDefaultProp - && !(eValType & SbxARRAY)) || - (eVarType != SbxOBJECT - && eVarType != SbxEMPTY - && !bHandleDefaultProp - && !(eVarType & SbxARRAY) ) ) + if( !bHandleDefaultProp && eVarType != SbxOBJECT && !(eVarType & SbxARRAY) && refVar->IsFixed() ) { Error( SbERR_INVALID_USAGE_OBJECT ); + return; } - else + + // Check value, !object is no error for sure if, only if type is fixed + SbxDataType eValType = refVal->GetType(); + bool bGetValObject = false; + if( !bHandleDefaultProp && eValType != SbxOBJECT && !(eValType & SbxARRAY) && refVal->IsFixed() ) { - // Getting in here causes problems with objects with default properties - // if they are SbxEMPTY I guess - if ( !bHandleDefaultProp || ( bHandleDefaultProp && refVal->GetType() == SbxOBJECT ) ) + Error( SbERR_INVALID_USAGE_OBJECT ); + return; + } + + // Getting in here causes problems with objects with default properties + // if they are SbxEMPTY I guess + if ( !bHandleDefaultProp || ( bHandleDefaultProp && eValType == SbxOBJECT ) ) + { + // Auf refVal GetObject fuer Collections ausloesen + SbxBase* pObjVarObj = refVal->GetObject(); + if( pObjVarObj ) { - // Auf refVal GetObject fuer Collections ausloesen - SbxBase* pObjVarObj = refVal->GetObject(); - if( pObjVarObj ) - { - SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj); + SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj); - // #67733 Typen mit Array-Flag sind auch ok - if( refObjVal ) - refVal = refObjVal; - else if( !(eValType & SbxARRAY) ) - refVal = NULL; - } + // #67733 Typen mit Array-Flag sind auch ok + if( refObjVal ) + refVal = refObjVal; + else if( !(eValType & SbxARRAY) ) + refVal = NULL; } + } - // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als - // Object deklarierten Variable zugewiesen werden, kann hier - // refVal ungueltig sein! - if( !refVal ) + // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als + // Object deklarierten Variable zugewiesen werden, kann hier + // refVal ungueltig sein! + if( !refVal ) + { + Error( SbERR_INVALID_USAGE_OBJECT ); + } + else + { + // Store auf die eigene Methode (innerhalb einer Function)? + BOOL bFlagsChanged = FALSE; + USHORT n = 0; + if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { - Error( SbERR_INVALID_USAGE_OBJECT ); + bFlagsChanged = TRUE; + n = refVar->GetFlags(); + refVar->SetFlag( SBX_WRITE ); } - else - { - // Store auf die eigene Methode (innerhalb einer Function)? - BOOL bFlagsChanged = FALSE; - USHORT n = 0; - if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) - { - bFlagsChanged = TRUE; - n = refVar->GetFlags(); - refVar->SetFlag( SBX_WRITE ); - } - SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar); - if( pProcProperty ) - pProcProperty->setSet( true ); + SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar); + if( pProcProperty ) + pProcProperty->setSet( true ); - if ( bHandleDefaultProp ) + if ( bHandleDefaultProp ) + { + // get default properties for lhs & rhs where necessary + // SbxVariable* defaultProp = NULL; unused variable + bool bLHSHasDefaultProp = false; + // LHS try determine if a default prop exists + if ( refVar->GetType() == SbxOBJECT ) { - // get default properties for lhs & rhs where necessary - // SbxVariable* defaultProp = NULL; unused variable - bool bLHSHasDefaultProp = false; - // LHS try determine if a default prop exists - if ( refVar->GetType() == SbxOBJECT ) + SbxVariable* pDflt = getDefaultProp( refVar ); + if ( pDflt ) { - SbxVariable* pDflt = getDefaultProp( refVar ); - if ( pDflt ) - { - refVar = pDflt; - bLHSHasDefaultProp = true; - } + refVar = pDflt; + bLHSHasDefaultProp = true; } - // RHS only get a default prop is the rhs has one - if ( refVal->GetType() == SbxOBJECT ) - { - // check if lhs is a null object - // if it is then use the object not the default property - SbxObject* pObj = NULL; + } + // RHS only get a default prop is the rhs has one + if ( refVal->GetType() == SbxOBJECT ) + { + // check if lhs is a null object + // if it is then use the object not the default property + SbxObject* pObj = NULL; - pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar); + pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar); - // calling GetObject on a SbxEMPTY variable raises - // object not set errors, make sure its an Object - if ( !pObj && refVar->GetType() == SbxOBJECT ) - { - SbxBase* pObjVarObj = refVar->GetObject(); - pObj = PTR_CAST(SbxObject,pObjVarObj); - } - SbxVariable* pDflt = NULL; - if ( pObj || bLHSHasDefaultProp ) - // lhs is either a valid object || or has a defaultProp - pDflt = getDefaultProp( refVal ); - if ( pDflt ) - refVal = pDflt; + // calling GetObject on a SbxEMPTY variable raises + // object not set errors, make sure its an Object + if ( !pObj && refVar->GetType() == SbxOBJECT ) + { + SbxBase* pObjVarObj = refVar->GetObject(); + pObj = PTR_CAST(SbxObject,pObjVarObj); } + SbxVariable* pDflt = NULL; + if ( pObj || bLHSHasDefaultProp ) + // lhs is either a valid object || or has a defaultProp + pDflt = getDefaultProp( refVal ); + if ( pDflt ) + refVal = pDflt; } + } - // Handle withevents - BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); - if ( bWithEvents ) - { - Reference< XInterface > xComListener; - - SbxBase* pObj = refVal->GetObject(); - SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL; - if( pUnoObj != NULL ) - { - Any aControlAny = pUnoObj->getUnoAny(); - String aDeclareClassName = refVar->GetDeclareClassName(); - ::rtl::OUString aVBAType = aDeclareClassName; - ::rtl::OUString aPrefix = refVar->GetName(); - SbxObjectRef xScopeObj = refVar->GetParent(); - xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj ); - - refVal->SetDeclareClassName( aDeclareClassName ); - refVal->SetComListener( xComListener ); // Hold reference - } + // Handle withevents + BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); + if ( bWithEvents ) + { + Reference< XInterface > xComListener; - *refVar = *refVal; - } - else + SbxBase* pObj = refVal->GetObject(); + SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL; + if( pUnoObj != NULL ) { - *refVar = *refVal; + Any aControlAny = pUnoObj->getUnoAny(); + String aDeclareClassName = refVar->GetDeclareClassName(); + ::rtl::OUString aVBAType = aDeclareClassName; + ::rtl::OUString aPrefix = refVar->GetName(); + SbxObjectRef xScopeObj = refVar->GetParent(); + xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj ); + + refVal->SetDeclareClassName( aDeclareClassName ); + refVal->SetComListener( xComListener ); // Hold reference } - // lhs is a property who's value is currently (Empty e.g. no broadcast yet) - // in this case if there is a default prop involved the value of the - // default property may infact be void so the type will also be SbxEMPTY - // in this case we do not want to call checkUnoStructCopy 'cause that will - // cause an error also - if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) ) - // #67607 Uno-Structs kopieren - checkUnoStructCopy( refVal, refVar ); - if( bFlagsChanged ) - refVar->SetFlags( n ); + *refVar = *refVal; } + else + { + *refVar = *refVal; + } + + // lhs is a property who's value is currently (Empty e.g. no broadcast yet) + // in this case if there is a default prop involved the value of the + // default property may infact be void so the type will also be SbxEMPTY + // in this case we do not want to call checkUnoStructCopy 'cause that will + // cause an error also + if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) ) + // #67607 Uno-Structs kopieren + checkUnoStructCopy( refVal, refVar ); + if( bFlagsChanged ) + refVar->SetFlags( n ); } } -- cgit From 20e2562e7be5ea6009e42d4cb9818642e9daa5f9 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Thu, 12 Aug 2010 08:40:35 +0200 Subject: mib18: #163254# Fixed instantiation of class modules for object members --- basic/source/classes/sb.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index d4520025953e..1427e7a74fdf 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -553,6 +553,35 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) USHORT nFlags_ = pProp->GetFlags(); pProp->SetFlag( SBX_NO_BROADCAST ); SbxProperty* pNewProp = new SbxProperty( *pProp ); + + // Special handling for modules instances and collections, they need + // to be instantiated, otherwise all refer to the same base object + SbxDataType eVarType = pProp->GetType(); + if( eVarType == SbxOBJECT ) + { + SbxBase* pObjBase = pProp->GetObject(); + SbxObject* pObj = PTR_CAST(SbxObject,pObjBase); + if( pObj != NULL ) + { + String aObjClass = pObj->GetClassName(); + (void)aObjClass; + + SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase); + if( pClassModuleObj != NULL ) + { + SbModule* pClassModule = pClassModuleObj->getClassModule(); + SbClassModuleObject* pNewObj = new SbClassModuleObject( pClassModule ); + pNewProp->PutObject( pNewObj ); + } + else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) ) + { + String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") ); + BasicCollection* pNewCollection = new BasicCollection( aCollectionName ); + pNewProp->PutObject( pNewCollection ); + } + } + } + pNewProp->ResetFlag( SBX_NO_BROADCAST ); pNewProp->SetParent( this ); pProps->PutDirect( pNewProp, i ); -- cgit From 2f61a21f70c9dc5efa8d0e0a54e06da282a68efb Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 12 Aug 2010 10:00:50 +0200 Subject: fwk152: #i10000# fix warning --- desktop/source/app/appfirststart.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx index 43c88e6eaa8a..c06d94fd0812 100644 --- a/desktop/source/app/appfirststart.cxx +++ b/desktop/source/app/appfirststart.cxx @@ -284,8 +284,6 @@ void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart ) xPSet->setPropertyValue( sPropName, makeAny( sal_False ) ); Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges(); - sal_Bool bQuickstart = sal_True; - sal_Bool bAutostart = sal_True; Sequence< Any > aSeq( 2 ); aSeq[0] <<= sal_True; aSeq[1] <<= sal_True; -- cgit From 1423da554b361a3aa020c17469972861a02dcac1 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 12 Aug 2010 10:22:02 +0200 Subject: sb130: #i113096# introduced com.sun.star.configuration.XUpdate.removeExtensionXcuFile --- configmgr/source/README | 1 + configmgr/source/access.cxx | 23 ++-- configmgr/source/additions.hxx | 43 +++++++ configmgr/source/components.cxx | 134 +++++++++++++++++---- configmgr/source/components.hxx | 15 ++- configmgr/source/data.cxx | 44 +++++++ configmgr/source/data.hxx | 23 +++- configmgr/source/update.cxx | 17 +++ configmgr/source/xcdparser.cxx | 2 +- configmgr/source/xcuparser.cxx | 30 +++-- configmgr/source/xcuparser.hxx | 6 +- .../registry/configuration/dp_configuration.cxx | 26 ++-- 12 files changed, 307 insertions(+), 57 deletions(-) create mode 100644 configmgr/source/additions.hxx diff --git a/configmgr/source/README b/configmgr/source/README index b731043d34ed..b00990d1eeb2 100644 --- a/configmgr/source/README +++ b/configmgr/source/README @@ -70,6 +70,7 @@ writemodfile.cxx broadcaster.cxx Notification management. +additions.hxx update.cxx Extension manager interface. diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 190db364cdfe..eda60e6d612a 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -798,13 +798,22 @@ void Access::initBroadcasterAndChanges( css::uno::Any(), css::uno::Any())); //TODO: non-void ReplacedElement } - //TODO: if (allChanges != 0) { - // allChanges->push_back( - // css::util::ElementChange( - // css::uno::makeAny(...), - // css::uno::Any(), css::uno::Any())); - // //TODO: non-void ReplacedElement - //} + if (allChanges != 0) { + rtl::OUStringBuffer path( + getRelativePathRepresentation()); + if (path.getLength() != 0) { + path.append(sal_Unicode('/')); + } + path.append( + Data::createSegment( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), + i->first)); + allChanges->push_back( + css::util::ElementChange( + css::uno::makeAny(path.makeStringAndClear()), + css::uno::Any(), css::uno::Any())); + //TODO: non-void ReplacedElement + } } // else: spurious Modifications::Node not representing a change break; diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx new file mode 100644 index 000000000000..f34373c7f742 --- /dev/null +++ b/configmgr/source/additions.hxx @@ -0,0 +1,43 @@ +/************************************************************************* +* +* 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 +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#ifndef INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX +#define INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX + +#include "sal/config.h" + +#include + +#include "path.hxx" + +namespace configmgr { + +typedef std::list< Path > Additions; + +} + +#endif diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 04e6317c959d..733ca05bc147 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -54,10 +54,12 @@ #include "rtl/ustring.hxx" #include "sal/types.h" +#include "additions.hxx" #include "components.hxx" #include "data.hxx" #include "modifications.hxx" #include "node.hxx" +#include "nodemap.hxx" #include "parsemanager.hxx" #include "partial.hxx" #include "rootaccess.hxx" @@ -86,12 +88,12 @@ typedef std::list< UnresolvedListItem > UnresolvedList; void parseXcsFile( rtl::OUString const & url, int layer, Data & data, Partial const * partial, - Modifications * modifications) + Modifications * modifications, Additions * additions) SAL_THROW(( css::container::NoSuchElementException, css::uno::RuntimeException)) { - OSL_ASSERT(partial == 0 && modifications == 0); - (void) partial; (void) modifications; + OSL_ASSERT(partial == 0 && modifications == 0 && additions == 0); + (void) partial; (void) modifications; (void) additions; OSL_VERIFY( rtl::Reference< ParseManager >( new ParseManager(url, new XcsParser(layer, data)))->parse()); @@ -99,14 +101,16 @@ void parseXcsFile( void parseXcuFile( rtl::OUString const & url, int layer, Data & data, Partial const * partial, - Modifications * modifications) + Modifications * modifications, Additions * additions) SAL_THROW(( css::container::NoSuchElementException, css::uno::RuntimeException)) { OSL_VERIFY( rtl::Reference< ParseManager >( new ParseManager( - url, new XcuParser(layer, data, partial, modifications)))-> + url, + new XcuParser( + layer, data, partial, modifications, additions)))-> parse()); } @@ -116,6 +120,29 @@ rtl::OUString expand(rtl::OUString const & str) { return s; } +bool hasOnlyEmptySets(rtl::Reference< Node > const & node) { + OSL_ASSERT(node.is()); + switch (node->kind()) { + default: // Node::KIND_LOCALIZED_VALUE + OSL_ASSERT(false); + // fall through + case Node::KIND_PROPERTY: + case Node::KIND_LOCALIZED_PROPERTY: + return true; + case Node::KIND_GROUP: + for (NodeMap::iterator i(node->getMembers().begin()); + i != node->getMembers().end(); ++i) + { + if (!hasOnlyEmptySets(i->second)) { + return false; + } + } + return true; + case Node::KIND_SET: + return node->getMembers().empty(); + } +} + static bool singletonCreated = false; static Components * singleton = 0; @@ -218,7 +245,7 @@ void Components::insertExtensionXcsFile( bool shared, rtl::OUString const & fileUri) { try { - parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0); + parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -233,9 +260,12 @@ void Components::insertExtensionXcuFile( bool shared, rtl::OUString const & fileUri, Modifications * modifications) { OSL_ASSERT(modifications != 0); + int layer = shared ? 10 : 14; + Additions * adds = data_.addExtensionXcuAdditions(fileUri, layer); try { - parseXcuFile(fileUri, shared ? 10 : 14, data_, 0, modifications); + parseXcuFile(fileUri, layer, data_, 0, modifications, adds); } catch (css::container::NoSuchElementException & e) { + data_.removeExtensionXcuAdditions(fileUri); throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -245,6 +275,54 @@ void Components::insertExtensionXcuFile( } } +void Components::removeExtensionXcuFile( + rtl::OUString const & fileUri, Modifications * modifications) +{ + //TODO: Ideally, exactly the data coming from the specified xcu file would + // be removed. However, not enough information is recorded in the in-memory + // data structures to do so. So, as a workaround, all those set elements + // that were freshly added by the xcu and have afterwards been left + // unchanged are removed (and nothing else). The heuristic to determine + // whether a node has been left unchanged is to check the layer ID (as + // usual) and additionally to check that the node does not recursively + // contain any non-empty sets (multiple extension xcu files are merged into + // one layer, so checking layer ID alone is not enough). Since + // item->additions records all additions of set members in textual order, + // the latter check works well when iterating through item->additions in + // reverse order. + rtl::Reference< Data::ExtensionXcu > item( + data_.removeExtensionXcuAdditions(fileUri)); + if (item.is()) { + for (Additions::reverse_iterator i(item->additions.rbegin()); + i != item->additions.rend(); ++i) + { + rtl::Reference< Node > parent; + NodeMap const * map = &data_.components; + rtl::Reference< Node > node; + for (Path::const_iterator j(i->begin()); j != i->end(); ++j) { + parent = node; + node = Data::findNode(item->layer, *map, *j); + if (!node.is()) { + break; + } + map = &node->getMembers(); + } + if (node.is()) { + OSL_ASSERT(parent.is()); + if (parent->kind() == Node::KIND_SET) { + OSL_ASSERT( + node->kind() == Node::KIND_GROUP || + node->kind() == Node::KIND_SET); + if (hasOnlyEmptySets(node)) { + parent->getMembers().erase(i->back()); + modifications->add(*i); + } + } + } + } + } +} + void Components::insertModificationXcuFile( rtl::OUString const & fileUri, std::set< rtl::OUString > const & includedPaths, @@ -254,7 +332,7 @@ void Components::insertModificationXcuFile( OSL_ASSERT(modifications != 0); try { Partial part(includedPaths, excludedPaths); - parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications); + parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications, 0); } catch (css::uno::Exception & e) { //TODO: more specific exception catching OSL_TRACE( "configmgr error inserting %s: %s", @@ -377,7 +455,8 @@ Components::Components( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") ":BUNDLED_EXTENSIONS_USER}/registry/" "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini")))); + "PackageRegistryBackend/configmgr.ini"))), + false); parseXcsXcuIniLayer( 9, expand( @@ -386,8 +465,9 @@ Components::Components( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") ":SHARED_EXTENSIONS_USER}/registry/" "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini")))); - parseXcsXcuLayer( //TODO: migrate + "PackageRegistryBackend/configmgr.ini"))), + true); + parseXcsXcuLayer( 11, expand( rtl::OUString( @@ -396,6 +476,8 @@ Components::Components( ":UNO_USER_PACKAGES_CACHE}/registry/" "com.sun.star.comp.deployment.configuration." "PackageRegistryBackend/registry")))); + // can be dropped once old UserInstallation format can no longer exist + // (probably OOo 4) parseXcsXcuIniLayer( 13, expand( @@ -404,7 +486,8 @@ Components::Components( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") ":UNO_USER_PACKAGES_CACHE}/registry/" "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini")))); + "PackageRegistryBackend/configmgr.ini"))), + true); try { parseModificationLayer(); } catch (css::uno::Exception & e) { //TODO: more specific exception catching @@ -470,7 +553,7 @@ void Components::parseFiles( file.match(extension, file.getLength() - extension.getLength())) { try { - (*parseFile)(stat.getFileURL(), layer, data_, 0, 0); + (*parseFile)(stat.getFileURL(), layer, data_, 0, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -486,19 +569,26 @@ void Components::parseFiles( void Components::parseFileList( int layer, FileParser * parseFile, rtl::OUString const & urls, - rtl::Bootstrap const & ini) + rtl::Bootstrap const & ini, bool recordAdditions) { for (sal_Int32 i = 0;;) { rtl::OUString url(urls.getToken(0, ' ', i)); if (url.getLength() != 0) { ini.expandMacrosFrom(url); //TODO: detect failure + Additions * adds = 0; + if (recordAdditions) { + adds = data_.addExtensionXcuAdditions(url, layer); + } try { - (*parseFile)(url, layer, data_, 0, 0); + (*parseFile)(url, layer, data_, 0, 0, adds); } catch (css::container::NoSuchElementException & e) { OSL_TRACE( "configmgr file does not exist: %s", rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8).getStr()); + if (adds != 0) { + data_.removeExtensionXcuAdditions(url); + } } } if (i == -1) { @@ -610,18 +700,20 @@ void Components::parseXcsXcuLayer(int layer, rtl::OUString const & url) { url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/data")), false); } -void Components::parseXcsXcuIniLayer(int layer, rtl::OUString const & url) { +void Components::parseXcsXcuIniLayer( + int layer, rtl::OUString const & url, bool recordAdditions) +{ //TODO: rtl::Bootstrap::getFrom "first trie[s] to retrieve the value via the // global function" rtl::Bootstrap ini(url); rtl::OUString urls; if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCHEMA")), urls)) { - parseFileList(layer, &parseXcsFile, urls, ini); + parseFileList(layer, &parseXcsFile, urls, ini, false); } if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA")), urls)) { - parseFileList(layer + 1, &parseXcuFile, urls, ini); + parseFileList(layer + 1, &parseXcuFile, urls, ini, recordAdditions); } } @@ -650,13 +742,13 @@ rtl::OUString Components::getModificationFileUrl() const { void Components::parseModificationLayer() { try { - parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0); + parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0, 0); } catch (css::container::NoSuchElementException &) { OSL_TRACE( "configmgr user registrymodifications.xcu does not (yet) exist"); // Migrate old user layer data (can be removed once migration is no - // longer relevant; also see hack for xsi namespace in XmlReader - // constructor): + // longer relevant, probably OOo 4; also see hack for xsi namespace in + // XmlReader constructor): parseFiles( Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")), &parseXcuFile, diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx index 2e635680c1ce..880ac95d34a8 100644 --- a/configmgr/source/components.hxx +++ b/configmgr/source/components.hxx @@ -38,7 +38,10 @@ #include "com/sun/star/uno/Reference.hxx" #include "rtl/ref.hxx" +#include "additions.hxx" #include "data.hxx" +#include "modifications.hxx" +#include "nodemap.hxx" #include "path.hxx" namespace com { namespace sun { namespace star { @@ -56,7 +59,6 @@ namespace rtl { namespace configmgr { class Broadcaster; -class Modifications; class Node; class Partial; class RootAccess; @@ -98,6 +100,9 @@ public: bool shared, rtl::OUString const & fileUri, Modifications * modifications); + void removeExtensionXcuFile( + rtl::OUString const & fileUri, Modifications * modifications); + void insertModificationXcuFile( rtl::OUString const & fileUri, std::set< rtl::OUString > const & includedPaths, @@ -109,7 +114,8 @@ public: private: typedef void FileParser( - rtl::OUString const &, int, Data &, Partial const *, Modifications *); + rtl::OUString const &, int, Data &, Partial const *, Modifications *, + Additions *); Components( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > @@ -123,13 +129,14 @@ private: void parseFileList( int layer, FileParser * parseFile, rtl::OUString const & urls, - rtl::Bootstrap const & ini); + rtl::Bootstrap const & ini, bool recordAdditions); void parseXcdFiles(int layer, rtl::OUString const & url); void parseXcsXcuLayer(int layer, rtl::OUString const & url); - void parseXcsXcuIniLayer(int layer, rtl::OUString const & url); + void parseXcsXcuIniLayer( + int layer, rtl::OUString const & url, bool recordAdditions); void parseModuleLayer(int layer, rtl::OUString const & url); diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx index e12f9596940b..50466ca0532c 100644 --- a/configmgr/source/data.cxx +++ b/configmgr/source/data.cxx @@ -36,11 +36,13 @@ #include "osl/diagnose.h" #include "rtl/ref.hxx" #include "rtl/string.h" +#include "rtl/textenc.h" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include "additions.hxx" #include "data.hxx" #include "groupnode.hxx" #include "node.hxx" @@ -325,4 +327,46 @@ rtl::Reference< Node > Data::getTemplate( return findNode(layer, templates, fullName); } +Additions * Data::addExtensionXcuAdditions( + rtl::OUString const & url, int layer) +{ + rtl::Reference< ExtensionXcu > item(new ExtensionXcu); + ExtensionXcuAdditions::iterator i( + extensionXcuAdditions_.insert( + ExtensionXcuAdditions::value_type( + url, rtl::Reference< ExtensionXcu >())).first); + if (i->second.is()) { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "already added extension xcu ")) + + url), + css::uno::Reference< css::uno::XInterface >()); + } + i->second = item; + item->layer = layer; + return &item->additions; +} + +rtl::Reference< Data::ExtensionXcu > Data::removeExtensionXcuAdditions( + rtl::OUString const & url) +{ + ExtensionXcuAdditions::iterator i(extensionXcuAdditions_.find(url)); + if (i == extensionXcuAdditions_.end()) { + // This can happen, as migration of pre OOo 3.3 UserInstallation + // extensions in dp_registry::backend::configuration::BackendImpl:: + // PackageImpl::processPackage_ can cause just-in-time creation of + // extension xcu files that are never added via addExtensionXcuAdditions + // (also, there might be url spelling differences between calls to + // addExtensionXcuAdditions and removeExtensionXcuAdditions?): + OSL_TRACE( + "unknown configmgr::Data::removeExtensionXcuAdditions(%s)", + rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr()); + return rtl::Reference< ExtensionXcu >(); + } + rtl::Reference< ExtensionXcu > item(i->second); + extensionXcuAdditions_.erase(i); + return item; +} + } diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx index 52353d066b67..8f5f7af0d86e 100644 --- a/configmgr/source/data.hxx +++ b/configmgr/source/data.hxx @@ -31,18 +31,20 @@ #include "sal/config.h" #include +#include #include #include "boost/noncopyable.hpp" #include "rtl/ref.hxx" +#include "rtl/ustring.hxx" #include "sal/types.h" +#include "salhelper/simplereferenceobject.hxx" +#include "additions.hxx" #include "modifications.hxx" #include "nodemap.hxx" #include "path.hxx" -namespace rtl { class OUString; } - namespace configmgr { class Node; @@ -50,6 +52,11 @@ class Node; struct Data: private boost::noncopyable { enum { NO_LAYER = INT_MAX }; + struct ExtensionXcu: public salhelper::SimpleReferenceObject { + int layer; + Additions additions; + }; + NodeMap templates; NodeMap components; @@ -80,6 +87,18 @@ struct Data: private boost::noncopyable { rtl::Reference< Node > getTemplate( int layer, rtl::OUString const & fullName) const; + + Additions * addExtensionXcuAdditions( + rtl::OUString const & url, int layer); + + rtl::Reference< ExtensionXcu > removeExtensionXcuAdditions( + rtl::OUString const & url); + +private: + typedef std::map< rtl::OUString, rtl::Reference< ExtensionXcu > > + ExtensionXcuAdditions; + + ExtensionXcuAdditions extensionXcuAdditions_; }; } diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx index 4c1d59d5d054..403b761a5abd 100644 --- a/configmgr/source/update.cxx +++ b/configmgr/source/update.cxx @@ -89,6 +89,9 @@ private: sal_Bool shared, rtl::OUString const & fileUri) throw (css::uno::RuntimeException); + virtual void SAL_CALL removeExtensionXcuFile(rtl::OUString const & fileUri) + throw (css::uno::RuntimeException); + virtual void SAL_CALL insertModificationXcuFile( rtl::OUString const & fileUri, css::uno::Sequence< rtl::OUString > const & includedPaths, @@ -120,6 +123,20 @@ void Service::insertExtensionXcuFile( bc.send(); } +void Service::removeExtensionXcuFile(rtl::OUString const & fileUri) + throw (css::uno::RuntimeException) +{ + Broadcaster bc; + { + osl::MutexGuard g(lock); + Modifications mods; + Components::getSingleton().removeExtensionXcuFile(fileUri, &mods); + Components::getSingleton().initGlobalBroadcaster( + mods, rtl::Reference< RootAccess >(), &bc); + } + bc.send(); +} + void Service::insertModificationXcuFile( rtl::OUString const & fileUri, css::uno::Sequence< rtl::OUString > const & includedPaths, diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx index 498254b35644..ad774d5ca3e3 100644 --- a/configmgr/source/xcdparser.cxx +++ b/configmgr/source/xcdparser.cxx @@ -137,7 +137,7 @@ bool XcdParser::startElement( if (ns == XmlReader::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) { - nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0); + nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0, 0); nesting_ = 1; return nestedParser_->startElement(reader, ns, name); } diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index cd1e6e55d085..91f3b244c5a8 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -68,12 +68,13 @@ namespace css = com::sun::star; XcuParser::XcuParser( int layer, Data & data, Partial const * partial, - Modifications * broadcastModifications): + Modifications * broadcastModifications, Additions * additions): valueParser_(layer), data_(data), partial_(partial), broadcastModifications_(broadcastModifications), - recordModifications_(layer == Data::NO_LAYER), + additions_(additions), recordModifications_(layer == Data::NO_LAYER), trackPath_( - partial_ != 0 || broadcastModifications_ != 0 || recordModifications_) + partial_ != 0 || broadcastModifications_ != 0 || additions_ != 0 || + recordModifications_) {} XcuParser::~XcuParser() {} @@ -624,7 +625,7 @@ void XcuParser::handleLocpropValue( pop = true; } if (trackPath_) { - recordModification(); + recordModification(false); if (pop) { path_.pop_back(); } @@ -638,7 +639,7 @@ void XcuParser::handleLocpropValue( locprop->getMembers().erase(i); } state_.push(State(true)); - recordModification(); + recordModification(false); break; default: throw css::uno::RuntimeException( @@ -750,7 +751,7 @@ void XcuParser::handleUnknownGroupProp( prop->setFinalized(valueParser_.getLayer()); } state_.push(State(prop, name, state_.top().locked)); - recordModification(); + recordModification(false); break; } // fall through @@ -800,7 +801,7 @@ void XcuParser::handlePlainGroupProp( property, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - recordModification(); + recordModification(false); break; case OPERATION_REMOVE: if (!property->isExtension()) { @@ -814,7 +815,7 @@ void XcuParser::handlePlainGroupProp( } group->getMembers().erase(propertyIndex); state_.push(State(true)); // ignore children - recordModification(); + recordModification(false); break; } } @@ -863,7 +864,7 @@ void XcuParser::handleLocalizedGroupProp( replacement, name, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - recordModification(); + recordModification(false); } break; case OPERATION_REMOVE: @@ -1070,7 +1071,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); state_.push(State(member, name, false)); - recordModification(); + recordModification(i == set->getMembers().end()); } break; case OPERATION_FUSE: @@ -1084,7 +1085,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); state_.push(State(member, name, false)); - recordModification(); + recordModification(true); } } else { state_.push( @@ -1104,15 +1105,18 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { set->getMembers().erase(i); } state_.push(State(true)); - recordModification(); + recordModification(false); break; } } -void XcuParser::recordModification() { +void XcuParser::recordModification(bool addition) { if (broadcastModifications_ != 0) { broadcastModifications_->add(path_); } + if (addition && additions_ != 0) { + additions_->push_back(path_); + } if (recordModifications_) { data_.modifications.add(path_); } diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx index 64108451b4ef..02ef4e5ff117 100644 --- a/configmgr/source/xcuparser.hxx +++ b/configmgr/source/xcuparser.hxx @@ -35,6 +35,7 @@ #include "rtl/ref.hxx" #include "rtl/ustring.hxx" +#include "additions.hxx" #include "node.hxx" #include "nodemap.hxx" #include "parser.hxx" @@ -59,7 +60,7 @@ class XcuParser: public Parser { public: XcuParser( int layer, Data & data, Partial const * partial, - Modifications * broadcastModifications); + Modifications * broadcastModifications, Additions * additions); private: virtual ~XcuParser(); @@ -108,7 +109,7 @@ private: void handleSetNode(XmlReader & reader, SetNode * set); - void recordModification(); + void recordModification(bool addition); struct State { rtl::Reference< Node > node; // empty iff ignore or @@ -141,6 +142,7 @@ private: Data & data_; Partial const * partial_; Modifications * broadcastModifications_; + Additions * additions_; bool recordModifications_; bool trackPath_; rtl::OUString componentName_; diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 9ea6e8227340..22cbcacc9e9d 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -139,7 +139,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data); ::boost::optional readDataFromDb(OUString const & url); - void deleteDataFromDb(OUString const & url); + OUString deleteDataFromDb(OUString const & url); ::std::list getAllIniEntries(); public: @@ -240,10 +240,18 @@ void BackendImpl::addDataToDb( return data; } -void BackendImpl::deleteDataFromDb(OUString const & url) +OUString BackendImpl::deleteDataFromDb(OUString const & url) { - if (m_backendDb.get()) + OUString url2(url); + if (m_backendDb.get()) { + boost::optional< ConfigurationBackendDb::Data > data( + m_backendDb->getEntry(url)); + if (data) { + url2 = expandUnoRcTerm(data->iniEntry); + } m_backendDb->removeEntry(url); + } + return url2; } ::std::list BackendImpl::getAllIniEntries() @@ -736,11 +744,11 @@ void BackendImpl::PackageImpl::processPackage_( //rebuilding the directory structure. rtl::OUString url2( rtl::OStringToOUString(i->first, RTL_TEXTENCODING_UTF8)); - ConfigurationBackendDb::Data data; if (url2 != url) { bool schema = i->second.equalsIgnoreAsciiCase( "vnd.sun.star.configuration-schema"); OUString url_replaced(url2); + ConfigurationBackendDb::Data data; if (!schema) { const OUString sModFolder = that->createFolder(OUString(), xCmdEnv); @@ -753,6 +761,7 @@ void BackendImpl::PackageImpl::processPackage_( deleteTempFolder(sModFolder); } that->addToConfigmgrIni(schema, url_replaced, xCmdEnv); + data.iniEntry = dp_misc::makeRcTerm(url_replaced); that->addDataToDb(url2, data); } that->m_registeredPackages->erase(i->first); @@ -762,9 +771,12 @@ void BackendImpl::PackageImpl::processPackage_( xCmdEnv ).executeCommand( OUSTR("delete"), Any( true /* delete physically */ ) ); } - that->deleteDataFromDb(getURL()); - - //TODO: revoking at runtime, possible, sensible? + url = that->deleteDataFromDb(url); + if (!m_isSchema) { + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->removeExtensionXcuFile( + expandUnoRcUrl(url)); + } } } -- cgit From 10e6c6cbfb05b1a46a6cf187c0d44cee2bfa3768 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 12 Aug 2010 10:22:02 +0200 Subject: sb130: #i113096# introduced com.sun.star.configuration.XUpdate.removeExtensionXcuFile --- offapi/com/sun/star/configuration/XUpdate.idl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/offapi/com/sun/star/configuration/XUpdate.idl b/offapi/com/sun/star/configuration/XUpdate.idl index 7514cbcb1b7f..c3316ea5dc45 100644 --- a/offapi/com/sun/star/configuration/XUpdate.idl +++ b/offapi/com/sun/star/configuration/XUpdate.idl @@ -40,7 +40,13 @@ module com { module sun { module star { module configuration { */ interface XUpdate { void insertExtensionXcsFile([in] boolean shared, [in] string fileUri); + void insertExtensionXcuFile([in] boolean shared, [in] string fileUri); + + void removeExtensionXcuFile([in] string fileUri); + // fileUri must exactly match corresponding insertExtensionXcuFile + // argument + void insertModificationXcuFile( [in] string fileUri, [in] sequence< string > includedPaths, [in] sequence< string > excludedPaths); -- cgit From 6bb9f5bea7037dcda3cb3e104452fb0104544bfb Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 12 Aug 2010 13:32:56 +0200 Subject: ooo33gsl05: #i113821# ensure last page renders when aborting job --- vcl/inc/vcl/print.hxx | 1 + vcl/source/gdi/print3.cxx | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 96822d9bc756..0cd56e32d83d 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -520,6 +520,7 @@ public: SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr& ); SAL_DLLPRIVATE void setOptionChangeHdl( const Link& ); SAL_DLLPRIVATE void createProgressDialog(); + SAL_DLLPRIVATE bool isProgressCanceled() const; SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& ); SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const; SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 0aeb928856fc..b3f858a06f2d 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -444,8 +444,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr& i_pContr if( ! aDlg.Execute() ) { GDIMetaFile aPageFile; - i_pController->setLastPage( sal_True ); - i_pController->getFilteredPageFile( 0, aPageFile ); + i_pController->abortJob(); return; } if( aDlg.isPrintToFile() ) @@ -453,9 +452,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr& i_pContr rtl::OUString aFile = queryFile( pController->getPrinter().get() ); if( ! aFile.getLength() ) { - GDIMetaFile aPageFile; - i_pController->setLastPage( sal_True ); - i_pController->getFilteredPageFile( 0, aPageFile ); + i_pController->abortJob(); return; } pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalFileName" ) ), @@ -612,7 +609,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrStartJob( pPrintFile, i_rJobName, Application::GetDisplayName(), @@ -624,11 +621,11 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrcreateProgressDialog(); int nPages = i_pController->getFilteredPageCount(); - for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount; nOuterIteration++ ) + for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount && ! bAborted; nOuterIteration++ ) { - for( int nPage = 0; nPage < nPages; nPage++ ) + for( int nPage = 0; nPage < nPages && ! bAborted; nPage++ ) { - for( int nInnerIteration = 0; nInnerIteration < nInnerRepeatCount; nInnerIteration++ ) + for( int nInnerIteration = 0; nInnerIteration < nInnerRepeatCount && ! bAborted; nInnerIteration++ ) { if( nPage == nPages-1 && nOuterIteration == nOuterRepeatCount-1 && @@ -638,6 +635,11 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptrsetLastPage( sal_True ); } i_pController->printFilteredPage( nPage ); + if( i_pController->isProgressCanceled() ) + { + i_pController->abortJob(); + bAborted = true; + } } } // FIXME: duplex ? @@ -1183,6 +1185,13 @@ void PrinterController::jobFinished( view::PrintableState ) void PrinterController::abortJob() { setJobState( view::PrintableState_JOB_ABORTED ); + // applications (well, sw) depend on a page request with "IsLastPage" = true + // to free resources, else they (well, sw) will crash eventually + setLastPage( sal_True ); + delete mpImplData->mpProgress; + mpImplData->mpProgress = NULL; + GDIMetaFile aMtf; + getPageFile( 0, aMtf, false ); } void PrinterController::setLastPage( sal_Bool i_bLastPage ) @@ -1515,6 +1524,11 @@ void PrinterController::createProgressDialog() mpImplData->mpProgress->reset(); } +bool PrinterController::isProgressCanceled() const +{ + return mpImplData->mpProgress && mpImplData->mpProgress->isCanceled(); +} + void PrinterController::setMultipage( const MultiPageSetup& i_rMPS ) { mpImplData->maMultiPage = i_rMPS; -- cgit From 7b40b729c0956185ce6bcf6d00b85857fcb9e26b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 12 Aug 2010 15:05:09 +0200 Subject: sw33bf08: #i108078#: ::sfx2::createBaseURI(): manually expand vnd.sun.star.expand: URIs before calling makeAbsolute(). --- sfx2/source/doc/DocumentMetadataAccess.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 9625ea958830..83ed9b3ccfe8 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -136,6 +137,16 @@ uno::Reference createBaseURI( throw uno::RuntimeException(); } + // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs + // this really should be done somewhere else, not here. + ::rtl::OUString pkgURI(i_rPkgURI); + if (pkgURI.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) + { + // expand it here (makeAbsolute requires hierarchical URI) + pkgURI = pkgURI.copy( sizeof("vnd.sun.star.expand:") - 1 ); + ::rtl::Bootstrap::expandMacros(pkgURI); + } + const uno::Reference xServiceFactory( i_xContext->getServiceManager(), uno::UNO_SET_THROW); const uno::Reference xUriFactory( @@ -146,11 +157,12 @@ uno::Reference createBaseURI( uno::Reference< uri::XUriReference > xBaseURI; const uno::Reference< uri::XUriReference > xPkgURI( - xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW ); + xUriFactory->parse(pkgURI), uno::UNO_SET_THROW ); xPkgURI->clearFragment(); + // need to know whether the storage is a FileSystemStorage // XServiceInfo would be better, but it is not implemented -// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) ) +// if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) ) if (true) { xBaseURI.set( xPkgURI, uno::UNO_SET_THROW ); #if 0 -- cgit From b045af077a788a6b95b2e690d58ea1712c6f3d25 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 12 Aug 2010 16:01:40 +0200 Subject: ooo33gsl05: #i113025# fix GDIMetaFile handlng of MapMode MAP_PIXEL --- vcl/inc/vcl/gdimtf.hxx | 2 ++ vcl/source/gdi/gdimtf.cxx | 43 +++++++++++++++++++++++++++++++++++++++++++ vcl/source/gdi/metaact.cxx | 2 +- vcl/source/gdi/print3.cxx | 6 +++--- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index 06f7a0d14a2e..c168443741fc 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -158,6 +158,8 @@ public: sal_Bool IsEqual( const GDIMetaFile& rMtf ) const; BOOL Mirror( ULONG nMirrorFlags ); void Move( long nX, long nY ); + // additional Move method getting specifics how to handle MapMode( MAP_PIXEL ) + void Move( long nX, long nY, long nDPIX, long nDPIX ); void Scale( double fScaleX, double fScaleY ); void Scale( const Fraction& rScaleX, const Fraction& rScaleY ); void Rotate( long nAngle10 ); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 01b34286a086..818a31a10c0f 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -841,6 +841,49 @@ void GDIMetaFile::Move( long nX, long nY ) } } +void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) +{ + const Size aBaseOffset( nX, nY ); + Size aOffset( aBaseOffset ); + VirtualDevice aMapVDev; + + aMapVDev.EnableOutput( FALSE ); + aMapVDev.SetReferenceDevice( nDPIX, nDPIY ); + aMapVDev.SetMapMode( GetPrefMapMode() ); + + for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() ) + { + const long nType = pAct->GetType(); + MetaAction* pModAct; + + if( pAct->GetRefCount() > 1 ) + { + Replace( pModAct = pAct->Clone(), GetCurPos() ); + pAct->Delete(); + } + else + pModAct = pAct; + + if( ( META_MAPMODE_ACTION == nType ) || + ( META_PUSH_ACTION == nType ) || + ( META_POP_ACTION == nType ) ) + { + pModAct->Execute( &aMapVDev ); + if( aMapVDev.GetMapMode().GetMapUnit() == MAP_PIXEL ) + { + aOffset = aMapVDev.LogicToPixel( aBaseOffset, GetPrefMapMode() ); + MapMode aMap( aMapVDev.GetMapMode() ); + aOffset.Width() = aOffset.Width() * (double)aMap.GetScaleX(); + aOffset.Height() = aOffset.Height() * (double)aMap.GetScaleY(); + } + else + aOffset = aMapVDev.LogicToLogic( aBaseOffset, GetPrefMapMode(), aMapVDev.GetMapMode() ); + } + + pModAct->Move( aOffset.Width(), aOffset.Height() ); + } +} + // ------------------------------------------------------------------------ void GDIMetaFile::Scale( double fScaleX, double fScaleY ) diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 752a4222bcb2..94f07b8f17d1 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -4078,7 +4078,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove ) aMemStm >> aFill; PolyPolygon aPath; aFill.getPath( aPath ); - aPath.Scale( nXMove, nYMove ); + aPath.Move( nXMove, nYMove ); aFill.setPath( aPath ); aDest << aFill; } diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index b3f858a06f2d..375c570f1a16 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -958,7 +958,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte o_rMtf.WindStart(); long nDX = (aPaperSize.Width() - aPageSize.aSize.Width()) / 2; long nDY = (aPaperSize.Height() - aPageSize.aSize.Height()) / 2; - o_rMtf.Move( nDX, nDY ); + o_rMtf.Move( nDX, nDY, mpImplData->mpPrinter->ImplGetDPIX(), mpImplData->mpPrinter->ImplGetDPIY() ); o_rMtf.WindStart(); o_rMtf.SetPrefSize( aPaperSize ); aPageSize.aSize = aPaperSize; @@ -1033,7 +1033,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte long nOffY = (aSubPageSize.Height() - long(double(aPageSize.aSize.Height()) * fScale)) / 2; long nX = rMPS.nLeftMargin + nOffX + nAdvX * nCellX; long nY = rMPS.nTopMargin + nOffY + nAdvY * nCellY; - aPageFile.Move( nX, nY ); + aPageFile.Move( nX, nY, mpImplData->mpPrinter->ImplGetDPIX(), mpImplData->mpPrinter->ImplGetDPIY() ); aPageFile.WindStart(); // calculate border rectangle Rectangle aSubPageRect( Point( nX, nY ), @@ -1153,7 +1153,7 @@ void PrinterController::printFilteredPage( int i_nPage ) { Point aPageOffset( mpImplData->mpPrinter->GetPageOffset() ); aPageFile.WindStart(); - aPageFile.Move( -aPageOffset.X(), -aPageOffset.Y() ); + aPageFile.Move( -aPageOffset.X(), -aPageOffset.Y(), mpImplData->mpPrinter->ImplGetDPIX(), mpImplData->mpPrinter->ImplGetDPIY() ); } GDIMetaFile aCleanedFile; -- cgit From f47d90f206047b44993671316cfad21eb471a846 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 12 Aug 2010 16:13:11 +0200 Subject: sw33bf08: #i108078#: ::sfx2::createBaseURI(): decode content of expand URI --- sfx2/source/doc/DocumentMetadataAccess.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 83ed9b3ccfe8..df0781be8877 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -140,11 +141,19 @@ uno::Reference createBaseURI( // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs // this really should be done somewhere else, not here. ::rtl::OUString pkgURI(i_rPkgURI); - if (pkgURI.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) + if (pkgURI.matchIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) { // expand it here (makeAbsolute requires hierarchical URI) - pkgURI = pkgURI.copy( sizeof("vnd.sun.star.expand:") - 1 ); - ::rtl::Bootstrap::expandMacros(pkgURI); + pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") ); + if (pkgURI.getLength() != 0) { + pkgURI = ::rtl::Uri::decode( + pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8); + if (pkgURI.getLength() == 0) { + throw uno::RuntimeException(); + } + ::rtl::Bootstrap::expandMacros(pkgURI); + } } const uno::Reference xServiceFactory( -- cgit From d2aa21c67466637572b0fbd06cc941c1d60d9dc4 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 13 Aug 2010 08:01:31 +0200 Subject: mib18: #163254# Set right name and parent for copied object class members --- basic/source/classes/sb.cxx | 4 ++++ basic/source/comp/sbcomp.cxx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 1427e7a74fdf..dab060500e05 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -571,12 +571,16 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) { SbModule* pClassModule = pClassModuleObj->getClassModule(); SbClassModuleObject* pNewObj = new SbClassModuleObject( pClassModule ); + pNewObj->SetName( pProp->GetName() ); + pNewObj->SetParent( pClassModule->pParent ); pNewProp->PutObject( pNewObj ); } else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) ) { String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") ); BasicCollection* pNewCollection = new BasicCollection( aCollectionName ); + pNewCollection->SetName( pProp->GetName() ); + pNewCollection->SetParent( pClassModule->pParent ); pNewProp->PutObject( pNewCollection ); } } diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index e6fe73177dd2..5b7e5c70591d 100755 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -261,7 +261,7 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, { aStr.AppendAscii( "Entering " ); } - String aModuleName = pModule->GetName(); + String aModuleName = pTraceMod->GetName(); aStr += aModuleName; if( pMethod != NULL ) { -- cgit From 9e5b02a0c1e802a6afdca2d79e77a0aa00e98ba7 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 13 Aug 2010 09:07:29 +0200 Subject: #i113776# avoid default adaptive subdivision for now --- basegfx/source/polygon/b2dtrapezoid.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 4cd63f938114..c1e0f7f6c7c1 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -1161,7 +1161,8 @@ namespace basegfx if(aSource.areControlPointsUsed()) { - aSource = aSource.getDefaultAdaptiveSubdivision(); + const double fPrecisionFactor = 0.25; + aSource = adaptiveSubdivideByDistance( aSource, fLineWidth * fPrecisionFactor ); } const sal_uInt32 nPointCount(aSource.count()); -- cgit From 969f4032e8ee1339cbbc339466f0122f8c1fb8a8 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Fri, 13 Aug 2010 11:15:11 +0200 Subject: native324 #i113835# preparing rpm installation on debian systems --- .../org/openoffice/setup/InstallData.java | 18 ++ .../openoffice/setup/Installer/LinuxInstaller.java | 182 ++++++++++++++------- .../setup/InstallerHelper/LinuxHelper.java | 21 +++ setup_native/scripts/install_linux.sh | 16 +- 4 files changed, 172 insertions(+), 65 deletions(-) diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java index aefd78e480b7..66598a7ca7cb 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java @@ -75,6 +75,8 @@ public class InstallData static private boolean databaseQueried = false; static private boolean useRtl = false; static private boolean installedProductMinorSet = false; + static private boolean isDebianSystem = false; + static private boolean debianInvestigated = false; static private String installType; /* custom or typical installation */ static private String osType; /* Linux, SunOS, ... */ static private String installDir = null; @@ -649,6 +651,22 @@ public class InstallData installedProductMinorSet = value; } + public boolean debianInvestigated() { + return debianInvestigated; + } + + public void setDebianInvestigated(boolean value) { + debianInvestigated = value; + } + + public boolean isDebianSystem() { + return isDebianSystem; + } + + public void setIsDebianSystem(boolean value) { + isDebianSystem = value; + } + public boolean databaseQueried() { return databaseQueried; } diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java index fa1ce919245c..dc9a76214106 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java @@ -190,6 +190,20 @@ public class LinuxInstaller extends Installer { if ( sofficeLink.exists() ) { useForce = true; } } + // On Debian based systems, rpms can be installed with the switch --force-debian, if a rpm + // is installed. + + String forceDebianString = ""; + + if ( ! data.debianInvestigated() ) { + helper.investigateDebian(data); + data.setDebianInvestigated(true); + } + + if ( data.isDebianSystem() ) { + forceDebianString = "--force-debian"; + } + String rpmCommand = ""; String[] rpmCommandArray; String databasePath = null; @@ -212,107 +226,115 @@ public class LinuxInstaller extends Installer { if (useForce) { if (useLocalDatabase) { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize --force -vh " + + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + "--relocate " + relocations + " " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[10]; + rpmCommandArray = new String[11]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = "--relocate"; - rpmCommandArray[6] = relocations; - rpmCommandArray[7] = databaseString; - rpmCommandArray[8] = databasePath; - rpmCommandArray[9] = packageName; + rpmCommandArray[4] = forceDebianString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = "--relocate"; + rpmCommandArray[7] = relocations; + rpmCommandArray[8] = databaseString; + rpmCommandArray[9] = databasePath; + rpmCommandArray[10] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize --force -vh " + + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[8]; + rpmCommandArray = new String[9]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = databaseString; - rpmCommandArray[6] = databasePath; - rpmCommandArray[7] = packageName; + rpmCommandArray[4] = forceDebianString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = databaseString; + rpmCommandArray[7] = databasePath; + rpmCommandArray[8] = packageName; } } else { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize --force -vh " + + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + "--relocate " + relocations + " " + packageName; - rpmCommandArray = new String[8]; + rpmCommandArray = new String[9]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = "--relocate"; - rpmCommandArray[6] = relocations; - rpmCommandArray[7] = packageName; + rpmCommandArray[4] = forceDebianString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = "--relocate"; + rpmCommandArray[7] = relocations; + rpmCommandArray[8] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize --force -vh " + packageName; - rpmCommandArray = new String[6]; + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + packageName; + rpmCommandArray = new String[7]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = packageName; + rpmCommandArray[4] = forceDebianString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = packageName; } } } else { if (useLocalDatabase) { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize -vh " + + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + "--relocate " + relocations + " " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[9]; + rpmCommandArray = new String[10]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; - rpmCommandArray[3] = "-vh"; - rpmCommandArray[4] = "--relocate"; - rpmCommandArray[5] = relocations; - rpmCommandArray[6] = databaseString; - rpmCommandArray[7] = databasePath; - rpmCommandArray[8] = packageName; + rpmCommandArray[3] = forceDebianString; + rpmCommandArray[4] = "-vh"; + rpmCommandArray[5] = "--relocate"; + rpmCommandArray[6] = relocations; + rpmCommandArray[7] = databaseString; + rpmCommandArray[8] = databasePath; + rpmCommandArray[9] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize -vh " + + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[7]; + rpmCommandArray = new String[8]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; - rpmCommandArray[3] = "-vh"; - rpmCommandArray[4] = databaseString; - rpmCommandArray[5] = databasePath; - rpmCommandArray[6] = packageName; + rpmCommandArray[3] = forceDebianString; + rpmCommandArray[4] = "-vh"; + rpmCommandArray[5] = databaseString; + rpmCommandArray[6] = databasePath; + rpmCommandArray[7] = packageName; } } else { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize -vh " + + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + "--relocate " + relocations + " " + packageName; - rpmCommandArray = new String[7]; + rpmCommandArray = new String[8]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; - rpmCommandArray[3] = "-vh"; - rpmCommandArray[4] = "--relocate"; - rpmCommandArray[5] = relocations; - rpmCommandArray[6] = packageName; + rpmCommandArray[3] = forceDebianString; + rpmCommandArray[4] = "-vh"; + rpmCommandArray[5] = "--relocate"; + rpmCommandArray[6] = relocations; + rpmCommandArray[7] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize -vh " + packageName; - rpmCommandArray = new String[5]; + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + packageName; + rpmCommandArray = new String[6]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; - rpmCommandArray[3] = "-vh"; - rpmCommandArray[4] = packageName; + rpmCommandArray[3] = forceDebianString; + rpmCommandArray[4] = "-vh"; + rpmCommandArray[5] = packageName; } } } @@ -383,20 +405,58 @@ public class LinuxInstaller extends Installer { useLocalDatabase = true; } - if (useLocalDatabase) { - rpmCommand = "rpm -ev" + " " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[5]; - rpmCommandArray[0] = "rpm"; - rpmCommandArray[1] = "-ev"; - rpmCommandArray[2] = databaseString; - rpmCommandArray[3] = databasePath; - rpmCommandArray[4] = packageName; + // On Debian based systems, rpms can be installed with the switch --force-debian, if a rpm + // is installed. + + String forceDebianString = ""; + + if ( ! data.debianInvestigated() ) { + helper.investigateDebian(data); + data.setDebianInvestigated(true); + } + + if ( data.isDebianSystem() ) { + forceDebianString = "--force-debian"; + } + + // Code duplication for isDebianSystem is necessary, because there is no valid position + // for forceDebianString, if it is empty. This is no problem in installPackage. + + if ( data.isDebianSystem() ) { + + if (useLocalDatabase) { + rpmCommand = "rpm " + forceDebianString + " -ev" + " " + databaseString + " " + databasePath + " " + packageName; + rpmCommandArray = new String[6]; + rpmCommandArray[0] = "rpm"; + rpmCommandArray[1] = forceDebianString; + rpmCommandArray[2] = "-ev"; + rpmCommandArray[3] = databaseString; + rpmCommandArray[4] = databasePath; + rpmCommandArray[5] = packageName; + } else { + rpmCommand = "rpm " + forceDebianString + " -ev" + " " + packageName; + rpmCommandArray = new String[4]; + rpmCommandArray[0] = "rpm"; + rpmCommandArray[1] = forceDebianString; + rpmCommandArray[2] = "-ev"; + rpmCommandArray[3] = packageName; + } } else { - rpmCommand = "rpm -ev" + " " + packageName; - rpmCommandArray = new String[3]; - rpmCommandArray[0] = "rpm"; - rpmCommandArray[1] = "-ev"; - rpmCommandArray[2] = packageName; + if (useLocalDatabase) { + rpmCommand = "rpm -ev" + " " + databaseString + " " + databasePath + " " + packageName; + rpmCommandArray = new String[5]; + rpmCommandArray[0] = "rpm"; + rpmCommandArray[1] = "-ev"; + rpmCommandArray[2] = databaseString; + rpmCommandArray[3] = databasePath; + rpmCommandArray[4] = packageName; + } else { + rpmCommand = "rpm -ev" + " " + packageName; + rpmCommandArray = new String[3]; + rpmCommandArray[0] = "rpm"; + rpmCommandArray[1] = "-ev"; + rpmCommandArray[2] = packageName; + } } Vector returnVector = new Vector(); diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/LinuxHelper.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/LinuxHelper.java index 1640ae706a46..ebf915c6274a 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/LinuxHelper.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/LinuxHelper.java @@ -381,6 +381,27 @@ import java.util.Vector;public class LinuxHelper { return databasePath; } + public void investigateDebian(InstallData data) { + + // String rpmQuery = "rpm --help; + String[] rpmQueryArray = new String[2]; + rpmQueryArray[0] = "rpm"; + rpmQueryArray[1] = "--help"; + + Vector returnVector = new Vector(); + Vector returnErrorVector = new Vector(); + int returnValue = ExecuteProcess.executeProcessReturnVector(rpmQueryArray, returnVector, returnErrorVector); + + // Checking if the return vector contains the string "force-debian" + + for (int i = 0; i < returnVector.size(); i++) { + String line = (String) returnVector.get(i); + if ( line.indexOf("force-debian") > -1 ) { + data.setIsDebianSystem(true); + } + } + } + public void getLinuxFileInfo(PackageDescription packageData) { // analyzing a string like "openoffice-core01-2.0.3-159" as "name-version-release" InstallData data = InstallData.getInstance(); diff --git a/setup_native/scripts/install_linux.sh b/setup_native/scripts/install_linux.sh index fe4be73f77ea..c33fe989554f 100644 --- a/setup_native/scripts/install_linux.sh +++ b/setup_native/scripts/install_linux.sh @@ -121,6 +121,14 @@ then exit 2 fi +# #163256# check if we are on a debian system... +if rpm --help | grep debian >/dev/null; +then + DEBIAN_FLAGS="--force-debian --nodeps" +else + DEBIAN_FLAGS= +fi + # # Determine whether this should be an update or a fresh install # @@ -227,7 +235,7 @@ FAKEDBRPM=/tmp/fake-db-1.0-$$.noarch.rpm linenum=??? tail -n +$linenum $0 > $FAKEDBRPM -rpm --upgrade --ignoresize --dbpath $RPM_DB_PATH $FAKEDBRPM +rpm ${DEBIAN_FLAGS} --upgrade --ignoresize --dbpath $RPM_DB_PATH $FAKEDBRPM rm -f $FAKEDBRPM @@ -253,7 +261,7 @@ echo "Installing the RPMs" ABSROOT=`cd ${INSTALLDIR}; pwd` RELOCATIONS=`rpm -qp --qf "--relocate %{PREFIXES}=${ABSROOT}%{PREFIXES} \n" $RPMLIST | sort -u | tr -d "\012"` -UserInstallation=\$BRAND_BASE_DIR/../UserInstallation rpm $RPMCMD --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST +UserInstallation=\$BRAND_BASE_DIR/../UserInstallation rpm ${DEBIAN_FLAGS} $RPMCMD --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST # # Create a link into the users home directory @@ -268,11 +276,11 @@ if [ "$UPDATE" = "yes" -a ! -f $INSTALLDIR/program/bootstraprc ] then echo echo "Update failed due to a bug in RPM, uninstalling .." - rpm --erase -v --nodeps --dbpath $RPM_DB_PATH `rpm --query --queryformat "%{NAME} " --package $RPMLIST --dbpath $RPM_DB_PATH` + rpm ${DEBIAN_FLAGS} --erase -v --nodeps --dbpath $RPM_DB_PATH `rpm --query --queryformat "%{NAME} " --package $RPMLIST --dbpath $RPM_DB_PATH` echo echo "Now re-installing new packages .." echo - rpm --install --nodeps --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST + rpm ${DEBIAN_FLAGS} --install --nodeps --ignoresize -vh $RELOCATIONS --dbpath $RPM_DB_PATH $RPMLIST echo fi -- cgit From 1fa6112a2d062612201c765ed3eb6e2faaba8faf Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 13 Aug 2010 11:25:17 +0200 Subject: ooo33gsl05: fix a typo --- vcl/inc/vcl/gdimtf.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index c168443741fc..636fc4a979f3 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -159,7 +159,7 @@ public: BOOL Mirror( ULONG nMirrorFlags ); void Move( long nX, long nY ); // additional Move method getting specifics how to handle MapMode( MAP_PIXEL ) - void Move( long nX, long nY, long nDPIX, long nDPIX ); + void Move( long nX, long nY, long nDPIX, long nDPIY ); void Scale( double fScaleX, double fScaleY ); void Scale( const Fraction& rScaleX, const Fraction& rScaleY ); void Rotate( long nAngle10 ); -- cgit From 232ee1a3b01e629ba1d2889e226fe66d8c834224 Mon Sep 17 00:00:00 2001 From: Michael Brauer Date: Fri, 13 Aug 2010 12:52:17 +0200 Subject: mib18: #163285#: Set correct error code in Collection.item and Collection.remove --- basic/source/classes/sb.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index dab060500e05..4afe5cab1e97 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -2086,7 +2086,7 @@ void BasicCollection::CollItem( SbxArray* pPar_ ) if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) pRes = xItemArray->Get32( nIndex ); if( !pRes ) - SetError( SbxERR_BAD_INDEX ); + SetError( SbERR_BAD_ARGUMENT ); else *(pPar_->Get(0)) = *pRes; } @@ -2104,6 +2104,6 @@ void BasicCollection::CollRemove( SbxArray* pPar_ ) if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) xItemArray->Remove32( nIndex ); else - SetError( SbxERR_BAD_INDEX ); + SetError( SbERR_BAD_ARGUMENT ); } -- cgit From 4d949990ef1438fcae98262519c6af2b47e5ccf5 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 13 Aug 2010 13:28:45 +0200 Subject: mib18: #163225# support long strings in basic --- basic/inc/basic/sbxvar.hxx | 12 +++-- basic/source/classes/sbunoobj.cxx | 2 +- basic/source/sbx/sbxbool.cxx | 18 +++---- basic/source/sbx/sbxbyte.cxx | 10 ++-- basic/source/sbx/sbxchar.cxx | 15 +++--- basic/source/sbx/sbxconv.hxx | 16 +++--- basic/source/sbx/sbxcurr.cxx | 26 +++++----- basic/source/sbx/sbxdate.cxx | 12 +++-- basic/source/sbx/sbxdbl.cxx | 10 ++-- basic/source/sbx/sbxdec.cxx | 20 ++++---- basic/source/sbx/sbxdec.hxx | 4 +- basic/source/sbx/sbxint.cxx | 38 ++++++-------- basic/source/sbx/sbxlng.cxx | 10 ++-- basic/source/sbx/sbxres.cxx | 2 +- basic/source/sbx/sbxres.hxx | 2 +- basic/source/sbx/sbxscan.cxx | 37 ++++++++------ basic/source/sbx/sbxsng.cxx | 10 ++-- basic/source/sbx/sbxstr.cxx | 50 +++++++++--------- basic/source/sbx/sbxuint.cxx | 10 ++-- basic/source/sbx/sbxulng.cxx | 10 ++-- basic/source/sbx/sbxvalue.cxx | 105 ++++++++++++++++++++------------------ basic/source/sbx/sbxvar.cxx | 40 ++++++++------- 22 files changed, 235 insertions(+), 224 deletions(-) diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx index 4d9d19b52a59..0cddcbdf8d17 100644 --- a/basic/inc/basic/sbxvar.hxx +++ b/basic/inc/basic/sbxvar.hxx @@ -178,7 +178,7 @@ struct SbxValues sal_uInt64 uInt64; int nInt; unsigned int nUInt; - String* pString; + ::rtl::OUString* pOUString; SbxDecimal* pDecimal; SbxBase* pObj; @@ -212,7 +212,7 @@ struct SbxValues SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {} SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {} SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {} - SbxValues( const String* _pString ): pString( (String*) _pString ), eType(SbxSTRING) {} + SbxValues( const ::rtl::OUString* _pString ): pOUString( (::rtl::OUString*)_pString ), eType(SbxSTRING) {} SbxValues( SbxBase* _pObj ): pObj( _pObj ), eType(SbxOBJECT) {} SbxValues( sal_Unicode* _pChar ): pChar( _pChar ), eType(SbxLPSTR) {} SbxValues( void* _pData ): pData( _pData ), eType(SbxPOINTER) {} @@ -237,7 +237,8 @@ class SbxValue : public SbxBase SbxValue* TheRealValue() const; protected: SbxValues aData; // Data - String aPic; // Picture-String + ::rtl::OUString aPic; // Picture-String + String aToolString; // tool string copy virtual void Broadcast( ULONG ); // Broadcast-Call virtual ~SbxValue(); @@ -303,6 +304,7 @@ public: UINT16 GetErr() const; const String& GetString() const; const String& GetCoreString() const; + ::rtl::OUString GetOUString() const; SbxDecimal* GetDecimal() const; SbxBase* GetObject() const; BOOL HasObject() const; @@ -325,8 +327,8 @@ public: BOOL PutDate( double ); BOOL PutBool( BOOL ); BOOL PutErr( USHORT ); - BOOL PutStringExt( const String& ); // with extended analysis (International, "TRUE"/"FALSE") - BOOL PutString( const String& ); + BOOL PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "TRUE"/"FALSE") + BOOL PutString( const ::rtl::OUString& ); BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR BOOL PutDecimal( SbxDecimal* pDecimal ); diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 7de2d0c02320..3e775613198b 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -1461,7 +1461,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty aRetVal.setValue( &c , getCharCppuType() ); break; } - case TypeClass_STRING: aRetVal <<= ::rtl::OUString( pVar->GetString() ); break; + case TypeClass_STRING: aRetVal <<= pVar->GetOUString(); break; case TypeClass_FLOAT: aRetVal <<= pVar->GetSingle(); break; case TypeClass_DOUBLE: aRetVal <<= pVar->GetDouble(); break; //case TypeClass_OCTET: break; diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx index 728b8e1472b0..3216e401b707 100644 --- a/basic/source/sbx/sbxbool.cxx +++ b/basic/source/sbx/sbxbool.cxx @@ -87,21 +87,20 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) case SbxSTRING: case SbxLPSTR: nRes = SbxFALSE; - if( p->pString ) + if ( p->pOUString ) { - if( p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_TRUE ) ) ) + if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_TRUE ) ) ) nRes = SbxTRUE; - else if( !p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_FALSE ) ) ) + else if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) ) { // Jetzt kann es noch in eine Zahl konvertierbar sein BOOL bError = TRUE; double n; SbxDataType t; USHORT nLen = 0; - String s( *p->pString ); - if( ImpScan( s, n, t, &nLen ) == SbxERR_OK ) + if( ImpScan( *p->pOUString, n, t, &nLen ) == SbxERR_OK ) { - if( nLen == s.Len() ) + if( nLen == p->pOUString->getLength() ) { bError = FALSE; if( n != 0.0 ) @@ -202,9 +201,10 @@ void ImpPutBool( SbxValues* p, INT16 n ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - *p->pString = SbxRes( n ? STRING_TRUE : STRING_FALSE ); + if ( !p->pOUString ) + p->pOUString = new ::rtl::OUString( SbxRes( n ? STRING_TRUE : STRING_FALSE ) ); + else + *p->pOUString = SbxRes( n ? STRING_TRUE : STRING_FALSE ); break; case SbxOBJECT: diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx index 8485b7105e21..e13c63967fc3 100644 --- a/basic/source/sbx/sbxbyte.cxx +++ b/basic/source/sbx/sbxbyte.cxx @@ -165,13 +165,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXBYTE ) { @@ -279,9 +279,9 @@ void ImpPutByte( SbxValues* p, BYTE n ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx index f9bca67a28d9..bd4ce91f451b 100644 --- a/basic/source/sbx/sbxchar.cxx +++ b/basic/source/sbx/sbxchar.cxx @@ -39,7 +39,7 @@ using namespace rtl; xub_Unicode ImpGetChar( const SbxValues* p ) { SbxValues aTmp; - xub_Unicode nRes; + xub_Unicode nRes = 0; start: switch( +p->eType ) { @@ -156,13 +156,11 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - nRes = 0; - else + if ( p->pOUString ) { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXCHAR ) { @@ -274,9 +272,10 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - *p->pString = n; + if ( !p->pOUString ) + p->pOUString = new ::rtl::OUString( n ); + else + *p->pOUString = ::rtl::OUString( n ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx index c1ada75286ab..16fec542cded 100644 --- a/basic/source/sbx/sbxconv.hxx +++ b/basic/source/sbx/sbxconv.hxx @@ -33,13 +33,13 @@ class SbxArray; // SBXSCAN.CXX -extern void ImpCvtNum( double nNum, short nPrec, String& rRes, BOOL bCoreString=FALSE ); +extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString=FALSE ); extern SbxError ImpScan - ( const String& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen, + ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen, BOOL bAllowIntntl=FALSE, BOOL bOnlyIntntl=FALSE ); // mit erweiterter Auswertung (International, "TRUE"/"FALSE") -extern BOOL ImpConvStringExt( String& rSrc, SbxDataType eTargetType ); +extern BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ); // SBXINT.CXX @@ -116,9 +116,9 @@ void ImpPutDate( SbxValues*, double ); // SBXSTR.CXX -String ImpGetString( const SbxValues* ); -String ImpGetCoreString( const SbxValues* ); -void ImpPutString( SbxValues*, const String* ); +::rtl::OUString ImpGetString( const SbxValues* ); +::rtl::OUString ImpGetCoreString( const SbxValues* ); +void ImpPutString( SbxValues*, const ::rtl::OUString* ); // SBXCHAR.CXX @@ -145,7 +145,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* ); void ImpPutBool( SbxValues*, INT16 ); // ByteArry <--> String -SbxArray* StringToByteArray(const String& rStr); -String ByteArrayToString(SbxArray* pArr); +SbxArray* StringToByteArray(const ::rtl::OUString& rStr); +::rtl::OUString ByteArrayToString(SbxArray* pArr); #endif diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx index 74380f84a75f..e27b11d5166c 100644 --- a/basic/source/sbx/sbxcurr.cxx +++ b/basic/source/sbx/sbxcurr.cxx @@ -37,8 +37,8 @@ #include #include "sbxconv.hxx" -static String ImpCurrencyToString( const SbxINT64& ); -static SbxINT64 ImpStringToCurrency( const String& ); +static ::rtl::OUString ImpCurrencyToString( const SbxINT64& ); +static SbxINT64 ImpStringToCurrency( const ::rtl::OUString& ); SbxINT64 ImpGetCurrency( const SbxValues* p ) { @@ -121,10 +121,10 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes.SetNull(); else - nRes = ImpStringToCurrency( *p->pString ); + nRes = ImpStringToCurrency( *p->pOUString ); break; case SbxOBJECT: { @@ -224,10 +224,10 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; - *p->pString = ImpCurrencyToString( r ); + *p->pOUString = ImpCurrencyToString( r ); break; case SbxOBJECT: { @@ -319,7 +319,7 @@ start: // Hilfs-Funktionen zur Wandlung -static String ImpCurrencyToString( const SbxINT64 &r ) +static ::rtl::OUString ImpCurrencyToString( const SbxINT64 &r ) { BigInt a10000 = 10000; @@ -331,20 +331,20 @@ static String ImpCurrencyToString( const SbxINT64 &r ) aFrac %= a10000; aFrac += a10000; - String aString; + ::rtl::OUString aString; if( r.nHigh < 0 ) - aString = '-'; + aString = ::rtl::OUString( (sal_Unicode)'-' ); aString += aInt.GetString(); - aString += '.'; + aString += ::rtl::OUString( (sal_Unicode)'.' ); aString += aFrac.GetString().GetBuffer()+1; return aString; } -static SbxINT64 ImpStringToCurrency( const String &r ) +static SbxINT64 ImpStringToCurrency( const ::rtl::OUString &r ) { int nDec = 4; String aStr; - const sal_Unicode* p = r.GetBuffer(); + const sal_Unicode* p = r.getStr(); if( *p == '-' ) aStr += *p++; diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index ce532fed0482..3a0636e4e7fc 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -86,7 +86,7 @@ double ImpGetDate( const SbxValues* p ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { @@ -126,7 +126,7 @@ double ImpGetDate( const SbxValues* p ) pFormatter->PutandConvertEntry( aStr, nCheckPos, nType, nIndex, LANGUAGE_GERMAN, eLangType ); - BOOL bSuccess = pFormatter->IsNumberFormat( *p->pString, nIndex, nRes ); + BOOL bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes ); if ( bSuccess ) { short nType_ = pFormatter->GetType( nIndex ); @@ -248,8 +248,8 @@ start: case SbxLPSTR: #ifndef DOS { - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; Color* pColor; LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); @@ -299,7 +299,9 @@ start: nIndex, LANGUAGE_GERMAN, eLangType ); - pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor ); + String aTmpString; + pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor ); + *p->pOUString = aTmpString; delete pFormatter; #endif break; diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx index 460f331c59b8..be55d3409131 100644 --- a/basic/source/sbx/sbxdbl.cxx +++ b/basic/source/sbx/sbxdbl.cxx @@ -76,7 +76,7 @@ double ImpGetDouble( const SbxValues* p ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) { nRes = 0; if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour @@ -86,7 +86,7 @@ double ImpGetDouble( const SbxValues* p ) { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) { nRes = 0; if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour @@ -188,9 +188,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 14, *p->pString, bCoreString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 14, *p->pOUString, bCoreString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index 319b0aac366c..2191d91c8d82 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -211,7 +211,7 @@ void SbxDecimal::setUInt( unsigned int val ) // sbxscan.cxx void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ); -bool SbxDecimal::setString( String* pString ) +bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); @@ -224,11 +224,11 @@ bool SbxDecimal::setString( String* pString ) HRESULT hResult; if( cDecimalSep != '.' || cThousandSep != ',' ) { - int nLen = pString->Len(); + int nLen = pOUString->getLength(); sal_Unicode* pBuffer = new sal_Unicode[nLen + 1]; pBuffer[nLen] = 0; - const sal_Unicode* pSrc = pString->GetBuffer(); + const sal_Unicode* pSrc = pOUString->getStr(); int i; for( i = 0 ; i < nLen ; ++i ) pBuffer[i] = pSrc[i]; @@ -248,7 +248,7 @@ bool SbxDecimal::setString( String* pString ) } else { - hResult = VarDecFromStr( (OLECHAR*)pString->GetBuffer(), nLANGID, 0, &maDec ); + hResult = VarDecFromStr( (OLECHAR*)pOUString->getStr(), nLANGID, 0, &maDec ); } bRet = ( hResult == S_OK ); return bRet; @@ -373,7 +373,7 @@ bool SbxDecimal::setSingle( float val ) { (void)val; return false; } bool SbxDecimal::setDouble( double val ) { (void)val; return false; } void SbxDecimal::setInt( int val ) { (void)val; } void SbxDecimal::setUInt( unsigned int val ) { (void)val; } -bool SbxDecimal::setString( String* pString ) { (void)pString; return false; } +bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { (void)pOUString; return false; } bool SbxDecimal::getChar( sal_Unicode& rVal ) { (void)rVal; return false; } bool SbxDecimal::getByte( BYTE& rVal ) { (void)rVal; return false; } @@ -388,7 +388,7 @@ bool SbxDecimal::getUInt( unsigned int& rVal ) { (void)rVal; return false; } #endif -bool SbxDecimal::getString( String& rString ) +bool SbxDecimal::getString( ::rtl::OUString& rString ) { #ifdef WIN32 static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); @@ -528,7 +528,7 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - pnDecRes->setString( p->pString ); break; + pnDecRes->setString( p->pOUString ); break; case SbxOBJECT: { SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); @@ -670,10 +670,10 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; // ImpCvtNum( (double) n, 0, *p->pString ); - pDec->getString( *p->pString ); + pDec->getString( *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx index 03f97bec5992..cd80bbad282e 100644 --- a/basic/source/sbx/sbxdec.hxx +++ b/basic/source/sbx/sbxdec.hxx @@ -85,7 +85,7 @@ public: bool setDouble( double val ); void setInt( int val ); void setUInt( unsigned int val ); - bool setString( String* pString ); + bool setString( ::rtl::OUString* pOUString ); void setDecimal( SbxDecimal* pDecimal ) { #ifdef WIN32 @@ -106,7 +106,7 @@ public: bool getDouble( double& rVal ); bool getInt( int& rVal ); bool getUInt( unsigned int& rVal ); - bool getString( String& rString ); + bool getString( ::rtl::OUString& rString ); bool operator -= ( const SbxDecimal &r ); bool operator += ( const SbxDecimal &r ); diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx index 406b8599e568..47c38aecb1c2 100644 --- a/basic/source/sbx/sbxint.cxx +++ b/basic/source/sbx/sbxint.cxx @@ -154,13 +154,13 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXINT ) { @@ -275,9 +275,9 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { @@ -456,20 +456,19 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { - ::rtl::OUString aOUStr( *p->pString ); ::rtl::OString aOStr = ::rtl::OUStringToOString - ( aOUStr, RTL_TEXTENCODING_ASCII_US ); + ( *p->pOUString, RTL_TEXTENCODING_ASCII_US ); nRes = aOStr.toInt64(); if( nRes == 0 ) { // Check if really 0 or invalid conversion double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else nRes = ImpDoubleToSalInt64( d ); @@ -575,13 +574,12 @@ start: case SbxSTRING: case SbxLPSTR: { - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; ::rtl::OString aOStr = ::rtl::OString::valueOf( n ); - ::rtl::OUString aOUStr = ::rtl::OStringToOUString + (*p->pOUString) = ::rtl::OStringToOUString ( aOStr, RTL_TEXTENCODING_ASCII_US ); - (*p->pString) = aOUStr; break; } case SbxOBJECT: @@ -745,20 +743,19 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { - ::rtl::OUString aOUStr( *p->pString ); ::rtl::OString aOStr = ::rtl::OUStringToOString - ( aOUStr, RTL_TEXTENCODING_ASCII_US ); + ( *p->pOUString, RTL_TEXTENCODING_ASCII_US ); sal_Int64 n64 = aOStr.toInt64(); if( n64 == 0 ) { // Check if really 0 or invalid conversion double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXSALUINT64 ) { @@ -879,16 +876,15 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; if( n > SbxMAXSALINT64 ) SbxBase::SetError( SbxERR_CONVERSION ); else { ::rtl::OString aOStr = ::rtl::OString::valueOf( (sal_Int64)n ); - ::rtl::OUString aOUStr = ::rtl::OStringToOUString + (*p->pOUString) = ::rtl::OStringToOUString ( aOStr, RTL_TEXTENCODING_ASCII_US ); - (*p->pString) = aOUStr; } break; case SbxOBJECT: diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx index c84b087dfc33..1cf2d84061f9 100644 --- a/basic/source/sbx/sbxlng.cxx +++ b/basic/source/sbx/sbxlng.cxx @@ -119,13 +119,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXLNG ) { @@ -240,9 +240,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx index f42c400afd91..369349e72069 100644 --- a/basic/source/sbx/sbxres.cxx +++ b/basic/source/sbx/sbxres.cxx @@ -86,6 +86,6 @@ const char* GetSbxRes( USHORT nId ) } SbxRes::SbxRes( USHORT nId ) - : XubString( String::CreateFromAscii( GetSbxRes( nId ) ) ) + : ::rtl::OUString( ::rtl::OUString::createFromAscii( GetSbxRes( nId ) ) ) {} diff --git a/basic/source/sbx/sbxres.hxx b/basic/source/sbx/sbxres.hxx index 8cd0ad26e951..8ed3c7054278 100644 --- a/basic/source/sbx/sbxres.hxx +++ b/basic/source/sbx/sbxres.hxx @@ -75,7 +75,7 @@ #define SBXRES_MAX 44 -class SbxRes : public String +class SbxRes : public ::rtl::OUString { public: SbxRes( USHORT ); diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 3d45818e6401..b8aad9bbf2e4 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -71,10 +71,10 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ) // Das ganze gibt auch noch einen Konversionsfehler, wenn der Datentyp // Fixed ist und das ganze nicht hineinpasst! -SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType, +SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType, USHORT* pLen, BOOL bAllowIntntl, BOOL bOnlyIntntl ) { - ByteString aBStr( rWSrc, RTL_TEXTENCODING_ASCII_US ); + ::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) ); // Bei International Komma besorgen char cIntntlComma, cIntntl1000; @@ -100,7 +100,7 @@ SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType, cIntntl1000 = (char)cThousandSep; } - const char* pStart = aBStr.GetBuffer(); + const char* pStart = aBStr.getStr(); const char* p = pStart; char buf[ 80 ], *q = buf; BOOL bRes = TRUE; @@ -391,7 +391,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth, #pragma warning(disable: 4748) // "... because optimizations are disabled ..." #endif -void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString ) +void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString ) { char *q; char cBuf[ 40 ], *p = cBuf; @@ -415,18 +415,18 @@ void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString ) if( *p == cDecimalSep ) p--; while( *q ) *++p = *q++; *++p = 0; - rRes = String::CreateFromAscii( cBuf ); + rRes = ::rtl::OUString::createFromAscii( cBuf ); } #ifdef _MSC_VER #pragma optimize( "", on ) #endif -BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) +BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) { // Merken, ob ueberhaupt was geaendert wurde BOOL bChanged = FALSE; - String aNewString; + ::rtl::OUString aNewString; // Nur Spezial-Flle behandeln, als Default tun wir nichts switch( eTargetType ) @@ -436,7 +436,7 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) case SbxDOUBLE: case SbxCURRENCY: { - ByteString aBStr( rSrc, RTL_TEXTENCODING_ASCII_US ); + ::rtl::OString aBStr( ::rtl::OUStringToOString( rSrc, RTL_TEXTENCODING_ASCII_US ) ); // Komma besorgen sal_Unicode cDecimalSep, cThousandSep; @@ -446,10 +446,11 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) // Ersetzen, wenn DecimalSep kein '.' (nur den ersten) if( cDecimalSep != (sal_Unicode)'.' ) { - USHORT nPos = aNewString.Search( cDecimalSep ); - if( nPos != STRING_NOTFOUND ) + sal_Int32 nPos = aNewString.indexOf( cDecimalSep ); + if( nPos != -1 ) { - aNewString.SetChar( nPos, '.' ); + sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr(); + pStr[nPos] = (sal_Unicode)'.'; bChanged = TRUE; } } @@ -459,15 +460,15 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) // Bei BOOL TRUE und FALSE als String pruefen case SbxBOOL: { - if( rSrc.EqualsIgnoreCaseAscii( "true" ) ) + if( rSrc.equalsIgnoreAsciiCaseAscii( "true" ) ) { - aNewString = String::CreateFromInt32(SbxTRUE); + aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE ); bChanged = TRUE; } else - if( rSrc.EqualsIgnoreCaseAscii( "false" ) ) + if( rSrc.equalsIgnoreAsciiCaseAscii( "false" ) ) { - aNewString = String::CreateFromInt32(SbxFALSE); + aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE ); bChanged = TRUE; } break; @@ -935,7 +936,11 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const //old: printfmtnum( GetDouble(), rRes, *pFmt ); } else - ImpCvtNum( GetDouble(), nComma, rRes ); + { + ::rtl::OUString aTmpString( rRes ); + ImpCvtNum( GetDouble(), nComma, aTmpString ); + rRes = aTmpString; + } break; case SbxSTRING: if( pFmt ) diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx index 82507dbe15e9..70ef1653666b 100644 --- a/basic/source/sbx/sbxsng.cxx +++ b/basic/source/sbx/sbxsng.cxx @@ -112,13 +112,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXSNG ) { @@ -237,9 +237,9 @@ start: case SbxSTRING: case SbxLPSTR: { - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 6, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 6, *p->pOUString ); break; } case SbxOBJECT: diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index 6deb2da29ba1..b4156a116ddc 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -44,12 +44,12 @@ using namespace rtl; // Die Konversion eines Items auf String wird ueber die Put-Methoden // der einzelnen Datentypen abgewickelt, um doppelten Code zu vermeiden. -XubString ImpGetString( const SbxValues* p ) +::rtl::OUString ImpGetString( const SbxValues* p ) { SbxValues aTmp; - XubString aRes; + ::rtl::OUString aRes; aTmp.eType = SbxSTRING; - aTmp.pString = &aRes; + aTmp.pOUString = &aRes; switch( +p->eType ) { case SbxNULL: @@ -86,8 +86,8 @@ XubString ImpGetString( const SbxValues* p ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( p->pString ) - aRes = *p->pString; + if ( p->pOUString ) + *aTmp.pOUString = *p->pOUString; break; case SbxOBJECT: { @@ -109,7 +109,7 @@ XubString ImpGetString( const SbxValues* p ) case SbxERROR: // Hier wird der String "Error n" erzeugt aRes = SbxRes( STRING_ERRORMSG ); - aRes += p->nUShort; break; + aRes += ::rtl::OUString( p->nUShort ); break; case SbxDATE: ImpPutDate( &aTmp, p->nDouble ); break; @@ -145,7 +145,7 @@ XubString ImpGetString( const SbxValues* p ) } // AB 10.4.97, neue Funktion fuer SbxValue::GetCoreString() -XubString ImpGetCoreString( const SbxValues* p ) +::rtl::OUString ImpGetCoreString( const SbxValues* p ) { // Vorerst nur fuer double if( ( p->eType & (~SbxBYREF) ) == SbxDOUBLE ) @@ -153,7 +153,6 @@ XubString ImpGetCoreString( const SbxValues* p ) SbxValues aTmp; XubString aRes; aTmp.eType = SbxSTRING; - aTmp.pString = &aRes; if( p->eType == SbxDOUBLE ) ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/TRUE ); else @@ -164,15 +163,15 @@ XubString ImpGetCoreString( const SbxValues* p ) return ImpGetString( p ); } -void ImpPutString( SbxValues* p, const XubString* n ) +void ImpPutString( SbxValues* p, const ::rtl::OUString* n ) { SbxValues aTmp; aTmp.eType = SbxSTRING; - XubString* pTmp = NULL; + ::rtl::OUString* pTmp = NULL; // Sicherheitshalber, falls ein NULL-Ptr kommt if( !n ) - n = pTmp = new XubString; - aTmp.pString = (XubString*) n; + n = pTmp = new ::rtl::OUString; + aTmp.pOUString = (::rtl::OUString*)n; switch( +p->eType ) { case SbxCHAR: @@ -209,14 +208,15 @@ void ImpPutString( SbxValues* p, const XubString* n ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( n->Len() ) + if( n->getLength() ) { - if( !p->pString ) - p->pString = new XubString; - *p->pString = *n; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString( *n ); + else + *p->pOUString = *n; } else - delete p->pString, p->pString = NULL; + delete p->pOUString, p->pOUString = NULL; break; case SbxOBJECT: { @@ -258,18 +258,18 @@ void ImpPutString( SbxValues* p, const XubString* n ) } // Convert string to an array of bytes, preserving unicode (2bytes per character) -SbxArray* StringToByteArray(const String& rStr) +SbxArray* StringToByteArray(const ::rtl::OUString& rStr) { - USHORT nArraySize = rStr.Len() * 2; - const sal_Unicode* pSrc = rStr.GetBuffer(); + sal_Int32 nArraySize = rStr.getLength() * 2; + const sal_Unicode* pSrc = rStr.getStr(); SbxDimArray* pArray = new SbxDimArray(SbxBYTE); bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); if( nArraySize ) { if( bIncIndex ) - pArray->AddDim( 1, nArraySize ); + pArray->AddDim32( 1, nArraySize ); else - pArray->AddDim( 0, nArraySize-1 ); + pArray->AddDim32( 0, nArraySize-1 ); } else { @@ -290,7 +290,7 @@ SbxArray* StringToByteArray(const String& rStr) } // Convert an array of bytes to string (2bytes per character) -String ByteArrayToString(SbxArray* pArr) +::rtl::OUString ByteArrayToString(SbxArray* pArr) { USHORT nCount = pArr->Count(); OUStringBuffer aStrBuf; @@ -315,7 +315,5 @@ String ByteArrayToString(SbxArray* pArr) aStrBuf.append(aChar); } - String aStr(aStrBuf.makeStringAndClear()); - - return aStr; + return aStrBuf.makeStringAndClear(); } diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx index ce0aea70b062..5b75a24d6d26 100644 --- a/basic/source/sbx/sbxuint.cxx +++ b/basic/source/sbx/sbxuint.cxx @@ -151,13 +151,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXUINT ) { @@ -272,9 +272,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx index 3dd81b8c616d..e0f6f3fa421d 100644 --- a/basic/source/sbx/sbxulng.cxx +++ b/basic/source/sbx/sbxulng.cxx @@ -127,13 +127,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXULNG ) { @@ -246,9 +246,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 7ee31af70556..4ea4836b701b 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -236,7 +236,7 @@ SbxValue::SbxValue( SbxDataType t, void* p ) : SbxBase() case SbxSINGLE: n |= SbxBYREF; aData.pSingle = (float*) p; break; case SbxDATE: case SbxDOUBLE: n |= SbxBYREF; aData.pDouble = (double*) p; break; - case SbxSTRING: n |= SbxBYREF; aData.pString = (XubString*) p; break; + case SbxSTRING: n |= SbxBYREF; aData.pOUString = (::rtl::OUString*) p; break; case SbxERROR: case SbxUSHORT: case SbxBOOL: n |= SbxBYREF; aData.pUShort = (UINT16*) p; break; @@ -280,8 +280,8 @@ SbxValue::SbxValue( const SbxValue& r ) switch( aData.eType ) { case SbxSTRING: - if( aData.pString ) - aData.pString = new XubString( *aData.pString ); + if( aData.pOUString ) + aData.pOUString = new ::rtl::OUString( *aData.pOUString ); break; case SbxOBJECT: if( aData.pObj ) @@ -309,7 +309,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r ) && aData.pObj && ( aData.pObj->GetType() == (SbxARRAY | SbxBYTE) ) && (r.aData.eType == SbxSTRING) ) { - String aStr = r.GetString(); + ::rtl::OUString aStr = r.GetString(); SbxArray* pArr = StringToByteArray(aStr); PutObject(pArr); return *this; @@ -323,7 +323,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r ) SbxArray* pArr = PTR_CAST(SbxArray, pObj); if( pArr ) { - String aStr = ByteArrayToString( pArr ); + ::rtl::OUString aStr = ByteArrayToString( pArr ); PutString(aStr); return *this; } @@ -385,7 +385,7 @@ void SbxValue::Clear() case SbxVOID: break; case SbxSTRING: - delete aData.pString; aData.pString = NULL; + delete aData.pOUString; aData.pOUString = NULL; break; case SbxOBJECT: if( aData.pObj ) @@ -551,9 +551,9 @@ BOOL SbxValue::Get( SbxValues& rRes ) const case SbxULONG: rRes.nULong = ImpGetULong( &p->aData ); break; case SbxLPSTR: case SbxSTRING: p->aPic = ImpGetString( &p->aData ); - rRes.pString = &p->aPic; break; + rRes.pOUString = &p->aPic; break; case SbxCoreSTRING: p->aPic = ImpGetCoreString( &p->aData ); - rRes.pString = &p->aPic; break; + rRes.pOUString = &p->aPic; break; case SbxINT: #if SAL_TYPES_SIZEOFINT == 2 rRes.nInt = (int) ImpGetInteger( &p->aData ); @@ -618,13 +618,11 @@ const XubString& SbxValue::GetString() const SbxValues aRes; aRes.eType = SbxSTRING; if( Get( aRes ) ) - // Geht in Ordnung, da Ptr eine Kopie ist - return *aRes.pString; + ((SbxValue*) this)->aToolString = *aRes.pOUString; else - { - ((SbxValue*) this)->aPic.Erase(); - return aPic; - } + ((SbxValue*) this)->aToolString.Erase(); + + return aToolString; } const XubString& SbxValue::GetCoreString() const @@ -632,13 +630,22 @@ const XubString& SbxValue::GetCoreString() const SbxValues aRes; aRes.eType = SbxCoreSTRING; if( Get( aRes ) ) - // Geht in Ordnung, da Ptr eine Kopie ist - return *aRes.pString; + ((SbxValue*) this)->aToolString = *aRes.pOUString; else - { - ((SbxValue*) this)->aPic.Erase(); - return aPic; - } + ((SbxValue*) this)->aToolString.Erase(); + + return aToolString; +} + +::rtl::OUString SbxValue::GetOUString() const +{ + ::rtl::OUString aResult; + SbxValues aRes; + aRes.eType = SbxSTRING; + if( Get( aRes ) ) + aResult = *aRes.pOUString; + + return aResult; } BOOL SbxValue::HasObject() const @@ -727,7 +734,7 @@ BOOL SbxValue::Put( const SbxValues& rVal ) case SbxUSHORT: ImpPutUShort( &p->aData, rVal.nUShort ); break; case SbxULONG: ImpPutULong( &p->aData, rVal.nULong ); break; case SbxLPSTR: - case SbxSTRING: ImpPutString( &p->aData, rVal.pString ); break; + case SbxSTRING: ImpPutString( &p->aData, rVal.pOUString ); break; case SbxINT: #if SAL_TYPES_SIZEOFINT == 2 ImpPutInteger( &p->aData, (INT16) rVal.nInt ); @@ -803,10 +810,10 @@ BOOL SbxValue::Put( const SbxValues& rVal ) // werden koennen, wenn Floats mit ',' als Dezimaltrenner oder BOOLs // explizit mit "TRUE" oder "FALSE" angegeben werden. // Implementierung in ImpConvStringExt (SBXSCAN.CXX) -BOOL SbxValue::PutStringExt( const XubString& r ) +BOOL SbxValue::PutStringExt( const ::rtl::OUString& r ) { // Kopieren, bei Unicode gleich konvertieren - String aStr( r ); + ::rtl::OUString aStr( r ); // Eigenen Typ bestimmen (nicht wie in Put() mit TheRealValue(), // Objekte werden sowieso nicht behandelt) @@ -820,9 +827,9 @@ BOOL SbxValue::PutStringExt( const XubString& r ) // sonst Original (Unicode bleibt erhalten) BOOL bRet; if( ImpConvStringExt( aStr, eTargetType ) ) - aRes.pString = (XubString*)&aStr; + aRes.pOUString = (::rtl::OUString*)&aStr; else - aRes.pString = (XubString*)&r; + aRes.pOUString = (::rtl::OUString*)&r; // #34939: Bei Strings. die eine Zahl enthalten und wenn this einen // Num-Typ hat, Fixed-Flag setzen, damit der Typ nicht veraendert wird @@ -851,10 +858,10 @@ BOOL SbxValue::PutStringExt( const XubString& r ) BOOL SbxValue::PutString( const xub_Unicode* p ) { - XubString aVal( p ); + ::rtl::OUString aVal( p ); SbxValues aRes; aRes.eType = SbxSTRING; - aRes.pString = &aVal; + aRes.pOUString = &aVal; Put( aRes ); return BOOL( !IsError() ); } @@ -909,19 +916,19 @@ BOOL SbxValue::fillAutomationDecimal BOOL SbxValue::PutpChar( const xub_Unicode* p ) { - XubString aVal( p ); + ::rtl::OUString aVal( p ); SbxValues aRes; aRes.eType = SbxLPSTR; - aRes.pString = &aVal; + aRes.pOUString = &aVal; Put( aRes ); return BOOL( !IsError() ); } -BOOL SbxValue::PutString( const XubString& r ) +BOOL SbxValue::PutString( const ::rtl::OUString& r ) { SbxValues aRes; aRes.eType = SbxSTRING; - aRes.pString = (XubString*) &r; + aRes.pOUString = (::rtl::OUString*) &r; Put( aRes ); return BOOL( !IsError() ); } @@ -986,14 +993,14 @@ BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const SbxDataType t = GetType(); if( t == SbxSTRING ) { - if( aData.pString ) + if( aData.pOUString ) { - XubString s( *aData.pString ); + ::rtl::OUString s( *aData.pOUString ); double n; SbxDataType t2; USHORT nLen = 0; if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/FALSE, bOnlyIntntl ) == SbxERR_OK ) - return BOOL( nLen == s.Len() ); + return BOOL( nLen == s.getLength() ); } return FALSE; } @@ -1046,7 +1053,7 @@ BOOL SbxValue::SetType( SbxDataType t ) switch( aData.eType ) { case SbxSTRING: - delete aData.pString; + delete aData.pOUString; break; case SbxOBJECT: if( aData.pObj && aData.pObj != this ) @@ -1163,14 +1170,14 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) Get( aL ); // #30576: Erstmal testen, ob Wandlung geklappt hat - if( aL.pString != NULL && aR.pString != NULL ) + if( aL.pOUString != NULL && aR.pOUString != NULL ) { - *aL.pString += *aR.pString; + *aL.pOUString += *aR.pOUString; } // Nicht einmal Left OK? - else if( aL.pString == NULL ) + else if( aL.pOUString == NULL ) { - aL.pString = new String(); + aL.pOUString = new ::rtl::OUString(); } Put( aL ); } @@ -1493,17 +1500,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const if( Get( aL ) && rOp.Get( aR ) ) switch( eOp ) { case SbxEQ: - bRes = BOOL( *aL.pString == *aR.pString ); break; + bRes = BOOL( *aL.pOUString == *aR.pOUString ); break; case SbxNE: - bRes = BOOL( *aL.pString != *aR.pString ); break; + bRes = BOOL( *aL.pOUString != *aR.pOUString ); break; case SbxLT: - bRes = BOOL( *aL.pString < *aR.pString ); break; + bRes = BOOL( *aL.pOUString < *aR.pOUString ); break; case SbxGT: - bRes = BOOL( *aL.pString > *aR.pString ); break; + bRes = BOOL( *aL.pOUString > *aR.pOUString ); break; case SbxLE: - bRes = BOOL( *aL.pString <= *aR.pString ); break; + bRes = BOOL( *aL.pOUString <= *aR.pOUString ); break; case SbxGE: - bRes = BOOL( *aL.pString >= *aR.pString ); break; + bRes = BOOL( *aL.pOUString >= *aR.pOUString ); break; default: SetError( SbxERR_NOTIMP ); } @@ -1668,9 +1675,9 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) XubString aVal; r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); if( aVal.Len() ) - aData.pString = new XubString( aVal ); + aData.pOUString = new ::rtl::OUString( aVal ); else - aData.pString = NULL; // JSM 22.09.1995 + aData.pOUString = NULL; // JSM 22.09.1995 break; } case SbxERROR: @@ -1781,9 +1788,9 @@ BOOL SbxValue::StoreData( SvStream& r ) const break; } case SbxSTRING: - if( aData.pString ) + if( aData.pOUString ) { - r.WriteByteString( *aData.pString, RTL_TEXTENCODING_ASCII_US ); + r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US ); } else { diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 20060f1f7493..58e3c1ae92c2 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -239,9 +239,9 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const if( i ) aTmp += ','; if( q->nFlags & SBX_OPTIONAL ) - aTmp += SbxRes( STRING_OPTIONAL ); + aTmp += String( SbxRes( STRING_OPTIONAL ) ); if( q->eType & SbxBYREF ) - aTmp += SbxRes( STRING_BYREF ); + aTmp += String( SbxRes( STRING_BYREF ) ); aTmp += q->aName; cType = ' '; // Kurzer Typ? Dann holen, evtl. ist dieser 0. @@ -263,12 +263,12 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const // langer Typ? if( t != SbxNAME_SHORT ) { - aTmp += SbxRes( STRING_AS ); + aTmp += String( SbxRes( STRING_AS ) ); if( nt < 32 ) - aTmp += SbxRes( - sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ); + aTmp += String( SbxRes( + sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ) ); else - aTmp += SbxRes( STRING_ANY ); + aTmp += String( SbxRes( STRING_ANY ) ); } } } @@ -276,15 +276,15 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const // Langer Typ? Dann holen if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY ) { - aTmp += SbxRes( STRING_AS ); + aTmp += String( SbxRes( STRING_AS ) ); if( et < 32 ) - aTmp += SbxRes( - sal::static_int_cast< USHORT >( STRING_TYPES + et ) ); + aTmp += String( SbxRes( + sal::static_int_cast< USHORT >( STRING_TYPES + et ) ) ); else - aTmp += SbxRes( STRING_ANY ); + aTmp += String( SbxRes( STRING_ANY ) ); } - ((SbxVariable*) this)->aPic = aTmp; - return aPic; + ((SbxVariable*) this)->aToolString = aTmp; + return aToolString; } // Einen simplen Hashcode erzeugen: Es werden die ersten 6 Zeichen gewertet. @@ -431,9 +431,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) if( nType == SbxNULL && GetClass() == SbxCLASS_METHOD ) nType = SbxEMPTY; SbxValues aTmp; - XubString aVal; + String aTmpString; + ::rtl::OUString aVal; aTmp.eType = aData.eType = (SbxDataType) nType; - aTmp.pString = &aVal; + aTmp.pOUString = &aVal; switch( nType ) { case SbxBOOL: @@ -445,10 +446,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) case SbxSINGLE: { // Floats als ASCII - rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); double d; SbxDataType t; - if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) + if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) { aTmp.nSingle = 0; return FALSE; @@ -460,9 +461,9 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) case SbxDOUBLE: { // Floats als ASCII - rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); SbxDataType t; - if( ImpScan( aVal, aTmp.nDouble, t, NULL ) != SbxERR_OK ) + if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK ) { aTmp.nDouble = 0; return FALSE; @@ -470,7 +471,8 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) break; } case SbxSTRING: - rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); + aVal = aTmpString; break; case SbxEMPTY: case SbxNULL: -- cgit From 5df1941a50f21012cb1b44c46e57e8b29467544b Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 13 Aug 2010 14:48:18 +0200 Subject: mib18: #163278# handle the internal VBA types correctly --- basic/source/classes/sbunoobj.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 3e775613198b..c9123b06341b 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -301,7 +301,12 @@ SbUnoObject* createOLEObject_Impl( const String& aType ) SbUnoObject* pUnoObj = NULL; if( xOLEFactory.is() ) { - Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aType ); + // some type names available in VBA can not be directly used in COM + ::rtl::OUString aOLEType = aType; + if ( aOLEType.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SAXXMLReader30" ) ) ) ) + aOLEType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Msxml2.SAXXMLReader.3.0" ) ); + + Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aOLEType ); if( xOLEObject.is() ) { Any aAny; -- cgit From a40d24467d45f19bf167a5e2a638a71715162675 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 13 Aug 2010 15:57:34 +0200 Subject: ooo33gsl05: #i113810# fix on behalf of aw --- svx/source/svdraw/svdmrkv.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index fffcac00e46c..ee9e8f48634b 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1063,8 +1063,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) /** handle mouse over effects for handles */ BOOL SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin) { - const ULONG nHdlCount = aHdl.GetHdlCount(); - if( nHdlCount ) + if(aHdl.GetHdlCount()) { SdrHdl* pMouseOverHdl = 0; if( !rMEvt.IsLeaveWindow() && pWin ) @@ -1074,6 +1073,8 @@ BOOL SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin) } // notify last mouse over handle that he lost the mouse + const ULONG nHdlCount = aHdl.GetHdlCount(); + for(ULONG nHdl = 0; nHdl < nHdlCount; nHdl++ ) { SdrHdl* pCurrentHdl = GetHdl(nHdl); -- cgit From 41b94861a16cb202c6aeb42c3e206a43f039e793 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 13 Aug 2010 17:51:00 +0200 Subject: mib18: wae --- basic/source/runtime/step0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 596b30b9d691..06a8bb19af00 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -442,7 +442,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b // Check value, !object is no error for sure if, only if type is fixed SbxDataType eValType = refVal->GetType(); - bool bGetValObject = false; +// bool bGetValObject = false; if( !bHandleDefaultProp && eValType != SbxOBJECT && !(eValType & SbxARRAY) && refVal->IsFixed() ) { Error( SbERR_INVALID_USAGE_OBJECT ); -- cgit From c26a9b2de55a47496d9cdbf4d75ccdf3572fc008 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 13 Aug 2010 17:59:32 +0200 Subject: mib18: wae --- basic/source/classes/sb.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 4afe5cab1e97..056c2ea38c4c 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -569,10 +569,10 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase); if( pClassModuleObj != NULL ) { - SbModule* pClassModule = pClassModuleObj->getClassModule(); - SbClassModuleObject* pNewObj = new SbClassModuleObject( pClassModule ); + SbModule* pLclClassModule = pClassModuleObj->getClassModule(); + SbClassModuleObject* pNewObj = new SbClassModuleObject( pLclClassModule ); pNewObj->SetName( pProp->GetName() ); - pNewObj->SetParent( pClassModule->pParent ); + pNewObj->SetParent( pLclClassModule->pParent ); pNewProp->PutObject( pNewObj ); } else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) ) -- cgit From 0e2a4986b2436c30efa76a20208c867af6e82e19 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 13 Aug 2010 23:34:21 +0200 Subject: fs33a: make compile in non-pro build (removed seemingly dead assertion) --- sw/source/ui/lingu/olmenu.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 0c7d7909ad7a..a4805a168c1c 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -823,7 +823,7 @@ void SwSpellPopup::Execute( USHORT nId ) else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) { OUString aWord( xSpellAlt->getWord() ); - DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" ); + //DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" ); PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC); String aDicName ( pMenu->GetItemText(nId) ); -- cgit From 8a395179065bfcd30ce82904aab4af1abf6c6d41 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Mon, 16 Aug 2010 12:53:36 +0200 Subject: native324 #i113835# preparing rpm installation on debian systems --- .../openoffice/setup/Installer/LinuxInstaller.java | 130 ++++++++++++--------- 1 file changed, 72 insertions(+), 58 deletions(-) diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java index dc9a76214106..74f436f8c375 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java @@ -194,6 +194,7 @@ public class LinuxInstaller extends Installer { // is installed. String forceDebianString = ""; + String nodepsString = ""; if ( ! data.debianInvestigated() ) { helper.investigateDebian(data); @@ -202,6 +203,7 @@ public class LinuxInstaller extends Installer { if ( data.isDebianSystem() ) { forceDebianString = "--force-debian"; + nodepsString = "--nodeps"; } String rpmCommand = ""; @@ -226,115 +228,123 @@ public class LinuxInstaller extends Installer { if (useForce) { if (useLocalDatabase) { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " " + nodepsString + " -vh " + "--relocate " + relocations + " " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[11]; + rpmCommandArray = new String[12]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; rpmCommandArray[4] = forceDebianString; - rpmCommandArray[5] = "-vh"; - rpmCommandArray[6] = "--relocate"; - rpmCommandArray[7] = relocations; - rpmCommandArray[8] = databaseString; - rpmCommandArray[9] = databasePath; - rpmCommandArray[10] = packageName; + rpmCommandArray[5] = nodepsString; + rpmCommandArray[6] = "-vh"; + rpmCommandArray[7] = "--relocate"; + rpmCommandArray[8] = relocations; + rpmCommandArray[9] = databaseString; + rpmCommandArray[10] = databasePath; + rpmCommandArray[11] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " " + nodepsString + " -vh " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[9]; + rpmCommandArray = new String[10]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; rpmCommandArray[4] = forceDebianString; - rpmCommandArray[5] = "-vh"; - rpmCommandArray[6] = databaseString; - rpmCommandArray[7] = databasePath; - rpmCommandArray[8] = packageName; + rpmCommandArray[5] = nodepsString; + rpmCommandArray[6] = "-vh"; + rpmCommandArray[7] = databaseString; + rpmCommandArray[8] = databasePath; + rpmCommandArray[9] = packageName; } } else { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " " + nodepsString + " -vh " + "--relocate " + relocations + " " + packageName; - rpmCommandArray = new String[9]; + rpmCommandArray = new String[10]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; rpmCommandArray[4] = forceDebianString; - rpmCommandArray[5] = "-vh"; - rpmCommandArray[6] = "--relocate"; - rpmCommandArray[7] = relocations; - rpmCommandArray[8] = packageName; + rpmCommandArray[5] = nodepsString; + rpmCommandArray[6] = "-vh"; + rpmCommandArray[7] = "--relocate"; + rpmCommandArray[8] = relocations; + rpmCommandArray[9] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " -vh " + packageName; - rpmCommandArray = new String[7]; + rpmCommand = "rpm --upgrade --ignoresize --force " + forceDebianString + " " + nodepsString + " -vh " + packageName; + rpmCommandArray = new String[8]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = "--force"; rpmCommandArray[4] = forceDebianString; - rpmCommandArray[5] = "-vh"; - rpmCommandArray[6] = packageName; + rpmCommandArray[5] = nodepsString; + rpmCommandArray[6] = "-vh"; + rpmCommandArray[7] = packageName; } } } else { if (useLocalDatabase) { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " " + nodepsString + " -vh " + "--relocate " + relocations + " " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[10]; + rpmCommandArray = new String[11]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = forceDebianString; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = "--relocate"; - rpmCommandArray[6] = relocations; - rpmCommandArray[7] = databaseString; - rpmCommandArray[8] = databasePath; - rpmCommandArray[9] = packageName; + rpmCommandArray[4] = nodepsString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = "--relocate"; + rpmCommandArray[7] = relocations; + rpmCommandArray[8] = databaseString; + rpmCommandArray[9] = databasePath; + rpmCommandArray[10] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " " + nodepsString + " -vh " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[8]; + rpmCommandArray = new String[9]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = forceDebianString; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = databaseString; - rpmCommandArray[6] = databasePath; - rpmCommandArray[7] = packageName; + rpmCommandArray[4] = nodepsString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = databaseString; + rpmCommandArray[7] = databasePath; + rpmCommandArray[8] = packageName; } } else { if ( relocations != null ) { - rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " " + nodepsString + " -vh " + "--relocate " + relocations + " " + packageName; - rpmCommandArray = new String[8]; + rpmCommandArray = new String[9]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = forceDebianString; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = "--relocate"; - rpmCommandArray[6] = relocations; - rpmCommandArray[7] = packageName; + rpmCommandArray[4] = nodepsString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = "--relocate"; + rpmCommandArray[7] = relocations; + rpmCommandArray[8] = packageName; } else { - rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " -vh " + packageName; - rpmCommandArray = new String[6]; + rpmCommand = "rpm --upgrade --ignoresize " + forceDebianString + " " + nodepsString + " -vh " + packageName; + rpmCommandArray = new String[7]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = "--upgrade"; rpmCommandArray[2] = "--ignoresize"; rpmCommandArray[3] = forceDebianString; - rpmCommandArray[4] = "-vh"; - rpmCommandArray[5] = packageName; + rpmCommandArray[4] = nodepsString; + rpmCommandArray[5] = "-vh"; + rpmCommandArray[6] = packageName; } } } @@ -409,6 +419,7 @@ public class LinuxInstaller extends Installer { // is installed. String forceDebianString = ""; + String nodepsString = ""; if ( ! data.debianInvestigated() ) { helper.investigateDebian(data); @@ -417,6 +428,7 @@ public class LinuxInstaller extends Installer { if ( data.isDebianSystem() ) { forceDebianString = "--force-debian"; + nodepsString = "--nodeps"; } // Code duplication for isDebianSystem is necessary, because there is no valid position @@ -425,21 +437,23 @@ public class LinuxInstaller extends Installer { if ( data.isDebianSystem() ) { if (useLocalDatabase) { - rpmCommand = "rpm " + forceDebianString + " -ev" + " " + databaseString + " " + databasePath + " " + packageName; - rpmCommandArray = new String[6]; + rpmCommand = "rpm " + forceDebianString + " " + nodepsString + " -ev" + " " + databaseString + " " + databasePath + " " + packageName; + rpmCommandArray = new String[7]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = forceDebianString; - rpmCommandArray[2] = "-ev"; - rpmCommandArray[3] = databaseString; - rpmCommandArray[4] = databasePath; - rpmCommandArray[5] = packageName; + rpmCommandArray[2] = nodepsString; + rpmCommandArray[3] = "-ev"; + rpmCommandArray[4] = databaseString; + rpmCommandArray[5] = databasePath; + rpmCommandArray[6] = packageName; } else { - rpmCommand = "rpm " + forceDebianString + " -ev" + " " + packageName; - rpmCommandArray = new String[4]; + rpmCommand = "rpm " + forceDebianString + " " + nodepsString + " -ev" + " " + packageName; + rpmCommandArray = new String[5]; rpmCommandArray[0] = "rpm"; rpmCommandArray[1] = forceDebianString; - rpmCommandArray[2] = "-ev"; - rpmCommandArray[3] = packageName; + rpmCommandArray[2] = nodepsString; + rpmCommandArray[3] = "-ev"; + rpmCommandArray[4] = packageName; } } else { if (useLocalDatabase) { -- cgit From 4929c034350dbad96804a5c517d3471c1d7b7b14 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 17 Aug 2010 10:13:38 +0200 Subject: fwk153: #i113914# set the new storage for duplicate libraries also --- sfx2/source/doc/objstor.cxx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 6c4bdf56ba26..4b77ba4172db 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1917,7 +1917,25 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl( bResult = SaveCompleted( xTmpStorage ); if ( bResult ) + { pImp->pBasicManager->setStorage( xTmpStorage ); + + // Get rid of this workaround after issue i113914 is fixed + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW ); + xBasicLibraries->setRootStorage( xTmpStorage ); + } + catch( uno::Exception& ) + {} + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW ); + xDialogLibraries->setRootStorage( xTmpStorage ); + } + catch( uno::Exception& ) + {} + } } catch( uno::Exception& ) {} @@ -2063,6 +2081,22 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) // TODO/LATER: may be this code will be replaced, but not sure // Set storage in document library containers pImp->pBasicManager->setStorage( xStorage ); + + // Get rid of this workaround after issue i113914 is fixed + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW ); + xBasicLibraries->setRootStorage( xStorage ); + } + catch( uno::Exception& ) + {} + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW ); + xDialogLibraries->setRootStorage( xStorage ); + } + catch( uno::Exception& ) + {} } else { -- cgit From 53cf0e655767a9e7b7a12eae6e856f5064134199 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 17 Aug 2010 12:59:19 +0200 Subject: ooo33gsl06: #i113919# fix page range behavior for 3.3 --- filter/source/pdf/pdfexport.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 8115f36d76f8..43f6f1faf2f1 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -791,7 +791,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue pPDFExtOutDevData->SetIsReduceImageResolution( mbReduceImageResolution ); pPDFExtOutDevData->SetIsExportNamedDestinations( mbExportBmkToDest ); - Sequence< PropertyValue > aRenderOptions( 6 ); + Sequence< PropertyValue > aRenderOptions( 5 ); aRenderOptions[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ); aRenderOptions[ 0 ].Value <<= Reference< awt::XDevice >( pXDevice ); aRenderOptions[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ); @@ -801,10 +801,14 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue aRenderOptions[ 2 ].Value <<= sal_True; aRenderOptions[ 3 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsLastPage" ) ); aRenderOptions[ 3 ].Value <<= sal_False; - aRenderOptions[ 4 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); - aRenderOptions[ 4 ].Value <<= aPageRange; - aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ); - aRenderOptions[ 5 ].Value <<= mbSkipEmptyPages; + aRenderOptions[ 4 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ); + aRenderOptions[ 4 ].Value <<= mbSkipEmptyPages; + #if 0 + // #i113919# writer has to begun "PageRange" for itself changing its renderer count + // we should unify this behavior but not for OOo 3.3 + aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); + aRenderOptions[ 5 ].Value <<= aPageRange; + #endif if( aPageRange.getLength() || !aSelection.hasValue() ) { -- cgit From 30ff826ddc974f37c72d2d74b3934ed691a7ef7e Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 17 Aug 2010 16:46:36 +0200 Subject: cws sw33bf08: #i113584#, #i113587# transliteration fixed --- .../source/transliteration/transliterationImpl.cxx | 1 - .../transliteration/transliteration_body.cxx | 273 +++++++++------------ 2 files changed, 116 insertions(+), 158 deletions(-) diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index dfadecfd5eb7..2109c310b233 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -295,7 +295,6 @@ OUString SAL_CALL TransliterationImpl::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) throw(RuntimeException) { - if (numCascade == 0) return inStr; diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index b58347826470..43222b7a41eb 100755 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -35,6 +35,7 @@ #include #include +#include #include "characterclassificationImpl.hxx" #include "breakiteratorImpl.hxx" @@ -96,7 +97,7 @@ static sal_uInt8 lcl_getMappingTypeForToggleCase( sal_uInt8 nMappingType, sal_Un nRes = MappingTypeLowerToUpper; else { - OSL_ENSURE( nType & 0x01 /* upper case */, "uppercase character expected! 'Toggle case' failed?" ); + // should also work properly for non-upper characters like white spacs, numbers, ... nRes = MappingTypeUpperToLower; } } @@ -330,185 +331,143 @@ Transliteration_titlecase::Transliteration_titlecase() implementationName = "com.sun.star.i18n.Transliteration.Transliteration_titlecase"; } -rtl::OUString SAL_CALL Transliteration_titlecase::transliterate( - const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& /*offset*/ ) - throw(RuntimeException) +#if 0 +struct LigatureData { - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - CharacterClassificationImpl aCharClassImpl( xMSF ); - - // possible problem: the locale is not exactly specific for each word in the text... - OUString aRes( aCharClassImpl.toTitle( inStr, startPos, nCount, aLocale ) ); - return aRes; + sal_uInt32 cChar; + sal_Char * pUtf8Text; +}; + +// available Unicode ligatures: +// http://www.unicode.org/charts +// http://www.unicode.org/charts/PDF/UFB00.pdf +static LigatureData aLigatures[] = +{ + { 0x0FB00, "ff" }, + { 0x0FB01, "fi" }, + { 0x0FB02, "fl" }, + { 0x0FB03, "ffi" }, + { 0x0FB04, "ffl" }, + { 0x0FB05, "ft" }, + { 0x0FB06, "st" }, + + { 0x0FB13, "\xD5\xB4\xD5\xB6" }, // Armenian small men now + { 0x0FB14, "\xD5\xB4\xD5\xA5" }, // Armenian small men ech + { 0x0FB15, "\xD5\xB4\xD5\xAB" }, // Armenian small men ini + { 0x0FB16, "\xD5\xBE\xD5\xB6" }, // Armenian small vew now + { 0x0FB17, "\xD5\xB4\xD5\xAD" }, // Armenian small men xeh + { 0x00000, "" } +}; + +static inline bool lcl_IsLigature( sal_uInt32 cChar ) +{ + return (0x0FB00 <= cChar && cChar <= 0x0FB06) || (0x0FB13 <= cChar && cChar <= 0x0FB17); } -Transliteration_sentencecase::Transliteration_sentencecase() +static rtl::OUString lcl_ResolveLigature( sal_uInt32 cChar ) { - nMappingType = MappingTypeToTitle; // though only to be applied to the first word... - transliterationName = "sentence(generic)"; - implementationName = "com.sun.star.i18n.Transliteration.Transliteration_sentencecase"; + rtl::OUString aRes; + if (lcl_IsLigature( cChar )) + { + LigatureData *pFound = NULL; + LigatureData *pData = aLigatures; + while (!pFound && pData->cChar != 0) + { + if (pData->cChar == cChar) + pFound = pData; + ++pData; + } + if (pFound) + aRes = rtl::OUString( pFound->pUtf8Text, strlen( pFound->pUtf8Text ), RTL_TEXTENCODING_UTF8 ); + } + else + aRes = rtl::OUString( &cChar, 1 ); + return aRes; } +#endif // if 0 -rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate( +static rtl::OUString transliterate_titlecase_Impl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + const Locale &rLocale, Sequence< sal_Int32 >& offset ) throw(RuntimeException) { - // inspired from Transliteration_body::transliterate - sal_Int32 nOffCount = 0, i; - bool bPoint = true; - if (useOffset) - { - for( i = 0; i < nCount; ++i ) { - sal_Unicode c = inStr.getStr()[ i + startPos ]; - if( sal_Unicode('.') == c || sal_Unicode('!') == c || sal_Unicode('?') == c ) { - bPoint = true; - nOffCount++; - } - else if( unicode::isAlpha( c ) || unicode::isDigit( c ) ) - { - const Mapping* map = 0; - if( bPoint && unicode::isLower( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeLowerToUpper); - bPoint = false; - } - else if (!bPoint && unicode::isUpper( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeUpperToLower); - } - - if(map == 0) - { - nOffCount++; - } - else - { - nOffCount += map->nmap; - } - } - else - { - nOffCount++; - } - } - } - - bPoint = true; - rtl::OUStringBuffer result; + const OUString aText( inStr.copy( startPos, nCount ) ); - if (useOffset) + OUString aRes; + if (aText.getLength() > 0) { - result.ensureCapacity(nOffCount); - if ( nOffCount != offset.getLength() ) - offset.realloc( nOffCount ); - } - - - sal_Int32 j = 0; - sal_Int32 * pArr = offset.getArray(); - for( i = 0; i < nCount; ++i ) { - sal_Unicode c = inStr.getStr()[ i + startPos ]; - if( sal_Unicode('.') == c || sal_Unicode('!') == c || sal_Unicode('?') == c ) { - bPoint = true; - result.append(c); - pArr[j++] = i + startPos; - } - else if( unicode::isAlpha( c ) || unicode::isDigit( c ) ) - { - const Mapping* map = 0; - if( bPoint && unicode::isLower( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeLowerToUpper); - } - else if (!bPoint && unicode::isUpper( c )) - { - map = &casefolding::getValue(&c, 0, 1, aLocale, MappingTypeUpperToLower); - } - - if(map == 0) - { - result.append( c ); - pArr[j++] = i + startPos; - } - else - { - for (sal_Int32 k = 0; k < map->nmap; k++) - { - result.append( map->map[k] ); - pArr[j++] = i + startPos; - } - } - bPoint = false; - } - else + Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); + CharacterClassificationImpl aCharClassImpl( xMSF ); + + // because aCharClassImpl.toTitle does not handle ligatures or but will raise + // an exception we need to handle the first chara manually... + + // we don't want to change surrogates by accident, thuse we use proper code point iteration + sal_Int32 nPos = 0; + sal_uInt32 cFirstChar = aText.iterateCodePoints( &nPos ); + OUString aResolvedLigature( &cFirstChar, 1 ); //lcl_ResolveLigature( cFirstChar ) ); + // toUpper can be used to properly resolve ligatures and characters like + aResolvedLigature = aCharClassImpl.toUpper( aResolvedLigature, 0, aResolvedLigature.getLength(), rLocale ); + // since toTitle will leave all-uppercase text unchanged we first need to + // use toLower to bring possible 2nd and following charas in lowercase + aResolvedLigature = aCharClassImpl.toLower( aResolvedLigature, 0, aResolvedLigature.getLength(), rLocale ); + sal_Int32 nResolvedLen = aResolvedLigature.getLength(); + + // now we can properly use toTitle to get the expected result for the resolved string. + // The rest of the text should just become lowercase. + aRes = aCharClassImpl.toTitle( aResolvedLigature, 0, nResolvedLen, rLocale ); + aRes += aCharClassImpl.toLower( aText, 1, aText.getLength() - 1, rLocale ); + offset.realloc( aRes.getLength() ); + + sal_Int32 *pOffset = offset.getArray(); + sal_Int32 nLen = offset.getLength(); + for (sal_Int32 i = 0; i < nLen; ++i) { - result.append( c ); - pArr[j++] = i + startPos; + sal_Int32 nIdx = 0; + if (i >= nResolvedLen) + nIdx = i - nResolvedLen + 1; + pOffset[i] = nIdx; } } - return result.makeStringAndClear(); +#if OSL_DEBUG_LEVEL > 1 + const sal_Int32 *pCOffset = offset.getConstArray(); + (void) pCOffset; +#endif + + return aRes; } -#if 0 -// TL: alternative implemntation try. But breakiterator has its problem too since -// beginOfSentence does not work as expected with '.'. See comment below. -// For the time being I will leave this code here as a from-scratch sample if the -// breakiterator works better at some point... -rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate( - const OUString& inStr, sal_Int32 nStartPos, sal_Int32 nCount, - Sequence< sal_Int32 >& /*offset*/ ) + +// this function expects to be called on a word-by-word basis, +// namely that startPos points to the first char of the word +rtl::OUString SAL_CALL Transliteration_titlecase::transliterate( + const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + Sequence< sal_Int32 >& offset ) throw(RuntimeException) { - OUString aRes( inStr.copy( nStartPos, nCount ) ); + return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset ); +} - if (nStartPos >= 0 && nStartPos < inStr.getLength() && nCount > 0) - { - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - BreakIteratorImpl brk( xMSF ); - sal_Int32 nSentenceStart = -1, nOldSentenceStart = -1; - sal_Int32 nPos = nStartPos + nCount - 1; - while (nPos >= nStartPos && nPos != -1) - { - // possible problem: the locale is not exactly specific for each sentence in the text, - // but it is the only one we have... - nOldSentenceStart = nSentenceStart; - nSentenceStart = brk.beginOfSentence( inStr, nPos, aLocale ); - - // since the breakiterator completely ignores '.' characvters as end-of-sentence when - // the next word is lower case we need to take care of that ourself. The drawback: - // la mid-sentence abbreviation like e.g. will now be identified as end-of-sentence. :-( - // Well, at least the other product does it in the same way... - sal_Int32 nFullStopPos = inStr.lastIndexOf( (sal_Unicode)'.', nPos ); - nPos = nSentenceStart; - if (nFullStopPos > 0 && nFullStopPos > nSentenceStart) - { - Boundary aBd2 = brk.nextWord( inStr, nFullStopPos, aLocale, WordType::DICTIONARY_WORD ); - nSentenceStart = aBd2.startPos; - nPos = nFullStopPos; - } +Transliteration_sentencecase::Transliteration_sentencecase() +{ + nMappingType = MappingTypeToTitle; // though only to be applied to the first word... + transliterationName = "sentence(generic)"; + implementationName = "com.sun.star.i18n.Transliteration.Transliteration_sentencecase"; +} - if (nSentenceStart < nOldSentenceStart || nOldSentenceStart == -1) - { - // the sentence start might be a quotation mark or some kind of bracket, thus - // we need the first dictionary word starting or following this position - // Boundary aBd1 = brk.nextWord( inStr, nSentenceStart, aLocale, WordType::DICTIONARY_WORD ); - Boundary aBd2 = brk.getWordBoundary( inStr, nSentenceStart, aLocale, WordType::DICTIONARY_WORD, true ); - // OUString aWord1( inStr.copy( aBd1.startPos, aBd1.endPos - aBd1.startPos + 1 ) ); - OUString aWord2( inStr.copy( aBd2.startPos, aBd2.endPos - aBd2.startPos + 1 ) ); - } - else - break; // prevent endless loop - // continue with previous sentence - if (nPos != -1) - --nPos; - } - } - return aRes; +// this function expects to be called on a sentence-by-sentence basis, +// namely that startPos points to the first word (NOT first char!) in the sentence +rtl::OUString SAL_CALL Transliteration_sentencecase::transliterate( + const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + Sequence< sal_Int32 >& offset ) + throw(RuntimeException) +{ + return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset ); } -#endif + } } } } + -- cgit From afb2f41ca982b7e0cbc8a5b4952ea3edfbb2a883 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 17 Aug 2010 16:46:36 +0200 Subject: cws sw33bf08: #i113584#, #i113587# transliteration fixed --- editeng/source/editeng/impedit.hxx | 3 + editeng/source/editeng/impedit4.cxx | 369 ++++++++++++++++++++++++++++++------ 2 files changed, 312 insertions(+), 60 deletions(-) diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index ede5acacc698..c8f5e2948665 100755 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -1002,6 +1003,8 @@ public: void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow ); EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ); + short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets ); + void SetAsianCompressionMode( USHORT n ); USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 482cd6d71338..6f216f7b22ca 100755 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -76,6 +76,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -83,6 +86,8 @@ #include #include +#include + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -2798,8 +2803,23 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool bClearTipW #endif // !SVX_LIGHT } + +struct TransliterationChgData +{ + USHORT nStart; + xub_StrLen nLen; + EditSelection aSelection; + String aNewText; + uno::Sequence< sal_Int32 > aOffsets; +}; + + EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ) { + uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); + if (!_xBI.is()) + return rSelection; + EditSelection aSel( rSelection ); aSel.Adjust( aEditDoc ); @@ -2808,8 +2828,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, EditSelection aNewSel( aSel ); - USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + const USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); + const USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); BOOL bChanges = FALSE; BOOL bLenChanged = FALSE; @@ -2832,83 +2852,266 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, USHORT nCurrentEnd = nEndPos; sal_uInt16 nLanguage = LANGUAGE_SYSTEM; - do - { - if ( bConsiderLanguage ) + // since we don't use Hiragana/Katakana or half-width/full-width transliterations here + // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will + // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES + // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the + // proper thing to do. + const sal_Int16 nWordType = i18n::WordType::ANYWORD_IGNOREWHITESPACES; + + //! In order to have less trouble with changing text size, e.g. because + //! of ligatures or � (German small sz) being resolved, we need to process + //! the text replacements from end to start. + //! This way the offsets for the yet to be changed words will be + //! left unchanged by the already replaced text. + //! For this we temporarily save the changes to be done in this vector + std::vector< TransliterationChgData > aChanges; + TransliterationChgData aChgData; + + if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE) + { + // for 'capitalize every word' we need to iterate over each word + + i18n::Boundary aSttBndry; + i18n::Boundary aEndBndry; + aSttBndry = _xBI->getWordBoundary( + *pNode, nStartPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ), + nWordType, TRUE /*prefer forward direction*/); + aEndBndry = _xBI->getWordBoundary( + *pNode, nEndPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ), + nWordType, FALSE /*prefer backward direction*/); + + // prevent backtracking to the previous word if selection is at word boundary + if (aSttBndry.endPos <= nStartPos) + { + aSttBndry = _xBI->nextWord( + *pNode, aSttBndry.endPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aSttBndry.endPos + 1 ) ) ), + nWordType); + } + // prevent advancing to the next word if selection is at word boundary + if (aEndBndry.startPos >= nEndPos) { - nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd ); - if ( nCurrentEnd > nEndPos ) - nCurrentEnd = nEndPos; + aEndBndry = _xBI->previousWord( + *pNode, aEndBndry.startPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aEndBndry.startPos + 1 ) ) ), + nWordType); } - xub_StrLen nLen = nCurrentEnd - nCurrentStart; + i18n::Boundary aCurWordBndry( aSttBndry ); + while (aCurWordBndry.startPos <= aEndBndry.startPos) + { + nCurrentStart = (xub_StrLen)aCurWordBndry.startPos; + nCurrentEnd = (xub_StrLen)aCurWordBndry.endPos; + sal_Int32 nLen = nCurrentEnd - nCurrentStart; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( pNode->Copy( nCurrentStart, nLen ) ); +#endif + + Sequence< sal_Int32 > aOffsets; + String aNewText( aTranslitarationWrapper.transliterate( *pNode, + GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), + nCurrentStart, nLen, &aOffsets )); + + if (!pNode->Equals( aNewText, nCurrentStart, nLen )) + { + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) ); + aChgData.aNewText = aNewText; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); + } +#if OSL_DEBUG_LEVEL > 1 + String aSelTxt ( GetSelected( aChgData.aSelection ) ); + (void) aSelTxt; +#endif + + aCurWordBndry = _xBI->nextWord( *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + nWordType); + } + DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos, "failed to reach end of transliteration" ); + } + else if (nTransliterationMode == i18n::TransliterationModulesExtra::SENTENCE_CASE) + { + // for 'sentence case' we need to iterate sentence by sentence + + sal_Int32 nLastStart = _xBI->beginOfSentence( + *pNode, nEndPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ) ); + sal_Int32 nLastEnd = _xBI->endOfSentence( + *pNode, nLastStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ) ); - Sequence aOffsets; - String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) ); + // extend nCurrentStart, nCurrentEnd to the current sentence boundaries + nCurrentStart = _xBI->beginOfSentence( + *pNode, nStartPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ) ); + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); - if( ( nLen != aNewText.Len() ) || !pNode->Equals( aNewText, nCurrentStart, nLen ) ) + // prevent backtracking to the previous sentence if selection starts at end of a sentence + if (nCurrentEnd <= nStartPos) { - bChanges = TRUE; - if ( nLen != aNewText.Len() ) - bLenChanged = TRUE; + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the next real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = _xBI->nextWord( *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + i18n::WordType::DICTIONARY_WORD); + + // now get new current sentence boundaries + nCurrentStart = _xBI->beginOfSentence( + *pNode, aBndry.startPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) ); + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); + } + // prevent advancing to the next sentence if selection ends at start of a sentence + if (nLastStart >= nEndPos) + { + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the previous real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = _xBI->previousWord( *pNode, nLastStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ), + i18n::WordType::DICTIONARY_WORD); + nLastEnd = _xBI->endOfSentence( + *pNode, aBndry.startPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) ); + if (nCurrentEnd > nLastEnd) + nCurrentEnd = nLastEnd; + } -#ifndef SVX_LIGHT - // Create UndoAction on Demand.... - if ( !pUndo && IsUndoEnabled() && !IsInUndo() ) - { - ESelection aESel( CreateESel( aSel ) ); - pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode ); + while (nCurrentStart < nLastEnd) + { + sal_Int32 nLen = nCurrentEnd - nCurrentStart; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( pNode->Copy( nCurrentStart, nLen ) ); +#endif - if ( ( nStartNode == nEndNode ) && !aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ) ) - pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) ); - else - pUndo->SetText( CreateBinTextObject( aSel, NULL ) ); + Sequence< sal_Int32 > aOffsets; + String aNewText( aTranslitarationWrapper.transliterate( *pNode, + GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), + nCurrentStart, nLen, &aOffsets )); + + if (!pNode->Equals( aNewText, nCurrentStart, nLen )) + { + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) ); + aChgData.aNewText = aNewText; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); } -#endif - // Change text without loosing the attributes - USHORT nCharsAfterTransliteration = - sal::static_int_cast< USHORT >(aOffsets.getLength()); - const sal_Int32* pOffsets = aOffsets.getConstArray(); - short nDiffs = 0; - for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ ) + i18n::Boundary aFirstWordBndry; + aFirstWordBndry = _xBI->nextWord( + *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + nWordType); + nCurrentStart = aFirstWordBndry.startPos; + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); + } + DBG_ASSERT( nCurrentEnd >= nLastEnd, "failed to reach end of transliteration" ); + } + else + { + do + { + if ( bConsiderLanguage ) { - USHORT nCurrentPos = nCurrentStart+n; - sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n]; + nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd ); + if ( nCurrentEnd > nEndPos ) + nCurrentEnd = nEndPos; + } - if ( !nDiff ) - { - DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); - pNode->SetChar( nCurrentPos, aNewText.GetChar(n) ); - } - else if ( nDiff < 0 ) - { - // Replace first char, delete the rest... - DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); - pNode->SetChar( nCurrentPos, aNewText.GetChar(n) ); + xub_StrLen nLen = nCurrentEnd - nCurrentStart; - DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" ); - GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) ); - } - else - { - DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." ); - GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), aNewText.GetChar(n) ); + Sequence< sal_Int32 > aOffsets; + String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) ); - } - nDiffs = sal::static_int_cast< short >(nDiffs + nDiff); + if (!pNode->Equals( aNewText, nCurrentStart, nLen )) + { + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) ); + aChgData.aNewText = aNewText; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); } - if ( nNode == nEndNode ) - aNewSel.Max().GetIndex() = - aNewSel.Max().GetIndex() + nDiffs; + nCurrentStart = nCurrentEnd; + } while( nCurrentEnd < nEndPos ); + } + + if (aChanges.size() > 0) + { +#ifndef SVX_LIGHT + // Create a single UndoAction on Demand for all the changes ... + if ( !pUndo && IsUndoEnabled() && !IsInUndo() ) + { + // adjust selection to include all changes + for (size_t i = 0; i < aChanges.size(); ++i) + { + const EditSelection &rSel = aChanges[i].aSelection; + if (aSel.Min().GetNode() == rSel.Min().GetNode() && + aSel.Min().GetIndex() > rSel.Min().GetIndex()) + aSel.Min().SetIndex( rSel.Min().GetIndex() ); + if (aSel.Max().GetNode() == rSel.Max().GetNode() && + aSel.Max().GetIndex() < rSel.Max().GetIndex()) + aSel.Max().SetIndex( rSel.Max().GetIndex() ); + } + aNewSel = aSel; + + ESelection aESel( CreateESel( aSel ) ); + pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode ); + + const bool bSingleNode = aSel.Min().GetNode()== aSel.Max().GetNode(); + const bool bHasAttribs = aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ); + if (bSingleNode && !bHasAttribs) + pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) ); + else + pUndo->SetText( CreateBinTextObject( aSel, NULL ) ); + } +#endif + + // now apply the changes from end to start to leave the offsets of the + // yet unchanged text parts remain the same. + for (size_t i = 0; i < aChanges.size(); ++i) + { + const TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ]; - ParaPortion* pParaPortion = GetParaPortions()[nNode]; - pParaPortion->MarkSelectionInvalid( nCurrentStart, std::max< USHORT >( nCurrentStart+nLen, nCurrentStart+aNewText.Len() ) ); + bChanges = TRUE; + if (rData.nLen != rData.aNewText.Len()) + bLenChanged = TRUE; + // Change text without loosing the attributes + USHORT nDiffs = ReplaceTextOnly( rData.aSelection.Min().GetNode(), + rData.nStart, rData.nLen, rData.aNewText, rData.aOffsets ); + + // adjust selection in end node to possibly changed size + if (aSel.Max().GetNode() == rData.aSelection.Max().GetNode()) + aNewSel.Max().GetIndex() = aNewSel.Max().GetIndex() + nDiffs; + + USHORT nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() ); + ParaPortion* pParaPortion = GetParaPortions()[nSelNode]; + pParaPortion->MarkSelectionInvalid( rData.nStart, + std::max< USHORT >( rData.nStart + rData.nLen, + rData.nStart + rData.aNewText.Len() ) ); } - nCurrentStart = nCurrentEnd; - } while( nCurrentEnd < nEndPos ); + } // if (aChanges.size() > 0) } #ifndef SVX_LIGHT @@ -2932,6 +3135,52 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, return aNewSel; } + +short ImpEditEngine::ReplaceTextOnly( + ContentNode* pNode, + USHORT nCurrentStart, xub_StrLen nLen, + const String& rNewText, + const uno::Sequence< sal_Int32 >& rOffsets ) +{ + (void) nLen; + + // Change text without loosing the attributes + USHORT nCharsAfterTransliteration = + sal::static_int_cast< USHORT >(rOffsets.getLength()); + const sal_Int32* pOffsets = rOffsets.getConstArray(); + short nDiffs = 0; + for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ ) + { + USHORT nCurrentPos = nCurrentStart+n; + sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n]; + + if ( !nDiff ) + { + DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); + pNode->SetChar( nCurrentPos, rNewText.GetChar(n) ); + } + else if ( nDiff < 0 ) + { + // Replace first char, delete the rest... + DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); + pNode->SetChar( nCurrentPos, rNewText.GetChar(n) ); + + DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" ); + GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) ); + } + else + { + DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." ); + GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), rNewText.GetChar(n) ); + + } + nDiffs = sal::static_int_cast< short >(nDiffs + nDiff); + } + + return nDiffs; +} + + void ImpEditEngine::SetAsianCompressionMode( USHORT n ) { if ( n != nAsianCompressionMode ) -- cgit From 3404d2fe8e50e3bc0efc91ccba9796fef73b3d5c Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 17 Aug 2010 16:46:36 +0200 Subject: cws sw33bf08: #i113584#, #i113587# transliteration fixed --- sw/inc/undobj.hxx | 6 +- sw/source/core/doc/docedt.cxx | 33 +++-- sw/source/core/txtnode/txtedt.cxx | 271 +++++++++++++++++++++++++++++++++----- sw/source/core/undo/unovwr.cxx | 136 +++++++++---------- 4 files changed, 326 insertions(+), 120 deletions(-) diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index cf92a707e40f..7f16e4e4d44c 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -27,9 +27,7 @@ #ifndef SW_UNDOBJ_HXX #define SW_UNDOBJ_HXX -// --> OD 2006-11-01 #130889# #include -// <-- #include #include @@ -1718,7 +1716,7 @@ public: struct _UndoTransliterate_Data; class SwUndoTransliterate : public SwUndo, public SwUndRng { - _UndoTransliterate_Data *pData, *pLastData; + std::vector< _UndoTransliterate_Data * > aChanges; sal_uInt32 nType; public: @@ -1732,7 +1730,7 @@ public: void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen, ::com::sun::star::uno::Sequence & rOffsets ); - BOOL HasData() const {return 0 != pData; } + BOOL HasData() const { return aChanges.size() > 0; } }; //-------------------------------------------------------------------- diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 31484ac303dd..bdcf8caaff7b 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +73,8 @@ #include #include +#include + using ::rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::linguistic2; @@ -2653,8 +2656,9 @@ bool SwDoc::DelFullPara( SwPaM& rPam ) } -void SwDoc::TransliterateText( const SwPaM& rPaM, - utl::TransliterationWrapper& rTrans ) +void SwDoc::TransliterateText( + const SwPaM& rPaM, + utl::TransliterationWrapper& rTrans ) { SwUndoTransliterate* pUndo; if( DoesUndo() ) @@ -2663,15 +2667,17 @@ void SwDoc::TransliterateText( const SwPaM& rPaM, pUndo = 0; const SwPosition* pStt = rPaM.Start(), - * pEnd = pStt == rPaM.GetPoint() ? rPaM.GetMark() - : rPaM.GetPoint(); - ULONG nSttNd = pStt->nNode.GetIndex(), nEndNd = pEnd->nNode.GetIndex(); + * pEnd = rPaM.End(); + ULONG nSttNd = pStt->nNode.GetIndex(), + nEndNd = pEnd->nNode.GetIndex(); xub_StrLen nSttCnt = pStt->nContent.GetIndex(), nEndCnt = pEnd->nContent.GetIndex(); SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode(); - if( pStt == pEnd && pTNd ) // no region ? + if( pStt == pEnd && pTNd ) // no selection? { + // set current word as 'area of effect' + Boundary aBndry; if( pBreakIt->GetBreakIter().is() ) aBndry = pBreakIt->GetBreakIter()->getWordBoundary( @@ -2687,21 +2693,24 @@ void SwDoc::TransliterateText( const SwPaM& rPaM, } } - if( nSttNd != nEndNd ) + if( nSttNd != nEndNd ) // is more than one text node involved? { + // iterate over all effected text nodes, the first and the last one + // may be incomplete because the selection starts and/or ends there + SwNodeIndex aIdx( pStt->nNode ); if( nSttCnt ) { aIdx++; if( pTNd ) - pTNd->TransliterateText( rTrans, nSttCnt, - pTNd->GetTxt().Len(), pUndo ); + pTNd->TransliterateText( rTrans, nSttCnt, pTNd->GetTxt().Len(), pUndo ); } for( ; aIdx.GetIndex() < nEndNd; aIdx++ ) + { if( 0 != ( pTNd = aIdx.GetNode().GetTxtNode() )) - pTNd->TransliterateText( rTrans, 0, pTNd->GetTxt().Len(), - pUndo ); + pTNd->TransliterateText( rTrans, 0, pTNd->GetTxt().Len(), pUndo ); + } if( nEndCnt && 0 != ( pTNd = pEnd->nNode.GetNode().GetTxtNode() )) pTNd->TransliterateText( rTrans, 0, nEndCnt, pUndo ); @@ -2721,6 +2730,8 @@ void SwDoc::TransliterateText( const SwPaM& rPaM, } SetModified(); } + + #define MAX_REDLINE_COUNT 250 // ----------------------------------------------------------------------------- void SwDoc::checkRedlining(RedlineMode_t& _rReadlineMode) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 944eb70b2c3d..0630dbd722b6 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -36,6 +36,7 @@ #include // clock() #include #endif + #include #include #include @@ -46,9 +47,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -86,6 +84,15 @@ #include +#include +#include +#include +#include +#include + +#include + + using rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::frame; @@ -1578,49 +1585,247 @@ void SwLinguStatistik::Flush() #endif + +struct TransliterationChgData +{ + xub_StrLen nStart; + xub_StrLen nLen; + String sChanged; + Sequence< sal_Int32 > aOffsets; +}; + // change text to Upper/Lower/Hiragana/Katagana/... -void SwTxtNode::TransliterateText( utl::TransliterationWrapper& rTrans, - xub_StrLen nStt, xub_StrLen nEnd, SwUndoTransliterate* pUndo ) +void SwTxtNode::TransliterateText( + utl::TransliterationWrapper& rTrans, + xub_StrLen nStt, xub_StrLen nEnd, + SwUndoTransliterate* pUndo ) { - if( nStt < nEnd ) + if (nStt < nEnd && pBreakIt->GetBreakIter().is()) { - SwLanguageIterator* pIter; - if( rTrans.needLanguageForTheMode() ) - pIter = new SwLanguageIterator( *this, nStt ); - else - pIter = 0; + // since we don't use Hiragana/Katakana or half-width/full-width transliterations here + // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will + // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES + // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the + // proper thing to do. + const sal_Int16 nWordType = WordType::ANYWORD_IGNOREWHITESPACES; + + //! In order to have less trouble with changing text size, e.g. because + //! of ligatures or � (German small sz) being resolved, we need to process + //! the text replacements from end to start. + //! This way the offsets for the yet to be changed words will be + //! left unchanged by the already replaced text. + //! For this we temporarily save the changes to be done in this vector + std::vector< TransliterationChgData > aChanges; + TransliterationChgData aChgData; + + if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::TITLE_CASE) + { + // for 'capitalize every word' we need to iterate over each word + + Boundary aSttBndry; + Boundary aEndBndry; + aSttBndry = pBreakIt->GetBreakIter()->getWordBoundary( + GetTxt(), nStt, + pBreakIt->GetLocale( GetLang( nStt ) ), + nWordType, + TRUE /*prefer forward direction*/); + aEndBndry = pBreakIt->GetBreakIter()->getWordBoundary( + GetTxt(), nEnd, + pBreakIt->GetLocale( GetLang( nEnd ) ), + nWordType, + FALSE /*prefer backward direction*/); + + // prevent backtracking to the previous word if selection is at word boundary + if (aSttBndry.endPos <= nStt) + { + aSttBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), aSttBndry.endPos, + pBreakIt->GetLocale( GetLang( aSttBndry.endPos ) ), + nWordType); + } + // prevent advancing to the next word if selection is at word boundary + if (aEndBndry.startPos >= nEnd) + { + aEndBndry = pBreakIt->GetBreakIter()->previousWord( + GetTxt(), aEndBndry.startPos, + pBreakIt->GetLocale( GetLang( aEndBndry.startPos ) ), + nWordType); + } - xub_StrLen nEndPos; - sal_uInt16 nLang; - do { - if( pIter ) + Boundary aCurWordBndry( aSttBndry ); + while (aCurWordBndry.startPos <= aEndBndry.startPos) { - nLang = pIter->GetLanguage(); - nEndPos = pIter->GetChgPos(); - if( nEndPos > nEnd ) - nEndPos = nEnd; + nStt = (xub_StrLen)aCurWordBndry.startPos; + nEnd = (xub_StrLen)aCurWordBndry.endPos; + sal_Int32 nLen = nEnd - nStt; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( GetTxt().Copy( nStt, nLen ) ); +#endif + + Sequence aOffsets; + String sChgd( rTrans.transliterate( GetTxt(), GetLang( nStt ), nStt, nLen, &aOffsets )); + + if (!m_Text.Equals( sChgd, nStt, nLen )) + { + aChgData.nStart = nStt; + aChgData.nLen = nLen; + aChgData.sChanged = sChgd; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); + } + + aCurWordBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), nEnd, + pBreakIt->GetLocale( GetLang( nEnd ) ), + nWordType); } - else + } + else if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::SENTENCE_CASE) + { + // for 'sentence case' we need to iterate sentence by sentence + + sal_Int32 nLastStart = pBreakIt->GetBreakIter()->beginOfSentence( + GetTxt(), nEnd, + pBreakIt->GetLocale( GetLang( nEnd ) ) ); + sal_Int32 nLastEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nLastStart, + pBreakIt->GetLocale( GetLang( nLastStart ) ) ); + + // extend nStt, nEnd to the current sentence boundaries + sal_Int32 nCurrentStart = pBreakIt->GetBreakIter()->beginOfSentence( + GetTxt(), nStt, + pBreakIt->GetLocale( GetLang( nStt ) ) ); + sal_Int32 nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nCurrentStart, + pBreakIt->GetLocale( GetLang( nCurrentStart ) ) ); + + // prevent backtracking to the previous sentence if selection starts at end of a sentence + if (nCurrentEnd <= nStt) + { + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the next real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), nCurrentEnd, + pBreakIt->GetLocale( GetLang( nCurrentEnd ) ), + i18n::WordType::DICTIONARY_WORD); + + // now get new current sentence boundaries + nCurrentStart = pBreakIt->GetBreakIter()->beginOfSentence( + GetTxt(), aBndry.startPos, + pBreakIt->GetLocale( GetLang( aBndry.startPos) ) ); + nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nCurrentStart, + pBreakIt->GetLocale( GetLang( nCurrentStart) ) ); + } + // prevent advancing to the next sentence if selection ends at start of a sentence + if (nLastStart >= nEnd) { - nLang = LANGUAGE_SYSTEM; - nEndPos = nEnd; + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the previous real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = pBreakIt->GetBreakIter()->previousWord( + GetTxt(), nLastStart, + pBreakIt->GetLocale( GetLang( nLastStart) ), + i18n::WordType::DICTIONARY_WORD); + nLastEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), aBndry.startPos, + pBreakIt->GetLocale( GetLang( aBndry.startPos) ) ); + if (nCurrentEnd > nLastEnd) + nCurrentEnd = nLastEnd; } - xub_StrLen nLen = nEndPos - nStt; - Sequence aOffsets; - String sChgd( rTrans.transliterate( m_Text, nLang, nStt, nLen, - &aOffsets )); - if( !m_Text.Equals( sChgd, nStt, nLen ) ) + while (nCurrentStart < nLastEnd) { - if ( pUndo ) + sal_Int32 nLen = nCurrentEnd - nCurrentStart; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( GetTxt().Copy( nCurrentStart, nLen ) ); +#endif + + Sequence aOffsets; + String sChgd( rTrans.transliterate( GetTxt(), + GetLang( nCurrentStart ), nCurrentStart, nLen, &aOffsets )); + + if (!m_Text.Equals( sChgd, nStt, nLen )) { - pUndo->AddChanges( *this, nStt, nLen, aOffsets ); + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.sChanged = sChgd; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); } - ReplaceTextOnly( nStt, nLen, sChgd, aOffsets ); + + Boundary aFirstWordBndry; + aFirstWordBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), nCurrentEnd, + pBreakIt->GetLocale( GetLang( nCurrentEnd ) ), + nWordType); + nCurrentStart = aFirstWordBndry.startPos; + nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nCurrentStart, + pBreakIt->GetLocale( GetLang( nCurrentStart ) ) ); } - nStt = nEndPos; - } while( nEndPos < nEnd && pIter && pIter->Next() ); - delete pIter; + } + else + { + // here we may transliterate over complete language portions... + + SwLanguageIterator* pIter; + if( rTrans.needLanguageForTheMode() ) + pIter = new SwLanguageIterator( *this, nStt ); + else + pIter = 0; + + xub_StrLen nEndPos; + sal_uInt16 nLang; + do { + if( pIter ) + { + nLang = pIter->GetLanguage(); + nEndPos = pIter->GetChgPos(); + if( nEndPos > nEnd ) + nEndPos = nEnd; + } + else + { + nLang = LANGUAGE_SYSTEM; + nEndPos = nEnd; + } + xub_StrLen nLen = nEndPos - nStt; + + Sequence aOffsets; + String sChgd( rTrans.transliterate( m_Text, nLang, nStt, nLen, &aOffsets )); + + if (!m_Text.Equals( sChgd, nStt, nLen )) + { + aChgData.nStart = nStt; + aChgData.nLen = nLen; + aChgData.sChanged = sChgd; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); + } + + nStt = nEndPos; + } while( nEndPos < nEnd && pIter && pIter->Next() ); + delete pIter; + } + + if (aChanges.size() > 0) + { + // now apply the changes from end to start to leave the offsets of the + // yet unchanged text parts remain the same. + for (size_t i = 0; i < aChanges.size(); ++i) + { + TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ]; + if (pUndo) + pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets ); + ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets ); + } + } } } diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index 8254d431b079..91549c84a57e 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -352,16 +352,14 @@ SwRewriter SwUndoOverwrite::GetRewriter() const struct _UndoTransliterate_Data { - String sText; - _UndoTransliterate_Data* pNext; - SwHistory* pHistory; - Sequence * pOffsets; - ULONG nNdIdx; - xub_StrLen nStart, nLen; - - _UndoTransliterate_Data( ULONG nNd, xub_StrLen nStt, xub_StrLen nStrLen, - const String& rTxt ) - : sText( rTxt ), pNext( 0 ), pHistory( 0 ), pOffsets( 0 ), + String sText; + SwHistory* pHistory; + Sequence< sal_Int32 >* pOffsets; + ULONG nNdIdx; + xub_StrLen nStart, nLen; + + _UndoTransliterate_Data( ULONG nNd, xub_StrLen nStt, xub_StrLen nStrLen, const String& rTxt ) + : sText( rTxt ), pHistory( 0 ), pOffsets( 0 ), nNdIdx( nNd ), nStart( nStt ), nLen( nStrLen ) {} ~_UndoTransliterate_Data() { delete pOffsets; delete pHistory; } @@ -369,22 +367,17 @@ struct _UndoTransliterate_Data void SetChangeAtNode( SwDoc& rDoc ); }; -SwUndoTransliterate::SwUndoTransliterate( const SwPaM& rPam, - const utl::TransliterationWrapper& rTrans ) - : SwUndo( UNDO_TRANSLITERATE ), SwUndRng( rPam ), - pData( 0 ), pLastData( 0 ), nType( rTrans.getType() ) +SwUndoTransliterate::SwUndoTransliterate( + const SwPaM& rPam, + const utl::TransliterationWrapper& rTrans ) + : SwUndo( UNDO_TRANSLITERATE ), SwUndRng( rPam ), nType( rTrans.getType() ) { } SwUndoTransliterate::~SwUndoTransliterate() { - _UndoTransliterate_Data* pD = pData; - while( pD ) - { - pData = pD; - pD = pD->pNext; - delete pData; - } + for (size_t i = 0; i < aChanges.size(); ++i) + delete aChanges[i]; } void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter ) @@ -393,8 +386,12 @@ void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter ) BOOL bUndo = rDoc.DoesUndo(); rDoc.DoUndo( FALSE ); - for( _UndoTransliterate_Data* pD = pData; pD; pD = pD->pNext ) - pD->SetChangeAtNode( rDoc ); + // since the changes were added to the vector from the end of the string/node towards + // the start, we need to revert them from the start towards the end now to keep the + // offset information of the undo data in sync with the changing text. + // Thus we need to iterate from the end of the vector to the start + for (sal_Int32 i = aChanges.size() - 1; i >= 0; --i) + aChanges[i]->SetChangeAtNode( rDoc ); rDoc.DoUndo( bUndo ); SetPaM( rUndoIter, TRUE ); @@ -413,8 +410,7 @@ void SwUndoTransliterate::Repeat( SwUndoIter& rUndoIter ) SwPaM& rPam = *rUndoIter.pAktPam; SwDoc& rDoc = rUndoIter.GetDoc(); - utl::TransliterationWrapper aTrans( - ::comphelper::getProcessServiceFactory(), nType ); + utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType ); rDoc.TransliterateText( rPam, aTrans ); rUndoIter.pLastUndoObj = this; @@ -428,67 +424,63 @@ void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd, _UndoTransliterate_Data* pNew = new _UndoTransliterate_Data( rTNd.GetIndex(), nStart, (xub_StrLen)nOffsLen, rTNd.GetTxt().Copy( nStart, nLen )); - if( pData ) - pLastData->pNext = pNew; - else - pData = pNew; - pLastData = pNew; + + aChanges.push_back( pNew ); const sal_Int32* pOffsets = rOffsets.getConstArray(); // where did we need less memory ? const sal_Int32* p = pOffsets; for( long n = 0; n < nOffsLen; ++n, ++p ) - if( *p != ( nStart + n )) + if( *p != ( nStart + n )) + { + // create the Offset array + pNew->pOffsets = new Sequence ( nLen ); + sal_Int32* pIdx = pNew->pOffsets->getArray(); + p = pOffsets; + long nMyOff, nNewVal = nStart; + for( n = 0, nMyOff = nStart; n < nOffsLen; ++p, ++n, ++nMyOff ) { - // create the Offset array - pNew->pOffsets = new Sequence ( nLen ); - sal_Int32* pIdx = pNew->pOffsets->getArray(); - p = pOffsets; - long nMyOff, nNewVal = nStart; - for( n = 0, nMyOff = nStart; n < nOffsLen; ++p, ++n, ++nMyOff ) + if( *p < nMyOff ) { - if( *p < nMyOff ) - { - // something is deleted - nMyOff = *p; - *(pIdx-1) = nNewVal++; - } - else if( *p > nMyOff ) - { - for( ; *p > nMyOff; ++nMyOff ) - *pIdx++ = nNewVal; - --nMyOff; - --n; - --p; - } - else - *pIdx++ = nNewVal++; + // something is deleted + nMyOff = *p; + *(pIdx-1) = nNewVal++; } - - // and then we need to save the attributes/bookmarks - // but this data must moved every time to the last in the chain! - _UndoTransliterate_Data* pD = pData; - while( pD != pNew ) + else if( *p > nMyOff ) { - if( pD->nNdIdx == pNew->nNdIdx && pD->pHistory ) - { - // same node and have a history? - pNew->pHistory = pD->pHistory; - pD->pHistory = 0; - break; // more can't exist - } - pD = pD->pNext; + for( ; *p > nMyOff; ++nMyOff ) + *pIdx++ = nNewVal; + --nMyOff; + --n; + --p; } + else + *pIdx++ = nNewVal++; + } - if( !pNew->pHistory ) + // and then we need to save the attributes/bookmarks + // but this data must moved every time to the last in the chain! + for (size_t i = 0; i + 1 < aChanges.size(); ++i) // check all changes but not the current one + { + _UndoTransliterate_Data* pD = aChanges[i]; + if( pD->nNdIdx == pNew->nNdIdx && pD->pHistory ) { - pNew->pHistory = new SwHistory; - SwRegHistory aRHst( rTNd, pNew->pHistory ); - pNew->pHistory->CopyAttr( rTNd.GetpSwpHints(), - pNew->nNdIdx, 0, rTNd.GetTxt().Len(), false ); + // same node and have a history? + pNew->pHistory = pD->pHistory; + pD->pHistory = 0; + break; // more can't exist } - break; } + + if( !pNew->pHistory ) + { + pNew->pHistory = new SwHistory; + SwRegHistory aRHst( rTNd, pNew->pHistory ); + pNew->pHistory->CopyAttr( rTNd.GetpSwpHints(), + pNew->nNdIdx, 0, rTNd.GetTxt().Len(), false ); + } + break; + } } void _UndoTransliterate_Data::SetChangeAtNode( SwDoc& rDoc ) -- cgit From d40c2239e14027cef7c281830616c3deacbc9174 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 18 Aug 2010 10:52:09 +0200 Subject: fwk153: #i110127# Provide one instance of module accelerator manager in module ui configuration manager implementation. --- .../moduleuiconfigurationmanager.hxx | 1 + .../accelerators/acceleratorconfiguration.cxx | 5 +- .../moduleuiconfigurationmanager.cxx | 72 ++++++++++++---------- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx index 9c5f9c89afe6..856746139b68 100644 --- a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx +++ b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx @@ -219,6 +219,7 @@ namespace framework com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xModuleImageManager; + com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xModuleAcceleratorManager; }; } diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index e63c41173df6..aae610f0e3dd 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1246,12 +1246,13 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: if (! xHAccess.is ()) return; - const sal_Int32 c = aEvent.Changes.getLength(); + css::util::ChangesEvent aReceivedEvents( aEvent ); + const sal_Int32 c = aReceivedEvents.Changes.getLength(); sal_Int32 i = 0; for (i=0; i']/Key['']/Command[]" will // be interesting for use. Sometimes short path values are given also by the broadcaster ... but they must be ignored :-) diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 193bd63b5ad5..607efce4d4d6 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -776,26 +776,29 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u css::lang::EventObject aEvent( xThis ); m_aListenerContainer.disposeAndClear( aEvent ); - { - ResetableGuard aGuard( m_aLock ); - try - { - if ( m_xModuleImageManager.is() ) - m_xModuleImageManager->dispose(); - } - catch ( Exception& ) - { - } + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ + ResetableGuard aGuard( m_aLock ); + Reference< XComponent > xModuleImageManager( m_xModuleImageManager ); + m_xModuleImageManager.clear(); + m_xModuleAcceleratorManager.clear(); + m_aUIElements[LAYER_USERDEFINED].clear(); + m_aUIElements[LAYER_DEFAULT].clear(); + m_xDefaultConfigStorage.clear(); + m_xUserConfigStorage.clear(); + m_xUserRootCommit.clear(); + m_bConfigRead = false; + m_bModified = false; + m_bDisposed = true; + aGuard.unlock(); + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - m_xModuleImageManager.clear(); - m_aUIElements[LAYER_USERDEFINED].clear(); - m_aUIElements[LAYER_DEFAULT].clear(); - m_xDefaultConfigStorage.clear(); - m_xUserConfigStorage.clear(); - m_xUserRootCommit.clear(); - m_bConfigRead = false; - m_bModified = false; - m_bDisposed = true; + try + { + if ( xModuleImageManager.is() ) + xModuleImageManager->dispose(); + } + catch ( Exception& ) + { } } @@ -1370,30 +1373,35 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager() } return Reference< XInterface >( m_xModuleImageManager, UNO_QUERY ); - -// return Reference< XInterface >(); } Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException) { ResetableGuard aGuard( m_aLock ); + + if ( m_bDisposed ) + throw DisposedException(); + Reference< XMultiServiceFactory > xSMGR = m_xServiceManager; - ::rtl::OUString aModule = /*m_aModuleShortName*/m_aModuleIdentifier; - aGuard.unlock(); + ::rtl::OUString aModule = m_aModuleIdentifier; - Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION); - Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW); + if ( !m_xModuleAcceleratorManager.is() ) + { + Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION); + Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW); - PropertyValue aProp; - aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier"); - aProp.Value <<= aModule; + PropertyValue aProp; + aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier"); + aProp.Value <<= aModule; - Sequence< Any > lArgs(1); - lArgs[0] <<= aProp; + Sequence< Any > lArgs(1); + lArgs[0] <<= aProp; - xInit->initialize(lArgs); + xInit->initialize(lArgs); + m_xModuleAcceleratorManager = Reference< XInterface >( xManager, UNO_QUERY ); + } - return xManager; + return m_xModuleAcceleratorManager; } Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException) -- cgit From 6916ec405e20a62bccc5a11f515c932e7e5cd968 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 18 Aug 2010 13:50:02 +0200 Subject: cws sw33bf08: #i113867# removing en-US dictionaries from Ukrainian language pack --- setup_native/source/packinfo/spellchecker_selection.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index 8d5cb0fc83b8..1ca0f231bfdc 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -44,6 +44,7 @@ sr = "sr,en-US" sh = "sr,en-US" sw = "sw,en-US" th = "th,en-US" +uk = "ru" vi = "vi,en-US,fr" zh-TW = "EMPTY,en-US" zh-CN = "EMPTY,en-US" -- cgit From cb9da85e07300b35a99fd6fe4b3d702f987d1582 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 18 Aug 2010 13:53:28 +0200 Subject: cws sw33bf08: #i113867# removing en-US dictionaries from Ukrainian language pack --- setup_native/source/packinfo/spellchecker_selection.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index 1ca0f231bfdc..5853a97b141e 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -44,7 +44,7 @@ sr = "sr,en-US" sh = "sr,en-US" sw = "sw,en-US" th = "th,en-US" -uk = "ru" +uk = "ru,en-US" vi = "vi,en-US,fr" zh-TW = "EMPTY,en-US" zh-CN = "EMPTY,en-US" -- cgit From 967756108a94191a992d38cc4866a5f2971f56f5 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 18 Aug 2010 16:43:38 +0200 Subject: fwk153: #i113674# replace backing component if there is one --- framework/inc/classes/framelistanalyzer.hxx | 25 +++++++++---------------- framework/prj/d.lst | 1 + framework/util/makefile.mk | 2 +- sfx2/source/view/viewfrm.cxx | 21 ++++++++++++++++++++- 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/framework/inc/classes/framelistanalyzer.hxx b/framework/inc/classes/framelistanalyzer.hxx index 518870b354f1..4ab3c4532cdc 100644 --- a/framework/inc/classes/framelistanalyzer.hxx +++ b/framework/inc/classes/framelistanalyzer.hxx @@ -28,13 +28,6 @@ #ifndef __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_ #define __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_ -//_______________________________________________ -// my own includes - -#include -#include -#include - //_______________________________________________ // interface includes #include @@ -88,10 +81,10 @@ class FrameListAnalyzer public: /** provides access to the frame container, which should be analyzed. */ - const css::uno::Reference< css::frame::XFramesSupplier >& m_xSupplier; + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& m_xSupplier; /** hold the reference frame, which is used e.g. to detect other frames with the same model. */ - const css::uno::Reference< css::frame::XFrame >& m_xReferenceFrame; + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& m_xReferenceFrame; /** enable/disable some special analyzing steps. see impl_analyze() for further informations. */ @@ -100,19 +93,19 @@ class FrameListAnalyzer /** contains all frames, which uses the same model like the reference frame. Will be filled only if m_eDetectMode has set the flag E_MODEL. The reference frame is never part of this list! */ - css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lModelFrames; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lModelFrames; /** contains all frames, which does not contain the same model like the reference frame. Filling of it can't be supressed by m_eDetectMode. The reference frame is never part of this list! All frames inside this list are visible ones. */ - css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lOtherVisibleFrames; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherVisibleFrames; /** contains all frames, which does not contain the same model like the reference frame. Filling of it can't be supressed by m_eDetectMode. The reference frame is never part of this list! All frames inside this list are hidden ones. */ - css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lOtherHiddenFrames; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherHiddenFrames; /** points to the help frame. Will be set only, if any other frame (means different from the reference frame) @@ -137,7 +130,7 @@ class FrameListAnalyzer Analyzing of the help frame ignores the visible state of any frame. But note: a hidden help frame indicates a wrong state! */ - css::uno::Reference< css::frame::XFrame > m_xHelp; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xHelp; /** points to the frame, which contains the backing component. Will be set only, if any other frame (means different from the reference frame) @@ -163,7 +156,7 @@ class FrameListAnalyzer Analyzing of the help frame ignores the visible state of any frame. But note: a hidden backing mode frame indicates a wrong state! */ - css::uno::Reference< css::frame::XFrame > m_xBackingComponent; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBackingComponent; /** is set to true only, if the reference frame is a hidden one. This value is undefined if m_eDetectMode doesn't have set the flag E_HIDDEN! */ @@ -200,8 +193,8 @@ class FrameListAnalyzer analyze steps. Note: Some member values will be undefined, if an analyze step will be disabled. */ - FrameListAnalyzer( const css::uno::Reference< css::frame::XFramesSupplier >& xSupplier , - const css::uno::Reference< css::frame::XFrame >& xReferenceFrame , + FrameListAnalyzer( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& xSupplier , + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xReferenceFrame , sal_uInt32 eDetectMode ); virtual ~FrameListAnalyzer(); diff --git a/framework/prj/d.lst b/framework/prj/d.lst index 7f260f07cf65..fe6077f57bc8 100644 --- a/framework/prj/d.lst +++ b/framework/prj/d.lst @@ -42,6 +42,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar ..\inc\classes\menuextensionsupplier.hxx %_DEST%\inc%_EXT%\framework\menuextensionsupplier.hxx ..\inc\interaction\preventduplicateinteraction.hxx %_DEST%\inc%_EXT%\framework\preventduplicateinteraction.hxx ..\inc\helper\titlehelper.hxx %_DEST%\inc%_EXT%\framework\titlehelper.hxx +..\inc\classes\framelistanalyzer.hxx %_DEST%\inc%_EXT%\framework\framelistanalyzer.hxx ..\uiconfig\startmodule\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\menubar\*.xml ..\uiconfig\startmodule\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\toolbar\*.xml diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 91532cda76e2..edc5f67ce60a 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -50,7 +50,6 @@ LIB1OBJFILES= \ $(SLO)$/protocolhandlercache.obj \ $(SLO)$/networkdomain.obj \ $(SLO)$/configaccess.obj \ - $(SLO)$/framelistanalyzer.obj \ $(SLO)$/shareablemutex.obj \ $(SLO)$/itemcontainer.obj \ $(SLO)$/rootitemcontainer.obj \ @@ -99,6 +98,7 @@ LIB2OBJFILES= \ $(SLO)$/configimporter.obj \ $(SLO)$/menuextensionsupplier.obj \ $(SLO)$/preventduplicateinteraction.obj \ + $(SLO)$/framelistanalyzer.obj \ $(SLO)$/titlehelper.obj # --- import classes library --------------------------------------------------- diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ed924623c700..a7f5c9d16541 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -96,6 +96,7 @@ #include #include #include +#include #include @@ -2092,7 +2093,25 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell { ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); - xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + + if ( !i_bHidden ) + { + try + { + // if there is a backing component, use it + Reference< XFramesSupplier > xTaskSupplier( xDesktop , css::uno::UNO_QUERY_THROW ); + ::framework::FrameListAnalyzer aAnalyzer( xTaskSupplier, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT ); + + if ( aAnalyzer.m_xBackingComponent.is() ) + xFrame = aAnalyzer.m_xBackingComponent; + } + catch( uno::Exception& ) + {} + } + + if ( !xFrame.is() ) + xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + bOwnFrame = true; } -- cgit From f1bcc220319d9d1f2652083f3f5389eb77748081 Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Wed, 18 Aug 2010 16:52:22 +0200 Subject: calc58: #i113820# make TEXT treat string results and inline strings identical to referenced cell text --- sc/source/core/tool/interpr1.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 35c63f52a92b..2e6ce932b466 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7108,10 +7108,6 @@ void ScInterpreter::ScText() case svDouble: fVal = PopDouble(); break; - case svString: - aStr = PopString(); - bString = true; - break; default: { FormulaTokenRef xTok( PopToken()); -- cgit From 7c84033b76922b3c843314354f8dc1bab364ed7d Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 18 Aug 2010 17:59:09 +0200 Subject: #i113857# disable right mouse button to trigger a range selection --- vcl/source/window/seleng.cxx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx index d4ee01c26d61..322b2937b5c9 100644 --- a/vcl/source/window/seleng.cxx +++ b/vcl/source/window/seleng.cxx @@ -218,8 +218,15 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) Point aPos = rMEvt.GetPosPixel(); aLastMove = rMEvt; - pWin->CaptureMouse(); - nFlags |= SELENG_IN_SEL; + if( !rMEvt.IsRight() ) + { + pWin->CaptureMouse(); + nFlags |= SELENG_IN_SEL; + } + else + { + nModifier = 0; + } switch ( nModifier ) { @@ -327,7 +334,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) |* *************************************************************************/ -BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& /* rMEvt */ ) +BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) { aWTimer.Stop(); //DbgOut("Up"); @@ -336,7 +343,11 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& /* rMEvt */ ) nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL); return FALSE; } - pWin->ReleaseMouse(); + + if( !rMEvt.IsRight() ) + { + pWin->ReleaseMouse(); + } if( (nFlags & SELENG_WAIT_UPEVT) && !(nFlags & SELENG_CMDEVT) && eSelMode != SINGLE_SELECTION) -- cgit From 20cd7f058892c76c9d794c6ff0a776ced306b34d Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Wed, 18 Aug 2010 18:56:10 +0200 Subject: calc58: #i113739# make N return 0 for all strings again --- sc/source/core/tool/interpr1.cxx | 23 +++++++---------------- sc/source/core/tool/interpr4.cxx | 6 ++++++ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 2e6ce932b466..1e4c02967152 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2481,22 +2481,13 @@ void ScInterpreter::ScN() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScN" ); USHORT nErr = nGlobalError; nGlobalError = 0; - double fVal; - if ( GetRawStackType() == svString ) - { - fVal = 0.0; - Pop(); - } - else - { - // Temporarily override the ConvertStringToValue() error for - // GetCellValue() / GetCellValueOrZero() - USHORT nSErr = mnStringNoValueError; - mnStringNoValueError = errCellNoValue; - fVal = GetDouble(); - mnStringNoValueError = nSErr; - } - if ( nGlobalError == NOTAVAILABLE || nGlobalError == errIllegalArgument ) + // Temporarily override the ConvertStringToValue() error for + // GetCellValue() / GetCellValueOrZero() + USHORT nSErr = mnStringNoValueError; + mnStringNoValueError = errCellNoValue; + double fVal = GetDouble(); + mnStringNoValueError = nSErr; + if ( nGlobalError == NOTAVAILABLE || nGlobalError == errCellNoValue ) nGlobalError = 0; // N(#NA) and N("text") are ok if ( !nGlobalError && nErr != NOTAVAILABLE ) nGlobalError = nErr; diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 5c326001ff02..dccb2355b3d5 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -231,6 +231,12 @@ double ScInterpreter::ConvertStringToValue( const String& rStr ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ConvertStringToValue" ); double fValue = 0.0; + if (mnStringNoValueError == errCellNoValue) + { + // Requested that all strings result in 0, error handled by caller. + SetError( mnStringNoValueError); + return fValue; + } ::rtl::OUString aStr( rStr); rtl_math_ConversionStatus eStatus; sal_Int32 nParseEnd; -- cgit From d5fb1d1383d2a5e0eaf6304180ccd3a60ac3228d Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Thu, 19 Aug 2010 14:04:41 +0200 Subject: #i1138511# allow symbol-aliasing in adobe single-byte encodings --- sal/textenc/convertadobe.tab | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sal/textenc/convertadobe.tab b/sal/textenc/convertadobe.tab index b657256d7bfe..31ec3305933b 100644 --- a/sal/textenc/convertadobe.tab +++ b/sal/textenc/convertadobe.tab @@ -185,6 +185,7 @@ rtl::textenc::BmpUnicodeToSingleByteRange const unicodeToAdobeSymbolEncoding[] { 0x23D0, 0x23D0 - 0x23D0, 0xBE }, { 0x25CA, 0x25CA - 0x25CA, 0xE0 }, { 0x2660, 0x2660 - 0x2660, 0xAA }, { 0x2663, 0x2663 - 0x2663, 0xA7 }, { 0x2665, 0x2665 - 0x2665, 0xA9 }, { 0x2666, 0x2666 - 0x2666, 0xA8 }, + { 0xF000, 0xF0FF - 0xF000, 0x00 }, // symbol aliasing U+F0XX->S+00XX { 0xF6D9, 0xF6D9 - 0xF6D9, 0xD3 }, { 0xF6DA, 0xF6DA - 0xF6DA, 0xD2 }, { 0xF6DB, 0xF6DB - 0xF6DB, 0xD4 }, { 0xF8E5, 0xF8E5 - 0xF8E5, 0x60 }, { 0xF8E8, 0xF8EA - 0xF8E8, 0xE2 } }; @@ -251,6 +252,7 @@ rtl::textenc::BmpUnicodeToSingleByteRange const unicodeToAdobeDingbatsEncoding[] { 0x2756, 0x2756 - 0x2756, 0x76 }, { 0x2758, 0x275E - 0x2758, 0x78 }, { 0x2761, 0x2767 - 0x2761, 0xA1 }, { 0x2776, 0x2794 - 0x2776, 0xB6 }, { 0x2798, 0x27AF - 0x2798, 0xD8 }, { 0x27B1, 0x27BE - 0x27B1, 0xF1 }, + { 0xF000, 0xF0FF - 0xF000, 0x00 }, // symbol aliasing U+F0XX->S+00XX { 0xF8D7, 0xF8E4 - 0xF8D7, 0x80 }}; rtl::textenc::BmpUnicodeToSingleByteConverterData const -- cgit From e050b9bc7c26f58d9fcd4c261909249e0522f9df Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Thu, 19 Aug 2010 17:12:37 +0200 Subject: calc58: #i113879# add ScMatrix::CloneIfConst() and regard only temporary matrices created by the interpreter as mutable --- sc/inc/scmatrix.hxx | 11 ++++++++++- sc/source/core/tool/interpr4.cxx | 7 ++++++- sc/source/core/tool/interpr5.cxx | 19 ++++++++++++------- sc/source/core/tool/scmatrix.cxx | 5 +++++ 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index 9857d675b7ab..b788672aa715 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -99,6 +99,7 @@ class SC_DLLPUBLIC ScMatrix mutable ULONG nRefCnt; // reference count SCSIZE nColCount; SCSIZE nRowCount; + bool mbCloneIfConst; // Whether the matrix is cloned with a CloneIfConst() call. void ResetIsString(); void DeleteIsString(); @@ -171,11 +172,19 @@ public: /** If nC*nR results in more than GetElementsMax() entries, a 1x1 matrix is created instead and a double error value (errStackOverflow) is set. Compare nC and nR with a GetDimensions() call to check. */ - ScMatrix( SCSIZE nC, SCSIZE nR) : nRefCnt(0) { CreateMatrix( nC, nR); } + ScMatrix( SCSIZE nC, SCSIZE nR) : nRefCnt(0), mbCloneIfConst(true) { CreateMatrix( nC, nR); } /** Clone the matrix. */ ScMatrix* Clone() const; + /** Clone the matrix if mbCloneIfConst (immutable) is set, otherwise + return _this_ matrix, to be assigned to a ScMatrixRef. */ + ScMatrix* CloneIfConst(); + + /** Set the matrix to (im)mutable for CloneIfConst(), only the interpreter + should do this and know the consequences. */ + inline void SetImmutable( bool bVal ) { mbCloneIfConst = bVal; } + /** * Resize the matrix to specified new dimension. Note that this operation * clears all stored values. diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index dccb2355b3d5..47cde7186067 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3970,5 +3970,10 @@ StackVar ScInterpreter::Interpret() while( maxsp-- ) (*p++)->DecRef(); - return xResult->GetType(); + StackVar eType = xResult->GetType(); + if (eType == svMatrix) + // Results are immutable in case they would be reused as input for new + // interpreters. + static_cast(xResult.operator->())->GetMatrix()->SetImmutable( true); + return eType; } diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index ba4322a3281a..73794cf15b2d 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -310,6 +310,9 @@ ScMatrixRef ScInterpreter::GetNewMat(SCSIZE nC, SCSIZE nR) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetNewMat" ); ScMatrix* pMat = new ScMatrix( nC, nR); pMat->SetErrorInterpreter( this); + // A temporary matrix is mutable and ScMatrix::CloneIfConst() returns the + // very matrix. + pMat->SetImmutable( false); SCSIZE nCols, nRows; pMat->GetDimensions( nCols, nRows); if ( nCols != nC || nRows != nR ) @@ -2069,23 +2072,25 @@ bool ScInterpreter::CheckMatrix(BOOL _bLOG,BOOL _bTrendGrowth,BYTE& nCase,SCSIZE { PushIllegalArgument(); return false; - } // if (!pMatY->IsValue(i)) - } // for ( SCSIZE i = 0; i < nCountY; i++ ) + } + } + if ( _bLOG ) { + ScMatrixRef pNewY = pMatY->CloneIfConst(); for (SCSIZE nElem = 0; nElem < nCountY; nElem++) { - const double fVal = pMatY->GetDouble(nElem); + const double fVal = pNewY->GetDouble(nElem); if (fVal <= 0.0) { PushIllegalArgument(); return false; } else - pMatY->PutDouble(log(fVal), nElem); - } // for (nElem = 0; nElem < nCountY; nElem++) - } // if ( _bRKP ) - + pNewY->PutDouble(log(fVal), nElem); + } + pMatY = pNewY; + } if (pMatX) { diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index fbb859b64ebf..2ecc20f53405 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -81,6 +81,11 @@ ScMatrix* ScMatrix::Clone() const return pScMat; } +ScMatrix* ScMatrix::CloneIfConst() +{ + return (mbCloneIfConst || IsEternalRef()) ? Clone() : this; +} + void ScMatrix::Resize( SCSIZE nC, SCSIZE nR) { Clear(); -- cgit From a37ba38fa326b3541fe20287d98a8d4fc672cb5e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 19 Aug 2010 17:46:08 +0200 Subject: fs33a: #i113988# properly retrieve standard images --- svtools/source/graphic/provider.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index fbf95406a63a..f1674dcd7d4a 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -231,19 +231,19 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( co if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:standardimage" ) ) ) { rtl::OUString sImageName( rResourceURL.copy( nIndex ) ); - if ( sImageName.compareToAscii( "info" ) ) + if ( sImageName.equalsAscii( "info" ) ) { xRet = InfoBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "warning" ) ) + else if ( sImageName.equalsAscii( "warning" ) ) { xRet = WarningBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "error" ) ) + else if ( sImageName.equalsAscii( "error" ) ) { xRet = ErrorBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "query" ) ) + else if ( sImageName.equalsAscii( "query" ) ) { xRet = QueryBox::GetStandardImage().GetXGraphic(); } -- cgit From 9c2ea353ead0291d5a298b88c3bae597caafe2f5 Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 20 Aug 2010 13:03:55 +0200 Subject: calc58: #i113946# undo does not work for deleting shapes --- chart2/source/controller/main/ChartController_Tools.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index ffe752f43a7a..779e3c32f1e7 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -827,16 +827,14 @@ bool ChartController::executeDispatch_Delete() else { //remove additional shape - uno::Reference< drawing::XShape > xShape( m_aSelection.getSelectedAdditionalShape() ); - if( xShape.is() ) + impl_ClearSelection(); { - impl_ClearSelection(); + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + if ( m_pDrawViewWrapper ) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex()); - if( m_pDrawViewWrapper ) - m_pDrawViewWrapper->UnmarkAll(); + m_pDrawViewWrapper->DeleteMarked(); + bReturn = true; } - bReturn = DrawModelWrapper::removeShape( xShape ); } } return bReturn; -- cgit From 3417318f27cdc15af6bdcb3ea5b7c6bb554352ab Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Fri, 20 Aug 2010 13:12:52 +0200 Subject: #i10000# supress bytecode generation --- l10ntools/scripts/xtxex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index 28529506e3a2..52baab0693d0 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -32,8 +32,8 @@ exit 1 fi if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else - exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" fi -- cgit From fffe7fed17cdbba6d3be3ee35b21a1456dc83159 Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Fri, 20 Aug 2010 13:13:16 +0200 Subject: #i10000# supress bytecode generation --- l10ntools/scripts/xhtex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index 659cd06e16d4..ad18d8c94eab 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -32,8 +32,8 @@ exit 1 fi if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else - exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" + exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" fi -- cgit From b07c2a4cb2b8060addbf0326970afedf62f7ecc9 Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 20 Aug 2010 13:23:46 +0200 Subject: calc58: #i113948# office crashes after resizing chart --- chart2/source/model/main/ChartModel.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 950169395c95..5a30d97118c5 100755 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -1043,6 +1043,7 @@ void SAL_CALL ChartModel::setVisualAreaSize( ::sal_Int64 nAspect, const awt::Siz { if( nAspect == embed::Aspects::MSOLE_CONTENT ) { + ControllerLockGuard aLockGuard( this ); bool bChanged = (m_aVisualAreaSize.Width != aSize.Width || m_aVisualAreaSize.Height != aSize.Height); -- cgit From 46bd96bc7c2f8fac93546f8aa905023a9a59f8ca Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 20 Aug 2010 16:30:57 +0200 Subject: ext004: just copy en-US file without modifications --- l10ntools/scripts/tool/xtxex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/xtxex.py b/l10ntools/scripts/tool/xtxex.py index 2c5f132530a6..96912754b7df 100644 --- a/l10ntools/scripts/tool/xtxex.py +++ b/l10ntools/scripts/tool/xtxex.py @@ -39,7 +39,8 @@ class Xtxex(AbstractL10nTool): def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): # Special handling for en-US files if lang == "en-US": - mod_outputfilename = outputfilename.replace("_en-US",'') + mod_outputfilename = outputfilename + # mod here if needed self.copy_file(inputfilename, mod_outputfilename) return # merge usual lang -- cgit From fe18bcac5f611b1bb0f3cf69abb2357a48d19106 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 20 Aug 2010 19:47:14 +0200 Subject: ooo33gsl07: #i113898# catch a NULL ptr --- vcl/unx/gtk/a11y/atkutil.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 13492f3d4a5c..51297109ca43 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -92,7 +92,7 @@ atk_wrapper_focus_idle_handler (gpointer data) // also emit state-changed:focused event under the same condition. { AtkObjectWrapper* wrapper_obj = ATK_OBJECT_WRAPPER (atk_obj); - if( !wrapper_obj->mpText && wrapper_obj->mpContext ) + if( wrapper_obj && !wrapper_obj->mpText && wrapper_obj->mpContext ) { uno::Any any = wrapper_obj->mpContext->queryInterface( accessibility::XAccessibleText::static_type(NULL) ); if ( typelib_TypeClass_INTERFACE == any.pType->eTypeClass && -- cgit From be84c56ceffdf5e1bdade35611b15f8e76379818 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 23 Aug 2010 12:46:11 +0200 Subject: fwk154: #i114014# Fix problem with check box 'Remember Password' in login dialog --- uui/source/iahndl-authentication.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 uui/source/iahndl-authentication.cxx diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx old mode 100755 new mode 100644 index 73fa61f31ff4..1e9a4e6837d3 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -270,7 +270,7 @@ handleAuthenticationRequest_( aInfo.SetCanRememberPassword( ePreferredRememberMode != eAlternateRememberMode); aInfo.SetIsRememberPassword( - eDefaultRememberMode != ucb::RememberAuthentication_NO); + ePreferredRememberMode != eDefaultRememberMode); aInfo.SetIsRememberPersistent( ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT); -- cgit From d1102d84dad39c9b9009c59fa27e5d3bf30a4804 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 23 Aug 2010 13:43:42 +0200 Subject: fwk154: #i114014# Use correct compare statement --- uui/source/iahndl-authentication.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 1e9a4e6837d3..95c2b45749ac 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -270,7 +270,7 @@ handleAuthenticationRequest_( aInfo.SetCanRememberPassword( ePreferredRememberMode != eAlternateRememberMode); aInfo.SetIsRememberPassword( - ePreferredRememberMode != eDefaultRememberMode); + ePreferredRememberMode == eDefaultRememberMode); aInfo.SetIsRememberPersistent( ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT); -- cgit From 49c3b9399521b7dd16ccba87d3bdfed1418a842b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 23 Aug 2010 14:38:35 +0200 Subject: ooo33gsl07: #i110881# workaround compiz (mwm hints should have no effect whatsoever on fullscreen) --- vcl/unx/source/app/wmadaptor.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index 1a116fcbe8d6..aa2e4c84ef24 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -2180,6 +2180,15 @@ void NetWMAdaptor::showFullScreen( X11SalFrame* pFrame, bool bFullScreen ) const if( m_aWMAtoms[ NET_WM_STATE_FULLSCREEN ] ) { pFrame->mbFullScreen = bFullScreen; + if( bFullScreen ) + { + if( m_aWMAtoms[ MOTIF_WM_HINTS ] ) + { + XDeleteProperty( m_pDisplay, + pFrame->GetShellWindow(), + m_aWMAtoms[ MOTIF_WM_HINTS ] ); + } + } if( pFrame->bMapped_ ) { // window already mapped, send WM a message -- cgit From 45e7a1e3f6b01c1fce6056f80e4642a452a42dfd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 23 Aug 2010 15:18:37 +0200 Subject: fs33a: expose the WB_HIDESELECTION but of the tree control at its UNO API --- svtools/inc/svtools/svtreebx.hxx | 1 + svtools/source/contnr/svtreebx.cxx | 9 +++++++++ svtools/source/uno/treecontrolpeer.cxx | 18 ++++++++++++++++++ toolkit/source/controls/tree/treecontrol.cxx | 1 + 4 files changed, 29 insertions(+) diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx index a600b91db1c4..787e0956888f 100644 --- a/svtools/inc/svtools/svtreebx.hxx +++ b/svtools/inc/svtools/svtreebx.hxx @@ -156,6 +156,7 @@ protected: virtual void CursorMoved( SvLBoxEntry* pNewCursor ); virtual void PreparePaint( SvLBoxEntry* ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); + virtual void StateChanged( StateChangedType nStateChange ); void InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground); BOOL IsCellFocusEnabled() const; diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index b11a3f12ddf3..3b1430e0df77 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -2516,6 +2516,15 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) Control::DataChanged( rDCEvt ); } +void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) +{ + SvLBox::StateChanged( i_nStateChange ); + if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 ) + { + SetWindowBits( GetStyle() ); + } +} + void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 7fb1a007960f..5c1f4925783a 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1322,6 +1322,21 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An switch( GetPropertyId( PropertyName ) ) { + case BASEPROPERTY_HIDEINACTIVESELECTION: + { + sal_Bool bEnabled = sal_False; + if ( aValue >>= bEnabled ) + { + WinBits nStyle = rTree.GetStyle(); + if ( bEnabled ) + nStyle |= WB_HIDESELECTION; + else + nStyle &= ~WB_HIDESELECTION; + rTree.SetStyle( nStyle ); + } + } + break; + case BASEPROPERTY_TREE_SELECTIONTYPE: { SelectionType eSelectionType; @@ -1412,6 +1427,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow(); switch(nPropId) { + case BASEPROPERTY_HIDEINACTIVESELECTION: + return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); + case BASEPROPERTY_TREE_SELECTIONTYPE: { SelectionType eSelectionType; diff --git a/toolkit/source/controls/tree/treecontrol.cxx b/toolkit/source/controls/tree/treecontrol.cxx index 8606792fdf2f..d56ca82bb845 100644 --- a/toolkit/source/controls/tree/treecontrol.cxx +++ b/toolkit/source/controls/tree/treecontrol.cxx @@ -76,6 +76,7 @@ UnoTreeModel::UnoTreeModel() ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSROOTHANDLES ); ImplRegisterProperty( BASEPROPERTY_TREE_ROWHEIGHT ); ImplRegisterProperty( BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING ); + ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION ); } UnoTreeModel::UnoTreeModel( const UnoTreeModel& rModel ) -- cgit From 4cc5448ed82f13bb107695b65f39589df1e46cb9 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 23 Aug 2010 16:32:34 +0200 Subject: ooo33gsl07: #i113253# use paper bin from user setup when appropriate --- vcl/source/gdi/print3.cxx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 375c570f1a16..51f33ed17f6c 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -173,6 +173,7 @@ public: // if set, pages are centered and trimmed onto the fixed page Size maFixedPageSize; sal_Int32 mnDefaultPaperBin; + sal_Int32 mnFixedPaperBin; ImplPrinterControllerData() : mbFirstPage( sal_True ), @@ -180,7 +181,8 @@ public: mbReversePageOrder( sal_False ), meJobState( view::PrintableState_JOB_STARTED ), mpProgress( NULL ), - mnDefaultPaperBin( -1 ) + mnDefaultPaperBin( -1 ), + mnFixedPaperBin( -1 ) {} ~ImplPrinterControllerData() { delete mpProgress; } @@ -726,6 +728,7 @@ void PrinterController::setPrinter( const boost::shared_ptr& i_rPrinter setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ), makeAny( rtl::OUString( i_rPrinter->GetName() ) ) ); mpImplData->mnDefaultPaperBin = mpImplData->mpPrinter->GetPaperBin(); + mpImplData->mnFixedPaperBin = -1; } bool PrinterController::setupPrinter( Window* i_pParent ) @@ -733,15 +736,20 @@ bool PrinterController::setupPrinter( Window* i_pParent ) bool bRet = false; if( mpImplData->mpPrinter.get() ) { + // get old data Size aPaperSize( mpImplData->mpPrinter->PixelToLogic( mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); + USHORT nPaperBin = mpImplData->mpPrinter->GetPaperBin(); + + // call driver setup bRet = mpImplData->mpPrinter->Setup( i_pParent ); if( bRet ) { - // was the papersize overridden ? if so we need to take action + // was papersize or bin overridden ? if so we need to take action Size aNewPaperSize( mpImplData->mpPrinter->PixelToLogic( mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); - if( aNewPaperSize != aPaperSize ) + USHORT nNewPaperBin = mpImplData->mpPrinter->GetPaperBin(); + if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin ) { mpImplData->maFixedPageSize = aNewPaperSize; mpImplData->maPageCache.invalidate(); @@ -750,6 +758,7 @@ bool PrinterController::setupPrinter( Window* i_pParent ) aOverrideSize.Height = aNewPaperSize.Height(); setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OverridePageSize" ) ), makeAny( aOverrideSize ) ); + mpImplData->mnFixedPaperBin = nNewPaperBin; } } } @@ -1147,8 +1156,13 @@ void PrinterController::printFilteredPage( int i_nPage ) mpImplData->mpPrinter->SetMapMode( MAP_100TH_MM ); // aPageSize was filtered through mpImplData->getRealPaperSize already by getFilteredPageFile() mpImplData->mpPrinter->SetPaperSizeUser( aPageSize.aSize, ! mpImplData->isFixedPageSize() ); + if( mpImplData->mnFixedPaperBin != -1 && + mpImplData->mpPrinter->GetPaperBin() != mpImplData->mnFixedPaperBin ) + { + mpImplData->mpPrinter->SetPaperBin( mpImplData->mnFixedPaperBin ); + } - // if full paper are is meant, move the output to accomodate for pageoffset + // if full paper is meant to be used, move the output to accomodate for pageoffset if( aPageSize.bFullPaper ) { Point aPageOffset( mpImplData->mpPrinter->GetPageOffset() ); -- cgit From 7fab09514c2975d9d936c840889e3dd2938bccad Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 24 Aug 2010 11:00:05 +0200 Subject: ooo33gsl07: #i114002# add missing license headers --- extensions/source/plugin/unx/npnapi.cxx | 31 +++++++++++++++++++++++++------ extensions/source/plugin/unx/nppapi.cxx | 31 +++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx index 003b4d0943a5..4a88577c5b71 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -1,10 +1,29 @@ /************************************************************************* - - Source Code Control System - Header - - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/npnapi.cxx,v 1.11 2008-01-14 14:53:25 ihi Exp $ - -*************************************************************************/ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx index 6dc1b7a30407..5e5c2dba1cf5 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -1,10 +1,29 @@ /************************************************************************* - - Source Code Control System - Header - - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/nppapi.cxx,v 1.7 2008-01-14 14:53:38 ihi Exp $ - -*************************************************************************/ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" -- cgit From 7d8e147c64eb45bbbe8ff7e1ca47d20b4a2499b1 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 24 Aug 2010 14:32:12 +0200 Subject: fs33a: #i113583# handle column names from complex descriptions --- .../source/core/dataaccess/documentdefinition.cxx | 17 ++-- dbaccess/source/core/inc/DatabaseDataProvider.hxx | 27 +++++- dbaccess/source/core/misc/DatabaseDataProvider.cxx | 95 ++++++++++++++++++++-- .../source/filter/xml/xmlExportDocumentHandler.cxx | 28 +++++-- 4 files changed, 143 insertions(+), 24 deletions(-) diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 4615c65fc042..7678cfbba62e 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -1569,16 +1569,7 @@ sal_Bool ODocumentDefinition::saveAs() Reference xNC(pDocuSave->getContent(),UNO_QUERY); if ( xNC.is() ) { - if ( m_pImpl->m_aProps.aTitle == pDocuSave->getName() ) - { - Reference xPersist(m_xEmbeddedObject,UNO_QUERY); - if ( xPersist.is() ) - { - xPersist->storeOwn(); - notifyDataSourceModified(); - } - } - else + if ( m_pImpl->m_aProps.aTitle != pDocuSave->getName() ) { try { @@ -1618,6 +1609,12 @@ sal_Bool ODocumentDefinition::saveAs() DBG_UNHANDLED_EXCEPTION(); } } + Reference xPersist(m_xEmbeddedObject,UNO_QUERY); + if ( xPersist.is() ) + { + xPersist->storeOwn(); + notifyDataSourceModified(); + } } } } diff --git a/dbaccess/source/core/inc/DatabaseDataProvider.hxx b/dbaccess/source/core/inc/DatabaseDataProvider.hxx index e1ceb4dde6f2..e75c980e2a93 100644 --- a/dbaccess/source/core/inc/DatabaseDataProvider.hxx +++ b/dbaccess/source/core/inc/DatabaseDataProvider.hxx @@ -33,11 +33,12 @@ #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp" #include "com/sun/star/chart2/XInternalDataProvider.hpp" +#include #include #include #include -#include "cppuhelper/compbase3.hxx" +#include "cppuhelper/compbase4.hxx" #include "cppuhelper/basemutex.hxx" #include "cppuhelper/propertysetmixin.hxx" #include @@ -52,8 +53,9 @@ namespace dbaccess { class DatabaseDataSource; -typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::chart2::data::XDatabaseDataProvider +typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::chart2::data::XDatabaseDataProvider , ::com::sun::star::container::XChild + , ::com::sun::star::chart::XComplexDescriptionAccess , ::com::sun::star::lang::XServiceInfo > TDatabaseDataProvider; class DatabaseDataProvider: private ::cppu::BaseMutex, @@ -187,6 +189,26 @@ private: // conatiner::XChild virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + // ____ XComplexDescriptionAccess ____ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setComplexRowDescriptions( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aRowDescriptions ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL getComplexColumnDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setComplexColumnDescriptions( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aColumnDescriptions ) throw (::com::sun::star::uno::RuntimeException); + + // ____ XChartDataArray (base of XComplexDescriptionAccess) ____ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw (::com::sun::star::uno::RuntimeException); + + // ____ XChartData (base of XChartDataArray) ____ + virtual void SAL_CALL addChartDataChangeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChartDataChangeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )throw (::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getNotANumber()throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isNotANumber(double nNumber )throw (::com::sun::star::uno::RuntimeException); private: DatabaseDataProvider(DatabaseDataProvider &); // not defined void operator =(DatabaseDataProvider &); // not defined @@ -229,6 +251,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet; ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > m_xInternal; + ::com::sun::star::uno::Reference< ::com::sun::star::chart::XComplexDescriptionAccess > m_xComplexDescriptionAccess; ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeXMLConversion> m_xRangeConversion; ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_xHandler; // the object doin' most of the work - an SDB-rowset diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index a83b04d93471..802e052297f9 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex { m_xInternal.set( m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart.InternalDataProvider")),m_xContext ), uno::UNO_QUERY ); m_xRangeConversion.set(m_xInternal,uno::UNO_QUERY); + m_xComplexDescriptionAccess.set(m_xInternal,uno::UNO_QUERY); osl_incrementInterlockedCount( &m_refCount ); { @@ -315,6 +317,75 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::cre } return xData; } + +uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL DatabaseDataProvider::getComplexRowDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getComplexRowDescriptions(); +} +void SAL_CALL DatabaseDataProvider::setComplexRowDescriptions( const uno::Sequence< uno::Sequence< ::rtl::OUString > >& aRowDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setComplexRowDescriptions(aRowDescriptions); +} +uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL DatabaseDataProvider::getComplexColumnDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getComplexColumnDescriptions(); +} +void SAL_CALL DatabaseDataProvider::setComplexColumnDescriptions( const uno::Sequence< uno::Sequence< rtl::OUString > >& aColumnDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setComplexColumnDescriptions(aColumnDescriptions); +} +// ____ XChartDataArray ____ +uno::Sequence< uno::Sequence< double > > SAL_CALL DatabaseDataProvider::getData() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getData(); +} + +void SAL_CALL DatabaseDataProvider::setData( const uno::Sequence< uno::Sequence< double > >& rDataInRows ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setData(rDataInRows); +} + +void SAL_CALL DatabaseDataProvider::setRowDescriptions( const uno::Sequence< rtl::OUString >& aRowDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setRowDescriptions(aRowDescriptions); +} + +void SAL_CALL DatabaseDataProvider::setColumnDescriptions( const uno::Sequence< rtl::OUString >& aColumnDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setColumnDescriptions(aColumnDescriptions); +} + +uno::Sequence< rtl::OUString > SAL_CALL DatabaseDataProvider::getRowDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getRowDescriptions(); +} + +uno::Sequence< rtl::OUString > SAL_CALL DatabaseDataProvider::getColumnDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getColumnDescriptions(); +} + +// ____ XChartData (base of XChartDataArray) ____ +void SAL_CALL DatabaseDataProvider::addChartDataChangeEventListener(const uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& x) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->addChartDataChangeEventListener(x); +} + +void SAL_CALL DatabaseDataProvider::removeChartDataChangeEventListener(const uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& x) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->removeChartDataChangeEventListener(x); +} + +double SAL_CALL DatabaseDataProvider::getNotANumber() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getNotANumber(); +} + +::sal_Bool SAL_CALL DatabaseDataProvider::isNotANumber( double nNumber ) throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->isNotANumber(nNumber); +} + // ----------------------------------------------------------------------------- uno::Reference< sheet::XRangeSelection > SAL_CALL DatabaseDataProvider::getRangeSelection() throw (uno::RuntimeException) @@ -616,26 +687,28 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat uno::Reference< sdbc::XResultSet> xRes(m_xRowSet,uno::UNO_QUERY_THROW); uno::Reference< sdbc::XRow> xRow(m_xRowSet,uno::UNO_QUERY_THROW); uno::Reference< sdbc::XResultSetMetaData> xResultSetMetaData = uno::Reference< sdbc::XResultSetMetaDataSupplier>(m_xRowSet,uno::UNO_QUERY)->getMetaData(); + uno::Reference< sdbc::XColumnLocate> xColumnLocate(m_xRowSet,uno::UNO_QUERY_THROW); ::std::vector aColumnTypes; uno::Sequence< uno::Any > aLabelArgs(1); const sal_Int32 nCount = aColumns.getLength(); if ( nCount ) aColumnTypes.push_back(xResultSetMetaData->getColumnType(1)); - for (sal_Int32 i = 1; i < nCount; ++i) - { - aColumnTypes.push_back(xResultSetMetaData->getColumnType(i+1)); - } // for (sal_Int32 i = 1; i < nCount; ++i) + ::std::vector< sal_Int32 > aColumnPositions; const ::rtl::OUString* pIter = aColumns.getConstArray(); const ::rtl::OUString* pEnd = pIter + aColumns.getLength(); for(sal_Int32 k = 0;pIter != pEnd;++pIter,++k) { + aColumnPositions.push_back(xColumnLocate->findColumn(*pIter)); uno::Reference< beans::XPropertySet> xColumn(xColumns->getByName(*pIter),uno::UNO_QUERY); + sal_Int32 nType = sdbc::DataType::VARCHAR; if ( xColumn.is() ) { m_aNumberFormats.insert( ::std::map< ::rtl::OUString,uno::Any>::value_type(::rtl::OUString::valueOf(k),xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT))); + xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType; } + aColumnTypes.push_back(nType); } ::std::vector< ::rtl::OUString > aRowLabels; @@ -649,9 +722,17 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat aValue.fill(1,aColumnTypes[0],xRow); aRowLabels.push_back(aValue.getString()); ::std::vector< double > aRow; - for (sal_Int32 j = _bHasCategories ? 2 : 1,i = 0; j <= nCount; ++j,++i) + ::std::vector< sal_Int32 >::iterator aColumnPosIter = aColumnPositions.begin(); + ::std::vector< sal_Int32 >::iterator aColumnPosEnd = aColumnPositions.end(); + sal_Int32 i = 0; + if ( _bHasCategories ) { - aValue.fill(j,aColumnTypes[j-1],xRow); + ++aColumnPosIter; + ++i; + } + for (; aColumnPosIter != aColumnPosEnd; ++aColumnPosIter,++i) + { + aValue.fill(*aColumnPosIter,aColumnTypes[i],xRow); if ( aValue.isNull() ) { double nValue; @@ -660,7 +741,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat } else aRow.push_back(aValue.getDouble()); - } // for (sal_Int32 j = 2,i = 0; j <= nCount; ++j,++i) + } aDataValues.push_back(aRow); } // while( xRes->next() && (!m_RowLimit || nRowCount < m_RowLimit) ) diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 3fa6b42e625b..1455dee74b3c 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -29,6 +29,7 @@ #include "xmlExportDocumentHandler.hxx" #include #include +#include #include #include #include @@ -339,11 +340,28 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any > // set ourself as delegator m_xProxy->setDelegator( *this ); - const ::rtl::OUString sCommand = m_xDatabaseDataProvider->getCommand(); - if ( sCommand.getLength() ) - m_aColumns = ::dbtools::getFieldNamesByCommandDescriptor(m_xDatabaseDataProvider->getActiveConnection() - ,m_xDatabaseDataProvider->getCommandType() - ,sCommand); + uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xDatabaseDataProvider,uno::UNO_QUERY); + if ( xDataProvider.is() ) + { + uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions(); + for(sal_Int32 i = 0 ; i < aColumnNames.getLength();++i) + { + if ( aColumnNames[i].getLength() ) + { + sal_Int32 nCount = m_aColumns.getLength(); + m_aColumns.realloc(nCount+1); + m_aColumns[nCount] = aColumnNames[i][0]; + } + } + } + else + { + const ::rtl::OUString sCommand = m_xDatabaseDataProvider->getCommand(); + if ( sCommand.getLength() ) + m_aColumns = ::dbtools::getFieldNamesByCommandDescriptor(m_xDatabaseDataProvider->getActiveConnection() + ,m_xDatabaseDataProvider->getCommandType() + ,sCommand); + } } // -------------------------------------------------------------------------------- uno::Any SAL_CALL ExportDocumentHandler::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException) -- cgit From b628a0a0158468eb04729e6ecd98008a7f814f1f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 24 Aug 2010 14:49:48 +0200 Subject: ooo33gsl07: #i110881# fix fullscreen mode with compiz and metacity ... again --- vcl/unx/gtk/window/gtkframe.cxx | 64 +++++++++++++++++++++++++++--------- vcl/unx/inc/plugins/gtk/gtkframe.hxx | 4 +++ 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index c6ff16f8395b..e8b55ebfa895 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1452,12 +1452,6 @@ void GtkSalFrame::setMinMaxSize() aHints |= GDK_HINT_MAX_SIZE; } } - if( m_bFullscreen ) - { - aGeo.max_width = m_aMaxSize.Width(); - aGeo.max_height = m_aMaxSize.Height(); - aHints |= GDK_HINT_MAX_SIZE; - } if( aHints ) gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow), NULL, @@ -1832,7 +1826,11 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) // workaround different legacy version window managers have different opinions about // _NET_WM_STATE_FULLSCREEN (Metacity <-> KWin) if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) + { + if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) ); + } if( bVisible ) Show( TRUE ); } @@ -1863,11 +1861,8 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) { if( bFullScreen ) { - if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) - { - if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) - gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); - } + if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE ); gtk_window_fullscreen( GTK_WINDOW(m_pWindow) ); moveToScreen( nScreen ); Size aScreenSize = pDisp->GetScreenSize( m_nScreen ); @@ -1879,11 +1874,8 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) else { gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) ); - if( getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) - { - if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) - gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE ); - } + if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) + gtk_window_set_resizable( GTK_WINDOW(m_pWindow), FALSE ); moveToScreen( nScreen ); } } @@ -2849,12 +2841,52 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f return FALSE; } +IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG ) +{ + Atom nStateAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE); + Atom nFSAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE_FULLSCREEN ); + if( nStateAtom && nFSAtom ) + { + /* #i110881# workaround a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8) + gtk_window_fullscreen can fail due to a race condition, request an additional status change + to fullscreen to be safe + */ + XEvent aEvent; + aEvent.type = ClientMessage; + aEvent.xclient.display = getDisplay()->GetDisplay(); + aEvent.xclient.window = GDK_WINDOW_XWINDOW(m_pWindow->window); + aEvent.xclient.message_type = nStateAtom; + aEvent.xclient.format = 32; + aEvent.xclient.data.l[0] = 1; + aEvent.xclient.data.l[1] = nFSAtom; + aEvent.xclient.data.l[2] = 0; + aEvent.xclient.data.l[3] = 0; + aEvent.xclient.data.l[4] = 0; + XSendEvent( getDisplay()->GetDisplay(), + getDisplay()->GetRootWindow( m_nScreen ), + False, + SubstructureNotifyMask | SubstructureRedirectMask, + &aEvent + ); + } + + return 0; +} + gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame ) { GtkSalFrame* pThis = (GtkSalFrame*)frame; GTK_YIELD_GRAB(); + if( pThis->m_bFullscreen ) + { + /* #i110881# workaorund a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8) + gtk_window_fullscreen can run into a race condition with the window's showstate + */ + Application::PostUserEvent( LINK( pThis, GtkSalFrame, ImplDelayedFullScreenHdl ) ); + } + bool bSetFocus = pThis->m_bSetFocusOnMap; pThis->m_bSetFocusOnMap = false; if( ImplGetSVData()->mbIsTestTool ) diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index 18dd476fc2c4..d47e5fb50fca 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -38,6 +38,8 @@ #include #include +#include "tools/link.hxx" + #include #include @@ -265,6 +267,8 @@ class GtkSalFrame : public SalFrame void setMinMaxSize(); void createNewWindow( XLIB_Window aParent, bool bXEmbed, int nScreen ); void askForXEmbedFocus( sal_Int32 nTimecode ); + + DECL_LINK( ImplDelayedFullScreenHdl, void* ); public: GtkSalFrame( SalFrame* pParent, ULONG nStyle ); GtkSalFrame( SystemParentData* pSysData ); -- cgit From bb76500478f77218336f4bc9a0d7c635c8d02bce Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 24 Aug 2010 15:00:36 +0200 Subject: fs33a: #i113744# check length of value --- dbaccess/source/core/api/KeySet.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index cee1887832d2..eadbffb52bfe 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -1667,7 +1667,7 @@ void OKeySet::impl_convertValue_throw(const ORowSetRow& _rInsertRow,const Select sal_Int32 nIndex = sValue.indexOf('.'); if ( nIndex != -1 ) { - aValue = sValue.copy(0,nIndex + (i_aMetaData.nScale > 0 ? i_aMetaData.nScale + 1 : 0)); + aValue = sValue.copy(0,::std::min(sValue.getLength(),nIndex + (i_aMetaData.nScale > 0 ? i_aMetaData.nScale + 1 : 0))); } } break; -- cgit From a23d2db4f0f3a75654ace6bb7f11f1803daeddad Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 24 Aug 2010 15:36:19 +0200 Subject: fs33a: #i113631# use m_sUpdateTableName --- dbaccess/source/core/api/KeySet.cxx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index eadbffb52bfe..992c748aad2e 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -198,16 +198,9 @@ void OKeySet::initColumns() m_pForeignColumnNames.reset( new SelectColumnsMetaData(bCase) ); } void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable - ,const Reference& i_xMeta + ,const Reference& /*i_xMeta*/ ,const Reference& i_xQueryColumns) { - ::rtl::OUString sCatalog,sSchema,sTable; - Reference xTableProp(i_aTable,UNO_QUERY); - Any aCatalog = xTableProp->getPropertyValue(PROPERTY_CATALOGNAME); - aCatalog >>= sCatalog; - xTableProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema; - xTableProp->getPropertyValue(PROPERTY_NAME) >>= sTable; - // first ask the database itself for the best columns which can be used Sequence< ::rtl::OUString> aBestColumnNames; Reference xKeyColumns = getPrimaryKeyColumns_throw(i_aTable); @@ -216,9 +209,8 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable const Reference xTblColSup(i_aTable,UNO_QUERY_THROW); const Reference xTblColumns = xTblColSup->getColumns(); - const ::rtl::OUString sComposedUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); - ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sComposedUpdateTableName,(*m_pKeyColumnNames),true); - ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sComposedUpdateTableName,(*m_pColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames),true); // locate parameter in select columns Reference xParaSup(m_xComposer,UNO_QUERY); @@ -230,7 +222,7 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable Reference xPara(xQueryParameters->getByIndex(i),UNO_QUERY_THROW); xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumns[i]; } - ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sComposedUpdateTableName,(*m_pParameterNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,m_sUpdateTableName,(*m_pParameterNames),true); SelectColumnsMetaData::const_iterator aPosIter = m_pKeyColumnNames->begin(); SelectColumnsMetaData::const_iterator aPosEnd = m_pKeyColumnNames->end(); -- cgit From f599db7be582daf55c0643a04198932e0470c44a Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 24 Aug 2010 17:53:12 +0200 Subject: fwk154: i114090: adapt listener code to reflect changes in config mgr, notification of change events --- ucb/source/core/ucb.cxx | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index c13ec9d367c8..4c4539080a13 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -647,28 +647,10 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& sal_Int32 nCount = Event.Changes.getLength(); if ( nCount ) { + uno::Reference< container::XHierarchicalNameAccess > xHierNameAccess; + Event.Base >>= xHierNameAccess; - uno::Reference< lang::XMultiServiceFactory > xConfigProv( - m_xSMgr->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationProvider" ) ), - uno::UNO_QUERY_THROW ); - - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - aProperty.Name - = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ); - aProperty.Value <<= Event.Base; - aArguments[ 0 ] <<= aProperty; - - uno::Reference< uno::XInterface > xInterface( - xConfigProv->createInstanceWithArguments( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationAccess" ) ), - aArguments ) ); - - uno::Reference< container::XHierarchicalNameAccess > - xHierNameAccess( xInterface, uno::UNO_QUERY_THROW ); + OSL_ASSERT( xHierNameAccess.is() ); const util::ElementChange* pElementChanges = Event.Changes.getConstArray(); -- cgit From 0859f99410f579d393f847e0fa6552cde6d9a35f Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 25 Aug 2010 14:08:27 +0200 Subject: sb130: #i113096# fixed TODO in configmgr::Broadcaster::send (to ease debugging) --- configmgr/source/broadcaster.cxx | 63 ++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx index bb77039dcc8f..ab59d333d6d3 100644 --- a/configmgr/source/broadcaster.cxx +++ b/configmgr/source/broadcaster.cxx @@ -32,13 +32,17 @@ #include "com/sun/star/beans/XPropertyChangeListener.hpp" #include "com/sun/star/container/XContainerListener.hpp" #include "com/sun/star/lang/DisposedException.hpp" +#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" #include "com/sun/star/lang/XEventListener.hpp" +#include "com/sun/star/uno/Any.hxx" #include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/XInterface.hpp" #include "com/sun/star/util/XChangesListener.hpp" +#include "cppuhelper/exc_hlp.hxx" #include "osl/diagnose.hxx" +#include "rtl/string.h" +#include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -50,6 +54,13 @@ namespace { namespace css = com::sun::star; +void appendMessage( + rtl::OUStringBuffer & buffer, css::uno::Exception const & exception) +{ + buffer.appendAscii(RTL_CONSTASCII_STRINGPARAM("; ")); + buffer.append(exception.Message); +} + } void Broadcaster::addDisposeNotification( @@ -108,14 +119,16 @@ void Broadcaster::addChangesNotification( } void Broadcaster::send() { - bool exception = false; + css::uno::Any exception; + rtl::OUStringBuffer messages; for (DisposeNotifications::iterator i(disposeNotifications_.begin()); i != disposeNotifications_.end(); ++i) { try { i->listener->disposing(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ContainerNotifications::iterator i( @@ -125,8 +138,9 @@ void Broadcaster::send() { try { i->listener->elementInserted(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ContainerNotifications::iterator i( @@ -136,8 +150,9 @@ void Broadcaster::send() { try { i->listener->elementRemoved(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ContainerNotifications::iterator i( @@ -147,8 +162,9 @@ void Broadcaster::send() { try { i->listener->elementReplaced(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (PropertyChangeNotifications::iterator i( @@ -158,8 +174,9 @@ void Broadcaster::send() { try { i->listener->propertyChange(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (PropertiesChangeNotifications::iterator i( @@ -169,8 +186,9 @@ void Broadcaster::send() { try { i->listener->propertiesChange(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ChangesNotifications::iterator i(changesNotifications_.begin()); @@ -178,16 +196,19 @@ void Broadcaster::send() { try { i->listener->changesOccurred(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } - if (exception) { //TODO - throw css::uno::RuntimeException( - rtl::OUString( + if (exception.hasValue()) { + throw css::lang::WrappedTargetRuntimeException( + (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "configmgr exceptions during listener notification")), - css::uno::Reference< css::uno::XInterface >()); + "configmgr exceptions during listener notification")) + + messages.makeStringAndClear()), + css::uno::Reference< css::uno::XInterface >(), + exception); } } -- cgit From 0da24e667613be2f480b57fce3519295ed0eea26 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 24 Aug 2010 17:53:12 +0200 Subject: fwk154: i114090: adapt listener code to reflect changes in config mgr, notification of change events (transplanted from 7c0cad639e0b6d74f4be88f5877270f1a8b9fa53) --- ucb/source/core/ucb.cxx | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index c13ec9d367c8..4c4539080a13 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -647,28 +647,10 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& sal_Int32 nCount = Event.Changes.getLength(); if ( nCount ) { + uno::Reference< container::XHierarchicalNameAccess > xHierNameAccess; + Event.Base >>= xHierNameAccess; - uno::Reference< lang::XMultiServiceFactory > xConfigProv( - m_xSMgr->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationProvider" ) ), - uno::UNO_QUERY_THROW ); - - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - aProperty.Name - = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ); - aProperty.Value <<= Event.Base; - aArguments[ 0 ] <<= aProperty; - - uno::Reference< uno::XInterface > xInterface( - xConfigProv->createInstanceWithArguments( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationAccess" ) ), - aArguments ) ); - - uno::Reference< container::XHierarchicalNameAccess > - xHierNameAccess( xInterface, uno::UNO_QUERY_THROW ); + OSL_ASSERT( xHierNameAccess.is() ); const util::ElementChange* pElementChanges = Event.Changes.getConstArray(); -- cgit From 4c53df43b4cd3f3104a090e95d82fe695ff22a75 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Wed, 25 Aug 2010 08:25:36 +0200 Subject: fwk154#i114083# fixed some file properies for the Oracle Open Office executables --- desktop/util/verinfo.rc | 8 ++++---- desktop/win32/source/applauncher/ooo/verinfo.rc | 4 ++-- desktop/win32/source/applauncher/verinfo.rc | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 desktop/util/verinfo.rc mode change 100644 => 100755 desktop/win32/source/applauncher/ooo/verinfo.rc mode change 100644 => 100755 desktop/win32/source/applauncher/verinfo.rc diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc old mode 100644 new mode 100755 index 038953f2aa79..7d589956ec83 --- a/desktop/util/verinfo.rc +++ b/desktop/util/verinfo.rc @@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo block "040704E4" { // German StringTable - value "CompanyName", "Oracle, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #else block "040904E4" { // International StringTable - value "CompanyName", "Oracle, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #endif } diff --git a/desktop/win32/source/applauncher/ooo/verinfo.rc b/desktop/win32/source/applauncher/ooo/verinfo.rc old mode 100644 new mode 100755 index ce698ba80333..c13e723527fc --- a/desktop/win32/source/applauncher/ooo/verinfo.rc +++ b/desktop/win32/source/applauncher/ooo/verinfo.rc @@ -69,7 +69,7 @@ VS_VERSION_INFO versioninfo value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #else block "040904E4" @@ -81,7 +81,7 @@ VS_VERSION_INFO versioninfo value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #endif } diff --git a/desktop/win32/source/applauncher/verinfo.rc b/desktop/win32/source/applauncher/verinfo.rc old mode 100644 new mode 100755 index 0db55c58c4b2..c0ff71494014 --- a/desktop/win32/source/applauncher/verinfo.rc +++ b/desktop/win32/source/applauncher/verinfo.rc @@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo block "040704E4" { // German StringTable - value "CompanyName", "Sun Microsystems, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #else block "040904E4" { // International StringTable - value "CompanyName", "Sun Microsystems, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #endif } -- cgit From 081f3c9e3fd4e3491994028e6b5eb19ff3ed7018 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Aug 2010 13:29:38 +0200 Subject: fs33a: when all panels claim to be invisible, make the first one visible --- sfx2/source/dialog/taskpane.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index f25485a1401c..5d763f81744d 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -584,6 +584,7 @@ namespace sfx2 return; ::rtl::OUString sFirstVisiblePanelResource; + ::rtl::OUString sFirstPanelResource; const Sequence< ::rtl::OUString > aUIElements( aWindowStateConfig.getNodeNames() ); for ( const ::rtl::OUString* resource = aUIElements.getConstArray(); @@ -594,6 +595,8 @@ namespace sfx2 if ( !impl_isToolPanelResource( *resource ) ) continue; + sFirstPanelResource = *resource; + ::utl::OConfigurationNode aResourceNode( aWindowStateConfig.openNode( *resource ) ); ::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) ); @@ -620,6 +623,9 @@ namespace sfx2 sFirstVisiblePanelResource = *resource; } + if ( sFirstVisiblePanelResource.getLength() == 0 ) + sFirstVisiblePanelResource = sFirstPanelResource; + if ( sFirstVisiblePanelResource.getLength() ) { ::boost::optional< size_t > aPanelPos( GetPanelPos( sFirstVisiblePanelResource ) ); -- cgit From e301c8006b0ebebaa1059f1712ab7269a684c540 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 25 Aug 2010 16:36:33 +0200 Subject: #i10000# removed obsolete switch --- l10ntools/scripts/localize.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl index 4b7040d6583d..7a9d8beb6f15 100644 --- a/l10ntools/scripts/localize.pl +++ b/l10ntools/scripts/localize.pl @@ -492,7 +492,7 @@ sub collectfiles{ # -e # if ( -x $command ){ if( $command ){ - if( !$bVerbose ){ $args .= " -QQ "; } + if( !$bVerbose ){ $args .= " "; } $args .= " -e -f $localizeSDF -l "; my $bFlag=""; if( $bAll ) {$args .= " en-US";} -- cgit From 0f5cf8b1ece166ffb32af79b54fe46ec5dc9a6f8 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 25 Aug 2010 19:09:27 +0200 Subject: #i10000# set dummy fields to 0 for string DB --- l10ntools/scripts/tool/sdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py index 2afcbaf4bb1f..dd413b14f75f 100644 --- a/l10ntools/scripts/tool/sdf.py +++ b/l10ntools/scripts/tool/sdf.py @@ -113,7 +113,7 @@ class SdfEntity: const._TITLE_POS = 13 const._DATE_POS = 14 - def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", + def __init__(self, project="", source_file="", dummy1="0", resource_type="", gid="", lid="", helpid="", platform="", dummy2="0", langid="", text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): self.project = project; self.source_file = source_file; -- cgit From d4db8f570730be85039435919ec78b119d7da3f5 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 26 Aug 2010 13:17:12 +0200 Subject: masterfix: #i10000# modify extract date and dummy fields for string database --- l10ntools/java/jpropex/java/JPropEx.java | 7 +++++-- l10ntools/scripts/tool/sdf.py | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java index be59d7f29479..ceeeb5083982 100644 --- a/l10ntools/java/jpropex/java/JPropEx.java +++ b/l10ntools/java/jpropex/java/JPropEx.java @@ -145,8 +145,11 @@ public class JPropEx //String path = makeAbs( inputFileArg ); path = path.replace( rootArg + "/" , "" ); path = path.replace("/","\\"); - return new SdfEntity( projectArg , path , "" /* dummy1 */ , resourceType , "", "" , "" , "" , "" /* dummy2 */ , - sourceLanguage , "", "" , "" , "" , "2002-02-02 02:02:02" ); + // TODO: Make this static + java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String date = dateformat.format( new Date() ); + return new SdfEntity( projectArg , path , "0" /* dummy1 */ , resourceType , "", "" , "" , "" , "0" /* dummy2 */ , + sourceLanguage , "", "" , "" , "" , date ); } private void merge() diff --git a/l10ntools/scripts/tool/sdf.py b/l10ntools/scripts/tool/sdf.py index dd413b14f75f..96afbed1452c 100644 --- a/l10ntools/scripts/tool/sdf.py +++ b/l10ntools/scripts/tool/sdf.py @@ -26,6 +26,7 @@ #************************************************************************* from pseudo import PseudoSet,PseudoOrderedDict +from time import gmtime, strftime class SdfData: _filename = ""; @@ -114,7 +115,7 @@ class SdfEntity: const._DATE_POS = 14 def __init__(self, project="", source_file="", dummy1="0", resource_type="", gid="", lid="", helpid="", platform="", dummy2="0", langid="", - text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"): + text="", helptext="", quickhelptext="", title="", date=""): self.project = project; self.source_file = source_file; self.dummy1 = dummy1; @@ -129,7 +130,11 @@ class SdfEntity: self.helptext = helptext; self.quickhelptext = quickhelptext; self.title = title; - self.date = date; + if date != "": + self.date = date; + else: + self.date = strftime("%Y-%m-%d %H:%M:%S",gmtime()) + def set_properties(self, line): splitted = line.split("\t") -- cgit From d7fd47ed54f42d353c375d171350cfe81c307414 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 26 Aug 2010 13:26:56 +0200 Subject: sb130: #i113096# previous change contained an error in configmgr::Components::removeExtensionXcuFile --- configmgr/source/components.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 733ca05bc147..e76460de5b64 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -290,6 +290,7 @@ void Components::removeExtensionXcuFile( // item->additions records all additions of set members in textual order, // the latter check works well when iterating through item->additions in // reverse order. + OSL_ASSERT(modifications != 0); rtl::Reference< Data::ExtensionXcu > item( data_.removeExtensionXcuAdditions(fileUri)); if (item.is()) { @@ -315,6 +316,7 @@ void Components::removeExtensionXcuFile( node->kind() == Node::KIND_SET); if (hasOnlyEmptySets(node)) { parent->getMembers().erase(i->back()); + addModification(*i); modifications->add(*i); } } -- cgit From abccae0c72bb7ec1b813653b256fe34ffb047279 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 26 Aug 2010 13:28:53 +0200 Subject: sb130: #i113096# UniversalContentBroker::changesOccurred is now also called for removed items --- ucb/source/core/ucb.cxx | 127 ++++++++++++++++++++++++++++-------------------- ucb/source/core/ucb.hxx | 6 --- 2 files changed, 74 insertions(+), 59 deletions(-) diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 4c4539080a13..30f7e32f3828 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -182,6 +183,63 @@ void makeAndAppendXMLName( } } +bool createContentProviderData( + const rtl::OUString & rProvider, + const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess, + ContentProviderData & rInfo) +{ + // Obtain service name. + rtl::OUStringBuffer aKeyBuffer (rProvider); + aKeyBuffer.appendAscii( "/ServiceName" ); + + rtl::OUString aValue; + try + { + if ( !( rxHierNameAccess->getByHierarchicalName( + aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + { + OSL_ENSURE( false, + "UniversalContentBroker::getContentProviderData - " + "Error getting item value!" ); + } + } + catch (container::NoSuchElementException &) + { + return false; + } + + rInfo.ServiceName = aValue; + + // Obtain URL Template. + aKeyBuffer.append(rProvider); + aKeyBuffer.appendAscii( "/URLTemplate" ); + + if ( !( rxHierNameAccess->getByHierarchicalName( + aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + { + OSL_ENSURE( false, + "UniversalContentBroker::getContentProviderData - " + "Error getting item value!" ); + } + + rInfo.URLTemplate = aValue; + + // Obtain Arguments. + aKeyBuffer.append(rProvider); + aKeyBuffer.appendAscii( "/Arguments" ); + + if ( !( rxHierNameAccess->getByHierarchicalName( + aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + { + OSL_ENSURE( false, + "UniversalContentBroker::getContentProviderData - " + "Error getting item value!" ); + } + + rInfo.Arguments = aValue; + return true; +} + } //========================================================================= @@ -664,9 +722,18 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& ContentProviderData aInfo; - createContentProviderData(aKey, xHierNameAccess, aInfo); - - aData.push_back(aInfo); + // Removal of UCPs from the configuration leads to changesOccurred + // notifications, too, but it is hard to tell for a given + // ElementChange whether it is an addition or a removal, so as a + // heuristic consider as removals those that cause a + // NoSuchElementException in createContentProviderData. + // + // For now, removal of UCPs from the configuration is simply ignored + // (and not reflected in the UCB's data structures): + if (createContentProviderData(aKey, xHierNameAccess, aInfo)) + { + aData.push_back(aInfo); + } } prepareAndRegister(aData); @@ -834,7 +901,10 @@ bool UniversalContentBroker::getContentProviderData( makeAndAppendXMLName( aElemBuffer, pElems[ n ] ); aElemBuffer.appendAscii( "']" ); - createContentProviderData(aElemBuffer.makeStringAndClear(), xHierNameAccess, aInfo); + OSL_VERIFY( + createContentProviderData( + aElemBuffer.makeStringAndClear(), xHierNameAccess, + aInfo)); rListToFill.push_back( aInfo ); } @@ -866,55 +936,6 @@ bool UniversalContentBroker::getContentProviderData( return true; } -void UniversalContentBroker::createContentProviderData( - const rtl::OUString & rProvider, - const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess, - ContentProviderData & rInfo) -{ - // Obtain service name. - rtl::OUStringBuffer aKeyBuffer (rProvider); - aKeyBuffer.appendAscii( "/ServiceName" ); - - rtl::OUString aValue; - if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) - { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " - "Error getting item value!" ); - } - - rInfo.ServiceName = aValue; - - // Obtain URL Template. - aKeyBuffer.append(rProvider); - aKeyBuffer.appendAscii( "/URLTemplate" ); - - if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) - { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " - "Error getting item value!" ); - } - - rInfo.URLTemplate = aValue; - - // Obtain Arguments. - aKeyBuffer.append(rProvider); - aKeyBuffer.appendAscii( "/Arguments" ); - - if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) - { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " - "Error getting item value!" ); - } - - rInfo.Arguments = aValue; -} - //========================================================================= // // ProviderListEntry_Impl implementation. diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx index 0e44c5bc99b5..d2f6e4e4c41e 100644 --- a/ucb/source/core/ucb.hxx +++ b/ucb/source/core/ucb.hxx @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -204,11 +203,6 @@ private: void prepareAndRegister( const ucbhelper::ContentProviderDataList& rData); - void createContentProviderData( - const rtl::OUString& rProvider, - const com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >& rxHierNameAccess, - ucbhelper::ContentProviderData& rInfo); - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; -- cgit From 4ea577d0efe22e5785c8ae72c86f517fd2cf9194 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 26 Aug 2010 17:11:05 +0200 Subject: sb130: #i113096# previous configmgr::Components::removeExtensionXcuFile changes were still not good --- configmgr/source/components.cxx | 24 +++++++++++++----------- configmgr/source/modifications.cxx | 21 +++++++++++++++++++++ configmgr/source/modifications.hxx | 2 ++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index e76460de5b64..33b0eca3f65f 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -120,26 +120,26 @@ rtl::OUString expand(rtl::OUString const & str) { return s; } -bool hasOnlyEmptySets(rtl::Reference< Node > const & node) { +bool canRemoveFromLayer(int layer, rtl::Reference< Node > const & node) { OSL_ASSERT(node.is()); + if (node->getLayer() > layer && node->getLayer() < Data::NO_LAYER) { + return false; + } switch (node->kind()) { - default: // Node::KIND_LOCALIZED_VALUE - OSL_ASSERT(false); - // fall through - case Node::KIND_PROPERTY: case Node::KIND_LOCALIZED_PROPERTY: - return true; case Node::KIND_GROUP: for (NodeMap::iterator i(node->getMembers().begin()); i != node->getMembers().end(); ++i) { - if (!hasOnlyEmptySets(i->second)) { + if (!canRemoveFromLayer(layer, i->second)) { return false; } } return true; case Node::KIND_SET: return node->getMembers().empty(); + default: // Node::KIND_PROPERTY, Node::KIND_LOCALIZED_VALUE + return true; } } @@ -282,7 +282,8 @@ void Components::removeExtensionXcuFile( // be removed. However, not enough information is recorded in the in-memory // data structures to do so. So, as a workaround, all those set elements // that were freshly added by the xcu and have afterwards been left - // unchanged are removed (and nothing else). The heuristic to determine + // unchanged or have only had their properties changed in the user layer are + // removed (and nothing else). The heuristic to determine // whether a node has been left unchanged is to check the layer ID (as // usual) and additionally to check that the node does not recursively // contain any non-empty sets (multiple extension xcu files are merged into @@ -302,7 +303,7 @@ void Components::removeExtensionXcuFile( rtl::Reference< Node > node; for (Path::const_iterator j(i->begin()); j != i->end(); ++j) { parent = node; - node = Data::findNode(item->layer, *map, *j); + node = Data::findNode(Data::NO_LAYER, *map, *j); if (!node.is()) { break; } @@ -314,14 +315,15 @@ void Components::removeExtensionXcuFile( OSL_ASSERT( node->kind() == Node::KIND_GROUP || node->kind() == Node::KIND_SET); - if (hasOnlyEmptySets(node)) { + if (canRemoveFromLayer(item->layer, node)) { parent->getMembers().erase(i->back()); - addModification(*i); + data_.modifications.remove(*i); modifications->add(*i); } } } } + writeModifications(); } } diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx index 2ad3b5ef8bd1..add18ceaa1ea 100644 --- a/configmgr/source/modifications.cxx +++ b/configmgr/source/modifications.cxx @@ -59,6 +59,27 @@ void Modifications::add(Path const & path) { p->children.clear(); } +void Modifications::remove(Path const & path) { + OSL_ASSERT(!path.empty()); + Node * p = &root_; + for (Path::const_iterator i(path.begin());;) { + Node::Children::iterator j(p->children.find(*i)); + if (j == p->children.end()) { + break; + } + if (++i == path.end()) { + p->children.erase(j); + if (p->children.empty()) { + Path parent(path); + parent.pop_back(); + remove(parent); + } + break; + } + p = &j->second; + } +} + Modifications::Node const & Modifications::getRoot() const { return root_; } diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx index e29a10150148..c28b1aadd192 100644 --- a/configmgr/source/modifications.hxx +++ b/configmgr/source/modifications.hxx @@ -54,6 +54,8 @@ public: void add(Path const & path); + void remove(Path const & path); + Node const & getRoot() const; private: -- cgit From 9e685a7e47924f184d076c43acde64548cb5925d Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 27 Aug 2010 11:31:33 +0200 Subject: masterfix OOO330: #i10000# unknown -B option for Python (Windows) --- l10ntools/scripts/xhtex | 9 ++++++++- l10ntools/scripts/xtxex | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index ad18d8c94eab..ca307cf2d4a4 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -31,9 +31,16 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi +if [ ${GUI} = "WNT" ]; then +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" +fi +else if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" fi - +fi diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index 52baab0693d0..fb54c1aee36c 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -31,9 +31,17 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi +if [ ${GUI} = "WNT" ]; then +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" +else + exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" +fi +else if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" fi +fi -- cgit From 926a7b29e05856d8ed567e3e4ff8640340d1ebfc Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 27 Aug 2010 13:01:02 +0200 Subject: masterfix OOO330: #i10000# solve merge problem / WaE --- desktop/source/app/app.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cf19af655a1b..f5d6979bc4b1 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1558,6 +1558,7 @@ void Desktop::Main() std::auto_ptr pLanguageOptions; std::auto_ptr pPathOptions; + Reference< ::com::sun::star::task::XRestartManager > xRestartManager; sal_Bool bRestartRequested( sal_False ); sal_Bool bUseSystemFileDialog(sal_True); int nAcquireCount( 0 ); @@ -1761,7 +1762,6 @@ void Desktop::Main() impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" ); - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; { ::comphelper::ComponentContext aContext( xSMgr ); xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); @@ -1929,7 +1929,6 @@ void Desktop::Main() // call Application::Execute to process messages in vcl message loop RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" ); - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; try { // The JavaContext contains an interaction handler which is used when @@ -1937,9 +1936,10 @@ void Desktop::Main() com::sun::star::uno::ContextLayer layer2( new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); - ::comphelper::ComponentContext aContext( xSMgr ); - xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); - if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) ) + // check whether the shutdown is caused by restart just before entering the Execute + bRestartRequested = bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + + if ( !bRestartRequested ) { // if this run of the office is triggered by restart, some additional actions should be done DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() ); @@ -1957,13 +1957,11 @@ void Desktop::Main() OfficeIPCThread::SetDowning(); FatalError( MakeStartupErrorMessage(exAnyCfg.Message) ); } - - // check whether the shutdown is caused by restart - sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); - if ( bRestartRequested ) - SetRestartState(); } + if ( bRestartRequested ) + SetRestartState(); + if (xGlobalBroadcaster.is()) { css::document::EventObject aEvent; -- cgit From 550c1339601b93ac54faf3333df47796e8ea118d Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 27 Aug 2010 13:02:34 +0200 Subject: masterfix OOO330: #i10000# new exception file unovwr.cxx --- sw/source/core/undo/makefile.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/sw/source/core/undo/makefile.mk b/sw/source/core/undo/makefile.mk index d6e6766a0fd4..c381761adba1 100644 --- a/sw/source/core/undo/makefile.mk +++ b/sw/source/core/undo/makefile.mk @@ -49,6 +49,7 @@ EXCEPTIONSFILES = \ $(SLO)$/unattr.obj \ $(SLO)$/undobj.obj \ $(SLO)$/undraw.obj \ + $(SLO)$/unovwr.obj \ $(SLO)$/untbl.obj SLOFILES = \ -- cgit From 8286fa794b87fd0871664909b6019836e2d4525f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Aug 2010 13:19:56 +0200 Subject: fs33a: reverting the fix for i112671. No string changes allowed in this phase. --- dbaccess/source/ext/macromigration/macromigration.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src index cfe27f5783d8..9742dcdfec71 100644 --- a/dbaccess/source/ext/macromigration/macromigration.src +++ b/dbaccess/source/ext/macromigration/macromigration.src @@ -445,7 +445,7 @@ String STR_INVALID_NUMBER_ARGS }; String STR_NO_DATABASE { - Text [ en-US ] = "No database document found in the initialization arguments."; + Text [ en-US ] = "No database document found in the initializatin arguments."; }; String STR_NOT_READONLY { -- cgit From 5f25caeb6d38b624c345c9ea937f88d7ada5522a Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Mon, 30 Aug 2010 20:20:51 +0200 Subject: masterfix: #i114025# WaE fixes --- vcl/source/gdi/gdimtf.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 818a31a10c0f..d36a18a1afba 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -873,8 +873,8 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) { aOffset = aMapVDev.LogicToPixel( aBaseOffset, GetPrefMapMode() ); MapMode aMap( aMapVDev.GetMapMode() ); - aOffset.Width() = aOffset.Width() * (double)aMap.GetScaleX(); - aOffset.Height() = aOffset.Height() * (double)aMap.GetScaleY(); + aOffset.Width() = static_cast(aOffset.Width() * (double)aMap.GetScaleX()); + aOffset.Height() = static_cast(aOffset.Height() * (double)aMap.GetScaleY()); } else aOffset = aMapVDev.LogicToLogic( aBaseOffset, GetPrefMapMode(), aMapVDev.GetMapMode() ); -- cgit From 65221b651bed8d6741238d634b1d5b741a373dfc Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 31 Aug 2010 09:17:25 +0200 Subject: fwk155: #i107615# integrate the patch from CD --- cui/source/customize/cfg.cxx | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d9f730e0224f..022cc1cfb72c 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1177,7 +1177,11 @@ bool MenuSaveInData::LoadSubMenus( const OUString& rBaseTitle, SvxConfigEntry* pParentData ) { - SvxEntries* pEntries = pParentData->GetEntries(); + SvxEntries* pEntries = pParentData->GetEntries(); + + // Don't access non existing menu configuration! + if ( !xMenuSettings.is() ) + return true; for ( sal_Int32 nIndex = 0; nIndex < xMenuSettings->getCount(); nIndex++ ) { @@ -2594,17 +2598,20 @@ IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox ) SvxConfigEntry* pMenuData = GetTopLevelSelection(); PopupMenu* pPopup = aModifyTopLevelButton.GetPopupMenu(); - pPopup->EnableItem( ID_DELETE, pMenuData->IsDeletable() ); - pPopup->EnableItem( ID_RENAME, pMenuData->IsRenamable() ); - pPopup->EnableItem( ID_MOVE, pMenuData->IsMovable() ); + if ( pMenuData ) + { + pPopup->EnableItem( ID_DELETE, pMenuData->IsDeletable() ); + pPopup->EnableItem( ID_RENAME, pMenuData->IsRenamable() ); + pPopup->EnableItem( ID_MOVE, pMenuData->IsMovable() ); - SvxEntries* pEntries = pMenuData->GetEntries(); - SvxEntries::const_iterator iter = pEntries->begin(); + SvxEntries* pEntries = pMenuData->GetEntries(); + SvxEntries::const_iterator iter = pEntries->begin(); - for ( ; iter != pEntries->end(); iter++ ) - { - SvxConfigEntry* pEntry = *iter; - InsertEntryIntoUI( pEntry ); + for ( ; iter != pEntries->end(); iter++ ) + { + SvxConfigEntry* pEntry = *iter; + InsertEntryIntoUI( pEntry ); + } } UpdateButtonStates(); -- cgit From ac41da2ac352859eec9961b29a5a82813a788c50 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 31 Aug 2010 12:21:23 +0200 Subject: masterfix: #i114215# builderror in canvas/source/vcl fixed --- canvas/source/vcl/canvashelper_texturefill.cxx | 1 + 1 file changed, 1 insertion(+) mode change 100755 => 100644 canvas/source/vcl/canvashelper_texturefill.cxx diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx old mode 100755 new mode 100644 index 023ceb2b5005..7387b06e3e84 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -704,6 +704,7 @@ namespace vclcanvas { ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0); ::basegfx::B2DRectangle aTextureDeviceRect; + ::basegfx::B2DHomMatrix aTextureTransform; ::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect, aRect, aTextureTransform ); -- cgit From 6554b3de755e7b07c8d313d8bc7ae7b0c6638133 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 12:27:38 +0200 Subject: fs33a: +i114247# sync WindowBits and Style --- svtools/source/contnr/svtreebx.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 3b1430e0df77..fa3cf8e734c1 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -1513,6 +1513,11 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) pImp->SetWindowBits( nWinStyle ); pImp->Resize(); Invalidate(); + + if ( nWindowStyle != GetStyle() ) + { + SetStyle( nWindowStyle ); + } } void SvTreeListBox::PaintEntry( SvLBoxEntry* pEntry ) @@ -2521,7 +2526,12 @@ void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) SvLBox::StateChanged( i_nStateChange ); if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 ) { - SetWindowBits( GetStyle() ); + if ( GetStyle() != nWindowStyle ) + // keep in sync with our WindowBits + // TODO: SetWindowBits is weird, it should be completely replaced (in all clients) with SetStyle + // (or are there WindowBits which have a different meaning when interpreted as style? Wouldn't + // be the first time, but all of those should be fixed meanwhile ...) + SetWindowBits( GetStyle() ); } } -- cgit From dfc9073aae20cbfbb1dc7bd63852089b7cd90532 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 1 Sep 2010 13:09:46 +0200 Subject: dba33h: #i114246# use correct table name --- dbaccess/source/core/api/KeySet.cxx | 31 +++++++++++++++++++++++++------ dbaccess/source/core/api/KeySet.hxx | 1 - 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 992c748aad2e..88b67b5ea5e3 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -198,7 +198,7 @@ void OKeySet::initColumns() m_pForeignColumnNames.reset( new SelectColumnsMetaData(bCase) ); } void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable - ,const Reference& /*i_xMeta*/ + ,const Reference& i_xMeta ,const Reference& i_xQueryColumns) { // first ask the database itself for the best columns which can be used @@ -209,9 +209,6 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable const Reference xTblColSup(i_aTable,UNO_QUERY_THROW); const Reference xTblColumns = xTblColSup->getColumns(); - ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames),true); - ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames),true); - // locate parameter in select columns Reference xParaSup(m_xComposer,UNO_QUERY); Reference xQueryParameters = xParaSup->getParameters(); @@ -222,7 +219,26 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable Reference xPara(xQueryParameters->getByIndex(i),UNO_QUERY_THROW); xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumns[i]; } - ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,m_sUpdateTableName,(*m_pParameterNames),true); + + if ( m_sUpdateTableName.getLength() ) + { + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,m_sUpdateTableName,(*m_pParameterNames),true); + } + else + { + ::rtl::OUString sCatalog,sSchema,sTable; + Reference xTableProp(i_aTable,UNO_QUERY); + Any aCatalog = xTableProp->getPropertyValue(PROPERTY_CATALOGNAME); + aCatalog >>= sCatalog; + xTableProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema; + xTableProp->getPropertyValue(PROPERTY_NAME) >>= sTable; + const ::rtl::OUString sComposedUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sComposedUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sComposedUpdateTableName,(*m_pColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sComposedUpdateTableName,(*m_pParameterNames),true); + } SelectColumnsMetaData::const_iterator aPosIter = m_pKeyColumnNames->begin(); SelectColumnsMetaData::const_iterator aPosEnd = m_pKeyColumnNames->end(); @@ -823,7 +839,10 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString ::rtl::OUString sStmt = ::rtl::OUString::createFromAscii("SELECT "); sStmt += sMaxStmt; sStmt += ::rtl::OUString::createFromAscii("FROM "); - sStmt += m_aSelectComposedTableName; + ::rtl::OUString sCatalog,sSchema,sTable; + ::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); + sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ); + //sStmt += m_aSelectComposedTableName; try { // now fetch the autoincrement values diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 694593e6c608..212ec237699e 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -112,7 +112,6 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> m_xRow; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer > m_xComposer; ::rtl::OUString m_sUpdateTableName; - ::rtl::OUString m_aSelectComposedTableName; ::std::vector< ::rtl::OUString > m_aFilterColumns; sal_Bool m_bRowCountFinal; -- cgit From ee9af8fd2730252534bf89dd6694e6555f072792 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 2 Sep 2010 10:54:17 +0200 Subject: fs33a: #i113583# use the categorie column as well to build table --- .../source/filter/xml/xmlExportDocumentHandler.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 1455dee74b3c..d3a557c3ff6b 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -339,10 +339,16 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any > // set ourself as delegator m_xProxy->setDelegator( *this ); + const ::rtl::OUString sCommand = m_xDatabaseDataProvider->getCommand(); + if ( sCommand.getLength() ) + m_aColumns = ::dbtools::getFieldNamesByCommandDescriptor(m_xDatabaseDataProvider->getActiveConnection() + ,m_xDatabaseDataProvider->getCommandType() + ,sCommand); uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xDatabaseDataProvider,uno::UNO_QUERY); if ( xDataProvider.is() ) { + m_aColumns.realloc(1); uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions(); for(sal_Int32 i = 0 ; i < aColumnNames.getLength();++i) { @@ -354,14 +360,6 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any > } } } - else - { - const ::rtl::OUString sCommand = m_xDatabaseDataProvider->getCommand(); - if ( sCommand.getLength() ) - m_aColumns = ::dbtools::getFieldNamesByCommandDescriptor(m_xDatabaseDataProvider->getActiveConnection() - ,m_xDatabaseDataProvider->getCommandType() - ,sCommand); - } } // -------------------------------------------------------------------------------- uno::Any SAL_CALL ExportDocumentHandler::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException) -- cgit From 0b78b565774f51ba9770783b5e4b5d0474307ee7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Sep 2010 14:50:14 +0200 Subject: fs33a: revert the original fix for HideInactiveSelection support in the tree list box, causing too much regressions. Fix it by using SetWindowBits instead of SetStyle --- svtools/source/contnr/svtreebx.cxx | 14 -------------- svtools/source/uno/treecontrolpeer.cxx | 6 +++--- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index fa3cf8e734c1..a8635c99d127 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -1513,11 +1513,6 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle ) pImp->SetWindowBits( nWinStyle ); pImp->Resize(); Invalidate(); - - if ( nWindowStyle != GetStyle() ) - { - SetStyle( nWindowStyle ); - } } void SvTreeListBox::PaintEntry( SvLBoxEntry* pEntry ) @@ -2524,15 +2519,6 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) { SvLBox::StateChanged( i_nStateChange ); - if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 ) - { - if ( GetStyle() != nWindowStyle ) - // keep in sync with our WindowBits - // TODO: SetWindowBits is weird, it should be completely replaced (in all clients) with SetStyle - // (or are there WindowBits which have a different meaning when interpreted as style? Wouldn't - // be the first time, but all of those should be fixed meanwhile ...) - SetWindowBits( GetStyle() ); - } } void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 5c1f4925783a..d1ea854cce61 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1327,12 +1327,12 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An sal_Bool bEnabled = sal_False; if ( aValue >>= bEnabled ) { - WinBits nStyle = rTree.GetStyle(); + WinBits nStyle = rTree.GetWindowBits(); if ( bEnabled ) nStyle |= WB_HIDESELECTION; else nStyle &= ~WB_HIDESELECTION; - rTree.SetStyle( nStyle ); + rTree.SetWindowBits( nStyle ); } } break; @@ -1428,7 +1428,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru switch(nPropId) { case BASEPROPERTY_HIDEINACTIVESELECTION: - return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); + return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); case BASEPROPERTY_TREE_SELECTIONTYPE: { -- cgit From 705d6cd7d7304e2337d4424c417d99592d087219 Mon Sep 17 00:00:00 2001 From: Jiao Jianhua Date: Mon, 13 Sep 2010 14:06:16 +0200 Subject: plus-minus-sw-navigator.diff: folding for each heading in Navigator i#64886, n#129410 --- sw/source/ui/utlui/content.cxx | 134 ++++++++++++++++++++++++++++++++--------- 1 file changed, 105 insertions(+), 29 deletions(-) diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index 0b0bca564f48..be64f527b310 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -1240,18 +1240,63 @@ void SwContentTree::RequestingChilds( SvLBoxEntry* pParent ) SwContentType* pCntType = (SwContentType*)pParent->GetUserData(); sal_uInt16 nCount = pCntType->GetMemberCount(); - for(sal_uInt16 i = 0; i < nCount; i++) - { - const SwContent* pCnt = pCntType->GetMember(i); - if(pCnt) - { - String sEntry = pCnt->GetName(); - if(!sEntry.Len()) - sEntry = sSpace; - InsertEntry(sEntry, pParent, - sal_False, LIST_APPEND, (void*)pCnt); - } - + /************************************************************** + Add for outline plus/minus + ***************************************************************/ + if(pCntType->GetType() == CONTENT_TYPE_OUTLINE) + { + SvLBoxEntry* pChild = 0; + for(sal_uInt16 i = 0; i < nCount; i++) + { + const SwContent* pCnt = pCntType->GetMember(i); + if(pCnt) + { + sal_uInt16 nLevel = ((SwOutlineContent*)pCnt)->GetOutlineLevel(); + String sEntry = pCnt->GetName(); + if(!sEntry.Len()) + sEntry = sSpace; + if(!pChild || (nLevel == 0)) + pChild = InsertEntry(sEntry, pParent, + sal_False, LIST_APPEND,(void*)pCnt); + else + { + //back search parent. + if(((SwOutlineContent*)pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel) + pChild = InsertEntry(sEntry, pChild, + sal_False, LIST_APPEND, (void*)pCnt); + else + { + pChild = Prev(pChild); + while(pChild && + lcl_IsContent(pChild) && + !(((SwOutlineContent*)pChild->GetUserData())->GetOutlineLevel() < nLevel) + ) + { + pChild = Prev(pChild); + } + if(pChild) + pChild = InsertEntry(sEntry, pChild, + sal_False, LIST_APPEND, (void*)pCnt); + } + } + } + } + } + else + { + for(sal_uInt16 i = 0; i < nCount; i++) + { + const SwContent* pCnt = pCntType->GetMember(i); + if(pCnt) + { + String sEntry = pCnt->GetName(); + if(!sEntry.Len()) + sEntry = sSpace; + InsertEntry(sEntry, pParent, + sal_False, LIST_APPEND, (void*)pCnt); + } + + } } } } @@ -1263,7 +1308,7 @@ void SwContentTree::RequestingChilds( SvLBoxEntry* pParent ) sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) { - if(!bIsRoot) + if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) { if(lcl_IsContentType(pParent)) { @@ -1276,6 +1321,19 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) } else nHiddenBlock |= nOr; + if((pCntType->GetType() == CONTENT_TYPE_OUTLINE)) + { + sal_Bool bBool = SvTreeListBox::Expand(pParent); + SvLBoxEntry* pChild = Next(pParent); + while(pChild && lcl_IsContent(pChild) && pParent->HasChilds()) + { + if(pChild->HasChilds()) + SvTreeListBox::Expand(pChild); + pChild = Next(pChild); + } + return bBool; + } + } } return SvTreeListBox::Expand(pParent); @@ -1288,10 +1346,12 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) { sal_Bool bRet; - if(!bIsRoot) + if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) { if(lcl_IsContentType(pParent)) { + if(bIsRoot) + return bRet = sal_False; SwContentType* pCntType = (SwContentType*)pParent->GetUserData(); sal_uInt16 nAnd = 1 << pCntType->GetType(); nAnd = ~nAnd; @@ -1306,7 +1366,8 @@ sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) bRet = SvTreeListBox::Collapse(pParent); } else - bRet = sal_False; +// bRet = sal_False; + bRet = SvTreeListBox::Collapse(pParent); return bRet; } @@ -1323,9 +1384,9 @@ IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG ) DBG_ASSERT(pEntry, "kein aktueller Eintrag!"); if(pEntry) { - if(lcl_IsContentType(pEntry)) + if(lcl_IsContentType(pEntry) && !pEntry->HasChilds()) RequestingChilds(pEntry); - else if(bIsActive || bIsConstant) + else if(!lcl_IsContentType(pEntry) && (bIsActive || bIsConstant)) { if(bIsConstant) { @@ -1369,9 +1430,14 @@ void SwContentTree::Display( sal_Bool bActive ) nOldScrollPos = pVScroll->GetThumbPos(); sEntryName = GetEntryText(pOldSelEntry); + SvLBoxEntry* pParantEntry = pOldSelEntry; + while( GetParent(pParantEntry)) + { + pParantEntry = GetParent(pParantEntry); + } if(GetParent(pOldSelEntry)) { - nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(GetParent(pOldSelEntry))); + nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(pParantEntry)); } } Clear(); @@ -1465,18 +1531,24 @@ void SwContentTree::Display( sal_Bool bActive ) (*ppRootContentT)->GetName(), rImage, rImage, 0, sal_False, LIST_APPEND, *ppRootContentT); - for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ ) + if(nRootType != CONTENT_TYPE_OUTLINE) { - const SwContent* pCnt = (*ppRootContentT)->GetMember(i); - if(pCnt) + SvLBoxEntry* pEntry; + for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ ) { - String sEntry = pCnt->GetName(); - if(!sEntry.Len()) - sEntry = sSpace; - InsertEntry( sEntry, pParent, - sal_False, LIST_APPEND, (void*)pCnt); + const SwContent* pCnt = (*ppRootContentT)->GetMember(i); + if(pCnt) + { + String sEntry = pCnt->GetName(); + if(!sEntry.Len()) + sEntry = sSpace; + InsertEntry( sEntry, pParent, + sal_False, LIST_APPEND, (void*)pCnt); + } } - } + } + else + RequestingChilds(pParent); Expand(pParent); if( nRootType == CONTENT_TYPE_OUTLINE && bIsActive ) { @@ -1851,9 +1923,9 @@ sal_Bool SwContentTree::HasContentChanged() // or if the visibility of objects (frames, sections, tables) has changed // i.e. in header/footer pArrType->FillMemberList(&bLevelOrVisibiblityChanged); - if(bLevelOrVisibiblityChanged) - bInvalidate = sal_True; sal_uInt16 nChildCount = (sal_uInt16)GetChildCount(pEntry); + if((nType == CONTENT_TYPE_OUTLINE) && bLevelOrVisibiblityChanged) + bRepaint = sal_True; if(bLevelOrVisibiblityChanged) bInvalidate = sal_True; @@ -2760,6 +2832,10 @@ sal_Bool SwContentTree::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) return sal_False; sal_Bool bEnable = sal_False; SvLBoxEntry* pParentEntry = GetParent(pEntry); + while(pParentEntry && (!lcl_IsContentType(pParentEntry))) + { + pParentEntry = GetParent(pParentEntry); + } if(!bIsLastReadOnly && (!IsVisible() || (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry || lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE))) -- cgit From 1f578e21a92b3532ddfd8e0fd007a7ec6b2ee240 Mon Sep 17 00:00:00 2001 From: Jiao Jianhua Date: Mon, 13 Sep 2010 14:07:35 +0200 Subject: plus-minus-sw-navigator2.diff: Folding for each heading in Navigator i#64886, n#129410i --- sw/source/ui/inc/conttree.hxx | 5 +++ sw/source/ui/utlui/content.cxx | 74 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx index d3a84b0bdb78..cbf58eb35e22 100644 --- a/sw/source/ui/inc/conttree.hxx +++ b/sw/source/ui/inc/conttree.hxx @@ -30,6 +30,9 @@ #include #include "swcont.hxx" +#include +//using namespace std; + class SwWrtShell; class SwContentType; class SwNavigationPI; @@ -74,6 +77,8 @@ class SwContentTree : public SvTreeListBox SwWrtShell* pActiveShell; // die aktive oder eine konst. offene View SwNavigationConfig* pConfig; + std::map< void*, sal_Bool > mOutLineNodeMap; + sal_Int32 nActiveBlock; USHORT nHiddenBlock; USHORT nRootType; diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index be64f527b310..04a6322eb277 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -968,7 +968,6 @@ SwContentTree::~SwContentTree() /*************************************************************************** Drag&Drop methods ***************************************************************************/ - void SwContentTree::StartDrag( sal_Int8 nAction, const Point& rPosPixel ) { if( !bIsRoot || nRootType != CONTENT_TYPE_OUTLINE ) @@ -1018,8 +1017,45 @@ sal_Int8 SwContentTree::AcceptDrop( const AcceptDropEvent& rEvt ) /*************************************************************************** Beschreibung: Drop wird im Navigator ausgefuehrt ***************************************************************************/ +void* lcl_GetOutlineKey( SwContentTree* pTree, SwOutlineContent* pContent) +{ + void* key = 0; + if( pTree && pContent ) + { + SwWrtShell* pShell = pTree->GetWrtShell(); + sal_Int32 nPos = pContent->GetYPos(); + if( nPos ) + { + key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + } + } + return key; +} + sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { + SvLBoxEntry* pEntry = pTargetEntry; + if( pEntry && ( nRootType == CONTENT_TYPE_OUTLINE ) && lcl_IsContent( pEntry ) ) + { + SwOutlineContent* pOutlineContent = ( SwOutlineContent* )( pEntry->GetUserData() ); + if( pOutlineContent ) + { + void* key = lcl_GetOutlineKey(this, pOutlineContent); + if( !mOutLineNodeMap[key] ) + { + while( pEntry->HasChilds() ) + { + SvLBoxEntry* pChildEntry = FirstChild( pEntry ); + while( pChildEntry ) + { + pEntry = pChildEntry; + pChildEntry = NextSibling( pChildEntry ); + } + } + pTargetEntry = pEntry; + } + } + } if( bIsRoot ) return SvTreeListBox::ExecuteDrop( rEvt ); return bIsInDrag ? DND_ACTION_NONE : GetParentWindow()->ExecuteDrop(rEvt); @@ -1308,7 +1344,8 @@ void SwContentTree::RequestingChilds( SvLBoxEntry* pParent ) sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) { - if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) + if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || + (nRootType == CONTENT_TYPE_OUTLINE)) { if(lcl_IsContentType(pParent)) { @@ -1323,18 +1360,39 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) nHiddenBlock |= nOr; if((pCntType->GetType() == CONTENT_TYPE_OUTLINE)) { + std::map< void*, sal_Bool > mCurrOutLineNodeMap; + + SwWrtShell* pShell = GetWrtShell(); sal_Bool bBool = SvTreeListBox::Expand(pParent); SvLBoxEntry* pChild = Next(pParent); while(pChild && lcl_IsContent(pChild) && pParent->HasChilds()) { if(pChild->HasChilds()) - SvTreeListBox::Expand(pChild); + { + sal_Int32 nPos = ((SwContent*)pChild->GetUserData())->GetYPos(); + void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + mCurrOutLineNodeMap.insert(std::map::value_type( key, sal_False ) ); + std::map::iterator iter = mOutLineNodeMap.find( key ); + if( iter != mOutLineNodeMap.end() && mOutLineNodeMap[key]) + { + mCurrOutLineNodeMap[key] = sal_True; + SvTreeListBox::Expand(pChild); + } + } pChild = Next(pChild); } + mOutLineNodeMap = mCurrOutLineNodeMap; return bBool; } } + else if( lcl_IsContent(pParent) ) + { + SwWrtShell* pShell = GetWrtShell(); + sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos(); + void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + mOutLineNodeMap[key] = sal_True; + } } return SvTreeListBox::Expand(pParent); } @@ -1346,7 +1404,8 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) { sal_Bool bRet; - if(!bIsRoot || ((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) + if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || + (nRootType == CONTENT_TYPE_OUTLINE)) { if(lcl_IsContentType(pParent)) { @@ -1362,6 +1421,13 @@ sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) } else nHiddenBlock &= nAnd; + } + else if( lcl_IsContent(pParent) ) + { + SwWrtShell* pShell = GetWrtShell(); + sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos(); + void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + mOutLineNodeMap[key] = sal_False; } bRet = SvTreeListBox::Collapse(pParent); } -- cgit From 8fd87a90a5ebcc9d8c4ddc7ece6d20debd58e801 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:37:51 +0200 Subject: cjk-character-units-imp.diff: add a new unit 'character unit' --- sw/inc/swmodule.hxx | 2 ++ sw/source/ui/app/appopt.cxx | 10 ++++++++ sw/source/ui/app/swmodul1.cxx | 57 +++++++++++++++++++++++++++++++++++++++++ sw/source/ui/config/optload.cxx | 17 ++++++++++++ sw/source/ui/config/usrpref.cxx | 11 +++++--- sw/source/ui/inc/pggrid.hxx | 2 +- sw/source/ui/inc/uitool.hxx | 3 +++ sw/source/ui/inc/usrpref.hxx | 12 +++++++++ sw/source/ui/misc/pggrid.cxx | 32 +++++++++++++++++++---- sw/source/ui/shells/textsh1.cxx | 4 +++ sw/source/ui/uiview/view.cxx | 17 ++++++++++-- sw/source/ui/utlui/uitool.cxx | 13 ++++++++++ 12 files changed, 168 insertions(+), 12 deletions(-) diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index c8e601143877..77c2e56bbe6c 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -169,6 +169,8 @@ public: //default page mode for text grid void ApplyDefaultPageMode(sal_Bool bIsSquaredPageMode); + void ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb); // apply_char_unit + // ConfigItems erzeugen SwModuleOptions* GetModuleConfig() { return pModuleConfig;} SwPrintOptions* GetPrtOptions(sal_Bool bWeb); diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index c6e2527ba0c8..0bc088f06a98 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -139,6 +139,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) FN_PARAM_WRTSHELL, FN_PARAM_WRTSHELL, FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, SID_ATTR_METRIC, SID_ATTR_METRIC, + SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT, SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP, RES_BACKGROUND, RES_BACKGROUND, SID_HTML_MODE, SID_HTML_MODE, @@ -379,6 +380,15 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; ::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog); } + + if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT, + FALSE, &pItem ) ) + { + SFX_APP()->SetOptions(rSet); + const SfxBoolItem* pCharItem = (const SfxBoolItem*)pItem; + ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog); + } + if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, FALSE, &pItem ) ) { diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 2b3a5df1391b..e4b152257141 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -308,6 +308,63 @@ void SwModule::ApplyRulerMetric( FieldUnit eMetric, BOOL bHorizontal, BOOL bWeb pTmpView = SwModule::GetNextView(pTmpView); } } + +/*------------------------------------------------- +set the usrpref 's char unit attribute and set ruler +'s unit as char if the "apply char unit" is checked +--------------------------------------------------*/ +void SwModule::ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb) +{ + SwMasterUsrPref* pPref; + if(bWeb) + { + if(!pWebUsrPref) + GetUsrPref(sal_True); + pPref = pWebUsrPref; + } + else + { + if(!pUsrPref) + GetUsrPref(sal_False); + pPref = pUsrPref; + } + BOOL bOldApplyCharUnit = pPref->IsApplyCharUnit(); + BOOL bHasChanged = FALSE; + if(bOldApplyCharUnit != bApplyChar) + { + pPref->SetApplyCharUnit(bApplyChar); + bHasChanged = TRUE; + } + + if( !bHasChanged ) + return; + + FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : pPref->GetMetric(); + FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : pPref->GetMetric(); + if(bApplyChar) + { + eHScrollMetric = FUNIT_CHAR; + eVScrollMetric = FUNIT_LINE; + } + else + { + eHScrollMetric = FUNIT_CM; + eVScrollMetric = FUNIT_CM; + } + SwView* pTmpView = SwModule::GetFirstView(); + // fuer alle MDI-Fenster das Lineal umschalten + while(pTmpView) + { + if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView))) + { + pTmpView->ChangeVLinealMetric(eVScrollMetric); + pTmpView->ChangeTabMetric(eHScrollMetric); + } + + pTmpView = SwModule::GetNextView(pTmpView); + } +} + /*-----------------13.11.96 11.57------------------- --------------------------------------------------*/ diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 4a0c9c2a6b25..1319cbfdabe8 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -220,6 +220,12 @@ BOOL __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) bRet = TRUE; } + if(aUseCharUnit.IsChecked() != aUseCharUnit.GetSavedValue()) + { + rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, aUseCharUnit.IsChecked())); + bRet = TRUE; + } + sal_Bool bIsSquaredPageModeFlag = aUseSquaredPageMode.IsChecked(); if ( bIsSquaredPageModeFlag != aUseSquaredPageMode.GetSavedValue() ) { @@ -306,6 +312,17 @@ void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet) aUseSquaredPageMode.Check( bSquaredPageMode ); aUseSquaredPageMode.SaveValue(); } + + if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT, FALSE, &pItem)) + { + BOOL bUseCharUnit = ((const SfxBoolItem*)pItem)->GetValue(); + aUseCharUnit.Check(bUseCharUnit); + } + else + { + aUseCharUnit.Check(pUsrPref->IsApplyCharUnit()); + } + aUseCharUnit.SaveValue(); } /*-----------------13.01.97 14.44------------------- Metric des Deftabstops umschalten diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index 85d3886fc79f..013e7dcfaa94 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -263,9 +263,10 @@ Sequence SwLayoutViewConfig::GetPropertyNames() "Window/IsVerticalRulerRight", //15 "ViewLayout/Columns", //16 "ViewLayout/BookMode", //17 - "Other/IsSquaredPageMode" //18 + "Other/IsSquaredPageMode", //18 + "Other/ApplyCharUnit" //19 }; - const int nCount = bWeb ? 14 : 19; + const int nCount = bWeb ? 14 : 20; Sequence aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -332,8 +333,9 @@ void SwLayoutViewConfig::Commit() case 16: pValues[nProp] <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;// "ViewLayout/Columns", case 17: bSet = rParent.IsViewLayoutBookMode(); break;// "ViewLayout/BookMode", case 18: bSet = rParent.IsSquaredPageMode(); break;// "Other/IsSquaredPageMode", + case 19: bSet = rParent.IsApplyCharUnit(); break;// "Other/IsApplyCharUnit", } - if(nProp < 8 || nProp == 10 || nProp == 15 || nProp == 17 || nProp == 18 ) + if(nProp < 8 || nProp == 10 || nProp == 15 || nProp == 17 || nProp == 18 || nProp == 19 ) pValues[nProp].setValue(&bSet, ::getBooleanCppuType()); } PutProperties(aNames, aValues); @@ -353,7 +355,7 @@ void SwLayoutViewConfig::Load() { if(pValues[nProp].hasValue()) { - sal_Bool bSet = nProp < 8 || nProp == 10 || nProp == 17 || nProp == 18 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; + sal_Bool bSet = nProp < 8 || nProp == 10 || nProp == 17 || nProp == 18 || nProp == 19 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; switch(nProp) { case 0: rParent.SetCrossHair(bSet); break;// "Line/Guide", @@ -419,6 +421,7 @@ void SwLayoutViewConfig::Load() break;// "ViewLayout/Columns", case 17: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode", case 18: rParent.SetDefaultPageMode(bSet,TRUE); break;// "Other/IsSquaredPageMode", + case 19: rParent.SetApplyCharUnit(bSet); break;// "Other/ApplyUserChar" } } } diff --git a/sw/source/ui/inc/pggrid.hxx b/sw/source/ui/inc/pggrid.hxx index 92ba2fa2ebd4..ef8355846a30 100644 --- a/sw/source/ui/inc/pggrid.hxx +++ b/sw/source/ui/inc/pggrid.hxx @@ -76,7 +76,7 @@ class SwTextGridPage: public SfxTabPage FixedText aColorFT; ColorListBox aColorLB; - Window* aControls[18]; + Window* aControls[20]; sal_Int32 m_nRubyUserValue; sal_Bool m_bRubyUserValue; diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx index e48f78f9aa96..aea135da9361 100644 --- a/sw/source/ui/inc/uitool.hxx +++ b/sw/source/ui/inc/uitool.hxx @@ -73,6 +73,9 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ); SW_DLLPUBLIC FieldUnit GetDfltMetric(BOOL bWeb); void SetDfltMetric(FieldUnit eMetric, BOOL bWeb); +SW_DLLPUBLIC BOOL HasCharUnit( BOOL bWeb ); +void SetApplyCharUnit(BOOL bApplyChar, BOOL bWeb); + // ListBox mit allen Zeichenvorlagen fuellen - ausser Standard! SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, BOOL bSorted = FALSE, BOOL bWithDefault = FALSE); diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx index 7864bf135934..7331471fb4d9 100644 --- a/sw/source/ui/inc/usrpref.hxx +++ b/sw/source/ui/inc/usrpref.hxx @@ -153,6 +153,7 @@ class SwMasterUsrPref : public SwViewOption SwCursorConfig aCursorConfig; SwWebColorConfig* pWebColorConfig; + sal_Bool bApplyCharUnit; // apply_char_unit public: SwMasterUsrPref(BOOL bWeb); ~SwMasterUsrPref(); @@ -254,6 +255,17 @@ public: aLayoutConfig.SetModified(); } + sal_Bool IsApplyCharUnit() const + { + return bApplyCharUnit; + } + void SetApplyCharUnit(BOOL bSet, sal_Bool bNoModify = sal_False) + { + bApplyCharUnit = bSet; + if(!bNoModify) + aLayoutConfig.SetModified(); + } + sal_Int32 GetDefTab() const { return nDefTab;} void SetDefTab( sal_Int32 nSet, sal_Bool bNoModify = sal_False ) { diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index a6e20cc56dc3..777479198157 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -113,7 +113,9 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : aControls[14] =&aPrintCB; aControls[15] =&aColorFT; aControls[16] =&aColorLB; - aControls[17] =0; + aControls[17] =&aLinesRangeFT; + aControls[18] =&aCharsRangeFT; + aControls[19] =0; Link aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl); aCharsPerLineNF.SetUpHdl(aLink); @@ -309,6 +311,10 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet) aGridItem.SetPrintGrid(aPrintCB.IsChecked()); aGridItem.SetColor(aColorLB.GetSelectEntryColor()); rSet.Put(aGridItem); +/// Amelia + SwView * pView = ::GetActiveView(); + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); } /* -----------------------------08.02.2002 10:54------------------------------ @@ -413,6 +419,10 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue()); aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP); aRubySizeMF.SetValue(0, FUNIT_TWIP); + String aMaxLinesFTStr = String::CreateFromAscii("( 1 - "); + aMaxLinesFTStr += String::CreateFromInt32(aLinesPerPageNF.GetValue()); + aMaxLinesFTStr += String::CreateFromAscii(" )"); + aLinesRangeFT.SetText( aMaxLinesFTStr ); m_nRubyUserValue = nHeight; m_bRubyUserValue = sal_True; @@ -421,6 +431,10 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) { long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue()); aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP); + String aMaxCharsFTStr = String::CreateFromAscii("( 1 - "); + aMaxCharsFTStr += String::CreateFromInt32(aCharsPerLineNF.GetValue()); + aMaxCharsFTStr += String::CreateFromAscii(" )"); + aCharsRangeFT.SetText( aMaxCharsFTStr ); } } GridModifyHdl(0); @@ -436,7 +450,6 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) if (&aTextSizeMF == pField) { sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP))); - aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize); m_bRubyUserValue = sal_False; } //set maximum line per page @@ -454,14 +467,22 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP))); aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize); m_bRubyUserValue = sal_False; + String aRangesStr = String::CreateFromAscii("( 1 - "); + aRangesStr += String::CreateFromInt32( m_aPageSize.Height() / nTextSize ); + aRangesStr += String::CreateFromAscii(" )"); + aLinesRangeFT.SetText( aRangesStr ); } else if (&aCharWidthMF == pField) { sal_Int32 nTextWidth = static_cast< sal_Int32 >(aCharWidthMF.Denormalize(aCharWidthMF.GetValue(FUNIT_TWIP))); + sal_Int32 nMaxChar = 45 ; if (nTextWidth) - aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth); - else - aCharsPerLineNF.SetValue( 45 ); + nMaxChar = m_aPageSize.Width() / nTextWidth; + aCharsPerLineNF.SetValue( nMaxChar ); + String aCharRangeStr = String::CreateFromAscii("( 1 - "); + aCharRangeStr += String::CreateFromInt32( nMaxChar ); + aCharRangeStr += String::CreateFromAscii(" )"); + aCharsRangeFT.SetText( aCharRangeStr ); } //rubySize is disabled } @@ -489,6 +510,7 @@ IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton) { aCharsPerLineFT.Enable(sal_False); aCharsPerLineNF.Enable(sal_False); + aCharsRangeFT.Enable(sal_False); aCharWidthFT.Enable(sal_False); aCharWidthMF.Enable(sal_False); } diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index e7d7ef613f2b..b13aaed44ee2 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -877,6 +877,10 @@ void SwTextShell::Execute(SfxRequest &rReq) { FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView())); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric))); + + BOOL bApplyCharUnit = ::HasCharUnit(0 != PTR_CAST(SwWebView, &GetView())); + SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit)); + SfxItemSet aCoreSet( GetPool(), RES_PARATR_BEGIN, RES_PARATR_END - 1, // --> OD 2008-02-25 #refactorlists# diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 4396ff03807c..3579cdc952f6 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -117,6 +117,7 @@ #include + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -950,9 +951,21 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pVRuler->SetZoom( aZoomFract ); pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick )); FieldUnit eMetric = pUsrPref->GetHScrollMetric(); - pHRuler->SetUnit( eMetric ); + + BOOL bApplyCharUnit = pUsrPref->IsApplyCharUnit(); + if ( bApplyCharUnit ) + pHRuler->SetUnit( FUNIT_CHAR ); + else + pHRuler->SetUnit( eMetric ); + eMetric = pUsrPref->GetVScrollMetric(); - pVRuler->SetUnit( eMetric ); + if ( bApplyCharUnit ) + pVRuler->SetUnit(FUNIT_LINE); + else + pVRuler->SetUnit( eMetric ); + + pHRuler->SetCharWidth( 371 ); // default character width + pVRuler->SetLineHeight( 551 ); // default line height // DocShell setzen pDocSh->SetView( this ); diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index 01f6c4e84d7a..b9982cc78227 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -736,6 +736,19 @@ String GetAppLangDateTimeString( const DateTime& rDT ) return sRet; } +/*---------------------------------------------------------------------------- + * add a new function which can get and set the current "SID_ATTR_APPLYCHARUNIT" value + *---------------------------------------------------------------------------*/ +BOOL HasCharUnit( BOOL bWeb) +{ + return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit(); +} + +void SetApplyCharUnit(BOOL bApplyChar, BOOL bWeb) +{ + SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb); +} + /*-- 26.01.2006 08:06:33--------------------------------------------------- -----------------------------------------------------------------------*/ -- cgit From 69f6c005a836515b96fb5ecc006b987a54a6f094 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:40:57 +0200 Subject: cjk-character-units-ui.diff: add a new unit 'character unit' --- sw/source/ui/config/optload.cxx | 6 ++++++ sw/source/ui/config/optload.hrc | 1 + sw/source/ui/config/optload.src | 12 ++++++++++++ sw/source/ui/config/optpage.cxx | 23 +++++++++++++++++------ sw/source/ui/inc/optload.hxx | 1 + sw/source/ui/inc/pggrid.hxx | 2 ++ sw/source/ui/misc/pggrid.cxx | 3 +++ sw/source/ui/misc/pggrid.hrc | 2 ++ sw/source/ui/misc/pggrid.src | 12 ++++++++++++ 9 files changed, 56 insertions(+), 6 deletions(-) diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 1319cbfdabe8..2dbe2bfabd48 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -77,6 +77,10 @@ using namespace ::com::sun::star; +#ifndef _SFXENUMITEM_HXX //autogen +#include +#endif + /* -----------------22.10.98 15:12------------------- * * --------------------------------------------------*/ @@ -100,6 +104,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : aTabFT ( this, SW_RES( FT_TAB ) ), aTabMF ( this, SW_RES( MF_TAB ) ), aUseSquaredPageMode ( this, SW_RES( CB_USE_SQUARE_PAGE_MODE ) ), + aUseCharUnit ( this , SW_RES( CB_USE_CHAR_UNIT ) ), pWrtShell ( NULL ), bHTMLMode ( FALSE ), @@ -122,6 +127,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : case FUNIT_POINT: case FUNIT_PICA: case FUNIT_INCH: + case FUNIT_CHAR: { // nur diese Metriken benutzen USHORT nPos = aMetricLB.InsertEntry( sMetric ); diff --git a/sw/source/ui/config/optload.hrc b/sw/source/ui/config/optload.hrc index b396b2d9f9f0..201c83d2af51 100644 --- a/sw/source/ui/config/optload.hrc +++ b/sw/source/ui/config/optload.hrc @@ -41,6 +41,7 @@ #define FT_TAB 21 #define MF_TAB 22 #define CB_USE_SQUARE_PAGE_MODE 23 +#define CB_USE_CHAR_UNIT 24 // SwCaptionOptPage ----------------------------- diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src index febd2a6fc35f..cab9d4831f8c 100644 --- a/sw/source/ui/config/optload.src +++ b/sw/source/ui/config/optload.src @@ -139,6 +139,16 @@ TabPage TP_OPTLOAD_PAGE Text [ en-US ] = "Use square page mode for text grid"; Text [ zh-CN ] = "使用稿纸模式"; }; + + CheckBox CB_USE_CHAR_UNIT + { + Pos = MAP_APPFONT ( 12 , 130) ; + Size = MAP_APPFONT ( 109 , 10 ) ; + Text [ de ] = "appy char unit" ; + Text [ en-US ] = "apply char unit"; + Text [ x-comment ] = " "; + }; + }; /**************************************************************************/ /* */ @@ -394,6 +404,8 @@ StringArray STR_ARR_METRIC < "Miles" ; FUNIT_MILE ; > ; < "Pica" ; FUNIT_PICA ; > ; < "Point" ; FUNIT_POINT ; > ; + < "Char" ; FUNIT_CHAR ; >; + < "Line" ; FUNIT_LINE ; >; }; }; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 921d2a652002..bd99cbd29345 100755 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -176,14 +176,25 @@ SwContentOptPage::SwContentOptPage( Window* pParent, case FUNIT_POINT: case FUNIT_PICA: case FUNIT_INCH: + case FUNIT_CHAR: // add two units , 'character' and 'line' , their ticks are not fixed + case FUNIT_LINE: { // nur diese Metriken benutzen - USHORT nPos = aMetricLB.InsertEntry( sMetric ); - aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit ); - aVMetric.InsertEntry( sMetric ); - aVMetric.SetEntryData( nPos, (void*)(long)eFUnit ); - aHMetric.InsertEntry( sMetric ); - aHMetric.SetEntryData( nPos, (void*)(long)eFUnit ); + // a horizontal ruler has not the 'line' unit + // there isn't 'line' unit in HTML format + if ( eFUnit != FUNIT_LINE ) + { + USHORT nPos = aMetricLB.InsertEntry( sMetric ); + aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit ); + aHMetric.InsertEntry( sMetric ); + aHMetric.SetEntryData( nPos, (void*)(long)eFUnit ); + } + // a vetical ruler has not the 'character' unit + if ( eFUnit != FUNIT_CHAR ) + { + USHORT nPos = aVMetric.InsertEntry( sMetric ); + aVMetric.SetEntryData( nPos, (void*)(long)eFUnit ); + } } default:;//prevent warning } diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx index abe43c00f0a3..18c1175fda72 100644 --- a/sw/source/ui/inc/optload.hxx +++ b/sw/source/ui/inc/optload.hxx @@ -68,6 +68,7 @@ private: FixedText aTabFT; MetricField aTabMF; CheckBox aUseSquaredPageMode; + CheckBox aUseCharUnit; SwWrtShell* pWrtShell; sal_Bool bHTMLMode; diff --git a/sw/source/ui/inc/pggrid.hxx b/sw/source/ui/inc/pggrid.hxx index ef8355846a30..26ca0cf1a353 100644 --- a/sw/source/ui/inc/pggrid.hxx +++ b/sw/source/ui/inc/pggrid.hxx @@ -54,12 +54,14 @@ class SwTextGridPage: public SfxTabPage FixedText aLinesPerPageFT; NumericField aLinesPerPageNF; + FixedText aLinesRangeFT; FixedText aTextSizeFT; MetricField aTextSizeMF; FixedText aCharsPerLineFT; NumericField aCharsPerLineNF; + FixedText aCharsRangeFT; FixedText aCharWidthFT; MetricField aCharWidthMF; diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 777479198157..198964a4e034 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -74,10 +75,12 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : aLayoutFL (this, SW_RES(FL_LAYOUT )), aLinesPerPageFT (this, SW_RES(FT_LINESPERPAGE )), aLinesPerPageNF (this, SW_RES(NF_LINESPERPAGE )), + aLinesRangeFT (this, SW_RES(FT_LINERANGE )), aTextSizeFT (this, SW_RES(FT_TEXTSIZE )), aTextSizeMF (this, SW_RES(MF_TEXTSIZE )), aCharsPerLineFT (this, SW_RES(FT_CHARSPERLINE )), aCharsPerLineNF (this, SW_RES(NF_CHARSPERLINE )), + aCharsRangeFT (this, SW_RES(FT_CHARRANGE )), aCharWidthFT (this, SW_RES(FT_CHARWIDTH )), aCharWidthMF (this, SW_RES(MF_CHARWIDTH )), aRubySizeFT (this, SW_RES(FT_RUBYSIZE )), diff --git a/sw/source/ui/misc/pggrid.hrc b/sw/source/ui/misc/pggrid.hrc index e156792c955d..e736e5040dbb 100644 --- a/sw/source/ui/misc/pggrid.hrc +++ b/sw/source/ui/misc/pggrid.hrc @@ -50,3 +50,5 @@ #define CB_SNAPTOCHARS 23 #define FT_CHARWIDTH 24 #define MF_CHARWIDTH 25 +#define FT_LINERANGE 26 +#define FT_CHARRANGE 27 diff --git a/sw/source/ui/misc/pggrid.src b/sw/source/ui/misc/pggrid.src index b03ec2a687c1..747e1325d3da 100644 --- a/sw/source/ui/misc/pggrid.src +++ b/sw/source/ui/misc/pggrid.src @@ -97,6 +97,12 @@ TabPage TP_TEXTGRID_PAGE Last = 154 ; SpinSize = 1 ; }; + FixedText FT_LINERANGE + { + Pos = MAP_APPFONT ( 103 , 82 ) ; + Size = MAP_APPFONT ( 25 , 8 ); + Text [ en-US ] = "( 1 - 48 )" ; + }; FixedText FT_TEXTSIZE { Pos = MAP_APPFONT ( 133 , 82 ) ; @@ -166,6 +172,12 @@ TabPage TP_TEXTGRID_PAGE Last = 5600 ; SpinSize = 5 ; }; + FixedText FT_CHARRANGE + { + Pos = MAP_APPFONT ( 103 , 96 ) ; + Size = MAP_APPFONT ( 25 , 8 ) ; + Text [ en-US ] = "( 1 - 45 )" ; + }; FixedText FT_RUBYSIZE { Pos = MAP_APPFONT ( 133 , 98 ) ; -- cgit From afcc1620eda45972f850af06495f556ee5e42977 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:42:44 +0200 Subject: cjk-character-units-rulers-sync-with-pggrid-fix.diff: --- sw/source/ui/inc/pggrid.hxx | 2 ++ sw/source/ui/misc/pggrid.cxx | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sw/source/ui/inc/pggrid.hxx b/sw/source/ui/inc/pggrid.hxx index 26ca0cf1a353..a9695b3e23f4 100644 --- a/sw/source/ui/inc/pggrid.hxx +++ b/sw/source/ui/inc/pggrid.hxx @@ -85,6 +85,8 @@ class SwTextGridPage: public SfxTabPage Size m_aPageSize; sal_Bool m_bVertical; sal_Bool m_bSquaredMode; + sal_Bool m_bHRulerChanged; + sal_Bool m_bVRulerChanged; SwTextGridPage(Window *pParent, const SfxItemSet &rSet); ~SwTextGridPage(); diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 198964a4e034..9c3972289e15 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -95,7 +95,9 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : m_bRubyUserValue(sal_False), m_aPageSize(MM50, MM50), m_bVertical(sal_False), - m_bSquaredMode(sal_False) + m_bSquaredMode(sal_False), + m_bHRulerChanged( sal_False ), + m_bVRulerChanged( sal_False ) { FreeResource(); @@ -229,6 +231,12 @@ BOOL SwTextGridPage::FillItemSet(SfxItemSet &rSet) bRet = TRUE; } + // draw ticks of ruler + SwView * pView = ::GetActiveView(); + if ( m_bHRulerChanged ) + pView->GetHLineal().DrawTicks(); + if ( m_bVRulerChanged ) + pView->GetVLineal().DrawTicks(); return bRet; } /*-- 06.02.2002 15:25:40--------------------------------------------------- @@ -315,9 +323,17 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet) aGridItem.SetColor(aColorLB.GetSelectEntryColor()); rSet.Put(aGridItem); /// Amelia - SwView * pView = ::GetActiveView(); - pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); - pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); + if ( aGridItem.GetGridType() != GRID_NONE ) + { + SwView * pView = ::GetActiveView(); + if ( aGridItem.GetGridType() == GRID_LINES_CHARS ) + { + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); + m_bHRulerChanged = sal_True; + } + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); + m_bVRulerChanged = sal_True; + } } /* -----------------------------08.02.2002 10:54------------------------------ -- cgit From c9326d9df33ec9d25ea72511511d4294857743b3 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:43:46 +0200 Subject: cjk-character-units-fix.diff: add a new unit 'character unit' i#356101 --- sw/source/ui/app/appopt.cxx | 1 + sw/source/ui/app/swmodul1.cxx | 6 ++++-- sw/source/ui/config/optload.cxx | 3 +++ sw/source/ui/config/optload.src | 3 +-- sw/source/ui/config/usrpref.cxx | 3 ++- sw/source/ui/misc/pggrid.cxx | 6 +++--- sw/source/ui/uiview/view.cxx | 6 ++++-- 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 0bc088f06a98..00a96d152b53 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -230,6 +230,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) pAppView->GetVLinealMetric(eUnit); pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< UINT16 >(eUnit) )); pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< UINT16 >(pPref->GetMetric()) )); + pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit())); if(bTextDialog) { if(pAppView) diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index e4b152257141..f27c89478a8a 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -348,8 +348,10 @@ void SwModule::ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb) } else { - eHScrollMetric = FUNIT_CM; - eVScrollMetric = FUNIT_CM; + if ( eHScrollMetric == FUNIT_CHAR ) + eHScrollMetric == FUNIT_CM; + if ( eVScrollMetric == FUNIT_LINE ) + eVScrollMetric == FUNIT_CM; } SwView* pTmpView = SwModule::GetFirstView(); // fuer alle MDI-Fenster das Lineal umschalten diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 2dbe2bfabd48..01cfd97b1374 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -148,7 +148,10 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : SvtCJKOptions aCJKOptions; if(!aCJKOptions.IsAsianTypographyEnabled()) + { aUseSquaredPageMode.Hide(); + aUseCharUnit.Hide(); + } } /*-----------------18.01.97 12.43------------------- diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src index cab9d4831f8c..c53234b02d5a 100644 --- a/sw/source/ui/config/optload.src +++ b/sw/source/ui/config/optload.src @@ -144,8 +144,7 @@ TabPage TP_OPTLOAD_PAGE { Pos = MAP_APPFONT ( 12 , 130) ; Size = MAP_APPFONT ( 109 , 10 ) ; - Text [ de ] = "appy char unit" ; - Text [ en-US ] = "apply char unit"; + Text [ en-US ] = "Enable char unit"; Text [ x-comment ] = " "; }; diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index 013e7dcfaa94..a08e1eddfe96 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -63,6 +63,7 @@ SwMasterUsrPref::SwMasterUsrPref(BOOL bWeb) : bIsVScrollMetricSet(sal_False), nDefTab( MM50 * 4 ), bIsSquaredPageMode(sal_False), + bApplyCharUnit(sal_False), aContentConfig(bWeb, *this), aLayoutConfig(bWeb, *this), aGridConfig(bWeb, *this), @@ -333,7 +334,7 @@ void SwLayoutViewConfig::Commit() case 16: pValues[nProp] <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;// "ViewLayout/Columns", case 17: bSet = rParent.IsViewLayoutBookMode(); break;// "ViewLayout/BookMode", case 18: bSet = rParent.IsSquaredPageMode(); break;// "Other/IsSquaredPageMode", - case 19: bSet = rParent.IsApplyCharUnit(); break;// "Other/IsApplyCharUnit", + case 19: bSet = rParent.IsApplyCharUnit(); break;// "Other/ApplyCharUnit", } if(nProp < 8 || nProp == 10 || nProp == 15 || nProp == 17 || nProp == 18 || nProp == 19 ) pValues[nProp].setValue(&bSet, ::getBooleanCppuType()); diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 9c3972289e15..91102a528d1a 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -323,17 +323,17 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet) aGridItem.SetColor(aColorLB.GetSelectEntryColor()); rSet.Put(aGridItem); /// Amelia + SwView * pView = ::GetActiveView(); if ( aGridItem.GetGridType() != GRID_NONE ) { - SwView * pView = ::GetActiveView(); if ( aGridItem.GetGridType() == GRID_LINES_CHARS ) { - pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); m_bHRulerChanged = sal_True; } - pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); m_bVRulerChanged = sal_True; } + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); } /* -----------------------------08.02.2002 10:54------------------------------ diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 3579cdc952f6..b2458cad9929 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -116,6 +116,7 @@ #include #include +#include using namespace ::com::sun::star; @@ -953,13 +954,14 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) FieldUnit eMetric = pUsrPref->GetHScrollMetric(); BOOL bApplyCharUnit = pUsrPref->IsApplyCharUnit(); - if ( bApplyCharUnit ) + SvtCJKOptions aCJKOptions; + if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) pHRuler->SetUnit( FUNIT_CHAR ); else pHRuler->SetUnit( eMetric ); eMetric = pUsrPref->GetVScrollMetric(); - if ( bApplyCharUnit ) + if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) pVRuler->SetUnit(FUNIT_LINE); else pVRuler->SetUnit( eMetric ); -- cgit From 69fa7431782484a66113ee35bd3381556083142a Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:45:00 +0200 Subject: cjk-character-units-fix-376788.diff: add a new character unit i#376788 --- sw/source/ui/app/swmodul1.cxx | 14 ++++++++++---- sw/source/ui/config/optload.cxx | 8 +++++--- sw/source/ui/misc/pggrid.cxx | 4 ++-- sw/source/ui/uiview/view.cxx | 36 ++++++++++++++++++++++++++++++------ 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index f27c89478a8a..932b849e82bc 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -348,10 +349,15 @@ void SwModule::ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb) } else { - if ( eHScrollMetric == FUNIT_CHAR ) - eHScrollMetric == FUNIT_CM; - if ( eVScrollMetric == FUNIT_LINE ) - eVScrollMetric == FUNIT_CM; + SvtCJKOptions aCJKOptions; + if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eHScrollMetric == FUNIT_CHAR )) + eHScrollMetric = FUNIT_INCH; + else if ( eHScrollMetric == FUNIT_CHAR ) + eHScrollMetric = FUNIT_CM; + if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eVScrollMetric == FUNIT_LINE )) + eVScrollMetric = FUNIT_INCH; + else if ( eVScrollMetric == FUNIT_LINE ) + eVScrollMetric = FUNIT_CM; } SwView* pTmpView = SwModule::GetFirstView(); // fuer alle MDI-Fenster das Lineal umschalten diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 01cfd97b1374..383252a52568 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -127,7 +127,6 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : case FUNIT_POINT: case FUNIT_PICA: case FUNIT_INCH: - case FUNIT_CHAR: { // nur diese Metriken benutzen USHORT nPos = aMetricLB.InsertEntry( sMetric ); @@ -229,9 +228,12 @@ BOOL __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) bRet = TRUE; } - if(aUseCharUnit.IsChecked() != aUseCharUnit.GetSavedValue()) + sal_Bool bIsUseCharUnitFlag = aUseCharUnit.IsChecked(); + SvtCJKOptions aCJKOptions; + bIsUseCharUnitFlag = bIsUseCharUnitFlag && aCJKOptions.IsAsianTypographyEnabled(); + if( bIsUseCharUnitFlag != aUseCharUnit.GetSavedValue()) { - rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, aUseCharUnit.IsChecked())); + rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bIsUseCharUnitFlag )); bRet = TRUE; } diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 91102a528d1a..30ed2ca5c302 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -331,9 +331,9 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet) m_bHRulerChanged = sal_True; } m_bVRulerChanged = sal_True; + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); } - pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); - pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); } /* -----------------------------08.02.2002 10:54------------------------------ diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index b2458cad9929..1b7b56c6e75d 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -955,16 +955,40 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) BOOL bApplyCharUnit = pUsrPref->IsApplyCharUnit(); SvtCJKOptions aCJKOptions; - if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) - pHRuler->SetUnit( FUNIT_CHAR ); + if ( aCJKOptions.IsAsianTypographyEnabled() ) + { + if ( bApplyCharUnit ) + eMetric = FUNIT_CHAR; + else + { + if ( eMetric == FUNIT_CHAR ) + eMetric = FUNIT_CM; + } + } else - pHRuler->SetUnit( eMetric ); + { + if ( eMetric == FUNIT_CHAR ) + eMetric = FUNIT_INCH; + } + pHRuler->SetUnit( eMetric ); eMetric = pUsrPref->GetVScrollMetric(); - if ( aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) - pVRuler->SetUnit(FUNIT_LINE); + if ( aCJKOptions.IsAsianTypographyEnabled() ) + { + if ( bApplyCharUnit ) + eMetric = FUNIT_LINE; + else + { + if ( eMetric == FUNIT_LINE ) + eMetric = FUNIT_CM; + } + } else - pVRuler->SetUnit( eMetric ); + { + if ( eMetric == FUNIT_LINE ) + eMetric = FUNIT_INCH; + } + pVRuler->SetUnit( eMetric ); pHRuler->SetCharWidth( 371 ); // default character width pVRuler->SetLineHeight( 551 ); // default line height -- cgit From bec7709b4a8d219f8da3e175c1ecf4db21495dae Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:46:36 +0200 Subject: cjk-character-units-in-pggrid-fix.diff: add a new character unit --- sw/source/ui/inc/pggrid.hxx | 1 + sw/source/ui/misc/pggrid.cxx | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/sw/source/ui/inc/pggrid.hxx b/sw/source/ui/inc/pggrid.hxx index a9695b3e23f4..b2e97b65fb62 100644 --- a/sw/source/ui/inc/pggrid.hxx +++ b/sw/source/ui/inc/pggrid.hxx @@ -93,6 +93,7 @@ class SwTextGridPage: public SfxTabPage void UpdatePageSize(const SfxItemSet& rSet); void PutGridItem(SfxItemSet& rSet); + void SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue ); DECL_LINK(GridTypeHdl, RadioButton*); DECL_LINK(CharorLineChangedHdl, SpinField*); diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 30ed2ca5c302..366edfded07b 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -259,6 +259,7 @@ void SwTextGridPage::Reset(const SfxItemSet &rSet) GridTypeHdl(pButton); aSnapToCharsCB.Check(rGridItem.IsSnapToChars()); aLinesPerPageNF.SetValue(rGridItem.GetLines()); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); m_nRubyUserValue = rGridItem.GetBaseHeight(); m_bRubyUserValue = sal_True; aTextSizeMF.SetValue(aTextSizeMF.Normalize(m_nRubyUserValue), FUNIT_TWIP); @@ -384,6 +385,12 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet) if ( m_bSquaredMode ) { aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize); + aCharsPerLineNF.SetMax( aCharsPerLineNF.GetValue() ); + aLinesPerPageNF.SetMax( m_aPageSize.Height() / + ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) + + aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP)))); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } else { @@ -393,9 +400,21 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet) aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth); else aCharsPerLineNF.SetValue( 45 ); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } } } +/* -----------------------------30.05.2008 14:12------------------------------ + + ---------------------------------------------------------------------------*/ +void SwTextGridPage::SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue ) +{ + String aFieldStr = String::CreateFromAscii("( 1 -"); + aFieldStr += String::CreateFromInt32( nValue ); + aFieldStr += String::CreateFromAscii(" )"); + rField.SetText( aFieldStr ); +} /* -----------------------------06.02.2002 15:24------------------------------ ---------------------------------------------------------------------------*/ @@ -430,6 +449,8 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP)))); aLinesPerPageNF.SetMax(nMaxLines); } + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); } else//in normal mode { @@ -438,10 +459,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue()); aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP); aRubySizeMF.SetValue(0, FUNIT_TWIP); - String aMaxLinesFTStr = String::CreateFromAscii("( 1 - "); - aMaxLinesFTStr += String::CreateFromInt32(aLinesPerPageNF.GetValue()); - aMaxLinesFTStr += String::CreateFromAscii(" )"); - aLinesRangeFT.SetText( aMaxLinesFTStr ); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); m_nRubyUserValue = nHeight; m_bRubyUserValue = sal_True; @@ -450,10 +468,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) { long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue()); aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP); - String aMaxCharsFTStr = String::CreateFromAscii("( 1 - "); - aMaxCharsFTStr += String::CreateFromInt32(aCharsPerLineNF.GetValue()); - aMaxCharsFTStr += String::CreateFromAscii(" )"); - aCharsRangeFT.SetText( aMaxCharsFTStr ); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); } } GridModifyHdl(0); @@ -477,6 +492,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) + aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP)))); aLinesPerPageNF.SetMax(nMaxLines); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } } else @@ -486,10 +502,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP))); aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize); m_bRubyUserValue = sal_False; - String aRangesStr = String::CreateFromAscii("( 1 - "); - aRangesStr += String::CreateFromInt32( m_aPageSize.Height() / nTextSize ); - aRangesStr += String::CreateFromAscii(" )"); - aLinesRangeFT.SetText( aRangesStr ); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } else if (&aCharWidthMF == pField) { @@ -498,10 +511,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) if (nTextWidth) nMaxChar = m_aPageSize.Width() / nTextWidth; aCharsPerLineNF.SetValue( nMaxChar ); - String aCharRangeStr = String::CreateFromAscii("( 1 - "); - aCharRangeStr += String::CreateFromInt32( nMaxChar ); - aCharRangeStr += String::CreateFromAscii(" )"); - aCharsRangeFT.SetText( aCharRangeStr ); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); } //rubySize is disabled } -- cgit From a2042c306e2cd449328aad331edc438363732833 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:37:50 +0200 Subject: cjk-character-units-imp.diff: add a new unit 'character unit' --- svx/inc/dlgutil.hxx | 1 + svx/source/dialog/dlgutil.cxx | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/svx/inc/dlgutil.hxx b/svx/inc/dlgutil.hxx index 9f0d5190daed..235898ef266e 100644 --- a/svx/inc/dlgutil.hxx +++ b/svx/inc/dlgutil.hxx @@ -39,6 +39,7 @@ class SfxItemSet; SVX_DLLPUBLIC FieldUnit GetModuleFieldUnit( const SfxItemSet& ); +SVX_DLLPUBLIC BOOL GetApplyCharUnit( const SfxItemSet& ); #define OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT) #define OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT) diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx index 6c7a42f90970..b230f1c08933 100644 --- a/svx/source/dialog/dlgutil.cxx +++ b/svx/source/dialog/dlgutil.cxx @@ -35,6 +35,9 @@ #include #include #include +#include +#include +#include // ----------------------------------------------------------------------- @@ -53,3 +56,33 @@ FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet ) return eUnit; } +BOOL GetApplyCharUnit( const SfxItemSet& rSet ) +{ + BOOL bUseCharUnit = FALSE; + const SfxPoolItem* pItem = NULL; + if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_APPLYCHARUNIT, FALSE, &pItem ) ) + bUseCharUnit = (BOOL)( (const SfxBoolItem*)pItem )->GetValue(); + else + { + // FIXME - this might be wrong, cf. the DEV300 changes in GetModuleFieldUnit() + SfxViewFrame* pFrame = SfxViewFrame::Current(); + SfxObjectShell* pSh = NULL; + if ( pFrame ) + pSh = pFrame->GetObjectShell(); + if ( pSh ) // #93209# the object shell is not always available during reload + { + SfxModule* pModule = pSh->GetModule(); + if ( pModule ) + { + pItem = pModule->GetItem( SID_ATTR_APPLYCHARUNIT ); + if ( pItem ) + bUseCharUnit = (BOOL)( (SfxBoolItem*)pItem )->GetValue(); + } + else + { + DBG_ERRORFILE( "GetApplyCharUnit(): no module found" ); + } + } + } + return bUseCharUnit; +} -- cgit From 954dcb2858da1c83914f8421817b4c85c33d28df Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:40:56 +0200 Subject: cjk-character-units-ui.diff: add a new unit 'character unit' --- .../schema/org/openoffice/Office/Writer.xcs | 12 ++++++++++ sfx2/inc/sfx2/sfxsids.hrc | 1 + sfx2/sdi/sfx.sdi | 27 ++++++++++++++++++++++ svx/source/dialog/ruler.hrc | 3 ++- svx/source/dialog/ruler.src | 12 ++++++++++ svx/source/dialog/sdstring.src | 2 ++ svx/source/dialog/svxruler.cxx | 11 +++++++-- 7 files changed, 65 insertions(+), 3 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 4a3c2c02c396..7dc2ee58b112 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -1651,6 +1651,18 @@ false
+ + + + + + + OS + apply char unit to calculate the paragraph's indent + + + true + diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 26e1991c24b8..dacf29b67199 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -757,6 +757,7 @@ #define SID_ATTR_QUICKLAUNCHER (SID_OPTIONS_START + 74) #define SID_ATTR_YEAR2000 (SID_OPTIONS_START + 87) #define SID_ATTR_ALLOWFOLDERWEBVIEW (SID_OPTIONS_START + 92) +#define SID_ATTR_APPLYCHARUNIT (SID_OPTIONS_START + 88) // PathTabPage diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 8ca8645a05ff..1eb45a62a9a7 100755 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -3829,6 +3829,33 @@ SfxUInt16Item MetricUnit SID_ATTR_METRIC GroupId = ; ] +//-------------------------------------------------------------------------- +SfxBoolItem ApplyCharUnit SID_ATTR_APPLYCHARUNIT + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_VIEW; +] + //-------------------------------------------------------------------------- SfxBoolItem Modified SID_MODIFIED diff --git a/svx/source/dialog/ruler.hrc b/svx/source/dialog/ruler.hrc index 1280b1237bc5..6aa5e4618da4 100644 --- a/svx/source/dialog/ruler.hrc +++ b/svx/source/dialog/ruler.hrc @@ -34,4 +34,5 @@ #define ID_MILE 10 #define ID_POINT 6 #define ID_PICA 7 - +#define ID_CHAR 11 +#define ID_LINE 12 diff --git a/svx/source/dialog/ruler.src b/svx/source/dialog/ruler.src index 4d0218f525ee..ef965a6a7752 100644 --- a/svx/source/dialog/ruler.src +++ b/svx/source/dialog/ruler.src @@ -87,6 +87,18 @@ Menu RID_SVXMN_RULER Checkable = TRUE ; Text [ en-US ] = "Pica" ; }; + MenuItem + { + Identifier = ID_CHAR ; + Checkable = TRUE ; + Text[ en-US ] = "Char" ; + }; + MenuItem + { + Identifier = ID_LINE ; + Checkable = TRUE ; + Text[ en-US ] = "Line" ; + }; }; }; String RID_SVXSTR_RULER_TAB_LEFT diff --git a/svx/source/dialog/sdstring.src b/svx/source/dialog/sdstring.src index 4b70dda6a151..fc4662994b69 100644 --- a/svx/source/dialog/sdstring.src +++ b/svx/source/dialog/sdstring.src @@ -1178,6 +1178,8 @@ StringArray RID_SVXSTR_FIELDUNIT_TABLE < "Miles" ; FUNIT_MILE ; > ; < "Pica" ; FUNIT_PICA ; > ; < "Point" ; FUNIT_POINT ; > ; + < "Char" ; FUNIT_CHAR ; > ; + < "Line" ; FUNIT_LINE ; > ; }; }; diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 7705a2dd08df..3aa4e9d235df 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -3763,8 +3763,15 @@ void SvxRuler::Command( const CommandEvent& rCEvt ) (nId == FUNIT_M || nId == FUNIT_KM || nId == FUNIT_FOOT || - nId == FUNIT_MILE )) - aMenu.RemoveItem(i - 1); + nId == FUNIT_MILE || + nId == FUNIT_CHAR || + nId == FUNIT_LINE )) + if (( nId == FUNIT_CHAR ) && bHorz ) + ; + else if (( nId == FUNIT_LINE ) && !bHorz ) + ; + else + aMenu.RemoveItem(i - 1); } aMenu.Execute( this, rCEvt.GetMousePosPixel() ); } -- cgit From 777969e38b46ec3138e1c365260d136a0f1e7817 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:43:45 +0200 Subject: cjk-character-units-fix.diff: add a new unit 'character unit' i#356101 --- .../schema/org/openoffice/Office/Writer.xcs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 7dc2ee58b112..9abada415fbd 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -1588,6 +1588,18 @@ true + + + + + + + OS + apply char unit to calculate the paragraph's indent + + + true + @@ -1651,18 +1663,6 @@ false - - - - - - - OS - apply char unit to calculate the paragraph's indent - - - true - -- cgit From 51fb3c7f1925c7d1604549dfd8fcc0139e54a36b Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:37:51 +0200 Subject: cjk-character-units-imp.diff: add a new unit 'character unit' --- svtools/inc/ruler.hxx | 7 +++++++ svtools/source/control/ruler.cxx | 42 +++++++++++++++++++++++++++++++++++++--- svtools/source/misc/unitconv.cxx | 3 +++ 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/svtools/inc/ruler.hxx b/svtools/inc/ruler.hxx index c2649b298ba6..bcf441e5c2d2 100644 --- a/svtools/inc/ruler.hxx +++ b/svtools/inc/ruler.hxx @@ -690,6 +690,10 @@ private: USHORT mnExtraStyle; USHORT mnExtraClicks; USHORT mnExtraModifier; +// Amelia + long mnCharWidth; + long mnLineHeight; + RulerExtra meExtraType; RulerType meDragType; MapUnit meSourceUnit; @@ -869,6 +873,9 @@ public: //set text direction right-to-left void SetTextRTL(BOOL bRTL); + + void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; } + void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; } }; #endif // _RULER_HXX diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 6fcbd92597ba..9cf87414650b 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -467,6 +467,25 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) long nY; BOOL bNoTicks = FALSE; + //Amelia + long nTickUnit ; + long nTick2 ; + if ( mnUnitIndex == RULER_UNIT_CHAR ) + { + nTick3 = mnCharWidth; + nTickCount = mnCharWidth; + nTickUnit = mnCharWidth; + nTick2 = mnCharWidth; + } + else if ( mnUnitIndex == RULER_UNIT_LINE ) + { + nTick3 = mnLineHeight; + nTickCount = mnLineHeight; + nTickUnit = mnLineHeight; + nTick2 = mnLineHeight; + } + aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode ); + // Groessenvorberechnung BOOL bVertRight = FALSE; if ( mnWinStyle & WB_HORZ ) @@ -487,7 +506,11 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width(); if ( nMaxWidth < 0 ) nMaxWidth *= -1; - nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit; +// Amelia + if (( mnUnitIndex == RULER_UNIT_CHAR ) || ( mnUnitIndex == RULER_UNIT_LINE )) + nMaxWidth /= nTickUnit; + else + nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit; UniString aNumStr( UniString::CreateFromInt32( nMaxWidth ) ); long nTxtWidth = GetTextWidth( aNumStr ); if ( (nTxtWidth*2) > nTickWidth ) @@ -567,7 +590,11 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) // Tick3 - Ausgabe (Text) if ( !(nTick % nTick3) ) { - aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit ); + //aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit ); + if ( ( mnUnitIndex == RULER_UNIT_CHAR ) || ( mnUnitIndex == RULER_UNIT_LINE ) ) + aNumStr = UniString::CreateFromInt32( nTick / nTickUnit ); + else + aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit ); nTxtWidth2 = GetTextWidth( aNumStr )/2; nX = nStart+n; @@ -594,7 +621,10 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) // Tick/Tick2 - Ausgabe (Striche) else { - if ( !(nTick % aImplRulerUnitTab[mnUnitIndex].nTick2) ) + /// Amelia + if ( ( mnUnitIndex != RULER_UNIT_CHAR ) && ( mnUnitIndex != RULER_UNIT_LINE ) ) + nTick2 = aImplRulerUnitTab[mnUnitIndex].nTick2; + if ( !(nTick % nTick2 ) ) nTickWidth = RULER_TICK2_WIDTH; else nTickWidth = RULER_TICK1_WIDTH; @@ -2804,6 +2834,12 @@ void Ruler::SetUnit( FieldUnit eNewUnit ) case FUNIT_PICA: mnUnitIndex = RULER_UNIT_PICA; break; + case FUNIT_CHAR: + mnUnitIndex = RULER_UNIT_CHAR; + break; + case FUNIT_LINE: + mnUnitIndex = RULER_UNIT_LINE; + break; default: #ifdef DBG_UTIL DBG_ERRORFILE( "Ruler::SetUnit() - Wrong Unit" ); diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index 612bcb4f0221..709ead2584a8 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -63,6 +63,9 @@ void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll ) rField.SetUnit( eUnit ); switch( eUnit ) { + // _CHAR and _LINE sets the step of "char" and "line" unit, they are same as FUNIT_MM + case FUNIT_CHAR: + case FUNIT_LINE: case FUNIT_MM: rField.SetSpinSize( 50 ); break; -- cgit From c85db626029fd8a5e0dfcb312937279df32339a0 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:40:57 +0200 Subject: cjk-character-units-ui.diff: add a new unit 'character unit' --- rsc/inc/vclrsc.hxx | 2 +- rsc/source/parser/rscibas.cxx | 3 +++ svl/inc/svl/poolitem.hxx | 2 +- svtools/source/control/ruler.cxx | 8 ++++++-- tools/inc/tools/fldunit.hxx | 2 +- vcl/source/control/field.cxx | 34 +++++++++++++++++++++------------- vcl/source/src/units.src | 3 +++ 7 files changed, 36 insertions(+), 18 deletions(-) diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx index 19677171dcb2..49847bd91e69 100644 --- a/rsc/inc/vclrsc.hxx +++ b/rsc/inc/vclrsc.hxx @@ -173,7 +173,7 @@ typedef sal_Int64 WinBits; // from vcl/inc/fldunit.hxx enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM, FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA, - FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM, + FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM, FUNIT_PERCENT, FUNIT_100TH_MM }; diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx index 1a896c897e27..6b79b4fdd3b3 100644 --- a/rsc/source/parser/rscibas.cxx +++ b/rsc/source/parser/rscibas.cxx @@ -237,6 +237,9 @@ RscEnum * RscTypCont::InitFieldUnitsType() SETCONST( pFieldUnits, "FUNIT_FOOT", FUNIT_FOOT ); SETCONST( pFieldUnits, "FUNIT_MILE", FUNIT_MILE ); SETCONST( pFieldUnits, "FUNIT_CUSTOM", FUNIT_CUSTOM ); + // Amelia : adds two units ,"char" and "line" + SETCONST( pFieldUnits, "FUNIT_CHAR", FUNIT_CHAR ); + SETCONST( pFieldUnits, "FUNIT_LINE", FUNIT_LINE ); SETCONST( pFieldUnits, "FUNIT_PERCENT", FUNIT_PERCENT ); return pFieldUnits; diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index c0cf53fb6ded..498b48d31aac 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.hxx @@ -100,7 +100,7 @@ enum SfxFieldUnit { SFX_FUNIT_NONE, SFX_FUNIT_MM, SFX_FUNIT_CM, SFX_FUNIT_M, SFX_FUNIT_KM, SFX_FUNIT_TWIP, SFX_FUNIT_POINT, SFX_FUNIT_PICA, - SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CUSTOM + SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CHAR, SFX_FUNIT_LINE, SFX_FUNIT_CUSTOM }; enum SfxMapUnit diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 9cf87414650b..9897c96e1672 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -81,7 +81,9 @@ #define RULER_UNIT_MILE 6 #define RULER_UNIT_POINT 7 #define RULER_UNIT_PICA 8 -#define RULER_UNIT_COUNT 9 +#define RULER_UNIT_CHAR 9 +#define RULER_UNIT_LINE 10 +#define RULER_UNIT_COUNT 11 // ----------------- // - ImplRulerData - @@ -145,7 +147,9 @@ static ImplRulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT] = { MAP_100TH_INCH, 1200, 120, 600, 1200, 30480, 3, "'" }, // FOOT { MAP_10TH_INCH, 633600, 63360, 316800, 633600, 1609344, 4, " miles" }, // MILE { MAP_POINT, 1, 12, 12, 36, 353, 2, " pt" }, // POINT -{ MAP_100TH_MM, 423, 423, 423, 846, 423, 3, " pi" } // PICA +{ MAP_100TH_MM, 423, 423, 423, 846, 423, 3, " pi" }, // PICA +{ MAP_100TH_MM, 371, 371, 371, 743, 371, 3, " ch" }, // CHAR +{ MAP_100TH_MM, 551, 551, 551, 1102, 551, 3, " li" } // LINE }; // ======================================================================= diff --git a/tools/inc/tools/fldunit.hxx b/tools/inc/tools/fldunit.hxx index 637539f6dd6f..d877776d4d86 100644 --- a/tools/inc/tools/fldunit.hxx +++ b/tools/inc/tools/fldunit.hxx @@ -35,7 +35,7 @@ // By changes you must also change: rsc/vclrsc.hxx enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM, FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA, - FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM, + FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM, FUNIT_PERCENT, FUNIT_100TH_MM }; #endif // _TOOLS_FLDUNIT_HXX diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 090aa2a84163..db8d210e2f67 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1128,6 +1128,10 @@ static FieldUnit ImplStringToMetric( const String &rMetricString ) if ( strAllUnits->GetString( i ).Equals( aStr ) ) return (FieldUnit) strAllUnits->GetValue( i ); + // Amelia : about character unit + if (aStr.EqualsIgnoreCaseAscii("cm")) + return FUNIT_CM; + return FUNIT_NONE; } @@ -1143,20 +1147,24 @@ static FieldUnit ImplMetricGetUnit( const XubString& rStr ) #define M *1000000L #define X *5280L -static const sal_Int64 aImplFactor[FUNIT_MILE+1][FUNIT_MILE+1] = +// Amelia : about measurement unit, 'char' and 'line' +//static const sal_Int64 aImplFactor[FUNIT_MILE+1][FUNIT_MILE+1] = +static const sal_Int64 aImplFactor[FUNIT_LINE+1][FUNIT_LINE+1] = { /* -mm/100 mm cm m km twip point pica inch foot mile */ -{ 1, 100, 1 K, 100 K, 100 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X }, -{ 1, 1, 10, 1 K, 1 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X }, -{ 1, 1, 1, 100, 100 K, 254, 254, 254, 254, 254*12, 254*12 X }, -{ 1, 1, 1, 1, 1 K, 254, 254, 254, 254, 254*12, 254*12 X }, -{ 1, 1, 1, 1, 1, 0, 254, 254, 254, 254*12, 254*12 X }, -{ 1440,144 K,144 K,14400 K, 0, 1, 20, 240, 1440,1440*12,1440*12 X }, -{ 72, 7200, 7200, 720 K, 720 M, 1, 1, 12, 72, 72*12, 72*12 X }, -{ 6, 600, 600, 60 K, 60 M, 1, 1, 1, 6, 6*12, 6*12 X }, -{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 12, 12 X }, -{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 X }, -{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 } +mm/100 mm cm m km twip point pica inch foot mile char line*/ +{ 1, 100, 1 K, 100 K, 100 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X , 53340, 396240}, +{ 1, 1, 10, 1 K, 1 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X , 5334, 396240}, +{ 1, 1, 1, 100, 100 K, 254, 254, 254, 254, 254*12, 254*12 X , 5334, 39624}, +{ 1, 1, 1, 1, 1 K, 254, 254, 254, 254, 254*12, 254*12 X , 533400, 39624}, +{ 1, 1, 1, 1, 1, 0, 254, 254, 254, 254*12, 254*12 X ,533400 K, 39624}, +{ 1440,144 K,144 K,14400 K, 0, 1, 20, 240, 1440,1440*12,1440*12 X , 210, 3120}, +{ 72, 7200, 7200, 720 K, 720 M, 1, 1, 12, 72, 72*12, 72*12 X , 210, 156}, +{ 6, 600, 600, 60 K, 60 M, 1, 1, 1, 6, 6*12, 6*12 X , 210, 10}, +{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 12, 12 X , 210, 45}, +{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 X , 210, 45}, +{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 , 210, 45}, +{ 144, 1440,14400, 14400, 14400, 1, 20, 240, 1440,1440*12, 1440*12 X, 1, 156 }, +{ 720,72000,72000, 7200 K,7200 M, 20, 10, 13, 11, 11*12, 11*12 X, 105, 1 } }; #undef X diff --git a/vcl/source/src/units.src b/vcl/source/src/units.src index 16b40b3f41a3..0a680fcb1913 100644 --- a/vcl/source/src/units.src +++ b/vcl/source/src/units.src @@ -30,6 +30,7 @@ #include #endif +// Amelia : adds two units , 'ch' and 'line' StringArray SV_FUNIT_STRINGS { ItemList [ en-US ] = @@ -51,6 +52,8 @@ StringArray SV_FUNIT_STRINGS < "feet" ; FUNIT_FOOT ; > ; < "miles" ; FUNIT_MILE ; > ; < "mile" ; FUNIT_MILE ; > ; + < "ch" ; FUNIT_CHAR ; > ; + < "line" ; FUNIT_LINE ; > ; < "%" ; FUNIT_PERCENT ; > ; }; }; -- cgit From 07a5627d92719740b5f16fdd8d53926acfffbde6 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:42:43 +0200 Subject: cjk-character-units-rulers-sync-with-pggrid-fix.diff: --- svtools/inc/ruler.hxx | 2 ++ svtools/source/control/ruler.cxx | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/svtools/inc/ruler.hxx b/svtools/inc/ruler.hxx index bcf441e5c2d2..3caa9cd6bccd 100644 --- a/svtools/inc/ruler.hxx +++ b/svtools/inc/ruler.hxx @@ -876,6 +876,8 @@ public: void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; } void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; } + + void DrawTicks(); }; #endif // _RULER_HXX diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 9897c96e1672..92c33e988c84 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -476,14 +476,14 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) long nTick2 ; if ( mnUnitIndex == RULER_UNIT_CHAR ) { - nTick3 = mnCharWidth; + nTick3 = mnCharWidth*2; nTickCount = mnCharWidth; nTickUnit = mnCharWidth; nTick2 = mnCharWidth; } else if ( mnUnitIndex == RULER_UNIT_LINE ) { - nTick3 = mnLineHeight; + nTick3 = mnLineHeight*2; nTickCount = mnLineHeight; nTickUnit = mnLineHeight; nTick2 = mnLineHeight; @@ -3219,3 +3219,11 @@ const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; } USHORT Ruler::GetIndentCount() const { return mpData->nIndents; } const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; } +/* --------------------------------------------------- + * + * ---------------------------------------------------*/ +void Ruler::DrawTicks() +{ + mbFormat = TRUE; + ImplDraw(); +} -- cgit From 274928f4eb238c703217d473f36b43deb4260d61 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:45:00 +0200 Subject: cjk-character-units-fix-376788.diff: add a new character unit i#376788 --- svtools/source/control/ruler.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 92c33e988c84..65fd042e3dfe 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -268,6 +268,8 @@ void Ruler::ImplInit( WinBits nWinBits ) mnExtraStyle = 0; // Style des Extra-Feldes mnExtraClicks = 0; // Click-Anzahl fuer Extra-Feld mnExtraModifier = 0; // Modifier-Tasten beim Click im Extrafeld + mnCharWidth = 371; + mnLineHeight = 551; mbCalc = TRUE; // Muessen Pagebreiten neu berechnet werden mbFormat = TRUE; // Muss neu ausgegeben werden mbDrag = FALSE; // Sind wir im Drag-Modus @@ -476,6 +478,8 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) long nTick2 ; if ( mnUnitIndex == RULER_UNIT_CHAR ) { + if ( mnCharWidth == 0 ) + mnCharWidth = 371; nTick3 = mnCharWidth*2; nTickCount = mnCharWidth; nTickUnit = mnCharWidth; @@ -483,6 +487,8 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) } else if ( mnUnitIndex == RULER_UNIT_LINE ) { + if ( mnLineHeight == 0 ) + mnLineHeight = 551; nTick3 = mnLineHeight*2; nTickCount = mnLineHeight; nTickUnit = mnLineHeight; -- cgit From 7bd13d9c9d86999bca94e1151c9ac0bdbf05fe13 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:37:50 +0200 Subject: cjk-character-units-imp.diff: add a new unit 'character unit' --- cui/source/tabpages/paragrph.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 26eccfc0bb3e..34f142176760 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -38,6 +38,7 @@ #define _SVX_PARAGRPH_CXX 0 #include +#include #include #include #include "paragrph.hrc" @@ -438,11 +439,19 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) // Metrik einstellen FieldUnit eFUnit = GetModuleFieldUnit( rSet ); + + BOOL bApplyCharUnit = GetApplyCharUnit( rSet ); + + if ( bApplyCharUnit ) + eFUnit = FUNIT_CHAR; SetFieldUnit( aLeftIndent, eFUnit ); SetFieldUnit( aRightIndent, eFUnit ); SetFieldUnit( aFLineIndent, eFUnit ); + if ( bApplyCharUnit ) + eFUnit = FUNIT_LINE; SetFieldUnit( aTopDist, eFUnit ); SetFieldUnit( aBottomDist, eFUnit ); + eFUnit = FUNIT_POINT; SetFieldUnit( aLineDistAtMetricBox, eFUnit ); USHORT _nWhich = GetWhich( SID_ATTR_LRSPACE ); -- cgit From e1e9d3b73c82d0f7448d5ffa1f49d0a5f36b2a22 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:45:00 +0200 Subject: cjk-character-units-fix-376788.diff: add a new character unit i#376788 --- cui/source/tabpages/paragrph.cxx | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 34f142176760..047f55f4f0db 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -442,17 +442,25 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) BOOL bApplyCharUnit = GetApplyCharUnit( rSet ); - if ( bApplyCharUnit ) + SvtCJKOptions aCJKOptions; + if(aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) eFUnit = FUNIT_CHAR; + SetFieldUnit( aLeftIndent, eFUnit ); SetFieldUnit( aRightIndent, eFUnit ); SetFieldUnit( aFLineIndent, eFUnit ); - if ( bApplyCharUnit ) - eFUnit = FUNIT_LINE; - SetFieldUnit( aTopDist, eFUnit ); - SetFieldUnit( aBottomDist, eFUnit ); - eFUnit = FUNIT_POINT; - SetFieldUnit( aLineDistAtMetricBox, eFUnit ); + if ( eFUnit == FUNIT_CHAR ) + { + SetFieldUnit( aTopDist, FUNIT_LINE ); + SetFieldUnit( aBottomDist, FUNIT_LINE ); + SetFieldUnit( aLineDistAtMetricBox, FUNIT_POINT ); + } + else + { + SetFieldUnit( aTopDist, eFUnit ); + SetFieldUnit( aBottomDist, eFUnit ); + SetFieldUnit( aLineDistAtMetricBox, eFUnit ); + } USHORT _nWhich = GetWhich( SID_ATTR_LRSPACE ); SfxItemState eItemState = rSet.GetItemState( _nWhich ); @@ -544,7 +552,10 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) else { aTopDist.SetRelative(); - SetFieldUnit( aTopDist, eFUnit ); + if ( eFUnit == FUNIT_CHAR ) + SetFieldUnit( aTopDist, FUNIT_LINE ); + else + SetFieldUnit( aTopDist, eFUnit ); SetMetricValue( aTopDist, rOldItem.GetUpper(), eUnit ); } @@ -556,7 +567,10 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) else { aBottomDist.SetRelative(); - SetFieldUnit( aBottomDist, eFUnit ); + if ( eFUnit == FUNIT_CHAR ) + SetFieldUnit( aBottomDist, FUNIT_LINE ); + else + SetFieldUnit( aBottomDist, eFUnit ); SetMetricValue( aBottomDist, rOldItem.GetLower(), eUnit ); } } -- cgit From e30fb4609b9d7333deb4401e0c41ee64b8da9f1b Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 13 Sep 2010 17:15:50 +0200 Subject: sw-rtf-num-fix.diff:Fixes for RTF numbering export n#569266 --- sw/source/filter/rtf/rtfatr.cxx | 12 +++---- sw/source/filter/rtf/rtfnum.cxx | 78 +++++++++++++---------------------------- 2 files changed, 31 insertions(+), 59 deletions(-) diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx index 17050299c84b..7d450178818b 100644 --- a/sw/source/filter/rtf/rtfatr.cxx +++ b/sw/source/filter/rtf/rtfatr.cxx @@ -438,15 +438,15 @@ bool SwFmtToSet(SwRTFWriter& rWrt, const SwFmt& rFmt, SfxItemSet &rSet) } const SwNumFmt* pNFmt = &rWrt.pDoc->GetOutlineNumRule()->Get( static_cast(nLvl) ); - if( pNFmt->GetAbsLSpace() ) + if( pNFmt->GetIndentAt() ) { SfxItemSet aSet( *rFmt.GetAttrSet().GetPool(), rFmt.GetAttrSet().GetRanges() ); aSet.SetParent( &rFmt.GetAttrSet() ); SvxLRSpaceItem aLR( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) ); - aLR.SetTxtLeft( aLR.GetTxtLeft() + pNFmt->GetAbsLSpace() ); - aLR.SetTxtFirstLineOfst( pNFmt->GetFirstLineOffset() ); + aLR.SetTxtLeft( aLR.GetTxtLeft() + pNFmt->GetIndentAt() ); + aLR.SetTxtFirstLineOfst( pNFmt->GetFirstLineIndent() ); aSet.Put(aLR); rSet.Put(aSet); @@ -1210,7 +1210,7 @@ static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) } // gibt es harte Attributierung ? - if( bNewFmts && pNd->HasSwAttrSet()) + if( pNd->HasSwAttrSet() ) { rRTFWrt.pFlyFmt = 0; @@ -1233,9 +1233,9 @@ static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) SfxItemSet aSet( rNdSet ); SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) ); - aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() ); + aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() ); if( MAXLEVEL > pNd->GetActualListLevel() ) - aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() ); + aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineIndent() ); else aSet.ClearItem( RES_PARATR_NUMRULE ); aSet.Put( aLR ); diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx index 84719b2f1255..b930d25b86c8 100644 --- a/sw/source/filter/rtf/rtfnum.cxx +++ b/sw/source/filter/rtf/rtfnum.cxx @@ -1,29 +1,3 @@ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" @@ -43,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +47,7 @@ void lcl_ExpandNumFmts( SwNumRule& rRule ) if( !rRule.GetNumFmt( n ) ) { SwNumFmt aNumFmt( rRule.Get( 0 )); - aNumFmt.SetAbsLSpace( aNumFmt.GetAbsLSpace() * ( n + 1 ) ); + aNumFmt.SetIndentAt( aNumFmt.GetIndentAt() * ( n + 1 ) ); rRule.Set( n, aNumFmt ); } } @@ -99,13 +74,13 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl ) int nLvlTxtLevel = 0, nLvlNumberLevel = 0; String sLvlText, sLvlNumber; SwNumFmt* pCurNumFmt; - String aStringFollow = aEmptyStr; + SvxNumberFormat::SvxNumLabelFollowedBy eFollowedBy = SvxNumberFormat::NOTHING; if( MAXLEVEL >= nNumLvl ) { pCurNumFmt = (SwNumFmt*)rRule.GetNumFmt( nNumLvl ); - pCurNumFmt->SetAbsLSpace( 0 ); - pCurNumFmt->SetFirstLineOffset( 0 ); + pCurNumFmt->SetIndentAt( 0 ); + pCurNumFmt->SetFirstLineIndent( 0 ); } else pCurNumFmt = 0; @@ -210,17 +185,16 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl ) break; case RTF_LEVELFOLLOW: - /* removed; waiting for swnum02 to be integrated! + /* removed; waiting for swnum02 to be integrated! */ switch (nTokenValue) { case 0: - aStringFollow=String('\t'); + eFollowedBy = SvxNumberFormat::LISTTAB; break; case 1: - aStringFollow=String(' '); + eFollowedBy = SvxNumberFormat::SPACE; break; } - */ break; case RTF_LEVELOLD: @@ -244,8 +218,8 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl ) // and put the current "LRSpace" into the set { SvxLRSpaceItem aLR( RES_LR_SPACE ); - aLR.SetTxtLeft( pCurNumFmt->GetAbsLSpace() ); - aLR.SetTxtFirstLineOfst(pCurNumFmt->GetFirstLineOffset()); + aLR.SetTxtLeft( pCurNumFmt->GetIndentAt() ); + aLR.SetTxtFirstLineOfst(pCurNumFmt->GetFirstLineIndent()); aSet.Put( aLR ); } @@ -264,8 +238,9 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl ) FALSE, &pItem )) { const SvxLRSpaceItem& rLR = *(SvxLRSpaceItem*)pItem; - pCurNumFmt->SetAbsLSpace( static_cast< short >(rLR.GetTxtLeft()) ); - pCurNumFmt->SetFirstLineOffset( rLR.GetTxtFirstLineOfst()); + pCurNumFmt->SetListtabPos( rLR.GetTxtLeft( ) ); + pCurNumFmt->SetIndentAt( rLR.GetTxtLeft() ); + pCurNumFmt->SetFirstLineIndent( rLR.GetTxtFirstLineOfst()); } // dann aus der Vorlage den Font holen @@ -306,16 +281,13 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl ) pCurNumFmt->SetSuffix( sLvlText ); } - String newSuffix=pCurNumFmt->GetSuffix(); - newSuffix+=aStringFollow; - pCurNumFmt->SetSuffix(newSuffix); - /* removed; waiting for swnum02 to be integrated! - if (aStringFollow.GetChar(0)=='\t' && !pCurNumFmt->IsItemize()) + /* removed; waiting for swnum02 to be integrated!*/ + pCurNumFmt->SetLabelFollowedBy( eFollowedBy ); + if (eFollowedBy == SvxNumberFormat::LISTTAB && !pCurNumFmt->IsItemize()) { - pCurNumFmt->SetAbsLSpace(0); - pCurNumFmt->SetFirstLineOffset(0); + pCurNumFmt->SetIndentAt(0); + pCurNumFmt->SetFirstLineIndent(0); } - */ } SkipToken( -1 ); @@ -380,7 +352,7 @@ void SwRTFParser::ReadListTable() String sTmp( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( RTF_NUMRULE_NAME " 1" ))); - aEntry.nListDocPos = pDoc->MakeNumRule( sTmp ); + aEntry.nListDocPos = pDoc->MakeNumRule( sTmp, 0, FALSE, SvxNumberFormat::LABEL_ALIGNMENT ); pCurRule = pDoc->GetNumRuleTbl()[ aEntry.nListDocPos ]; // --> OD 2008-07-08 #i91400# pCurRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, FALSE ), @@ -1011,8 +983,8 @@ NUMATTR_SETUNDERLINE: case RTF_PNINDENT: if( 0 > short( nTokenValue ) ) nTokenValue = - (short)nTokenValue; - pCurNumFmt->SetFirstLineOffset( - short( nTokenValue )); - pCurNumFmt->SetAbsLSpace( (nLevel + 1 ) * USHORT( nTokenValue )); + pCurNumFmt->SetFirstLineIndent( - nTokenValue ); + pCurNumFmt->SetIndentAt( (nLevel + 1 ) * nTokenValue ); break; case RTF_PNSP: pCurNumFmt->SetCharTextDistance( USHORT( nTokenValue )); @@ -1288,8 +1260,8 @@ void SwRTFWriter::OutRTFListTab() } Strm() << OOO_STRING_SVTOOLS_RTF_FI; - OutLong( rFmt.GetFirstLineOffset() ) << OOO_STRING_SVTOOLS_RTF_LI; - OutLong( rFmt.GetAbsLSpace() ); + OutLong( rFmt.GetFirstLineIndent() ) << OOO_STRING_SVTOOLS_RTF_LI; + OutLong( rFmt.GetIndentAt() ); Strm() << '}'; @@ -1401,9 +1373,9 @@ BOOL SwRTFWriter::OutListNum( const SwTxtNode& rNd ) SfxItemSet aSet( *rNdSet.GetPool(), rNdSet.GetRanges() ); aSet.SetParent( &rNdSet ); SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) ); - aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() ); + aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() ); - aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() ); + aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineIndent() ); if ( bExportNumRule ) Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTTEXT << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN << ' '; -- cgit From 24dd42f316e5cb16ba726c05ba486d53e033052d Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 13 Sep 2010 17:15:50 +0200 Subject: sw-rtf-num-fix.diff:Fixes for RTF numbering export n#569266 --- filter/source/msfilter/escherex.cxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 805849279e6b..834d7ca214e6 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -720,6 +720,29 @@ void EscherPropertyContainer::CreateTextProperties( if ( nTextId ) AddOpt( ESCHER_Prop_lTxid, nTextId ); + + // n#404221: In case of rotation we need to write the txtflTextFlow + // attribute too. + if (bIsTextFrame) { + sal_uInt16 nAngle = EscherPropertyValueHelper::GetPropertyValue( + aAny, + rXPropSet, + String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), + sal_True ) + ? (sal_uInt16)( ( *((sal_Int32*)aAny.getValue() ) ) + 5 ) / 10 : 0; + if (nAngle==900) { + AddOpt( ESCHER_Prop_txflTextFlow, 1 ); + bSuppressRotation=true; + } + if (nAngle==1800) { + AddOpt( ESCHER_Prop_txflTextFlow, 2 ); + bSuppressRotation=true; + } + if (nAngle==2700) { + AddOpt( ESCHER_Prop_txflTextFlow, 3 ); + bSuppressRotation=true; + } + } } sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart, -- cgit From 151636e58c07b40f9ab26fb265f22a06a303a37f Mon Sep 17 00:00:00 2001 From: Octavio Alvarez Date: Mon, 13 Sep 2010 17:26:19 +0200 Subject: sw-show-Remove-Hyperlink-even-with-selection.diff: --- sw/source/ui/shells/textsh1.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index b13aaed44ee2..a3daee3d8222 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -1596,7 +1596,6 @@ void SwTextShell::GetState( SfxItemSet &rSet ) GetViewFrame()->GetChildWindow( nWhich ) )); break; case FN_EDIT_HYPERLINK: - case FN_REMOVE_HYPERLINK: case FN_COPY_HYPERLINK_LOCATION: { SfxItemSet aSet(GetPool(), @@ -1609,6 +1608,20 @@ void SwTextShell::GetState( SfxItemSet &rSet ) } } break; + case FN_REMOVE_HYPERLINK: + { + SfxItemSet aSet(GetPool(), + RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT); + rSh.GetCurAttr(aSet); + + // If a hyperlink is selected, either alone or along with other text... + if( ((SFX_ITEM_DONTCARE & aSet.GetItemState( RES_TXTATR_INETFMT, TRUE )) == 0) || rSh.HasReadonlySel()) + { + rSet.DisableItem(nWhich); + } + } + break; case SID_TRANSLITERATE_HALFWIDTH: case SID_TRANSLITERATE_FULLWIDTH: case SID_TRANSLITERATE_HIRAGANA: -- cgit From 6e690e0909459d46c53d17e7939891abea11e566 Mon Sep 17 00:00:00 2001 From: Octavio Alvarez Date: Mon, 13 Sep 2010 17:30:41 +0200 Subject: sw-preserve-char-style-on-reset-format.diff:Perserve character style on links i#47893 --- sw/source/ui/shells/textsh1.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index a3daee3d8222..2e6f4b976a0a 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -508,8 +508,6 @@ void SwTextShell::Execute(SfxRequest &rReq) RES_CHRATR_CJK_LANGUAGE + 1, RES_CHRATR_CTL_LANGUAGE - 1, RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, -- cgit From 90f5ce36231551e226d4b3e2fefaa8493af692ac Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 09:36:14 +0200 Subject: svg-import-filter.diff: SVG Import Filter implementation in filter module --- .../source/config/fragments/fcfg_drawgraphics.mk | 1 + .../filters/SVG___Scalable_Vector_Graphics.xcu | 13 + .../types/svg_Scalable_Vector_Graphics.xcu | 6 +- filter/source/svg/b2dellipse.cxx | 139 ++ filter/source/svg/b2dellipse.hxx | 77 + filter/source/svg/gentoken.pl | 58 + filter/source/svg/gfxtypes.hxx | 356 ++++ filter/source/svg/makefile.mk | 52 +- filter/source/svg/parserfragments.cxx | 553 ++++++ filter/source/svg/parserfragments.hxx | 50 + filter/source/svg/spirit_supplements.hxx | 115 ++ filter/source/svg/svgfilter.cxx | 107 +- filter/source/svg/svgfilter.hxx | 39 +- filter/source/svg/svgimport.cxx | 191 +- filter/source/svg/svgreader.cxx | 1876 ++++++++++++++++++++ filter/source/svg/svgreader.hxx | 43 + filter/source/svg/test/makefile.mk | 114 ++ filter/source/svg/test/odfserializer.cxx | 140 ++ filter/source/svg/test/odfserializer.hxx | 31 + filter/source/svg/test/parsertest.cxx | 209 +++ filter/source/svg/test/svg2odf.cxx | 124 ++ filter/source/svg/tokenmap.cxx | 62 + filter/source/svg/tokenmap.hxx | 32 + filter/source/svg/tokens.txt | 403 +++++ filter/source/svg/units.cxx | 99 ++ filter/source/svg/units.hxx | 60 + 26 files changed, 4695 insertions(+), 255 deletions(-) create mode 100644 filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu create mode 100644 filter/source/svg/b2dellipse.cxx create mode 100644 filter/source/svg/b2dellipse.hxx create mode 100644 filter/source/svg/gentoken.pl create mode 100644 filter/source/svg/gfxtypes.hxx create mode 100644 filter/source/svg/parserfragments.cxx create mode 100644 filter/source/svg/parserfragments.hxx create mode 100644 filter/source/svg/spirit_supplements.hxx create mode 100644 filter/source/svg/svgreader.cxx create mode 100644 filter/source/svg/svgreader.hxx create mode 100644 filter/source/svg/test/makefile.mk create mode 100644 filter/source/svg/test/odfserializer.cxx create mode 100644 filter/source/svg/test/odfserializer.hxx create mode 100644 filter/source/svg/test/parsertest.cxx create mode 100644 filter/source/svg/test/svg2odf.cxx create mode 100644 filter/source/svg/tokenmap.cxx create mode 100644 filter/source/svg/tokenmap.hxx create mode 100644 filter/source/svg/tokens.txt create mode 100644 filter/source/svg/units.cxx create mode 100644 filter/source/svg/units.hxx diff --git a/filter/source/config/fragments/fcfg_drawgraphics.mk b/filter/source/config/fragments/fcfg_drawgraphics.mk index 7038e27e8ae4..41a46254b871 100644 --- a/filter/source/config/fragments/fcfg_drawgraphics.mk +++ b/filter/source/config/fragments/fcfg_drawgraphics.mk @@ -54,6 +54,7 @@ F4_DRAWGRAPHICS = \ SGF___StarOffice_Writer_SGF \ SGV___StarDraw_2_0 \ SVM___StarView_Metafile \ + SVG___Scalable_Vector_Graphics \ TGA___Truevision_TARGA \ TIF___Tag_Image_File \ WMF___MS_Windows_Metafile \ diff --git a/filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu b/filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu new file mode 100644 index 000000000000..1212e056762e --- /dev/null +++ b/filter/source/config/fragments/filters/SVG___Scalable_Vector_Graphics.xcu @@ -0,0 +1,13 @@ + + IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED + + com.sun.star.comp.Draw.SVGFilter + + + SVG - Scalable Vector Graphics + + 0 + svg_Scalable_Vector_Graphics + + com.sun.star.drawing.DrawingDocument + diff --git a/filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu b/filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu index 37643df4c7ec..8865dee4a831 100644 --- a/filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu +++ b/filter/source/config/fragments/types/svg_Scalable_Vector_Graphics.xcu @@ -1,10 +1,10 @@ - + com.sun.star.comp.Draw.SVGFilter svg image/svg+xml - false - + true + SVG - Scalable Vector Graphics SVG - Scalable Vector Graphics diff --git a/filter/source/svg/b2dellipse.cxx b/filter/source/svg/b2dellipse.cxx new file mode 100644 index 000000000000..8ae97c6bcdb3 --- /dev/null +++ b/filter/source/svg/b2dellipse.cxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#include "b2dellipse.hxx" + +#include + +#include + +#include + +#include + +#include +#include +#include + +class ImplB2DEllipse +{ + basegfx::B2DPoint maCenter; + basegfx::B2DTuple maRadius; + +public: + ImplB2DEllipse() + : maCenter(0.0f, 0.0f), + maRadius(0.0f, 0.0f) + {} + + ImplB2DEllipse(const ImplB2DEllipse& rToBeCopied) + : maCenter(rToBeCopied.maCenter), + maRadius(rToBeCopied.maRadius) + {} + + ImplB2DEllipse& operator=( const ImplB2DEllipse& rToBeCopied ) + { + maCenter = rToBeCopied.maCenter; + maRadius = rToBeCopied.maRadius; + + return *this; + } + + bool isEqual(const ImplB2DEllipse& rCandidate) const + { + return (maCenter == rCandidate.maCenter) + && (maRadius == rCandidate.maRadius); + } + + basegfx::B2DPoint getCenter() const + { + return maCenter; + } + + void setCenter(const basegfx::B2DPoint& rCenter) + { + maCenter = rCenter; + } + + basegfx::B2DTuple getRadius() const + { + return maRadius; + } + + void setRadius(const basegfx::B2DTuple& rRadius) + { + maRadius = rRadius; + } + + + void transform(const basegfx::B2DHomMatrix& /* rMatrix */) + { + } +}; + +////////////////////////////////////////////////////////////////////////////// + +namespace basegfx +{ + + B2DEllipse::B2DEllipse() + {} + + B2DEllipse::B2DEllipse(const basegfx::B2DPoint& rCenter, const basegfx::B2DTuple& rRadius) + : maCenter(rCenter), maRadius(rRadius) + { + } + + B2DEllipse::~B2DEllipse() + { + } + + bool B2DEllipse::operator==(const B2DEllipse& rEllipse) const + { + return (maCenter == rEllipse.maCenter) && (maRadius == rEllipse.maRadius); + } + + bool B2DEllipse::operator!=(const B2DEllipse& rEllipse) const + { + return !(*this == rEllipse); + } + + basegfx::B2DPoint B2DEllipse::getB2DEllipseCenter() const + { + return maCenter; + } + + void B2DEllipse::setB2DEllipseCenter(const basegfx::B2DPoint& rCenter) + { + maCenter = rCenter; + } + + basegfx::B2DTuple B2DEllipse::getB2DEllipseRadius() const + { + return maRadius; + } + + void B2DEllipse::setB2DEllipseRadius(const basegfx::B2DTuple& rRadius) + { + maRadius = rRadius; + } + + void B2DEllipse::transform(const basegfx::B2DHomMatrix& /* rMatrix */) + { + } +} // end of namespace basegfx + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/filter/source/svg/b2dellipse.hxx b/filter/source/svg/b2dellipse.hxx new file mode 100644 index 000000000000..a63d83974ec5 --- /dev/null +++ b/filter/source/svg/b2dellipse.hxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef _BASEGFX_B2DELLIPSE_HXX +#define _BASEGFX_B2DELLIPSE_HXX + +#include + +#include + +#include + +#include + +#include + +////////////////////////////////////////////////////////////////////////////// +// predeclarations +class ImplB2DEllipse; + +namespace basegfx +{ + class B2DPoint; + class B2DVector; + class B2DHomMatrix; +} // end of namespace basegfx + +////////////////////////////////////////////////////////////////////////////// + +namespace basegfx +{ + class B2DEllipse + { + private: + basegfx::B2DPoint maCenter; + basegfx::B2DTuple maRadius; + + public: + B2DEllipse(); + B2DEllipse(const B2DEllipse& rEllipse); + B2DEllipse(const basegfx::B2DPoint& rCenter, const basegfx::B2DTuple& rRadius); + ~B2DEllipse(); + + // assignment operator + B2DEllipse& operator=(const B2DEllipse& rEllipse); + + // compare operators + bool operator==(const B2DEllipse& rEllipse) const; + bool operator!=(const B2DEllipse& rEllipse) const; + + // Coordinate interface + basegfx::B2DPoint getB2DEllipseCenter() const; + void setB2DEllipseCenter(const basegfx::B2DPoint& rCenter); + + basegfx::B2DTuple getB2DEllipseRadius() const; + void setB2DEllipseRadius(const basegfx::B2DTuple& rRadius); + + // apply transformation given in matrix form to the Ellipse + void transform(const basegfx::B2DHomMatrix& rMatrix); + }; +} // end of namespace basegfx + +////////////////////////////////////////////////////////////////////////////// + +#endif /* _BASEGFX_B2DELLIPSE_HXX */ diff --git a/filter/source/svg/gentoken.pl b/filter/source/svg/gentoken.pl new file mode 100644 index 000000000000..75bb1e262aab --- /dev/null +++ b/filter/source/svg/gentoken.pl @@ -0,0 +1,58 @@ +# from oox/source/token - should really put this into solenv + +$ARGV0 = shift @ARGV; +$ARGV1 = shift @ARGV; +$ARGV2 = shift @ARGV; + +open ( TOKENS, $ARGV0 ) || die "can't open token file: $!"; +my %tokens; + +while ( defined ($line = ) ) +{ + if( !($line =~ /^#/) ) + { + chomp($line); + @token = split(/\s+/,$line); + if ( not defined ($token[1]) ) + { + $token[1] = "XML_".$token[0]; + $token[1] =~ tr/\-\.\:/___/; + $token[1] =~ s/\+/PLUS/g; + $token[1] =~ s/\-/MINUS/g; + } + + $tokens{$token[0]} = uc($token[1]); + } +} +close ( TOKENS ); + +open ( HXX, ">$ARGV1" ) || die "can't open tokens.hxx file: $!"; +open ( GPERF, ">$ARGV2" ) || die "can't open tokens.gperf file: $!"; + +print ( GPERF "%language=C++\n" ); +print ( GPERF "%global-table\n" ); +print ( GPERF "%null-strings\n" ); +print ( GPERF "%struct-type\n" ); +print ( GPERF "struct xmltoken\n" ); +print ( GPERF "{\n" ); +print ( GPERF " const sal_Char *name; sal_Int32 nToken; \n" ); +print ( GPERF "};\n" ); +print ( GPERF "%%\n" ); + +print ( HXX "#ifndef INCLUDED_AUTOGEN_TOKEN_HXX\n" ); +print ( HXX "#define INCLUDED_AUTOGEN_TOKEN_HXX\n\n" ); +print ( HXX "#include \n\n" ); + +$i = 0; +foreach( sort(keys(%tokens)) ) +{ + print( HXX "const sal_Int32 $tokens{$_} = $i;\n" ); + print( GPERF "$_,$tokens{$_}\n" ); + $i = $i + 1; +} +print ( GPERF "%%\n" ); +print ( HXX "const sal_Int32 XML_TOKEN_COUNT = $i;\n" ); +print ( HXX "const sal_Int32 XML_TOKEN_INVALID = -1;\n\n" ); +print ( HXX "#endif\n" ); +close ( HXX ); +close ( GPERF ); diff --git a/filter/source/svg/gfxtypes.hxx b/filter/source/svg/gfxtypes.hxx new file mode 100644 index 000000000000..3675e30e65eb --- /dev/null +++ b/filter/source/svg/gfxtypes.hxx @@ -0,0 +1,356 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef INCLUDED_GFXTYPES_HXX +#define INCLUDED_GFXTYPES_HXX + +#include +#include +#include + +#include +#include +#include + +namespace svgi +{ + +struct ARGBColor +{ + double toDoubleColor( sal_uInt8 val ) { return val/255.0; } + + ARGBColor() : a(1.0), r(0.0), g(0.0), b(0.0) + {} + explicit ARGBColor(double fGrey) : a(1.0), r(fGrey), g(fGrey), b(fGrey) + {} + ARGBColor( double r_, double g_, double b_ ) : + a(1.0), r(r_), g(g_), b(b_) + {} + ARGBColor( double a_, double r_, double g_, double b_ ) : + a(a_), r(r_), g(g_), b(b_) + {} + ARGBColor( int r_, int g_, int b_ ) : + a(1.0), + r(toDoubleColor(sal::static_int_cast(r_))), + g(toDoubleColor(sal::static_int_cast(g_))), + b(toDoubleColor(sal::static_int_cast(b_))) + {} + ARGBColor( int a_, int r_, int g_, int b_ ) : + a(toDoubleColor(sal::static_int_cast(a_))), + r(toDoubleColor(sal::static_int_cast(r_))), + g(toDoubleColor(sal::static_int_cast(g_))), + b(toDoubleColor(sal::static_int_cast(b_))) + {} + double a; + double r; + double g; + double b; +}; +inline bool operator==( const ARGBColor& rLHS, const ARGBColor& rRHS ) +{ return rLHS.a==rRHS.a && rLHS.r==rRHS.r && rLHS.g==rRHS.g && rLHS.b==rRHS.b; } +inline bool operator!=( const ARGBColor& rLHS, const ARGBColor& rRHS ) +{ return !(rLHS==rRHS); } + +struct GradientStop +{ + GradientStop() : maStopColor(), mnStopPosition(0.0) + {} + ARGBColor maStopColor; + double mnStopPosition; +}; +inline bool operator==( const GradientStop& rLHS, const GradientStop& rRHS ) +{ return rLHS.mnStopPosition==rRHS.mnStopPosition && rLHS.maStopColor==rRHS.maStopColor; } + +struct Gradient +{ + enum GradientType { LINEAR, RADIAL}; + std::vector maStops; + basegfx::B2DHomMatrix maTransform; + GradientType meType; + union + { + double test; + struct + { + double mfX1; + double mfX2; + double mfY1; + double mfY2; + } linear; + struct + { + double mfCX; + double mfCY; + double mfFX; + double mfFY; + double mfR; + } radial; + } maCoords; + sal_Int32 mnId; + bool mbBoundingBoxUnits; + bool mbLinearBoundingBoxUnits; + +// explicit Gradient(GradientType eType) : maStops(), maTransform(), meType(eType), maCoords.mfCX(0.0), maCoords.mfCY(0.0), maCoords.mfFX(0.0), maCoords.mfFY(0.0), maCoords.mfR(0.0), mnId(0), mbBoundingBoxUnits(false) + explicit Gradient(GradientType eType) : maStops(), maTransform(), meType(eType), mnId(0), mbBoundingBoxUnits(false) + { + maCoords.radial.mfCX = 0.0; + maCoords.radial.mfCY = 0.0; + maCoords.radial.mfFX = 0.0; + maCoords.radial.mfFY = 0.0; + maCoords.radial.mfR = 0.0; + } +}; + +inline bool operator==( const Gradient& rLHS, const Gradient& rRHS ) +{ + if( rLHS.meType != rRHS.meType ) + return false; + if( rLHS.meType == Gradient::LINEAR ) + return rLHS.mbBoundingBoxUnits==rRHS.mbBoundingBoxUnits && rLHS.maStops==rRHS.maStops && + rLHS.maCoords.linear.mfX1 == rRHS.maCoords.linear.mfX1 && rLHS.maCoords.linear.mfX2 == rRHS.maCoords.linear.mfX2 && + rLHS.maCoords.linear.mfY1 == rRHS.maCoords.linear.mfY1 && rLHS.maCoords.linear.mfY2 == rRHS.maCoords.linear.mfY2; + else + return rLHS.mbBoundingBoxUnits==rRHS.mbBoundingBoxUnits && rLHS.maStops==rRHS.maStops && + rLHS.maCoords.radial.mfCX == rRHS.maCoords.radial.mfCX && rLHS.maCoords.radial.mfCY == rRHS.maCoords.radial.mfCY && + rLHS.maCoords.radial.mfFX == rRHS.maCoords.radial.mfFX && rLHS.maCoords.radial.mfFY == rRHS.maCoords.radial.mfFY && + rLHS.maCoords.radial.mfR == rRHS.maCoords.radial.mfR; +} + +enum PaintType +{ + NONE, + SOLID, + GRADIENT +}; + +enum FillRule +{ + NON_ZERO, + EVEN_ODD +}; + +enum TextAlign +{ + BEFORE, + CENTER, + AFTER +}; + +enum CapStyle +{ + BUTT, + RECT, + ROUND +}; + +enum FontStyle +{ + STYLE_NORMAL, + STYLE_OBLIQUE, + STYLE_ITALIC +}; + +enum FontVariant +{ + VARIANT_NORMAL, + VARIANT_SMALLCAPS +}; + +struct State +{ + State() : + maCTM(), + maTransform(), + maViewport(), + maViewBox(), + maFontFamily(), // app-default + mnFontSize(12.0), + meFontStyle(STYLE_NORMAL), + meFontVariant(VARIANT_NORMAL), + mnFontWeight(400.0), + meTextAnchor(BEFORE), + meTextDisplayAlign(BEFORE), + mnTextLineIncrement(0.0), + maCurrentColor(1.0), + mbVisibility(true), + meFillType(SOLID), + mnFillOpacity(1.0), + meStrokeType(NONE), + mnStrokeOpacity(1.0), + meViewportFillType(NONE), + mnViewportFillOpacity(1.0), + maFillColor(0.0), + maFillGradient(Gradient::LINEAR), + meFillRule(NON_ZERO), + maStrokeColor(0.0), + maStrokeGradient(Gradient::LINEAR), + maDashArray(), + mnDashOffset(0.0), + meLineCap(BUTT), + meLineJoin(basegfx::B2DLINEJOIN_MITER), + mnMiterLimit(4.0), + mnStrokeWidth(1.0), + maViewportFillColor(1.0), + maViewportFillGradient(Gradient::LINEAR), + mnStyleId(0) + {} + + basegfx::B2DHomMatrix maCTM; + basegfx::B2DHomMatrix maTransform; + basegfx::B2DRange maViewport; + basegfx::B2DRange maViewBox; + + rtl::OUString maFontFamily; + /** Absolute: xx-small=6.94 | x-small=8.33 | small=10 | medium=12 | large=14.4 | x-large=17.28 | xx-large=20.736 + + Relative(to parent): larger (enlarge by 1.2) + smaller (shrink by 1.2) + + */ + double mnFontSize; + FontStyle meFontStyle; + FontVariant meFontVariant; + double mnFontWeight; + + TextAlign meTextAnchor; // text-anchor + TextAlign meTextDisplayAlign; // display-align + double mnTextLineIncrement; // 0.0 means auto + + ARGBColor maCurrentColor; + bool mbVisibility; + + PaintType meFillType; + double mnFillOpacity; + PaintType meStrokeType; + double mnStrokeOpacity; + PaintType meViewportFillType; + double mnViewportFillOpacity; + + ARGBColor maFillColor; + Gradient maFillGradient; + FillRule meFillRule; + + ARGBColor maStrokeColor; + Gradient maStrokeGradient; + std::vector maDashArray; + double mnDashOffset; + CapStyle meLineCap; + basegfx::B2DLineJoin meLineJoin; + double mnMiterLimit; + double mnStrokeWidth; + + ARGBColor maViewportFillColor; + Gradient maViewportFillGradient; + + sal_Int32 mnStyleId; +}; + +inline bool operator==(const State& rLHS, const State& rRHS ) +{ + return rLHS.maCTM==rRHS.maCTM && + rLHS.maTransform==rRHS.maTransform && + rLHS.maViewport==rRHS.maViewport && + rLHS.maViewBox==rRHS.maViewBox && + rLHS.maFontFamily==rRHS.maFontFamily && + rLHS.mnFontSize==rRHS.mnFontSize && + rLHS.meFontStyle==rRHS.meFontStyle && + rLHS.meFontVariant==rRHS.meFontVariant && + rLHS.mnFontWeight==rRHS.mnFontWeight && + rLHS.meTextAnchor==rRHS.meTextAnchor && + rLHS.meTextDisplayAlign==rRHS.meTextDisplayAlign && + rLHS.mnTextLineIncrement==rRHS.mnTextLineIncrement && + rLHS.maCurrentColor==rRHS.maCurrentColor && + rLHS.mbVisibility==rRHS.mbVisibility && + rLHS.meFillType==rRHS.meFillType && + rLHS.mnFillOpacity==rRHS.mnFillOpacity && + rLHS.meStrokeType==rRHS.meStrokeType && + rLHS.mnStrokeOpacity==rRHS.mnStrokeOpacity && + rLHS.meViewportFillType==rRHS.meViewportFillType && + rLHS.mnViewportFillOpacity==rRHS.mnViewportFillOpacity && + rLHS.maFillColor==rRHS.maFillColor && + rLHS.maFillGradient==rRHS.maFillGradient && + rLHS.meFillRule==rRHS.meFillRule && + rLHS.maStrokeColor==rRHS.maStrokeColor && + rLHS.maStrokeGradient==rRHS.maStrokeGradient && + rLHS.maDashArray==rRHS.maDashArray && + rLHS.mnDashOffset==rRHS.mnDashOffset && + rLHS.meLineCap==rRHS.meLineCap && + rLHS.meLineJoin==rRHS.meLineJoin && + rLHS.mnMiterLimit==rRHS.mnMiterLimit && + rLHS.mnStrokeWidth==rRHS.mnStrokeWidth && + rLHS.maViewportFillColor==rRHS.maViewportFillColor && + rLHS.maViewportFillGradient==rRHS.maViewportFillGradient; +} + +struct StateHash +{ + size_t operator()(const State& rState ) const + { + return size_t(rState.maCTM.get( 0, 0 )) + ^ size_t(rState.maCTM.get( 1, 0 )) + ^ size_t(rState.maCTM.get( 0, 1 )) + ^ size_t(rState.maCTM.get( 1, 1 )) + ^ size_t(rState.maCTM.get( 0, 2 )) + ^ size_t(rState.maCTM.get( 1, 2 )) + ^ size_t(rState.maViewport.getWidth()) + ^ size_t(rState.maViewport.getHeight()) + ^ size_t(rState.maViewBox.getWidth()) + ^ size_t(rState.maViewBox.getHeight()) + ^ size_t(rState.maFontFamily.hashCode()) + ^ size_t(rState.mnFontSize) + ^ size_t(rState.meFontStyle) + ^ size_t(rState.meFontVariant) + ^ size_t(rState.mnFontWeight) + ^ size_t(rState.meTextAnchor) + ^ size_t(rState.meTextDisplayAlign) + ^ size_t(rState.mnTextLineIncrement) + ^ size_t(rState.mbVisibility) + ^ size_t(rState.meFillType) + ^ size_t(rState.mnFillOpacity) + ^ size_t(rState.meStrokeType) + ^ size_t(rState.mnStrokeOpacity) + ^ size_t(rState.meViewportFillType) + ^ size_t(rState.mnViewportFillOpacity) + ^ size_t(rState.maFillColor.a) + ^ size_t(rState.maFillColor.r) + ^ size_t(rState.maFillColor.g) + ^ size_t(rState.maFillColor.b) + ^ size_t(rState.maFillGradient.maStops.size()) + ^ size_t(rState.meFillRule) + ^ size_t(rState.maStrokeColor.a) + ^ size_t(rState.maStrokeColor.r) + ^ size_t(rState.maStrokeColor.g) + ^ size_t(rState.maStrokeColor.b) + ^ size_t(rState.maStrokeGradient.maStops.size()) + ^ size_t(rState.maDashArray.size()) + ^ size_t(rState.mnDashOffset) + ^ size_t(rState.meLineCap) + ^ size_t(rState.meLineJoin) + ^ size_t(rState.mnMiterLimit) + ^ size_t(rState.mnStrokeWidth) + ^ size_t(rState.maViewportFillColor.a) + ^ size_t(rState.maViewportFillColor.r) + ^ size_t(rState.maViewportFillColor.g) + ^ size_t(rState.maViewportFillColor.b) + ^ size_t(rState.maViewportFillGradient.maStops.size()); + } +}; + +typedef std::hash_set StatePool; +typedef std::hash_map StateMap; + +} // namespace svgi + +#endif diff --git a/filter/source/svg/makefile.mk b/filter/source/svg/makefile.mk index 12c1210c18c4..c9f8e09c8e22 100644 --- a/filter/source/svg/makefile.mk +++ b/filter/source/svg/makefile.mk @@ -26,25 +26,38 @@ #************************************************************************* PRJ=..$/.. + PRJNAME=filter TARGET=svgfilter - ENABLE_EXCEPTIONS=TRUE VISIBILITY_HIDDEN=TRUE # --- Settings ---------------------------------- -.INCLUDE : settings.mk +.INCLUDE : settings.mk +.INCLUDE : libs.mk # --- Types ------------------------------------- -SLOFILES= $(SLO)$/svguno.obj \ - $(SLO)$/svgfilter.obj \ +SLOFILES= \ + $(SLO)$/b2dellipse.obj \ + $(SLO)$/parserfragments.obj \ $(SLO)$/svgexport.obj \ + $(SLO)$/svgfilter.obj \ $(SLO)$/svgfontexport.obj \ - $(SLO)$/svgwriter.obj -.IF "$(SOLAR_JAVA)"!="" -SLOFILES+= $(SLO)$/svgimport.obj + $(SLO)$/svgimport.obj \ + $(SLO)$/svgreader.obj \ + $(SLO)$/svgwriter.obj \ + $(SLO)$/tokenmap.obj \ + $(SLO)$/units.obj + +.IF "$(COMID)"=="gcc3" +.IF "$(CCNUMVER)">="000400000000" || "$(SYSTEM_BOOST)"=="YES" +CFLAGS+=-DUSE_MODERN_SPIRIT +.ENDIF +.ENDIF +.IF "$(SYSTEM_BOOST)"=="NO" +CFLAGS+=-DUSE_MODERN_SPIRIT .ENDIF # --- Library ----------------------------------- @@ -54,21 +67,17 @@ SHL1TARGET=$(TARGET)$(DLLPOSTFIX) SHL1STDLIBS=\ $(EDITENGLIB) \ $(SVXCORELIB) \ + $(BASEGFXLIB) \ $(XMLOFFLIB) \ - $(SVTOOLLIB) \ + $(SVTOOLLIB) \ $(VCLLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ - $(SALLIB) - -.IF "$(SOLAR_JAVA)"!="" -SHL1STDLIBS+=\ - $(JVMACCESSLIB) -.ENDIF - + $(SALLIB) \ + $(LIBXML) SHL1DEPN= SHL1IMPLIB= i$(SHL1TARGET) @@ -81,3 +90,16 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------- .INCLUDE : target.mk + +# Generate gperf files - from oox/source/token +$(INCCOM)$/tokens.hxx $(MISC)$/tokens.gperf : tokens.txt gentoken.pl + $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(MISC)$/tokens.gperf + +$(INCCOM)$/tokens.cxx : $(MISC)$/tokens.gperf makefile.mk + gperf --compare-strncmp -C -m 20 $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" >$(INCCOM)$/tokens.cxx + +$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx + +$(SLO)$/parserfragments.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx + +$(SLO)$/svgreader.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx new file mode 100644 index 000000000000..d11ceca02d70 --- /dev/null +++ b/filter/source/svg/parserfragments.cxx @@ -0,0 +1,553 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_filter.hxx" + +#include "parserfragments.hxx" +#include "spirit_supplements.hxx" +#include "gfxtypes.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "units.hxx" +#include "tokenmap.hxx" + +using namespace ::com::sun::star; + +namespace svgi +{ + +inline sal_uInt8 hex2int( char val ) +{ + return val <= '9' ? val-'0' : (val < 'a' ? val+10-'A' : val+10-'a'); +} + +void setFourBitColor( double& rChannel, char nChar ) +{ + const sal_uInt8 nVal(hex2int(nChar)); + OSL_TRACE( "setFourBitCOlor %d color", nVal ); + rChannel = (nVal*16+nVal)/255.0; +} + +void setEightBitColor( double& rChannel, const char* pStart, const char* ) +{ + const sal_uInt8 nVal0(hex2int(pStart[0])); + const sal_uInt8 nVal1(hex2int(pStart[1])); + OSL_TRACE( "setEightbitCOlor %d, %d color", nVal0, nVal1 ); + rChannel = (nVal0*16+nVal1)/255.0; +} + +void setIntColor( double& rChannel, sal_uInt8 nVal ) +{ + OSL_TRACE( "setIntColor %d color", nVal ); + rChannel = nVal/255.0; +} + +void calcRotation(std::vector& rTransforms, + geometry::AffineMatrix2D& rCurrTransform, + double fRotationAngle) +{ + ::basegfx::B2DHomMatrix aCurr; + aCurr.translate(-rCurrTransform.m02,-rCurrTransform.m12); + aCurr.rotate(fRotationAngle*M_PI/180); + aCurr.translate(rCurrTransform.m02,rCurrTransform.m12); + + OSL_TRACE("calcRotation - fRotationAngle - %f", fRotationAngle); + rTransforms.push_back( + basegfx::unotools::affineMatrixFromHomMatrix( + rCurrTransform, + aCurr)); +} + +void calcSkewX(std::vector& rTransforms, + double fSkewAngle) +{ + geometry::AffineMatrix2D aMat(1.0,0.0,0.0, + tan(fSkewAngle*M_PI/180),1.0,0.0); + rTransforms.push_back(aMat); +} + +void calcSkewY(std::vector& rTransforms, + double fSkewAngle) +{ + geometry::AffineMatrix2D aMat(1.0,tan(fSkewAngle*M_PI/180),0.0, + 0.0,1.0,0.0); + rTransforms.push_back(aMat); +} + +void assign_twice(double& r_oVal1, double& r_oVal2, const double& rInVal ) +{ + r_oVal1 = r_oVal2 = rInVal; +} + +geometry::AffineMatrix2D multiplyMatrix( const geometry::AffineMatrix2D& rLHS, + const geometry::AffineMatrix2D& rRHS ) +{ + basegfx::B2DHomMatrix aLHS; + basegfx::B2DHomMatrix aRHS; + + basegfx::unotools::homMatrixFromAffineMatrix(aLHS,rLHS); + basegfx::unotools::homMatrixFromAffineMatrix(aRHS,rRHS); + + aRHS*=aLHS; + + geometry::AffineMatrix2D aRet; + return basegfx::unotools::affineMatrixFromHomMatrix(aRet,aRHS); +} + +bool parseColor( const char* sColor, ARGBColor& rColor ) +{ + using namespace ::boost::spirit; + + int_parser byte_p; + + if( parse(sColor, + // Begin grammar + ( + // the #rrggbb form + ('#' >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, + boost::ref(rColor.r),_1,_2)] + >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, + boost::ref(rColor.g),_1,_2)] + >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, + boost::ref(rColor.b),_1,_2)]) + | + // the #rgb form + ('#' >> xdigit_p[boost::bind(&setFourBitColor, + boost::ref(rColor.r),_1)] + >> xdigit_p[boost::bind(&setFourBitColor, + boost::ref(rColor.g),_1)] + >> xdigit_p[boost::bind(&setFourBitColor, + boost::ref(rColor.b),_1)]) + | + // rgb() form + (str_p("rgb") + >> '(' >> + ( + // rgb(int,int,int) + (byte_p[boost::bind(&setIntColor, + boost::ref(rColor.r),_1)] >> ',' >> + byte_p[boost::bind(&setIntColor, + boost::ref(rColor.g),_1)] >> ',' >> + byte_p[boost::bind(&setIntColor, + boost::ref(rColor.b),_1)]) + | + // rgb(double,double,double) + (real_p[assign_a(rColor.r)] >> ',' >> + real_p[assign_a(rColor.g)] >> ',' >> + real_p[assign_a(rColor.b)]) + ) + >> ')') + ) >> end_p, + // End grammar + space_p).full ) + { + // free-form color found & parsed + return true; + } + + // no free-form color - maybe a color name? + // trim white space before + while( *sColor && + (*sColor==' ' || *sColor=='\t' || *sColor=='\r' || *sColor=='\n') ) + ++sColor; + // trim white space after + int nLen=strlen(sColor)-1; + while( nLen && + (sColor[nLen]==' ' || sColor[nLen]=='\t' || sColor[nLen]=='\r' || sColor[nLen]=='\n') ) + --nLen; + switch (getTokenId(sColor, nLen+1)) + { + case XML_ALICEBLUE: rColor = ARGBColor(240,248,255); return true; + case XML_ANTIQUEWHITE: rColor = ARGBColor(250,235,215); return true; + case XML_AQUA: rColor = ARGBColor(0,255,255); return true; + case XML_AQUAMARINE: rColor = ARGBColor(127,255,212); return true; + case XML_AZURE: rColor = ARGBColor(240,255,255); return true; + case XML_BEIGE: rColor = ARGBColor(245,245,220); return true; + case XML_BISQUE: rColor = ARGBColor(255,228,196); return true; + case XML_BLACK: rColor = ARGBColor(0,0,0); return true; + case XML_BLANCHEDALMOND: rColor = ARGBColor(255,235,205); return true; + case XML_BLUE: rColor = ARGBColor(0,0,255); return true; + case XML_BLUEVIOLET: rColor = ARGBColor(138,43,226); return true; + case XML_BROWN: rColor = ARGBColor(165,42,42); return true; + case XML_BURLYWOOD: rColor = ARGBColor(222,184,135); return true; + case XML_CADETBLUE: rColor = ARGBColor(95,158,160); return true; + case XML_CHARTREUSE: rColor = ARGBColor(127,255,0); return true; + case XML_CHOCOLATE: rColor = ARGBColor(210,105,30); return true; + case XML_CORAL: rColor = ARGBColor(255,127,80); return true; + case XML_CORNFLOWERBLUE: rColor = ARGBColor(100,149,237); return true; + case XML_CORNSILK: rColor = ARGBColor(255,248,220); return true; + case XML_CRIMSON: rColor = ARGBColor(220,20,60); return true; + case XML_CYAN: rColor = ARGBColor(0,255,255); return true; + case XML_DARKBLUE: rColor = ARGBColor(0,0,139); return true; + case XML_DARKCYAN: rColor = ARGBColor(0,139,139); return true; + case XML_DARKGOLDENROD: rColor = ARGBColor(184,134,11); return true; + case XML_DARKGRAY: rColor = ARGBColor(169,169,169); return true; + case XML_DARKGREEN: rColor = ARGBColor(0,100,0); return true; + case XML_DARKGREY: rColor = ARGBColor(169,169,169); return true; + case XML_DARKKHAKI: rColor = ARGBColor(189,183,107); return true; + case XML_DARKMAGENTA: rColor = ARGBColor(139,0,139); return true; + case XML_DARKOLIVEGREEN: rColor = ARGBColor(85,107,47); return true; + case XML_DARKORANGE: rColor = ARGBColor(255,140,0); return true; + case XML_DARKORCHID: rColor = ARGBColor(153,50,204); return true; + case XML_DARKRED: rColor = ARGBColor(139,0,0); return true; + case XML_DARKSALMON: rColor = ARGBColor(233,150,122); return true; + case XML_DARKSEAGREEN: rColor = ARGBColor(143,188,143); return true; + case XML_DARKSLATEBLUE: rColor = ARGBColor(72,61,139); return true; + case XML_DARKSLATEGRAY: rColor = ARGBColor(47,79,79); return true; + case XML_DARKSLATEGREY: rColor = ARGBColor(47,79,79); return true; + case XML_DARKTURQUOISE: rColor = ARGBColor(0,206,209); return true; + case XML_DARKVIOLET: rColor = ARGBColor(148,0,211); return true; + case XML_DEEPPINK: rColor = ARGBColor(255,20,147); return true; + case XML_DEEPSKYBLUE: rColor = ARGBColor(0,191,255); return true; + case XML_DIMGRAY: rColor = ARGBColor(105,105,105); return true; + case XML_DIMGREY: rColor = ARGBColor(105,105,105); return true; + case XML_DODGERBLUE: rColor = ARGBColor(30,144,255); return true; + case XML_FIREBRICK: rColor = ARGBColor(178,34,34); return true; + case XML_FLORALWHITE: rColor = ARGBColor(255,250,240); return true; + case XML_FORESTGREEN: rColor = ARGBColor(34,139,34); return true; + case XML_FUCHSIA: rColor = ARGBColor(255,0,255); return true; + case XML_GAINSBORO: rColor = ARGBColor(220,220,220); return true; + case XML_GHOSTWHITE: rColor = ARGBColor(248,248,255); return true; + case XML_GOLD: rColor = ARGBColor(255,215,0); return true; + case XML_GOLDENROD: rColor = ARGBColor(218,165,32); return true; + case XML_GRAY: rColor = ARGBColor(128,128,128); return true; + case XML_GREY: rColor = ARGBColor(128,128,128); return true; + case XML_GREEN: rColor = ARGBColor(0,128,0); return true; + case XML_GREENYELLOW: rColor = ARGBColor(173,255,47); return true; + case XML_HONEYDEW: rColor = ARGBColor(240,255,240); return true; + case XML_HOTPINK: rColor = ARGBColor(255,105,180); return true; + case XML_INDIANRED: rColor = ARGBColor(205,92,92); return true; + case XML_INDIGO: rColor = ARGBColor(75,0,130); return true; + case XML_IVORY: rColor = ARGBColor(255,255,240); return true; + case XML_KHAKI: rColor = ARGBColor(240,230,140); return true; + case XML_LAVENDER: rColor = ARGBColor(230,230,250); return true; + case XML_LAVENDERBLUSH: rColor = ARGBColor(255,240,245); return true; + case XML_LAWNGREEN: rColor = ARGBColor(124,252,0); return true; + case XML_LEMONCHIFFON: rColor = ARGBColor(255,250,205); return true; + case XML_LIGHTBLUE: rColor = ARGBColor(173,216,230); return true; + case XML_LIGHTCORAL: rColor = ARGBColor(240,128,128); return true; + case XML_LIGHTCYAN: rColor = ARGBColor(224,255,255); return true; + case XML_LIGHTGOLDENRODYELLOW: rColor = ARGBColor(250,250,210); return true; + case XML_LIGHTGRAY: rColor = ARGBColor(211,211,211); return true; + case XML_LIGHTGREEN: rColor = ARGBColor(144,238,144); return true; + case XML_LIGHTGREY: rColor = ARGBColor(211,211,211); return true; + case XML_LIGHTPINK: rColor = ARGBColor(255,182,193); return true; + case XML_LIGHTSALMON: rColor = ARGBColor(255,160,122); return true; + case XML_LIGHTSEAGREEN: rColor = ARGBColor(32,178,170); return true; + case XML_LIGHTSKYBLUE: rColor = ARGBColor(135,206,250); return true; + case XML_LIGHTSLATEGRAY: rColor = ARGBColor(119,136,153); return true; + case XML_LIGHTSLATEGREY: rColor = ARGBColor(119,136,153); return true; + case XML_LIGHTSTEELBLUE: rColor = ARGBColor(176,196,222); return true; + case XML_LIGHTYELLOW: rColor = ARGBColor(255,255,224); return true; + case XML_LIME: rColor = ARGBColor(0,255,0); return true; + case XML_LIMEGREEN: rColor = ARGBColor(50,205,50); return true; + case XML_LINEN: rColor = ARGBColor(250,240,230); return true; + case XML_MAGENTA: rColor = ARGBColor(255,0,255); return true; + case XML_MAROON: rColor = ARGBColor(128,0,0); return true; + case XML_MEDIUMAQUAMARINE: rColor = ARGBColor(102,205,170); return true; + case XML_MEDIUMBLUE: rColor = ARGBColor(0,0,205); return true; + case XML_MEDIUMORCHID: rColor = ARGBColor(186,85,211); return true; + case XML_MEDIUMPURPLE: rColor = ARGBColor(147,112,219); return true; + case XML_MEDIUMSEAGREEN: rColor = ARGBColor(60,179,113); return true; + case XML_MEDIUMSLATEBLUE: rColor = ARGBColor(123,104,238); return true; + case XML_MEDIUMSPRINGGREEN: rColor = ARGBColor(0,250,154); return true; + case XML_MEDIUMTURQUOISE: rColor = ARGBColor(72,209,204); return true; + case XML_MEDIUMVIOLETRED: rColor = ARGBColor(199,21,133); return true; + case XML_MIDNIGHTBLUE: rColor = ARGBColor(25,25,112); return true; + case XML_MINTCREAM: rColor = ARGBColor(245,255,250); return true; + case XML_MISTYROSE: rColor = ARGBColor(255,228,225); return true; + case XML_MOCCASIN: rColor = ARGBColor(255,228,181); return true; + case XML_NAVAJOWHITE: rColor = ARGBColor(255,222,173); return true; + case XML_NAVY: rColor = ARGBColor(0,0,128); return true; + case XML_OLDLACE: rColor = ARGBColor(253,245,230); return true; + case XML_OLIVE: rColor = ARGBColor(128,128,0); return true; + case XML_OLIVEDRAB: rColor = ARGBColor(107,142,35); return true; + case XML_ORANGE: rColor = ARGBColor(255,165,0); return true; + case XML_ORANGERED: rColor = ARGBColor(255,69,0); return true; + case XML_ORCHID: rColor = ARGBColor(218,112,214); return true; + case XML_PALEGOLDENROD: rColor = ARGBColor(238,232,170); return true; + case XML_PALEGREEN: rColor = ARGBColor(152,251,152); return true; + case XML_PALETURQUOISE: rColor = ARGBColor(175,238,238); return true; + case XML_PALEVIOLETRED: rColor = ARGBColor(219,112,147); return true; + case XML_PAPAYAWHIP: rColor = ARGBColor(255,239,213); return true; + case XML_PEACHPUFF: rColor = ARGBColor(255,218,185); return true; + case XML_PERU: rColor = ARGBColor(205,133,63); return true; + case XML_PINK: rColor = ARGBColor(255,192,203); return true; + case XML_PLUM: rColor = ARGBColor(221,160,221); return true; + case XML_POWDERBLUE: rColor = ARGBColor(176,224,230); return true; + case XML_PURPLE: rColor = ARGBColor(128,0,128); return true; + case XML_RED: rColor = ARGBColor(255,0,0); return true; + case XML_ROSYBROWN: rColor = ARGBColor(188,143,143); return true; + case XML_ROYALBLUE: rColor = ARGBColor(65,105,225); return true; + case XML_SADDLEBROWN: rColor = ARGBColor(139,69,19); return true; + case XML_SALMON: rColor = ARGBColor(250,128,114); return true; + case XML_SANDYBROWN: rColor = ARGBColor(244,164,96); return true; + case XML_SEAGREEN: rColor = ARGBColor(46,139,87); return true; + case XML_SEASHELL: rColor = ARGBColor(255,245,238); return true; + case XML_SIENNA: rColor = ARGBColor(160,82,45); return true; + case XML_SILVER: rColor = ARGBColor(192,192,192); return true; + case XML_SKYBLUE: rColor = ARGBColor(135,206,235); return true; + case XML_SLATEBLUE: rColor = ARGBColor(106,90,205); return true; + case XML_SLATEGRAY: rColor = ARGBColor(112,128,144); return true; + case XML_SLATEGREY: rColor = ARGBColor(112,128,144); return true; + case XML_SNOW: rColor = ARGBColor(255,250,250); return true; + case XML_SPRINGGREEN: rColor = ARGBColor(0,255,127); return true; + case XML_STEELBLUE: rColor = ARGBColor(70,130,180); return true; + case XML_TAN: rColor = ARGBColor(210,180,140); return true; + case XML_TEAL: rColor = ARGBColor(0,128,128); return true; + case XML_THISTLE: rColor = ARGBColor(216,191,216); return true; + case XML_TOMATO: rColor = ARGBColor(255,99,71); return true; + case XML_TURQUOISE: rColor = ARGBColor(64,224,208); return true; + case XML_VIOLET: rColor = ARGBColor(238,130,238); return true; + case XML_WHEAT: rColor = ARGBColor(245,222,179); return true; + case XML_WHITE: rColor = ARGBColor(255,255,255); return true; + case XML_WHITESMOKE: rColor = ARGBColor(245,245,245); return true; + case XML_YELLOW: rColor = ARGBColor(255,255,0); return true; + case XML_YELLOWGREEN: rColor = ARGBColor(154,205,50); return true; + + default: + return false; // no color at all, I'd guess. + } +} + +bool parseOpacity (const char* sOpacity, ARGBColor& rColor ) +{ + using namespace ::boost::spirit; + + if( parse(sOpacity, + // Begin grammar + ( + real_p[assign_a(rColor.a)] + ) >> end_p, + // End grammar + space_p).full ) + { + return true; + } + return false; +} + +////////////////////////////////////////////////////////////// + +bool parseTransform( const char* sTransform, basegfx::B2DHomMatrix& rTransform ) +{ + using namespace ::boost::spirit; + + double fRefOffsetX(0.0); + double fRefOffsetY(0.0); + bool bRefTransform(false); + + double fRotationAngle=0.0; + double fSkewAngle=0.0; + geometry::AffineMatrix2D aIdentityTransform; + geometry::AffineMatrix2D aCurrTransform; + std::vector aTransforms; + aIdentityTransform.m00 = 1.0; aIdentityTransform.m11 = 1.0; + aCurrTransform = aIdentityTransform; + + const bool bRes = parse(sTransform, + // Begin grammar + ( + // identity transform + str_p("none") + | + // the ref() form + (str_p("ref") + >> '(' + >> str_p("svg")[assign_a(bRefTransform,true)] + >> !(real_p[assign_a(fRefOffsetX)] >> (',' | eps_p) >> + real_p[assign_a(fRefOffsetY)]) + >> ')') + | + // the transform-list form + (list_p( + ( + // matrix(a,b,c,d,e,f) + (str_p("matrix") + >> '(' + >> real_p[assign_a(aCurrTransform.m00)] >> (',' | eps_p) + >> real_p[assign_a(aCurrTransform.m10)] >> (',' | eps_p) + >> real_p[assign_a(aCurrTransform.m01)] >> (',' | eps_p) + >> real_p[assign_a(aCurrTransform.m11)] >> (',' | eps_p) + >> real_p[assign_a(aCurrTransform.m02)] >> (',' | eps_p) + >> real_p[assign_a(aCurrTransform.m12)] + >> ')')[push_back_a(aTransforms,aCurrTransform)] + | + // translate(x,[y]) + (str_p("translate") + >> '(' + >> real_p[boost::bind(&assign_twice, + boost::ref(aCurrTransform.m02), + boost::ref(aCurrTransform.m12),_1)] + >> !((',' | eps_p) >> real_p[assign_a(aCurrTransform.m12)]) + >> ')')[push_back_a(aTransforms,aCurrTransform)] + | + // scale(x,[y]) + (str_p("scale") + >> '(' + >> real_p[boost::bind(&assign_twice, + boost::ref(aCurrTransform.m00), + boost::ref(aCurrTransform.m11),_1)] + >> !((',' | eps_p) >> real_p[assign_a(aCurrTransform.m11)]) + >> ')')[push_back_a(aTransforms,aCurrTransform)] + | + // rotate(phi,[cx, cy]) + (str_p("rotate") + >> '(' + >> real_p[assign_a(fRotationAngle)] + >> !((',' | eps_p) >> real_p[assign_a(aCurrTransform.m02)] + >> real_p[assign_a(aCurrTransform.m12)]) + >> ')')[boost::bind(&calcRotation, + boost::ref(aTransforms), + boost::ref(aCurrTransform), + boost::cref(fRotationAngle))] + | + // skewX(phi) + (str_p("skewX") + >> '(' + >> real_p[assign_a(fSkewAngle)] + >> ')')[boost::bind(&calcSkewX, + boost::ref(aTransforms), + boost::cref(fSkewAngle))] + | + // skewY(phi) + (str_p("skewY") + >> '(' + >> real_p[assign_a(fSkewAngle)] + >> ')')[boost::bind(&calcSkewY, + boost::ref(aTransforms), + boost::cref(fSkewAngle))] + // reset current transform after every push + )[assign_a(aCurrTransform,aIdentityTransform)], + // list delimiter is either ',' or space + ',' | eps_p )) + ) >> end_p, + // End grammar + space_p).full; + + if( !bRes ) + return false; + + // fold all transformations into one + const geometry::AffineMatrix2D aTotalTransform( + std::accumulate(aTransforms.begin(), + aTransforms.end(), + aIdentityTransform, + &multiplyMatrix)); + + basegfx::unotools::homMatrixFromAffineMatrix( + rTransform, + aTotalTransform); + + // TODO(F1): handle the ref case + return bRes; +} + +////////////////////////////////////////////////////////////// + +bool parseViewBox( const char* sViewbox, basegfx::B2DRange& rRect ) +{ + using namespace ::boost::spirit; + + double x=0.0,y=0.0,w=0.0,h=0.0; + + const bool bRes = parse(sViewbox, + // Begin grammar + ( + // either comma- or space-delimited list of four doubles + real_p[assign_a(x)] >> (',' | eps_p) >> + real_p[assign_a(y)] >> (',' | eps_p) >> + real_p[assign_a(w)] >> (',' | eps_p) >> + real_p[assign_a(h)] >> end_p + ), + // End grammar + space_p).full; + + if( !bRes ) + return false; + + rRect = basegfx::B2DRange(x,y,x+w,y+h); + + return true; +} + +////////////////////////////////////////////////////////////// + +bool parseDashArray( const char* sDashArray, std::vector& rOutputVector ) +{ + using namespace ::boost::spirit; + + rOutputVector.clear(); + return parse(sDashArray, + // Begin grammar + ( + // parse comma-delimited list of doubles (have to use the + // 'direct' variant, as otherwise spirit refactors our + // parser to push both real num and comma to push_back_a) + list_p.direct + ( + real_p[push_back_a(rOutputVector)], + ',' + ) + ) >> end_p, + // End grammar + space_p).full; +} + +////////////////////////////////////////////////////////////// + +namespace +{ +void appendChar( std::string& str, char character) +{ + str.append(1,character); +} +} + +bool parseXlinkHref( const char* sXlinkHref, std::string& data ) +{ + using namespace ::boost::spirit; + + data.erase(data.begin(),data.end()); + + std::string sLink(sXlinkHref); + + if (!sLink.compare(0,5,"data:")) + { + // the inplace "data" uri + size_t position = sLink.rfind(','); + if (position > 0 && position < std::string::npos) + { + data = sLink.substr(position+1); + OSL_TRACE("%s", data.c_str()); + return true; + } + } + + return false; +} + +} // namespace svgi diff --git a/filter/source/svg/parserfragments.hxx b/filter/source/svg/parserfragments.hxx new file mode 100644 index 000000000000..bcb6427aa4d8 --- /dev/null +++ b/filter/source/svg/parserfragments.hxx @@ -0,0 +1,50 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef INCLUDED_PARSERFRAGMENTS_HXX +#define INCLUDED_PARSERFRAGMENTS_HXX + +#include +#include +#include + +namespace basegfx +{ + class B2DHomMatrix; + class B2DRange; +} +namespace svgi +{ + struct ARGBColor; + + /// Parse given string for one of the SVG color grammars + bool parseColor( const char* sColor, ARGBColor& rColor ); + bool parseOpacity( const char* sOpacity, ARGBColor& rColor ); + + /// Parse given string for one of the SVG transformation grammars + bool parseTransform( const char* sTransform, basegfx::B2DHomMatrix& rTransform ); + + /// Parse given string for the viewBox attribute + bool parseViewBox( const char* sViewbox, basegfx::B2DRange& rRect ); + + /// Parse given string for a list of double values, comma-delimited + bool parseDashArray( const char* sDashArray, std::vector& rOutputVector ); + + /// Parse given string for the xlink attribute + bool parseXlinkHref( const char* xlink, std::string& data ); + +} // namespace svgi + +#endif diff --git a/filter/source/svg/spirit_supplements.hxx b/filter/source/svg/spirit_supplements.hxx new file mode 100644 index 000000000000..6623e6d64f3b --- /dev/null +++ b/filter/source/svg/spirit_supplements.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef INCLUDED_SPIRIT_SUPPLEMENTS_HXX +#define INCLUDED_SPIRIT_SUPPLEMENTS_HXX + +# ifndef USE_MODERN_SPIRIT +# include + +namespace boost { namespace spirit +{ + template <> + class assign_actor< std::pair > + { + public: + explicit assign_actor(std::pair& ref_) + : ref(ref_) {} + + template + void operator()(T2 const& val) const + { ref = val; } + + template + void operator()(IteratorT const& f, IteratorT const& l) const + { + ref.first = f, ref.second = l; + } + + private: + std::pair& ref; + }; + + template struct assigner + { + assigner( Target& rTarget, Value aValue ) : + mrTarget(rTarget), maValue(aValue) + {} + + void assign() const { mrTarget=maValue; } + + void operator()() const { assign(); } + template void operator()(T1) const { assign(); } + template void operator()(T1,T2) const { assign(); } + template void operator()(T1,T2,T3) const { assign(); } + + Target& mrTarget; + const Value maValue; + }; + + template inline assigner + assign_a( Target& rTarget, Value aValue ) + { + return assigner(rTarget,aValue); + } + + template inline assign_actor + assign_a(Target& rTarget) + { + return assign_actor(rTarget); + } + + template struct back_pusher + { + back_pusher( Target& rTarget, const Value& rValue ) : + mrTarget(rTarget), mrValue(rValue) + {} + + void push_back() const { mrTarget.push_back(mrValue); } + + void operator()() const { push_back(); } + template void operator()(T1) const { push_back(); } + template void operator()(T1,T2) const { push_back(); } + template void operator()(T1,T2,T3) const { push_back(); } + + Target& mrTarget; + const Value& mrValue; + }; + + template inline back_pusher + push_back_a( Target& rTarget, const Value& rValue ) + { + return back_pusher(rTarget,rValue); + } + + template struct value_back_pusher + { + explicit value_back_pusher( Target& rTarget ) : + mrTarget(rTarget) + {} + template void operator()(T1 val) const { mrTarget.push_back(val); } + + Target& mrTarget; + }; + + template inline value_back_pusher + push_back_a( Target& rTarget ) + { + return value_back_pusher(rTarget); + } +} } + +# endif +#endif diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 118474bbe2b0..2755dfcf45d4 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -30,13 +30,16 @@ #include -#include "svgfilter.hxx" +#include +#include #include #include #include #include #include +#include "svgfilter.hxx" + using ::rtl::OUString; using namespace ::com::sun::star; @@ -44,8 +47,9 @@ using namespace ::com::sun::star; // - SVGFilter - // ------------- -SVGFilter::SVGFilter( const Reference< XMultiServiceFactory > &rxMSF ) : - mxMSF( rxMSF ), +SVGFilter::SVGFilter( const Reference< XComponentContext >& rxCtx ) : + mxMSF( rxCtx->getServiceManager(), + uno::UNO_QUERY_THROW ), mpSVGDoc( NULL ), mpSVGExport( NULL ), mpSVGFontExport( NULL ), @@ -80,11 +84,9 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto if( pFocusWindow ) pFocusWindow->EnterWait(); -#ifdef SOLAR_JAVA if( mxDstDoc.is() ) bRet = implImport( rDescriptor ); else -#endif if( mxSrcDoc.is() ) { uno::Reference< frame::XDesktop > xDesktop( mxMSF->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), @@ -153,77 +155,64 @@ void SAL_CALL SVGFilter::setSourceDocument( const Reference< XComponent >& xDoc // ----------------------------------------------------------------------------- -#ifdef SOLAR_JAVA void SAL_CALL SVGFilter::setTargetDocument( const Reference< XComponent >& xDoc ) throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException) { mxDstDoc = xDoc; } -#endif - -// ----------------------------------------------------------------------------- - -void SAL_CALL SVGFilter::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& /* aArguments */ ) - throw (Exception, RuntimeException) -{ -} - -// ----------------------------------------------------------------------------- - -OUString SVGFilter_getImplementationName () - throw (RuntimeException) -{ - return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.SVGFilter" ) ); -} - -// ----------------------------------------------------------------------------- - -#define SERVICE_NAME "com.sun.star.document.SVGFilter" - -sal_Bool SAL_CALL SVGFilter_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) ); -} // ----------------------------------------------------------------------------- -Sequence< OUString > SAL_CALL SVGFilter_getSupportedServiceNames( ) throw (RuntimeException) +rtl::OUString SAL_CALL SVGFilter::detect( Sequence< PropertyValue >& io_rDescriptor ) throw (RuntimeException) { - Sequence < OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); - return aRet; -} + uno::Reference< io::XInputStream > xInput; + rtl::OUString aURL; -#undef SERVICE_NAME + const beans::PropertyValue* pAttribs = io_rDescriptor.getConstArray(); + const sal_Int32 nAttribs = io_rDescriptor.getLength(); + for( sal_Int32 i = 0; i < nAttribs; i++ ) + { + if( pAttribs[i].Name.equalsAscii( "InputStream" ) ) + pAttribs[i].Value >>= xInput; + } -// ----------------------------------------------------------------------------- + if( !xInput.is() ) + return rtl::OUString(); -Reference< XInterface > SAL_CALL SVGFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) -{ - return (cppu::OWeakObject*) new SVGFilter( rSMgr ); -} + uno::Reference< io::XSeekable > xSeek( xInput, uno::UNO_QUERY ); + if( xSeek.is() ) + xSeek->seek( 0 ); -// ----------------------------------------------------------------------------- + // read the first 1024 bytes & check a few magic string + // constants (heuristically) + const sal_Int32 nLookAhead = 1024; + uno::Sequence< sal_Int8 > aBuf( nLookAhead ); + const sal_uInt64 nBytes=xInput->readBytes(aBuf, nLookAhead); + const sal_Int8* const pBuf=aBuf.getConstArray(); -OUString SAL_CALL SVGFilter::getImplementationName( ) - throw (RuntimeException) -{ - return SVGFilter_getImplementationName(); -} + sal_Int8 aMagic1[] = {'<', 's', 'v', 'g'}; + if( std::search(pBuf, pBuf+nBytes, + aMagic1, aMagic1+sizeof(aMagic1)/sizeof(*aMagic1)) != pBuf+nBytes ) + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("svg_Scalable_Vector_Graphics") ); -// ----------------------------------------------------------------------------- + sal_Int8 aMagic2[] = {'D', 'O', 'C', 'T', 'Y', 'P', 'E', ' ', 's', 'v', 'g'}; + if( std::search(pBuf, pBuf+nBytes, + aMagic2, aMagic2+sizeof(aMagic2)/sizeof(*aMagic2)) != pBuf+nBytes ) + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("svg_Scalable_Vector_Graphics") ); -sal_Bool SAL_CALL SVGFilter::supportsService( const OUString& rServiceName ) - throw (RuntimeException) -{ - return SVGFilter_supportsService( rServiceName ); + return rtl::OUString(); } // ----------------------------------------------------------------------------- -::com::sun::star::uno::Sequence< OUString > SAL_CALL SVGFilter::getSupportedServiceNames( ) throw (RuntimeException) -{ - return SVGFilter_getSupportedServiceNames(); -} +namespace sdecl = comphelper::service_decl; + sdecl::class_ serviceImpl; + const sdecl::ServiceDecl svgFilter( + serviceImpl, + "com.sun.star.comp.Draw.SVGFilter", + "com.sun.star.document.ImportFilter;" + "com.sun.star.document.ExportFilter;" + "com.sun.star.document.ExtendedTypeDetection" ); + +// The C shared lib entry points +COMPHELPER_SERVICEDECL_EXPORTS1(svgFilter) diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index 0bbc64e2c244..a1582b5e434f 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -35,20 +35,14 @@ #include #include #include -#ifdef SOLAR_JAVA #include -#endif // SOLAR_JAVA #include +#include #include #include #include #include -#include -#ifdef SOLAR_JAVA -#include -#else // !SOLAR_JAVA #include -#endif #include #include #include @@ -175,18 +169,10 @@ class SVGFontExport; class SVGActionWriter; class EditFieldInfo; -#ifdef SOLAR_JAVA -class SVGFilter : public cppu::WeakImplHelper5 < XFilter, - XImporter, - XExporter, - XInitialization, - XServiceInfo > -#else // !SOLAR_JAVA class SVGFilter : public cppu::WeakImplHelper4 < XFilter, + XImporter, XExporter, - XInitialization, - XServiceInfo > -#endif + XExtendedFilterDetection > { typedef ::std::hash_map< Reference< XInterface >, ObjectRepresentation, HashReferenceXInterface > ObjectMap; @@ -203,15 +189,11 @@ private: ObjectMap* mpObjects; Reference< XComponent > mxSrcDoc; -#ifdef SOLAR_JAVA Reference< XComponent > mxDstDoc; -#endif Reference< XDrawPage > mxDefaultPage; Link maOldFieldHdl; -#ifdef SOLAR_JAVA sal_Bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException); -#endif sal_Bool implExport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException); Reference< XDocumentHandler > implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm ); @@ -250,26 +232,19 @@ protected: virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& rDescriptor ) throw(RuntimeException); virtual void SAL_CALL cancel( ) throw (RuntimeException); -#ifdef SOLAR_JAVA // XImporter virtual void SAL_CALL setTargetDocument( const Reference< XComponent >& xDoc ) throw(IllegalArgumentException, RuntimeException); -#endif // XExporter virtual void SAL_CALL setSourceDocument( const Reference< XComponent >& xDoc ) throw(IllegalArgumentException, RuntimeException); - // XInitialization - virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw(RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(RuntimeException); - virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException); + // XExtendedFilterDetection + virtual rtl::OUString SAL_CALL detect( Sequence< PropertyValue >& io_rDescriptor ) throw (RuntimeException); public: - SVGFilter( const Reference< XMultiServiceFactory > &rxMSF ); - virtual ~SVGFilter(); + explicit SVGFilter( const Reference< XComponentContext >& rxCtx ); + virtual ~SVGFilter(); }; // ----------------------------------------------------------------------------- diff --git a/filter/source/svg/svgimport.cxx b/filter/source/svg/svgimport.cxx index fd4f711cb085..7f4be27745b6 100644 --- a/filter/source/svg/svgimport.cxx +++ b/filter/source/svg/svgimport.cxx @@ -29,160 +29,59 @@ #include "precompiled_filter.hxx" #include "svgfilter.hxx" +#include "svgreader.hxx" + #include "rtl/ref.hxx" -#include "jvmaccess/virtualmachine.hxx" -// ------------- -// - SVGFilter - -// ------------- + +#include + +#include + +#include +#include + +#include + +#include +#include +#include + +#include +#include + +using namespace ::com::sun::star; +using namespace ::svgi; sal_Bool SVGFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException) { - Reference< XMultiServiceFactory > xServiceFactory( ::comphelper::getProcessServiceFactory() ) ; - rtl::OUString aTmpFileName; - String aFileName; - sal_Int32 nLength = rDescriptor.getLength(); - const PropertyValue* pValue = rDescriptor.getConstArray(); - sal_Bool bRet = sal_False; - - for( sal_Int32 i = 0 ; ( i < nLength ) && !aTmpFileName.getLength(); i++) - if( pValue[ i ].Name.equalsAscii( "FileName" ) ) - pValue[ i ].Value >>= aTmpFileName; - - if( aTmpFileName.getLength() && xServiceFactory.is() ) + rtl::OUString aURL; + uno::Reference< io::XInputStream > xInputStream; + uno::Reference< task::XStatusIndicator > xStatus; + const sal_Int32 nLength = rDescriptor.getLength(); + const beans::PropertyValue* pAttribs = rDescriptor.getConstArray(); + for ( sal_Int32 i=0 ; i xJavaVM( xServiceFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), UNO_QUERY ); - Sequence< sal_Int8 > aProcessID( 17 ); - String aLocalFile; - - if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( aTmpFileName, aLocalFile ) && aLocalFile.Len() ) + if( pAttribs->Name.equalsAscii( "InputStream" ) ) { - rtl_getGlobalProcessId( (sal_uInt8 *) aProcessID.getArray() ); - aProcessID[16] = 0; - - OSL_ENSURE(sizeof (sal_Int64) - >= sizeof (jvmaccess::VirtualMachine *), - "Pointer cannot be represented as sal_Int64"); - sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( - static_cast< jvmaccess::VirtualMachine * >(0)); - xJavaVM->getJavaVM(aProcessID) >>= nPointer; - rtl::Reference _virtualMachine = - reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer); - if (!_virtualMachine.is()) - return bRet; - - jobjectArray aArgs; - jclass aClass; - jmethodID aMId; - jstring aJStr; - - try - { - jvmaccess::VirtualMachine::AttachGuard vmGuard(_virtualMachine); - - JNIEnv * pEnv = vmGuard.getEnvironment(); - - aClass = pEnv->FindClass( "SOTranscoder" ); - - if( aClass ) - { - aMId = pEnv->GetStaticMethodID( aClass, "main", "([Ljava/lang/String;)V" ); - if ( aMId ) - { - - ::utl::TempFile aTempFile; - String aOutputURL( aTempFile.GetURL() ); - String aOutputFile; - - aTempFile.EnableKillingFile(); - - if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( aOutputURL, aOutputFile ) && aOutputFile.Len() ) - { - aJStr = pEnv->NewStringUTF( ByteString( aLocalFile.GetBuffer(), RTL_TEXTENCODING_UTF8 ).GetBuffer() ); - aArgs = static_cast(pEnv->NewObjectArray( 2, pEnv->FindClass( "java/lang/String" ), aJStr )); - aJStr = pEnv->NewStringUTF( ByteString( aOutputFile.GetBuffer(), RTL_TEXTENCODING_UTF8 ).GetBuffer() ); - pEnv->SetObjectArrayElement( aArgs, 1, aJStr ); - pEnv->CallStaticVoidMethod( aClass, aMId, aArgs ); - - Graphic aGraphic; - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aOutputURL, STREAM_READ ); - - if( pIStm ) - { - GraphicConverter::Import( *pIStm, aGraphic ); - delete pIStm; - } - - Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxDstDoc, UNO_QUERY ); - - if( xDrawPagesSupplier.is() && ( aGraphic.GetType() != GRAPHIC_NONE ) ) - { - Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages() ); - - if( xDrawPages.is() && xDrawPages->getCount() ) - { - Reference< XDrawPage > xDrawPage; - - if( xDrawPages->getByIndex( 0 ) >>= xDrawPage ) - { - Reference< XShapes > xShapes( xDrawPage, UNO_QUERY ); - Reference< XPropertySet> xPagePropSet( xDrawPage, UNO_QUERY ); - Reference< XShape > xShape( Reference< XMultiServiceFactory >( mxDstDoc, UNO_QUERY )->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GraphicObjectShape" ) ) ), UNO_QUERY ); - - if( xPagePropSet.is() && xShapes.is() && xShape.is() ) - { - Reference< XPropertySet > xPropSet( xShape, UNO_QUERY ); - sal_Int32 nPageWidth = 0, nPageHeight = 0; - - xPagePropSet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nPageWidth; - xPagePropSet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nPageHeight; - - if( xPropSet.is() && nPageWidth && nPageHeight ) - { - xShapes->add( xShape ); - - ::com::sun::star::awt::Point aPos; - ::com::sun::star::awt::Size aSize; - GraphicObject aGraphObj( aGraphic ); - String aGraphURL( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ); - Any aValue; - Size aGraphicSize; - const MapMode aTargetMapMode( MAP_100TH_MM ); - - if( aGraphObj.GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) - aGraphicSize = Application::GetDefaultDevice()->PixelToLogic( aGraphObj.GetPrefSize(), aTargetMapMode ); - else - aGraphicSize = OutputDevice::LogicToLogic( aGraphObj.GetPrefSize(), aGraphObj.GetPrefMapMode(), aTargetMapMode ); - - aGraphURL += String( aGraphObj.GetUniqueID(), RTL_TEXTENCODING_ASCII_US ); - aValue <<= rtl::OUString( aGraphURL ); - xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), aValue ); - - aPos.X = ( nPageWidth - aGraphicSize.Width() ) >> 1; - aPos.Y = ( nPageHeight - aGraphicSize.Height() ) >> 1; - - aSize.Width = aGraphicSize.Width(); - aSize.Height = aGraphicSize.Height(); - - xShape->setPosition( aPos ); - xShape->setSize( aSize ); - - bRet = sal_True; - } - } - } - } - } - } - } - } - } - catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) - { - } + pAttribs->Value >>= xInputStream; } + else if( pAttribs->Name.equalsAscii( "StatusIndicator" ) ) + pAttribs->Value >>= xStatus; } - return bRet; + + OSL_ASSERT(xInputStream.is()); + if(!xInputStream.is()) + return sal_False; + + rtl::OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.XMLOasisImporter" ) ); + Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + + // The XImporter sets up an empty target document for XDocumentHandler to write to.. + uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); + xImporter->setTargetDocument(mxDstDoc); + + SVGReader aReader(mxMSF, xInputStream, xInternalHandler); + return aReader.parseAndConvert(); } diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx new file mode 100644 index 000000000000..d24ab7136477 --- /dev/null +++ b/filter/source/svg/svgreader.cxx @@ -0,0 +1,1876 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_filter.hxx" + +#include "svgreader.hxx" +#include +#include "gfxtypes.hxx" +#include "units.hxx" +#include "parserfragments.hxx" +#include "tokenmap.hxx" +#include "b2dellipse.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define USTR(x) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) +#define OASIS_STR "urn:oasis:names:tc:opendocument:xmlns:" + +using namespace ::com::sun::star; + +namespace svgi +{ +namespace +{ + +/** visits all children of the specified type with the given functor + */ +template void visitChildren(const Func& rFunc, + const uno::Reference xElem, + xml::dom::NodeType eChildType ) +{ + uno::Reference xChildren( xElem->getChildNodes() ); + const sal_Int32 nNumNodes( xChildren->getLength() ); + for( sal_Int32 i=0; iitem(i)->getNodeType() == eChildType ) + rFunc( *xChildren->item(i).get() ); + } +} + +/** Visit all elements of the given tree (in-order traversal) + + Given functor is called for every element, and passed the + element's attributes, if any + */ +template void visitElements(Func& rFunc, + const uno::Reference xElem) +{ + if( xElem->hasAttributes() ) + rFunc(xElem,xElem->getAttributes()); + else + rFunc(xElem); + + // notify children processing + rFunc.push(); + + // recurse over children + uno::Reference xChildren( xElem->getChildNodes() ); + const sal_Int32 nNumNodes( xChildren->getLength() ); + for( sal_Int32 i=0; iitem(i)->getNodeType() == xml::dom::NodeType_ELEMENT_NODE ) + visitElements( rFunc, + uno::Reference( + xChildren->item(i), + uno::UNO_QUERY_THROW) ); + } + + // children processing done + rFunc.pop(); +} + +template value_type square(value_type v) +{ + return v*v; +} + +double colorDiffSquared(const ARGBColor& rCol1, const ARGBColor& rCol2) +{ + return + square(rCol1.a-rCol2.a) + + square(rCol1.r-rCol2.r) + + square(rCol1.g-rCol2.g) + + square(rCol1.b-rCol2.b); +} + +typedef std::map ElementRefMapType; + +struct AnnotatingVisitor +{ + AnnotatingVisitor(StatePool& rStatePool, + StateMap& rStateMap, + const State& rInitialState, + const uno::Reference& xDocumentHandler) : + mnCurrStateId(0), + maCurrState(), + maParentStates(), + mrStates(rStatePool), + mrStateMap(rStateMap), + mxDocumentHandler(xDocumentHandler), + maGradientVector(), + maGradientStopVector() + { + maParentStates.push_back(rInitialState); + } + + void operator()( const uno::Reference& ) + {} + + void operator()( const uno::Reference& xElem, + const uno::Reference& xAttributes ) + { + const sal_Int32 nTagId(getTokenId(xElem->getTagName())); + switch (nTagId) + { + case XML_LINEARGRADIENT: + { + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + maGradientVector.push_back(Gradient(Gradient::LINEAR)); + + // do we have a reference to a parent gradient? parse + // that first, as it sets our defaults here (manually + // tracking default state on each Gradient variable is + // much more overhead) + uno::Reference xNode(xAttributes->getNamedItem(USTR("href"))); + if(xNode.is()) + { + const rtl::OUString sValue(xNode->getNodeValue()); + ElementRefMapType::iterator aFound=maGradientIdMap.end(); + if (sValue.copy(0,1).equalsAscii("#")) + aFound = maGradientIdMap.find(sValue.copy(1)); + else + aFound = maGradientIdMap.find(sValue);; + + if( aFound != maGradientIdMap.end() ) + maGradientVector.back() = maGradientVector[aFound->second]; + } + + // do that after dereferencing, to prevent hyperlinked + // gradient to clobber our Id again + maGradientVector.back().mnId = maGradientVector.size()-1; + maGradientVector.back().meType = Gradient::LINEAR; // has been clobbered as well + + for( sal_Int32 i=0; iitem(i)->getNodeName()), + xAttributes->item(i)->getNodeValue() ); + } + break; + } + case XML_RADIALGRADIENT: + { + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + maGradientVector.push_back(Gradient(Gradient::RADIAL)); + + // do we have a reference to a parent gradient? parse + // that first, as it sets our defaults here (manually + // tracking default state on each Gradient variable is + // much more overhead) + uno::Reference xNode(xAttributes->getNamedItem(USTR("href"))); + if(xNode.is()) + { + const rtl::OUString sValue(xNode->getNodeValue()); + ElementRefMapType::iterator aFound=maGradientIdMap.end(); + if (sValue.copy(0,1).equalsAscii("#")) + aFound = maGradientIdMap.find(sValue.copy(1)); + else + aFound = maGradientIdMap.find(sValue);; + + if( aFound != maGradientIdMap.end() ) + maGradientVector.back() = maGradientVector[aFound->second]; + } + + // do that after dereferencing, to prevent hyperlinked + // gradient to clobber our Id again + maGradientVector.back().mnId = maGradientVector.size()-1; + maGradientVector.back().meType = Gradient::RADIAL; // has been clobbered as well + + for( sal_Int32 i=0; iitem(i)->getNodeName()), + xAttributes->item(i)->getNodeValue() ); + } + break; + } + case XML_STOP: + { + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + maGradientStopVector.push_back(GradientStop()); + maGradientVector.back().maStops.push_back(maGradientStopVector.size()-1); + for( sal_Int32 i=0; iitem(i)->getNodeName()), + xAttributes->item(i)->getNodeValue() ); + } + break; + } + default: + { + // init state. inherit defaults from parent. + maCurrState = maParentStates.back(); + maCurrState.maTransform.identity(); + + // scan for style info + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nTokenId( + getTokenId(xAttributes->item(i)->getNodeName())); + if( XML_STYLE == nTokenId ) + parseStyle(sAttributeValue); + else + parseAttribute(nTokenId, + sAttributeValue); + } + + // all attributes parsed, can calc total CTM now + basegfx::B2DHomMatrix aLocalTransform; + if( !maCurrState.maViewBox.isEmpty() && + maCurrState.maViewBox.getWidth() != 0.0 && + maCurrState.maViewBox.getHeight() != 0.0 ) + { + // transform aViewBox into viewport, such that they + // coincide + aLocalTransform.translate(-maCurrState.maViewBox.getMinX(), + -maCurrState.maViewBox.getMinY()); + aLocalTransform.scale(maCurrState.maViewport.getWidth()/maCurrState.maViewBox.getWidth(), + maCurrState.maViewport.getHeight()/maCurrState.maViewBox.getHeight()); + } + maCurrState.maCTM = maCurrState.maCTM*maCurrState.maTransform*aLocalTransform; + + OSL_TRACE("annotateStyle - CTM is: %f %f %f %f %f %f", + maCurrState.maCTM.get(0,0), + maCurrState.maCTM.get(0,1), + maCurrState.maCTM.get(0,2), + maCurrState.maCTM.get(1,0), + maCurrState.maCTM.get(1,1), + maCurrState.maCTM.get(1,2)); + + // if necessary, serialize to automatic-style section + writeStyle(xElem,nTagId); + } + } + } + + rtl::OUString getStyleName( const char* sPrefix, sal_Int32 nId ) + { + return rtl::OUString::createFromAscii(sPrefix)+rtl::OUString::valueOf(nId); + } + + bool hasGradientOpacity( const Gradient& rGradient ) + { + return + maGradientStopVector[ + rGradient.maStops[0]].maStopColor.a != 1.0 || + maGradientStopVector[ + rGradient.maStops[1]].maStopColor.a != 1.0; + } + + struct StopSorter + { + explicit StopSorter( const std::vector< GradientStop >& rStopVec ) : + mrStopVec(rStopVec) + {} + + bool operator()( sal_Size rLHS, sal_Size rRHS ) + { + return mrStopVec[rLHS].mnStopPosition < mrStopVec[rRHS].mnStopPosition; + } + + const std::vector< GradientStop >& mrStopVec; + }; + + void optimizeGradientStops( Gradient& rGradient ) + { + // sort for increasing stop position + std::sort(rGradient.maStops.begin(),rGradient.maStops.end(), + StopSorter(maGradientStopVector)); + + if( rGradient.maStops.size() < 3 ) + return; //easy! :-) + + // join similar colors + std::vector aNewStops(1,rGradient.maStops.front()); + for( sal_Size i=1; i fMaxDistance ) + { + nMaxIndex = i-1; + fMaxDistance = fCurrDistance; + } + } + rGradient.maStops[0] = rGradient.maStops[nMaxIndex]; + rGradient.maStops[1] = rGradient.maStops[nMaxIndex+1]; + rGradient.maStops.erase(rGradient.maStops.begin()+2,rGradient.maStops.end()); + } + + sal_Int8 toByteColor( double val ) + { + // TODO(Q3): duplicated from vcl::unotools + return sal::static_int_cast( + basegfx::fround(val*255.0)); + } + + rtl::OUString getOdfColor( const ARGBColor& rColor ) + { + // TODO(Q3): duplicated from pdfimport + rtl::OUStringBuffer aBuf( 7 ); + const sal_uInt8 nRed ( toByteColor(rColor.r) ); + const sal_uInt8 nGreen( toByteColor(rColor.g) ); + const sal_uInt8 nBlue ( toByteColor(rColor.b) ); + aBuf.append( sal_Unicode('#') ); + if( nRed < 10 ) + aBuf.append( sal_Unicode('0') ); + aBuf.append( sal_Int32(nRed), 16 ); + if( nGreen < 10 ) + aBuf.append( sal_Unicode('0') ); + aBuf.append( sal_Int32(nGreen), 16 ); + if( nBlue < 10 ) + aBuf.append( sal_Unicode('0') ); + aBuf.append( sal_Int32(nBlue), 16 ); + + // TODO(F3): respect alpha transparency (polygons etc.) + OSL_ASSERT(rColor.a == 1.0); + + return aBuf.makeStringAndClear(); + } + + bool writeStyle(State& rState, const sal_Int32 nTagId) + { + rtl::Reference xAttrs( new SvXMLAttributeList() ); + uno::Reference xUnoAttrs( xAttrs.get() ); + + std::pair aRes = mrStates.insert(rState); + if( !aRes.second ) + return false; // not written + + ++mnCurrStateId; + + // mnStyleId does not take part in hashing/comparison + const_cast(*aRes.first).mnStyleId = mnCurrStateId; + mrStateMap.insert(std::make_pair( + mnCurrStateId, + rState)); + + // find two representative stop colors (as odf only support + // start&end color) + optimizeGradientStops(rState.maFillGradient); + + // do we have a gradient fill? then write out gradient as well + if( rState.meFillType == GRADIENT && rState.maFillGradient.maStops.size() > 1 ) + { + // TODO(F3): ODF12 supposedly also groks svg:linear/radialGradient + xAttrs->AddAttribute( USTR( "draw:name" ), getStyleName("svggradient", rState.maFillGradient.mnId) ); + if( rState.maFillGradient.meType == Gradient::LINEAR ) + { + // should the optimizeGradientStops method decide that + // this is a three-color gradient, it prolly wanted us + // to take axial instead + xAttrs->AddAttribute( USTR( "draw:style" ), + rState.maFillGradient.maStops.size() == 3 ? + USTR("axial") : + USTR("linear") ); + } + else + { + xAttrs->AddAttribute( USTR( "draw:style" ), USTR("ellipsoid") ); + xAttrs->AddAttribute( USTR( "draw:cx" ), USTR("50%") ); + xAttrs->AddAttribute( USTR( "draw:cy" ), USTR("50%") ); + } + + basegfx::B2DTuple rScale, rTranslate; + double rRotate, rShearX; + if( rState.maFillGradient.maTransform.decompose(rScale, rTranslate, rRotate, rShearX) ) + xAttrs->AddAttribute( USTR( "draw:angle" ), + rtl::OUString::valueOf(rRotate*1800.0/M_PI ) ); + xAttrs->AddAttribute( USTR( "draw:start-color" ), + getOdfColor( + maGradientStopVector[ + rState.maFillGradient.maStops[0]].maStopColor) ); + xAttrs->AddAttribute( USTR( "draw:end-color" ), + getOdfColor( + maGradientStopVector[ + rState.maFillGradient.maStops[1]].maStopColor) ); + xAttrs->AddAttribute( USTR( "draw:border" ), USTR("0%") ); + mxDocumentHandler->startElement( USTR("draw:gradient"), + xUnoAttrs ); + mxDocumentHandler->endElement( USTR("draw:gradient") ); + + if( hasGradientOpacity(rState.maFillGradient) ) + { + // need to write out opacity style as well + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "draw:name" ), getStyleName("svgopacity", rState.maFillGradient.mnId) ); + if( rState.maFillGradient.meType == Gradient::LINEAR ) + { + xAttrs->AddAttribute( USTR( "draw:style" ), USTR("linear") ); + } + else + { + xAttrs->AddAttribute( USTR( "draw:style" ), USTR("ellipsoid") ); + xAttrs->AddAttribute( USTR( "draw:cx" ), USTR("50%") ); + xAttrs->AddAttribute( USTR( "draw:cy" ), USTR("50%") ); + } + + // modulate gradient opacity with overall fill opacity + xAttrs->AddAttribute( USTR( "draw:end" ), + rtl::OUString::valueOf( + maGradientStopVector[ + rState.maFillGradient.maStops[0]].maStopColor.a* + maCurrState.mnFillOpacity*100.0)+USTR("%" ) ); + xAttrs->AddAttribute( USTR( "draw:start" ), + rtl::OUString::valueOf( + maGradientStopVector[ + rState.maFillGradient.maStops[1]].maStopColor.a* + maCurrState.mnFillOpacity*100.0)+USTR("%" ) ); + xAttrs->AddAttribute( USTR( "draw:border" ), USTR("0%") ); + mxDocumentHandler->startElement( USTR("draw:opacity"), + xUnoAttrs ); + mxDocumentHandler->endElement( USTR("draw:opacity") ); + } + } + + // serialize to automatic-style section + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "style:name" ), getStyleName("svggraphicstyle", mnCurrStateId) ); + xAttrs->AddAttribute( USTR( "style:family" ), USTR("graphic") ); + mxDocumentHandler->startElement( USTR("style:style"), + xUnoAttrs ); + + xAttrs->Clear(); + // text or shape? if the former, no use in processing any + // graphic attributes except stroke color, ODF can do ~nothing + // with text shapes + if( nTagId == XML_TEXT ) + { + //xAttrs->AddAttribute( USTR( "draw:auto-grow-height"), USTR("true")); + xAttrs->AddAttribute( USTR( "draw:auto-grow-width"), USTR("true")); + xAttrs->AddAttribute( USTR( "draw:textarea-horizontal-align"), USTR("left")); + //xAttrs->AddAttribute( USTR( "draw:textarea-vertical-align"), USTR("top")); + xAttrs->AddAttribute( USTR( "fo:min-height"), USTR("0cm")); + + xAttrs->AddAttribute( USTR( "fo:padding-top"), USTR("0cm")); + xAttrs->AddAttribute( USTR( "fo:padding-left"), USTR("0cm")); + xAttrs->AddAttribute( USTR( "fo:padding-right"), USTR("0cm")); + xAttrs->AddAttribute( USTR( "fo:padding-bottom"), USTR("0cm")); + + // disable any background shape + xAttrs->AddAttribute( USTR( "draw:stroke" ), USTR("none")); + xAttrs->AddAttribute( USTR( "draw:fill" ), USTR("none")); + } + else + { + if( rState.meFillType != NONE ) + { + if( rState.meFillType == GRADIENT ) + { + xAttrs->AddAttribute( USTR( "draw:fill" ), USTR("gradient")); + xAttrs->AddAttribute( USTR( "draw:fill-gradient-name" ), + getStyleName("svggradient", rState.maFillGradient.mnId) ); + if( hasGradientOpacity(rState.maFillGradient) ) + { + // needs transparency gradient as well + xAttrs->AddAttribute( USTR( "draw:opacity-name" ), + getStyleName("svgopacity", rState.maFillGradient.mnId) ); + } + else if( maCurrState.mnFillOpacity != 1.0 ) + xAttrs->AddAttribute( USTR( "draw:opacity" ), + rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity)+USTR("%") ); + } + else + { + xAttrs->AddAttribute( USTR( "draw:fill" ), USTR("solid")); + xAttrs->AddAttribute( USTR( "draw:fill-color" ), getOdfColor(rState.maFillColor)); + if( maCurrState.mnFillOpacity != 1.0 ) + xAttrs->AddAttribute( USTR( "draw:opacity" ), + rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity)+USTR("%") ); + } + } + else + xAttrs->AddAttribute( USTR( "draw:fill" ), USTR("none")); + + if( rState.meStrokeType != NONE ) + { + xAttrs->AddAttribute( USTR( "draw:stroke" ), USTR("solid")); + xAttrs->AddAttribute( USTR( "svg:stroke-color" ), getOdfColor(rState.maStrokeColor)); + } + else + xAttrs->AddAttribute( USTR( "draw:stroke" ), USTR("none")); + + if( maCurrState.mnStrokeWidth != 0.0 ) + { + ::basegfx::B2DVector aVec(maCurrState.mnStrokeWidth,0); + aVec *= maCurrState.maCTM; + xAttrs->AddAttribute( USTR("svg:stroke-width"), rtl::OUString::valueOf( pt2mm(aVec.getLength()) )+USTR("mm")); + } + if( maCurrState.meLineJoin == basegfx::B2DLINEJOIN_MITER ) + xAttrs->AddAttribute( USTR( "draw:stroke-linejoin"), USTR("miter")); + else if( maCurrState.meLineJoin == basegfx::B2DLINEJOIN_ROUND ) + xAttrs->AddAttribute( USTR( "draw:stroke-linejoin"), USTR("round")); + else if( maCurrState.meLineJoin == basegfx::B2DLINEJOIN_BEVEL ) + xAttrs->AddAttribute( USTR( "draw:stroke-linejoin"), USTR("bevel")); + if( maCurrState.mnStrokeOpacity != 1.0 ) + xAttrs->AddAttribute( USTR("svg:stroke-opacity"), + rtl::OUString::valueOf(100.0*maCurrState.mnStrokeOpacity)+USTR("%")); + } + + mxDocumentHandler->startElement( USTR("style:graphic-properties"), + xUnoAttrs ); + mxDocumentHandler->endElement( USTR("style:graphic-properties") ); + mxDocumentHandler->endElement( USTR("style:style") ); + + return true; // newly written + } + + void writeStyle(const uno::Reference& xElem, const sal_Int32 nTagId) + { + sal_Int32 nEmulatedStyleId=0; + if( maCurrState.maDashArray.size() && + maCurrState.meStrokeType != NONE ) + { + // ODF dashing is severly borked - generate filled shape + // instead (further down the road - here, we simply + // emulate a filled style with the next id) + + // move all stroke attribs to fill, Clear stroking + State aEmulatedStrokeState( maCurrState ); + aEmulatedStrokeState.meFillType = maCurrState.meStrokeType; + aEmulatedStrokeState.mnFillOpacity = maCurrState.mnStrokeOpacity; + aEmulatedStrokeState.maFillColor = maCurrState.maStrokeColor; + aEmulatedStrokeState.maFillGradient = maCurrState.maStrokeGradient; + aEmulatedStrokeState.meFillRule = EVEN_ODD; + aEmulatedStrokeState.meStrokeType = NONE; + + if( writeStyle(aEmulatedStrokeState, nTagId) ) + nEmulatedStyleId = mnCurrStateId; + else + nEmulatedStyleId = mrStates.find(aEmulatedStrokeState)->mnStyleId; + } + + sal_Int32 nStyleId=0; + if( writeStyle(maCurrState, nTagId) ) + nStyleId = mnCurrStateId; + else + nStyleId = mrStates.find(maCurrState)->mnStyleId; + + xElem->setAttribute(USTR("internal-style-ref"), + rtl::OUString::valueOf( + nStyleId) + +USTR("$") + +rtl::OUString::valueOf( + nEmulatedStyleId)); + } + + void push() + { + maParentStates.push_back(maCurrState); + } + + void pop() + { + maParentStates.pop_back(); + } + + void parseLinearGradientData( Gradient& io_rCurrGradient, + const sal_Int32 nGradientNumber, + const sal_Int32 nTokenId, + const rtl::OUString& sValue ) + { + switch(nTokenId) + { + case XML_GRADIENTTRANSFORM: + { + rtl::OString aValueUtf8( sValue.getStr(), + sValue.getLength(), + RTL_TEXTENCODING_UTF8 ); + parseTransform(aValueUtf8.getStr(),io_rCurrGradient.maTransform); + break; + } + case XML_X1: + io_rCurrGradient.maCoords.linear.mfX1 = convLength(sValue,maCurrState,'h'); + break; + case XML_X2: + io_rCurrGradient.maCoords.linear.mfX2 = convLength(sValue,maCurrState,'h'); + break; + case XML_Y1: + io_rCurrGradient.maCoords.linear.mfY1 = convLength(sValue,maCurrState,'v'); + break; + case XML_Y2: + io_rCurrGradient.maCoords.linear.mfY2 = convLength(sValue,maCurrState,'v'); + break; + case XML_ID: + maGradientIdMap.insert(std::make_pair(sValue,nGradientNumber)); + break; + case XML_GRADIENTUNITS: + if (getTokenId(sValue) == XML_OBJECTBOUNDINGBOX) + io_rCurrGradient.mbBoundingBoxUnits = true; + else + io_rCurrGradient.mbBoundingBoxUnits = false; + break; + default: + break; + } + } + + void parseRadialGradientData( Gradient& io_rCurrGradient, + const sal_Int32 nGradientNumber, + const sal_Int32 nTokenId, + const rtl::OUString& sValue ) + { + switch(nTokenId) + { + case XML_GRADIENTTRANSFORM: + { + rtl::OString aValueUtf8( sValue.getStr(), + sValue.getLength(), + RTL_TEXTENCODING_UTF8 ); + parseTransform(aValueUtf8.getStr(),io_rCurrGradient.maTransform); + break; + } + case XML_CX: + io_rCurrGradient.maCoords.radial.mfCX = convLength(sValue,maCurrState,'h'); + break; + case XML_CY: + io_rCurrGradient.maCoords.radial.mfCY = convLength(sValue,maCurrState,'v'); + break; + case XML_FX: + io_rCurrGradient.maCoords.radial.mfFX = convLength(sValue,maCurrState,'h'); + break; + case XML_FY: + io_rCurrGradient.maCoords.radial.mfFY = convLength(sValue,maCurrState,'v'); + break; + case XML_R: + io_rCurrGradient.maCoords.radial.mfR = convLength(sValue,maCurrState,'r'); + break; + case XML_ID: + maGradientIdMap.insert(std::make_pair(sValue,nGradientNumber)); + break; + case XML_GRADIENTUNITS: + if (getTokenId(sValue) == XML_OBJECTBOUNDINGBOX) + io_rCurrGradient.mbBoundingBoxUnits = true; + else + io_rCurrGradient.mbBoundingBoxUnits = false; + break; + default: + break; + } + } + + void parseGradientStop( GradientStop& io_rGradientStop, + const sal_Int32 nStopNumber, + const sal_Int32 nTokenId, + const rtl::OUString& sValue ) + { + switch(nTokenId) + { + case XML_HREF: + { + ElementRefMapType::iterator aFound=maStopIdMap.end(); + if (sValue.copy(0,1).equalsAscii("#")) + aFound = maStopIdMap.find(sValue.copy(1)); + else + aFound = maStopIdMap.find(sValue);; + + if( aFound != maStopIdMap.end() ) + io_rGradientStop = maGradientStopVector[aFound->second]; + break; + } + case XML_ID: + maStopIdMap.insert(std::make_pair(sValue,nStopNumber)); + break; + case XML_OFFSET: + io_rGradientStop.mnStopPosition = sValue.toDouble(); + break; + case XML_STYLE: + parseStyle( sValue ); + break; + default: + break; + } + } + + void parseAttribute( const sal_Int32 nTokenId, + const rtl::OUString& sValue ) + { + rtl::OString aValueUtf8( sValue.getStr(), + sValue.getLength(), + RTL_TEXTENCODING_UTF8 ); + switch(nTokenId) + { + case XML_WIDTH: + { + const double fViewPortWidth( + convLength(sValue,maCurrState,'h')); + + maCurrState.maViewport.expand( + basegfx::B2DTuple(fViewPortWidth,0.0)); + break; + } + case XML_HEIGHT: + { + const double fViewPortHeight( + convLength(sValue,maCurrState,'v')); + + maCurrState.maViewport.expand( + basegfx::B2DTuple(0.0,fViewPortHeight)); + break; + } + case XML_VIEWBOX: + { + // TODO(F1): preserveAspectRatio + parseViewBox( + aValueUtf8, + maCurrState.maViewBox); + break; + } + case XML_FILL_RULE: + { + if( aValueUtf8 == "evenodd" ) + maCurrState.meFillRule = EVEN_ODD; + else if( aValueUtf8 == "nonzero" ) + maCurrState.meFillRule = NON_ZERO; + else if( aValueUtf8 == "inherit" ) + maCurrState.meFillRule = maParentStates.back().meFillRule; + break; + } + case XML_FILL_OPACITY: + if( aValueUtf8 == "inherit" ) + maCurrState.mnFillOpacity = maParentStates.back().mnFillOpacity; + else + maCurrState.mnFillOpacity = aValueUtf8.toDouble(); + break; + case XML_STROKE_WIDTH: + { + if( aValueUtf8 == "inherit" ) + maCurrState.mnStrokeWidth = maParentStates.back().mnStrokeWidth; + else + maCurrState.mnStrokeWidth = convLength(sValue,maCurrState,'r'); + break; + } + case XML_STROKE_LINECAP: + { + if( aValueUtf8 == "butt" ) + maCurrState.meLineCap = BUTT; + else if( aValueUtf8 == "round" ) + maCurrState.meLineCap = ROUND; + else if( aValueUtf8 == "square" ) + maCurrState.meLineCap = RECT; + else if( aValueUtf8 == "inherit" ) + maCurrState.meLineCap = maParentStates.back().meLineCap; + break; + } + case XML_STROKE_LINEJOIN: + { + if( aValueUtf8 == "miter" ) + maCurrState.meLineJoin = basegfx::B2DLINEJOIN_MITER; + else if( aValueUtf8 == "round" ) + maCurrState.meLineJoin = basegfx::B2DLINEJOIN_ROUND; + else if( aValueUtf8 == "bevel" ) + maCurrState.meLineJoin = basegfx::B2DLINEJOIN_BEVEL; + else if( aValueUtf8 == "inherit" ) + maCurrState.meLineJoin = maParentStates.back().meLineJoin; + break; + } + case XML_STROKE_MITERLIMIT: + { + if( aValueUtf8 == "inherit" ) + maCurrState.mnMiterLimit = maParentStates.back().mnMiterLimit; + else + maCurrState.mnMiterLimit = aValueUtf8.toDouble(); + break; + } + case XML_STROKE_DASHOFFSET: + { + if( aValueUtf8 == "inherit" ) + maCurrState.mnDashOffset = maParentStates.back().mnDashOffset; + else + maCurrState.mnDashOffset = convLength(sValue,maCurrState,'r'); + break; + } + case XML_STROKE_DASHARRAY: + { + if( aValueUtf8 == "none" ) + maCurrState.maDashArray.clear(); + else if( aValueUtf8 == "inherit" ) + maCurrState.maDashArray = maParentStates.back().maDashArray; + else + parseDashArray(aValueUtf8.getStr(), + maCurrState.maDashArray); + break; + } + case XML_STROKE_OPACITY: + if( aValueUtf8 == "inherit" ) + maCurrState.mnStrokeOpacity = maParentStates.back().mnStrokeOpacity; + else + maCurrState.mnStrokeOpacity = aValueUtf8.toDouble(); + break; + case XML_FILL: + { + const State& rParent( maParentStates.back() ); + parsePaint( sValue, + aValueUtf8.getStr(), + maCurrState.meFillType, + maCurrState.maFillColor, + maCurrState.maFillGradient, + rParent.meFillType, + rParent.maFillColor, + rParent.maFillGradient ); + break; + } + case XML_STROKE: + { + const State& rParent( maParentStates.back() ); + parsePaint( sValue, + aValueUtf8.getStr(), + maCurrState.meStrokeType, + maCurrState.maStrokeColor, + maCurrState.maStrokeGradient, + rParent.meStrokeType, + rParent.maStrokeColor, + rParent.maStrokeGradient ); + break; + } + case XML_TRANSFORM: + { + basegfx::B2DHomMatrix aTransform; + parseTransform(aValueUtf8.getStr(),aTransform); + maCurrState.maTransform = maCurrState.maTransform*aTransform; + break; + } + case XML_FONT_FAMILY: + maCurrState.maFontFamily=sValue; + break; + case XML_FONT_SIZE: + maCurrState.mnFontSize=convLength(sValue,maCurrState,'v'); + break; + case XML_FONT_STYLE: + maCurrState.meFontStyle=STYLE_ITALIC; // TODO: sValue.toStyleId(); + break; + case XML_FONT_WEIGHT: + maCurrState.mnFontWeight=sValue.toDouble(); + break; + case XML_FONT_VARIANT: + maCurrState.meFontVariant=VARIANT_SMALLCAPS; // TODO: sValue.toDouble(); + break; + case XML_STOP_COLOR: + if( maGradientVector.empty() || + maGradientVector.back().maStops.empty() ) + break; + parseColor( aValueUtf8, + maGradientStopVector[ + maGradientVector.back().maStops.back()].maStopColor ); + break; + case XML_STOP_OPACITY: + if( maGradientVector.empty() || + maGradientVector.back().maStops.empty() ) + break; + parseOpacity( aValueUtf8, + maGradientStopVector[ + maGradientVector.back().maStops.back()].maStopColor ); + break; + default: + OSL_TRACE("unhandled token %s", getTokenName(nTokenId)); + break; + } + } + + void parseStyle( const rtl::OUString& sValue ) + { + // split individual style attributes + sal_Int32 nIndex=0, nDummyIndex=0; + rtl::OUString aCurrToken; + do + { + aCurrToken=sValue.getToken(0,';',nIndex); + + if( aCurrToken.getLength() ) + { + // split attrib & value + nDummyIndex=0; + rtl::OUString aCurrAttrib( + aCurrToken.getToken(0,':',nDummyIndex).trim()); + OSL_ASSERT(nDummyIndex!=-1); + nDummyIndex=0; + rtl::OUString aCurrValue( + aCurrToken.getToken(1,':',nDummyIndex).trim()); + OSL_ASSERT(nDummyIndex==-1); + + // recurse into normal attribute parsing + parseAttribute( getTokenId(aCurrAttrib), + aCurrValue ); + } + } + while( nIndex != -1 ); + } + + void parsePaint( const rtl::OUString& rValue, + const char* sValue, + PaintType& rType, + ARGBColor& rColor, + Gradient& rGradient, + const PaintType& rInheritType, + const ARGBColor& rInheritColor, + const Gradient& rInheritGradient ) + { + if( strcmp(sValue,"none") == 0 ) + rType = NONE; + else if( strcmp(sValue,"currentColor") == 0 ) + { + rType = SOLID; + rColor = maCurrState.maCurrentColor; + } + else if( strcmp(sValue,"inherit") == 0) + { + rType = rInheritType; + rColor = rInheritColor; + rGradient = rInheritGradient; + } + else if( strncmp(sValue,"url(#",5) == 0 ) + { + // assuming gradient. assumption does not hold generally + if( rValue.getLength() > 5 ) + { + ElementRefMapType::iterator aRes; + if( (aRes=maGradientIdMap.find(rValue.copy(5, + rValue.getLength()-6))) != maGradientIdMap.end() ) + { + rGradient = maGradientVector[aRes->second]; + rType = GRADIENT; + } + } + } + else + { + rType = SOLID; + parseColor(sValue,rColor); + } + } + + sal_Int32 mnCurrStateId; + State maCurrState; + std::vector maParentStates; + StatePool& mrStates; + StateMap& mrStateMap; + uno::Reference mxDocumentHandler; + std::vector< Gradient > maGradientVector; + std::vector< GradientStop > maGradientStopVector; + ElementRefMapType maGradientIdMap; + ElementRefMapType maStopIdMap; +}; + +/// Annotate svg styles with unique references to state pool +static void annotateStyles( StatePool& rStatePool, + StateMap& rStateMap, + const State& rInitialState, + const uno::Reference xElem, + const uno::Reference& xDocHdl ) +{ + AnnotatingVisitor aVisitor(rStatePool,rStateMap,rInitialState,xDocHdl); + visitElements(aVisitor, xElem); +} + +struct ShapeWritingVisitor +{ + ShapeWritingVisitor(StatePool& /*rStatePool*/, + StateMap& rStateMap, + const uno::Reference& xDocumentHandler) : + mrStateMap(rStateMap), + mxDocumentHandler(xDocumentHandler), + mnShapeNum(0) + {} + + void operator()( const uno::Reference& ) + { + } + + void operator()( const uno::Reference& xElem, + const uno::Reference& xAttributes ) + { + rtl::Reference xAttrs( new SvXMLAttributeList() ); + uno::Reference xUnoAttrs( xAttrs.get() ); + + sal_Int32 nDummyIndex(0); + rtl::OUString sStyleId( + xElem->getAttribute( + USTR("internal-style-ref")).getToken( + 0,'$',nDummyIndex)); + StateMap::iterator pOrigState=mrStateMap.find( + sStyleId.toInt32()); + + if( pOrigState == mrStateMap.end() ) + return; // non-exportable element, e.g. linearGradient + + maCurrState = pOrigState->second; + + const sal_Int32 nTokenId(getTokenId(xElem->getNodeName())); + switch(nTokenId) + { + case XML_LINE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double x1=0.0,y1=0.0,x2=0.0,y2=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X1: + x1= convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_X2: + x2 = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y1: + y1 = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_Y2: + y2 = convLength(sAttributeValue,maCurrState,'v'); + break; + default: + // skip + break; + } + } + + rtl::OUString sLinePath = USTR("M")+rtl::OUString::valueOf(x1)+USTR(",") + +rtl::OUString::valueOf(y1)+USTR("L")+rtl::OUString::valueOf(x2)+USTR(",") + +rtl::OUString::valueOf(y2); + basegfx::B2DPolyPolygon aPoly; + basegfx::tools::importFromSvgD(aPoly, sLinePath); + + writePathShape(xAttrs, + xUnoAttrs, + xElem, + sStyleId, + basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_POLYGON: + case XML_POLYLINE: + { + rtl::OUString sPoints = xElem->hasAttribute(USTR("points")) ? xElem->getAttribute(USTR("points")) : USTR(""); + basegfx::B2DPolygon aPoly; + basegfx::tools::importFromSvgPoints(aPoly, sPoints); + if( nTokenId == XML_POLYGON || maCurrState.meFillType != NONE ) + aPoly.setClosed(true); + + writePathShape(xAttrs, + xUnoAttrs, + xElem, + sStyleId, + basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_RECT: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + bool bRxSeen=false, bRySeen=false; + double x=0.0,y=0.0,width=0.0,height=0.0,rx=0.0,ry=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X: + x = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y: + y = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_WIDTH: + width = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_HEIGHT: + height = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_RX: + rx = convLength(sAttributeValue,maCurrState,'h'); + bRxSeen=true; + break; + case XML_RY: + ry = convLength(sAttributeValue,maCurrState,'v'); + bRySeen=true; + break; + default: + // skip + break; + } + } + + if( bRxSeen && !bRySeen ) + ry = rx; + else if( bRySeen && !bRxSeen ) + rx = ry; + + basegfx::B2DPolygon aPoly; + aPoly = basegfx::tools::createPolygonFromRect( + basegfx::B2DRange(x,y,x+width,y+height), + rx/width, ry/height ); + + writePathShape(xAttrs, + xUnoAttrs, + xElem, + sStyleId, + basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_PATH: + { + rtl::OUString sPath = xElem->hasAttribute(USTR("d")) ? xElem->getAttribute(USTR("d")) : USTR(""); + basegfx::B2DPolyPolygon aPoly; + basegfx::tools::importFromSvgD(aPoly, sPath); + + writePathShape(xAttrs, + xUnoAttrs, + xElem, + sStyleId, + aPoly); + break; + } + case XML_CIRCLE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double cx=0.0,cy=0.0,r=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_CX: + cx = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_CY: + cy = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_R: + r = convLength(sAttributeValue,maCurrState,'r'); + default: + // skip + break; + } + } + + writeEllipseShape(xAttrs, + xUnoAttrs, + xElem, + sStyleId, + basegfx::B2DEllipse(basegfx::B2DPoint(cx, cy), basegfx::B2DTuple(r,r))); + break; + } + case XML_ELLIPSE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double cx=0.0,cy=0.0,rx=0.0, ry=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_CX: + cx = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_CY: + cy = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_RX: + rx = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_RY: + ry = convLength(sAttributeValue,maCurrState,'v'); + default: + // skip + break; + } + } + + writeEllipseShape(xAttrs, + xUnoAttrs, + xElem, + sStyleId, + basegfx::B2DEllipse(basegfx::B2DPoint(cx, cy), basegfx::B2DTuple(rx,ry))); + break; + } + case XML_IMAGE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double x=0.0,y=0.0,width=0.0,height=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X: + x = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y: + y = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_WIDTH: + width = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_HEIGHT: + height = convLength(sAttributeValue,maCurrState,'v'); + break; + default: + // skip + break; + } + } + + rtl::OUString sValue = xElem->hasAttribute(USTR("href")) ? xElem->getAttribute(USTR("href")) : USTR(""); + rtl::OString aValueUtf8( sValue.getStr(), sValue.getLength(), RTL_TEXTENCODING_UTF8 ); + std::string sLinkValue; + parseXlinkHref(aValueUtf8.getStr(), sLinkValue); + + if (!sLinkValue.empty()) + writeBinaryData(xAttrs, xUnoAttrs, xElem, basegfx::B2DRange(x,y,x+width,y+height), sLinkValue); + break; + } + case XML_TEXT: + { + // collect text from all TEXT_NODE children into sText + rtl::OUStringBuffer sText; + visitChildren(boost::bind( + (rtl::OUStringBuffer& (rtl::OUStringBuffer::*)(const sal_Unicode* str))&rtl::OUStringBuffer::append, + boost::ref(sText), + boost::bind(&xml::dom::XNode::getNodeValue, + _1)), + xElem, + xml::dom::NodeType_TEXT_NODE); + + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double x=0.0,y=0.0,width=0.0,height=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X: + x = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y: + y = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_WIDTH: + width = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_HEIGHT: + height = convLength(sAttributeValue,maCurrState,'v'); + break; + default: + // skip + break; + } + } + + // actually export text + xAttrs->Clear(); + + // extract basic transformations out of CTM + basegfx::B2DTuple aScale, aTranslate; + double fRotate, fShearX; + ::rtl::OUString sTransformValue; + if (maCurrState.maCTM.decompose(aScale, aTranslate, fRotate, fShearX)) + { + rtl::OUString sTransform; + x += aTranslate.getX(); + y += aTranslate.getY(); + + sTransform += + USTR("scale(") + + rtl::OUString::valueOf(aScale.getX()) + + USTR(", ") + + rtl::OUString::valueOf(aScale.getX()) + + USTR(")"); + + if( fRotate ) + sTransform += USTR(" rotate(") + rtl::OUString::valueOf(fRotate*180.0/M_PI) + USTR(")"); + + if( fShearX ) + sTransform += USTR(" skewX(") + rtl::OUString::valueOf(fShearX*180.0/M_PI) + USTR(")"); + } + + xAttrs->AddAttribute( USTR( "svg:x" ), rtl::OUString::valueOf(pt2mm(x))+USTR("mm")); + xAttrs->AddAttribute( USTR( "svg:y" ), rtl::OUString::valueOf(pt2mm(y))+USTR("mm")); + xAttrs->AddAttribute( USTR( "draw:style-name" ), USTR("svggraphicstyle")+sStyleId ); + + mxDocumentHandler->startElement(USTR("draw:frame"),xUnoAttrs); + + xAttrs->Clear(); + mxDocumentHandler->startElement(USTR("draw:text-box"),xUnoAttrs); + // TODO: put text style in here + mxDocumentHandler->startElement(USTR("text:p"),xUnoAttrs); + mxDocumentHandler->characters(sText.makeStringAndClear()); + mxDocumentHandler->endElement(USTR("text:p")); + mxDocumentHandler->endElement(USTR("draw:text-box")); + mxDocumentHandler->endElement(USTR("draw:frame")); + break; + } + } + } + + void push() + {} + + void pop() + {} + + void writeBinaryData( rtl::Reference& xAttrs, + const uno::Reference& xUnoAttrs, + const uno::Reference& /* xElem */, + const basegfx::B2DRange& rShapeBounds, + const std::string& data) + { + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "svg:x" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getMinX()))+USTR("mm")); + xAttrs->AddAttribute( USTR( "svg:y" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getMinY()))+USTR("mm")); + xAttrs->AddAttribute( USTR( "svg:width" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getWidth()))+USTR("mm")); + xAttrs->AddAttribute( USTR( "svg:height" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getHeight()))+USTR("mm")); + + mxDocumentHandler->startElement(USTR("draw:frame"),xUnoAttrs); + + xAttrs->Clear(); + mxDocumentHandler->startElement(USTR("draw:image"),xUnoAttrs); + + mxDocumentHandler->startElement(USTR("office:binary-data"),xUnoAttrs); + + mxDocumentHandler->characters(rtl::OUString::createFromAscii(data.c_str())); + + mxDocumentHandler->endElement(USTR("office:binary-data")); + + mxDocumentHandler->endElement(USTR("draw:image")); + + mxDocumentHandler->endElement(USTR("draw:frame")); + } + + + void writeTransformAttribute(const basegfx::B2DHomMatrix rMatrix, rtl::Reference& xAttrs) + { + basegfx::B2DTuple rScale, rTranslate; + double rRotate, rShearX; + ::rtl::OUString sTransformValue; + if (!rMatrix.decompose(rScale, rTranslate, rRotate, rShearX)) + return; + if (rScale.getX() != 1.0 || rScale.getY() != 1.0) + sTransformValue += USTR("scale(")+::rtl::OUString::valueOf(rScale.getX())+USTR(" ") + +::rtl::OUString::valueOf(rScale.getY())+USTR(") "); + if (rTranslate.getX() != 0.0f || rTranslate.getY() != 0.0f) + sTransformValue += USTR("translate(")+::rtl::OUString::valueOf(rTranslate.getX()/100.0f)+USTR("mm ") + +::rtl::OUString::valueOf(rTranslate.getY()/100.0f)+USTR("mm) "); + if (rRotate != 0.0f) + sTransformValue += USTR("rotate(")+::rtl::OUString::valueOf(rRotate)+USTR(") "); + + if (rShearX != 0.0f) + sTransformValue += USTR("skewX(")+::rtl::OUString::valueOf(rShearX)+USTR(") "); + if (!sTransformValue.getLength()) + return; + xAttrs->AddAttribute( USTR("draw:transform"), sTransformValue); + } + + void writeEllipseShape( rtl::Reference& xAttrs, + const uno::Reference& xUnoAttrs, + const uno::Reference& xElem, + const rtl::OUString& rStyleId, + const basegfx::B2DEllipse& rEllipse) + { + State aState = maCurrState; + rtl::OUString aStyleId(rStyleId); + + xAttrs->Clear(); + + basegfx::B2DPolygon aPoly = basegfx::tools::createPolygonFromEllipse(rEllipse.getB2DEllipseCenter(), + rEllipse.getB2DEllipseRadius().getX(), rEllipse.getB2DEllipseRadius().getY()); + writePathShape(xAttrs, xUnoAttrs, xElem, rStyleId, basegfx::B2DPolyPolygon(aPoly)); + + } + + void writePathShape( rtl::Reference& xAttrs, + const uno::Reference& xUnoAttrs, + const uno::Reference& xElem, + const rtl::OUString& rStyleId, + const basegfx::B2DPolyPolygon& rPoly ) + { + // we might need to split up polypolygon into multiple path + // shapes (e.g. when emulating line stroking) + std::vector aPolys(1,rPoly); + State aState = maCurrState; + rtl::OUString aStyleId(rStyleId); + + xAttrs->Clear(); + + OSL_TRACE("writePath - the CTM is: %f %f %f %f %f %f", + maCurrState.maCTM.get(0,0), + maCurrState.maCTM.get(0,1), + maCurrState.maCTM.get(0,2), + maCurrState.maCTM.get(1,0), + maCurrState.maCTM.get(1,1), + maCurrState.maCTM.get(1,2)); + + if( aState.meStrokeType != NONE && aState.maDashArray.size() ) + { + // ODF dashing is severly borked - generate filled polygon instead + aPolys.clear(); + for( sal_uInt32 i=0; igetAttribute( + USTR("internal-style-ref")).getToken(1,'$',nDummyIndex); + StateMap::iterator pAlternateState=mrStateMap.find(aStyleId.toInt32()); + OSL_ASSERT(pAlternateState != mrStateMap.end()); + aState = pAlternateState->second; + OSL_ENSURE( pAlternateState == mrStateMap.end(), + "Doh - where's my alternate style entry?!" ); + } + + // TODO(F2): separate out shear, rotate etc. + // apply transformation to polygon, to keep draw + // import in 100th mm + std::for_each(aPolys.begin(),aPolys.end(), + boost::bind(&basegfx::B2DPolyPolygon::transform, + _1,boost::cref(aState.maCTM))); + + for( sal_uInt32 i=0; iAddAttribute( USTR( "svg:d" ), basegfx::tools::exportToSvgD( + aPolys[i], + false, // no relative coords. causes rounding errors + false )); // no quad bezier detection. crashes older versions. + mxDocumentHandler->startElement(USTR("draw:path"), + xUnoAttrs); + mxDocumentHandler->endElement(USTR("draw:path")); + } + } + + void fillShapeProperties( rtl::Reference& xAttrs, + const uno::Reference& /* xElem */, + const basegfx::B2DRange& rShapeBounds, + const rtl::OUString& rStyleName ) + { + xAttrs->AddAttribute( USTR( "draw:z-index" ), rtl::OUString::valueOf( mnShapeNum++ )); + xAttrs->AddAttribute( USTR( "draw:style-name" ), rStyleName); + xAttrs->AddAttribute( USTR( "svg:width" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getWidth()))+USTR("mm")); + xAttrs->AddAttribute( USTR( "svg:height" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getHeight()))+USTR("mm")); + + // OOo expects the viewbox to be in 100th of mm + xAttrs->AddAttribute( USTR( "svg:viewBox" ), + USTR("0 0 ") + + rtl::OUString::valueOf( + basegfx::fround(pt100thmm(rShapeBounds.getWidth())) ) + + USTR(" ") + + rtl::OUString::valueOf( + basegfx::fround(pt100thmm(rShapeBounds.getHeight())) )); + + // TODO(F1): decompose transformation in calling code, and use + // transform attribute here + // writeTranslate(maCurrState.maCTM, xAttrs); + xAttrs->AddAttribute( USTR( "svg:x" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getMinX()))+USTR("mm")); + xAttrs->AddAttribute( USTR( "svg:y" ), rtl::OUString::valueOf(pt2mm(rShapeBounds.getMinY()))+USTR("mm")); + } + + State maCurrState; + StateMap& mrStateMap; + uno::Reference mxDocumentHandler; + sal_Int32 mnShapeNum; +}; + +/// Write out shapes from DOM tree +static void writeShapes( StatePool& rStatePool, + StateMap& rStateMap, + const uno::Reference xElem, + const uno::Reference& xDocHdl ) +{ + ShapeWritingVisitor aVisitor(rStatePool,rStateMap,xDocHdl); + visitElements(aVisitor, xElem); +} + +#ifdef VERBOSE +struct DumpingVisitor +{ + void operator()( const uno::Reference& xElem ) + { + OSL_TRACE("name: %s", + rtl::OUStringToOString( + xElem->getTagName(), + RTL_TEXTENCODING_UTF8 ).getStr()); + } + + void operator()( const uno::Reference& xElem, + const uno::Reference& xAttributes ) + { + OSL_TRACE("name: %s", + rtl::OUStringToOString( + xElem->getTagName(), + RTL_TEXTENCODING_UTF8 ).getStr()); + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + for( sal_Int32 i=0; iitem(i)->getNodeName(), + RTL_TEXTENCODING_UTF8 ).getStr(), + rtl::OUStringToOString( + xAttributes->item(i)->getNodeValue(), + RTL_TEXTENCODING_UTF8 ).getStr()); + } + } + + void push() {} + void pop() {} +}; + +static void dumpTree( const uno::Reference xElem ) +{ + DumpingVisitor aVisitor; + visitElements(aVisitor, xElem); +} +#endif + +} // namespace + + +SVGReader::SVGReader(const uno::Reference& xServiceFactory, + const uno::Reference& xInputStream, + const uno::Reference& xDocumentHandler) : + m_xServiceFactory( xServiceFactory ), + m_xInputStream( xInputStream ), + m_xDocumentHandler( xDocumentHandler ) +{ +} + +sal_Bool SVGReader::parseAndConvert() +{ + uno::Reference xDomBuilder( + m_xServiceFactory->createInstance( + rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), uno::UNO_QUERY ); + + uno::Reference xDom( + xDomBuilder->parse(m_xInputStream), + uno::UNO_QUERY_THROW ); + + uno::Reference xDocElem( xDom->getDocumentElement(), + uno::UNO_QUERY_THROW ); + + // the root state for svg document + State aInitialState; + + ///////////////////////////////////////////////////////////////// + // doc boilerplate + ///////////////////////////////////////////////////////////////// + + m_xDocumentHandler->startDocument(); + + // get the document dimensions + + // if the "width" and "height" attributes are missing, inkscape fakes + // A4 portrait for. Let's do the same. + if (!xDocElem->hasAttribute(USTR("width"))) + xDocElem->setAttribute(USTR("width"), USTR("210mm")); + if (!xDocElem->hasAttribute(USTR("height"))) + xDocElem->setAttribute(USTR("height"), USTR("297mm")); + + double fViewPortWidth( pt2mm(convLength(xDocElem->getAttribute(USTR("width")),aInitialState,'h')) ); + double fViewPortHeight( pt2mm(convLength(xDocElem->getAttribute(USTR("height")),aInitialState,'v')) ); + + // document prolog + rtl::Reference xAttrs( new SvXMLAttributeList() ); + uno::Reference xUnoAttrs( xAttrs.get() ); + + xAttrs->AddAttribute( USTR( "xmlns:office" ), USTR( OASIS_STR "office:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:style" ), USTR( OASIS_STR "style:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:text" ), USTR( OASIS_STR "text:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:svg" ), USTR( OASIS_STR "svg-compatible:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:table" ), USTR( OASIS_STR "table:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:draw" ), USTR( OASIS_STR "drawing:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:fo" ), USTR( OASIS_STR "xsl-fo-compatible:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:xlink" ), USTR( "http://www.w3.org/1999/xlink" )); + xAttrs->AddAttribute( USTR( "xmlns:dc" ), USTR( "http://purl.org/dc/elements/1.1/" )); + xAttrs->AddAttribute( USTR( "xmlns:number" ), USTR( OASIS_STR "datastyle:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:presentation" ), USTR( OASIS_STR "presentation:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:math" ), USTR( "http://www.w3.org/1998/Math/MathML" )); + xAttrs->AddAttribute( USTR( "xmlns:form" ), USTR( OASIS_STR "form:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:script" ), USTR( OASIS_STR "script:1.0" )); + xAttrs->AddAttribute( USTR( "xmlns:dom" ), USTR( "http://www.w3.org/2001/xml-events" )); + xAttrs->AddAttribute( USTR( "xmlns:xforms" ), USTR( "http://www.w3.org/2002/xforms" )); + xAttrs->AddAttribute( USTR( "xmlns:xsd" ), USTR( "http://www.w3.org/2001/XMLSchema" )); + xAttrs->AddAttribute( USTR( "xmlns:xsi" ), USTR( "http://www.w3.org/2001/XMLSchema-instance" )); + xAttrs->AddAttribute( USTR( "office:version" ), USTR( "1.0" )); + xAttrs->AddAttribute( USTR( "office:mimetype" ), USTR( "application/vnd.oasis.opendocument.graphics" )); + + m_xDocumentHandler->startElement( USTR("office:document"), xUnoAttrs ); + + xAttrs->Clear(); + + m_xDocumentHandler->startElement( USTR("office:settings"), xUnoAttrs); + + xAttrs->AddAttribute( USTR( "config:name" ), USTR( "ooo:view-settings" )); + m_xDocumentHandler->startElement( USTR("config:config-item-set"), xUnoAttrs); + + xAttrs->Clear(); + + xAttrs->AddAttribute( USTR( "config:name" ), USTR( "VisibleAreaTop" )); + xAttrs->AddAttribute( USTR( "config:type" ), USTR( "int" )); + m_xDocumentHandler->startElement( USTR( "config:config-item" ), xUnoAttrs); + + m_xDocumentHandler->characters( USTR( "0" )); + + m_xDocumentHandler->endElement( USTR( "config:config-item" )); + + xAttrs->Clear(); + + xAttrs->AddAttribute( USTR( "config:name" ), USTR( "VisibleAreaLeft" )); + xAttrs->AddAttribute( USTR( "config:type" ), USTR( "int" )); + m_xDocumentHandler->startElement( USTR( "config:config-item" ), xUnoAttrs); + + m_xDocumentHandler->characters( USTR( "0" )); + + m_xDocumentHandler->endElement( USTR( "config:config-item" )); + + xAttrs->Clear(); + + xAttrs->AddAttribute( USTR( "config:name" ), USTR( "VisibleAreaWidth" )); + xAttrs->AddAttribute( USTR( "config:type" ), USTR( "int" )); + m_xDocumentHandler->startElement( USTR( "config:config-item" ), xUnoAttrs); + + sal_Int64 iWidth = sal_Int64(fViewPortWidth); + m_xDocumentHandler->characters( ::rtl::OUString::valueOf(iWidth) ); + + m_xDocumentHandler->endElement( USTR( "config:config-item" )); + + xAttrs->Clear(); + + xAttrs->AddAttribute( USTR( "config:name" ), USTR( "VisibleAreaHeight" )); + xAttrs->AddAttribute( USTR( "config:type" ), USTR( "int" )); + m_xDocumentHandler->startElement( USTR( "config:config-item" ), xUnoAttrs); + + sal_Int64 iHeight = sal_Int64(fViewPortHeight); + m_xDocumentHandler->characters( ::rtl::OUString::valueOf(iHeight) ); + + m_xDocumentHandler->endElement( USTR( "config:config-item" )); + + m_xDocumentHandler->endElement( USTR( "config:config-item-set" )); + + m_xDocumentHandler->endElement( USTR( "office:settings" )); + + xAttrs->Clear(); + + m_xDocumentHandler->startElement( USTR("office:automatic-styles"), + xUnoAttrs ); + + xAttrs->AddAttribute( USTR( "style:name" ), USTR("pagelayout1")); + m_xDocumentHandler->startElement( USTR("style:page-layout"), + xUnoAttrs ); + // TODO(Q3): this is super-ugly. In-place container come to mind. + xAttrs->Clear(); + + // make page viewport-width times viewport-height mm large - add + // 5% border at every side + xAttrs->AddAttribute( USTR( "fo:margin-top" ), USTR("0mm")); + xAttrs->AddAttribute( USTR( "fo:margin-bottom" ), USTR("0mm")); + xAttrs->AddAttribute( USTR( "fo:margin-left" ), USTR("0mm")); + xAttrs->AddAttribute( USTR( "fo:margin-right" ), USTR("0mm")); + xAttrs->AddAttribute( USTR( "fo:page-width" ), rtl::OUString::valueOf(fViewPortWidth)+USTR("mm")); + xAttrs->AddAttribute( USTR( "fo:page-height" ), rtl::OUString::valueOf(fViewPortHeight)+USTR("mm")); + xAttrs->AddAttribute( USTR( "style:print-orientation" ), + fViewPortWidth > fViewPortHeight ? + USTR("landscape") : + USTR("portrait")); + m_xDocumentHandler->startElement( USTR("style:page-layout-properties"), + xUnoAttrs ); + m_xDocumentHandler->endElement( USTR("style:page-layout-properties") ); + m_xDocumentHandler->endElement( USTR("style:page-layout") ); + + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "style:name" ), USTR("pagestyle1")); + xAttrs->AddAttribute( USTR( "style:family" ), USTR("drawing-page")); + m_xDocumentHandler->startElement( USTR("style:style"), + xUnoAttrs ); + + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "draw:background-size" ), USTR("border")); + xAttrs->AddAttribute( USTR( "draw:fill" ), USTR("none")); + m_xDocumentHandler->startElement( USTR("style:drawing-page-properties"), + xUnoAttrs ); + m_xDocumentHandler->endElement( USTR("style:drawing-page-properties") ); + m_xDocumentHandler->endElement( USTR("style:style") ); + + StatePool aStatePool; + StateMap aStateMap; + annotateStyles(aStatePool,aStateMap,aInitialState, + xDocElem,m_xDocumentHandler); + +#ifdef VERBOSE + dumpTree(xDocElem); +#endif + + m_xDocumentHandler->endElement( USTR("office:automatic-styles") ); + + //////////////////////////////////////////////////////////////////// + + xAttrs->Clear(); + m_xDocumentHandler->startElement( USTR("office:styles"), + xUnoAttrs); + m_xDocumentHandler->endElement( USTR("office:styles") ); + + //////////////////////////////////////////////////////////////////// + + m_xDocumentHandler->startElement( USTR("office:master-styles"), + xUnoAttrs ); + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "style:name" ), USTR("Default")); + xAttrs->AddAttribute( USTR( "style:page-layout-name" ), USTR("pagelayout1")); + xAttrs->AddAttribute( USTR( "draw:style-name" ), USTR("pagestyle1")); + m_xDocumentHandler->startElement( USTR("style:master-page"), + xUnoAttrs ); + m_xDocumentHandler->endElement( USTR("style:master-page") ); + + m_xDocumentHandler->endElement( USTR("office:master-styles") ); + + //////////////////////////////////////////////////////////////////// + + xAttrs->Clear(); + m_xDocumentHandler->startElement( USTR("office:body"), + xUnoAttrs ); + m_xDocumentHandler->startElement( USTR("office:drawing"), + xUnoAttrs ); + + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "draw:master-page-name" ), USTR("Default")); + xAttrs->AddAttribute( USTR( "draw:style-name" ), USTR("pagestyle1")); + m_xDocumentHandler->startElement(USTR("draw:page"), + xUnoAttrs); + + // write out all shapes + writeShapes(aStatePool, + aStateMap, + xDocElem, + m_xDocumentHandler); + + m_xDocumentHandler->endElement( USTR("draw:page") ); + m_xDocumentHandler->endElement( USTR("office:drawing") ); + m_xDocumentHandler->endElement( USTR("office:body") ); + m_xDocumentHandler->endElement( USTR("office:document") ); + m_xDocumentHandler->endDocument(); + + return sal_True; +} + +} // namespace svgi diff --git a/filter/source/svg/svgreader.hxx b/filter/source/svg/svgreader.hxx new file mode 100644 index 000000000000..d4b57d31868d --- /dev/null +++ b/filter/source/svg/svgreader.hxx @@ -0,0 +1,43 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef INCLUDED_SVGREADER_HXX +#define INCLUDED_SVGREADER_HXX + +#include +#include +#include +#include + +namespace svgi +{ + +class SVGReader +{ + const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; + const ::com::sun::star::uno::Reference< com::sun::star::io::XInputStream > m_xInputStream; + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xDocumentHandler; + +public: + SVGReader( const com::sun::star::uno::Reference& xServiceFactory, + const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler ); + + sal_Bool parseAndConvert(); +}; + +} // namespace svgi + +#endif diff --git a/filter/source/svg/test/makefile.mk b/filter/source/svg/test/makefile.mk new file mode 100644 index 000000000000..d51fdda07e68 --- /dev/null +++ b/filter/source/svg/test/makefile.mk @@ -0,0 +1,114 @@ +#************************************************************************* +# +# OpenOffice.org - a multi-platform office productivity suite +# +# Author: +# Fridrich Strba +# Thorsten Behrens +# +# Copyright (C) 2008, Novell Inc. +# Parts copyright 2005 by Sun Microsystems, Inc. +# +# The Contents of this file are made available subject to +# the terms of GNU Lesser General Public License Version 3. +# +#************************************************************************* + +PRJ=..$/..$/.. +PRJNAME=filter +TARGET=tests +TARGETTYPE=CUI +ENABLE_EXCEPTIONS=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- unit tests --------------------------------------------------- + +SHL1OBJS= \ + $(SLO)$/parsertest.obj + +SHL1TARGET= tests +SHL1LIBS= $(SLB)$/svgfilter.lib +SHL1STDLIBS= \ + $(BASEGFXLIB) \ + $(SVXLIB) \ + $(SVTOOLLIB) \ + $(XMLOFFLIB) \ + $(BASEGFXLIB) \ + $(VCLLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) \ + $(LIBXML) \ + $(CPPUNITLIB) + +# --- svg2xml binary ------------------------------------------------------ + +TARGET2=svg2odf + +APP1TARGET=$(TARGET2) +APP1LIBSALCPPRT= +APP1OBJS= \ + $(SLO)$/odfserializer.obj \ + $(SLO)$/svg2odf.obj + +APP1LIBS=\ + $(SLB)$/svgfilter.lib + +APP1STDLIBS=\ + $(BASEGFXLIB) \ + $(SVXLIB) \ + $(XMLOFFLIB) \ + $(BASEGFXLIB) \ + $(VCLLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) \ + $(LIBXML) + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk +.INCLUDE : _cppunit.mk + +# --- Special ------------------------------------------------------ + +TESTFILES=\ + anarchist.svg \ + anarchist2.svg \ + Nested.svg + +$(MISC)$/%_svgi_unittest_succeeded : $(BIN)$/svg2odf + rm -f $(MISC)$/$(@:s/_succeeded/.xml/:f) + $(BIN)$/svg2odf $(@:s/_svgi_unittest_succeeded/.svg/:f) $(MISC)$/$(@:s/_succeeded/.xml/:f) $(BIN)$/svgi_unittest_test.ini + $(TOUCH) $@ + +.IF "$(GUI)" == "WNT" +SAXPARSERLIB=$(SOLARBINDIR)$/sax.uno$(DLLPOST) +UNOXMLLIB=$(SOLARBINDIR)$/$(DLLPRE)unoxml$(OFFICEUPD)$(DLLPOSTFIX)$(DLLPOST) +.ELSE +SAXPARSERLIB=$(SOLARLIBDIR)$/sax.uno$(DLLPOST) +UNOXMLLIB=$(SOLARLIBDIR)$/$(DLLPRE)unoxml$(OFFICEUPD)$(DLLPOSTFIX)$(DLLPOST) +.ENDIF + +$(BIN)$/unittestservices.rdb : makefile.mk $(SAXPARSERLIB) $(UNOXMLLIB) + rm -f $@ + $(REGCOMP) -register -r $@ -c $(SAXPARSERLIB) + $(REGCOMP) -register -r $@ -c $(UNOXMLLIB) + +$(BIN)$/svgi_unittest_test.ini : makefile.mk + rm -f $@ + @echo UNO_SERVICES=$(BIN)$/unittestservices.rdb > $@ + @echo UNO_TYPES=$(UNOUCRRDB:s/\/\\/) >> $@ + +ALLTAR : $(BIN)$/svgi_unittest_test.ini \ + $(BIN)$/unittestservices.rdb \ + $(foreach,i,$(TESTFILES:s/.svg/_svgi_unittest_succeeded/:f) $(MISC)$/$i) diff --git a/filter/source/svg/test/odfserializer.cxx b/filter/source/svg/test/odfserializer.cxx new file mode 100644 index 000000000000..2a8958d02c31 --- /dev/null +++ b/filter/source/svg/test/odfserializer.cxx @@ -0,0 +1,140 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * Parts copyright 2005 by Sun Microsystems, Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_filter.hxx" + +#include "odfserializer.hxx" +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; + +namespace svgi +{ + +typedef ::cppu::WeakComponentImplHelper1< + com::sun::star::xml::sax::XDocumentHandler> ODFSerializerBase; + +class ODFSerializer : private cppu::BaseMutex, + public ODFSerializerBase, + boost::noncopyable +{ +public: + explicit ODFSerializer(const uno::Reference& xOut) : + ODFSerializerBase(m_aMutex), + m_xOutStream(xOut), + m_aLineFeed(1), + m_aBuf() + { + m_aLineFeed[0] = '\n'; + } + + virtual void SAL_CALL startDocument( ) throw (xml::sax::SAXException, uno::RuntimeException); + virtual void SAL_CALL endDocument( ) throw (xml::sax::SAXException, uno::RuntimeException); + virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs ) throw (xml::sax::SAXException, uno::RuntimeException); + virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw (xml::sax::SAXException, uno::RuntimeException); + virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw (xml::sax::SAXException, uno::RuntimeException); + virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (xml::sax::SAXException, uno::RuntimeException); + virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw (xml::sax::SAXException, uno::RuntimeException); + virtual void SAL_CALL setDocumentLocator( const uno::Reference< xml::sax::XLocator >& xLocator ) throw (xml::sax::SAXException, uno::RuntimeException); + +private: + uno::Reference m_xOutStream; + uno::Sequence m_aLineFeed; + uno::Sequence m_aBuf; +}; + +void SAL_CALL ODFSerializer::startDocument( ) throw (xml::sax::SAXException, uno::RuntimeException) +{ + OSL_PRECOND(m_xOutStream.is(), "ODFSerializer(): invalid output stream"); + + rtl::OUStringBuffer aElement; + aElement.appendAscii(""); + characters(aElement.makeStringAndClear()); +} + +void SAL_CALL ODFSerializer::endDocument() throw (xml::sax::SAXException, uno::RuntimeException) +{} + +void SAL_CALL ODFSerializer::startElement( const ::rtl::OUString& aName, + const uno::Reference< xml::sax::XAttributeList >& xAttribs ) throw (xml::sax::SAXException, uno::RuntimeException) +{ + rtl::OUStringBuffer aElement; + aElement.appendAscii("<"); + aElement.append(aName); + aElement.appendAscii(" "); + + const sal_Int16 nLen=xAttribs->getLength(); + for( sal_Int16 i=0; igetNameByIndex(i)); + aElement.appendAscii("=\""); + aElement.append(xAttribs->getValueByIndex(i)); + aElement.appendAscii("\" "); + } + + aElement.appendAscii(">"); + characters(aElement.makeStringAndClear()); +} + +void SAL_CALL ODFSerializer::endElement( const ::rtl::OUString& aName ) throw (xml::sax::SAXException, uno::RuntimeException) +{ + rtl::OUStringBuffer aElement; + aElement.appendAscii(""); + characters(aElement.makeStringAndClear()); +} + +void SAL_CALL ODFSerializer::characters( const ::rtl::OUString& aChars ) throw (xml::sax::SAXException, uno::RuntimeException) +{ + const rtl::OString aStr = rtl::OUStringToOString(aChars, + RTL_TEXTENCODING_UTF8); + const sal_Int32 nLen( aStr.getLength() ); + m_aBuf.realloc( nLen ); + const sal_Char* pStr = aStr.getStr(); + std::copy(pStr,pStr+nLen,m_aBuf.getArray()); + + m_xOutStream->writeBytes(m_aBuf); + // TODO(F1): Make pretty printing configurable + m_xOutStream->writeBytes(m_aLineFeed); +} + +void SAL_CALL ODFSerializer::ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (xml::sax::SAXException, uno::RuntimeException) +{ + // TODO(F1): Make pretty printing configurable + characters(aWhitespaces); +} + +void SAL_CALL ODFSerializer::processingInstruction( const ::rtl::OUString&, + const ::rtl::OUString& ) throw (xml::sax::SAXException, uno::RuntimeException) +{} + +void SAL_CALL ODFSerializer::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& ) throw (xml::sax::SAXException, uno::RuntimeException) +{} + +uno::Reference< xml::sax::XDocumentHandler> createSerializer(const uno::Reference& xOut ) +{ + return uno::Reference(new ODFSerializer(xOut)); +} + +} diff --git a/filter/source/svg/test/odfserializer.hxx b/filter/source/svg/test/odfserializer.hxx new file mode 100644 index 000000000000..d9ef2a34cc14 --- /dev/null +++ b/filter/source/svg/test/odfserializer.hxx @@ -0,0 +1,31 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * Parts copyright 2005 by Sun Microsystems, Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef INCLUDED_SVG_ODFSERIALIZER_HXX +#define INCLUDED_SVG_ODFSERIALIZER_HXX + +#include +#include +#include + +namespace svgi +{ + /// Creates a XDocumentHandler that serializes directly to an XOutputStream + ::com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler> + createSerializer(const ::com::sun::star::uno::Reference& ); +} + +#endif // _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HDL_ diff --git a/filter/source/svg/test/parsertest.cxx b/filter/source/svg/test/parsertest.cxx new file mode 100644 index 000000000000..04695a54f02c --- /dev/null +++ b/filter/source/svg/test/parsertest.cxx @@ -0,0 +1,209 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 31. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_filter.hxx" + +#include + +#include "../gfxtypes.hxx" +#include "../parserfragments.hxx" + +using namespace svgi; + +class TestParser : public CppUnit::TestFixture +{ +public: + void setUp() + {} + + void tearDown() + {} + + void testParseColor() + { + ARGBColor aTmp; + + const char* sIn="#102030 "; + ARGBColor aOut(16, 32, 48); + CPPUNIT_ASSERT_MESSAGE( "Consuming color #112233", + parseColor( sIn, aTmp ) ); + OSL_TRACE("color is: a:%f r:%f g:%f b:%f", aTmp.a, aTmp.r, aTmp.g, aTmp.b); + CPPUNIT_ASSERT_MESSAGE( "Parsing color #112233", + aOut==aTmp ); + + sIn=" #321"; + aOut=ARGBColor(51, 34, 17); + CPPUNIT_ASSERT_MESSAGE( "Consuming color #321", + parseColor( sIn, aTmp ) ); + OSL_TRACE("color is: a:%f r:%f g:%f b:%f", aTmp.a, aTmp.r, aTmp.g, aTmp.b); + CPPUNIT_ASSERT_MESSAGE( "Parsing color #321", + aOut==aTmp ); + + sIn="rgb(100,200,\t 50)"; + aOut=ARGBColor(100, 200, 50); + CPPUNIT_ASSERT_MESSAGE( "Consuming color rgb(100,200,50)", + parseColor( sIn, aTmp ) ); + OSL_TRACE("color is: a:%f r:%f g:%f b:%f", aTmp.a, aTmp.r, aTmp.g, aTmp.b); + CPPUNIT_ASSERT_MESSAGE( "Parsing color rgb(100,200,50)", + aOut==aTmp ); + + sIn="rgb(0.1, \t0.2,0.9)"; + aOut=ARGBColor(0.1, 0.2, 0.9); + CPPUNIT_ASSERT_MESSAGE( "Consuming color rgb(0.1,0.2,0.9)", + parseColor( sIn, aTmp ) ); + OSL_TRACE("color is: a:%f r:%f g:%f b:%f", aTmp.a, aTmp.r, aTmp.g, aTmp.b); + CPPUNIT_ASSERT_MESSAGE( "Parsing color rgb(0.1,0.2,0.9)", + aOut==aTmp ); + + sIn=" burlywood "; + aOut=ARGBColor(222,184,135); + CPPUNIT_ASSERT_MESSAGE( "Consuming color burlywood", + parseColor( sIn, aTmp ) ); + OSL_TRACE("color is: a:%f r:%f g:%f b:%f", aTmp.a, aTmp.r, aTmp.g, aTmp.b); + CPPUNIT_ASSERT_MESSAGE( "Parsing color burlywood", + aOut==aTmp ); + } + + void testParseOpacity() + { + ARGBColor aTmp; + + const char* sIn=" 0.123 "; + ARGBColor aOut(0.123, 0.0, 0.0, 0.0); + CPPUNIT_ASSERT_MESSAGE( "Consuming opacity 0.123", + parseOpacity( sIn, aTmp ) ); + OSL_TRACE("color is: a:%f r:%f g:%f b:%f", aTmp.a, aTmp.r, aTmp.g, aTmp.b); + CPPUNIT_ASSERT_MESSAGE( "Parsing opacity 0.123", + aOut==aTmp ); + } + + void testParseTransform() + { + basegfx::B2DHomMatrix aOut; + + const char* sIn=" none "; + basegfx::B2DHomMatrix aTmp; + CPPUNIT_ASSERT_MESSAGE( "Consuming transformation none", + parseTransform( sIn, aTmp ) ); + OSL_TRACE("transformation is: m00:%f m01:%f m02:%f m10:%f m11:%f m12:%f", + aTmp.get(0,0), aTmp.get(0,1), aTmp.get(0,2), aTmp.get(1,0), aTmp.get(1,1), aTmp.get(1,2) ); + CPPUNIT_ASSERT_MESSAGE( "Parsing transformation none", + aOut==aTmp ); + + sIn=" scale( 10 ) "; + aOut.identity(); + aOut.scale(10.0,10.0); + CPPUNIT_ASSERT_MESSAGE( "Consuming transformation scale(10)", + parseTransform( sIn, aTmp ) ); + OSL_TRACE("transformation is: m00:%f m01:%f m02:%f m10:%f m11:%f m12:%f", + aTmp.get(0,0), aTmp.get(0,1), aTmp.get(0,2), aTmp.get(1,0), aTmp.get(1,1), aTmp.get(1,2) ); + CPPUNIT_ASSERT_MESSAGE( "Parsing transformation scale(10)", + aOut==aTmp ); + + sIn=" scale( 10 20.12 ) "; + aOut.identity(); + aOut.scale(10.0,20.12); + CPPUNIT_ASSERT_MESSAGE( "Consuming transformation scale(10 20.12)", + parseTransform( sIn, aTmp ) ); + OSL_TRACE("transformation is: m00:%f m01:%f m02:%f m10:%f m11:%f m12:%f", + aTmp.get(0,0), aTmp.get(0,1), aTmp.get(0,2), aTmp.get(1,0), aTmp.get(1,1), aTmp.get(1,2) ); + CPPUNIT_ASSERT_MESSAGE( "Parsing transformation scale(10 20.12)", + aOut==aTmp ); + + sIn="matrix( 1,2 3,4,5 6 )"; + aOut.identity(); + aOut.set(0,0,1.0); aOut.set(1,0,2.0); aOut.set(0,1,3.0); aOut.set(1,1,4.0); aOut.set(0,2,5.0); aOut.set(1,2,6.0); + CPPUNIT_ASSERT_MESSAGE( "Consuming transformation matrix(1,2,3,4,5,6)", + parseTransform( sIn, aTmp ) ); + OSL_TRACE("transformation is: m00:%f m01:%f m02:%f m10:%f m11:%f m12:%f", + aTmp.get(0,0), aTmp.get(0,1), aTmp.get(0,2), aTmp.get(1,0), aTmp.get(1,1), aTmp.get(1,2) ); + CPPUNIT_ASSERT_MESSAGE( "Parsing transformation matrix(1,2,3,4,5,6)", + aOut==aTmp ); + + sIn="matrix( 1 0 0 1 -10 -10 ) translate(10) scale(10), rotate(90)"; + aOut.identity(); + aOut.set(0,0,0.0); aOut.set(1,0,10.0); aOut.set(0,1,-10.0); aOut.set(1,1,0.0); aOut.set(0,2,0.0); aOut.set(1,2,0.0); + CPPUNIT_ASSERT_MESSAGE( "Consuming transformation matrix(1,2,3,4,5,6)", + parseTransform( sIn, aTmp ) ); + OSL_TRACE("transformation is: m00:%f m01:%f m02:%f m10:%f m11:%f m12:%f", + aTmp.get(0,0), aTmp.get(0,1), aTmp.get(0,2), aTmp.get(1,0), aTmp.get(1,1), aTmp.get(1,2) ); + CPPUNIT_ASSERT_MESSAGE( "Parsing transformation matrix(1,2,3,4,5,6)", + aOut==aTmp ); + + sIn="skewX(45)"; + aOut.identity(); + aOut.set(0,0,1.0); aOut.set(1,0,1.0); aOut.set(0,1,0.0); aOut.set(1,1,1.0); aOut.set(0,2,0.0); aOut.set(1,2,0.0); + CPPUNIT_ASSERT_MESSAGE( "Consuming transformation skewX(45)", + parseTransform( sIn, aTmp ) ); + OSL_TRACE("transformation is: m00:%f m01:%f m02:%f m10:%f m11:%f m12:%f", + aTmp.get(0,0), aTmp.get(0,1), aTmp.get(0,2), aTmp.get(1,0), aTmp.get(1,1), aTmp.get(1,2) ); + CPPUNIT_ASSERT_MESSAGE( "Parsing transformation skewX(45)", + aOut==aTmp ); + + sIn="skewY(45)"; + aOut.identity(); + aOut.set(0,0,1.0); aOut.set(1,0,0.0); aOut.set(0,1,1.0); aOut.set(1,1,1.0); aOut.set(0,2,0.0); aOut.set(1,2,0.0); + CPPUNIT_ASSERT_MESSAGE( "Consuming transformation skewY(45)", + parseTransform( sIn, aTmp ) ); + OSL_TRACE("transformation is: m00:%f m01:%f m02:%f m10:%f m11:%f m12:%f", + aTmp.get(0,0), aTmp.get(0,1), aTmp.get(0,2), aTmp.get(1,0), aTmp.get(1,1), aTmp.get(1,2) ); + CPPUNIT_ASSERT_MESSAGE( "Parsing transformation skewY(45)", + aOut==aTmp ); + } + + void testParseViewBox() + { + basegfx::B2DRange aTmp; + + const char* sIn=" 10 20, 30.5,5 "; + basegfx::B2DRange aOut(10,20,40.5,25); + CPPUNIT_ASSERT_MESSAGE( "Consuming 10,20,30.5,5", + parseViewBox( sIn, aTmp ) ); + OSL_TRACE("viewbox is: x1:%f y1:%f x2:%f y2:%f", aTmp.getMinX(), aTmp.getMinY(), aTmp.getMaxX(), aTmp.getMaxY()); + CPPUNIT_ASSERT_MESSAGE( "Parsing 10,20,30.5,5", + aOut==aTmp ); + } + + void testParseDashArray() + { + std::vector aTmp; + + const char* sIn=" 10,20, -10.00 "; + std::vector aOut; aOut.push_back(10.0); aOut.push_back(20.0); aOut.push_back(-10.0); + CPPUNIT_ASSERT_MESSAGE( "Consuming 10,20,-10.00", + parseDashArray( sIn, aTmp ) ); + OSL_TRACE("dash array is: len %d, %f %f %f", aTmp.size(), aTmp[0], aTmp[1], aTmp[2] ); + CPPUNIT_ASSERT_MESSAGE( "Parsing 10,20,-10.00", + aOut==aTmp ); + } + + CPPUNIT_TEST_SUITE(TestParser); + CPPUNIT_TEST(testParseColor); + CPPUNIT_TEST(testParseOpacity); + CPPUNIT_TEST(testParseTransform); + CPPUNIT_TEST(testParseViewBox); + CPPUNIT_TEST(testParseDashArray); + // TODO: CPPUNIT_TEST(testParseXlinkHref); + CPPUNIT_TEST_SUITE_END(); +}; + +// ----------------------------------------------------------------------------- + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(TestParser, "test svg parser fragments"); + +// this macro creates an empty function, which will called by the RegisterAllFunctions() +// to let the user the possibility to also register some functions by hand. +NOADDITIONAL; diff --git a/filter/source/svg/test/svg2odf.cxx b/filter/source/svg/test/svg2odf.cxx new file mode 100644 index 000000000000..e2235fc4d5ae --- /dev/null +++ b/filter/source/svg/test/svg2odf.cxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * Parts copyright 2005 by Sun Microsystems, Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_filter.hxx" + +#include "../svgreader.hxx" +#include "odfserializer.hxx" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; + +namespace +{ + class OutputWrap : public cppu::WeakImplHelper1< + io::XOutputStream> + { + osl::File maFile; + + public: + + explicit OutputWrap( const rtl::OUString& rURL ) : maFile(rURL) + { + maFile.open(osl_File_OpenFlag_Create|OpenFlag_Write); + } + + virtual void SAL_CALL writeBytes( const com::sun::star::uno::Sequence< ::sal_Int8 >& aData ) throw (com::sun::star::io::NotConnectedException,com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) + + { + sal_uInt64 nBytesWritten(0); + maFile.write(aData.getConstArray(),aData.getLength(),nBytesWritten); + } + + virtual void SAL_CALL flush() throw (com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) + { + } + + virtual void SAL_CALL closeOutput() throw (com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException, com::sun::star::uno::RuntimeException) + { + maFile.close(); + } + }; +} + +SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) +{ + if( argc != 4 ) + { + OSL_TRACE( "Invocation: svg2odf . Exiting" ); + return 1; + } + + ::rtl::OUString aBaseURL, aTmpURL, aSrcURL, aDstURL, aIniUrl; + + osl_getProcessWorkingDir(&aBaseURL.pData); + osl_getFileURLFromSystemPath( rtl::OUString::createFromAscii(argv[1]).pData, + &aTmpURL.pData ); + osl_getAbsoluteFileURL(aBaseURL.pData,aTmpURL.pData,&aSrcURL.pData); + + osl_getFileURLFromSystemPath( rtl::OUString::createFromAscii(argv[2]).pData, + &aTmpURL.pData ); + osl_getAbsoluteFileURL(aBaseURL.pData,aTmpURL.pData,&aDstURL.pData); + + osl_getFileURLFromSystemPath( rtl::OUString::createFromAscii(argv[3]).pData, + &aTmpURL.pData ); + osl_getAbsoluteFileURL(aBaseURL.pData,aTmpURL.pData,&aIniUrl.pData); + + // bootstrap UNO + uno::Reference< lang::XMultiServiceFactory > xFactory; + uno::Reference< uno::XComponentContext > xCtx; + try + { + xCtx = ::cppu::defaultBootstrap_InitialComponentContext(aIniUrl); + xFactory = uno::Reference< lang::XMultiServiceFactory >(xCtx->getServiceManager(), + uno::UNO_QUERY); + if( xFactory.is() ) + ::comphelper::setProcessServiceFactory( xFactory ); + } + catch( uno::Exception& ) + { + } + + if( !xFactory.is() ) + { + OSL_TRACE( "Could not bootstrap UNO, installation must be in disorder. Exiting." ); + return 1; + } + + osl::File aInputFile(aSrcURL); + if( osl::FileBase::E_None!=aInputFile.open(OpenFlag_Read) ) + { + OSL_TRACE( "Cannot open input file" ); + return 1; + } + + svgi::SVGReader aReader(xFactory, + uno::Reference( + new comphelper::OSLInputStreamWrapper(aInputFile)), + svgi::createSerializer(new OutputWrap(aDstURL))); + return aReader.parseAndConvert() ? 0 : 1; +} diff --git a/filter/source/svg/tokenmap.cxx b/filter/source/svg/tokenmap.cxx new file mode 100644 index 000000000000..18a1de42031e --- /dev/null +++ b/filter/source/svg/tokenmap.cxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * Parts copyright 2005 by Sun Microsystems, Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_filter.hxx" + +#include "tokenmap.hxx" +#include + +namespace svgi +{ + +#include "tokens.cxx" + +sal_Int32 getTokenId( const char* sIdent, sal_Int32 nLen ) +{ + const struct xmltoken* t = Perfect_Hash::in_word_set( sIdent, nLen ); + if( t ) + return t->nToken; + else + return XML_TOKEN_INVALID; +} + +sal_Int32 getTokenId( const rtl::OUString& sIdent ) +{ + rtl::OString aUTF8( sIdent.getStr(), + sIdent.getLength(), + RTL_TEXTENCODING_UTF8 ); + return getTokenId( aUTF8.getStr(), aUTF8.getLength() ); +} + +const char* getTokenName( sal_Int32 nTokenId ) +{ + if( nTokenId >= XML_TOKEN_COUNT ) + return NULL; + + const xmltoken* pCurr=wordlist; + const xmltoken* pEnd=wordlist+sizeof(wordlist)/sizeof(*wordlist); + while( pCurr != pEnd ) + { + if(pCurr->nToken == nTokenId) + return pCurr->name; + ++pCurr; + } + + return NULL; +} + +} // namespace svgi diff --git a/filter/source/svg/tokenmap.hxx b/filter/source/svg/tokenmap.hxx new file mode 100644 index 000000000000..475b2b9160eb --- /dev/null +++ b/filter/source/svg/tokenmap.hxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef INCLUDED_TOKENMAP_HXX +#define INCLUDED_TOKENMAP_HXX + +#include "tokens.hxx" + +#include +#include + +namespace svgi +{ + sal_Int32 getTokenId( const char* sIdent, sal_Int32 nLen ); + sal_Int32 getTokenId( const rtl::OUString& sIdent ); + const char* getTokenName( sal_Int32 nTokenId ); + +} // namespace svgi + +#endif diff --git a/filter/source/svg/tokens.txt b/filter/source/svg/tokens.txt new file mode 100644 index 000000000000..1211e691f627 --- /dev/null +++ b/filter/source/svg/tokens.txt @@ -0,0 +1,403 @@ +####################################### +# +# elements (SVG Tiny 1.2) +# +####################################### +a +animate +animateColor +animateMotion +animateTransform +animation +audio +circle +defs +desc +discard +ellipse +font +font-face +font-face-src +font-face-uri +foreignObject +g +glyph +handler +hkern +image +line +linearGradient +listener +metadata +missing-glyph +mpath +path +polygon +polyline +prefetch +radialGradient +rect +script +set +solidColor +stop +svg +switch +tbreak +text +textArea +title +tspan +use +video +####################################### +# +# properties (SVG Tiny 1.2) +# +####################################### +audio-level +color +color-rendering +display +display-align +fill +fill-opacity +fill-rule +font-family +font-size +font-style +font-variant +font-weight +image-rendering +line-increment +opacity +pointer-events +shape-rendering +solid-color +solid-opacity +stop-color +stop-opacity +stroke +stroke-dasharray +stroke-dashoffset +stroke-linecap +stroke-linejoin +stroke-miterlimit +stroke-opacity +stroke-width +text-align +text-anchor +text-rendering +vector-effect +viewport-fill +viewport-fill-opacity +visibility +####################################### +# +# attributes (SVG Tiny 1.2) +# +####################################### +accent-height +accumulate +additive +alphabetic +arabic-form +ascent +attributeName +attributeType +bandwidth +baseProfile +bbox +begin +by +calcMode +cap-height +class +contentScriptType +cx +cy +d +defaultAction +descent +dur +editable +end +event +externalResourcesRequired +fill +focusHighlight +focusable +font-family +font-stretch +font-style +font-variant +font-weight +from +fx +fy +g1 +g2 +glyph-name +gradientTransform +gradientUnits +handler +hanging +height +height +horiz-adv-x +horiz-origin-x +id +ideographic +initialVisibility +k +keyPoints +keySplines +keyTimes +lang +mathematical +max +mediaCharacterEncoding +mediaContentEncodings +mediaSize +mediaTime +min +nav-down +nav-down-left +nav-down-right +nav-left +nav-next +nav-prev +nav-right +nav-up +nav-up-left +nav-up-right +observer +offset +origin +overlay +overline-position +overline-thickness +panose-1 +path +pathLength +phase +playbackOrder +points +preserveAspectRatio +propagate +r +repeatCount +repeatDur +requiredExtensions +requiredFeatures +requiredFonts +requiredFormats +restart +rotate +rx +ry +slope +snapshotTime +stemh +stemv +strikethrough-position +strikethrough-thickness +style +syncBehavior +syncBehaviorDefault +syncMaster +syncTolerance +syncToleranceDefault +systemLanguage +target +timelineBegin +to +transform +transformBehavior +type +u1 +u2 +underline-position +underline-thickness +unicode +unicode-range +units-per-em +values +version +viewBox +width +widths +x +x-height +x1 +x2 +actuate +arcrole +href +role +show +base +space +y +y1 +y2 +zoomAndPan +####################################### +# +# colour values +# +####################################### +aliceblue +antiquewhite +aqua +aquamarine +azure +beige +bisque +black +blanchedalmond +blue +blueviolet +brown +burlywood +cadetblue +chartreuse +chocolate +coral +cornflowerblue +cornsilk +crimson +cyan +darkblue +darkcyan +darkgoldenrod +darkgray +darkgreen +darkgrey +darkkhaki +darkmagenta +darkolivegreen +darkorange +darkorchid +darkred +darksalmon +darkseagreen +darkslateblue +darkslategray +darkslategrey +darkturquoise +darkviolet +deeppink +deepskyblue +dimgray +dimgrey +dodgerblue +firebrick +floralwhite +forestgreen +fuchsia +gainsboro +ghostwhite +gold +goldenrod +gray +grey +green +greenyellow +honeydew +hotpink +indianred +indigo +ivory +khaki +lavender +lavenderblush +lawngreen +lemonchiffon +lightblue +lightcoral +lightcyan +lightgoldenrodyellow +lightgray +lightgreen +lightgrey +lightpink +lightsalmon +lightseagreen +lightskyblue +lightslategray +lightslategrey +lightsteelblue +lightyellow +lime +limegreen +linen +magenta +maroon +mediumaquamarine +mediumblue +mediumorchid +mediumpurple +mediumseagreen +mediumslateblue +mediumspringgreen +mediumturquoise +mediumvioletred +midnightblue +mintcream +mistyrose +moccasin +navajowhite +navy +oldlace +olive +olivedrab +orange +orangered +orchid +palegoldenrod +palegreen +paleturquoise +palevioletred +papayawhip +peachpuff +peru +pink +plum +powderblue +purple +red +rosybrown +royalblue +saddlebrown +salmon +sandybrown +seagreen +seashell +sienna +silver +skyblue +slateblue +slategray +slategrey +snow +springgreen +steelblue +tan +teal +thistle +tomato +turquoise +violet +wheat +white +whitesmoke +yellow +yellowgreen +####################################### +# +# Gradient units values +# +####################################### +userSpaceOnUse +objectBoundingBox diff --git a/filter/source/svg/units.cxx b/filter/source/svg/units.cxx new file mode 100644 index 000000000000..b727a42db0fa --- /dev/null +++ b/filter/source/svg/units.cxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Jan Holesovsky + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_filter.hxx" + +#include "units.hxx" +#include "gfxtypes.hxx" +#include "spirit_supplements.hxx" + +#include +#include + +#include +// workaround. spirit uses INT_MAX. +#include +#include + + +namespace svgi +{ + +double convLength( double value, SvgUnit unit, const State& rState, char dir ) +{ + const double fBoxLen( dir=='h' ? rState.maViewBox.getWidth() : + (dir=='v' ? rState.maViewBox.getHeight() : + rState.maViewBox.getRange().getLength())); + + // convert svg unit to internal coordinates ("pixel"). Since the + // OOo drawing layer is still largely integer-based, the initial + // viewport transformation includes a certain scale factor + double fRet(value); + switch ( unit ) + { + case SVG_LENGTH_UNIT_CM: fRet *= 72.0/2.54; break; + case SVG_LENGTH_UNIT_IN: fRet *= 72.0; break; + case SVG_LENGTH_UNIT_MM: fRet *= 72.0/25.4; break; + case SVG_LENGTH_UNIT_PC: fRet *= 72.0/6.0; break; + case SVG_LENGTH_UNIT_USER: + case SVG_LENGTH_UNIT_PX: // no unit defaults to PX in svg, + // assume display to have 72DPI + case SVG_LENGTH_UNIT_PT: break; + case SVG_LENGTH_UNIT_EM: fRet *= rState.mnFontSize; break; + case SVG_LENGTH_UNIT_EX: fRet *= rState.mnFontSize / 2.0; break; + case SVG_LENGTH_UNIT_PERCENTAGE: fRet *= fBoxLen; break; + default: OSL_TRACE( "Unknown length type" ); break; + } + + return fRet; +} + +double convLength( const rtl::OUString& sValue, const State& rState, char dir ) +{ + using namespace ::boost::spirit; + + rtl::OString aUTF8 = rtl::OUStringToOString( sValue, + RTL_TEXTENCODING_UTF8 ); + + double nVal=0.0; + SvgUnit eUnit=SVG_LENGTH_UNIT_PX; + const bool bRes = parse(aUTF8.getStr(), + // Begin grammar + ( + real_p[assign_a(nVal)] + >> ( str_p("cm") [assign_a(eUnit,SVG_LENGTH_UNIT_CM)] + | str_p("em") [assign_a(eUnit,SVG_LENGTH_UNIT_EM)] + | str_p("ex") [assign_a(eUnit,SVG_LENGTH_UNIT_EX)] + | str_p("in") [assign_a(eUnit,SVG_LENGTH_UNIT_IN)] + | str_p("mm") [assign_a(eUnit,SVG_LENGTH_UNIT_MM)] + | str_p("pc") [assign_a(eUnit,SVG_LENGTH_UNIT_PC)] + | str_p("pt") [assign_a(eUnit,SVG_LENGTH_UNIT_PT)] + | str_p("px") [assign_a(eUnit,SVG_LENGTH_UNIT_PX)] + | str_p("%") [assign_a(eUnit,SVG_LENGTH_UNIT_PERCENTAGE)] + | str_p("") [assign_a(eUnit,SVG_LENGTH_UNIT_USER)] + | end_p) + ), + // End grammar + space_p).full; + + if( !bRes ) + return 0.0; + + return convLength(nVal,eUnit,rState,dir); +} + +} // namespace svgi diff --git a/filter/source/svg/units.hxx b/filter/source/svg/units.hxx new file mode 100644 index 000000000000..7bf764178135 --- /dev/null +++ b/filter/source/svg/units.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * Author: + * Jan Holesovsky + * Fridrich Strba + * Thorsten Behrens + * + * Copyright (C) 2008, Novell Inc. + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + ************************************************************************/ + +#ifndef INCLUDED_UNITS_HXX +#define INCLUDED_UNITS_HXX + +#include + +namespace rtl{ class OUString; } +namespace svgi +{ + struct State; + enum SvgUnit + { + SVG_LENGTH_UNIT_CM, + SVG_LENGTH_UNIT_EM, + SVG_LENGTH_UNIT_EX, + SVG_LENGTH_UNIT_IN, + SVG_LENGTH_UNIT_MM, + SVG_LENGTH_UNIT_PC, + SVG_LENGTH_UNIT_PT, + SVG_LENGTH_UNIT_PX, + SVG_LENGTH_UNIT_PERCENTAGE, + SVG_LENGTH_UNIT_USER + }; + + /** return svg_length_t in 100th's of mm + @param fVal value to convert + @param unit unit the value is in + @param rState current state (needed for viewport dimensions etc.) + @param dir direction - either 'h' or 'v' for horizonal or vertical, resp. + */ + double convLength( double fVal, SvgUnit unit, const State& rState, char dir ); + + /** return svg_length_t in 100th's of mm + @param sValue value to convert + @param rState current state (needed for viewport dimensions etc.) + @param dir direction - either 'h' or 'v' for horizonal or vertical, resp. + */ + double convLength( const rtl::OUString& sValue, const State& rState, char dir ); + + inline double pt2mm(double fVal) { return fVal*25.4/72.0; } + inline double pt100thmm(double fVal) { return fVal*2540.0/72.0; } + +} // namespace svgi + +#endif -- cgit From c8f0caee6d5a1360153f8730937229c96dc6557a Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 09:42:47 +0200 Subject: svg-import-filter-gfxfilter.diff: SVG Graphics filter implementation --- .../config/fragments/fcfg_internalgraphics.mk | 1 + .../internalgraphicfilters/svg_Import.xcu | 10 + filter/source/svg/exports.map | 10 + filter/source/svg/makefile.mk | 3 +- filter/source/svg/svgfilter.cxx | 8 + filter/source/svg/svgfilter.hxx | 7 + filter/source/svg/svgreader.cxx | 756 ++++++++++++++++++++- filter/source/svg/test/makefile.mk | 1 + 8 files changed, 791 insertions(+), 5 deletions(-) create mode 100644 filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu create mode 100644 filter/source/svg/exports.map diff --git a/filter/source/config/fragments/fcfg_internalgraphics.mk b/filter/source/config/fragments/fcfg_internalgraphics.mk index ae978f0ca06c..d1f628a6be4f 100644 --- a/filter/source/config/fragments/fcfg_internalgraphics.mk +++ b/filter/source/config/fragments/fcfg_internalgraphics.mk @@ -68,6 +68,7 @@ F4_INTERNALGRAPHICS = \ sgf_Import \ sgv_Import \ svg_Export \ + svg_Import \ svm_Export \ svm_Import \ tga_Import \ diff --git a/filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu new file mode 100644 index 000000000000..339323757332 --- /dev/null +++ b/filter/source/config/fragments/internalgraphicfilters/svg_Import.xcu @@ -0,0 +1,10 @@ + + svg_Scalable_Vector_Graphics + svgfilter + + + + SVG - Scalable Vector Graphics + + IMPORT + diff --git a/filter/source/svg/exports.map b/filter/source/svg/exports.map new file mode 100644 index 000000000000..afb1469bb75c --- /dev/null +++ b/filter/source/svg/exports.map @@ -0,0 +1,10 @@ +UDK_3_0_0 { + global: + component_getImplementationEnvironment; + component_getFactory; + component_writeInfo; + GraphicImport; + + local: + *; +}; diff --git a/filter/source/svg/makefile.mk b/filter/source/svg/makefile.mk index c9f8e09c8e22..715ed8266b8d 100644 --- a/filter/source/svg/makefile.mk +++ b/filter/source/svg/makefile.mk @@ -74,6 +74,7 @@ SHL1STDLIBS=\ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(COMPHELPERLIB) \ + $(SVTOOLLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) \ @@ -82,7 +83,7 @@ SHL1STDLIBS=\ SHL1DEPN= SHL1IMPLIB= i$(SHL1TARGET) SHL1LIBS= $(SLB)$/$(TARGET).lib -SHL1VERSIONMAP=$(SOLARENV)/src/component.map +SHL1VERSIONMAP=exports.map SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 2755dfcf45d4..9f3909f14732 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -205,6 +205,14 @@ rtl::OUString SAL_CALL SVGFilter::detect( Sequence< PropertyValue >& io_rDescrip // ----------------------------------------------------------------------------- +class FilterConfigItem; +extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL ) +{ + return importSvg( rStream, rGraphic ); +} + +// ----------------------------------------------------------------------------- + namespace sdecl = comphelper::service_decl; sdecl::class_ serviceImpl; const sdecl::ServiceDecl svgFilter( diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index a1582b5e434f..e7ee983b2feb 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -268,4 +268,11 @@ sal_Bool SAL_CALL SVGFilter_supportsService( const ::rtl::OUString& ServiceName SAL_CALL SVGFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw ( ::com::sun::star::uno::Exception ); +// ----------------------------------------------------------------------------- + +class SvStream; +class Graphic; + +bool importSvg(SvStream & rStream, Graphic & rGraphic ); + #endif // SVGFILTER_HXX diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index d24ab7136477..d7383f156e37 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -7,6 +7,7 @@ * Thorsten Behrens * * Copyright (C) 2008, Novell Inc. + * Parts copyright 2005 by Sun Microsystems, Inc. * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 3. @@ -41,6 +42,17 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -424,6 +436,9 @@ struct AnnotatingVisitor // start&end color) optimizeGradientStops(rState.maFillGradient); + if( !mxDocumentHandler.is() ) + return true; // cannot write style, svm import case + // do we have a gradient fill? then write out gradient as well if( rState.meFillType == GRADIENT && rState.maFillGradient.maStops.size() > 1 ) { @@ -1505,10 +1520,12 @@ struct ShapeWritingVisitor for( sal_uInt32 i=0; i& rGradientVector, + const std::vector< GradientStop >& rGradientStopVector) : + mrStateMap(rStateMap), + mrOutDev(rOutDev), + mrGradientVector(rGradientVector), + mrGradientStopVector(rGradientStopVector) + {} + + void operator()( const uno::Reference& ) + { + } + + void operator()( const uno::Reference& xElem, + const uno::Reference& xAttributes ) + { + sal_Int32 nDummyIndex(0); + rtl::OUString sStyleId( + xElem->getAttribute( + USTR("internal-style-ref")).getToken( + 0,'$',nDummyIndex)); + StateMap::iterator pOrigState=mrStateMap.find( + sStyleId.toInt32()); + + if( pOrigState == mrStateMap.end() ) + return; // non-exportable element, e.g. linearGradient + + maCurrState = pOrigState->second; + + const sal_Int32 nTokenId(getTokenId(xElem->getNodeName())); + switch(nTokenId) + { + case XML_LINE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double x1=0.0,y1=0.0,x2=0.0,y2=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X1: + x1= convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_X2: + x2 = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y1: + y1 = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_Y2: + y2 = convLength(sAttributeValue,maCurrState,'v'); + break; + default: + // skip + break; + } + } + + basegfx::B2DPolygon aPoly; + aPoly.append(basegfx::B2DPoint(x1,y1)); + aPoly.append(basegfx::B2DPoint(x2,y2)); + + renderPathShape(basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_POLYGON: + case XML_POLYLINE: + { + rtl::OUString sPoints = xElem->hasAttribute(USTR("points")) ? xElem->getAttribute(USTR("points")) : USTR(""); + basegfx::B2DPolygon aPoly; + basegfx::tools::importFromSvgPoints(aPoly, sPoints); + if( nTokenId == XML_POLYGON || maCurrState.meFillType != NONE ) + aPoly.setClosed(true); + + renderPathShape(basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_RECT: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + bool bRxSeen=false, bRySeen=false; + double x=0.0,y=0.0,width=0.0,height=0.0,rx=0.0,ry=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X: + x = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y: + y = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_WIDTH: + width = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_HEIGHT: + height = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_RX: + rx = convLength(sAttributeValue,maCurrState,'h'); + bRxSeen=true; + break; + case XML_RY: + ry = convLength(sAttributeValue,maCurrState,'v'); + bRySeen=true; + break; + default: + // skip + break; + } + } + + if( bRxSeen && !bRySeen ) + ry = rx; + else if( bRySeen && !bRxSeen ) + rx = ry; + + basegfx::B2DPolygon aPoly; + aPoly = basegfx::tools::createPolygonFromRect( + basegfx::B2DRange(x,y,x+width,y+height), + rx, ry ); + + renderPathShape(basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_PATH: + { + rtl::OUString sPath = xElem->hasAttribute(USTR("d")) ? xElem->getAttribute(USTR("d")) : USTR(""); + basegfx::B2DPolyPolygon aPoly; + basegfx::tools::importFromSvgD(aPoly, sPath); + + renderPathShape(aPoly); + break; + } + case XML_CIRCLE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double cx=0.0,cy=0.0,r=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_CX: + cx = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_CY: + cy = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_R: + r = convLength(sAttributeValue,maCurrState,'o'); + default: + // skip + break; + } + } + + basegfx::B2DEllipse aEllipse(basegfx::B2DPoint(cx, cy), basegfx::B2DTuple(r,r)); + basegfx::B2DPolygon aPoly = basegfx::tools::createPolygonFromEllipse( + aEllipse.getB2DEllipseCenter(), + aEllipse.getB2DEllipseRadius().getX(), + aEllipse.getB2DEllipseRadius().getY()); + + renderPathShape(basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_ELLIPSE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double cx=0.0,cy=0.0,rx=0.0, ry=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_CX: + cx = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_CY: + cy = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_RX: + rx = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_RY: + ry = convLength(sAttributeValue,maCurrState,'v'); + default: + // skip + break; + } + } + + basegfx::B2DEllipse aEllipse(basegfx::B2DPoint(cx, cy), basegfx::B2DTuple(rx,ry)); + basegfx::B2DPolygon aPoly = basegfx::tools::createPolygonFromEllipse( + aEllipse.getB2DEllipseCenter(), + aEllipse.getB2DEllipseRadius().getX(), + aEllipse.getB2DEllipseRadius().getY()); + + renderPathShape(basegfx::B2DPolyPolygon(aPoly)); + break; + } + case XML_IMAGE: + { + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double x=0.0,y=0.0,width=0.0,height=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X: + x = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y: + y = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_WIDTH: + width = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_HEIGHT: + height = convLength(sAttributeValue,maCurrState,'v'); + break; + default: + // skip + break; + } + } + + rtl::OUString sValue = xElem->hasAttribute(USTR("href")) ? xElem->getAttribute(USTR("href")) : USTR(""); + rtl::OString aValueUtf8( sValue.getStr(), sValue.getLength(), RTL_TEXTENCODING_UTF8 ); + std::string sLinkValue; + parseXlinkHref(aValueUtf8.getStr(), sLinkValue); + + if (!sLinkValue.empty()) + { + // <- blatant copy from svx/source/xml/xmlgrhlp.cxx + Graphic aGraphic; + + uno::Sequence aData; + SvXMLUnitConverter::decodeBase64(aData, + rtl::OUString::createFromAscii(sLinkValue.c_str())); + SvMemoryStream aSrc(aData.getArray(), + aData.getLength(), + STREAM_READ); + USHORT nFormat = GRFILTER_FORMAT_DONTKNOW; + USHORT pDeterminedFormat = GRFILTER_FORMAT_DONTKNOW; + GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), aSrc ,nFormat,&pDeterminedFormat ); + + if (pDeterminedFormat == GRFILTER_FORMAT_DONTKNOW) + { + //Read the first two byte to check whether it is a gzipped stream, is so it may be in wmz or emz format + //unzip them and try again + + BYTE sFirstBytes[ 2 ]; + + aSrc.Seek( STREAM_SEEK_TO_END ); + ULONG nStreamLen = aSrc.Tell(); + aSrc.Seek( 0 ); + + if ( !nStreamLen ) + { + SvLockBytes* pLockBytes = aSrc.GetLockBytes(); + if ( pLockBytes ) + pLockBytes->SetSynchronMode( TRUE ); + + aSrc.Seek( STREAM_SEEK_TO_END ); + nStreamLen = aSrc.Tell(); + aSrc.Seek( 0 ); + } + if( nStreamLen >= 2 ) + { + //read two byte + aSrc.Read( sFirstBytes, 2 ); + + if( sFirstBytes[0] == 0x1f && sFirstBytes[1] == 0x8b ) + { + SvMemoryStream* pDest = new SvMemoryStream; + ZCodec aZCodec( 0x8000, 0x8000 ); + aZCodec.BeginCompression(ZCODEC_GZ_LIB); + aSrc.Seek( 0 ); + aZCodec.Decompress( aSrc, *pDest ); + + if (aZCodec.EndCompression() && pDest ) + { + pDest->Seek( STREAM_SEEK_TO_END ); + ULONG nStreamLen_ = pDest->Tell(); + if (nStreamLen_) + { + pDest->Seek(0L); + GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), *pDest ,nFormat,&pDeterminedFormat ); + } + } + delete pDest; + } + } + } + // -> blatant copy from svx/source/xml/xmlgrhlp.cxx + + const Rectangle aBounds( + Point(basegfx::fround(pt100thmm(x)), + basegfx::fround(pt100thmm(y))), + Size(basegfx::fround(pt100thmm(width)), + basegfx::fround(pt100thmm(height)))); + aGraphic.Draw(&mrOutDev, + aBounds.TopLeft(), + aBounds.GetSize()); + maBounds.Union(aBounds); + } + break; + } + case XML_TEXT: + { + // collect text from all TEXT_NODE children into sText + rtl::OUStringBuffer sText; + visitChildren(boost::bind( + (rtl::OUStringBuffer& (rtl::OUStringBuffer::*)(const sal_Unicode* str))&rtl::OUStringBuffer::append, + boost::ref(sText), + boost::bind(&xml::dom::XNode::getNodeValue, + _1)), + xElem, + xml::dom::NodeType_TEXT_NODE); + + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + rtl::OUString sAttributeValue; + double x=0.0,y=0.0,width=0.0,height=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); + const sal_Int32 nAttribId( + getTokenId(xAttributes->item(i)->getNodeName())); + switch(nAttribId) + { + case XML_X: + x = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_Y: + y = convLength(sAttributeValue,maCurrState,'v'); + break; + case XML_WIDTH: + width = convLength(sAttributeValue,maCurrState,'h'); + break; + case XML_HEIGHT: + height = convLength(sAttributeValue,maCurrState,'v'); + break; + default: + // skip + break; + } + } + + // actually export text + Font aFont(maCurrState.maFontFamily, + Size(0, + basegfx::fround(pt100thmm(maCurrState.mnFontSize)))); + + // extract basic transformations out of CTM + basegfx::B2DTuple aScale, aTranslate; + double fRotate, fShearX; + ::rtl::OUString sTransformValue; + if (maCurrState.maCTM.decompose(aScale, aTranslate, fRotate, fShearX)) + { + rtl::OUString sTransform; + x += aTranslate.getX(); + y += aTranslate.getY(); + + aFont.SetSize( + Size(basegfx::fround(aFont.GetWidth()*aScale.getX()), + basegfx::fround(aFont.GetHeight()*aScale.getY()))); + + if( fRotate ) + aFont.SetOrientation(basegfx::fround(fRotate*1800.0/M_PI)); + } + + // TODO(F2): update bounds + mrOutDev.SetFont(aFont); + mrOutDev.DrawText(Point(basegfx::fround(pt100thmm(x)), + basegfx::fround(pt100thmm(y))), + sText.makeStringAndClear()); + break; + } + } + } + + void push() + { + } + + void pop() + { + } + + bool hasGradientOpacity( const Gradient& rGradient ) + { + return + mrGradientStopVector[ + rGradient.maStops[0]].maStopColor.a != 1.0 || + mrGradientStopVector[ + rGradient.maStops[1]].maStopColor.a != 1.0; + } + + sal_Int8 toByteColor( double val ) + { + // TODO(Q3): duplicated from vcl::unotools + return sal::static_int_cast( + basegfx::fround(val*255.0)); + } + + ::Color getVclColor( const ARGBColor& rColor ) + { + const sal_uInt8 nRed ( toByteColor(rColor.r) ); + const sal_uInt8 nGreen( toByteColor(rColor.g) ); + const sal_uInt8 nBlue ( toByteColor(rColor.b) ); + + return ::Color(nRed,nGreen,nBlue); + } + + void renderPathShape(const basegfx::B2DPolyPolygon& rPoly) + { + // we might need to split up polypolygon into multiple path + // shapes (e.g. when emulating line stroking) + State aState = maCurrState; + + // bring polygon from pt coordinate system to 100th millimeter + aState.maCTM.scale(2540.0/72.0,2540.0/72.0); + + basegfx::B2DPolyPolygon aPoly(rPoly); + aPoly.transform(aState.maCTM); + + const basegfx::B2DRange aBounds=basegfx::tools::getRange(aPoly); + maBounds.Union( + Rectangle( + basegfx::fround(aBounds.getMinX()), + basegfx::fround(aBounds.getMinY()), + basegfx::fround(aBounds.getMaxX()), + basegfx::fround(aBounds.getMaxY()))); + + // fill first + mrOutDev.SetLineColor(); + + // do we have a gradient fill? + if( aState.meFillType == GRADIENT && aState.maFillGradient.maStops.size() > 1 ) + { + ::Gradient aGradient; + + if( aState.maFillGradient.meType == Gradient::LINEAR ) + { + // should the optimizeGradientStops method decide that + // this is a three-color gradient, it prolly wanted us + // to take axial instead + aGradient = ::Gradient( aState.maFillGradient.maStops.size() == 3 ? + GRADIENT_AXIAL : + GRADIENT_LINEAR ); + } + else + { + aGradient = ::Gradient( GRADIENT_ELLIPTICAL ); + } + + basegfx::B2DTuple rScale, rTranslate; + double rRotate, rShearX; + if( aState.maFillGradient.maTransform.decompose(rScale, rTranslate, rRotate, rShearX) ) + aGradient.SetAngle( basegfx::fround(rRotate*1800.0/M_PI) ); + aGradient.SetStartColor( getVclColor( + mrGradientStopVector[ + aState.maFillGradient.maStops[0]].maStopColor) ); + aGradient.SetEndColor( getVclColor( + mrGradientStopVector[ + aState.maFillGradient.maStops[1]].maStopColor) ); + + if( hasGradientOpacity(aState.maFillGradient) ) + { + ::Gradient aTransparencyGradient=aGradient; + + const BYTE cTransStart( 255- + basegfx::fround(mrGradientStopVector[ + aState.maFillGradient.maStops[1]].maStopColor.a* + aState.mnFillOpacity*255.0)); + const Color aTransStart( cTransStart, cTransStart, cTransStart ); + + const BYTE cTransEnd( 255- + basegfx::fround(mrGradientStopVector[ + aState.maFillGradient.maStops[0]].maStopColor.a* + aState.mnFillOpacity*255.0)); + const Color aTransEnd( cTransEnd, cTransEnd, cTransEnd ); + + // modulate gradient opacity with overall fill opacity + aTransparencyGradient.SetStartColor(aTransStart); + aTransparencyGradient.SetEndColor(aTransEnd); + + VirtualDevice aVDev; + GDIMetaFile aMtf; + + aVDev.EnableOutput( FALSE ); + aVDev.SetMapMode( mrOutDev.GetMapMode() ); + aMtf.Record( &aVDev ); + + aVDev.SetLineColor(); + aVDev.SetFillColor(); + aVDev.DrawGradient(::PolyPolygon(aPoly),aGradient); + + const Rectangle aMtfBounds( + basegfx::fround(aBounds.getMinX()), + basegfx::fround(aBounds.getMinY()), + basegfx::fround(aBounds.getMaxX()), + basegfx::fround(aBounds.getMaxY())); + + MapMode aMap(mrOutDev.GetMapMode()); + aMtf.Stop(); + aMtf.WindStart(); + aMap.SetOrigin( aMtfBounds.TopLeft() ); + aMtf.SetPrefMapMode( aMap ); + aMtf.SetPrefSize( aMtfBounds.GetSize() ); + + mrOutDev.DrawTransparent(aMtf, + aMtfBounds.TopLeft(), + aMtfBounds.GetSize(), + aTransparencyGradient); + } + else + { + mrOutDev.DrawGradient(::PolyPolygon(aPoly),aGradient); + } + } + else + { + if( aState.meFillType == NONE ) + mrOutDev.SetFillColor(); + else + mrOutDev.SetFillColor(getVclColor(aState.maFillColor)); + + if( aState.mnFillOpacity != 1.0 ) + mrOutDev.DrawTransparent(::PolyPolygon(aPoly), + basegfx::fround( + (1.0-aState.mnFillOpacity)*100.0)); + else + mrOutDev.DrawPolyPolygon(::PolyPolygon(aPoly)); + } + + // Stroking now + mrOutDev.SetFillColor(); + + if( aState.meStrokeType != NONE && + (aState.maDashArray.size() || + aState.mnStrokeWidth != 1.0) ) + { + // vcl thick lines are severly borked - generate filled + // polygon instead + std::vector aPolys; + aPoly = rPoly; + if( !aState.maDashArray.empty() ) + { + aPoly.clear(); + basegfx::B2DPolyPolygon aSegment; + for( sal_uInt32 i=0; i& mrGradientVector; + const std::vector< GradientStop >& mrGradientStopVector; + Rectangle maBounds; +}; + } // namespace svgi + +bool importSvg(SvStream & rStream, Graphic & rGraphic ) +{ + const uno::Reference xServiceFactory( + ::comphelper::getProcessServiceFactory()); + + uno::Reference xDomBuilder( + xServiceFactory->createInstance( + rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), + uno::UNO_QUERY ); + + uno::Reference xStream( + new utl::OInputStreamWrapper(rStream) ); + + uno::Reference xDom( + xDomBuilder->parse(xStream), + uno::UNO_QUERY_THROW ); + + uno::Reference xDocElem( xDom->getDocumentElement(), + uno::UNO_QUERY_THROW ); + + VirtualDevice aVDev; + GDIMetaFile aMtf; + + aVDev.EnableOutput( FALSE ); + aMtf.Record( &aVDev ); + + // parse styles and fill state stack + svgi::State aInitialState; + svgi::StatePool aStatePool; + svgi::StateMap aStateMap; + svgi::AnnotatingVisitor aVisitor(aStatePool, + aStateMap, + aInitialState, + uno::Reference()); + svgi::visitElements(aVisitor, xDocElem); + +#ifdef VERBOSE + dumpTree(xDocElem); +#endif + + // render all shapes to mtf + svgi::ShapeRenderingVisitor aRenderer(aStatePool,aStateMap,aVDev, + aVisitor.maGradientVector, + aVisitor.maGradientStopVector); + svgi::visitElements(aRenderer, xDocElem); + + aMtf.Stop(); + + aMtf.WindStart(); + aMtf.SetPrefMapMode( MAP_100TH_MM ); + + // get the document dimensions + + // if the "width" and "height" attributes are missing, inkscape fakes + // A4 portrait for. Let's do the same. + if (!xDocElem->hasAttribute(USTR("width"))) + xDocElem->setAttribute(USTR("width"), USTR("210mm")); + if (!xDocElem->hasAttribute(USTR("height"))) + xDocElem->setAttribute(USTR("height"), USTR("297mm")); + + aMtf.SetPrefSize( + Size( + std::max( + sal_Int32(aRenderer.maBounds.Right()), + basegfx::fround( svgi::pt100thmm(svgi::convLength(xDocElem->getAttribute(USTR("width")),aInitialState,'h')) )), + std::max( + sal_Int32(aRenderer.maBounds.Bottom()), + basegfx::fround( svgi::pt100thmm(svgi::convLength(xDocElem->getAttribute(USTR("height")),aInitialState,'v')) )))); + + rGraphic = aMtf; + + return sal_True; +} diff --git a/filter/source/svg/test/makefile.mk b/filter/source/svg/test/makefile.mk index d51fdda07e68..669d5496b084 100644 --- a/filter/source/svg/test/makefile.mk +++ b/filter/source/svg/test/makefile.mk @@ -41,6 +41,7 @@ SHL1STDLIBS= \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(COMPHELPERLIB) \ + $(SVTOOLLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) \ -- cgit From c04b1c582f9c3b5ff854ba16181af7f5c00d3bb3 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 09:47:53 +0200 Subject: svg-import-viewbox-fix.diff: fixes some nastiness with viewbox --- filter/source/svg/parserfragments.cxx | 3 ++- filter/source/svg/svgreader.cxx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx index d11ceca02d70..147f77889155 100644 --- a/filter/source/svg/parserfragments.cxx +++ b/filter/source/svg/parserfragments.cxx @@ -510,7 +510,8 @@ bool parseDashArray( const char* sDashArray, std::vector& rOutputVector list_p.direct ( real_p[push_back_a(rOutputVector)], - ',' + // list delimiter is either ',' or space + ',' | eps_p ) ) >> end_p, // End grammar diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index d7383f156e37..d7b8a28bdaa8 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -254,6 +254,7 @@ struct AnnotatingVisitor // init state. inherit defaults from parent. maCurrState = maParentStates.back(); maCurrState.maTransform.identity(); + maCurrState.maViewBox.reset(); // scan for style info const sal_Int32 nNumAttrs( xAttributes->getLength() ); -- cgit From 614464ccc3ffd814267d52c58300e04b3178a865 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 09:49:34 +0200 Subject: svg-import-painturi-fix.diff: improves parsing of paint fragments --- filter/source/svg/parserfragments.cxx | 128 +++++++++++++++++++++++----------- filter/source/svg/parserfragments.hxx | 24 +++++++ filter/source/svg/svgreader.cxx | 33 ++++++--- 3 files changed, 136 insertions(+), 49 deletions(-) diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx index 147f77889155..8cdc8315122a 100644 --- a/filter/source/svg/parserfragments.cxx +++ b/filter/source/svg/parserfragments.cxx @@ -117,52 +117,72 @@ geometry::AffineMatrix2D multiplyMatrix( const geometry::AffineMatrix2D& rLHS, return basegfx::unotools::affineMatrixFromHomMatrix(aRet,aRHS); } +namespace +{ + struct ColorGrammar : public ::boost::spirit::grammar< ColorGrammar > + { + public: + ARGBColor& m_rColor; + explicit ColorGrammar( ARGBColor& rColor ) : m_rColor(rColor) {} + template< typename ScannerT > + struct definition + { + ::boost::spirit::rule< ScannerT > colorExpression; + definition( const ColorGrammar& self ) + { + using namespace ::boost::spirit; + + int_parser byte_p; + colorExpression = + ( + // the #rrggbb form + ('#' >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, + boost::ref(self.m_rColor.r),_1,_2)] + >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, + boost::ref(self.m_rColor.g),_1,_2)] + >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, + boost::ref(self.m_rColor.b),_1,_2)]) + | + // the #rgb form + ('#' >> xdigit_p[boost::bind(&setFourBitColor, + boost::ref(self.m_rColor.r),_1)] + >> xdigit_p[boost::bind(&setFourBitColor, + boost::ref(self.m_rColor.g),_1)] + >> xdigit_p[boost::bind(&setFourBitColor, + boost::ref(self.m_rColor.b),_1)]) + | + // rgb() form + (str_p("rgb") + >> '(' >> + ( + // rgb(int,int,int) + (byte_p[boost::bind(&setIntColor, + boost::ref(self.m_rColor.r),_1)] >> ',' >> + byte_p[boost::bind(&setIntColor, + boost::ref(self.m_rColor.g),_1)] >> ',' >> + byte_p[boost::bind(&setIntColor, + boost::ref(self.m_rColor.b),_1)]) + | + // rgb(double,double,double) + (real_p[assign_a(self.m_rColor.r)] >> ',' >> + real_p[assign_a(self.m_rColor.g)] >> ',' >> + real_p[assign_a(self.m_rColor.b)]) + ) + >> ')') + ); + } + ::boost::spirit::rule const& start() const { return colorExpression; } + }; + }; +} + bool parseColor( const char* sColor, ARGBColor& rColor ) { using namespace ::boost::spirit; - int_parser byte_p; - if( parse(sColor, - // Begin grammar - ( - // the #rrggbb form - ('#' >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, - boost::ref(rColor.r),_1,_2)] - >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, - boost::ref(rColor.g),_1,_2)] - >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, - boost::ref(rColor.b),_1,_2)]) - | - // the #rgb form - ('#' >> xdigit_p[boost::bind(&setFourBitColor, - boost::ref(rColor.r),_1)] - >> xdigit_p[boost::bind(&setFourBitColor, - boost::ref(rColor.g),_1)] - >> xdigit_p[boost::bind(&setFourBitColor, - boost::ref(rColor.b),_1)]) - | - // rgb() form - (str_p("rgb") - >> '(' >> - ( - // rgb(int,int,int) - (byte_p[boost::bind(&setIntColor, - boost::ref(rColor.r),_1)] >> ',' >> - byte_p[boost::bind(&setIntColor, - boost::ref(rColor.g),_1)] >> ',' >> - byte_p[boost::bind(&setIntColor, - boost::ref(rColor.b),_1)]) - | - // rgb(double,double,double) - (real_p[assign_a(rColor.r)] >> ',' >> - real_p[assign_a(rColor.g)] >> ',' >> - real_p[assign_a(rColor.b)]) - ) - >> ')') - ) >> end_p, - // End grammar - space_p).full ) + ColorGrammar(rColor) >> end_p, + space_p).full ) { // free-form color found & parsed return true; @@ -520,6 +540,32 @@ bool parseDashArray( const char* sDashArray, std::vector& rOutputVector ////////////////////////////////////////////////////////////// +bool parsePaintUri( std::pair& o_rPaintUri, + std::pair& io_rColor, + const char* sPaintUri ) +{ + using namespace ::boost::spirit; + + const bool bRes = parse(sPaintUri, + // Begin grammar + ( + str_p("url(#") >> + (+alnum_p)[assign_a(o_rPaintUri)] >> + str_p(")") >> + *( str_p("none")[assign_a(io_rColor.second,false)] | + str_p("currentColor")[assign_a(io_rColor.second,true)] | + ColorGrammar(io_rColor.first) + // TODO(F1): named color + ) + ) >> end_p, + // End grammar + space_p).full; + + return bRes; +} + +////////////////////////////////////////////////////////////// + namespace { void appendChar( std::string& str, char character) diff --git a/filter/source/svg/parserfragments.hxx b/filter/source/svg/parserfragments.hxx index bcb6427aa4d8..d2b699231b76 100644 --- a/filter/source/svg/parserfragments.hxx +++ b/filter/source/svg/parserfragments.hxx @@ -18,6 +18,7 @@ #include #include +#include #include namespace basegfx @@ -42,6 +43,29 @@ namespace svgi /// Parse given string for a list of double values, comma-delimited bool parseDashArray( const char* sDashArray, std::vector& rOutputVector ); + /** Parse paint uri + + @param o_rPaintUri + Start and end ptr for uri substring (within + [sPaintUri,sPaintUri+strlen(sPaintUri)] + + @param io_rColor + The optional paint color to use. if o_rPaintUri is empty, + parser sets io_rColor.second to false for color="None", to + true and keeps current io_rColor.first entry for + "currentColor", and to true and sets io_rColor.first to parsed + color otherwise. + + @param sPaintUri + String to parse. Permitted to contain the optional paint + stuff, like fallback color. + + @return true, if a paint uri was successfully parsed. + */ + bool parsePaintUri( std::pair& o_rPaintUri, + std::pair& io_rColor, + const char* sPaintUri ); + /// Parse given string for the xlink attribute bool parseXlinkHref( const char* xlink, std::string& data ); diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index d7b8a28bdaa8..7f85fa96e8d8 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -996,6 +996,9 @@ struct AnnotatingVisitor const ARGBColor& rInheritColor, const Gradient& rInheritGradient ) { + std::pair aPaintUri(NULL,NULL); + std::pair aColor(maCurrState.maCurrentColor, + false); if( strcmp(sValue,"none") == 0 ) rType = NONE; else if( strcmp(sValue,"currentColor") == 0 ) @@ -1009,19 +1012,33 @@ struct AnnotatingVisitor rColor = rInheritColor; rGradient = rInheritGradient; } - else if( strncmp(sValue,"url(#",5) == 0 ) + else if( parsePaintUri(aPaintUri,aColor,sValue) ) { - // assuming gradient. assumption does not hold generally - if( rValue.getLength() > 5 ) + if( aPaintUri.first != aPaintUri.second ) { - ElementRefMapType::iterator aRes; - if( (aRes=maGradientIdMap.find(rValue.copy(5, - rValue.getLength()-6))) != maGradientIdMap.end() ) + // assuming gradient. assumption does not hold generally + const char* pClosingBracket; + if( (pClosingBracket=strstr(sValue,")")) && rValue.getLength() > 5 ) { - rGradient = maGradientVector[aRes->second]; - rType = GRADIENT; + ElementRefMapType::iterator aRes; + if( (aRes=maGradientIdMap.find( + rValue.copy(aPaintUri.first-sValue, + aPaintUri.second-aPaintUri.first))) != maGradientIdMap.end() ) + { + rGradient = maGradientVector[aRes->second]; + rType = GRADIENT; + } } } + else if( aColor.second ) + { + rType = SOLID; + rColor = aColor.first; + } + else + { + rType = NONE; + } } else { -- cgit From fbd966ca51c0d25a0197b0917bc7132b7a340e7e Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 09:51:31 +0200 Subject: svg-import-textimport.diff: much improved text import --- filter/source/svg/gfxtypes.hxx | 29 +++------ filter/source/svg/svgreader.cxx | 138 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 141 insertions(+), 26 deletions(-) diff --git a/filter/source/svg/gfxtypes.hxx b/filter/source/svg/gfxtypes.hxx index 3675e30e65eb..d247b69ec643 100644 --- a/filter/source/svg/gfxtypes.hxx +++ b/filter/source/svg/gfxtypes.hxx @@ -155,19 +155,6 @@ enum CapStyle ROUND }; -enum FontStyle -{ - STYLE_NORMAL, - STYLE_OBLIQUE, - STYLE_ITALIC -}; - -enum FontVariant -{ - VARIANT_NORMAL, - VARIANT_SMALLCAPS -}; - struct State { State() : @@ -177,8 +164,8 @@ struct State maViewBox(), maFontFamily(), // app-default mnFontSize(12.0), - meFontStyle(STYLE_NORMAL), - meFontVariant(VARIANT_NORMAL), + maFontStyle(RTL_CONSTASCII_USTRINGPARAM("normal")), + maFontVariant(RTL_CONSTASCII_USTRINGPARAM("normal")), mnFontWeight(400.0), meTextAnchor(BEFORE), meTextDisplayAlign(BEFORE), @@ -220,8 +207,8 @@ struct State */ double mnFontSize; - FontStyle meFontStyle; - FontVariant meFontVariant; + rtl::OUString maFontStyle; + rtl::OUString maFontVariant; double mnFontWeight; TextAlign meTextAnchor; // text-anchor @@ -265,8 +252,8 @@ inline bool operator==(const State& rLHS, const State& rRHS ) rLHS.maViewBox==rRHS.maViewBox && rLHS.maFontFamily==rRHS.maFontFamily && rLHS.mnFontSize==rRHS.mnFontSize && - rLHS.meFontStyle==rRHS.meFontStyle && - rLHS.meFontVariant==rRHS.meFontVariant && + rLHS.maFontStyle==rRHS.maFontStyle && + rLHS.maFontVariant==rRHS.maFontVariant && rLHS.mnFontWeight==rRHS.mnFontWeight && rLHS.meTextAnchor==rRHS.meTextAnchor && rLHS.meTextDisplayAlign==rRHS.meTextDisplayAlign && @@ -310,8 +297,8 @@ struct StateHash ^ size_t(rState.maViewBox.getHeight()) ^ size_t(rState.maFontFamily.hashCode()) ^ size_t(rState.mnFontSize) - ^ size_t(rState.meFontStyle) - ^ size_t(rState.meFontVariant) + ^ size_t(rState.maFontStyle.hashCode()) + ^ size_t(rState.maFontVariant.hashCode()) ^ size_t(rState.mnFontWeight) ^ size_t(rState.meTextAnchor) ^ size_t(rState.meTextDisplayAlign) diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 7f85fa96e8d8..0c70c5ff35b0 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -415,6 +415,24 @@ struct AnnotatingVisitor return aBuf.makeStringAndClear(); } + rtl::OUString getOdfAlign( TextAlign eAlign ) + { + static ::rtl::OUString aStart(USTR("start")); + static ::rtl::OUString aEnd(USTR("end")); + // static ::rtl::OUString aJustify(USTR("justify")); + static ::rtl::OUString aCenter(USTR("center")); + switch(eAlign) + { + default: + case BEFORE: + return aStart; + case CENTER: + return aCenter; + case AFTER: + return aEnd; + } + } + bool writeStyle(State& rState, const sal_Int32 nTagId) { rtl::Reference xAttrs( new SvXMLAttributeList() ); @@ -443,7 +461,7 @@ struct AnnotatingVisitor // do we have a gradient fill? then write out gradient as well if( rState.meFillType == GRADIENT && rState.maFillGradient.maStops.size() > 1 ) { - // TODO(F3): ODF12 supposedly also groks svg:linear/radialGradient + // TODO(F3): ODF12 supposedly also groks svg:linear/radialGradient. But CL says: nope. xAttrs->AddAttribute( USTR( "draw:name" ), getStyleName("svggradient", rState.maFillGradient.mnId) ); if( rState.maFillGradient.meType == Gradient::LINEAR ) { @@ -515,6 +533,47 @@ struct AnnotatingVisitor } // serialize to automatic-style section + if( nTagId == XML_TEXT ) + { + // write paragraph style attributes + xAttrs->Clear(); + + xAttrs->AddAttribute( USTR( "style:name" ), getStyleName("svgparagraphstyle", mnCurrStateId) ); + xAttrs->AddAttribute( USTR( "style:family" ), USTR("paragraph") ); + mxDocumentHandler->startElement( USTR("style:style"), + xUnoAttrs ); + + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "fo:text-align"), getOdfAlign(rState.meTextAnchor)); + + mxDocumentHandler->startElement( USTR("style:paragraph-properties"), + xUnoAttrs ); + mxDocumentHandler->endElement( USTR("style:paragraph-properties") ); + mxDocumentHandler->endElement( USTR("style:style") ); + + // write text style attributes + xAttrs->Clear(); + + xAttrs->AddAttribute( USTR( "style:name" ), getStyleName("svgtextstyle", mnCurrStateId) ); + xAttrs->AddAttribute( USTR( "style:family" ), USTR("text") ); + mxDocumentHandler->startElement( USTR("style:style"), + xUnoAttrs ); + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "fo:font-family"), rState.maFontFamily); + xAttrs->AddAttribute( USTR( "fo:font-size"), + rtl::OUString::valueOf(pt2mm(rState.mnFontSize))+USTR("mm")); + xAttrs->AddAttribute( USTR( "fo:font-style"), rState.maFontStyle); + xAttrs->AddAttribute( USTR( "fo:font-variant"), rState.maFontVariant); + xAttrs->AddAttribute( USTR( "fo:font-weight"), + rtl::OUString::valueOf(rState.mnFontWeight)); + xAttrs->AddAttribute( USTR( "fo:color"), getOdfColor(rState.maFillColor)); + + mxDocumentHandler->startElement( USTR("style:text-properties"), + xUnoAttrs ); + mxDocumentHandler->endElement( USTR("style:text-properties") ); + mxDocumentHandler->endElement( USTR("style:style") ); + } + xAttrs->Clear(); xAttrs->AddAttribute( USTR( "style:name" ), getStyleName("svggraphicstyle", mnCurrStateId) ); xAttrs->AddAttribute( USTR( "style:family" ), USTR("graphic") ); @@ -928,13 +987,16 @@ struct AnnotatingVisitor maCurrState.mnFontSize=convLength(sValue,maCurrState,'v'); break; case XML_FONT_STYLE: - maCurrState.meFontStyle=STYLE_ITALIC; // TODO: sValue.toStyleId(); + parseFontStyle(maCurrState,sValue,aValueUtf8.getStr()); break; case XML_FONT_WEIGHT: maCurrState.mnFontWeight=sValue.toDouble(); break; case XML_FONT_VARIANT: - maCurrState.meFontVariant=VARIANT_SMALLCAPS; // TODO: sValue.toDouble(); + parseFontVariant(maCurrState,sValue,aValueUtf8.getStr()); + break; + case XML_TEXT_ANCHOR: + parseTextAlign(maCurrState,aValueUtf8.getStr()); break; case XML_STOP_COLOR: if( maGradientVector.empty() || @@ -987,6 +1049,34 @@ struct AnnotatingVisitor while( nIndex != -1 ); } + void parseFontStyle( State& io_rInitialState, + const rtl::OUString& rValue, + const char* sValue ) + { + if( strcmp(sValue,"inherit") != 0 ) + io_rInitialState.maFontStyle = rValue; + } + + void parseFontVariant( State& io_rInitialState, + const rtl::OUString& rValue, + const char* sValue ) + { + if( strcmp(sValue,"inherit") != 0 ) + io_rInitialState.maFontVariant = rValue; + } + + void parseTextAlign( State& io_rInitialState, + const char* sValue ) + { + if( strcmp(sValue,"start") == 0 ) + io_rInitialState.meTextAnchor = BEFORE; + else if( strcmp(sValue,"middle") == 0 ) + io_rInitialState.meTextAnchor = CENTER; + else if( strcmp(sValue,"end") == 0 ) + io_rInitialState.meTextAnchor = AFTER; + // keep current val for sValue == "inherit" + } + void parsePaint( const rtl::OUString& rValue, const char* sValue, PaintType& rType, @@ -1391,6 +1481,10 @@ struct ShapeWritingVisitor // actually export text xAttrs->Clear(); + // some heuristic attempts to have text output + // baseline-relative + y -= 2.0*maCurrState.mnFontSize/3.0; + // extract basic transformations out of CTM basegfx::B2DTuple aScale, aTranslate; double fRotate, fShearX; @@ -1423,9 +1517,16 @@ struct ShapeWritingVisitor xAttrs->Clear(); mxDocumentHandler->startElement(USTR("draw:text-box"),xUnoAttrs); - // TODO: put text style in here + xAttrs->AddAttribute( USTR( "text:style-name" ), USTR("svgparagraphstyle")+sStyleId); mxDocumentHandler->startElement(USTR("text:p"),xUnoAttrs); + + xAttrs->Clear(); + xAttrs->AddAttribute( USTR( "text:style-name" ), USTR("svgtextstyle")+sStyleId); + mxDocumentHandler->startElement(USTR("text:span"),xUnoAttrs); + + xAttrs->Clear(); mxDocumentHandler->characters(sText.makeStringAndClear()); + mxDocumentHandler->endElement(USTR("text:span")); mxDocumentHandler->endElement(USTR("text:p")); mxDocumentHandler->endElement(USTR("draw:text-box")); mxDocumentHandler->endElement(USTR("draw:frame")); @@ -2291,6 +2392,14 @@ struct ShapeRenderingVisitor Font aFont(maCurrState.maFontFamily, Size(0, basegfx::fround(pt100thmm(maCurrState.mnFontSize)))); + aFont.SetAlign(ALIGN_BASELINE); + aFont.SetColor(getVclColor(maCurrState.maFillColor)); + aFont.SetFillColor(getVclColor(maCurrState.maFillColor)); + + if( !maCurrState.maFontStyle.equalsAscii("normal") ) + aFont.SetItalic(ITALIC_NORMAL); // TODO: discriminate + if( !maCurrState.mnFontWeight != 400.0 ) + aFont.SetWeight(WEIGHT_BOLD); // TODO: discriminate // extract basic transformations out of CTM basegfx::B2DTuple aScale, aTranslate; @@ -2312,9 +2421,27 @@ struct ShapeRenderingVisitor // TODO(F2): update bounds mrOutDev.SetFont(aFont); + const ::rtl::OUString aText( sText.makeStringAndClear() ); + switch( maCurrState.meTextAnchor ) + { + default: + case BEFORE: + break; + + case CENTER: + { + const long nWidth=mrOutDev.GetTextWidth(aText); + x -= nWidth/2; + } + break; + + case AFTER: + x -= mrOutDev.GetTextWidth(aText); + break; + } mrOutDev.DrawText(Point(basegfx::fround(pt100thmm(x)), basegfx::fround(pt100thmm(y))), - sText.makeStringAndClear()); + aText); break; } } @@ -2592,6 +2719,7 @@ bool importSvg(SvStream & rStream, Graphic & rGraphic ) aVDev.EnableOutput( FALSE ); aMtf.Record( &aVDev ); + aVDev.SetTextAlign(ALIGN_BASELINE); // parse styles and fill state stack svgi::State aInitialState; -- cgit From 466f6298ada375d1a6c70d5467c80dba89615197 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 14 Sep 2010 09:54:19 +0200 Subject: svg-import-convlength-fix.diff: fixing relative size calculation --- filter/source/svg/units.cxx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/filter/source/svg/units.cxx b/filter/source/svg/units.cxx index b727a42db0fa..9c98caca2122 100644 --- a/filter/source/svg/units.cxx +++ b/filter/source/svg/units.cxx @@ -35,10 +35,6 @@ namespace svgi double convLength( double value, SvgUnit unit, const State& rState, char dir ) { - const double fBoxLen( dir=='h' ? rState.maViewBox.getWidth() : - (dir=='v' ? rState.maViewBox.getHeight() : - rState.maViewBox.getRange().getLength())); - // convert svg unit to internal coordinates ("pixel"). Since the // OOo drawing layer is still largely integer-based, the initial // viewport transformation includes a certain scale factor @@ -55,7 +51,28 @@ double convLength( double value, SvgUnit unit, const State& rState, char dir ) case SVG_LENGTH_UNIT_PT: break; case SVG_LENGTH_UNIT_EM: fRet *= rState.mnFontSize; break; case SVG_LENGTH_UNIT_EX: fRet *= rState.mnFontSize / 2.0; break; - case SVG_LENGTH_UNIT_PERCENTAGE: fRet *= fBoxLen; break; + case SVG_LENGTH_UNIT_PERCENTAGE: + { + double fBoxLen; + if (rState.maViewBox.isEmpty()) + { + basegfx::B2DRange aDefaultBox(0, 0, + convLength(210, SVG_LENGTH_UNIT_MM, rState, 'h'), + convLength(297, SVG_LENGTH_UNIT_MM, rState, 'v')); + fBoxLen = (dir=='h' ? aDefaultBox.getWidth() : + (dir=='v' ? aDefaultBox.getHeight() : + aDefaultBox.getRange().getLength())); + } + else + { + fBoxLen = (dir=='h' ? rState.maViewBox.getWidth() : + (dir=='v' ? rState.maViewBox.getHeight() : + rState.maViewBox.getRange().getLength())); + } + + fRet *= fBoxLen/100.0; + } + break; default: OSL_TRACE( "Unknown length type" ); break; } -- cgit From 338bcd091871b9ade5caddfaa9b109ad99a7c332 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 14 Sep 2010 09:56:06 +0200 Subject: svg-import-eh-fix.diff: eat exceptions before they reach unaware code --- filter/source/svg/svgfilter.cxx | 9 ++++++++- filter/source/svg/svgreader.cxx | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 9f3909f14732..984cf32fa912 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -208,7 +208,14 @@ rtl::OUString SAL_CALL SVGFilter::detect( Sequence< PropertyValue >& io_rDescrip class FilterConfigItem; extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL ) { - return importSvg( rStream, rGraphic ); + BOOL bRet = FALSE; + try + { + bRet = importSvg( rStream, rGraphic ); + } + catch (const uno::Exception&) { + } + return bRet; } // ----------------------------------------------------------------------------- diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 0c70c5ff35b0..ffd9e72195e3 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -1796,7 +1796,7 @@ sal_Bool SVGReader::parseAndConvert() { uno::Reference xDomBuilder( m_xServiceFactory->createInstance( - rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), uno::UNO_QUERY ); + rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), uno::UNO_QUERY_THROW ); uno::Reference xDom( xDomBuilder->parse(m_xInputStream), @@ -2702,7 +2702,7 @@ bool importSvg(SvStream & rStream, Graphic & rGraphic ) uno::Reference xDomBuilder( xServiceFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.xml.dom.DocumentBuilder")), - uno::UNO_QUERY ); + uno::UNO_QUERY_THROW ); uno::Reference xStream( new utl::OInputStreamWrapper(rStream) ); -- cgit From aa466b6bb2e71970efebcffb32c5af11d529b1a2 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 09:57:31 +0200 Subject: svg-import-opacity-fix.diff: fixing handling of opacity attribute --- filter/source/svg/gfxtypes.hxx | 2 ++ filter/source/svg/svgreader.cxx | 38 ++++++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/filter/source/svg/gfxtypes.hxx b/filter/source/svg/gfxtypes.hxx index d247b69ec643..fc52b2205865 100644 --- a/filter/source/svg/gfxtypes.hxx +++ b/filter/source/svg/gfxtypes.hxx @@ -174,6 +174,7 @@ struct State mbVisibility(true), meFillType(SOLID), mnFillOpacity(1.0), + mnOpacity(1.0), meStrokeType(NONE), mnStrokeOpacity(1.0), meViewportFillType(NONE), @@ -220,6 +221,7 @@ struct State PaintType meFillType; double mnFillOpacity; + double mnOpacity; PaintType meStrokeType; double mnStrokeOpacity; PaintType meViewportFillType; diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index ffd9e72195e3..7df07f0abdb9 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -519,12 +519,12 @@ struct AnnotatingVisitor rtl::OUString::valueOf( maGradientStopVector[ rState.maFillGradient.maStops[0]].maStopColor.a* - maCurrState.mnFillOpacity*100.0)+USTR("%" ) ); + maCurrState.mnFillOpacity*maCurrState.mnOpacity*100.0)+USTR("%" ) ); xAttrs->AddAttribute( USTR( "draw:start" ), rtl::OUString::valueOf( maGradientStopVector[ rState.maFillGradient.maStops[1]].maStopColor.a* - maCurrState.mnFillOpacity*100.0)+USTR("%" ) ); + maCurrState.mnFillOpacity*maCurrState.mnOpacity*100.0)+USTR("%" ) ); xAttrs->AddAttribute( USTR( "draw:border" ), USTR("0%") ); mxDocumentHandler->startElement( USTR("draw:opacity"), xUnoAttrs ); @@ -616,17 +616,17 @@ struct AnnotatingVisitor xAttrs->AddAttribute( USTR( "draw:opacity-name" ), getStyleName("svgopacity", rState.maFillGradient.mnId) ); } - else if( maCurrState.mnFillOpacity != 1.0 ) + else if( maCurrState.mnFillOpacity*maCurrState.mnOpacity != 1.0 ) xAttrs->AddAttribute( USTR( "draw:opacity" ), - rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity)+USTR("%") ); + rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity*maCurrState.mnOpacity)+USTR("%") ); } else { xAttrs->AddAttribute( USTR( "draw:fill" ), USTR("solid")); xAttrs->AddAttribute( USTR( "draw:fill-color" ), getOdfColor(rState.maFillColor)); - if( maCurrState.mnFillOpacity != 1.0 ) + if( maCurrState.mnFillOpacity*maCurrState.mnOpacity != 1.0 ) xAttrs->AddAttribute( USTR( "draw:opacity" ), - rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity)+USTR("%") ); + rtl::OUString::valueOf(100.0*maCurrState.mnFillOpacity*maCurrState.mnOpacity)+USTR("%") ); } } else @@ -652,9 +652,9 @@ struct AnnotatingVisitor xAttrs->AddAttribute( USTR( "draw:stroke-linejoin"), USTR("round")); else if( maCurrState.meLineJoin == basegfx::B2DLINEJOIN_BEVEL ) xAttrs->AddAttribute( USTR( "draw:stroke-linejoin"), USTR("bevel")); - if( maCurrState.mnStrokeOpacity != 1.0 ) + if( maCurrState.mnStrokeOpacity*maCurrState.mnOpacity != 1.0 ) xAttrs->AddAttribute( USTR("svg:stroke-opacity"), - rtl::OUString::valueOf(100.0*maCurrState.mnStrokeOpacity)+USTR("%")); + rtl::OUString::valueOf(100.0*maCurrState.mnStrokeOpacity*maCurrState.mnOpacity)+USTR("%")); } mxDocumentHandler->startElement( USTR("style:graphic-properties"), @@ -876,6 +876,12 @@ struct AnnotatingVisitor maCurrState.meFillRule = maParentStates.back().meFillRule; break; } + case XML_OPACITY: + if( aValueUtf8 == "inherit" ) + maCurrState.mnOpacity = maParentStates.back().mnOpacity; + else + maCurrState.mnOpacity = aValueUtf8.toDouble(); + break; case XML_FILL_OPACITY: if( aValueUtf8 == "inherit" ) maCurrState.mnFillOpacity = maParentStates.back().mnFillOpacity; @@ -2540,13 +2546,13 @@ struct ShapeRenderingVisitor const BYTE cTransStart( 255- basegfx::fround(mrGradientStopVector[ aState.maFillGradient.maStops[1]].maStopColor.a* - aState.mnFillOpacity*255.0)); + aState.mnFillOpacity*maCurrState.mnOpacity*255.0)); const Color aTransStart( cTransStart, cTransStart, cTransStart ); const BYTE cTransEnd( 255- basegfx::fround(mrGradientStopVector[ aState.maFillGradient.maStops[0]].maStopColor.a* - aState.mnFillOpacity*255.0)); + aState.mnFillOpacity*maCurrState.mnOpacity*255.0)); const Color aTransEnd( cTransEnd, cTransEnd, cTransEnd ); // modulate gradient opacity with overall fill opacity @@ -2594,10 +2600,10 @@ struct ShapeRenderingVisitor else mrOutDev.SetFillColor(getVclColor(aState.maFillColor)); - if( aState.mnFillOpacity != 1.0 ) + if( aState.mnFillOpacity*maCurrState.mnOpacity != 1.0 ) mrOutDev.DrawTransparent(::PolyPolygon(aPoly), basegfx::fround( - (1.0-aState.mnFillOpacity)*100.0)); + (1.0-(aState.mnFillOpacity*maCurrState.mnOpacity))*100.0)); else mrOutDev.DrawPolyPolygon(::PolyPolygon(aPoly)); } @@ -2652,10 +2658,10 @@ struct ShapeRenderingVisitor for( sal_uInt32 i=0; i Date: Tue, 14 Sep 2010 09:58:36 +0200 Subject: svg-import-empty-gradient-fix.diff: guard against empty gradient stops n#560255 --- filter/source/svg/svgreader.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 7df07f0abdb9..dbe70843ffcb 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -308,10 +308,11 @@ struct AnnotatingVisitor bool hasGradientOpacity( const Gradient& rGradient ) { return - maGradientStopVector[ - rGradient.maStops[0]].maStopColor.a != 1.0 || - maGradientStopVector[ - rGradient.maStops[1]].maStopColor.a != 1.0; + !rGradient.maStops.empty() && + (maGradientStopVector[ + rGradient.maStops[0]].maStopColor.a != 1.0 || + maGradientStopVector[ + rGradient.maStops[1]].maStopColor.a != 1.0); } struct StopSorter @@ -2464,10 +2465,11 @@ struct ShapeRenderingVisitor bool hasGradientOpacity( const Gradient& rGradient ) { return - mrGradientStopVector[ - rGradient.maStops[0]].maStopColor.a != 1.0 || - mrGradientStopVector[ - rGradient.maStops[1]].maStopColor.a != 1.0; + !rGradient.maStops.empty() && + (mrGradientStopVector[ + rGradient.maStops[0]].maStopColor.a != 1.0 || + mrGradientStopVector[ + rGradient.maStops[1]].maStopColor.a != 1.0); } sal_Int8 toByteColor( double val ) -- cgit From b50171bab3eaa52ef321be19474f77e8c74b1758 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 10:34:20 +0200 Subject: libwpd.diff: upload new libwpd --- libwpd/makefile.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libwpd/makefile.mk b/libwpd/makefile.mk index abca6ff60019..104d79f19151 100644 --- a/libwpd/makefile.mk +++ b/libwpd/makefile.mk @@ -41,9 +41,8 @@ TARGET=wpd @echo "Using system libwpd..." .ENDIF -TARFILE_NAME=libwpd-0.8.8 -TARFILE_MD5=cd5997284f4ba1e8dde5d1e5869fc342 -PATCH_FILES=$(TARFILE_NAME).diff +TARFILE_NAME=libwpd-0.8.14 +TARFILE_MD5=64d66018897d759358f454010b6e75d2 BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) BUILD_DIR=src$/lib -- cgit From 112477fa8f6ba59dc39aa8a3c00dca0da07197a3 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 10:36:11 +0200 Subject: writerperfect-nocondensedparagraphs.diff: no negative paragraph height. --- writerperfect/source/filter/TextRunStyle.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/writerperfect/source/filter/TextRunStyle.cxx b/writerperfect/source/filter/TextRunStyle.cxx index f3e8b0499956..65f79780f61f 100644 --- a/writerperfect/source/filter/TextRunStyle.cxx +++ b/writerperfect/source/filter/TextRunStyle.cxx @@ -77,7 +77,12 @@ void ParagraphStyle::write(DocumentHandler *pHandler) const if (strcmp(k.key(), "fo:margin-top") == 0) propList.insert("fo:margin-top", k()->getStr()); if (strcmp(k.key(), "fo:margin-bottom") == 0) - propList.insert("fo:margin-bottom", k()->getStr()); + { + if (k()->getFloat() > 0.0f) + propList.insert("fo:margin-bottom", k()->getStr()); + else + propList.insert("fo:margin-bottom", 0.0f); + } if (strcmp(k.key(), "fo:line-height") == 0) propList.insert("fo:line-height", k()->getStr()); if (strcmp(k.key(), "fo:break-before") == 0) -- cgit From 88f6fa6d2fe53dddec061394dfe42f3d9c221707 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 10:50:46 +0200 Subject: win32-pdfimport-use-temporary-file.diff: avoid locking issues on win32 --- sdext/source/pdfimport/pdfiadaptor.cxx | 2 +- sdext/source/pdfimport/wrapper/wrapper.cxx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx index 16af49409fc5..c17d6001d172 100644 --- a/sdext/source/pdfimport/pdfiadaptor.cxx +++ b/sdext/source/pdfimport/pdfiadaptor.cxx @@ -250,7 +250,7 @@ bool PDFIRawAdaptor::parse( const uno::Reference& xInput bool bSuccess=false; - if( xInput.is() && (!rURL.getLength() || rURL.compareToAscii( "file:", 5 ) != 0) ) + if( xInput.is() ) bSuccess = xpdf_ImportFromStream( xInput, pSink, xIHdl, rPwd, m_xContext ); else bSuccess = xpdf_ImportFromFile( rURL, pSink, xIHdl, rPwd, m_xContext ); diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index 51817ce5eacf..59bb3884085f 100755 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -1105,7 +1105,11 @@ bool xpdf_ImportFromStream( const uno::Reference< io::XInputStream >& xI osl_closeFile( aFile ); - return bSuccess && xpdf_ImportFromFile( aURL, rSink, xIHdl, rPwd, xContext ); + if ( bSuccess ) + bSuccess = xpdf_ImportFromFile( aURL, rSink, xIHdl, rPwd, xContext ); + osl_removeFile( aURL.pData ); + + return bSuccess; } } -- cgit From 6e69e849c63d7f44611967fa79133ab6b6bb0bee Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 11:03:41 +0200 Subject: wpsimport-filter.diff: WPS Import filter - filter module changes --- filter/source/config/fragments/fcfg_writer.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filter/source/config/fragments/fcfg_writer.mk b/filter/source/config/fragments/fcfg_writer.mk index 220788049f79..005a9704e267 100644 --- a/filter/source/config/fragments/fcfg_writer.mk +++ b/filter/source/config/fragments/fcfg_writer.mk @@ -18,6 +18,7 @@ T4_WRITER = \ writer_Rich_Text_Format \ writer_StarOffice_XML_Writer \ writer_WordPerfect_Document \ + writer_MS_Works_Document \ writer_T602_Document \ writer_Text \ writer_Text_encoded \ @@ -48,6 +49,7 @@ F4_WRITER = \ Rich_Text_Format \ StarOffice_XML__Writer_ \ WordPerfect \ + MS_Works \ T602Document \ Text \ Text__encoded_ \ -- cgit From fc263c4f068ae706e05d0dc0546400301f381303 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 11:07:30 +0200 Subject: wpsimport-writerperfect.diff: WPS Import filter - core implementation. --- writerperfect/prj/build.lst | 5 ++- writerperfect/prj/d.lst | 4 +- writerperfect/source/filter/DocumentCollector.cxx | 2 +- writerperfect/source/filter/DocumentCollector.hxx | 7 ++-- writerperfect/source/filter/DocumentHandler.cxx | 10 ++--- writerperfect/source/filter/SectionStyle.cxx | 2 +- writerperfect/source/filter/makefile.mk | 12 ++++-- writerperfect/source/stream/WPXSvStream.cxx | 2 +- writerperfect/source/stream/WPXSvStream.h | 3 +- writerperfect/source/stream/makefile.mk | 6 +++ .../source/wpdimp/WordPerfectCollector.cxx | 5 ++- .../source/wpdimp/WordPerfectCollector.hxx | 4 +- writerperfect/source/wpdimp/makefile.mk | 12 ++++-- writerperfect/util/makefile.mk | 47 +++++++++++++++++++--- 14 files changed, 88 insertions(+), 33 deletions(-) diff --git a/writerperfect/prj/build.lst b/writerperfect/prj/build.lst index 3bb3867d8633..d708c33341d0 100644 --- a/writerperfect/prj/build.lst +++ b/writerperfect/prj/build.lst @@ -1,6 +1,7 @@ -wp writerperfect : LIBWPD:libwpd sot comphelper xmloff NULL +wp writerperfect : LIBWPS:libwps LIBWPD:libwpd sot comphelper xmloff svtools NULL wp writerperfect usr1 - all wp_mkout NULL wp writerperfect\source\stream nmake - all wp_stream NULL wp writerperfect\source\filter nmake - all wp_filter NULL wp writerperfect\source\wpdimp nmake - all wp_wpdimp NULL -wp writerperfect\util nmake - all wp_util wp_wpdimp wp_filter wp_stream NULL +wp writerperfect\source\wpsimp nmake - all wp_wpsimp NULL +wp writerperfect\util nmake - all wp_util wp_wpsimp wp_wpdimp wp_filter wp_stream NULL diff --git a/writerperfect/prj/d.lst b/writerperfect/prj/d.lst index 5b5852c6a86f..fb11fa974311 100644 --- a/writerperfect/prj/d.lst +++ b/writerperfect/prj/d.lst @@ -1,4 +1,4 @@ -..\%__SRC%\lib\libwpft*.so %_DEST%\lib%_EXT% -..\%__SRC%\bin\wpft*.dll %_DEST%\bin%_EXT% +..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT% +..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT% ..\%__SRC%\bin\wpftgo.dll %_DEST%\bin%_EXT%\wpftgo.dll ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib diff --git a/writerperfect/source/filter/DocumentCollector.cxx b/writerperfect/source/filter/DocumentCollector.cxx index e258d2212518..e20ce6bca132 100644 --- a/writerperfect/source/filter/DocumentCollector.cxx +++ b/writerperfect/source/filter/DocumentCollector.cxx @@ -58,7 +58,7 @@ _WriterDocumentState::_WriterDocumentState() : { } -DocumentCollector::DocumentCollector(WPXInputStream *pInput, DocumentHandler *pHandler) : +DocumentCollector::DocumentCollector(WPSInputStream *pInput, DocumentHandler *pHandler) : mpInput(pInput), mpHandler(pHandler), mbUsed(false), diff --git a/writerperfect/source/filter/DocumentCollector.hxx b/writerperfect/source/filter/DocumentCollector.hxx index 18ebcdb43418..a1e7fbc6de11 100644 --- a/writerperfect/source/filter/DocumentCollector.hxx +++ b/writerperfect/source/filter/DocumentCollector.hxx @@ -35,6 +35,7 @@ #if defined _MSC_VER #pragma warning( push, 1 ) #endif +#include #include #if defined _MSC_VER #pragma warning( pop ) @@ -82,7 +83,7 @@ struct ltstr class DocumentCollector : public WPXHLListenerImpl { public: - DocumentCollector(WPXInputStream *pInput, DocumentHandler *pHandler); + DocumentCollector(WPSInputStream *pInput, DocumentHandler *pHandler); virtual ~DocumentCollector(); bool filter(); @@ -133,7 +134,7 @@ public: virtual void closeTableCell(); virtual void insertCoveredTableCell(const WPXPropertyList &propList); virtual void closeTable(); - virtual bool parseSourceDocument(WPXInputStream &input) = 0; + virtual bool parseSourceDocument(WPSInputStream &input) = 0; protected: void _resetDocumentState(); @@ -147,7 +148,7 @@ private: void _openListLevel(TagOpenElement *pListLevelOpenElement); void _closeListLevel(const char *szListType); - WPXInputStream *mpInput; + WPSInputStream *mpInput; DocumentHandler *mpHandler; bool mbUsed; // whether or not it has been before (you can only use me once!) diff --git a/writerperfect/source/filter/DocumentHandler.cxx b/writerperfect/source/filter/DocumentHandler.cxx index 5877b8acd5df..a5204c519830 100644 --- a/writerperfect/source/filter/DocumentHandler.cxx +++ b/writerperfect/source/filter/DocumentHandler.cxx @@ -42,19 +42,19 @@ DocumentHandler::DocumentHandler(Reference < XDocumentHandler > &xHandler) : void DocumentHandler::startDocument() { - WRITER_DEBUG_MSG(("DocumentHandler::startDocument")); + WRITER_DEBUG_MSG(("DocumentHandler::startDocument\n")); mxHandler->startDocument(); } void DocumentHandler::endDocument() { - WRITER_DEBUG_MSG(("DocumentHandler::endDocument")); + WRITER_DEBUG_MSG(("DocumentHandler::endDocument\n")); mxHandler->endDocument(); } void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xPropList) { - WRITER_DEBUG_MSG(("DocumentHandler::startElement")); + WRITER_DEBUG_MSG(("DocumentHandler::startElement\n")); SvXMLAttributeList *pAttrList = new SvXMLAttributeList(); Reference < XAttributeList > xAttrList(pAttrList); WPXPropertyList::Iter i(xPropList); @@ -71,13 +71,13 @@ void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xP void DocumentHandler::endElement(const char *psName) { - WRITER_DEBUG_MSG(("DocumentHandler::endElement")); + WRITER_DEBUG_MSG(("DocumentHandler::endElement\n")); mxHandler->endElement(OUString::createFromAscii(psName)); } void DocumentHandler::characters(const WPXString &sCharacters) { - WRITER_DEBUG_MSG(("DocumentHandler::characters")); + WRITER_DEBUG_MSG(("DocumentHandler::characters\n")); OUString sCharU16(sCharacters.cstr(), strlen(sCharacters.cstr()), RTL_TEXTENCODING_UTF8); mxHandler->characters(sCharU16); } diff --git a/writerperfect/source/filter/SectionStyle.cxx b/writerperfect/source/filter/SectionStyle.cxx index 51dd9fc398f1..10e46d3612d2 100644 --- a/writerperfect/source/filter/SectionStyle.cxx +++ b/writerperfect/source/filter/SectionStyle.cxx @@ -33,7 +33,7 @@ #ifdef _MSC_VER double rint(double x); -#endif /* _WIN32 */ +#endif /* _MSC_VER */ SectionStyle::SectionStyle(const WPXPropertyList &xPropList, const WPXPropertyListVector &xColumns, diff --git a/writerperfect/source/filter/makefile.mk b/writerperfect/source/filter/makefile.mk index e535d2aebbe0..a092ce27db2e 100644 --- a/writerperfect/source/filter/makefile.mk +++ b/writerperfect/source/filter/makefile.mk @@ -7,12 +7,16 @@ ENABLE_EXCEPTIONS=true .INCLUDE : settings.mk .IF "$(SYSTEM_LIBWPD)" == "YES" -INCPRE+=$(LIBWPD_CFLAGS) -I.. -.ELSE -# broken but ... necessary, internal include shafted ... -INCPRE+=-I.. +INCPRE+=$(LIBWPD_CFLAGS) +.ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) .ENDIF +# broken but ... necessary, internal include shafted ... +INCPRE+= -I.. + SLOFILES= \ $(SLO)$/DocumentElement.obj \ $(SLO)$/FontStyle.obj \ diff --git a/writerperfect/source/stream/WPXSvStream.cxx b/writerperfect/source/stream/WPXSvStream.cxx index 973fb5ab31d9..0fc62657786c 100644 --- a/writerperfect/source/stream/WPXSvStream.cxx +++ b/writerperfect/source/stream/WPXSvStream.cxx @@ -9,7 +9,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; WPXSvInputStream::WPXSvInputStream( Reference< XInputStream > xStream ) : - WPXInputStream(true), + WPSInputStream(), mxChildStorage(), mxChildStream(), mxStream(xStream), diff --git a/writerperfect/source/stream/WPXSvStream.h b/writerperfect/source/stream/WPXSvStream.h index 099c5a76eccf..f4f3b7eb81ad 100644 --- a/writerperfect/source/stream/WPXSvStream.h +++ b/writerperfect/source/stream/WPXSvStream.h @@ -12,12 +12,13 @@ #if defined _MSC_VER #pragma warning( push, 1 ) #endif +#include #include #if defined _MSC_VER #pragma warning( pop ) #endif -class WPXSvInputStream : public WPXInputStream +class WPXSvInputStream : public WPSInputStream { public: WPXSvInputStream( ::com::sun::star::uno::Reference< diff --git a/writerperfect/source/stream/makefile.mk b/writerperfect/source/stream/makefile.mk index 7e684b71bdb1..97262e7b7486 100644 --- a/writerperfect/source/stream/makefile.mk +++ b/writerperfect/source/stream/makefile.mk @@ -10,6 +10,12 @@ ENABLE_EXCEPTIONS=true INCPRE+=$(LIBWPD_CFLAGS) .ENDIF +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwps +.ENDIF + # broken but ... necessary, internal include shafted ... INCPRE+= -I.. diff --git a/writerperfect/source/wpdimp/WordPerfectCollector.cxx b/writerperfect/source/wpdimp/WordPerfectCollector.cxx index 0bc10cc0ba5b..9d32fdec0333 100644 --- a/writerperfect/source/wpdimp/WordPerfectCollector.cxx +++ b/writerperfect/source/wpdimp/WordPerfectCollector.cxx @@ -30,11 +30,12 @@ #pragma warning( push, 1 ) #endif #include "WordPerfectCollector.hxx" +#include #if defined _MSC_VER #pragma warning( pop ) #endif -WordPerfectCollector::WordPerfectCollector(WPXInputStream *pInput, DocumentHandler *pHandler) : +WordPerfectCollector::WordPerfectCollector(WPSInputStream *pInput, DocumentHandler *pHandler) : DocumentCollector(pInput, pHandler) { } @@ -43,7 +44,7 @@ WordPerfectCollector::~WordPerfectCollector() { } -bool WordPerfectCollector::parseSourceDocument(WPXInputStream &input) +bool WordPerfectCollector::parseSourceDocument(WPSInputStream &input) { WPDResult result = WPDocument::parse(&input, static_cast(this)); if (result != WPD_OK) diff --git a/writerperfect/source/wpdimp/WordPerfectCollector.hxx b/writerperfect/source/wpdimp/WordPerfectCollector.hxx index 400a5ca8c856..95ed7afdda57 100644 --- a/writerperfect/source/wpdimp/WordPerfectCollector.hxx +++ b/writerperfect/source/wpdimp/WordPerfectCollector.hxx @@ -34,8 +34,8 @@ class WordPerfectCollector : public DocumentCollector { public: - WordPerfectCollector(WPXInputStream *pInput, DocumentHandler *pHandler); + WordPerfectCollector(WPSInputStream *pInput, DocumentHandler *pHandler); virtual ~WordPerfectCollector(); - bool parseSourceDocument(WPXInputStream &pInput); + bool parseSourceDocument(WPSInputStream &pInput); }; #endif diff --git a/writerperfect/source/wpdimp/makefile.mk b/writerperfect/source/wpdimp/makefile.mk index bc2a3cda544b..745887eb8588 100644 --- a/writerperfect/source/wpdimp/makefile.mk +++ b/writerperfect/source/wpdimp/makefile.mk @@ -7,12 +7,16 @@ ENABLE_EXCEPTIONS=true .INCLUDE : settings.mk .IF "$(SYSTEM_LIBWPD)" == "YES" -INCPRE+=$(LIBWPD_CFLAGS) -I.. -.ELSE -# broken but ... necessary, internal include shafted ... -INCPRE+=-I.. +INCPRE+=$(LIBWPD_CFLAGS) +.ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) .ENDIF +# broken but ... necessary, internal include shafted ... +INCPRE+= -I.. + SLOFILES= \ $(SLO)$/WordPerfectCollector.obj \ $(SLO)$/WordPerfectImportFilter.obj \ diff --git a/writerperfect/util/makefile.mk b/writerperfect/util/makefile.mk index dca29e005287..56bdfb2c60cb 100644 --- a/writerperfect/util/makefile.mk +++ b/writerperfect/util/makefile.mk @@ -4,18 +4,26 @@ TARGET=writerperfect .INCLUDE : settings.mk -.IF "$(GUI)"=="UNX" + +.IF "$(GUI)"=="UNX" || "$(GUI)$(COM)"=="WNTGCC" + .IF "$(SYSTEM_LIBWPD)" == "YES" LIBWPD=$(LIBWPD_LIBS) .ELSE LIBWPD=-lwpdlib .ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +LIBWPS=$(LIBWPS_LIBS) .ELSE -.IF "$(GUI)$(COM)"=="WNTGCC" -LIBWPD=-lwpdlib -.ELSE - LIBWPD=$(LIBPRE) wpdlib.lib +LIBWPS=-lwpslib .ENDIF + +.ELSE + +LIBWPD=$(LIBPRE) wpdlib.lib +LIBWPS=$(LIBPRE) wpslib.lib + .ENDIF LIB1TARGET= $(SLB)$/wpft.lib @@ -42,4 +50,33 @@ SHL1LIBS = $(LIB1TARGET) SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) + +LIB2TARGET= $(SLB)$/msworks.lib +LIB2FILES= \ + $(SLB)$/stream.lib \ + $(SLB)$/filter.lib \ + $(SLB)$/wpsimp.lib +SHL2LIBS=$(LIB2TARGET) +SHL2STDLIBS+= \ + $(SVLLIB) \ + $(SOTLIB) \ + $(SO2LIB) \ + $(SVTOOLLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(COMPHELPERLIB) \ + $(UCBHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) \ + $(XMLOFFLIB) \ + $(LIBWPS) \ + $(LIBWPD) + +SHL2TARGET = msworks$(DLLPOSTFIX) +SHL2IMPLIB = i$(SHL2TARGET) +SHL2LIBS = $(LIB2TARGET) +SHL2VERSIONMAP = $(SOLARENV)/src/component.map +DEF2NAME = $(SHL2TARGET) + .INCLUDE : target.mk -- cgit From 774bc97f20701342da0cc5b3f0406e48256f82f2 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 11:15:24 +0200 Subject: libwps.diff: WPS Import filter - create a libwps module --- libwpd/makefile.mk | 2 +- libwps/libwps-0.1.1.diff | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ libwps/makefile.mk | 60 +++++++++++++++++++++++++++++++ libwps/prj/build.lst | 3 ++ libwps/prj/d.lst | 6 ++++ 5 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 libwps/libwps-0.1.1.diff create mode 100644 libwps/makefile.mk create mode 100644 libwps/prj/build.lst create mode 100644 libwps/prj/d.lst diff --git a/libwpd/makefile.mk b/libwpd/makefile.mk index 104d79f19151..d12173d79dad 100644 --- a/libwpd/makefile.mk +++ b/libwpd/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # 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 diff --git a/libwps/libwps-0.1.1.diff b/libwps/libwps-0.1.1.diff new file mode 100644 index 000000000000..6977cf33ceec --- /dev/null +++ b/libwps/libwps-0.1.1.diff @@ -0,0 +1,93 @@ +*** misc/libwps-0.1.1/src/lib/WPSListener.h Thu Nov 29 20:58:57 2007 +--- misc/build/libwps-0.1.1/src/lib/WPSListener.h Sun Dec 2 20:54:35 2007 +*************** +*** 39,45 **** + virtual ~WPSListener(); + + bool isUndoOn() { return m_isUndoOn; } +! void setUndoOn(bool isUndoOn) { m_isUndoOn = isUndoOn; } + + std::list &m_pageList; + +--- 39,45 ---- + virtual ~WPSListener(); + + bool isUndoOn() { return m_isUndoOn; } +! void setUndoOn(bool undoOn) { m_isUndoOn = undoOn; } + + std::list &m_pageList; + +*** misc/libwps-0.1.1/src/lib/WPSContentListener.cpp Thu Nov 29 20:58:57 2007 +--- misc/build/libwps-0.1.1/src/lib/WPSContentListener.cpp Sun Dec 2 21:09:11 2007 +*************** +*** 36,62 **** + #define LIBWPS_MAX std::max + #endif + +- namespace { +- +- WPXString doubleToString(const double value) +- { +- WPXString tempString; +- tempString.sprintf("%.4f", value); +- std::string decimalPoint(localeconv()->decimal_point); +- if ((decimalPoint.size() == 0) || (decimalPoint == ".")) +- return tempString; +- std::string stringValue(tempString.cstr()); +- if (!stringValue.empty()) +- { +- std::string::size_type pos; +- while ((pos = stringValue.find(decimalPoint)) != std::string::npos) +- stringValue.replace(pos,decimalPoint.size(),"."); +- } +- return WPXString(stringValue.c_str()); +- } +- +- } // namespace +- + _WPSContentParsingState::_WPSContentParsingState() : + m_textAttributeBits(0), + m_fontSize(12.0f/*WP6_DEFAULT_FONT_SIZE*/), // FIXME ME!!!!!!!!!!!!!!!!!!! HELP WP6_DEFAULT_FONT_SIZE +--- 36,41 ---- +*************** +*** 578,585 **** + _closePageSpan(); + } + +- const float WPS_DEFAULT_SUPER_SUB_SCRIPT = 58.0f; +- + void WPSContentListener::_openSpan() + { + if (!m_ps->m_isParagraphOpened && !m_ps->m_isListElementOpened) +--- 557,562 ---- +*************** +*** 622,639 **** + } + + WPXPropertyList propList; +! if (attributeBits & WPS_SUPERSCRIPT_BIT) { +! WPXString sSuperScript("super "); +! sSuperScript.append(doubleToString(WPS_DEFAULT_SUPER_SUB_SCRIPT)); +! sSuperScript.append("%"); +! propList.insert("style:text-position", sSuperScript); +! } +! else if (attributeBits & WPS_SUBSCRIPT_BIT) { +! WPXString sSubScript("sub "); +! sSubScript.append(doubleToString(WPS_DEFAULT_SUPER_SUB_SCRIPT)); +! sSubScript.append("%"); +! propList.insert("style:text-position", sSubScript); +! } + if (attributeBits & WPS_ITALICS_BIT) + propList.insert("fo:font-style", "italic"); + if (attributeBits & WPS_BOLD_BIT) +--- 599,608 ---- + } + + WPXPropertyList propList; +! if (m_ps->m_textAttributeBits & WPS_SUPERSCRIPT_BIT) +! propList.insert("style:text-position", "super 58%"); +! else if (m_ps->m_textAttributeBits & WPS_SUBSCRIPT_BIT) +! propList.insert("style:text-position", "sub 58%"); + if (attributeBits & WPS_ITALICS_BIT) + propList.insert("fo:font-style", "italic"); + if (attributeBits & WPS_BOLD_BIT) diff --git a/libwps/makefile.mk b/libwps/makefile.mk new file mode 100644 index 000000000000..3d9cefe0f4ed --- /dev/null +++ b/libwps/makefile.mk @@ -0,0 +1,60 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=. + +PRJNAME=wps +TARGET=wps + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- + +.IF "$(SYSTEM_LIBWPS)" == "YES" +@all: + @echo "Using system libwps..." +.ENDIF + +# libwps depends on the libwpd framework +.IF "$(SYSTEM_LIBWPD)" == "YES" +INCPRE+=$(LIBWPD_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd +.ENDIF + +TARFILE_NAME=libwps-0.1.2 +TARFILE_MD5=799fc3b835a79adce8c88a3fee0150c1 +BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) +BUILD_DIR=src/lib + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk diff --git a/libwps/prj/build.lst b/libwps/prj/build.lst new file mode 100644 index 000000000000..85004e1c9759 --- /dev/null +++ b/libwps/prj/build.lst @@ -0,0 +1,3 @@ +lwps libwps : LIBWPD:libwpd soltools NULL +lwps libwps usr1 - all lwps_mkout NULL +lwps libwps nmake - all lwps_libwps NULL diff --git a/libwps/prj/d.lst b/libwps/prj/d.lst new file mode 100644 index 000000000000..fe897d7fd386 --- /dev/null +++ b/libwps/prj/d.lst @@ -0,0 +1,6 @@ +mkdir: %_DEST%\inc%_EXT%\libwps +..\%__SRC%\misc\build\libwps*\src\lib\libwps.h %_DEST%\inc%_EXT%\libwps\ +..\%__SRC%\misc\build\libwps*\src\lib\WPSStream.h %_DEST%\inc%_EXT%\libwps\ +..\%__SRC%\misc\build\libwps*\src\lib\WPSDocument.h %_DEST%\inc%_EXT%\libwps\ +..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a +..\%__SRC%\slb\*.lib %_DEST%\lib%_EXT%\*.lib -- cgit From ba38cd2089911917c2cf6e4fdda6ae488df19dd4 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 11:26:04 +0200 Subject: libwpg.diff: WPG Import filter - create a libwpg module. --- libwpg/makefile.mk | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libwpg/prj/build.lst | 3 +++ libwpg/prj/d.lst | 16 ++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 libwpg/makefile.mk create mode 100644 libwpg/prj/build.lst create mode 100644 libwpg/prj/d.lst diff --git a/libwpg/makefile.mk b/libwpg/makefile.mk new file mode 100644 index 000000000000..424fd9896c0c --- /dev/null +++ b/libwpg/makefile.mk @@ -0,0 +1,60 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=. + +PRJNAME=wpg +TARGET=wpg + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- + +.IF "$(SYSTEM_LIBWPG)" == "YES" +@all: + @echo "Using system libwpg..." +.ENDIF + +# libwpg depends on the libwpd framework +.IF "$(SYSTEM_LIBWPD)" == "YES" +INCPRE+=$(LIBWPD_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd +.ENDIF + +TARFILE_NAME=libwpg-0.1.3 +TARFILE_MD5=db556b750bf3eac8481a4cc5e29e5af1 +BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) +BUILD_DIR=src/lib + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk diff --git a/libwpg/prj/build.lst b/libwpg/prj/build.lst new file mode 100644 index 000000000000..d54a1d9df0f2 --- /dev/null +++ b/libwpg/prj/build.lst @@ -0,0 +1,3 @@ +lwpg libwpg : LIBWPD:libwpd soltools NULL +lwpg libwpg usr1 - all lwpg_mkout NULL +lwpg libwpg nmake - all lwpg_libwpg NULL diff --git a/libwpg/prj/d.lst b/libwpg/prj/d.lst new file mode 100644 index 000000000000..d01a25a0c772 --- /dev/null +++ b/libwpg/prj/d.lst @@ -0,0 +1,16 @@ +mkdir: %_DEST%\inc%_EXT%\libwpg +..\%__SRC%\misc\build\libwpg*\src\lib\libwpg.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGBitmap.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGBinaryData.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGBrush.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGColor.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGGradient.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGPaintInterface.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGPath.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGPen.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGPoint.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGraphics.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGRect.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\misc\build\libwpg*\src\lib\WPGString.h %_DEST%\inc%_EXT%\libwpg\ +..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a +..\%__SRC%\slb\*.lib %_DEST%\lib%_EXT%\*.lib -- cgit From 9347f606ec8b85921c3a609befc2fa8005f89459 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 11:30:28 +0200 Subject: wpgimporter.diff: WPG Import filter --- filter/source/config/fragments/fcfg_draw.mk | 7 +++-- writerperfect/prj/build.lst | 5 ++-- writerperfect/source/filter/DocumentHandler.cxx | 2 +- writerperfect/util/makefile.mk | 35 +++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/filter/source/config/fragments/fcfg_draw.mk b/filter/source/config/fragments/fcfg_draw.mk index d6e6d9caad54..71d6b0b119f2 100644 --- a/filter/source/config/fragments/fcfg_draw.mk +++ b/filter/source/config/fragments/fcfg_draw.mk @@ -7,7 +7,8 @@ T4_DRAW = \ draw_StarOffice_XML_Draw_Template \ pdf_Portable_Document_Format\ draw8 \ - draw8_template + draw8_template \ + draw_WordPerfect_Graphics # ----------------------------------------------- # count = 9 @@ -16,7 +17,9 @@ F4_DRAW = \ draw_StarOffice_XML_Draw_Template \ draw_pdf_Export \ draw8 \ - draw8_template + draw8_template \ + WordPerfectGraphics + # ----------------------------------------------- # count = 4 diff --git a/writerperfect/prj/build.lst b/writerperfect/prj/build.lst index d708c33341d0..bf7a656a1f2f 100644 --- a/writerperfect/prj/build.lst +++ b/writerperfect/prj/build.lst @@ -1,7 +1,8 @@ -wp writerperfect : LIBWPS:libwps LIBWPD:libwpd sot comphelper xmloff svtools NULL +wp writerperfect : LIBWPG:libwpg LIBWPS:libwps LIBWPD:libwpd sot comphelper xmloff svtools NULL wp writerperfect usr1 - all wp_mkout NULL wp writerperfect\source\stream nmake - all wp_stream NULL wp writerperfect\source\filter nmake - all wp_filter NULL wp writerperfect\source\wpdimp nmake - all wp_wpdimp NULL wp writerperfect\source\wpsimp nmake - all wp_wpsimp NULL -wp writerperfect\util nmake - all wp_util wp_wpsimp wp_wpdimp wp_filter wp_stream NULL +wp writerperfect\source\wpgimp nmake - all wp_wpgimp NULL +wp writerperfect\util nmake - all wp_util wp_wpgimp wp_wpsimp wp_wpdimp wp_filter wp_stream NULL diff --git a/writerperfect/source/filter/DocumentHandler.cxx b/writerperfect/source/filter/DocumentHandler.cxx index a5204c519830..71dd370c96fb 100644 --- a/writerperfect/source/filter/DocumentHandler.cxx +++ b/writerperfect/source/filter/DocumentHandler.cxx @@ -61,7 +61,7 @@ void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xP for (i.rewind(); i.next(); ) { // filter out libwpd elements - if (strlen(i.key()) > 6 && strncmp(i.key(), "libwpd", 6) != 0) + if (strncmp(i.key(), "libwpd", 6) != 0) pAttrList->AddAttribute(OUString::createFromAscii(i.key()), OUString::createFromAscii(i()->getStr().cstr())); } diff --git a/writerperfect/util/makefile.mk b/writerperfect/util/makefile.mk index 56bdfb2c60cb..35daf5e9b3bf 100644 --- a/writerperfect/util/makefile.mk +++ b/writerperfect/util/makefile.mk @@ -19,10 +19,17 @@ LIBWPS=$(LIBWPS_LIBS) LIBWPS=-lwpslib .ENDIF +.IF "$(SYSTEM_LIBWPG)" == "YES" +LIBWPG=$(LIBWPG_LIBS) +.ELSE +LIBWPG=-lwpglib +.ENDIF + .ELSE LIBWPD=$(LIBPRE) wpdlib.lib LIBWPS=$(LIBPRE) wpslib.lib +LIBWPG=$(LIBPRE) wpglib.lib .ENDIF @@ -79,4 +86,32 @@ SHL2LIBS = $(LIB2TARGET) SHL2VERSIONMAP = $(SOLARENV)/src/component.map DEF2NAME = $(SHL2TARGET) +LIB3TARGET= $(SLB)$/wpgimport.lib +LIB3FILES= \ + $(SLB)$/stream.lib \ + $(SLB)$/filter.lib \ + $(SLB)$/wpgimp.lib +SHL3LIBS=$(LIB3TARGET) +SHL3STDLIBS+= \ + $(SVLLIB) \ + $(SOTLIB) \ + $(SO2LIB) \ + $(SVTOOLLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(COMPHELPERLIB) \ + $(UCBHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) \ + $(XMLOFFLIB) \ + $(LIBWPD) \ + $(LIBWPG) + +SHL3TARGET = wpgimport$(DLLPOSTFIX) +SHL3IMPLIB = i$(SHL3TARGET) +SHL3LIBS = $(LIB3TARGET) +SHL3VERSIONMAP = $(SOLARENV)/src/component.map +DEF3NAME = $(SHL3TARGET) + .INCLUDE : target.mk -- cgit From 23cf3c4595d7969cdb09d262c85f34972b0f74a8 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 11:41:58 +0200 Subject: internal-mesa-headers-mesa.diff: Create mesa module for use with transogl. --- Mesa/inc/gl.h | 2252 +++++++++++++++ Mesa/inc/gl_mangle.h | 1568 +++++++++++ Mesa/inc/glext.h | 7271 +++++++++++++++++++++++++++++++++++++++++++++++++ Mesa/inc/glu.h | 348 +++ Mesa/inc/glu_mangle.h | 86 + Mesa/inc/glx.h | 500 ++++ Mesa/inc/glx_mangle.h | 81 + Mesa/inc/glxext.h | 785 ++++++ Mesa/inc/vms_x_fix.h | 1224 +++++++++ Mesa/prj/build.lst | 3 + Mesa/prj/d.lst | 3 + 11 files changed, 14121 insertions(+) create mode 100644 Mesa/inc/gl.h create mode 100644 Mesa/inc/gl_mangle.h create mode 100644 Mesa/inc/glext.h create mode 100644 Mesa/inc/glu.h create mode 100644 Mesa/inc/glu_mangle.h create mode 100644 Mesa/inc/glx.h create mode 100644 Mesa/inc/glx_mangle.h create mode 100644 Mesa/inc/glxext.h create mode 100644 Mesa/inc/vms_x_fix.h create mode 100644 Mesa/prj/build.lst create mode 100644 Mesa/prj/d.lst diff --git a/Mesa/inc/gl.h b/Mesa/inc/gl.h new file mode 100644 index 000000000000..b427637e6ece --- /dev/null +++ b/Mesa/inc/gl.h @@ -0,0 +1,2252 @@ +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef __gl_h_ +#define __gl_h_ + +#if defined(USE_MGL_NAMESPACE) +#include "gl_mangle.h" +#endif + + +/********************************************************************** + * Begin system-specific stuff. Do not do any of this when building + * for SciTech SNAP, as this is all done before this header file is + * included. + */ +#if !defined(__SCITECH_SNAP__) + +#if defined(__BEOS__) +#include /* to get some BeOS-isms */ +#endif + +#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO)) +#define OPENSTEP +#endif + +#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) +#define __WIN32__ +#endif + +#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# endif /* _STATIC_MESA support */ +# define GLAPIENTRY __stdcall +#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ +# define GLAPI extern +# define GLAPIENTRY __stdcall +#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +# define GLAPI __attribute__((visibility("default"))) +# define GLAPIENTRY +#endif /* WIN32 && !CYGWIN */ + +#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) +# define PRAGMA_EXPORT_SUPPORTED 1 +#endif + +/* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by + * including only glut.h, since glut.h depends on windows.h. + * Applications needing to include windows.h with parms other + * than "WIN32_LEAN_AND_MEAN" may include windows.h before + * glut.h or gl.h. + */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) \ + && !defined(OPENSTEP) && !defined(__CYGWIN__) || defined(__MINGW32__) +#include +#endif + +#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED +#pragma import on +#endif + +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY +#endif + +/* "P" suffix to be used for a pointer to a function */ +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * +#endif + +#ifdef CENTERLINE_CLPP +#define signed +#endif + +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export on +#endif + +#endif /* !__SCITECH_SNAP__ */ +/* + * End system-specific stuff. + **********************************************************************/ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_ARB_imaging 1 + + +/* + * Datatypes + */ +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; /* 1-byte signed */ +typedef short GLshort; /* 2-byte signed */ +typedef int GLint; /* 4-byte signed */ +typedef unsigned char GLubyte; /* 1-byte unsigned */ +typedef unsigned short GLushort; /* 2-byte unsigned */ +typedef unsigned int GLuint; /* 4-byte unsigned */ +typedef int GLsizei; /* 4-byte signed */ +typedef float GLfloat; /* single precision float */ +typedef float GLclampf; /* single precision float in [0,1] */ +typedef double GLdouble; /* double precision float */ +typedef double GLclampd; /* double precision float in [0,1] */ + + + +/* + * Constants + */ + +/* Boolean values */ +#define GL_FALSE 0x0 +#define GL_TRUE 0x1 + +/* Data types */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A + +/* Primitives */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 + +/* Vertex Arrays */ +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D + +/* Matrix Mode */ +#define GL_MATRIX_MODE 0x0BA0 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* Points */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_POINT_SIZE_RANGE 0x0B12 + +/* Lines */ +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_WIDTH_RANGE 0x0B22 + +/* Polygons */ +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 + +/* Display Lists */ +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_LIST_MODE 0x0B30 + +/* Depth buffer */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_BITS 0x0D56 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_COMPONENT 0x1902 + +/* Lighting */ +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_SHININESS 0x1601 +#define GL_EMISSION 0x1600 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_SHADE_MODEL 0x0B54 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_NORMALIZE 0x0BA1 + +/* User clipping planes */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* Accumulation buffer */ +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_ACCUM 0x0100 +#define GL_ADD 0x0104 +#define GL_LOAD 0x0101 +#define GL_MULT 0x0103 +#define GL_RETURN 0x0102 + +/* Alpha testing */ +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_ALPHA_TEST_FUNC 0x0BC1 + +/* Blending */ +#define GL_BLEND 0x0BE2 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND_DST 0x0BE0 +#define GL_ZERO 0x0 +#define GL_ONE 0x1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 + +/* Render Mode */ +#define GL_FEEDBACK 0x1C01 +#define GL_RENDER 0x1C00 +#define GL_SELECT 0x1C02 + +/* Feedback */ +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 + +/* Selection */ +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 + +/* Fog */ +#define GL_FOG 0x0B60 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_COLOR 0x0B66 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_LINEAR 0x2601 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* Logic Ops */ +#define GL_LOGIC_OP 0x0BF1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_CLEAR 0x1500 +#define GL_SET 0x150F +#define GL_COPY 0x1503 +#define GL_COPY_INVERTED 0x150C +#define GL_NOOP 0x1505 +#define GL_INVERT 0x150A +#define GL_AND 0x1501 +#define GL_NAND 0x150E +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_XOR 0x1506 +#define GL_EQUIV 0x1509 +#define GL_AND_REVERSE 0x1502 +#define GL_AND_INVERTED 0x1504 +#define GL_OR_REVERSE 0x150B +#define GL_OR_INVERTED 0x150D + +/* Stencil */ +#define GL_STENCIL_BITS 0x0D57 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_INDEX 0x1901 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 + +/* Buffers, Pixel Drawing/Reading */ +#define GL_NONE 0x0 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +/*GL_FRONT 0x0404 */ +/*GL_BACK 0x0405 */ +/*GL_FRONT_AND_BACK 0x0408 */ +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_COLOR_INDEX 0x1900 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_ALPHA_BITS 0x0D55 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_INDEX_BITS 0x0D51 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_READ_BUFFER 0x0C02 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_BITMAP 0x1A00 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_DITHER 0x0BD0 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 + +/* Implementation limits */ +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B + +/* Gets */ +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_MODE 0x0C30 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_RENDER_MODE 0x0C40 +#define GL_RGBA_MODE 0x0C31 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_VIEWPORT 0x0BA2 + +/* Evaluators */ +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 + +/* Hints */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* Scissor box */ +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 + +/* Pixel Mode / Transfer */ +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 + +/* Texture mapping */ +#define GL_TEXTURE_ENV 0x2300 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_LINEAR 0x2400 +#define GL_EYE_PLANE 0x2502 +#define GL_SPHERE_MAP 0x2402 +#define GL_DECAL 0x2101 +#define GL_MODULATE 0x2100 +#define GL_NEAREST 0x2600 +#define GL_REPEAT 0x2901 +#define GL_CLAMP 0x2900 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 + +/* Utility */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* Errors */ +#define GL_NO_ERROR 0x0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* glPush/PopAttrib bits */ +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000FFFFF + + +/* OpenGL 1.1 */ +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + + + +/* + * Miscellaneous + */ + +GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); + +GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glClear( GLbitfield mask ); + +GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); + +GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); + +GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); + +GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); + +GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); + +GLAPI void GLAPIENTRY glCullFace( GLenum mode ); + +GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); + +GLAPI void GLAPIENTRY glPointSize( GLfloat size ); + +GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); + +GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); + +GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); + +GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); + +GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); + +GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); + +GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); + +GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); + +GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); + +GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); + +GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); + +GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glEnable( GLenum cap ); + +GLAPI void GLAPIENTRY glDisable( GLenum cap ); + +GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); + + +GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ + +GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ + + +GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); + +GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); + +GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); + +GLAPI void GLAPIENTRY glPopAttrib( void ); + + +GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ + +GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ + + +GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); + +GLAPI GLenum GLAPIENTRY glGetError( void ); + +GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); + +GLAPI void GLAPIENTRY glFinish( void ); + +GLAPI void GLAPIENTRY glFlush( void ); + +GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); + + +/* + * Depth Buffer + */ + +GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); + +GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); + +GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); + +GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); + + +/* + * Accumulation Buffer + */ + +GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); + +GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); + + +/* + * Transformation + */ + +GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); + +GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, + GLsizei width, GLsizei height ); + +GLAPI void GLAPIENTRY glPushMatrix( void ); + +GLAPI void GLAPIENTRY glPopMatrix( void ); + +GLAPI void GLAPIENTRY glLoadIdentity( void ); + +GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glRotated( GLdouble angle, + GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRotatef( GLfloat angle, + GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); + + +/* + * Display Lists + */ + +GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); + +GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); + +GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); + +GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); + +GLAPI void GLAPIENTRY glEndList( void ); + +GLAPI void GLAPIENTRY glCallList( GLuint list ); + +GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, + const GLvoid *lists ); + +GLAPI void GLAPIENTRY glListBase( GLuint base ); + + +/* + * Drawing Functions + */ + +GLAPI void GLAPIENTRY glBegin( GLenum mode ); + +GLAPI void GLAPIENTRY glEnd( void ); + + +GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); +GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); +GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); +GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); + +GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); +GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glIndexd( GLdouble c ); +GLAPI void GLAPIENTRY glIndexf( GLfloat c ); +GLAPI void GLAPIENTRY glIndexi( GLint c ); +GLAPI void GLAPIENTRY glIndexs( GLshort c ); +GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); +GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); +GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); +GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); +GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); +GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); +GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); +GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); +GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); +GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); +GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); +GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); + +GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, + GLbyte blue, GLbyte alpha ); +GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, + GLdouble blue, GLdouble alpha ); +GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); +GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, + GLint blue, GLint alpha ); +GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, + GLshort blue, GLshort alpha ); +GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha ); +GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, + GLuint blue, GLuint alpha ); +GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, + GLushort blue, GLushort alpha ); + + +GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); + +GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); + + +GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); +GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); +GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); +GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); + +GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); +GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); +GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); +GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); +GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); +GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); +GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); +GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); +GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); +GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); + + +GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); +GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); +GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); +GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); + + +/* + * Vertex Arrays (1.1) + */ + +GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); + +GLAPI void GLAPIENTRY glArrayElement( GLint i ); + +GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); + +GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, + const GLvoid *pointer ); + +/* + * Lighting + */ + +GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); + +GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, + GLfloat *params ); +GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); + + +/* + * Raster functions + */ + +GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); + +GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, + const GLfloat *values ); +GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, + const GLuint *values ); +GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, + const GLushort *values ); + +GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); +GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); +GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); + +GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, + GLfloat xorig, GLfloat yorig, + GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap ); + +GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLvoid *pixels ); + +GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type ); + +/* + * Stenciling + */ + +GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); + +GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); + +GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); + +GLAPI void GLAPIENTRY glClearStencil( GLint s ); + + + +/* + * Texture mapping + */ + +GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); +GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, + GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, + GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, + GLvoid *pixels ); + + +/* 1.1 functions */ + +GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, + const GLuint *textures, + const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, + const GLuint *textures, + GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); + + +GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, + GLint xoffset, + GLsizei width, GLenum format, + GLenum type, const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height ); + + +/* + * Evaluators + */ + +GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, + GLint stride, + GLint order, const GLdouble *points ); +GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, + GLint stride, + GLint order, const GLfloat *points ); + +GLAPI void GLAPIENTRY glMap2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ); +GLAPI void GLAPIENTRY glMap2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ); + +GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); +GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); +GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); + +GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); +GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); + +GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); +GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); + +GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); + +GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ); +GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ); + +GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); + +GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); + +GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); + +GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); + + +/* + * Fog + */ + +GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); + +GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); + +GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); + + +/* + * Selection and Feedback + */ + +GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); + +GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); + +GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); + +GLAPI void GLAPIENTRY glInitNames( void ); + +GLAPI void GLAPIENTRY glLoadName( GLuint name ); + +GLAPI void GLAPIENTRY glPushName( GLuint name ); + +GLAPI void GLAPIENTRY glPopName( void ); + + + +/* + * OpenGL 1.2 + */ + +#define GL_RESCALE_NORMAL 0x803A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A + +GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, + GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, + GLenum format, + GLenum type, const GLvoid *pixels); + +GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLint x, + GLint y, GLsizei width, + GLsizei height ); + +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + + +/* + * GL_ARB_imaging + */ + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 + + +GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, + GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTable( GLenum target, + GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *data ); + +GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, + const GLint *params); + +GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, + const GLfloat *params); + +GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); + +GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, + GLenum internalformat, GLboolean sink ); + +GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); + +GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, + GLenum format, GLenum type, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, + GLboolean sink ); + +GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); + +GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, + GLenum format, GLenum types, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, + GLenum internalformat, GLsizei width, GLenum format, GLenum type, + const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, + GLfloat params ); + +GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); + +GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, + GLint params ); + +GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width, + GLsizei height); + +GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, + GLenum type, GLvoid *image ); + +GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *row, const GLvoid *column ); + +GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, + GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); + +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); + + + +/* + * OpenGL 1.3 + */ + +/* multitexture */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +/* texture_cube_map */ +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +/* texture_compression */ +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +/* multisample */ +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +/* transpose_matrix */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +/* texture_env_combine */ +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +/* texture_env_dot3 */ +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +/* texture_border_clamp */ +#define GL_CLAMP_TO_BORDER 0x812D + +GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); + +GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); + + +GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); + +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); + + +/* + * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) + */ +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#endif /* GL_ARB_multitexture */ + + + +/* + * Define this token if you want "old-style" header file behaviour (extensions + * defined in gl.h). Otherwise, extensions will be included from glext.h. + */ +#if defined(GL_GLEXT_LEGACY) + +/* All extensions that used to be here are now found in glext.h */ + +#else /* GL_GLEXT_LEGACY */ + +#include + +#endif /* GL_GLEXT_LEGACY */ + + + +#if GL_ARB_shader_objects + +#ifndef GL_MESA_shader_debug +#define GL_MESA_shader_debug 1 + +#define GL_DEBUG_OBJECT_MESA 0x8759 +#define GL_DEBUG_PRINT_MESA 0x875A +#define GL_DEBUG_ASSERT_MESA 0x875B + +GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void); +GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); +GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, + GLsizei *length, GLcharARB *debugLog); +GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); + +#endif /* GL_MESA_shader_debug */ + +#endif /* GL_ARB_shader_objects */ + + +/* + * ???. GL_MESA_packed_depth_stencil + * XXX obsolete + */ +#ifndef GL_MESA_packed_depth_stencil +#define GL_MESA_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_MESA 0x8750 +#define GL_UNSIGNED_INT_24_8_MESA 0x8751 +#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 +#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 +#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +#endif /* GL_MESA_packed_depth_stencil */ + + +#ifndef GL_MESA_program_debug +#define GL_MESA_program_debug 1 + +#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0 +#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1 +#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2 +#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3 +#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4 +#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5 +#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6 +#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7 + +typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); + +GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); + +GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); + +#endif /* GL_MESA_program_debug */ + + +#ifndef GL_ATI_blend_equation_separate +#define GL_ATI_blend_equation_separate 1 + +#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D + +GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); + +#endif /* GL_ATI_blend_equation_separate */ + + + +/** + ** NOTE!!!!! If you add new functions to this file, or update + ** glext.h be sure to regenerate the gl_mangle.h file. See comments + ** in that file for details. + **/ + + + +/********************************************************************** + * Begin system-specific stuff + */ +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export off +#endif + +#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED +#pragma import off +#endif +/* + * End system-specific stuff + **********************************************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ diff --git a/Mesa/inc/gl_mangle.h b/Mesa/inc/gl_mangle.h new file mode 100644 index 000000000000..369b8a0fc6d5 --- /dev/null +++ b/Mesa/inc/gl_mangle.h @@ -0,0 +1,1568 @@ +#if 0 +#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output" +#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names" + files="gl.h glext.h" +#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line" + awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0 + echo "" +#define GL_MANGLE_C4 get aliases + grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq + echo "" + echo "#endif /* GL_MANGLE_H */" + exit +#endif /* REGENERATION */ + +/* + * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link + * your application both with OpenGL and Mesa. The Mesa functions will + * be redefined so they are prefixed with "mgl" instead of "gl". + * Mgl contributed by Randy Frank (rfrank@rsinc.com) + * Regneration code contributed by Ray Tice (rayt@ma.ultra.net) + */ + +#ifndef GL_MANGLE_H +#define GL_MANGLE_H + +#ifndef MANGLE +#define MANGLE(x) mgl##x +#endif /*MANGLE*/ + +/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */ + +#define glAccum MANGLE(Accum) +#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT) +#define glActiveTextureARB MANGLE(ActiveTextureARB) +#define glActiveTexture MANGLE(ActiveTexture) +#define glActiveVaryingNV MANGLE(ActiveVaryingNV) +#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI) +#define glAlphaFunc MANGLE(AlphaFunc) +#define glApplyTextureEXT MANGLE(ApplyTextureEXT) +#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV) +#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT) +#define glAreTexturesResident MANGLE(AreTexturesResident) +#define glArrayElementEXT MANGLE(ArrayElementEXT) +#define glArrayElement MANGLE(ArrayElement) +#define glArrayObjectATI MANGLE(ArrayObjectATI) +#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX) +#define glAttachObjectARB MANGLE(AttachObjectARB) +#define glAttachShader MANGLE(AttachShader) +#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) +#define glBegin MANGLE(Begin) +#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV) +#define glBeginQueryARB MANGLE(BeginQueryARB) +#define glBeginQuery MANGLE(BeginQuery) +#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV) +#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) +#define glBindAttribLocationARB MANGLE(BindAttribLocationARB) +#define glBindAttribLocation MANGLE(BindAttribLocation) +#define glBindBufferARB MANGLE(BindBufferARB) +#define glBindBufferBaseNV MANGLE(BindBufferBaseNV) +#define glBindBuffer MANGLE(BindBuffer) +#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV) +#define glBindBufferRangeNV MANGLE(BindBufferRangeNV) +#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT) +#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) +#define glBindFramebufferEXT MANGLE(BindFramebufferEXT) +#define glBindLightParameterEXT MANGLE(BindLightParameterEXT) +#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT) +#define glBindParameterEXT MANGLE(BindParameterEXT) +#define glBindProgramARB MANGLE(BindProgramARB) +#define glBindProgramNV MANGLE(BindProgramNV) +#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT) +#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT) +#define glBindTextureEXT MANGLE(BindTextureEXT) +#define glBindTexture MANGLE(BindTexture) +#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT) +#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE) +#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT) +#define glBinormal3bEXT MANGLE(Binormal3bEXT) +#define glBinormal3bvEXT MANGLE(Binormal3bvEXT) +#define glBinormal3dEXT MANGLE(Binormal3dEXT) +#define glBinormal3dvEXT MANGLE(Binormal3dvEXT) +#define glBinormal3fEXT MANGLE(Binormal3fEXT) +#define glBinormal3fvEXT MANGLE(Binormal3fvEXT) +#define glBinormal3iEXT MANGLE(Binormal3iEXT) +#define glBinormal3ivEXT MANGLE(Binormal3ivEXT) +#define glBinormal3sEXT MANGLE(Binormal3sEXT) +#define glBinormal3svEXT MANGLE(Binormal3svEXT) +#define glBinormalPointerEXT MANGLE(BinormalPointerEXT) +#define glBitmap MANGLE(Bitmap) +#define glBlendColorEXT MANGLE(BlendColorEXT) +#define glBlendColor MANGLE(BlendColor) +#define glBlendEquationEXT MANGLE(BlendEquationEXT) +#define glBlendEquation MANGLE(BlendEquation) +#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI) +#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT) +#define glBlendEquationSeparate MANGLE(BlendEquationSeparate) +#define glBlendFunc MANGLE(BlendFunc) +#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT) +#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) +#define glBlendFuncSeparate MANGLE(BlendFuncSeparate) +#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT) +#define glBufferDataARB MANGLE(BufferDataARB) +#define glBufferData MANGLE(BufferData) +#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE) +#define glBufferSubDataARB MANGLE(BufferSubDataARB) +#define glBufferSubData MANGLE(BufferSubData) +#define glCallList MANGLE(CallList) +#define glCallLists MANGLE(CallLists) +#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT) +#define glClampColorARB MANGLE(ClampColorARB) +#define glClearAccum MANGLE(ClearAccum) +#define glClearColorIiEXT MANGLE(ClearColorIiEXT) +#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT) +#define glClearColor MANGLE(ClearColor) +#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA) +#define glClearDepthdNV MANGLE(ClearDepthdNV) +#define glClearDepth MANGLE(ClearDepth) +#define glClearIndex MANGLE(ClearIndex) +#define glClear MANGLE(Clear) +#define glClearStencil MANGLE(ClearStencil) +#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB) +#define glClientActiveTexture MANGLE(ClientActiveTexture) +#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI) +#define glClipPlane MANGLE(ClipPlane) +#define glColor3b MANGLE(Color3b) +#define glColor3bv MANGLE(Color3bv) +#define glColor3d MANGLE(Color3d) +#define glColor3dv MANGLE(Color3dv) +#define glColor3f MANGLE(Color3f) +#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN) +#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN) +#define glColor3fv MANGLE(Color3fv) +#define glColor3hNV MANGLE(Color3hNV) +#define glColor3hvNV MANGLE(Color3hvNV) +#define glColor3i MANGLE(Color3i) +#define glColor3iv MANGLE(Color3iv) +#define glColor3s MANGLE(Color3s) +#define glColor3sv MANGLE(Color3sv) +#define glColor3ub MANGLE(Color3ub) +#define glColor3ubv MANGLE(Color3ubv) +#define glColor3ui MANGLE(Color3ui) +#define glColor3uiv MANGLE(Color3uiv) +#define glColor3us MANGLE(Color3us) +#define glColor3usv MANGLE(Color3usv) +#define glColor4b MANGLE(Color4b) +#define glColor4bv MANGLE(Color4bv) +#define glColor4d MANGLE(Color4d) +#define glColor4dv MANGLE(Color4dv) +#define glColor4f MANGLE(Color4f) +#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN) +#define glColor4fv MANGLE(Color4fv) +#define glColor4hNV MANGLE(Color4hNV) +#define glColor4hvNV MANGLE(Color4hvNV) +#define glColor4i MANGLE(Color4i) +#define glColor4iv MANGLE(Color4iv) +#define glColor4s MANGLE(Color4s) +#define glColor4sv MANGLE(Color4sv) +#define glColor4ub MANGLE(Color4ub) +#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN) +#define glColor4ubv MANGLE(Color4ubv) +#define glColor4ui MANGLE(Color4ui) +#define glColor4uiv MANGLE(Color4uiv) +#define glColor4us MANGLE(Color4us) +#define glColor4usv MANGLE(Color4usv) +#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI) +#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI) +#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI) +#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT) +#define glColorMask MANGLE(ColorMask) +#define glColorMaterial MANGLE(ColorMaterial) +#define glColorPointerEXT MANGLE(ColorPointerEXT) +#define glColorPointerListIBM MANGLE(ColorPointerListIBM) +#define glColorPointer MANGLE(ColorPointer) +#define glColorPointervINTEL MANGLE(ColorPointervINTEL) +#define glColorSubTableEXT MANGLE(ColorSubTableEXT) +#define glColorSubTable MANGLE(ColorSubTable) +#define glColorTableEXT MANGLE(ColorTableEXT) +#define glColorTable MANGLE(ColorTable) +#define glColorTableParameterfv MANGLE(ColorTableParameterfv) +#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI) +#define glColorTableParameteriv MANGLE(ColorTableParameteriv) +#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI) +#define glColorTableSGI MANGLE(ColorTableSGI) +#define glCombinerInputNV MANGLE(CombinerInputNV) +#define glCombinerOutputNV MANGLE(CombinerOutputNV) +#define glCombinerParameterfNV MANGLE(CombinerParameterfNV) +#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV) +#define glCombinerParameteriNV MANGLE(CombinerParameteriNV) +#define glCombinerParameterivNV MANGLE(CombinerParameterivNV) +#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV) +#define glCompileShaderARB MANGLE(CompileShaderARB) +#define glCompileShader MANGLE(CompileShader) +#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB) +#define glCompressedTexImage1D MANGLE(CompressedTexImage1D) +#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB) +#define glCompressedTexImage2D MANGLE(CompressedTexImage2D) +#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB) +#define glCompressedTexImage3D MANGLE(CompressedTexImage3D) +#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB) +#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D) +#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB) +#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D) +#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB) +#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D) +#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT) +#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D) +#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT) +#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D) +#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT) +#define glConvolutionParameterf MANGLE(ConvolutionParameterf) +#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT) +#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv) +#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT) +#define glConvolutionParameteri MANGLE(ConvolutionParameteri) +#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT) +#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv) +#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT) +#define glCopyColorSubTable MANGLE(CopyColorSubTable) +#define glCopyColorTable MANGLE(CopyColorTable) +#define glCopyColorTableSGI MANGLE(CopyColorTableSGI) +#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D) +#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT) +#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D) +#define glCopyPixels MANGLE(CopyPixels) +#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT) +#define glCopyTexImage1D MANGLE(CopyTexImage1D) +#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT) +#define glCopyTexImage2D MANGLE(CopyTexImage2D) +#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT) +#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D) +#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT) +#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) +#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT) +#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) +#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA) +#define glCreateProgram MANGLE(CreateProgram) +#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB) +#define glCreateShader MANGLE(CreateShader) +#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB) +#define glCullFace MANGLE(CullFace) +#define glCullParameterdvEXT MANGLE(CullParameterdvEXT) +#define glCullParameterfvEXT MANGLE(CullParameterfvEXT) +#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB) +#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX) +#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX) +#define glDeformSGIX MANGLE(DeformSGIX) +#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX) +#define glDeleteBuffersARB MANGLE(DeleteBuffersARB) +#define glDeleteBuffers MANGLE(DeleteBuffers) +#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE) +#define glDeleteFencesNV MANGLE(DeleteFencesNV) +#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) +#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT) +#define glDeleteLists MANGLE(DeleteLists) +#define glDeleteObjectARB MANGLE(DeleteObjectARB) +#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) +#define glDeleteProgram MANGLE(DeleteProgram) +#define glDeleteProgramsARB MANGLE(DeleteProgramsARB) +#define glDeleteProgramsNV MANGLE(DeleteProgramsNV) +#define glDeleteQueriesARB MANGLE(DeleteQueriesARB) +#define glDeleteQueries MANGLE(DeleteQueries) +#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT) +#define glDeleteShader MANGLE(DeleteShader) +#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) +#define glDeleteTextures MANGLE(DeleteTextures) +#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE) +#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT) +#define glDepthBoundsdNV MANGLE(DepthBoundsdNV) +#define glDepthBoundsEXT MANGLE(DepthBoundsEXT) +#define glDepthFunc MANGLE(DepthFunc) +#define glDepthMask MANGLE(DepthMask) +#define glDepthRangedNV MANGLE(DepthRangedNV) +#define glDepthRange MANGLE(DepthRange) +#define glDetachObjectARB MANGLE(DetachObjectARB) +#define glDetachShader MANGLE(DetachShader) +#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) +#define glDisableClientState MANGLE(DisableClientState) +#define glDisableIndexedEXT MANGLE(DisableIndexedEXT) +#define glDisable MANGLE(Disable) +#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) +#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) +#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray) +#define glDrawArraysEXT MANGLE(DrawArraysEXT) +#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT) +#define glDrawArrays MANGLE(DrawArrays) +#define glDrawBuffer MANGLE(DrawBuffer) +#define glDrawBuffersARB MANGLE(DrawBuffersARB) +#define glDrawBuffersATI MANGLE(DrawBuffersATI) +#define glDrawBuffers MANGLE(DrawBuffers) +#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE) +#define glDrawElementArrayATI MANGLE(DrawElementArrayATI) +#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT) +#define glDrawElements MANGLE(DrawElements) +#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN) +#define glDrawPixels MANGLE(DrawPixels) +#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE) +#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI) +#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT) +#define glDrawRangeElements MANGLE(DrawRangeElements) +#define glEdgeFlag MANGLE(EdgeFlag) +#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT) +#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM) +#define glEdgeFlagPointer MANGLE(EdgeFlagPointer) +#define glEdgeFlagv MANGLE(EdgeFlagv) +#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE) +#define glElementPointerATI MANGLE(ElementPointerATI) +#define glEnableClientState MANGLE(EnableClientState) +#define glEnableIndexedEXT MANGLE(EnableIndexedEXT) +#define glEnable MANGLE(Enable) +#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) +#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) +#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray) +#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI) +#define glEndList MANGLE(EndList) +#define glEnd MANGLE(End) +#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) +#define glEndQueryARB MANGLE(EndQueryARB) +#define glEndQuery MANGLE(EndQuery) +#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV) +#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) +#define glEvalCoord1d MANGLE(EvalCoord1d) +#define glEvalCoord1dv MANGLE(EvalCoord1dv) +#define glEvalCoord1f MANGLE(EvalCoord1f) +#define glEvalCoord1fv MANGLE(EvalCoord1fv) +#define glEvalCoord2d MANGLE(EvalCoord2d) +#define glEvalCoord2dv MANGLE(EvalCoord2dv) +#define glEvalCoord2f MANGLE(EvalCoord2f) +#define glEvalCoord2fv MANGLE(EvalCoord2fv) +#define glEvalMapsNV MANGLE(EvalMapsNV) +#define glEvalMesh1 MANGLE(EvalMesh1) +#define glEvalMesh2 MANGLE(EvalMesh2) +#define glEvalPoint1 MANGLE(EvalPoint1) +#define glEvalPoint2 MANGLE(EvalPoint2) +#define glExecuteProgramNV MANGLE(ExecuteProgramNV) +#define glExtractComponentEXT MANGLE(ExtractComponentEXT) +#define glFeedbackBuffer MANGLE(FeedbackBuffer) +#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV) +#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX) +#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE) +#define glFinishFenceNV MANGLE(FinishFenceNV) +#define glFinish MANGLE(Finish) +#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE) +#define glFinishTextureSUNX MANGLE(FinishTextureSUNX) +#define glFlush MANGLE(Flush) +#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE) +#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV) +#define glFlushRasterSGIX MANGLE(FlushRasterSGIX) +#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE) +#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV) +#define glFogCoorddEXT MANGLE(FogCoorddEXT) +#define glFogCoordd MANGLE(FogCoordd) +#define glFogCoorddvEXT MANGLE(FogCoorddvEXT) +#define glFogCoorddv MANGLE(FogCoorddv) +#define glFogCoordfEXT MANGLE(FogCoordfEXT) +#define glFogCoordf MANGLE(FogCoordf) +#define glFogCoordfvEXT MANGLE(FogCoordfvEXT) +#define glFogCoordfv MANGLE(FogCoordfv) +#define glFogCoordhNV MANGLE(FogCoordhNV) +#define glFogCoordhvNV MANGLE(FogCoordhvNV) +#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT) +#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM) +#define glFogCoordPointer MANGLE(FogCoordPointer) +#define glFogf MANGLE(Fogf) +#define glFogFuncSGIS MANGLE(FogFuncSGIS) +#define glFogfv MANGLE(Fogfv) +#define glFogi MANGLE(Fogi) +#define glFogiv MANGLE(Fogiv) +#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX) +#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX) +#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX) +#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX) +#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX) +#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX) +#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX) +#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT) +#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT) +#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT) +#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT) +#define glFrameZoomSGIX MANGLE(FrameZoomSGIX) +#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI) +#define glFrontFace MANGLE(FrontFace) +#define glFrustum MANGLE(Frustum) +#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX) +#define glGenBuffersARB MANGLE(GenBuffersARB) +#define glGenBuffers MANGLE(GenBuffers) +#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT) +#define glGenFencesAPPLE MANGLE(GenFencesAPPLE) +#define glGenFencesNV MANGLE(GenFencesNV) +#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) +#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT) +#define glGenLists MANGLE(GenLists) +#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV) +#define glGenProgramsARB MANGLE(GenProgramsARB) +#define glGenProgramsNV MANGLE(GenProgramsNV) +#define glGenQueriesARB MANGLE(GenQueriesARB) +#define glGenQueries MANGLE(GenQueries) +#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT) +#define glGenSymbolsEXT MANGLE(GenSymbolsEXT) +#define glGenTexturesEXT MANGLE(GenTexturesEXT) +#define glGenTextures MANGLE(GenTextures) +#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE) +#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT) +#define glGetActiveAttribARB MANGLE(GetActiveAttribARB) +#define glGetActiveAttrib MANGLE(GetActiveAttrib) +#define glGetActiveUniformARB MANGLE(GetActiveUniformARB) +#define glGetActiveUniform MANGLE(GetActiveUniform) +#define glGetActiveVaryingNV MANGLE(GetActiveVaryingNV) +#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI) +#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) +#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB) +#define glGetAttachedShaders MANGLE(GetAttachedShaders) +#define glGetAttribLocationARB MANGLE(GetAttribLocationARB) +#define glGetAttribLocation MANGLE(GetAttribLocation) +#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT) +#define glGetBooleanv MANGLE(GetBooleanv) +#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB) +#define glGetBufferParameteriv MANGLE(GetBufferParameteriv) +#define glGetBufferPointervARB MANGLE(GetBufferPointervARB) +#define glGetBufferPointerv MANGLE(GetBufferPointerv) +#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB) +#define glGetBufferSubData MANGLE(GetBufferSubData) +#define glGetClipPlane MANGLE(GetClipPlane) +#define glGetColorTableEXT MANGLE(GetColorTableEXT) +#define glGetColorTable MANGLE(GetColorTable) +#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT) +#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv) +#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI) +#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT) +#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv) +#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI) +#define glGetColorTableSGI MANGLE(GetColorTableSGI) +#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV) +#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV) +#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB) +#define glGetCompressedTexImage MANGLE(GetCompressedTexImage) +#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT) +#define glGetConvolutionFilter MANGLE(GetConvolutionFilter) +#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT) +#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv) +#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT) +#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv) +#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA) +#define glGetDebugLogMESA MANGLE(GetDebugLogMESA) +#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS) +#define glGetDoublev MANGLE(GetDoublev) +#define glGetError MANGLE(GetError) +#define glGetFenceivNV MANGLE(GetFenceivNV) +#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV) +#define glGetFloatv MANGLE(GetFloatv) +#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS) +#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT) +#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX) +#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT) +#define glGetHandleARB MANGLE(GetHandleARB) +#define glGetHistogramEXT MANGLE(GetHistogramEXT) +#define glGetHistogram MANGLE(GetHistogram) +#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT) +#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv) +#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT) +#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv) +#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP) +#define glGetInfoLogARB MANGLE(GetInfoLogARB) +#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX) +#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT) +#define glGetIntegerv MANGLE(GetIntegerv) +#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT) +#define glGetLightfv MANGLE(GetLightfv) +#define glGetLightiv MANGLE(GetLightiv) +#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX) +#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX) +#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT) +#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV) +#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV) +#define glGetMapdv MANGLE(GetMapdv) +#define glGetMapfv MANGLE(GetMapfv) +#define glGetMapiv MANGLE(GetMapiv) +#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV) +#define glGetMapParameterivNV MANGLE(GetMapParameterivNV) +#define glGetMaterialfv MANGLE(GetMaterialfv) +#define glGetMaterialiv MANGLE(GetMaterialiv) +#define glGetMinmaxEXT MANGLE(GetMinmaxEXT) +#define glGetMinmax MANGLE(GetMinmax) +#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT) +#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv) +#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT) +#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv) +#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI) +#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI) +#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB) +#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB) +#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV) +#define glGetPixelMapfv MANGLE(GetPixelMapfv) +#define glGetPixelMapuiv MANGLE(GetPixelMapuiv) +#define glGetPixelMapusv MANGLE(GetPixelMapusv) +#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS) +#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS) +#define glGetPointervEXT MANGLE(GetPointervEXT) +#define glGetPointerv MANGLE(GetPointerv) +#define glGetPolygonStipple MANGLE(GetPolygonStipple) +#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB) +#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV) +#define glGetProgramEnvParameterIuivNV MANGLE(GetProgramEnvParameterIuivNV) +#define glGetProgramInfoLog MANGLE(GetProgramInfoLog) +#define glGetProgramivARB MANGLE(GetProgramivARB) +#define glGetProgramiv MANGLE(GetProgramiv) +#define glGetProgramivNV MANGLE(GetProgramivNV) +#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB) +#define glGetProgramLocalParameterIivNV MANGLE(GetProgramLocalParameterIivNV) +#define glGetProgramLocalParameterIuivNV MANGLE(GetProgramLocalParameterIuivNV) +#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV) +#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV) +#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV) +#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA) +#define glGetProgramStringARB MANGLE(GetProgramStringARB) +#define glGetProgramStringNV MANGLE(GetProgramStringNV) +#define glGetQueryivARB MANGLE(GetQueryivARB) +#define glGetQueryiv MANGLE(GetQueryiv) +#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT) +#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB) +#define glGetQueryObjectiv MANGLE(GetQueryObjectiv) +#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT) +#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB) +#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv) +#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT) +#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) +#define glGetSeparableFilter MANGLE(GetSeparableFilter) +#define glGetShaderInfoLog MANGLE(GetShaderInfoLog) +#define glGetShaderiv MANGLE(GetShaderiv) +#define glGetShaderSourceARB MANGLE(GetShaderSourceARB) +#define glGetShaderSource MANGLE(GetShaderSource) +#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) +#define glGetString MANGLE(GetString) +#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI) +#define glGetTexEnvfv MANGLE(GetTexEnvfv) +#define glGetTexEnviv MANGLE(GetTexEnviv) +#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS) +#define glGetTexGendv MANGLE(GetTexGendv) +#define glGetTexGenfv MANGLE(GetTexGenfv) +#define glGetTexGeniv MANGLE(GetTexGeniv) +#define glGetTexImage MANGLE(GetTexImage) +#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv) +#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv) +#define glGetTexParameterfv MANGLE(GetTexParameterfv) +#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT) +#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT) +#define glGetTexParameteriv MANGLE(GetTexParameteriv) +#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV) +#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV) +#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT) +#define glGetUniformfvARB MANGLE(GetUniformfvARB) +#define glGetUniformfv MANGLE(GetUniformfv) +#define glGetUniformivARB MANGLE(GetUniformivARB) +#define glGetUniformiv MANGLE(GetUniformiv) +#define glGetUniformLocationARB MANGLE(GetUniformLocationARB) +#define glGetUniformLocation MANGLE(GetUniformLocation) +#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT) +#define glGetUniformuivEXT MANGLE(GetUniformuivEXT) +#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI) +#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT) +#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT) +#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT) +#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT) +#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV) +#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI) +#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB) +#define glGetVertexAttribdv MANGLE(GetVertexAttribdv) +#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV) +#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB) +#define glGetVertexAttribfv MANGLE(GetVertexAttribfv) +#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV) +#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT) +#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB) +#define glGetVertexAttribiv MANGLE(GetVertexAttribiv) +#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV) +#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB) +#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv) +#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV) +#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN) +#define glHint MANGLE(Hint) +#define glHintPGI MANGLE(HintPGI) +#define glHistogramEXT MANGLE(HistogramEXT) +#define glHistogram MANGLE(Histogram) +#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX) +#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP) +#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP) +#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP) +#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP) +#define glIndexd MANGLE(Indexd) +#define glIndexdv MANGLE(Indexdv) +#define glIndexf MANGLE(Indexf) +#define glIndexFuncEXT MANGLE(IndexFuncEXT) +#define glIndexfv MANGLE(Indexfv) +#define glIndexi MANGLE(Indexi) +#define glIndexiv MANGLE(Indexiv) +#define glIndexMask MANGLE(IndexMask) +#define glIndexMaterialEXT MANGLE(IndexMaterialEXT) +#define glIndexPointerEXT MANGLE(IndexPointerEXT) +#define glIndexPointerListIBM MANGLE(IndexPointerListIBM) +#define glIndexPointer MANGLE(IndexPointer) +#define glIndexs MANGLE(Indexs) +#define glIndexsv MANGLE(Indexsv) +#define glIndexub MANGLE(Indexub) +#define glIndexubv MANGLE(Indexubv) +#define glInitNames MANGLE(InitNames) +#define glInsertComponentEXT MANGLE(InsertComponentEXT) +#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX) +#define glInterleavedArrays MANGLE(InterleavedArrays) +#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX) +#define glIsBufferARB MANGLE(IsBufferARB) +#define glIsBuffer MANGLE(IsBuffer) +#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT) +#define glIsEnabled MANGLE(IsEnabled) +#define glIsFenceAPPLE MANGLE(IsFenceAPPLE) +#define glIsFenceNV MANGLE(IsFenceNV) +#define glIsFramebufferEXT MANGLE(IsFramebufferEXT) +#define glIsList MANGLE(IsList) +#define glIsObjectBufferATI MANGLE(IsObjectBufferATI) +#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV) +#define glIsProgramARB MANGLE(IsProgramARB) +#define glIsProgram MANGLE(IsProgram) +#define glIsProgramNV MANGLE(IsProgramNV) +#define glIsQueryARB MANGLE(IsQueryARB) +#define glIsQuery MANGLE(IsQuery) +#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT) +#define glIsShader MANGLE(IsShader) +#define glIsTextureEXT MANGLE(IsTextureEXT) +#define glIsTexture MANGLE(IsTexture) +#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT) +#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE) +#define glLightEnviSGIX MANGLE(LightEnviSGIX) +#define glLightf MANGLE(Lightf) +#define glLightfv MANGLE(Lightfv) +#define glLighti MANGLE(Lighti) +#define glLightiv MANGLE(Lightiv) +#define glLightModelf MANGLE(LightModelf) +#define glLightModelfv MANGLE(LightModelfv) +#define glLightModeli MANGLE(LightModeli) +#define glLightModeliv MANGLE(LightModeliv) +#define glLineStipple MANGLE(LineStipple) +#define glLineWidth MANGLE(LineWidth) +#define glLinkProgramARB MANGLE(LinkProgramARB) +#define glLinkProgram MANGLE(LinkProgram) +#define glListBase MANGLE(ListBase) +#define glListParameterfSGIX MANGLE(ListParameterfSGIX) +#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX) +#define glListParameteriSGIX MANGLE(ListParameteriSGIX) +#define glListParameterivSGIX MANGLE(ListParameterivSGIX) +#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX) +#define glLoadIdentity MANGLE(LoadIdentity) +#define glLoadMatrixd MANGLE(LoadMatrixd) +#define glLoadMatrixf MANGLE(LoadMatrixf) +#define glLoadName MANGLE(LoadName) +#define glLoadProgramNV MANGLE(LoadProgramNV) +#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB) +#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd) +#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB) +#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf) +#define glLockArraysEXT MANGLE(LockArraysEXT) +#define glLogicOp MANGLE(LogicOp) +#define glMap1d MANGLE(Map1d) +#define glMap1f MANGLE(Map1f) +#define glMap2d MANGLE(Map2d) +#define glMap2f MANGLE(Map2f) +#define glMapBufferARB MANGLE(MapBufferARB) +#define glMapBuffer MANGLE(MapBuffer) +#define glMapControlPointsNV MANGLE(MapControlPointsNV) +#define glMapGrid1d MANGLE(MapGrid1d) +#define glMapGrid1f MANGLE(MapGrid1f) +#define glMapGrid2d MANGLE(MapGrid2d) +#define glMapGrid2f MANGLE(MapGrid2f) +#define glMapObjectBufferATI MANGLE(MapObjectBufferATI) +#define glMapParameterfvNV MANGLE(MapParameterfvNV) +#define glMapParameterivNV MANGLE(MapParameterivNV) +#define glMaterialf MANGLE(Materialf) +#define glMaterialfv MANGLE(Materialfv) +#define glMateriali MANGLE(Materiali) +#define glMaterialiv MANGLE(Materialiv) +#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB) +#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB) +#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB) +#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB) +#define glMatrixMode MANGLE(MatrixMode) +#define glMinmaxEXT MANGLE(MinmaxEXT) +#define glMinmax MANGLE(Minmax) +#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT) +#define glMultiDrawArrays MANGLE(MultiDrawArrays) +#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE) +#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT) +#define glMultiDrawElements MANGLE(MultiDrawElements) +#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE) +#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM) +#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB) +#define glMultiTexCoord1d MANGLE(MultiTexCoord1d) +#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB) +#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv) +#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB) +#define glMultiTexCoord1f MANGLE(MultiTexCoord1f) +#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB) +#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv) +#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV) +#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV) +#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB) +#define glMultiTexCoord1i MANGLE(MultiTexCoord1i) +#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB) +#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv) +#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB) +#define glMultiTexCoord1s MANGLE(MultiTexCoord1s) +#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB) +#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv) +#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB) +#define glMultiTexCoord2d MANGLE(MultiTexCoord2d) +#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB) +#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv) +#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB) +#define glMultiTexCoord2f MANGLE(MultiTexCoord2f) +#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB) +#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv) +#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV) +#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV) +#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB) +#define glMultiTexCoord2i MANGLE(MultiTexCoord2i) +#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB) +#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv) +#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB) +#define glMultiTexCoord2s MANGLE(MultiTexCoord2s) +#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB) +#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv) +#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB) +#define glMultiTexCoord3d MANGLE(MultiTexCoord3d) +#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB) +#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv) +#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB) +#define glMultiTexCoord3f MANGLE(MultiTexCoord3f) +#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB) +#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv) +#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV) +#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV) +#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB) +#define glMultiTexCoord3i MANGLE(MultiTexCoord3i) +#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB) +#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv) +#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB) +#define glMultiTexCoord3s MANGLE(MultiTexCoord3s) +#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB) +#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv) +#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB) +#define glMultiTexCoord4d MANGLE(MultiTexCoord4d) +#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB) +#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv) +#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB) +#define glMultiTexCoord4f MANGLE(MultiTexCoord4f) +#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB) +#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv) +#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV) +#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV) +#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB) +#define glMultiTexCoord4i MANGLE(MultiTexCoord4i) +#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB) +#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv) +#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB) +#define glMultiTexCoord4s MANGLE(MultiTexCoord4s) +#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB) +#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv) +#define glMultMatrixd MANGLE(MultMatrixd) +#define glMultMatrixf MANGLE(MultMatrixf) +#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB) +#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd) +#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB) +#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) +#define glNewList MANGLE(NewList) +#define glNewObjectBufferATI MANGLE(NewObjectBufferATI) +#define glNormal3b MANGLE(Normal3b) +#define glNormal3bv MANGLE(Normal3bv) +#define glNormal3d MANGLE(Normal3d) +#define glNormal3dv MANGLE(Normal3dv) +#define glNormal3f MANGLE(Normal3f) +#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN) +#define glNormal3fv MANGLE(Normal3fv) +#define glNormal3hNV MANGLE(Normal3hNV) +#define glNormal3hvNV MANGLE(Normal3hvNV) +#define glNormal3i MANGLE(Normal3i) +#define glNormal3iv MANGLE(Normal3iv) +#define glNormal3s MANGLE(Normal3s) +#define glNormal3sv MANGLE(Normal3sv) +#define glNormalPointerEXT MANGLE(NormalPointerEXT) +#define glNormalPointerListIBM MANGLE(NormalPointerListIBM) +#define glNormalPointer MANGLE(NormalPointer) +#define glNormalPointervINTEL MANGLE(NormalPointervINTEL) +#define glNormalStream3bATI MANGLE(NormalStream3bATI) +#define glNormalStream3bvATI MANGLE(NormalStream3bvATI) +#define glNormalStream3dATI MANGLE(NormalStream3dATI) +#define glNormalStream3dvATI MANGLE(NormalStream3dvATI) +#define glNormalStream3fATI MANGLE(NormalStream3fATI) +#define glNormalStream3fvATI MANGLE(NormalStream3fvATI) +#define glNormalStream3iATI MANGLE(NormalStream3iATI) +#define glNormalStream3ivATI MANGLE(NormalStream3ivATI) +#define glNormalStream3sATI MANGLE(NormalStream3sATI) +#define glNormalStream3svATI MANGLE(NormalStream3svATI) +#define glOrtho MANGLE(Ortho) +#define glPassTexCoordATI MANGLE(PassTexCoordATI) +#define glPassThrough MANGLE(PassThrough) +#define glPixelDataRangeNV MANGLE(PixelDataRangeNV) +#define glPixelMapfv MANGLE(PixelMapfv) +#define glPixelMapuiv MANGLE(PixelMapuiv) +#define glPixelMapusv MANGLE(PixelMapusv) +#define glPixelStoref MANGLE(PixelStoref) +#define glPixelStorei MANGLE(PixelStorei) +#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS) +#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS) +#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS) +#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS) +#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX) +#define glPixelTransferf MANGLE(PixelTransferf) +#define glPixelTransferi MANGLE(PixelTransferi) +#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT) +#define glPixelZoom MANGLE(PixelZoom) +#define glPNTrianglesfATI MANGLE(PNTrianglesfATI) +#define glPNTrianglesiATI MANGLE(PNTrianglesiATI) +#define glPointParameterfARB MANGLE(PointParameterfARB) +#define glPointParameterfEXT MANGLE(PointParameterfEXT) +#define glPointParameterf MANGLE(PointParameterf) +#define glPointParameterfSGIS MANGLE(PointParameterfSGIS) +#define glPointParameterfvARB MANGLE(PointParameterfvARB) +#define glPointParameterfvEXT MANGLE(PointParameterfvEXT) +#define glPointParameterfv MANGLE(PointParameterfv) +#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS) +#define glPointParameteri MANGLE(PointParameteri) +#define glPointParameteriNV MANGLE(PointParameteriNV) +#define glPointParameteriv MANGLE(PointParameteriv) +#define glPointParameterivNV MANGLE(PointParameterivNV) +#define glPointSize MANGLE(PointSize) +#define glPollAsyncSGIX MANGLE(PollAsyncSGIX) +#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX) +#define glPolygonMode MANGLE(PolygonMode) +#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT) +#define glPolygonOffset MANGLE(PolygonOffset) +#define glPolygonStipple MANGLE(PolygonStipple) +#define glPopAttrib MANGLE(PopAttrib) +#define glPopClientAttrib MANGLE(PopClientAttrib) +#define glPopMatrix MANGLE(PopMatrix) +#define glPopName MANGLE(PopName) +#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV) +#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV) +#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT) +#define glPrioritizeTextures MANGLE(PrioritizeTextures) +#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV) +#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV) +#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA) +#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB) +#define glProgramEnvParameterI4iNV MANGLE(ProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV MANGLE(ProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV MANGLE(ProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV MANGLE(ProgramEnvParameterI4uivNV) +#define glProgramEnvParameters4fvEXT MANGLE(ProgramEnvParameters4fvEXT) +#define glProgramEnvParametersI4ivNV MANGLE(ProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV MANGLE(ProgramEnvParametersI4uivNV) +#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB) +#define glProgramLocalParameterI4iNV MANGLE(ProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV MANGLE(ProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV MANGLE(ProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV MANGLE(ProgramLocalParameterI4uivNV) +#define glProgramLocalParameters4fvEXT MANGLE(ProgramLocalParameters4fvEXT) +#define glProgramLocalParametersI4ivNV MANGLE(ProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV MANGLE(ProgramLocalParametersI4uivNV) +#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV) +#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV) +#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV) +#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV) +#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV) +#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT) +#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV) +#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV) +#define glProgramStringARB MANGLE(ProgramStringARB) +#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV) +#define glPushAttrib MANGLE(PushAttrib) +#define glPushClientAttrib MANGLE(PushClientAttrib) +#define glPushMatrix MANGLE(PushMatrix) +#define glPushName MANGLE(PushName) +#define glRasterPos2d MANGLE(RasterPos2d) +#define glRasterPos2dv MANGLE(RasterPos2dv) +#define glRasterPos2f MANGLE(RasterPos2f) +#define glRasterPos2fv MANGLE(RasterPos2fv) +#define glRasterPos2i MANGLE(RasterPos2i) +#define glRasterPos2iv MANGLE(RasterPos2iv) +#define glRasterPos2s MANGLE(RasterPos2s) +#define glRasterPos2sv MANGLE(RasterPos2sv) +#define glRasterPos3d MANGLE(RasterPos3d) +#define glRasterPos3dv MANGLE(RasterPos3dv) +#define glRasterPos3f MANGLE(RasterPos3f) +#define glRasterPos3fv MANGLE(RasterPos3fv) +#define glRasterPos3i MANGLE(RasterPos3i) +#define glRasterPos3iv MANGLE(RasterPos3iv) +#define glRasterPos3s MANGLE(RasterPos3s) +#define glRasterPos3sv MANGLE(RasterPos3sv) +#define glRasterPos4d MANGLE(RasterPos4d) +#define glRasterPos4dv MANGLE(RasterPos4dv) +#define glRasterPos4f MANGLE(RasterPos4f) +#define glRasterPos4fv MANGLE(RasterPos4fv) +#define glRasterPos4i MANGLE(RasterPos4i) +#define glRasterPos4iv MANGLE(RasterPos4iv) +#define glRasterPos4s MANGLE(RasterPos4s) +#define glRasterPos4sv MANGLE(RasterPos4sv) +#define glReadBuffer MANGLE(ReadBuffer) +#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX) +#define glReadPixels MANGLE(ReadPixels) +#define glRectd MANGLE(Rectd) +#define glRectdv MANGLE(Rectdv) +#define glRectf MANGLE(Rectf) +#define glRectfv MANGLE(Rectfv) +#define glRecti MANGLE(Recti) +#define glRectiv MANGLE(Rectiv) +#define glRects MANGLE(Rects) +#define glRectsv MANGLE(Rectsv) +#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX) +#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT) +#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV) +#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT) +#define glRenderMode MANGLE(RenderMode) +#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN) +#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN) +#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN) +#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN) +#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN) +#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN) +#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV) +#define glResetHistogramEXT MANGLE(ResetHistogramEXT) +#define glResetHistogram MANGLE(ResetHistogram) +#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT) +#define glResetMinmax MANGLE(ResetMinmax) +#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA) +#define glRotated MANGLE(Rotated) +#define glRotatef MANGLE(Rotatef) +#define glSampleCoverageARB MANGLE(SampleCoverageARB) +#define glSampleCoverage MANGLE(SampleCoverage) +#define glSampleMapATI MANGLE(SampleMapATI) +#define glSampleMaskEXT MANGLE(SampleMaskEXT) +#define glSampleMaskSGIS MANGLE(SampleMaskSGIS) +#define glSamplePatternEXT MANGLE(SamplePatternEXT) +#define glSamplePatternSGIS MANGLE(SamplePatternSGIS) +#define glScaled MANGLE(Scaled) +#define glScalef MANGLE(Scalef) +#define glScissor MANGLE(Scissor) +#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT) +#define glSecondaryColor3b MANGLE(SecondaryColor3b) +#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT) +#define glSecondaryColor3bv MANGLE(SecondaryColor3bv) +#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT) +#define glSecondaryColor3d MANGLE(SecondaryColor3d) +#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT) +#define glSecondaryColor3dv MANGLE(SecondaryColor3dv) +#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT) +#define glSecondaryColor3f MANGLE(SecondaryColor3f) +#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT) +#define glSecondaryColor3fv MANGLE(SecondaryColor3fv) +#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV) +#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV) +#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT) +#define glSecondaryColor3i MANGLE(SecondaryColor3i) +#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT) +#define glSecondaryColor3iv MANGLE(SecondaryColor3iv) +#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT) +#define glSecondaryColor3s MANGLE(SecondaryColor3s) +#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT) +#define glSecondaryColor3sv MANGLE(SecondaryColor3sv) +#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT) +#define glSecondaryColor3ub MANGLE(SecondaryColor3ub) +#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT) +#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv) +#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT) +#define glSecondaryColor3ui MANGLE(SecondaryColor3ui) +#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT) +#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv) +#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT) +#define glSecondaryColor3us MANGLE(SecondaryColor3us) +#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT) +#define glSecondaryColor3usv MANGLE(SecondaryColor3usv) +#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT) +#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM) +#define glSecondaryColorPointer MANGLE(SecondaryColorPointer) +#define glSelectBuffer MANGLE(SelectBuffer) +#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT) +#define glSeparableFilter2D MANGLE(SeparableFilter2D) +#define glSetFenceAPPLE MANGLE(SetFenceAPPLE) +#define glSetFenceNV MANGLE(SetFenceNV) +#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI) +#define glSetInvariantEXT MANGLE(SetInvariantEXT) +#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT) +#define glShadeModel MANGLE(ShadeModel) +#define glShaderOp1EXT MANGLE(ShaderOp1EXT) +#define glShaderOp2EXT MANGLE(ShaderOp2EXT) +#define glShaderOp3EXT MANGLE(ShaderOp3EXT) +#define glShaderSourceARB MANGLE(ShaderSourceARB) +#define glShaderSource MANGLE(ShaderSource) +#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS) +#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX) +#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX) +#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX) +#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX) +#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) +#define glStencilClearTagEXT MANGLE(StencilClearTagEXT) +#define glStencilFunc MANGLE(StencilFunc) +#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI) +#define glStencilFuncSeparate MANGLE(StencilFuncSeparate) +#define glStencilMask MANGLE(StencilMask) +#define glStencilMaskSeparate MANGLE(StencilMaskSeparate) +#define glStencilOp MANGLE(StencilOp) +#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI) +#define glStencilOpSeparate MANGLE(StencilOpSeparate) +#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX) +#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY) +#define glSwizzleEXT MANGLE(SwizzleEXT) +#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX) +#define glTangent3bEXT MANGLE(Tangent3bEXT) +#define glTangent3bvEXT MANGLE(Tangent3bvEXT) +#define glTangent3dEXT MANGLE(Tangent3dEXT) +#define glTangent3dvEXT MANGLE(Tangent3dvEXT) +#define glTangent3fEXT MANGLE(Tangent3fEXT) +#define glTangent3fvEXT MANGLE(Tangent3fvEXT) +#define glTangent3iEXT MANGLE(Tangent3iEXT) +#define glTangent3ivEXT MANGLE(Tangent3ivEXT) +#define glTangent3sEXT MANGLE(Tangent3sEXT) +#define glTangent3svEXT MANGLE(Tangent3svEXT) +#define glTangentPointerEXT MANGLE(TangentPointerEXT) +#define glTbufferMask3DFX MANGLE(TbufferMask3DFX) +#define glTestFenceAPPLE MANGLE(TestFenceAPPLE) +#define glTestFenceNV MANGLE(TestFenceNV) +#define glTestObjectAPPLE MANGLE(TestObjectAPPLE) +#define glTexBufferEXT MANGLE(TexBufferEXT) +#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI) +#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI) +#define glTexCoord1d MANGLE(TexCoord1d) +#define glTexCoord1dv MANGLE(TexCoord1dv) +#define glTexCoord1f MANGLE(TexCoord1f) +#define glTexCoord1fv MANGLE(TexCoord1fv) +#define glTexCoord1hNV MANGLE(TexCoord1hNV) +#define glTexCoord1hvNV MANGLE(TexCoord1hvNV) +#define glTexCoord1i MANGLE(TexCoord1i) +#define glTexCoord1iv MANGLE(TexCoord1iv) +#define glTexCoord1s MANGLE(TexCoord1s) +#define glTexCoord1sv MANGLE(TexCoord1sv) +#define glTexCoord2d MANGLE(TexCoord2d) +#define glTexCoord2dv MANGLE(TexCoord2dv) +#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2f MANGLE(TexCoord2f) +#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN) +#define glTexCoord2fv MANGLE(TexCoord2fv) +#define glTexCoord2hNV MANGLE(TexCoord2hNV) +#define glTexCoord2hvNV MANGLE(TexCoord2hvNV) +#define glTexCoord2i MANGLE(TexCoord2i) +#define glTexCoord2iv MANGLE(TexCoord2iv) +#define glTexCoord2s MANGLE(TexCoord2s) +#define glTexCoord2sv MANGLE(TexCoord2sv) +#define glTexCoord3d MANGLE(TexCoord3d) +#define glTexCoord3dv MANGLE(TexCoord3dv) +#define glTexCoord3f MANGLE(TexCoord3f) +#define glTexCoord3fv MANGLE(TexCoord3fv) +#define glTexCoord3hNV MANGLE(TexCoord3hNV) +#define glTexCoord3hvNV MANGLE(TexCoord3hvNV) +#define glTexCoord3i MANGLE(TexCoord3i) +#define glTexCoord3iv MANGLE(TexCoord3iv) +#define glTexCoord3s MANGLE(TexCoord3s) +#define glTexCoord3sv MANGLE(TexCoord3sv) +#define glTexCoord4d MANGLE(TexCoord4d) +#define glTexCoord4dv MANGLE(TexCoord4dv) +#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4f MANGLE(TexCoord4f) +#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN) +#define glTexCoord4fv MANGLE(TexCoord4fv) +#define glTexCoord4hNV MANGLE(TexCoord4hNV) +#define glTexCoord4hvNV MANGLE(TexCoord4hvNV) +#define glTexCoord4i MANGLE(TexCoord4i) +#define glTexCoord4iv MANGLE(TexCoord4iv) +#define glTexCoord4s MANGLE(TexCoord4s) +#define glTexCoord4sv MANGLE(TexCoord4sv) +#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT) +#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM) +#define glTexCoordPointer MANGLE(TexCoordPointer) +#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL) +#define glTexEnvf MANGLE(TexEnvf) +#define glTexEnvfv MANGLE(TexEnvfv) +#define glTexEnvi MANGLE(TexEnvi) +#define glTexEnviv MANGLE(TexEnviv) +#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS) +#define glTexGend MANGLE(TexGend) +#define glTexGendv MANGLE(TexGendv) +#define glTexGenf MANGLE(TexGenf) +#define glTexGenfv MANGLE(TexGenfv) +#define glTexGeni MANGLE(TexGeni) +#define glTexGeniv MANGLE(TexGeniv) +#define glTexImage1D MANGLE(TexImage1D) +#define glTexImage2D MANGLE(TexImage2D) +#define glTexImage3DEXT MANGLE(TexImage3DEXT) +#define glTexImage3D MANGLE(TexImage3D) +#define glTexImage4DSGIS MANGLE(TexImage4DSGIS) +#define glTexParameterf MANGLE(TexParameterf) +#define glTexParameterfv MANGLE(TexParameterfv) +#define glTexParameterIivEXT MANGLE(TexParameterIivEXT) +#define glTexParameteri MANGLE(TexParameteri) +#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT) +#define glTexParameteriv MANGLE(TexParameteriv) +#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT) +#define glTexSubImage1D MANGLE(TexSubImage1D) +#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT) +#define glTexSubImage2D MANGLE(TexSubImage2D) +#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT) +#define glTexSubImage3D MANGLE(TexSubImage3D) +#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS) +#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS) +#define glTextureLightEXT MANGLE(TextureLightEXT) +#define glTextureMaterialEXT MANGLE(TextureMaterialEXT) +#define glTextureNormalEXT MANGLE(TextureNormalEXT) +#define glTrackMatrixNV MANGLE(TrackMatrixNV) +#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV) +#define glTranslated MANGLE(Translated) +#define glTranslatef MANGLE(Translatef) +#define glUniform1fARB MANGLE(Uniform1fARB) +#define glUniform1f MANGLE(Uniform1f) +#define glUniform1fvARB MANGLE(Uniform1fvARB) +#define glUniform1fv MANGLE(Uniform1fv) +#define glUniform1iARB MANGLE(Uniform1iARB) +#define glUniform1i MANGLE(Uniform1i) +#define glUniform1ivARB MANGLE(Uniform1ivARB) +#define glUniform1iv MANGLE(Uniform1iv) +#define glUniform1uiEXT MANGLE(Uniform1uiEXT) +#define glUniform1uivEXT MANGLE(Uniform1uivEXT) +#define glUniform2fARB MANGLE(Uniform2fARB) +#define glUniform2f MANGLE(Uniform2f) +#define glUniform2fvARB MANGLE(Uniform2fvARB) +#define glUniform2fv MANGLE(Uniform2fv) +#define glUniform2iARB MANGLE(Uniform2iARB) +#define glUniform2i MANGLE(Uniform2i) +#define glUniform2ivARB MANGLE(Uniform2ivARB) +#define glUniform2iv MANGLE(Uniform2iv) +#define glUniform2uiEXT MANGLE(Uniform2uiEXT) +#define glUniform2uivEXT MANGLE(Uniform2uivEXT) +#define glUniform3fARB MANGLE(Uniform3fARB) +#define glUniform3f MANGLE(Uniform3f) +#define glUniform3fvARB MANGLE(Uniform3fvARB) +#define glUniform3fv MANGLE(Uniform3fv) +#define glUniform3iARB MANGLE(Uniform3iARB) +#define glUniform3i MANGLE(Uniform3i) +#define glUniform3ivARB MANGLE(Uniform3ivARB) +#define glUniform3iv MANGLE(Uniform3iv) +#define glUniform3uiEXT MANGLE(Uniform3uiEXT) +#define glUniform3uivEXT MANGLE(Uniform3uivEXT) +#define glUniform4fARB MANGLE(Uniform4fARB) +#define glUniform4f MANGLE(Uniform4f) +#define glUniform4fvARB MANGLE(Uniform4fvARB) +#define glUniform4fv MANGLE(Uniform4fv) +#define glUniform4iARB MANGLE(Uniform4iARB) +#define glUniform4i MANGLE(Uniform4i) +#define glUniform4ivARB MANGLE(Uniform4ivARB) +#define glUniform4iv MANGLE(Uniform4iv) +#define glUniform4uiEXT MANGLE(Uniform4uiEXT) +#define glUniform4uivEXT MANGLE(Uniform4uivEXT) +#define glUniformBufferEXT MANGLE(UniformBufferEXT) +#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB) +#define glUniformMatrix2fv MANGLE(UniformMatrix2fv) +#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv) +#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv) +#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB) +#define glUniformMatrix3fv MANGLE(UniformMatrix3fv) +#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv) +#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv) +#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB) +#define glUniformMatrix4fv MANGLE(UniformMatrix4fv) +#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv) +#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv) +#define glUnlockArraysEXT MANGLE(UnlockArraysEXT) +#define glUnmapBufferARB MANGLE(UnmapBufferARB) +#define glUnmapBuffer MANGLE(UnmapBuffer) +#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI) +#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) +#define glUseProgram MANGLE(UseProgram) +#define glUseProgramObjectARB MANGLE(UseProgramObjectARB) +#define glValidateProgramARB MANGLE(ValidateProgramARB) +#define glValidateProgram MANGLE(ValidateProgram) +#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) +#define glVariantbvEXT MANGLE(VariantbvEXT) +#define glVariantdvEXT MANGLE(VariantdvEXT) +#define glVariantfvEXT MANGLE(VariantfvEXT) +#define glVariantivEXT MANGLE(VariantivEXT) +#define glVariantPointerEXT MANGLE(VariantPointerEXT) +#define glVariantsvEXT MANGLE(VariantsvEXT) +#define glVariantubvEXT MANGLE(VariantubvEXT) +#define glVariantuivEXT MANGLE(VariantuivEXT) +#define glVariantusvEXT MANGLE(VariantusvEXT) +#define glVertex2d MANGLE(Vertex2d) +#define glVertex2dv MANGLE(Vertex2dv) +#define glVertex2f MANGLE(Vertex2f) +#define glVertex2fv MANGLE(Vertex2fv) +#define glVertex2hNV MANGLE(Vertex2hNV) +#define glVertex2hvNV MANGLE(Vertex2hvNV) +#define glVertex2i MANGLE(Vertex2i) +#define glVertex2iv MANGLE(Vertex2iv) +#define glVertex2s MANGLE(Vertex2s) +#define glVertex2sv MANGLE(Vertex2sv) +#define glVertex3d MANGLE(Vertex3d) +#define glVertex3dv MANGLE(Vertex3dv) +#define glVertex3f MANGLE(Vertex3f) +#define glVertex3fv MANGLE(Vertex3fv) +#define glVertex3hNV MANGLE(Vertex3hNV) +#define glVertex3hvNV MANGLE(Vertex3hvNV) +#define glVertex3i MANGLE(Vertex3i) +#define glVertex3iv MANGLE(Vertex3iv) +#define glVertex3s MANGLE(Vertex3s) +#define glVertex3sv MANGLE(Vertex3sv) +#define glVertex4d MANGLE(Vertex4d) +#define glVertex4dv MANGLE(Vertex4dv) +#define glVertex4f MANGLE(Vertex4f) +#define glVertex4fv MANGLE(Vertex4fv) +#define glVertex4hNV MANGLE(Vertex4hNV) +#define glVertex4hvNV MANGLE(Vertex4hvNV) +#define glVertex4i MANGLE(Vertex4i) +#define glVertex4iv MANGLE(Vertex4iv) +#define glVertex4s MANGLE(Vertex4s) +#define glVertex4sv MANGLE(Vertex4sv) +#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE) +#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV) +#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB) +#define glVertexAttrib1d MANGLE(VertexAttrib1d) +#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV) +#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB) +#define glVertexAttrib1dv MANGLE(VertexAttrib1dv) +#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV) +#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB) +#define glVertexAttrib1f MANGLE(VertexAttrib1f) +#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV) +#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB) +#define glVertexAttrib1fv MANGLE(VertexAttrib1fv) +#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV) +#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV) +#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV) +#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB) +#define glVertexAttrib1s MANGLE(VertexAttrib1s) +#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV) +#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB) +#define glVertexAttrib1sv MANGLE(VertexAttrib1sv) +#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV) +#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB) +#define glVertexAttrib2d MANGLE(VertexAttrib2d) +#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV) +#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB) +#define glVertexAttrib2dv MANGLE(VertexAttrib2dv) +#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV) +#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB) +#define glVertexAttrib2f MANGLE(VertexAttrib2f) +#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV) +#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB) +#define glVertexAttrib2fv MANGLE(VertexAttrib2fv) +#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV) +#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV) +#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV) +#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB) +#define glVertexAttrib2s MANGLE(VertexAttrib2s) +#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV) +#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB) +#define glVertexAttrib2sv MANGLE(VertexAttrib2sv) +#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV) +#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB) +#define glVertexAttrib3d MANGLE(VertexAttrib3d) +#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV) +#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB) +#define glVertexAttrib3dv MANGLE(VertexAttrib3dv) +#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV) +#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB) +#define glVertexAttrib3f MANGLE(VertexAttrib3f) +#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV) +#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB) +#define glVertexAttrib3fv MANGLE(VertexAttrib3fv) +#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV) +#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV) +#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV) +#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB) +#define glVertexAttrib3s MANGLE(VertexAttrib3s) +#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV) +#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB) +#define glVertexAttrib3sv MANGLE(VertexAttrib3sv) +#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV) +#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB) +#define glVertexAttrib4bv MANGLE(VertexAttrib4bv) +#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB) +#define glVertexAttrib4d MANGLE(VertexAttrib4d) +#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV) +#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB) +#define glVertexAttrib4dv MANGLE(VertexAttrib4dv) +#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV) +#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB) +#define glVertexAttrib4f MANGLE(VertexAttrib4f) +#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV) +#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB) +#define glVertexAttrib4fv MANGLE(VertexAttrib4fv) +#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV) +#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV) +#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV) +#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB) +#define glVertexAttrib4iv MANGLE(VertexAttrib4iv) +#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB) +#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv) +#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB) +#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv) +#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB) +#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv) +#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB) +#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub) +#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB) +#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv) +#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB) +#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv) +#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB) +#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv) +#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB) +#define glVertexAttrib4s MANGLE(VertexAttrib4s) +#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV) +#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB) +#define glVertexAttrib4sv MANGLE(VertexAttrib4sv) +#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV) +#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV) +#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB) +#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv) +#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV) +#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB) +#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv) +#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB) +#define glVertexAttrib4usv MANGLE(VertexAttrib4usv) +#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI) +#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT) +#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT) +#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT) +#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT) +#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT) +#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT) +#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT) +#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT) +#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT) +#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB) +#define glVertexAttribPointer MANGLE(VertexAttribPointer) +#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV) +#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV) +#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV) +#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV) +#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV) +#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV) +#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV) +#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV) +#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV) +#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV) +#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV) +#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV) +#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV) +#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV) +#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV) +#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV) +#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV) +#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV) +#define glVertexBlendARB MANGLE(VertexBlendARB) +#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI) +#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI) +#define glVertexPointerEXT MANGLE(VertexPointerEXT) +#define glVertexPointerListIBM MANGLE(VertexPointerListIBM) +#define glVertexPointer MANGLE(VertexPointer) +#define glVertexPointervINTEL MANGLE(VertexPointervINTEL) +#define glVertexStream1dATI MANGLE(VertexStream1dATI) +#define glVertexStream1dvATI MANGLE(VertexStream1dvATI) +#define glVertexStream1fATI MANGLE(VertexStream1fATI) +#define glVertexStream1fvATI MANGLE(VertexStream1fvATI) +#define glVertexStream1iATI MANGLE(VertexStream1iATI) +#define glVertexStream1ivATI MANGLE(VertexStream1ivATI) +#define glVertexStream1sATI MANGLE(VertexStream1sATI) +#define glVertexStream1svATI MANGLE(VertexStream1svATI) +#define glVertexStream2dATI MANGLE(VertexStream2dATI) +#define glVertexStream2dvATI MANGLE(VertexStream2dvATI) +#define glVertexStream2fATI MANGLE(VertexStream2fATI) +#define glVertexStream2fvATI MANGLE(VertexStream2fvATI) +#define glVertexStream2iATI MANGLE(VertexStream2iATI) +#define glVertexStream2ivATI MANGLE(VertexStream2ivATI) +#define glVertexStream2sATI MANGLE(VertexStream2sATI) +#define glVertexStream2svATI MANGLE(VertexStream2svATI) +#define glVertexStream3dATI MANGLE(VertexStream3dATI) +#define glVertexStream3dvATI MANGLE(VertexStream3dvATI) +#define glVertexStream3fATI MANGLE(VertexStream3fATI) +#define glVertexStream3fvATI MANGLE(VertexStream3fvATI) +#define glVertexStream3iATI MANGLE(VertexStream3iATI) +#define glVertexStream3ivATI MANGLE(VertexStream3ivATI) +#define glVertexStream3sATI MANGLE(VertexStream3sATI) +#define glVertexStream3svATI MANGLE(VertexStream3svATI) +#define glVertexStream4dATI MANGLE(VertexStream4dATI) +#define glVertexStream4dvATI MANGLE(VertexStream4dvATI) +#define glVertexStream4fATI MANGLE(VertexStream4fATI) +#define glVertexStream4fvATI MANGLE(VertexStream4fvATI) +#define glVertexStream4iATI MANGLE(VertexStream4iATI) +#define glVertexStream4ivATI MANGLE(VertexStream4ivATI) +#define glVertexStream4sATI MANGLE(VertexStream4sATI) +#define glVertexStream4svATI MANGLE(VertexStream4svATI) +#define glVertexWeightfEXT MANGLE(VertexWeightfEXT) +#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT) +#define glVertexWeighthNV MANGLE(VertexWeighthNV) +#define glVertexWeighthvNV MANGLE(VertexWeighthvNV) +#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT) +#define glViewport MANGLE(Viewport) +#define glWeightbvARB MANGLE(WeightbvARB) +#define glWeightdvARB MANGLE(WeightdvARB) +#define glWeightfvARB MANGLE(WeightfvARB) +#define glWeightivARB MANGLE(WeightivARB) +#define glWeightPointerARB MANGLE(WeightPointerARB) +#define glWeightsvARB MANGLE(WeightsvARB) +#define glWeightubvARB MANGLE(WeightubvARB) +#define glWeightuivARB MANGLE(WeightuivARB) +#define glWeightusvARB MANGLE(WeightusvARB) +#define glWindowPos2dARB MANGLE(WindowPos2dARB) +#define glWindowPos2d MANGLE(WindowPos2d) +#define glWindowPos2dMESA MANGLE(WindowPos2dMESA) +#define glWindowPos2dvARB MANGLE(WindowPos2dvARB) +#define glWindowPos2dv MANGLE(WindowPos2dv) +#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA) +#define glWindowPos2fARB MANGLE(WindowPos2fARB) +#define glWindowPos2f MANGLE(WindowPos2f) +#define glWindowPos2fMESA MANGLE(WindowPos2fMESA) +#define glWindowPos2fvARB MANGLE(WindowPos2fvARB) +#define glWindowPos2fv MANGLE(WindowPos2fv) +#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA) +#define glWindowPos2iARB MANGLE(WindowPos2iARB) +#define glWindowPos2i MANGLE(WindowPos2i) +#define glWindowPos2iMESA MANGLE(WindowPos2iMESA) +#define glWindowPos2ivARB MANGLE(WindowPos2ivARB) +#define glWindowPos2iv MANGLE(WindowPos2iv) +#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA) +#define glWindowPos2sARB MANGLE(WindowPos2sARB) +#define glWindowPos2s MANGLE(WindowPos2s) +#define glWindowPos2sMESA MANGLE(WindowPos2sMESA) +#define glWindowPos2svARB MANGLE(WindowPos2svARB) +#define glWindowPos2sv MANGLE(WindowPos2sv) +#define glWindowPos2svMESA MANGLE(WindowPos2svMESA) +#define glWindowPos3dARB MANGLE(WindowPos3dARB) +#define glWindowPos3d MANGLE(WindowPos3d) +#define glWindowPos3dMESA MANGLE(WindowPos3dMESA) +#define glWindowPos3dvARB MANGLE(WindowPos3dvARB) +#define glWindowPos3dv MANGLE(WindowPos3dv) +#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA) +#define glWindowPos3fARB MANGLE(WindowPos3fARB) +#define glWindowPos3f MANGLE(WindowPos3f) +#define glWindowPos3fMESA MANGLE(WindowPos3fMESA) +#define glWindowPos3fvARB MANGLE(WindowPos3fvARB) +#define glWindowPos3fv MANGLE(WindowPos3fv) +#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA) +#define glWindowPos3iARB MANGLE(WindowPos3iARB) +#define glWindowPos3i MANGLE(WindowPos3i) +#define glWindowPos3iMESA MANGLE(WindowPos3iMESA) +#define glWindowPos3ivARB MANGLE(WindowPos3ivARB) +#define glWindowPos3iv MANGLE(WindowPos3iv) +#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA) +#define glWindowPos3sARB MANGLE(WindowPos3sARB) +#define glWindowPos3s MANGLE(WindowPos3s) +#define glWindowPos3sMESA MANGLE(WindowPos3sMESA) +#define glWindowPos3svARB MANGLE(WindowPos3svARB) +#define glWindowPos3sv MANGLE(WindowPos3sv) +#define glWindowPos3svMESA MANGLE(WindowPos3svMESA) +#define glWindowPos4dMESA MANGLE(WindowPos4dMESA) +#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA) +#define glWindowPos4fMESA MANGLE(WindowPos4fMESA) +#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA) +#define glWindowPos4iMESA MANGLE(WindowPos4iMESA) +#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA) +#define glWindowPos4sMESA MANGLE(WindowPos4sMESA) +#define glWindowPos4svMESA MANGLE(WindowPos4svMESA) +#define glWriteMaskEXT MANGLE(WriteMaskEXT) + +#endif /* GL_MANGLE_H */ diff --git a/Mesa/inc/glext.h b/Mesa/inc/glext.h new file mode 100644 index 000000000000..449b70d0b459 --- /dev/null +++ b/Mesa/inc/glext.h @@ -0,0 +1,7271 @@ +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated 2008/03/24 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 40 + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + +#ifndef GL_VERSION_2_1 +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; /* native character */ +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for handling shader object handles and program/shader text */ +typedef char GLcharARB; /* native character */ +typedef unsigned int GLhandleARB; /* shader object handle */ +#endif + +/* GL types for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) +#include +#if defined(__STDC__) +#if defined(__arch64__) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include /* Fallback option */ +#endif +#endif + +#ifndef GL_EXT_timer_query +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glFogCoordf (GLfloat); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *); +GLAPI void APIENTRY glFogCoordd (GLdouble); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameteri (GLenum, GLint); +GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); +GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos2i (GLint, GLint); +GLAPI void APIENTRY glWindowPos2iv (const GLint *); +GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *); +GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3iv (const GLint *); +GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQuery (GLuint); +GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); +GLAPI void APIENTRY glEndQuery (GLenum); +GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint); +GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); +GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); +GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); +GLAPI void APIENTRY glAttachShader (GLuint, GLuint); +GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); +GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum); +GLAPI void APIENTRY glDeleteProgram (GLuint); +GLAPI void APIENTRY glDeleteShader (GLuint); +GLAPI void APIENTRY glDetachShader (GLuint, GLuint); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); +GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgram (GLuint); +GLAPI GLboolean APIENTRY glIsShader (GLuint); +GLAPI void APIENTRY glLinkProgram (GLuint); +GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); +GLAPI void APIENTRY glUseProgram (GLuint); +GLAPI void APIENTRY glUniform1f (GLint, GLfloat); +GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1i (GLint, GLint); +GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glValidateProgram (GLuint); +GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); +GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); +GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); +GLAPI void APIENTRY glEndQueryARB (GLenum); +GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); +GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); +GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1iARB (GLint, GLint); +GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *); +GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint); +GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint); +GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#endif + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#endif + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble); +GLAPI void APIENTRY glClearDepthdNV (GLdouble); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#endif + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +#endif + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum); +GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#endif + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Mesa/inc/glu.h b/Mesa/inc/glu.h new file mode 100644 index 000000000000..d7f5de9d1c76 --- /dev/null +++ b/Mesa/inc/glu.h @@ -0,0 +1,348 @@ +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#ifndef __glu_h__ +#define __glu_h__ + +#if defined(USE_MGL_NAMESPACE) +#include "glu_mangle.h" +#endif + +#include + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * +#endif + +#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32) +# undef GLAPI +# define GLAPI __declspec(dllexport) +#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) +/* tag specifying we're building for DLL runtime support */ +# undef GLAPI +# define GLAPI __declspec(dllimport) +#elif !defined(GLAPI) +/* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +#endif /* _STATIC_MESA support */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************/ + +/* Extensions */ +#define GLU_EXT_object_space_tess 1 +#define GLU_EXT_nurbs_tessellator 1 + +/* Boolean */ +#define GLU_FALSE 0 +#define GLU_TRUE 1 + +/* Version */ +#define GLU_VERSION_1_1 1 +#define GLU_VERSION_1_2 1 +#define GLU_VERSION_1_3 1 + +/* StringName */ +#define GLU_VERSION 100800 +#define GLU_EXTENSIONS 100801 + +/* ErrorCode */ +#define GLU_INVALID_ENUM 100900 +#define GLU_INVALID_VALUE 100901 +#define GLU_OUT_OF_MEMORY 100902 +#define GLU_INCOMPATIBLE_GL_VERSION 100903 +#define GLU_INVALID_OPERATION 100904 + +/* NurbsDisplay */ +/* GLU_FILL */ +#define GLU_OUTLINE_POLYGON 100240 +#define GLU_OUTLINE_PATCH 100241 + +/* NurbsCallback */ +#define GLU_NURBS_ERROR 100103 +#define GLU_ERROR 100103 +#define GLU_NURBS_BEGIN 100164 +#define GLU_NURBS_BEGIN_EXT 100164 +#define GLU_NURBS_VERTEX 100165 +#define GLU_NURBS_VERTEX_EXT 100165 +#define GLU_NURBS_NORMAL 100166 +#define GLU_NURBS_NORMAL_EXT 100166 +#define GLU_NURBS_COLOR 100167 +#define GLU_NURBS_COLOR_EXT 100167 +#define GLU_NURBS_TEXTURE_COORD 100168 +#define GLU_NURBS_TEX_COORD_EXT 100168 +#define GLU_NURBS_END 100169 +#define GLU_NURBS_END_EXT 100169 +#define GLU_NURBS_BEGIN_DATA 100170 +#define GLU_NURBS_BEGIN_DATA_EXT 100170 +#define GLU_NURBS_VERTEX_DATA 100171 +#define GLU_NURBS_VERTEX_DATA_EXT 100171 +#define GLU_NURBS_NORMAL_DATA 100172 +#define GLU_NURBS_NORMAL_DATA_EXT 100172 +#define GLU_NURBS_COLOR_DATA 100173 +#define GLU_NURBS_COLOR_DATA_EXT 100173 +#define GLU_NURBS_TEXTURE_COORD_DATA 100174 +#define GLU_NURBS_TEX_COORD_DATA_EXT 100174 +#define GLU_NURBS_END_DATA 100175 +#define GLU_NURBS_END_DATA_EXT 100175 + +/* NurbsError */ +#define GLU_NURBS_ERROR1 100251 +#define GLU_NURBS_ERROR2 100252 +#define GLU_NURBS_ERROR3 100253 +#define GLU_NURBS_ERROR4 100254 +#define GLU_NURBS_ERROR5 100255 +#define GLU_NURBS_ERROR6 100256 +#define GLU_NURBS_ERROR7 100257 +#define GLU_NURBS_ERROR8 100258 +#define GLU_NURBS_ERROR9 100259 +#define GLU_NURBS_ERROR10 100260 +#define GLU_NURBS_ERROR11 100261 +#define GLU_NURBS_ERROR12 100262 +#define GLU_NURBS_ERROR13 100263 +#define GLU_NURBS_ERROR14 100264 +#define GLU_NURBS_ERROR15 100265 +#define GLU_NURBS_ERROR16 100266 +#define GLU_NURBS_ERROR17 100267 +#define GLU_NURBS_ERROR18 100268 +#define GLU_NURBS_ERROR19 100269 +#define GLU_NURBS_ERROR20 100270 +#define GLU_NURBS_ERROR21 100271 +#define GLU_NURBS_ERROR22 100272 +#define GLU_NURBS_ERROR23 100273 +#define GLU_NURBS_ERROR24 100274 +#define GLU_NURBS_ERROR25 100275 +#define GLU_NURBS_ERROR26 100276 +#define GLU_NURBS_ERROR27 100277 +#define GLU_NURBS_ERROR28 100278 +#define GLU_NURBS_ERROR29 100279 +#define GLU_NURBS_ERROR30 100280 +#define GLU_NURBS_ERROR31 100281 +#define GLU_NURBS_ERROR32 100282 +#define GLU_NURBS_ERROR33 100283 +#define GLU_NURBS_ERROR34 100284 +#define GLU_NURBS_ERROR35 100285 +#define GLU_NURBS_ERROR36 100286 +#define GLU_NURBS_ERROR37 100287 + +/* NurbsProperty */ +#define GLU_AUTO_LOAD_MATRIX 100200 +#define GLU_CULLING 100201 +#define GLU_SAMPLING_TOLERANCE 100203 +#define GLU_DISPLAY_MODE 100204 +#define GLU_PARAMETRIC_TOLERANCE 100202 +#define GLU_SAMPLING_METHOD 100205 +#define GLU_U_STEP 100206 +#define GLU_V_STEP 100207 +#define GLU_NURBS_MODE 100160 +#define GLU_NURBS_MODE_EXT 100160 +#define GLU_NURBS_TESSELLATOR 100161 +#define GLU_NURBS_TESSELLATOR_EXT 100161 +#define GLU_NURBS_RENDERER 100162 +#define GLU_NURBS_RENDERER_EXT 100162 + +/* NurbsSampling */ +#define GLU_OBJECT_PARAMETRIC_ERROR 100208 +#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 +#define GLU_OBJECT_PATH_LENGTH 100209 +#define GLU_OBJECT_PATH_LENGTH_EXT 100209 +#define GLU_PATH_LENGTH 100215 +#define GLU_PARAMETRIC_ERROR 100216 +#define GLU_DOMAIN_DISTANCE 100217 + +/* NurbsTrim */ +#define GLU_MAP1_TRIM_2 100210 +#define GLU_MAP1_TRIM_3 100211 + +/* QuadricDrawStyle */ +#define GLU_POINT 100010 +#define GLU_LINE 100011 +#define GLU_FILL 100012 +#define GLU_SILHOUETTE 100013 + +/* QuadricCallback */ +/* GLU_ERROR */ + +/* QuadricNormal */ +#define GLU_SMOOTH 100000 +#define GLU_FLAT 100001 +#define GLU_NONE 100002 + +/* QuadricOrientation */ +#define GLU_OUTSIDE 100020 +#define GLU_INSIDE 100021 + +/* TessCallback */ +#define GLU_TESS_BEGIN 100100 +#define GLU_BEGIN 100100 +#define GLU_TESS_VERTEX 100101 +#define GLU_VERTEX 100101 +#define GLU_TESS_END 100102 +#define GLU_END 100102 +#define GLU_TESS_ERROR 100103 +#define GLU_TESS_EDGE_FLAG 100104 +#define GLU_EDGE_FLAG 100104 +#define GLU_TESS_COMBINE 100105 +#define GLU_TESS_BEGIN_DATA 100106 +#define GLU_TESS_VERTEX_DATA 100107 +#define GLU_TESS_END_DATA 100108 +#define GLU_TESS_ERROR_DATA 100109 +#define GLU_TESS_EDGE_FLAG_DATA 100110 +#define GLU_TESS_COMBINE_DATA 100111 + +/* TessContour */ +#define GLU_CW 100120 +#define GLU_CCW 100121 +#define GLU_INTERIOR 100122 +#define GLU_EXTERIOR 100123 +#define GLU_UNKNOWN 100124 + +/* TessProperty */ +#define GLU_TESS_WINDING_RULE 100140 +#define GLU_TESS_BOUNDARY_ONLY 100141 +#define GLU_TESS_TOLERANCE 100142 + +/* TessError */ +#define GLU_TESS_ERROR1 100151 +#define GLU_TESS_ERROR2 100152 +#define GLU_TESS_ERROR3 100153 +#define GLU_TESS_ERROR4 100154 +#define GLU_TESS_ERROR5 100155 +#define GLU_TESS_ERROR6 100156 +#define GLU_TESS_ERROR7 100157 +#define GLU_TESS_ERROR8 100158 +#define GLU_TESS_MISSING_BEGIN_POLYGON 100151 +#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 +#define GLU_TESS_MISSING_END_POLYGON 100153 +#define GLU_TESS_MISSING_END_CONTOUR 100154 +#define GLU_TESS_COORD_TOO_LARGE 100155 +#define GLU_TESS_NEED_COMBINE_CALLBACK 100156 + +/* TessWinding */ +#define GLU_TESS_WINDING_ODD 100130 +#define GLU_TESS_WINDING_NONZERO 100131 +#define GLU_TESS_WINDING_POSITIVE 100132 +#define GLU_TESS_WINDING_NEGATIVE 100133 +#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 + +/*************************************************************/ + + +#ifdef __cplusplus +class GLUnurbs; +class GLUquadric; +class GLUtesselator; +#else +typedef struct GLUnurbs GLUnurbs; +typedef struct GLUquadric GLUquadric; +typedef struct GLUtesselator GLUtesselator; +#endif + +typedef GLUnurbs GLUnurbsObj; +typedef GLUquadric GLUquadricObj; +typedef GLUtesselator GLUtesselatorObj; +typedef GLUtesselator GLUtriangulatorObj; + +#define GLU_TESS_MAX_COORD 1.0e150 + +/* Internal convenience typedefs */ +typedef void (GLAPIENTRYP _GLUfuncptr)(); + +GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb); +GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString); +GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad); +GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); +GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb); +GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error); +GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); +GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name); +GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); +GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); +GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); +GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void); +GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void); +GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void); +GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type); +GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); +GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); +GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); +GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); +GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); +GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); +GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); +GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); +GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); +GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal); +GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation); +GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture); +GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); +GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); +GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); +GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); +GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); +GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); +GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); + +#ifdef __cplusplus +} +#endif + +#endif /* __glu_h__ */ diff --git a/Mesa/inc/glu_mangle.h b/Mesa/inc/glu_mangle.h new file mode 100644 index 000000000000..9c25aa864c13 --- /dev/null +++ b/Mesa/inc/glu_mangle.h @@ -0,0 +1,86 @@ +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef GLU_MANGLE_H +#define GLU_MANGLE_H + + +#define gluLookAt mgluLookAt +#define gluOrtho2D mgluOrtho2D +#define gluPerspective mgluPerspective +#define gluPickMatrix mgluPickMatrix +#define gluProject mgluProject +#define gluUnProject mgluUnProject +#define gluErrorString mgluErrorString +#define gluScaleImage mgluScaleImage +#define gluBuild1DMipmaps mgluBuild1DMipmaps +#define gluBuild2DMipmaps mgluBuild2DMipmaps +#define gluNewQuadric mgluNewQuadric +#define gluDeleteQuadric mgluDeleteQuadric +#define gluQuadricDrawStyle mgluQuadricDrawStyle +#define gluQuadricOrientation mgluQuadricOrientation +#define gluQuadricNormals mgluQuadricNormals +#define gluQuadricTexture mgluQuadricTexture +#define gluQuadricCallback mgluQuadricCallback +#define gluCylinder mgluCylinder +#define gluSphere mgluSphere +#define gluDisk mgluDisk +#define gluPartialDisk mgluPartialDisk +#define gluNewNurbsRenderer mgluNewNurbsRenderer +#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer +#define gluLoadSamplingMatrices mgluLoadSamplingMatrices +#define gluNurbsProperty mgluNurbsProperty +#define gluGetNurbsProperty mgluGetNurbsProperty +#define gluBeginCurve mgluBeginCurve +#define gluEndCurve mgluEndCurve +#define gluNurbsCurve mgluNurbsCurve +#define gluBeginSurface mgluBeginSurface +#define gluEndSurface mgluEndSurface +#define gluNurbsSurface mgluNurbsSurface +#define gluBeginTrim mgluBeginTrim +#define gluEndTrim mgluEndTrim +#define gluPwlCurve mgluPwlCurve +#define gluNurbsCallback mgluNurbsCallback +#define gluNewTess mgluNewTess +#define gluDeleteTess mgluDeleteTess +#define gluTessBeginPolygon mgluTessBeginPolygon +#define gluTessBeginContour mgluTessBeginContour +#define gluTessVertex mgluTessVertex +#define gluTessEndPolygon mgluTessEndPolygon +#define gluTessEndContour mgluTessEndContour +#define gluTessProperty mgluTessProperty +#define gluTessNormal mgluTessNormal +#define gluTessCallback mgluTessCallback +#define gluGetTessProperty mgluGetTessProperty +#define gluBeginPolygon mgluBeginPolygon +#define gluNextContour mgluNextContour +#define gluEndPolygon mgluEndPolygon +#define gluGetString mgluGetString +#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels +#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels +#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels +#define gluBuild3DMipmaps mgluBuild3DMipmaps +#define gluCheckExtension mgluCheckExtension +#define gluUnProject4 mgluUnProject4 +#define gluNurbsCallbackData mgluNurbsCallbackData +#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT + +#endif diff --git a/Mesa/inc/glx.h b/Mesa/inc/glx.h new file mode 100644 index 000000000000..c91a91823048 --- /dev/null +++ b/Mesa/inc/glx.h @@ -0,0 +1,500 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef GLX_H +#define GLX_H + + +#ifdef __VMS +#include +# ifdef __cplusplus +/* VMS Xlib.h gives problems with C++. + * this avoids a bunch of trivial warnings */ +#pragma message disable nosimpint +#endif +#endif +#include +#include +#ifdef __VMS +# ifdef __cplusplus +#pragma message enable nosimpint +#endif +#endif +#include + + +#if defined(USE_MGL_NAMESPACE) +#include "glx_mangle.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define GLX_VERSION_1_1 1 +#define GLX_VERSION_1_2 1 +#define GLX_VERSION_1_3 1 +#define GLX_VERSION_1_4 1 + +#define GLX_EXTENSION_NAME "GLX" + + + +/* + * Tokens for glXChooseVisual and glXGetConfig: + */ +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 + + +/* + * Error codes returned by glXGetConfig: + */ +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + + +/* + * GLX 1.1 and later: + */ +#define GLX_VENDOR 1 +#define GLX_VERSION 2 +#define GLX_EXTENSIONS 3 + + +/* + * GLX 1.3 and later: + */ +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 + + +/* + * GLX 1.4 and later: + */ +#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/ +#define GLX_SAMPLES 0x186a1 /*100001*/ + + + +typedef struct __GLXcontextRec *GLXContext; +typedef XID GLXPixmap; +typedef XID GLXDrawable; +/* GLX 1.3 and later */ +typedef struct __GLXFBConfigRec *GLXFBConfig; +typedef XID GLXFBConfigID; +typedef XID GLXContextID; +typedef XID GLXWindow; +typedef XID GLXPbuffer; + + + +extern XVisualInfo* glXChooseVisual( Display *dpy, int screen, + int *attribList ); + +extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool direct ); + +extern void glXDestroyContext( Display *dpy, GLXContext ctx ); + +extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, + GLXContext ctx); + +extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, + unsigned long mask ); + +extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); + +extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual, + Pixmap pixmap ); + +extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ); + +extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event ); + +extern Bool glXQueryVersion( Display *dpy, int *maj, int *min ); + +extern Bool glXIsDirect( Display *dpy, GLXContext ctx ); + +extern int glXGetConfig( Display *dpy, XVisualInfo *visual, + int attrib, int *value ); + +extern GLXContext glXGetCurrentContext( void ); + +extern GLXDrawable glXGetCurrentDrawable( void ); + +extern void glXWaitGL( void ); + +extern void glXWaitX( void ); + +extern void glXUseXFont( Font font, int first, int count, int list ); + + + +/* GLX 1.1 and later */ +extern const char *glXQueryExtensionsString( Display *dpy, int screen ); + +extern const char *glXQueryServerString( Display *dpy, int screen, int name ); + +extern const char *glXGetClientString( Display *dpy, int name ); + + +/* GLX 1.2 and later */ +extern Display *glXGetCurrentDisplay( void ); + + +/* GLX 1.3 and later */ +extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen, + const int *attribList, int *nitems ); + +extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config, + int attribute, int *value ); + +extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen, + int *nelements ); + +extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy, + GLXFBConfig config ); + +extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config, + Window win, const int *attribList ); + +extern void glXDestroyWindow( Display *dpy, GLXWindow window ); + +extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config, + Pixmap pixmap, const int *attribList ); + +extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap ); + +extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config, + const int *attribList ); + +extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ); + +extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, + unsigned int *value ); + +extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config, + int renderType, GLXContext shareList, + Bool direct ); + +extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw, + GLXDrawable read, GLXContext ctx ); + +extern GLXDrawable glXGetCurrentReadDrawable( void ); + +extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute, + int *value ); + +extern void glXSelectEvent( Display *dpy, GLXDrawable drawable, + unsigned long mask ); + +extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, + unsigned long *mask ); + + +/* GLX 1.4 and later */ +extern void (*glXGetProcAddress(const GLubyte *procname))( void ); + + +#ifndef GLX_GLXEXT_LEGACY + +#include + +#else + + + +/* + * ARB 2. GLX_ARB_get_proc_address + */ +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +typedef void (*__GLXextFuncPtr)(void); +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); + +#endif /* GLX_ARB_get_proc_address */ + + + +#endif /* GLX_GLXEXT_LEGACY */ + + +/** + ** The following aren't in glxext.h yet. + **/ + + +/* + * ???. GLX_NV_vertex_array_range + */ +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range + +extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void glXFreeMemoryNV(GLvoid *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); + +#endif /* GLX_NV_vertex_array_range */ + + +/* + * ???. GLX_MESA_allocate_memory + */ +#ifndef GLX_MESA_allocate_memory +#define GLX_MESA_allocate_memory 1 + +extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); +extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer); +typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer); + +#endif /* GLX_MESA_allocate_memory */ + + +/* + * ARB ?. GLX_ARB_render_texture + * XXX This was never finalized! + */ +#ifndef GLX_ARB_render_texture +#define GLX_ARB_render_texture 1 + +extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList); + +#endif /* GLX_ARB_render_texture */ + + +/* + * Remove this when glxext.h is updated. + */ +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#endif /* GLX_NV_float_buffer */ + + + +/* + * #?. GLX_MESA_swap_frame_usage + */ +#ifndef GLX_MESA_swap_frame_usage +#define GLX_MESA_swap_frame_usage 1 + +extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage); +extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage); +typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +#endif /* GLX_MESA_swap_frame_usage */ + + + +/* + * #?. GLX_MESA_swap_control + */ +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +extern int glXSwapIntervalMESA(unsigned int interval); +extern int glXGetSwapIntervalMESA(void); + +typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval); +typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); + +#endif /* GLX_MESA_swap_control */ + + + +/* + * #?. GLX_EXT_texture_from_pixmap + * XXX not finished? + */ +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 + +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 + +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD + +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); + +#endif /* GLX_EXT_texture_from_pixmap */ + + + + +/*** Should these go here, or in another header? */ +/* +** GLX Events +*/ +typedef struct { + int event_type; /* GLX_DAMAGED or GLX_SAVED */ + int draw_type; /* GLX_WINDOW or GLX_PBUFFER */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* XID of Drawable */ + unsigned int buffer_mask; /* mask indicating which buffers are affected */ + unsigned int aux_buffer; /* which aux buffer was affected */ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXPbufferClobberEvent; + +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Mesa/inc/glx_mangle.h b/Mesa/inc/glx_mangle.h new file mode 100644 index 000000000000..b0d3d39ac8c1 --- /dev/null +++ b/Mesa/inc/glx_mangle.h @@ -0,0 +1,81 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef GLX_MANGLE_H +#define GLX_MANGLE_H + +#define glXChooseVisual mglXChooseVisual +#define glXCreateContext mglXCreateContext +#define glXDestroyContext mglXDestroyContext +#define glXMakeCurrent mglXMakeCurrent +#define glXCopyContext mglXCopyContext +#define glXSwapBuffers mglXSwapBuffers +#define glXCreateGLXPixmap mglXCreateGLXPixmap +#define glXDestroyGLXPixmap mglXDestroyGLXPixmap +#define glXQueryExtension mglXQueryExtension +#define glXQueryVersion mglXQueryVersion +#define glXIsDirect mglXIsDirect +#define glXGetConfig mglXGetConfig +#define glXGetCurrentContext mglXGetCurrentContext +#define glXGetCurrentDrawable mglXGetCurrentDrawable +#define glXWaitGL mglXWaitGL +#define glXWaitX mglXWaitX +#define glXUseXFont mglXUseXFont +#define glXQueryExtensionsString mglXQueryExtensionsString +#define glXQueryServerString mglXQueryServerString +#define glXGetClientString mglXGetClientString +#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA +#define glXReleaseBuffersMESA mglXReleaseBuffersMESA +#define glXCopySubBufferMESA mglXCopySubBufferMESA +#define glXGetVideoSyncSGI mglXGetVideoSyncSGI +#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI + +/* GLX 1.2 */ +#define glXGetCurrentDisplay mglXGetCurrentDisplay + +/* GLX 1.3 */ +#define glXChooseFBConfig mglXChooseFBConfig +#define glXGetFBConfigAttrib mglXGetFBConfigAttrib +#define glXGetFBConfigs mglXGetFBConfigs +#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig +#define glXCreateWindow mglXCreateWindow +#define glXDestroyWindow mglXDestroyWindow +#define glXCreatePixmap mglXCreatePixmap +#define glXDestroyPixmap mglXDestroyPixmap +#define glXCreatePbuffer mglXCreatePbuffer +#define glXDestroyPbuffer mglXDestroyPbuffer +#define glXQueryDrawable mglXQueryDrawable +#define glXCreateNewContext mglXCreateNewContext +#define glXMakeContextCurrent mglXMakeContextCurrent +#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable +#define glXQueryContext mglXQueryContext +#define glXSelectEvent mglXSelectEvent +#define glXGetSelectedEvent mglXGetSelectedEvent + +/* GLX 1.4 */ +#define glXGetProcAddress mglXGetProcAddress + + +#endif diff --git a/Mesa/inc/glxext.h b/Mesa/inc/glxext.h new file mode 100644 index 000000000000..930289c05073 --- /dev/null +++ b/Mesa/inc/glxext.h @@ -0,0 +1,785 @@ +#ifndef __glxext_h_ +#define __glxext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glxext.h last updated 2007/04/21 */ +/* Current version at http://www.opengl.org/registry/ */ +#define GLX_GLXEXT_VERSION 19 + +#ifndef GLX_VERSION_1_3 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 +#endif + +#ifndef GLX_ARB_get_proc_address +#endif + +#ifndef GLX_ARB_multisample +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 +#endif + +#ifndef GLX_SGI_swap_control +#endif + +#ifndef GLX_SGI_video_sync +#endif + +#ifndef GLX_SGI_make_current_read +#endif + +#ifndef GLX_SGIX_video_source +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +/* reuse GLX_NONE_EXT */ +#endif + +#ifndef GLX_EXT_import_context +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 +/* reuse GLX_SCREEN_EXT */ +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#endif + +#ifndef GLX_SGI_cushion +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024 +#endif + +#ifndef GLX_SGIX_swap_group +#endif + +#ifndef GLX_SGIX_swap_barrier +#endif + +#ifndef GLX_SGIS_blended_overlay +#define GLX_BLENDED_RGBA_SGIS 0x8025 +#endif + +#ifndef GLX_SGIS_shared_multisample +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 +#endif + +#ifndef GLX_SUN_get_transparent_index +#endif + +#ifndef GLX_3DFX_multisample +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#endif + +#ifndef GLX_MESA_pixmap_colormap +#endif + +#ifndef GLX_MESA_release_buffers +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 +#endif + +#ifndef GLX_OML_sync_control +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 +#endif + +#ifndef GLX_MESA_agp_offset +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB +#endif + + +/*************************************************************/ + +#ifndef GLX_ARB_get_proc_address +typedef void (*__GLXextFuncPtr)(void); +#endif + +#ifndef GLX_SGIX_video_source +typedef XID GLXVideoSourceSGIX; +#endif + +#ifndef GLX_SGIX_fbconfig +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; +#endif + +#ifndef GLX_SGIX_pbuffer +typedef XID GLXPbufferSGIX; +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* i.d. of Drawable */ + int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */ + int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */ + unsigned int mask; /* mask indicating which buffers are affected*/ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXBufferClobberEventSGIX; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GLX_OML_sync_control extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include /* Fallback option */ +#endif +#endif + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *); +extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *); +extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *); +extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig); +extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *); +extern void glXDestroyWindow (Display *, GLXWindow); +extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *); +extern void glXDestroyPixmap (Display *, GLXPixmap); +extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *); +extern void glXDestroyPbuffer (Display *, GLXPbuffer); +extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *); +extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool); +extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawable (void); +extern Display * glXGetCurrentDisplay (void); +extern int glXQueryContext (Display *, GLXContext, int, int *); +extern void glXSelectEvent (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +#endif + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 +#endif + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 +#endif + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXSwapIntervalSGI (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); +#endif + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetVideoSyncSGI (unsigned int *); +extern int glXWaitVideoSyncSGI (int, int, unsigned int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count); +#endif + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawableSGI (void); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +#endif + +#ifndef GLX_SGIX_video_source +#define GLX_SGIX_video_source 1 +#ifdef _VL_H +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode); +extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode); +typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource); +#endif /* _VL_H */ +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 +#endif + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Display * glXGetCurrentDisplayEXT (void); +extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *); +extern GLXContextID glXGetContextIDEXT (const GLXContext); +extern GLXContext glXImportContextEXT (Display *, GLXContextID); +extern void glXFreeContextEXT (Display *, GLXContext); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID); +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context); +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *); +extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *); +extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap); +extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool); +extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX); +extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis); +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *); +extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX); +extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *); +extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf); +typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask); +#endif + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCushionSGI (Display *, Window, float); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion); +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXBindChannelToWindowSGIX (Display *, int, int, Window); +extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int); +extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype); +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_SGIX_dmbuffer 1 +#ifdef _DM_BUFFER_H_ +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer); +#endif /* _DM_BUFFER_H_ */ +#endif + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); +#endif + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int); +extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); +#endif + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); +#endif + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); +#endif + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable); +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXSet3DfxModeMESA (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); +#endif + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 +#endif + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *); +extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *); +extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t); +extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *); +extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); +#endif + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 +#endif + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int + participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin, srcYOrigin, srcWidth, srcHeight; + int destXOrigin, destYOrigin, destWidth, destHeight; +} GLXPipeRect; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin, YOrigin, maxHeight, maxWidth; +} GLXPipeRectLimits; + +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *); +extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *); +extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *); +extern int glXDestroyHyperpipeConfigSGIX (Display *, int); +extern int glXBindHyperpipeSGIX (Display *, int); +extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *); +extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *); +extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +#endif + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern unsigned int glXGetAGPOffsetMESA (const void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer); +#endif + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 +#endif + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *); +extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Mesa/inc/vms_x_fix.h b/Mesa/inc/vms_x_fix.h new file mode 100644 index 000000000000..70454e3d9f53 --- /dev/null +++ b/Mesa/inc/vms_x_fix.h @@ -0,0 +1,1224 @@ +/*************************************************************************** + * * + * Author : Jouk Jansen (joukj@hrem.nano.tudelft.nl) * + * * + * Last revision : 31 August 2006 * + * * + * Repair definitions of Runtime library functions when compiling with * + * /name=(as_is) on OpenVMS * + * * + ***************************************************************************/ + +#ifndef VMS_X_FIX +#define VMS_X_FIX + +#define decw$_select DECW$_SELECT +#define DtSaverGetWindows DTSAVERGETWINDOWS +#define MrmFetchWidget MRMFETCHWIDGET +#define MrmInitialize MRMINITIALIZE +#define MrmOpenHierarchy MRMOPENHIERARCHY +#define MrmRegisterNames MRMREGISTERNAMES +#define XAddExtension XADDEXTENSION +#define XAddHosts XADDHOSTS +#define XAllocClassHint XALLOCCLASSHINT +#define XAllocColor XALLOCCOLOR +#define XAllocColorCells XALLOCCOLORCELLS +#define XAllocIconSize XALLOCICONSIZE +#define XAllocNamedColor XALLOCNAMEDCOLOR +#define XAllocSizeHints XALLOCSIZEHINTS +#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP +#define XAllocWMHints XALLOCWMHINTS +#define XAllowEvents XALLOWEVENTS +#define XAutoRepeatOff XAUTOREPEATOFF +#define XAutoRepeatOn XAUTOREPEATON +#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET +#define XBell XBELL +#define XBitmapPad XBITMAPPAD +#define XBlackPixel XBLACKPIXEL +#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN +#define XCellsOfScreen XCELLSOFSCREEN +#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB +#define XChangeGC XCHANGEGC +#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL +#define XChangePointerControl XCHANGEPOINTERCONTROL +#define XChangeProperty XCHANGEPROPERTY +#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES +#define XCheckIfEvent XCHECKIFEVENT +#define XCheckMaskEvent XCHECKMASKEVENT +#define XCheckTypedEvent XCHECKTYPEDEVENT +#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT +#define XCheckWindowEvent XCHECKWINDOWEVENT +#define XClearArea XCLEARAREA +#define XClearWindow XCLEARWINDOW +#define XClipBox XCLIPBOX +#define XCloseDisplay XCLOSEDISPLAY +#define XCloseIM XCLOSEIM +#define XConfigureWindow XCONFIGUREWINDOW +#define XConvertSelection XCONVERTSELECTION +#define XCopyArea XCOPYAREA +#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE +#define XCopyGC XCOPYGC +#define XCopyPlane XCOPYPLANE +#define XCreateBitmapFromData XCREATEBITMAPFROMDATA +#define XCreateColormap XCREATECOLORMAP +#define XCreateFontCursor XCREATEFONTCURSOR +#define XCreateFontSet XCREATEFONTSET +#define XCreateGC XCREATEGC +#define XCreateGlyphCursor XCREATEGLYPHCURSOR +#define XCreateIC XCREATEIC +#define XCreateImage XCREATEIMAGE +#define XCreatePixmap XCREATEPIXMAP +#define XCreatePixmapCursor XCREATEPIXMAPCURSOR +#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA +#define XCreateRegion XCREATEREGION +#define XCreateSimpleWindow XCREATESIMPLEWINDOW +#define XCreateWindow XCREATEWINDOW +#define XDefaultColormap XDEFAULTCOLORMAP +#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN +#define XDefaultDepth XDEFAULTDEPTH +#define XDefaultDepthOfScreen XDEFAULTDEPTHOFSCREEN +#define XDefaultGC XDEFAULTGC +#define XDefaultRootWindow XDEFAULTROOTWINDOW +#define XDefaultScreen XDEFAULTSCREEN +#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY +#define XDefaultVisual XDEFAULTVISUAL +#define XDefaultVisualOfScreen XDEFAULTVISUALOFSCREEN +#define XDefineCursor XDEFINECURSOR +#define XDeleteContext XDELETECONTEXT +#define XDeleteProperty XDELETEPROPERTY +#define XDestroyIC XDESTROYIC +#define XDestroyRegion XDESTROYREGION +#define XDestroySubwindows XDESTROYSUBWINDOWS +#define XDestroyWindow XDESTROYWINDOW +#define XDisableAccessControl XDISABLEACCESSCONTROL +#define XDisplayCells XDISPLAYCELLS +#define XDisplayHeight XDISPLAYHEIGHT +#define XDisplayKeycodes XDISPLAYKEYCODES +#define XDisplayName XDISPLAYNAME +#define XDisplayOfIM XDISPLAYOFIM +#define XDisplayOfScreen XDISPLAYOFSCREEN +#define XDisplayString XDISPLAYSTRING +#define XDisplayWidth XDISPLAYWIDTH +#define XDoesBackingStore XDOESBACKINGSTORE +#define XDrawArc XDRAWARC +#define XDrawArcs XDRAWARCS +#define XDrawImageString XDRAWIMAGESTRING +#define XDrawImageString16 XDRAWIMAGESTRING16 +#define XDrawLine XDRAWLINE +#define XDrawLines XDRAWLINES +#define XDrawPoint XDRAWPOINT +#define XDrawPoints XDRAWPOINTS +#define XDrawRectangle XDRAWRECTANGLE +#define XDrawRectangles XDRAWRECTANGLES +#define XDrawSegments XDRAWSEGMENTS +#define XDrawString XDRAWSTRING +#define XDrawString16 XDRAWSTRING16 +#define XDrawText XDRAWTEXT +#define XDrawText16 XDRAWTEXT16 +#define XESetCloseDisplay XESETCLOSEDISPLAY +#define XEmptyRegion XEMPTYREGION +#define XEnableAccessControl XENABLEACCESSCONTROL +#define XEqualRegion XEQUALREGION +#define XEventsQueued XEVENTSQUEUED +#define XExtendedMaxRequestSize XEXTENDEDMAXREQUESTSIZE +#define XExtentsOfFontSet XEXTENTSOFFONTSET +#define XFetchBuffer XFETCHBUFFER +#define XFetchBytes XFETCHBYTES +#define XFetchName XFETCHNAME +#define XFillArc XFILLARC +#define XFillArcs XFILLARCS +#define XFillPolygon XFILLPOLYGON +#define XFillRectangle XFILLRECTANGLE +#define XFillRectangles XFILLRECTANGLES +#define XFilterEvent XFILTEREVENT +#define XFindContext XFINDCONTEXT +#define XFlush XFLUSH +#define XFontsOfFontSet XFONTSOFFONTSET +#define XForceScreenSaver XFORCESCREENSAVER +#define XFree XFREE +#define XFreeColormap XFREECOLORMAP +#define XFreeColors XFREECOLORS +#define XFreeCursor XFREECURSOR +#define XFreeDeviceList XFREEDEVICELIST +#define XFreeDeviceState XFREEDEVICESTATE +#define XFreeFont XFREEFONT +#define XFreeFontInfo XFREEFONTINFO +#define XFreeFontNames XFREEFONTNAMES +#define XFreeFontSet XFREEFONTSET +#define XFreeGC XFREEGC +#define XFreeModifiermap XFREEMODIFIERMAP +#define XFreePixmap XFREEPIXMAP +#define XFreeStringList XFREESTRINGLIST +#define XGContextFromGC XGCONTEXTFROMGC +#define XGeometry XGEOMETRY +#define XGetAtomName XGETATOMNAME +#define XGetClassHint XGETCLASSHINT +#define XGetCommand XGETCOMMAND +#define XGetDefault XGETDEFAULT +#define XGetErrorDatabaseText XGETERRORDATABASETEXT +#define XGetErrorText XGETERRORTEXT +#define XGetExtensionVersion XGETEXTENSIONVERSION +#define XGetFontProperty XGETFONTPROPERTY +#define XGetGCValues XGETGCVALUES +#define XGetGeometry XGETGEOMETRY +#define XGetICValues XGETICVALUES +#define XGetIMValues XGETIMVALUES +#define XGetIconName XGETICONNAME +#define XGetIconSizes XGETICONSIZES +#define XGetImage XGETIMAGE +#define XGetInputFocus XGETINPUTFOCUS +#define XGetKeyboardControl XGETKEYBOARDCONTROL +#define XGetKeyboardMapping XGETKEYBOARDMAPPING +#define XGetModifierMapping XGETMODIFIERMAPPING +#define XGetMotionEvents XGETMOTIONEVENTS +#define XGetNormalHints XGETNORMALHINTS +#define XGetPointerControl XGETPOINTERCONTROL +#define XGetPointerMapping XGETPOINTERMAPPING +#define XGetRGBColormaps XGETRGBCOLORMAPS +#define XGetScreenSaver XGETSCREENSAVER +#define XGetSelectionOwner XGETSELECTIONOWNER +#define XGetStandardColormap XGETSTANDARDCOLORMAP +#define XGetSubImage XGETSUBIMAGE +#define XGetTextProperty XGETTEXTPROPERTY +#define XGetVisualInfo XGETVISUALINFO +#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS +#define XGetWMHints XGETWMHINTS +#define XGetWMIconName XGETWMICONNAME +#define XGetWMName XGETWMNAME +#define XGetWMNormalHints XGETWMNORMALHINTS +#define XGetWindowAttributes XGETWINDOWATTRIBUTES +#define XGetWindowProperty XGETWINDOWPROPERTY +#define XGrabButton XGRABBUTTON +#define XGrabKeyboard XGRABKEYBOARD +#define XGrabPointer XGRABPOINTER +#define XGrabServer XGRABSERVER +#define XHeightMMOfScreen XHEIGHTMMOFSCREEN +#define XHeightOfScreen XHEIGHTOFSCREEN +#define XIconifyWindow XICONIFYWINDOW +#define XIfEvent XIFEVENT +#define XInitExtension XINITEXTENSION +#define XInitImage XINITIMAGE +#define XInstallColormap XINSTALLCOLORMAP +#define XInternAtom XINTERNATOM +#define XInternAtoms XINTERNATOMS +#define XIntersectRegion XINTERSECTREGION +#define XKeycodeToKeysym XKEYCODETOKEYSYM +#define XKeysymToKeycode XKEYSYMTOKEYCODE +#define XKeysymToString XKEYSYMTOSTRING +#define XKillClient XKILLCLIENT +#define XListDepths XLISTDEPTHS +#define XListFonts XLISTFONTS +#define XListFontsWithInfo XLISTFONTSWITHINFO +#define XListHosts XLISTHOSTS +#define XListInputDevices XLISTINPUTDEVICES +#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS +#define XListPixmapFormats XLISTPIXMAPFORMATS +#define XListProperties XLISTPROPERTIES +#define XLoadFont XLOADFONT +#define XLoadQueryFont XLOADQUERYFONT +#define XLookupColor XLOOKUPCOLOR +#define XLookupKeysym XLOOKUPKEYSYM +#define XLookupString XLOOKUPSTRING +#define XLowerWindow XLOWERWINDOW +#define XMapRaised XMAPRAISED +#define XMapSubwindows XMAPSUBWINDOWS +#define XMapWindow XMAPWINDOW +#define XMaskEvent XMASKEVENT +#define XMatchVisualInfo XMATCHVISUALINFO +#define XMaxRequestSize XMAXREQUESTSIZE +#define XMissingExtension XMISSINGEXTENSION +#define XMoveResizeWindow XMOVERESIZEWINDOW +#define XMoveWindow XMOVEWINDOW +#define XNextEvent XNEXTEVENT +#define XNextRequest XNEXTREQUEST +#define XNoOp XNOOP +#define XOffsetRegion XOFFSETREGION +#define XOpenDevice XOPENDEVICE +#define XOpenDisplay XOPENDISPLAY +#define XOpenIM XOPENIM +#define XParseColor XPARSECOLOR +#define XParseGeometry XPARSEGEOMETRY +#define XPeekEvent XPEEKEVENT +#define XPeekIfEvent XPEEKIFEVENT +#define XPending XPENDING +#define XPointInRegion XPOINTINREGION +#define XPolygonRegion XPOLYGONREGION +#define XPutBackEvent XPUTBACKEVENT +#define XPutImage XPUTIMAGE +#define XQLength XQLENGTH +#define XQueryBestCursor XQUERYBESTCURSOR +#define XQueryBestStipple XQUERYBESTSTIPPLE +#define XQueryColor XQUERYCOLOR +#define XQueryColors XQUERYCOLORS +#define XQueryDeviceState XQUERYDEVICESTATE +#define XQueryExtension XQUERYEXTENSION +#define XQueryFont XQUERYFONT +#define XQueryKeymap XQUERYKEYMAP +#define XQueryPointer XQUERYPOINTER +#define XQueryTree XQUERYTREE +#define XRaiseWindow XRAISEWINDOW +#define XReadBitmapFile XREADBITMAPFILE +#define XRecolorCursor XRECOLORCURSOR +#define XReconfigureWMWindow XRECONFIGUREWMWINDOW +#define XRectInRegion XRECTINREGION +#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING +#define XRemoveHosts XREMOVEHOSTS +#define XReparentWindow XREPARENTWINDOW +#define XResetScreenSaver XRESETSCREENSAVER +#define XResizeWindow XRESIZEWINDOW +#define XResourceManagerString XRESOURCEMANAGERSTRING +#define XRestackWindows XRESTACKWINDOWS +#define XRotateBuffers XROTATEBUFFERS +#define XRootWindow XROOTWINDOW +#define XRootWindowOfScreen XROOTWINDOWOFSCREEN +#define XSaveContext XSAVECONTEXT +#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN +#define XScreenOfDisplay XSCREENOFDISPLAY +#define XSelectAsyncEvent XSELECTASYNCEVENT +#define XSelectAsyncInput XSELECTASYNCINPUT +#define XSelectExtensionEvent XSELECTEXTENSIONEVENT +#define XSelectInput XSELECTINPUT +#define XSendEvent XSENDEVENT +#define XServerVendor XSERVERVENDOR +#define XSetArcMode XSETARCMODE +#define XSetBackground XSETBACKGROUND +#define XSetClassHint XSETCLASSHINT +#define XSetClipMask XSETCLIPMASK +#define XSetClipOrigin XSETCLIPORIGIN +#define XSetClipRectangles XSETCLIPRECTANGLES +#define XSetCloseDownMode XSETCLOSEDOWNMODE +#define XSetCommand XSETCOMMAND +#define XSetDashes XSETDASHES +#define XSetErrorHandler XSETERRORHANDLER +#define XSetExtensionErrorHandler XSETEXTENSIONERRORHANDLER +#define XSetFillRule XSETFILLRULE +#define XSetFillStyle XSETFILLSTYLE +#define XSetFont XSETFONT +#define XSetForeground XSETFOREGROUND +#define XSetFunction XSETFUNCTION +#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES +#define XSetICFocus XSETICFOCUS +#define XSetICValues XSETICVALUES +#define XSetIOErrorHandler XSETIOERRORHANDLER +#define XSetIconName XSETICONNAME +#define XSetInputFocus XSETINPUTFOCUS +#define XSetLineAttributes XSETLINEATTRIBUTES +#define XSetLocaleModifiers XSETLOCALEMODIFIERS +#define XSetNormalHints XSETNORMALHINTS +#define XSetPlaneMask XSETPLANEMASK +#define XSetRegion XSETREGION +#define XSetRGBColormaps XSETRGBCOLORMAPS +#define XSetScreenSaver XSETSCREENSAVER +#define XSetSelectionOwner XSETSELECTIONOWNER +#define XSetStandardProperties XSETSTANDARDPROPERTIES +#define XSetState XSETSTATE +#define XSetStipple XSETSTIPPLE +#define XSetSubwindowMode XSETSUBWINDOWMODE +#define XSetTSOrigin XSETTSORIGIN +#define XSetTextProperty XSETTEXTPROPERTY +#define XSetTile XSETTILE +#define XSetTransientForHint XSETTRANSIENTFORHINT +#define XSetWMClientMachine XSETWMCLIENTMACHINE +#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS +#define XSetWMHints XSETWMHINTS +#define XSetWMIconName XSETWMICONNAME +#define XSetWMName XSETWMNAME +#define XSetWMNormalHints XSETWMNORMALHINTS +#define XSetWMProperties XSETWMPROPERTIES +#define XSetWMProtocols XSETWMPROTOCOLS +#define XSetWMSizeHints XSETWMSIZEHINTS +#define XSetWindowBackground XSETWINDOWBACKGROUND +#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP +#define XSetWindowBorder XSETWINDOWBORDER +#define XSetWindowBorderPixmap XSETWINDOWBORDERPIXMAP +#define XSetWindowBorderWidth XSETWINDOWBORDERWIDTH +#define XSetWindowColormap XSETWINDOWCOLORMAP +#define XShapeCombineMask XSHAPECOMBINEMASK +#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES +#define XShapeGetRectangles XSHAPEGETRECTANGLES +#define XShapeQueryExtension XSHAPEQUERYEXTENSION +#define XShmAttach XSHMATTACH +#define XShmCreateImage XSHMCREATEIMAGE +#define XShmCreatePixmap XSHMCREATEPIXMAP +#define XShmDetach XSHMDETACH +#define XShmGetEventBase XSHMGETEVENTBASE +#define XShmPutImage XSHMPUTIMAGE +#define XShmQueryExtension XSHMQUERYEXTENSION +#define XShmQueryVersion XSHMQUERYVERSION +#define XShrinkRegion XSHRINKREGION +#define XStoreBuffer XSTOREBUFFER +#define XStoreBytes XSTOREBYTES +#define XStoreColor XSTORECOLOR +#define XStoreColors XSTORECOLORS +#define XStoreName XSTORENAME +#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY +#define XStringToKeysym XSTRINGTOKEYSYM +#define XSubtractRegion XSUBTRACTREGION +#define XSupportsLocale XSUPPORTSLOCALE +#define XSync XSYNC +#define XSynchronize XSYNCHRONIZE +#define XTextExtents XTEXTEXTENTS +#define XTextExtents16 XTEXTEXTENTS16 +#define XTextPropertyToStringList XTEXTPROPERTYTOSTRINGLIST +#define XTextWidth XTEXTWIDTH +#define XTextWidth16 XTEXTWIDTH16 +#define XTranslateCoordinates XTRANSLATECOORDINATES +#define XUndefineCursor XUNDEFINECURSOR +#define XUngrabButton XUNGRABBUTTON +#define XUngrabKeyboard XUNGRABKEYBOARD +#define XUngrabPointer XUNGRABPOINTER +#define XUngrabServer XUNGRABSERVER +#define XUninstallColormap XUNINSTALLCOLORMAP +#define XUnionRectWithRegion XUNIONRECTWITHREGION +#define XUnionRegion XUNIONREGION +#define XUniqueContext XUNIQUECONTEXT +#define XUnloadFont XUNLOADFONT +#define XUnmapWindow XUNMAPWINDOW +#define XUnsetICFocus XUNSETICFOCUS +#define XVaCreateNestedList XVACREATENESTEDLIST +#define XVisualIDFromVisual XVISUALIDFROMVISUAL +#define XWMGeometry XWMGEOMETRY +#define XWarpPointer XWARPPOINTER +#define XWhitePixel XWHITEPIXEL +#define XWhitePixelOfScreen XWHITEPIXELOFSCREEN +#define XWidthMMOfScreen XWIDTHMMOFSCREEN +#define XWidthOfScreen XWIDTHOFSCREEN +#define XWindowEvent XWINDOWEVENT +#define XWithdrawWindow XWITHDRAWWINDOW +#define XXorRegion XXORREGION +#define XcmsQueryColor XCMSQUERYCOLOR +#define XdbeAllocateBackBufferName XDBEALLOCATEBACKBUFFERNAME +#define XdbeFreeVisualInfo XDBEFREEVISUALINFO +#define XdbeGetVisualInfo XDBEGETVISUALINFO +#define XdbeQueryExtension XDBEQUERYEXTENSION +#define XdbeSwapBuffers XDBESWAPBUFFERS +#define XextAddDisplay XEXTADDDISPLAY +#define XextFindDisplay XEXTFINDDISPLAY +#define XextRemoveDisplay XEXTREMOVEDISPLAY +#define XkbSetDetectableAutoRepeat XKBSETDETECTABLEAUTOREPEAT +#define XmActivateProtocol XMACTIVATEPROTOCOL +#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK +#define XmAddProtocols XMADDPROTOCOLS +#define XmChangeColor XMCHANGECOLOR +#define XmClipboardCopy XMCLIPBOARDCOPY +#define XmClipboardCopyByName XMCLIPBOARDCOPYBYNAME +#define XmClipboardEndCopy XMCLIPBOARDENDCOPY +#define XmClipboardEndRetrieve XMCLIPBOARDENDRETRIEVE +#define XmClipboardInquireCount XMCLIPBOARDINQUIRECOUNT +#define XmClipboardInquireFormat XMCLIPBOARDINQUIREFORMAT +#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH +#define XmClipboardLock XMCLIPBOARDLOCK +#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE +#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY +#define XmClipboardStartRetrieve XMCLIPBOARDSTARTRETRIEVE +#define XmClipboardUnlock XMCLIPBOARDUNLOCK +#define XmCommandError XMCOMMANDERROR +#define XmCommandGetChild XMCOMMANDGETCHILD +#define XmCommandSetValue XMCOMMANDSETVALUE +#define XmCreateArrowButton XMCREATEARROWBUTTON +#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET +#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG +#define XmCreateCascadeButton XMCREATECASCADEBUTTON +#define XmCreateCascadeButtonGadget XMCREATECASCADEBUTTONGADGET +#define XmCreateDialogShell XMCREATEDIALOGSHELL +#define XmCreateDragIcon XMCREATEDRAGICON +#define XmCreateDrawingArea XMCREATEDRAWINGAREA +#define XmCreateDrawnButton XMCREATEDRAWNBUTTON +#define XmCreateErrorDialog XMCREATEERRORDIALOG +#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX +#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG +#define XmCreateForm XMCREATEFORM +#define XmCreateFormDialog XMCREATEFORMDIALOG +#define XmCreateFrame XMCREATEFRAME +#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG +#define XmCreateLabel XMCREATELABEL +#define XmCreateLabelGadget XMCREATELABELGADGET +#define XmCreateList XMCREATELIST +#define XmCreateMainWindow XMCREATEMAINWINDOW +#define XmCreateMenuBar XMCREATEMENUBAR +#define XmCreateMessageBox XMCREATEMESSAGEBOX +#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG +#define XmCreateOptionMenu XMCREATEOPTIONMENU +#define XmCreatePanedWindow XMCREATEPANEDWINDOW +#define XmCreatePopupMenu XMCREATEPOPUPMENU +#define XmCreatePromptDialog XMCREATEPROMPTDIALOG +#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU +#define XmCreatePushButton XMCREATEPUSHBUTTON +#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET +#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG +#define XmCreateRadioBox XMCREATERADIOBOX +#define XmCreateRowColumn XMCREATEROWCOLUMN +#define XmCreateScale XMCREATESCALE +#define XmCreateScrollBar XMCREATESCROLLBAR +#define XmCreateScrolledList XMCREATESCROLLEDLIST +#define XmCreateScrolledText XMCREATESCROLLEDTEXT +#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW +#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG +#define XmCreateSeparator XMCREATESEPARATOR +#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET +#define XmCreateSimpleMenuBar XMCREATESIMPLEMENUBAR +#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG +#define XmCreateText XMCREATETEXT +#define XmCreateTextField XMCREATETEXTFIELD +#define XmCreateToggleButton XMCREATETOGGLEBUTTON +#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET +#define XmCreateWarningDialog XMCREATEWARNINGDIALOG +#define XmCvtCTToXmString XMCVTCTTOXMSTRING +#define XmDestroyPixmap XMDESTROYPIXMAP +#define XmDragStart XMDRAGSTART +#define XmDropSiteRegister XMDROPSITEREGISTER +#define XmDropSiteUnregister XMDROPSITEUNREGISTER +#define XmDropSiteUpdate XMDROPSITEUPDATE +#define XmDropTransferStart XMDROPTRANSFERSTART +#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD +#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH +#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY +#define XmFontListCopy XMFONTLISTCOPY +#define XmFontListCreate XMFONTLISTCREATE +#define XmFontListEntryCreate XMFONTLISTENTRYCREATE +#define XmFontListEntryFree XMFONTLISTENTRYFREE +#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT +#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG +#define XmFontListEntryLoad XMFONTLISTENTRYLOAD +#define XmFontListFree XMFONTLISTFREE +#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT +#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT +#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT +#define XmFontListNextEntry XMFONTLISTNEXTENTRY +#define XmGetColors XMGETCOLORS +#define XmGetColorCalculation XMGETCOLORCALCULATION +#define XmGetFocusWidget XMGETFOCUSWIDGET +#define XmGetMenuCursor XMGETMENUCURSOR +#define XmGetPixmap XMGETPIXMAP +#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH +#define XmGetTearOffControl XMGETTEAROFFCONTROL +#define XmGetXmDisplay XMGETXMDISPLAY +#define XmImMbLookupString XMIMMBLOOKUPSTRING +#define XmImRegister XMIMREGISTER +#define XmImSetFocusValues XMIMSETFOCUSVALUES +#define XmImSetValues XMIMSETVALUES +#define XmImUnregister XMIMUNREGISTER +#define XmImUnsetFocus XMIMUNSETFOCUS +#define XmInstallImage XMINSTALLIMAGE +#define XmInternAtom XMINTERNATOM +#define XmIsMotifWMRunning XMISMOTIFWMRUNNING +#define XmListAddItem XMLISTADDITEM +#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED +#define XmListAddItems XMLISTADDITEMS +#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED +#define XmListDeleteAllItems XMLISTDELETEALLITEMS +#define XmListDeleteItem XMLISTDELETEITEM +#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS +#define XmListDeletePos XMLISTDELETEPOS +#define XmListDeselectAllItems XMLISTDESELECTALLITEMS +#define XmListDeselectPos XMLISTDESELECTPOS +#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS +#define XmListGetMatchPos XMLISTGETMATCHPOS +#define XmListGetSelectedPos XMLISTGETSELECTEDPOS +#define XmListItemExists XMLISTITEMEXISTS +#define XmListItemPos XMLISTITEMPOS +#define XmListPosSelected XMLISTPOSSELECTED +#define XmListReplaceItems XMLISTREPLACEITEMS +#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS +#define XmListSelectItem XMLISTSELECTITEM +#define XmListSelectPos XMLISTSELECTPOS +#define XmListSetBottomPos XMLISTSETBOTTOMPOS +#define XmListSetItem XMLISTSETITEM +#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS +#define XmListSetPos XMLISTSETPOS +#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS +#define XmMenuPosition XMMENUPOSITION +#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD +#define XmOptionButtonGadget XMOPTIONBUTTONGADGET +#define XmOptionLabelGadget XMOPTIONLABELGADGET +#define XmProcessTraversal XMPROCESSTRAVERSAL +#define XmQmotif XMQMOTIF +#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK +#define XmRemoveProtocols XMREMOVEPROTOCOLS +#define XmRemoveTabGroup XMREMOVETABGROUP +#define XmRepTypeGetId XMREPTYPEGETID +#define XmRepTypeGetRecord XMREPTYPEGETRECORD +#define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON +#define XmRepTypeRegister XMREPTYPEREGISTER +#define XmRepTypeValidValue XMREPTYPEVALIDVALUE +#define XmScrollBarGetValues XMSCROLLBARGETVALUES +#define XmScrollBarSetValues XMSCROLLBARSETVALUES +#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS +#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD +#define XmSetColorCalculation XMSETCOLORCALCULATION +#define XmStringByteCompare XMSTRINGBYTECOMPARE +#define XmStringCompare XMSTRINGCOMPARE +#define XmStringConcat XMSTRINGCONCAT +#define XmStringCopy XMSTRINGCOPY +#define XmStringCreate XMSTRINGCREATE +#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED +#define XmStringCreateLtoR XMSTRINGCREATELTOR +#define XmStringCreateSimple XMSTRINGCREATESIMPLE +#define XmStringDraw XMSTRINGDRAW +#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE +#define XmStringExtent XMSTRINGEXTENT +#define XmStringFree XMSTRINGFREE +#define XmStringFreeContext XMSTRINGFREECONTEXT +#define XmStringGetLtoR XMSTRINGGETLTOR +#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT +#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT +#define XmStringInitContext XMSTRINGINITCONTEXT +#define XmStringLength XMSTRINGLENGTH +#define XmStringLtoRCreate XMSTRINGLTORCREATE +#define XmStringNConcat XMSTRINGNCONCAT +#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE +#define XmStringSeparatorCreate XMSTRINGSEPARATORCREATE +#define XmStringWidth XMSTRINGWIDTH +#define XmTextClearSelection XMTEXTCLEARSELECTION +#define XmTextCopy XMTEXTCOPY +#define XmTextCut XMTEXTCUT +#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION +#define XmTextFieldCopy XMTEXTFIELDCOPY +#define XmTextFieldCut XMTEXTFIELDCUT +#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE +#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION +#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION +#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH +#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION +#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION +#define XmTextFieldGetString XMTEXTFIELDGETSTRING +#define XmTextFieldInsert XMTEXTFIELDINSERT +#define XmTextFieldPaste XMTEXTFIELDPASTE +#define XmTextFieldRemove XMTEXTFIELDREMOVE +#define XmTextFieldReplace XMTEXTFIELDREPLACE +#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE +#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT +#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION +#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH +#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION +#define XmTextFieldSetString XMTEXTFIELDSETSTRING +#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION +#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION +#define XmTextGetEditable XMTEXTGETEDITABLE +#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION +#define XmTextGetLastPosition XMTEXTGETLASTPOSITION +#define XmTextGetMaxLength XMTEXTGETMAXLENGTH +#define XmTextGetSelection XMTEXTGETSELECTION +#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION +#define XmTextGetString XMTEXTGETSTRING +#define XmTextInsert XMTEXTINSERT +#define XmTextPaste XMTEXTPASTE +#define XmTextPosToXY XMTEXTPOSTOXY +#define XmTextRemove XMTEXTREMOVE +#define XmTextReplace XMTEXTREPLACE +#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION +#define XmTextSetEditable XMTEXTSETEDITABLE +#define XmTextSetHighlight XMTEXTSETHIGHLIGHT +#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION +#define XmTextSetSelection XMTEXTSETSELECTION +#define XmTextSetString XMTEXTSETSTRING +#define XmTextSetTopCharacter XMTEXTSETTOPCHARACTER +#define XmTextShowPosition XMTEXTSHOWPOSITION +#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE +#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE +#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE +#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE +#define XmUninstallImage XMUNINSTALLIMAGE +#define XmUpdateDisplay XMUPDATEDISPLAY +#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX +#define XmbDrawString XMBDRAWSTRING +#define XmbLookupString XMBLOOKUPSTRING +#define XmbResetIC XMBRESETIC +#define XmbSetWMProperties XMBSETWMPROPERTIES +#define XmbTextEscapement XMBTEXTESCAPEMENT +#define XmbTextExtents XMBTEXTEXTENTS +#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY +#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST +#define XmbufCreateBuffers XMBUFCREATEBUFFERS +#define XmbufDestroyBuffers XMBUFDESTROYBUFFERS +#define XmbufDisplayBuffers XMBUFDISPLAYBUFFERS +#define XmbufQueryExtension XMBUFQUERYEXTENSION +#define Xmemory_free XMEMORY_FREE +#define Xmemory_malloc XMEMORY_MALLOC +#define XmuClientWindow XMUCLIENTWINDOW +#define XmuConvertStandardSelection XMUCONVERTSTANDARDSELECTION +#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP +#define XmuInternAtom XMUINTERNATOM +#define XmuInternStrings XMUINTERNSTRINGS +#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP +#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE +#define XrmCombineDatabase XRMCOMBINEDATABASE +#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE +#define XrmDestroyDatabase XRMDESTROYDATABASE +#define XrmGetDatabase XRMGETDATABASE +#define XrmGetFileDatabase XRMGETFILEDATABASE +#define XrmGetResource XRMGETRESOURCE +#define XrmGetStringDatabase XRMGETSTRINGDATABASE +#define XrmInitialize XRMINITIALIZE +#define XrmMergeDatabases XRMMERGEDATABASES +#define XrmParseCommand XRMPARSECOMMAND +#define XrmPermStringToQuark XRMPERMSTRINGTOQUARK +#define XrmPutFileDatabase XRMPUTFILEDATABASE +#define XrmPutLineResource XRMPUTLINERESOURCE +#define XrmPutStringResource XRMPUTSTRINGRESOURCE +#define XrmQGetResource XRMQGETRESOURCE +#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE +#define XrmQuarkToString XRMQUARKTOSTRING +#define XrmSetDatabase XRMSETDATABASE +#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST +#define XrmStringToQuark XRMSTRINGTOQUARK +#define XtAddCallback XTADDCALLBACK +#define XtAddCallbacks XTADDCALLBACKS +#define XtAddConverter XTADDCONVERTER +#define XtAddEventHandler XTADDEVENTHANDLER +#define XtAddExposureToRegion XTADDEXPOSURETOREGION +#define XtAddGrab XTADDGRAB +#define XtAddRawEventHandler XTADDRAWEVENTHANDLER +#define XtAllocateGC XTALLOCATEGC +#define XtAppAddActions XTAPPADDACTIONS +#define XtAppAddInput XTAPPADDINPUT +#define XtAppAddTimeOut XTAPPADDTIMEOUT +#define XtAppAddWorkProc XTAPPADDWORKPROC +#define XtAppCreateShell XTAPPCREATESHELL +#define XtAppError XTAPPERROR +#define XtAppErrorMsg XTAPPERRORMSG +#define XtAppGetErrorDatabase XTAPPGETERRORDATABASE +#define XtAppGetErrorDatabaseText XTAPPGETERRORDATABASETEXT +#define XtAppSetErrorMsgHandler XTAPPSETERRORMSGHANDLER +#define XtAppInitialize XTAPPINITIALIZE +#define XtAppMainLoop XTAPPMAINLOOP +#define XtAppNextEvent XTAPPNEXTEVENT +#define XtAppPeekEvent XTAPPPEEKEVENT +#define XtAppPending XTAPPPENDING +#define XtAppProcessEvent XTAPPPROCESSEVENT +#define XtAppSetErrorHandler XTAPPSETERRORHANDLER +#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES +#define XtAppSetTypeConverter XTAPPSETTYPECONVERTER +#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER +#define XtAppWarningMsg XTAPPWARNINGMSG +#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER +#define XtAppWarning XTAPPWARNING +#define XtAugmentTranslations XTAUGMENTTRANSLATIONS +#define XtCallActionProc XTCALLACTIONPROC +#define XtCallCallbackList XTCALLCALLBACKLIST +#define XtCallCallbacks XTCALLCALLBACKS +#define XtCallConverter XTCALLCONVERTER +#define XtCalloc XTCALLOC +#ifndef NOXTDISPLAY +#define XtClass XTCLASS +#endif +#define XtCloseDisplay XTCLOSEDISPLAY +#define XtConfigureWidget XTCONFIGUREWIDGET +#define XtConvert XTCONVERT +#define XtConvertAndStore XTCONVERTANDSTORE +#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT +#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET +#define XtCreatePopupShell XTCREATEPOPUPSHELL +#define XtCreateWidget XTCREATEWIDGET +#define XtCreateWindow XTCREATEWINDOW +#define XtCvtStringToFont XTCVTSTRINGTOFONT +#define XtDatabase XTDATABASE +#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT +#define XtDestroyWidget XTDESTROYWIDGET +#define XtDisownSelection XTDISOWNSELECTION +#define XtDispatchEvent XTDISPATCHEVENT +#ifndef NOXTDISPLAY +#define XtDisplay XTDISPLAY +#endif +#define XtDisplayInitialize XTDISPLAYINITIALIZE +#define XtDisplayOfObject XTDISPLAYOFOBJECT +#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING +#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT +#define XtError XTERROR +#define XtErrorMsg XTERRORMSG +#define XtFree XTFREE +#define XtGetActionKeysym XTGETACTIONKEYSYM +#define XtGetActionList XTGETACTIONLIST +#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS +#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES +#define XtGetClassExtension XTGETCLASSEXTENSION +#define XtGetConstraintResourceList XTGETCONSTRAINTRESOURCELIST +#define XtGetGC XTGETGC +#define XtGetMultiClickTime XTGETMULTICLICKTIME +#define XtGetResourceList XTGETRESOURCELIST +#define XtGetSelectionValue XTGETSELECTIONVALUE +#define XtGetSelectionValues XTGETSELECTIONVALUES +#define XtGetSubresources XTGETSUBRESOURCES +#define XtGetValues XTGETVALUES +#define XtGrabButton XTGRABBUTTON +#define XtGrabKeyboard XTGRABKEYBOARD +#define XtGrabPointer XTGRABPOINTER +#define XtHasCallbacks XTHASCALLBACKS +#define XtInitialize XTINITIALIZE +#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS +#define XtInsertEventHandler XTINSERTEVENTHANDLER +#define XtInsertRawEventHandler XTINSERTRAWEVENTHANDLER +#define XtInstallAccelerators XTINSTALLACCELERATORS +#define XtIsManaged XTISMANAGED +#define XtIsObject XTISOBJECT +#ifndef NOXTDISPLAY +#define XtIsRealized XTISREALIZED +#endif +#define XtIsSensitive XTISSENSITIVE +#define XtIsSubclass XTISSUBCLASS +#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED +#define XtMainLoop XTMAINLOOP +#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST +#define XtMakeResizeRequest XTMAKERESIZEREQUEST +#define XtMalloc XTMALLOC +#define XtManageChild XTMANAGECHILD +#define XtManageChildren XTMANAGECHILDREN +#define XtMergeArgLists XTMERGEARGLISTS +#define XtMoveWidget XTMOVEWIDGET +#define XtName XTNAME +#define XtNameToWidget XTNAMETOWIDGET +#define XtOpenApplication XTOPENAPPLICATION +#define XtOpenDisplay XTOPENDISPLAY +#define XtOverrideTranslations XTOVERRIDETRANSLATIONS +#define XtOwnSelection XTOWNSELECTION +#ifndef NOXTDISPLAY +#define XtParent XTPARENT +#endif +#define XtParseAcceleratorTable XTPARSEACCELERATORTABLE +#define XtParseTranslationTable XTPARSETRANSLATIONTABLE +#define XtPopdown XTPOPDOWN +#define XtPopup XTPOPUP +#define XtPopupSpringLoaded XTPOPUPSPRINGLOADED +#define XtQueryGeometry XTQUERYGEOMETRY +#define XtRealizeWidget XTREALIZEWIDGET +#define XtRealloc XTREALLOC +#define XtRegisterDrawable _XTREGISTERWINDOW +#define XtRegisterGrabAction XTREGISTERGRABACTION +#define XtReleaseGC XTRELEASEGC +#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS +#define XtRemoveCallback XTREMOVECALLBACK +#define XtRemoveEventHandler XTREMOVEEVENTHANDLER +#define XtRemoveGrab XTREMOVEGRAB +#define XtRemoveInput XTREMOVEINPUT +#define XtRemoveTimeOut XTREMOVETIMEOUT +#define XtRemoveWorkProc XTREMOVEWORKPROC +#define XtResizeWidget XTRESIZEWIDGET +#define XtResolvePathname XTRESOLVEPATHNAME +#ifndef NOXTDISPLAY +#define XtScreen XTSCREEN +#endif +#define XtScreenDatabase XTSCREENDATABASE +#define XtScreenOfObject XTSCREENOFOBJECT +#define XtSessionReturnToken XTSESSIONRETURNTOKEN +#define XtSetErrorHandler XTSETERRORHANDLER +#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS +#define XtSetLanguageProc XTSETLANGUAGEPROC +#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED +#define XtSetSensitive XTSETSENSITIVE +#define XtSetTypeConverter XTSETTYPECONVERTER +#define XtSetValues XTSETVALUES +#define XtShellStrings XTSHELLSTRINGS +#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING +#define XtStrings XTSTRINGS +#define XtToolkitInitialize XTTOOLKITINITIALIZE +#define XtTranslateCoords XTTRANSLATECOORDS +#define XtTranslateKeycode XTTRANSLATEKEYCODE +#define XtUngrabButton XTUNGRABBUTTON +#define XtUngrabKeyboard XTUNGRABKEYBOARD +#define XtUngrabPointer XTUNGRABPOINTER +#define XtUnmanageChild XTUNMANAGECHILD +#define XtUnmanageChildren XTUNMANAGECHILDREN +#define XtUnrealizeWidget XTUNREALIZEWIDGET +#define XtUnregisterDrawable _XTUNREGISTERWINDOW +#define XtVaAppCreateShell XTVAAPPCREATESHELL +#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET +#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL +#define XtVaCreateWidget XTVACREATEWIDGET +#define XtVaGetApplicationResources XTVAGETAPPLICATIONRESOURCES +#define XtVaGetValues XTVAGETVALUES +#define XtVaSetValues XTVASETVALUES +#define XtWarning XTWARNING +#define XtWarningMsg XTWARNINGMSG +#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT +#ifndef NOXTDISPLAY +#define XtWindow XTWINDOW +#endif +#define XtWindowOfObject XTWINDOWOFOBJECT +#define XtWindowToWidget XTWINDOWTOWIDGET +#define XwcDrawImageString XWCDRAWIMAGESTRING +#define XwcDrawString XWCDRAWSTRING +#define XwcFreeStringList XWCFREESTRINGLIST +#define XwcTextEscapement XWCTEXTESCAPEMENT +#define XwcTextExtents XWCTEXTEXTENTS +#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY +#define XwcLookupString XWCLOOKUPSTRING +#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST +#define _XAllocTemp _XALLOCTEMP +#define _XDeqAsyncHandler _XDEQASYNCHANDLER +#define _XEatData _XEATDATA +#define _XFlush _XFLUSH +#define _XFreeTemp _XFREETEMP +#define _XGetAsyncReply _XGETASYNCREPLY +#define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS +#define _XRead _XREAD +#define _XReadPad _XREADPAD +#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE +#define _XReply _XREPLY +#define _XSend _XSEND +#define _XUnregisterFilter _XUNREGISTERFILTER +#define _XVIDtoVisual _XVIDTOVISUAL +#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT +#define _XmClearBorder _XMCLEARBORDER +#define _XmConfigureObject _XMCONFIGUREOBJECT +#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK +#define _XmDrawArrow _XMDRAWARROW +#define _XmDrawShadows _XMDRAWSHADOWS +#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT +#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS +#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS +#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR +#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST +#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON +#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA +#define _XmGrabKeyboard _XMGRABKEYBOARD +#define _XmGrabPointer _XMGRABPOINTER +#define _XmInheritClass _XMINHERITCLASS +#define _XmInputForGadget _XMINPUTFORGADGET +#define _XmInputInGadget _XMINPUTINGADGET +#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST +#define _XmMenuPopDown _XMMENUPOPDOWN +#define _XmMoveObject _XMMOVEOBJECT +#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED +#define _XmOSBuildFileList _XMOSBUILDFILELIST +#define _XmOSFileCompare _XMOSFILECOMPARE +#define _XmOSFindPatternPart _XMOSFINDPATTERNPART +#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC +#define _XmPostPopupMenu _XMPOSTPOPUPMENU +#define _XmPrimitiveEnter _XMPRIMITIVEENTER +#define _XmPrimitiveLeave _XMPRIMITIVELEAVE +#define _XmRedisplayGadgets _XMREDISPLAYGADGETS +#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE +#define _XmStringDraw _XMSTRINGDRAW +#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT +#define _XmStrings _XMSTRINGS +#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS +#define _XmToVerticalPixels _XMTOVERTICALPIXELS +#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT +#define _Xm_fastPtr _XM_FASTPTR +#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG +#define _XtCopyFromArg _XTCOPYFROMARG +#define _XtCountVaList _XTCOUNTVALIST +#define _XtInherit _XTINHERIT +#define _XtInheritTranslations _XTINHERITTRANSLATIONS +#define _XtIsSubclassOf _XTISSUBCLASSOF +#define _XtVaToArgList _XTVATOARGLIST +#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS +#define cli$dcl_parse CLI$DCL_PARSE +#define cli$get_value CLI$GET_VALUE +#define cli$present CLI$PRESENT +#define compositeClassRec COMPOSITECLASSREC +#define compositeWidgetClass COMPOSITEWIDGETCLASS +#define constraintClassRec CONSTRAINTCLASSREC +#define constraintWidgetClass CONSTRAINTWIDGETCLASS +#define coreWidgetClass COREWIDGETCLASS +#define exe$getspi EXE$GETSPI +#define lbr$close LBR$CLOSE +#define lbr$get_header LBR$GET_HEADER +#define lbr$get_index LBR$GET_INDEX +#define lbr$get_record LBR$GET_RECORD +#define lbr$ini_control LBR$INI_CONTROL +#define lbr$lookup_key LBR$LOOKUP_KEY +#define lbr$open LBR$OPEN +#define lbr$output_help LBR$OUTPUT_HELP +#define lib$add_times LIB$ADD_TIMES +#define lib$addx LIB$ADDX +#define lib$create_dir LIB$CREATE_DIR +#define lib$create_vm_zone LIB$CREATE_VM_ZONE +#define lib$cvt_from_internal_time LIB$CVT_FROM_INTERNAL_TIME +#define lib$cvt_htb LIB$CVT_HTB +#define lib$cvt_vectim LIB$CVT_VECTIM +#define lib$day LIB$DAY +#define lib$day_of_week LIB$DAY_OF_WEEK +#define lib$delete_symbol LIB$DELETE_SYMBOL +#define lib$delete_vm_zone LIB$DELETE_VM_ZONE +#define lib$disable_ctrl LIB$DISABLE_CTRL +#define lib$ediv LIB$EDIV +#define lib$emul LIB$EMUL +#define lib$enable_ctrl LIB$ENABLE_CTRL +#define lib$find_vm_zone LIB$FIND_VM_ZONE +#define lib$format_date_time LIB$FORMAT_DATE_TIME +#define lib$free_timer LIB$FREE_TIMER +#define lib$free_vm LIB$FREE_VM +#define lib$get_ef LIB$GET_EF +#define lib$get_foreign LIB$GET_FOREIGN +#define lib$get_input LIB$GET_INPUT +#define lib$get_users_language LIB$GET_USERS_LANGUAGE +#define lib$get_vm LIB$GET_VM +#define lib$get_symbol LIB$GET_SYMBOL +#define lib$getdvi LIB$GETDVI +#define lib$init_date_time_context LIB$INIT_DATE_TIME_CONTEXT +#define lib$init_timer LIB$INIT_TIMER +#define lib$find_file LIB$FIND_FILE +#define lib$find_file_end LIB$FIND_FILE_END +#define lib$find_image_symbol LIB$FIND_IMAGE_SYMBOL +#define lib$mult_delta_time LIB$MULT_DELTA_TIME +#define lib$put_output LIB$PUT_OUTPUT +#define lib$rename_file LIB$RENAME_FILE +#define lib$reset_vm_zone LIB$RESET_VM_ZONE +#define lib$set_symbol LIB$SET_SYMBOL +#define lib$sfree1_dd LIB$SFREE1_DD +#define lib$show_vm LIB$SHOW_VM +#define lib$show_vm_zone LIB$SHOW_VM_ZONE +#define lib$spawn LIB$SPAWN +#define lib$stat_timer LIB$STAT_TIMER +#define lib$subx LIB$SUBX +#define lib$sub_times LIB$SUB_TIMES +#define lib$wait LIB$WAIT +#define mail$send_add_address MAIL$SEND_ADD_ADDRESS +#define mail$send_add_attribute MAIL$SEND_ADD_ATTRIBUTE +#define mail$send_add_bodypart MAIL$SEND_ADD_BODYPART +#define mail$send_begin MAIL$SEND_BEGIN +#define mail$send_end MAIL$SEND_END +#define mail$send_message MAIL$SEND_MESSAGE +#define ncs$convert NCS$CONVERT +#define ncs$get_cf NCS$GET_CF +#define objectClass OBJECTCLASS +#define objectClassRec OBJECTCLASSREC +#define overrideShellClassRec OVERRIDESHELLCLASSREC +#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS +#define pthread_attr_create PTHREAD_ATTR_CREATE +#define pthread_attr_delete PTHREAD_ATTR_DELETE +#define pthread_attr_destroy PTHREAD_ATTR_DESTROY +#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP +#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP +#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED +#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO +#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED +#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM +#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY +#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE +#define pthread_attr_init PTHREAD_ATTR_INIT +#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP +#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE +#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP +#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED +#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO +#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED +#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM +#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY +#ifndef pthread_attr_setscope +# define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE +#endif +#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE +#define pthread_cancel PTHREAD_CANCEL +#define pthread_cancel_e PTHREAD_CANCEL_E +#define pthread_cond_broadcast PTHREAD_COND_BROADCAST +#define pthread_cond_destroy PTHREAD_COND_DESTROY +#define pthread_cond_init PTHREAD_COND_INIT +#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP +#define pthread_cond_signal PTHREAD_COND_SIGNAL +#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP +#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT +#define pthread_cond_wait PTHREAD_COND_WAIT +#define pthread_condattr_create PTHREAD_CONDATTR_CREATE +#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE +#define pthread_condattr_init PTHREAD_CONDATTR_INIT +#define pthread_create PTHREAD_CREATE +#define pthread_delay_np PTHREAD_DELAY_NP +#define pthread_detach PTHREAD_DETACH +#define pthread_equal PTHREAD_EQUAL +#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP +#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP +#define pthread_exc_matches_np PTHREAD_EXC_MATCHES_NP +#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP +#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP +#define pthread_exc_raise_np PTHREAD_EXC_RAISE_NP +#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP +#define pthread_exit PTHREAD_EXIT +#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP +#define pthread_getprio PTHREAD_GETPRIO +#define pthread_getschedparam PTHREAD_GETSCHEDPARAM +#define pthread_getscheduler PTHREAD_GETSCHEDULER +#define pthread_getspecific PTHREAD_GETSPECIFIC +#define pthread_getunique_np PTHREAD_GETUNIQUE_NP +#define pthread_join PTHREAD_JOIN +#define pthread_join32 PTHREAD_JOIN32 +#define pthread_key_create PTHREAD_KEY_CREATE +#define pthread_key_delete PTHREAD_KEY_DELETE +#define pthread_keycreate PTHREAD_KEYCREATE +#define pthread_kill PTHREAD_KILL +#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP +#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY +#define pthread_mutex_init PTHREAD_MUTEX_INIT +#define pthread_mutex_lock PTHREAD_MUTEX_LOCK +#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK +#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK +#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE +#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE +#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY +#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP +#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT +#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP +#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP +#define pthread_once PTHREAD_ONCE +#define pthread_resume_np PTHREAD_RESUME_NP +#define pthread_self PTHREAD_SELF +#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL +#define pthread_setcancel PTHREAD_SETCANCEL +#define pthread_setcancelstate PTHREAD_SETCANCELSTATE +#define pthread_setcanceltype PTHREAD_SETCANCELTYPE +#define pthread_setprio PTHREAD_SETPRIO +#define pthread_setschedparam PTHREAD_SETSCHEDPARAM +#define pthread_setscheduler PTHREAD_SETSCHEDULER +#define pthread_setspecific PTHREAD_SETSPECIFIC +#define pthread_suspend_np PTHREAD_SUSPEND_NP +#define pthread_testcancel PTHREAD_TESTCANCEL +#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP +#define pthread_yield PTHREAD_YIELD +#define pthread_yield_np PTHREAD_YIELD_NP +#define rectObjClass RECTOBJCLASS +#define rectObjClassRec RECTOBJCLASSREC +#define sessionShellWidgetClass SESSIONSHELLWIDGETCLASS +#define shellWidgetClass SHELLWIDGETCLASS +#define shmat SHMAT +#define shmctl SHMCTL +#define shmdt SHMDT +#define shmget SHMGET +#define smg$create_key_table SMG$CREATE_KEY_TABLE +#define smg$create_virtual_keyboard SMG$CREATE_VIRTUAL_KEYBOARD +#define smg$read_composed_line SMG$READ_COMPOSED_LINE +#define sys$add_ident SYS$ADD_IDENT +#define sys$asctoid SYS$ASCTOID +#define sys$assign SYS$ASSIGN +#define sys$bintim SYS$BINTIM +#define sys$cancel SYS$CANCEL +#define sys$cantim SYS$CANTIM +#define sys$check_access SYS$CHECK_ACCESS +#define sys$close SYS$CLOSE +#define sys$connect SYS$CONNECT +#define sys$create SYS$CREATE +#define sys$create_user_profile SYS$CREATE_USER_PROFILE +#define sys$crembx SYS$CREMBX +#define sys$creprc SYS$CREPRC +#define sys$crmpsc SYS$CRMPSC +#define sys$dassgn SYS$DASSGN +#define sys$dclast SYS$DCLAST +#define sys$dclexh SYS$DCLEXH +#define sys$delprc SYS$DELPRC +#define sys$deq SYS$DEQ +#define sys$dgblsc SYS$DGBLSC +#define sys$display SYS$DISPLAY +#define sys$enq SYS$ENQ +#define sys$enqw SYS$ENQW +#define sys$erase SYS$ERASE +#define sys$fao SYS$FAO +#define sys$faol SYS$FAOL +#define sys$find_held SYS$FIND_HELD +#define sys$finish_rdb SYS$FINISH_RDB +#define sys$flush SYS$FLUSH +#define sys$forcex SYS$FORCEX +#define sys$get SYS$GET +#define sys$get_security SYS$GET_SECURITY +#define sys$getdviw SYS$GETDVIW +#define sys$getjpi SYS$GETJPI +#define sys$getjpiw SYS$GETJPIW +#define sys$getlkiw SYS$GETLKIW +#define sys$getmsg SYS$GETMSG +#define sys$getsyi SYS$GETSYI +#define sys$getsyiw SYS$GETSYIW +#define sys$gettim SYS$GETTIM +#define sys$getuai SYS$GETUAI +#define sys$grantid SYS$GRANTID +#define sys$hash_password SYS$HASH_PASSWORD +#define sys$hiber SYS$HIBER +#define sys$mgblsc SYS$MGBLSC +#define sys$numtim SYS$NUMTIM +#define sys$open SYS$OPEN +#define sys$parse SYS$PARSE +#define sys$parse_acl SYS$PARSE_ACL +#define sys$parse_acl SYS$PARSE_ACL +#define sys$persona_assume SYS$PERSONA_ASSUME +#define sys$persona_create SYS$PERSONA_CREATE +#define sys$persona_delete SYS$PERSONA_DELETE +#define sys$process_scan SYS$PROCESS_SCAN +#define sys$put SYS$PUT +#define sys$qio SYS$QIO +#define sys$qiow SYS$QIOW +#define sys$read SYS$READ +#define sys$resched SYS$RESCHED +#define sys$rewind SYS$REWIND +#define sys$search SYS$SEARCH +#define sys$set_security SYS$SET_SECURITY +#define sys$setast SYS$SETAST +#define sys$setef SYS$SETEF +#define sys$setimr SYS$SETIMR +#define sys$setpri SYS$SETPRI +#define sys$setprn SYS$SETPRN +#define sys$setprv SYS$SETPRV +#define sys$setswm SYS$SETSWM +#define sys$setuai SYS$SETUAI +#define sys$sndopr SYS$SNDOPR +#define sys$synch SYS$SYNCH +#define sys$trnlnm SYS$TRNLNM +#define sys$update SYS$UPDATE +#define sys$wake SYS$WAKE +#define sys$write SYS$WRITE +#define topLevelShellClassRec TOPLEVELSHELLCLASSREC +#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS +#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS +#define vendorShellClassRec VENDORSHELLCLASSREC +#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS +#define widgetClass WIDGETCLASS +#define widgetClassRec WIDGETCLASSREC +#define wmShellClassRec WMSHELLCLASSREC +#define wmShellWidgetClass WMSHELLWIDGETCLASS +#define x$soft_ast_lib_lock X$SOFT_AST_LIB_LOCK +#define x$soft_ast_lock_depth X$SOFT_AST_LOCK_DEPTH +#define x$soft_reenable_asts X$SOFT_REENABLE_ASTS +#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS +#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS +#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC +#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS +#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS +#define xmCommandWidgetClass XMCOMMANDWIDGETCLASS +#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS +#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS +#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS +#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS +#define xmFormWidgetClass XMFORMWIDGETCLASS +#define xmFrameWidgetClass XMFRAMEWIDGETCLASS +#define xmGadgetClass XMGADGETCLASS +#define xmLabelGadgetClass XMLABELGADGETCLASS +#define xmLabelWidgetClass XMLABELWIDGETCLASS +#define xmListWidgetClass XMLISTWIDGETCLASS +#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS +#define xmManagerClassRec XMMANAGERCLASSREC +#define xmManagerWidgetClass XMMANAGERWIDGETCLASS +#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS +#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS +#define xmPrimitiveClassRec XMPRIMITIVECLASSREC +#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS +#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC +#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS +#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS +#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS +#define xmSashWidgetClass XMSASHWIDGETCLASS +#define xmScaleWidgetClass XMSCALEWIDGETCLASS +#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS +#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC +#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS +#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS +#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS +#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS +#define xmTextWidgetClass XMTEXTWIDGETCLASS +#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS +#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS + +#if (__VMS_VER < 80200000) +# define SetReqLen(req,n,badlen) \ + if ((req->length + n) > (unsigned)65535) { \ + n = badlen; \ + req->length += n; \ + } else \ + req->length += n +#endif + +#ifdef __cplusplus +extern "C" { +#endif +extern void XtFree(char*); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Mesa/prj/build.lst b/Mesa/prj/build.lst new file mode 100644 index 000000000000..8910be4da8ea --- /dev/null +++ b/Mesa/prj/build.lst @@ -0,0 +1,3 @@ +me Mesa : solenv NULL +me Mesa usr1 - u me_mkout NULL +me Mesa\prj get - all me_prj NULL diff --git a/Mesa/prj/d.lst b/Mesa/prj/d.lst new file mode 100644 index 000000000000..5991e2066540 --- /dev/null +++ b/Mesa/prj/d.lst @@ -0,0 +1,3 @@ +mkdir: %_DEST%\inc%_EXT%\GL + +..\inc\*.h %_DEST%\inc%_EXT%\GL\*.h -- cgit From aab9dafd7b89ef764a691d2ad4abd14ec88dddf4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Sep 2010 12:10:19 +0200 Subject: win32-dxsdk-200908.diff: Build also against DirectX SDK August 2009. --- canvas/source/directx/dx_winstuff.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/canvas/source/directx/dx_winstuff.hxx b/canvas/source/directx/dx_winstuff.hxx index d1718b07f3d1..935c12501768 100755 --- a/canvas/source/directx/dx_winstuff.hxx +++ b/canvas/source/directx/dx_winstuff.hxx @@ -84,9 +84,14 @@ #else + #include #include #include -// #include #i107614# removing include, it has been changed in the latest sdk fron August2009 from dxerr9.h into dxerr.h + #if _DXSDK_BUILD_MAJOR < 1734 /* Earlier than the August 2009 DXSDK */ + #include + #else + #include + #endif typedef IDirect3DSurface9 surface_type; -- cgit From 6e84ca7a66032b1c1a4f19e4fdfdf1879cd05842 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Sep 2010 12:20:45 +0200 Subject: build-fix-win32.diff: Fix Windows build on partitions without short names --- external/msvcp80/README_msvcX80.dll | 5 +++-- external/prj/d.lst | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/external/msvcp80/README_msvcX80.dll b/external/msvcp80/README_msvcX80.dll index 364f172bde84..fa89ab964d6a 100644 --- a/external/msvcp80/README_msvcX80.dll +++ b/external/msvcp80/README_msvcX80.dll @@ -1,2 +1,3 @@ -Put the msvcp80.dll and msvcr80.dll in this directory for Windows builds using -a VS 2005 compiler. +Put the msvcp80.dll, msvcr80.dll and Microsoft.VC80.CRT.manifest in this +directory for Windows builds using VS 2005, or using prebuilt Mozilla DLLs +that were built using VS 2005. diff --git a/external/prj/d.lst b/external/prj/d.lst index 9e0c68129c77..ff1b19a0e94f 100644 --- a/external/prj/d.lst +++ b/external/prj/d.lst @@ -36,8 +36,8 @@ mkdir: %_DEST%\inc%_EXT%\external\mingw\include\sys ..\msvcp80\msvcm80*.dll %_DEST%\bin%_EXT% ..\msvcp80\msvcp80*.dll %_DEST%\bin%_EXT% ..\msvcp80\msvcr80*.dll %_DEST%\bin%_EXT% -..\msvcp90\Microsoft.VC80.CRT.manifest %_DEST%\bin%_EXT%\Microsoft.VC80.CRT.manifest -..\msvcp90\Microsoft.VC80.DebugCRT.manifest %_DEST%\bin%_EXT%\Microsoft.VC80.DebugCRT.manifest +..\msvcp80\Microsoft.VC80.CRT.manifest %_DEST%\bin%_EXT%\Microsoft.VC80.CRT.manifest +..\msvcp80\Microsoft.VC80.DebugCRT.manifest %_DEST%\bin%_EXT%\Microsoft.VC80.DebugCRT.manifest ..\msvcp90\msvcm90*.dll %_DEST%\bin%_EXT% ..\msvcp90\msvcp90*.dll %_DEST%\bin%_EXT% -- cgit From b4896256c595f4b98bcd488bdb4c290e0b2c4b64 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 12:57:42 +0200 Subject: win32-force-version-fix.diff: force WINVER when using non-std win api --- connectivity/source/drivers/ado/ADriver.cxx | 2 ++ desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx | 2 ++ desktop/win32/source/setup/setup.cpp | 1 + fpicker/source/win32/filepicker/FileOpenDlg.cxx | 2 ++ 4 files changed, 7 insertions(+) diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx index 20eb6910f849..2374470bb610 100644 --- a/connectivity/source/drivers/ado/ADriver.cxx +++ b/connectivity/source/drivers/ado/ADriver.cxx @@ -25,6 +25,8 @@ * ************************************************************************/ +#define _WIN32_WINNT 0x0501 + // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_connectivity.hxx" #include "ado/ADriver.hxx" diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index 8bd8a6191201..f92c6caa250c 100755 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -25,6 +25,8 @@ * ************************************************************************/ +#define _WIN32_WINNT 0x0500 + // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_desktop.hxx" diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp index edc27751b110..7bfd544b2494 100755 --- a/desktop/win32/source/setup/setup.cpp +++ b/desktop/win32/source/setup/setup.cpp @@ -26,6 +26,7 @@ ************************************************************************/ #define WIN // scope W32 API +#define _WIN32_WINNT 0x0501 #if defined _MSC_VER #pragma warning(push, 1) diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.cxx b/fpicker/source/win32/filepicker/FileOpenDlg.cxx index 73a757058e28..6307d2a20a98 100644 --- a/fpicker/source/win32/filepicker/FileOpenDlg.cxx +++ b/fpicker/source/win32/filepicker/FileOpenDlg.cxx @@ -25,6 +25,8 @@ * ************************************************************************/ +#define _WIN32_WINNT 0x0500 + // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_fpicker.hxx" -- cgit From 428a2d7f37870788e521f3a384a43ece532b1605 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 12:58:20 +0200 Subject: win32-force-version-fix.diff: force WINVER when using non-std win api --- canvas/source/cairo/cairo_win32_cairo.cxx | 2 ++ i18npool/source/isolang/inwnt.cxx | 2 ++ vcl/win/source/gdi/salprn.cxx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/canvas/source/cairo/cairo_win32_cairo.cxx b/canvas/source/cairo/cairo_win32_cairo.cxx index d0d6558c2fdd..6e3472af3a7e 100644 --- a/canvas/source/cairo/cairo_win32_cairo.cxx +++ b/canvas/source/cairo/cairo_win32_cairo.cxx @@ -25,6 +25,8 @@ * ************************************************************************/ +#define _WIN32_WINNT 0x0500 + // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_canvas.hxx" diff --git a/i18npool/source/isolang/inwnt.cxx b/i18npool/source/isolang/inwnt.cxx index 2e07e8ea1322..ddc5016d7c40 100644 --- a/i18npool/source/isolang/inwnt.cxx +++ b/i18npool/source/isolang/inwnt.cxx @@ -29,6 +29,8 @@ #include +#define WINVER 0x0500 + #ifdef _MSC_VER #pragma warning(push,1) // disable warnings within system headers #endif diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index 9d8d41723f64..c8c7b5c68fff 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -28,6 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#define WINVER 0x0500 + #include #include -- cgit From 00d479a6449ceb0156913dea97fa32ac7133d61c Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 12:58:29 +0200 Subject: win32-force-version-fix.diff: force WINVER when using non-std win api --- sal/osl/w32/file_dirvol.cxx | 2 +- sal/osl/w32/file_error.c | 2 +- sal/osl/w32/file_url.cxx | 2 +- sal/osl/w32/tempfile.cxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index 09bdec7988c3..48e6da2236d0 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -27,7 +27,7 @@ #define UNICODE #define _UNICODE -#define _WIN32_WINNT_0x0500 +#define _WIN32_WINNT 0x0500 #include "systools/win32/uwinapi.h" #include "osl/file.h" diff --git a/sal/osl/w32/file_error.c b/sal/osl/w32/file_error.c index 26e749cc5451..ff74e6c025f3 100644 --- a/sal/osl/w32/file_error.c +++ b/sal/osl/w32/file_error.c @@ -27,7 +27,7 @@ #define UNICODE #define _UNICODE -#define _WIN32_WINNT_0x0500 +#define _WIN32_WINNT 0x0500 #include "systools/win32/uwinapi.h" #include "file_error.h" diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 90140cda97c6..21c5a0a11df3 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -27,7 +27,7 @@ #define UNICODE #define _UNICODE -#define _WIN32_WINNT_0x0500 +#define _WIN32_WINNT 0x0500 #include "systools/win32/uwinapi.h" #include "file_url.h" diff --git a/sal/osl/w32/tempfile.cxx b/sal/osl/w32/tempfile.cxx index 6a3d2549004a..4e7d97a207f7 100644 --- a/sal/osl/w32/tempfile.cxx +++ b/sal/osl/w32/tempfile.cxx @@ -27,7 +27,7 @@ #define UNICODE #define _UNICODE -#define _WIN32_WINNT_0x0500 +#define _WIN32_WINNT 0x0500 #include "systools/win32/uwinapi.h" #include "osl/file.h" -- cgit From f3d51af52ffa30b63f89c3eede87c54d3c6a1f73 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 13:11:23 +0200 Subject: win32-vs2005-compat.diff: Fix build with Visual Studio 2005 --- setup_native/source/win32/customactions/rebase/rebase.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_native/source/win32/customactions/rebase/rebase.cxx b/setup_native/source/win32/customactions/rebase/rebase.cxx index dfe1e82e1e9b..b25414c6bbf6 100644 --- a/setup_native/source/win32/customactions/rebase/rebase.cxx +++ b/setup_native/source/win32/customactions/rebase/rebase.cxx @@ -68,8 +68,8 @@ static BOOL rebaseImage( const std::string& filePath, LPVOID address ) ULONG_PTR lpNewImageBase = reinterpret_cast(address); BOOL bResult = ReBaseImage( - filePath.c_str(), - "", + (PSTR)filePath.c_str(), + (PSTR)"", TRUE, FALSE, FALSE, -- cgit From 7d29a89fe7f305f72c31206d2c36f05bbc96a7ef Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 13:12:18 +0200 Subject: win32-vs2005-compat.diff: Fix build with Visual Studio 2005 --- vos/inc/vos/object.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vos/inc/vos/object.hxx b/vos/inc/vos/object.hxx index 6108280cf382..eaaedd9202e7 100644 --- a/vos/inc/vos/object.hxx +++ b/vos/inc/vos/object.hxx @@ -70,8 +70,8 @@ public: /** Define private new and delete operator because of compiler bug, when allocating and deleteing a exported class */ - void* SAL_CALL operator new(size_t size); - void* SAL_CALL operator new(size_t size, void* p); + void* SAL_CALL operator new(::size_t size); + void* SAL_CALL operator new(::size_t size, void* p); void SAL_CALL operator delete(void* p); -- cgit From 09ce8ce7edd4580698239ac9d610de68b7c9a76e Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 13:12:26 +0200 Subject: win32-vs2005-compat.diff: Fix build with Visual Studio 2005 --- cppu/inc/com/sun/star/uno/Reference.h | 4 ++-- cppu/inc/com/sun/star/uno/Sequence.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cppu/inc/com/sun/star/uno/Reference.h b/cppu/inc/com/sun/star/uno/Reference.h index f792556dcb57..9051eed4e372 100644 --- a/cppu/inc/com/sun/star/uno/Reference.h +++ b/cppu/inc/com/sun/star/uno/Reference.h @@ -239,13 +239,13 @@ class Reference : public BaseReference public: // these are here to force memory de/allocation to sal lib. /** @internal */ - inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW( () ) + inline static void * SAL_CALL operator new ( ::size_t nSize ) SAL_THROW( () ) { return ::rtl_allocateMemory( nSize ); } /** @internal */ inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW( () ) { ::rtl_freeMemory( pMem ); } /** @internal */ - inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW( () ) + inline static void * SAL_CALL operator new ( ::size_t, void * pMem ) SAL_THROW( () ) { return pMem; } /** @internal */ inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW( () ) diff --git a/cppu/inc/com/sun/star/uno/Sequence.h b/cppu/inc/com/sun/star/uno/Sequence.h index da9906533583..effcde6a25f0 100644 --- a/cppu/inc/com/sun/star/uno/Sequence.h +++ b/cppu/inc/com/sun/star/uno/Sequence.h @@ -69,7 +69,7 @@ class Sequence public: // these are here to force memory de/allocation to sal lib. /** @internal */ - inline static void * SAL_CALL operator new ( size_t nSize ) + inline static void * SAL_CALL operator new ( ::size_t nSize ) SAL_THROW( () ) { return ::rtl_allocateMemory( nSize ); } /** @internal */ @@ -77,7 +77,7 @@ public: SAL_THROW( () ) { ::rtl_freeMemory( pMem ); } /** @internal */ - inline static void * SAL_CALL operator new ( size_t, void * pMem ) + inline static void * SAL_CALL operator new ( ::size_t, void * pMem ) SAL_THROW( () ) { return pMem; } /** @internal */ -- cgit From 0a104203d8e97e2be5ff55da53185406f74ee326 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 13:12:33 +0200 Subject: win32-vs2005-compat.diff: Fix build with Visual Studio 2005 --- sw/source/filter/ww8/wrtw8nds.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 6e6dcf813767..e796b68f5efd 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -762,14 +762,14 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRu /*Get defaults if no formatting on ruby text*/ const SfxItemPool *pPool = rNode.GetSwAttrSet().GetPool(); - const SfxItemPool &rPool = pPool ? *pPool : m_rWW8Export.pDoc->GetAttrPool(); + pPool = pPool ? pPool : &m_rWW8Export.pDoc->GetAttrPool(); - const SvxFontItem &rFont = DefaultItemGet< SvxFontItem >( rPool, + const SvxFontItem &rFont = DefaultItemGet< SvxFontItem >( *pPool, GetWhichOfScript( RES_CHRATR_FONT,nRubyScript ) ); sFamilyName = rFont.GetFamilyName(); const SvxFontHeightItem &rHeight = DefaultItemGet< SvxFontHeightItem > - ( rPool, GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) ); + ( *pPool, GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) ); nHeight = rHeight.GetHeight(); } nHeight = (nHeight + 5)/10; -- cgit From b1a46b9bc8f3875890234a4c64676edf97516114 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Sep 2010 13:24:04 +0200 Subject: win32-invalid-names.diff: Allow technically illegal pathname components n#277603 Allow some technically illegal pathname components on Win32 (directories with trailing spaces or periods) because some SMB servers like Netware (and Samba, if mangled names = No) do serve such directories if they exist on the server's host system. --- sal/osl/w32/file_url.cxx | 16 +++++++++++----- sal/osl/w32/file_url.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 21c5a0a11df3..e182a86b9a09 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -89,9 +89,10 @@ static BOOL IsValidFilePathComponent( case '.': if ( dwFlags & VALIDATEPATH_ALLOW_ELLIPSE ) { - if ( 1 == lpCurrent - lpComponent ) + if ( (dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD) || + 1 == lpCurrent - lpComponent ) { - /* Current directory is O.K. */ + /* Either do allow periods anywhere, or current directory */ lpComponentEnd = lpCurrent; break; } @@ -104,8 +105,13 @@ static BOOL IsValidFilePathComponent( } case 0: case ' ': - lpComponentEnd = lpCurrent - 1; - fValid = FALSE; + if ( dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD ) + lpComponentEnd = lpCurrent; + else + { + lpComponentEnd = lpCurrent - 1; + fValid = FALSE; + } break; default: lpComponentEnd = lpCurrent; @@ -375,7 +381,7 @@ DWORD IsValidFilePath(rtl_uString *path, LPCTSTR *lppError, DWORD dwFlags, rtl_u lpComponent = lpszPath + i; } - fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags ); + fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags | VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD); if ( fValid && lpComponent ) { diff --git a/sal/osl/w32/file_url.h b/sal/osl/w32/file_url.h index d9137c8c2fcc..23e238da3e43 100644 --- a/sal/osl/w32/file_url.h +++ b/sal/osl/w32/file_url.h @@ -61,6 +61,7 @@ extern "C" { #define VALIDATEPATH_ALLOW_ELLIPSE 0x0002 #define VALIDATEPATH_ALLOW_RELATIVE 0x0004 #define VALIDATEPATH_ALLOW_UNC 0x0008 +#define VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD 0x0010 #define MAX_LONG_PATH 32767 -- cgit From da82dc8f87b628c860e26d3e02eb2f92229a8bec Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Sep 2010 13:27:42 +0200 Subject: accept-underscores-in-hostnames.diff: Accept underscores in hostnames n#182422 --- tools/source/fsys/urlobj.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index a6d7bc6fd04e..b9c4941aa155 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -2390,7 +2390,7 @@ bool INetURLObject::parseHost( aTheCanonic.append(sal_Unicode('[')); eState = STATE_IP6; } - else if (INetMIME::isAlpha(*p)) + else if (INetMIME::isAlpha(*p) || *p == '_') eState = STATE_TOPLABEL; else if (INetMIME::isDigit(*p)) { @@ -2408,19 +2408,19 @@ bool INetURLObject::parseHost( eState = STATE_LABEL_DOT; else if (*p == '-') eState = STATE_LABEL_HYPHEN; - else if (!INetMIME::isAlphanumeric(*p)) + else if (!INetMIME::isAlphanumeric(*p) && *p != '_') goto done; break; case STATE_LABEL_HYPHEN: - if (INetMIME::isAlphanumeric(*p)) + if (INetMIME::isAlphanumeric(*p) || *p == '_') eState = STATE_LABEL; else if (*p != '-') goto done; break; case STATE_LABEL_DOT: - if (INetMIME::isAlpha(*p)) + if (INetMIME::isAlpha(*p) || *p == '_') eState = STATE_TOPLABEL; else if (INetMIME::isDigit(*p)) eState = STATE_LABEL; @@ -2433,19 +2433,19 @@ bool INetURLObject::parseHost( eState = STATE_TOPLABEL_DOT; else if (*p == '-') eState = STATE_TOPLABEL_HYPHEN; - else if (!INetMIME::isAlphanumeric(*p)) + else if (!INetMIME::isAlphanumeric(*p) && *p != '_') goto done; break; case STATE_TOPLABEL_HYPHEN: - if (INetMIME::isAlphanumeric(*p)) + if (INetMIME::isAlphanumeric(*p) || *p == '_') eState = STATE_TOPLABEL; else if (*p != '-') goto done; break; case STATE_TOPLABEL_DOT: - if (INetMIME::isAlpha(*p)) + if (INetMIME::isAlpha(*p) || *p == '_') eState = STATE_TOPLABEL; else if (INetMIME::isDigit(*p)) eState = STATE_LABEL; @@ -2467,7 +2467,7 @@ bool INetURLObject::parseHost( eState = STATE_LABEL_DOT; else if (*p == '-') eState = STATE_LABEL_HYPHEN; - else if (INetMIME::isAlpha(*p)) + else if (INetMIME::isAlpha(*p) || *p == '_') eState = STATE_LABEL; else if (INetMIME::isDigit(*p)) if (nDigits < 3) @@ -2482,7 +2482,7 @@ bool INetURLObject::parseHost( break; case STATE_IP4_DOT: - if (INetMIME::isAlpha(*p)) + if (INetMIME::isAlpha(*p) || *p == '_') eState = STATE_TOPLABEL; else if (INetMIME::isDigit(*p)) { @@ -5372,7 +5372,7 @@ sal_uInt32 INetURLObject::scanDomain(sal_Unicode const *& rBegin, switch (eState) { case STATE_DOT: - if (p != pEnd && INetMIME::isAlphanumeric(*p)) + if (p != pEnd && (INetMIME::isAlphanumeric(*p) || *p == '_')) { ++nLabels; eState = STATE_LABEL; @@ -5386,7 +5386,7 @@ sal_uInt32 INetURLObject::scanDomain(sal_Unicode const *& rBegin, case STATE_LABEL: if (p != pEnd) { - if (INetMIME::isAlphanumeric(*p)) + if (INetMIME::isAlphanumeric(*p) || *p == '_') break; else if (*p == '.') { @@ -5406,7 +5406,7 @@ sal_uInt32 INetURLObject::scanDomain(sal_Unicode const *& rBegin, case STATE_HYPHEN: if (p != pEnd) { - if (INetMIME::isAlphanumeric(*p)) + if (INetMIME::isAlphanumeric(*p) || *p == '_') { eState = STATE_LABEL; break; -- cgit From 426ce43c837ef49600bc282a0136bb2b4ed3f7fe Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 11:47:49 +0200 Subject: toolbar-decorations-svx.diff: Improved toolbar popups. --- svx/source/tbxctrls/linectrl.cxx | 4 ++-- svx/source/tbxctrls/tbcontrl.cxx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index 6deab3eca30b..9ea2e7736898 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -382,7 +382,7 @@ SvxLineEndWindow::SvxLineEndWindow( const String& rWndTitle ) : SfxPopupWindow( nSlotId, rFrame, - WinBits( WB_BORDER | WB_STDFLOATWIN | WB_SIZEABLE | WB_3DLOOK ) ), + WinBits( WB_STDPOPUP ) ), pLineEndList ( NULL ), aLineEndSet ( this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) ), nCols ( 2 ), @@ -404,7 +404,7 @@ SvxLineEndWindow::SvxLineEndWindow( SfxPopupWindow( nSlotId, rFrame, pParentWindow, - WinBits( WB_BORDER | WB_STDFLOATWIN | WB_SIZEABLE | WB_3DLOOK ) ), + WinBits( WB_STDPOPUP ) ), pLineEndList ( NULL ), aLineEndSet ( this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) ), nCols ( 2 ), diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5c99e84e6a47..813a4b131536 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -829,7 +829,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, const String& rWndTitle, Window* pParentWindow ) : - SfxPopupWindow( nSlotId, rFrame, pParentWindow, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK|WB_DIALOGCONTROL ) ), + SfxPopupWindow( nSlotId, rFrame, pParentWindow, WinBits( WB_STDPOPUP ) ), theSlotId( nSlotId ), aColorSet( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) ), @@ -1055,7 +1055,7 @@ void SvxColorWindow_Impl::StateChanged( USHORT nSID, SfxItemState eState, const SvxFrameWindow_Impl::SvxFrameWindow_Impl( USHORT nId, const Reference< XFrame >& rFrame, Window* pParentWindow ) : - SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK | WB_DIALOGCONTROL ) ), + SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_STDPOPUP ) ), aFrameSet ( this, WinBits( WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) ), bParagraphMode(sal_False) @@ -1329,7 +1329,7 @@ BOOL SvxFrameWindow_Impl::Close() SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& rFrame, Window* pParentWindow ) : - SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK | WB_DIALOGCONTROL ) ), + SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_STDPOPUP ) ), aLineSet( this, WinBits( WB_3DLOOK | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD | WB_NONEFIELD | WB_NO_DIRECTSELECT ) ) { -- cgit From 2a82fbacfeb5198cc1605f0c09cba8533fb39a2f Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 11:49:46 +0200 Subject: toolbar-decorations-svx-tables-columns.diff: "New table" widget rework. And a small update of the "Columns" widget. --- svx/source/tbxctrls/layctrl.cxx | 488 ++++++++++++++++++---------------------- 1 file changed, 218 insertions(+), 270 deletions(-) diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index 139506028292..01fb64636a3d 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -32,9 +32,7 @@ #include // HACK: prevent conflict between STLPORT and Workshop headers #include -#ifndef _SV_BUTTON_HXX //autogen #include -#endif #include #include #include @@ -56,51 +54,72 @@ SFX_IMPL_TOOLBOX_CONTROL(SvxColumnsToolBoxControl,SfxUInt16Item); // class TableWindow ----------------------------------------------------- +const long TABLE_CELL_WIDTH = 15; +const long TABLE_CELL_HEIGHT = 15; + +const long TABLE_CELLS_HORIZ = 10; +const long TABLE_CELLS_VERT = 15; + +const long TABLE_POS_X = 2; +const long TABLE_POS_Y = 2; + +const long TABLE_WIDTH = TABLE_POS_X + TABLE_CELLS_HORIZ*TABLE_CELL_WIDTH; +const long TABLE_HEIGHT = TABLE_POS_Y + TABLE_CELLS_VERT*TABLE_CELL_HEIGHT; + class TableWindow : public SfxPopupWindow { private: + PushButton aTableButton; ::Color aLineColor; - ::Color aHighlightLineColor; ::Color aFillColor; ::Color aHighlightFillColor; + ::Color aBackgroundColor; long nCol; long nLine; - long nWidth; - long nHeight; - long nMX; - long nMY; - long nTextHeight; BOOL bInitialKeyInput; BOOL m_bMod1; ToolBox& rTbx; Reference< XFrame > mxFrame; rtl::OUString maCommand; - void UpdateSize_Impl( long nNewCol, long nNewLine); + DECL_LINK( SelectHdl, void * ); public: TableWindow( USHORT nSlotId, const rtl::OUString& rCmd, + const String& rText, ToolBox& rParentTbx, const Reference< XFrame >& rFrame ); ~TableWindow(); void KeyInput( const KeyEvent& rKEvt ); virtual void MouseMove( const MouseEvent& rMEvt ); - virtual void MouseButtonDown( const MouseEvent& rMEvt ); virtual void MouseButtonUp( const MouseEvent& rMEvt ); virtual void Paint( const Rectangle& ); virtual void PopupModeEnd(); virtual SfxPopupWindow* Clone() const; - USHORT GetColCount() const { return (USHORT)nCol; } - USHORT GetLineCount() const { return (USHORT)nLine; } +private: + void Update( long nNewCol, long nNewLine ); + void TableDialog( const Sequence< PropertyValue >& rArgs ); + void CloseAndShowTableDialog(); }; // ----------------------------------------------------------------------- -TableWindow::TableWindow( USHORT nSlotId, const rtl::OUString& rCmd, ToolBox& rParentTbx, const Reference< XFrame >& rFrame ) : - SfxPopupWindow( nSlotId, rFrame, WB_SYSTEMWINDOW ), +IMPL_LINK( TableWindow, SelectHdl, void *, EMPTYARG ) +{ + CloseAndShowTableDialog(); + return NULL; +} + +// ----------------------------------------------------------------------- + +TableWindow::TableWindow( USHORT nSlotId, const rtl::OUString& rCmd, const String& rText, ToolBox& rParentTbx, const Reference< XFrame >& rFrame ) : + SfxPopupWindow( nSlotId, rFrame, WinBits( WB_STDPOPUP ) ), + aTableButton( this ), + nCol( 0 ), + nLine( 0 ), bInitialKeyInput(TRUE), m_bMod1(FALSE), rTbx(rParentTbx), @@ -109,38 +128,41 @@ TableWindow::TableWindow( USHORT nSlotId, const rtl::OUString& rCmd, ToolBox& rP { const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); svtools::ColorConfig aColorConfig; - aLineColor = ::Color( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ); - aHighlightLineColor = rStyles.GetHighlightTextColor(); + + aLineColor = rStyles.GetShadowColor(); aFillColor = rStyles.GetWindowColor(); aHighlightFillColor = rStyles.GetHighlightColor(); + aBackgroundColor = GetSettings().GetStyleSettings().GetFaceColor(); - nTextHeight = GetTextHeight()+1; - SetBackground(); + SetBackground( aBackgroundColor ); Font aFont = GetFont(); - aFont.SetColor( aLineColor ); - aFont.SetFillColor( aFillColor ); + aFont.SetColor( ::Color( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ) ); + aFont.SetFillColor( aBackgroundColor ); aFont.SetTransparent( FALSE ); SetFont( aFont ); - nCol = 0; - nLine = 0; - nWidth = 5; - nHeight = 5; + SetText( rText ); - Size aLogicSize = LogicToPixel( Size( 55, 35 ), MapMode( MAP_10TH_MM ) ); - nMX = aLogicSize.Width(); - nMY = aLogicSize.Height(); - SetOutputSizePixel( Size( nMX*nWidth-1, nMY*nHeight-1+nTextHeight ) ); + aTableButton.SetPosSizePixel( Point( TABLE_POS_X + TABLE_CELL_WIDTH, TABLE_HEIGHT + 5 ), + Size( TABLE_WIDTH - TABLE_POS_X - 2*TABLE_CELL_WIDTH, 24 ) ); + aTableButton.SetText( String( SVX_RESSTR( RID_SVXSTR_MORE ) ) ); + aTableButton.SetClickHdl( LINK( this, TableWindow, SelectHdl ) ); + aTableButton.Show(); + + SetOutputSizePixel( Size( TABLE_WIDTH + 3, TABLE_HEIGHT + 33 ) ); } + // ----------------------------------------------------------------------- + TableWindow::~TableWindow() { } + // ----------------------------------------------------------------------- SfxPopupWindow* TableWindow::Clone() const { - return new TableWindow( GetId(), maCommand, rTbx, mxFrame ); + return new TableWindow( GetId(), maCommand, GetText(), rTbx, mxFrame ); } // ----------------------------------------------------------------------- @@ -151,164 +173,64 @@ void TableWindow::MouseMove( const MouseEvent& rMEvt ) Point aPos = rMEvt.GetPosPixel(); Point aMousePos( aPos ); - if ( rMEvt.IsEnterWindow() ) - CaptureMouse(); - else if ( aMousePos.X() < 0 || aMousePos.Y() < 0 ) - { - nCol = 0; - nLine = 0; - ReleaseMouse(); - Invalidate(); - return; - } - - long nNewCol = 0; - long nNewLine = 0; - - if ( aPos.X() > 0 ) - nNewCol = aPos.X() / nMX + 1; - if ( aPos.Y() > 0 ) - nNewLine = aPos.Y() / nMY + 1; - - if ( nNewCol > 500 ) - nNewCol = 500; - if ( nNewLine > 1000 ) - nNewLine = 1000; - - UpdateSize_Impl( nNewCol, nNewLine); + long nNewCol = ( aMousePos.X() - TABLE_POS_X + TABLE_CELL_WIDTH ) / TABLE_CELL_WIDTH; + long nNewLine = ( aMousePos.Y() - TABLE_POS_Y + TABLE_CELL_HEIGHT ) / TABLE_CELL_HEIGHT; + Update( nNewCol, nNewLine ); } -/* -----------------------------15.05.2002 17:14------------------------------ - ---------------------------------------------------------------------------*/ -void TableWindow::UpdateSize_Impl( long nNewCol, long nNewLine) -{ - Size aWinSize = GetOutputSizePixel(); - Point aWinPos = GetPosPixel(); - Point aMaxPos = OutputToScreenPixel( GetDesktopRectPixel().BottomRight() ); - if ( (nWidth <= nNewCol) || (nHeight < nNewLine) ) - { - long nOff = 0; - - if ( nWidth <= nNewCol ) - { - nWidth = nNewCol; - nWidth++; - } - if ( nHeight <= nNewLine ) - { - nHeight = nNewLine; - nOff = 1; - } - while ( nWidth > 0 && - (short)(aWinPos.X()+(nMX*nWidth-1)) >= aMaxPos.X()-3 ) - nWidth--; - - while ( nHeight > 0 && - (short)(aWinPos.Y()+(nMY*nHeight-1+nTextHeight)) >= - aMaxPos.Y()-3 ) - nHeight--; - - if ( nNewCol > nWidth ) - nNewCol = nWidth; - - if ( nNewLine > nHeight ) - nNewLine = nHeight; - - Size _aWinSize = GetOutputSizePixel(); - Invalidate( Rectangle( 0, _aWinSize.Height()-nTextHeight+2-nOff, - _aWinSize.Width(), _aWinSize.Height() ) ); - SetOutputSizePixel( Size( nMX*nWidth-1, nMY*nHeight-1+nTextHeight ) ); - } - long nMinCol = 0; - long nMaxCol = 0; - long nMinLine = 0; - long nMaxLine = 0; - if ( nNewCol < nCol ) - { - nMinCol = nNewCol; - nMaxCol = nCol; - } - else - { - nMinCol = nCol; - nMaxCol = nNewCol; - } - if ( nNewLine < nLine ) - { - nMinLine = nNewLine; - nMaxLine = nLine; - } - else - { - nMinLine = nLine; - nMaxLine = nNewLine; - } - - if ( (nNewCol != nCol) || (nNewLine != nLine) ) - { - Invalidate( Rectangle( 0, aWinSize.Height()-nTextHeight+2, - aWinSize.Width(), aWinSize.Height() ) ); - - if ( nNewCol != nCol ) - { - Invalidate( Rectangle( nMinCol*nMX-1, 0, nMaxCol*nMX+1, nMaxLine*nMY ) ); - nCol = nNewCol; - } - if ( nNewLine != nLine ) - { - Invalidate( Rectangle( 0, nMinLine*nMY-2, nMaxCol*nMX, nMaxLine*nMY+1 ) ); - nLine = nNewLine; - } - } - Update(); -} -/* -----------------------------15.05.2002 14:22------------------------------ +// ----------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ void TableWindow::KeyInput( const KeyEvent& rKEvt ) { - BOOL bHandled = FALSE; + bool bHandled = false; USHORT nModifier = rKEvt.GetKeyCode().GetModifier(); USHORT nKey = rKEvt.GetKeyCode().GetCode(); - if(!nModifier) + if ( !nModifier ) { - if( KEY_UP == nKey || KEY_DOWN == nKey || - KEY_LEFT == nKey || KEY_RIGHT == nKey || - KEY_ESCAPE == nKey ||KEY_RETURN == nKey ) + bHandled = true; + long nNewCol = nCol; + long nNewLine = nLine; + switch(nKey) { - bHandled = TRUE; - long nNewCol = nCol; - long nNewLine = nLine; - switch(nKey) - { - case KEY_UP : - if(nNewLine > 1) - { - nNewLine--; - break; - } - //no break; - case KEY_ESCAPE: - EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL); + case KEY_UP: + if ( nNewLine > 1 ) + nNewLine--; + else + EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL ); break; - case KEY_DOWN : + case KEY_DOWN: + if ( nNewLine < TABLE_CELLS_VERT ) nNewLine++; + else + CloseAndShowTableDialog(); break; - case KEY_LEFT : - - if(nNewCol) - nNewCol--; + case KEY_LEFT: + if ( nNewCol > 1 ) + nNewCol--; + else + EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL ); break; - case KEY_RIGHT : + case KEY_RIGHT: + if ( nNewCol < TABLE_CELLS_HORIZ ) nNewCol++; + else + CloseAndShowTableDialog(); break; - case KEY_RETURN : - if(IsMouseCaptured()) - ReleaseMouse(); - EndPopupMode(FLOATWIN_POPUPMODEEND_CLOSEALL ); + case KEY_ESCAPE: + EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL ); break; - } + case KEY_RETURN: + EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL ); + break; + case KEY_TAB: + CloseAndShowTableDialog(); + break; + default: + bHandled = false; + } + if ( bHandled ) + { //make sure that a table can initially be created if(bInitialKeyInput) { @@ -318,27 +240,17 @@ void TableWindow::KeyInput( const KeyEvent& rKEvt ) if(!nNewCol) nNewCol = 1; } - UpdateSize_Impl( nNewCol, nNewLine); + Update( nNewCol, nNewLine ); } } else if(KEY_MOD1 == nModifier && KEY_RETURN == nKey) { m_bMod1 = TRUE; - if(IsMouseCaptured()) - ReleaseMouse(); - EndPopupMode(FLOATWIN_POPUPMODEEND_CLOSEALL ); + EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL ); } if(!bHandled) SfxPopupWindow::KeyInput(rKEvt); - -} -// ----------------------------------------------------------------------- - -void TableWindow::MouseButtonDown( const MouseEvent& rMEvt ) -{ - SfxPopupWindow::MouseButtonDown( rMEvt ); - CaptureMouse(); } // ----------------------------------------------------------------------- @@ -346,56 +258,45 @@ void TableWindow::MouseButtonDown( const MouseEvent& rMEvt ) void TableWindow::MouseButtonUp( const MouseEvent& rMEvt ) { SfxPopupWindow::MouseButtonUp( rMEvt ); - ReleaseMouse(); - - if ( IsInPopupMode() ) - EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL ); + EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL ); } // ----------------------------------------------------------------------- void TableWindow::Paint( const Rectangle& ) { - long i; - long nStart; - Size aSize = GetOutputSizePixel(); + const long nSelectionWidth = TABLE_POS_X + nCol*TABLE_CELL_WIDTH; + const long nSelectionHeight = TABLE_POS_Y + nLine*TABLE_CELL_HEIGHT; - SetLineColor(); - SetFillColor( aHighlightFillColor ); - DrawRect( Rectangle( 0, 0, nCol*nMX-1, nLine*nMY-1 ) ); - SetFillColor( aFillColor ); - DrawRect( Rectangle( nCol*nMX-1, 0, - aSize.Width(), aSize.Height()-nTextHeight+1 ) ); - DrawRect( Rectangle( 0, nLine*nMY-1, - aSize.Width(), aSize.Height()-nTextHeight+1 ) ); - - SetLineColor( aHighlightLineColor ); - for ( i = 1; i < nCol; i++ ) - DrawLine( Point( i*nMX-1, 0 ), Point( i*nMX-1, nLine*nMY-1 ) ); - for ( i = 1; i < nLine; i++ ) - DrawLine( Point( 0, i*nMY-1 ), Point( nCol*nMX-1, i*nMY-1 ) ); + // the non-selected parts of the table SetLineColor( aLineColor ); - for ( i = 1; i <= nWidth; i++ ) - { - if ( i < nCol ) - nStart = nLine*nMY-1; - else - nStart = 0; - DrawLine( Point( i*nMX-1, nStart ), Point( i*nMX-1, nHeight*nMY-1 ) ); - } - for ( i = 1; i <= nHeight; i++ ) + SetFillColor( aFillColor ); + DrawRect( Rectangle( nSelectionWidth, TABLE_POS_Y, TABLE_WIDTH, nSelectionHeight ) ); + DrawRect( Rectangle( TABLE_POS_X, nSelectionHeight, nSelectionWidth, TABLE_HEIGHT ) ); + DrawRect( Rectangle( nSelectionWidth, nSelectionHeight, TABLE_WIDTH, TABLE_HEIGHT ) ); + + // the selection + if ( nCol > 0 && nLine > 0 ) { - if ( i < nLine ) - nStart = nCol*nMX-1; - else - nStart = 0; - DrawLine( Point( nStart, i*nMY-1 ), Point( nWidth*nMX-1, i*nMY-1 ) ); + SetFillColor( aHighlightFillColor ); + DrawRect( Rectangle( TABLE_POS_X, TABLE_POS_Y, + nSelectionWidth, nSelectionHeight ) ); } - SetLineColor(); - String aText; + // lines inside of the table + SetLineColor( aLineColor ); + for ( long i = 1; i < TABLE_CELLS_VERT; ++i ) + DrawLine( Point( TABLE_POS_X, TABLE_POS_Y + i*TABLE_CELL_HEIGHT ), + Point( TABLE_WIDTH, TABLE_POS_Y + i*TABLE_CELL_HEIGHT ) ); + + for ( long i = 1; i < TABLE_CELLS_HORIZ; ++i ) + DrawLine( Point( TABLE_POS_X + i*TABLE_CELL_WIDTH, TABLE_POS_Y ), + Point( TABLE_POS_X + i*TABLE_CELL_WIDTH, TABLE_HEIGHT ) ); + + // the text near the mouse cursor telling the table dimensions if ( nCol && nLine ) { + String aText; aText += String::CreateFromInt32( nCol ); aText.AppendAscii( " x " ); aText += String::CreateFromInt32( nLine ); @@ -405,22 +306,30 @@ void TableWindow::Paint( const Rectangle& ) aText += String(SVX_RESSTR(RID_SVXSTR_PAGES)); } - } - else - aText = Button::GetStandardText( BUTTON_CANCEL ); - Size aTextSize( GetTextWidth( aText ), GetTextHeight() ); + Size aSize = GetOutputSizePixel(); + Size aTextSize( GetTextWidth( aText ), GetTextHeight() ); - Rectangle aClearRect( 0, aSize.Height()-nTextHeight+2, (aSize.Width()), aSize.Height() ); - DrawRect( aClearRect ); + long nTextX = nSelectionWidth + TABLE_CELL_WIDTH; + long nTextY = nSelectionHeight + TABLE_CELL_HEIGHT; + const long nTipBorder = 2; - // #i95350# force RTL output - if( IsRTLEnabled() && nCol && nLine ) - aText.Insert(0x202D, 0); - DrawText( Point( (aSize.Width() - aTextSize.Width()) / 2, aSize.Height() - nTextHeight + 2 ), aText ); + if ( aTextSize.Width() + TABLE_POS_X + TABLE_CELL_WIDTH + 2*nTipBorder < nSelectionWidth ) + nTextX = nSelectionWidth - TABLE_CELL_WIDTH - aTextSize.Width(); - SetLineColor( aLineColor ); - SetFillColor(); - DrawRect( Rectangle( Point(0,0), aSize ) ); + if ( aTextSize.Height() + TABLE_POS_Y + TABLE_CELL_HEIGHT + 2*nTipBorder < nSelectionHeight ) + nTextY = nSelectionHeight - TABLE_CELL_HEIGHT - aTextSize.Height(); + + SetLineColor( aLineColor ); + SetFillColor( aBackgroundColor ); + DrawRect( Rectangle ( nTextX - 2*nTipBorder, nTextY - 2*nTipBorder, + nTextX + aTextSize.Width() + nTipBorder, nTextY + aTextSize.Height() + nTipBorder ) ); + + // #i95350# force RTL output + if ( IsRTLEnabled() ) + aText.Insert( 0x202D, 0 ); + + DrawText( Point( nTextX, nTextY ), aText ); + } } // ----------------------------------------------------------------------- @@ -429,37 +338,71 @@ void TableWindow::PopupModeEnd() { if ( !IsPopupModeCanceled() && nCol && nLine ) { - Window* pParent = rTbx.GetParent(); - USHORT nId = GetId(); - pParent->UserEvent(SVX_EVENT_COLUM_WINDOW_EXECUTE, reinterpret_cast(nId)); - - Reference< XDispatchProvider > xDispatchProvider( mxFrame, UNO_QUERY ); - if ( xDispatchProvider.is() ) - { - com::sun::star::util::URL aTargetURL; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), - UNO_QUERY ); - aTargetURL.Complete = maCommand; - xTrans->parseStrict( aTargetURL ); - Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, rtl::OUString(), 0 ); - if ( xDispatch.is() ) - { - Sequence< PropertyValue > aArgs( 2 ); - aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Columns" )); - aArgs[0].Value = makeAny( sal_Int16( nCol )); - aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Rows" )); - aArgs[1].Value = makeAny( sal_Int16( nLine )); + Sequence< PropertyValue > aArgs( 2 ); + aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Columns" )); + aArgs[0].Value = makeAny( sal_Int16( nCol )); + aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Rows" )); + aArgs[1].Value = makeAny( sal_Int16( nLine )); - xDispatch->dispatch( aTargetURL, aArgs ); - } - } + TableDialog( aArgs ); } - else if ( IsPopupModeCanceled() ) - ReleaseMouse(); + SfxPopupWindow::PopupModeEnd(); } +// ----------------------------------------------------------------------- + +void TableWindow::Update( long nNewCol, long nNewLine ) +{ + if ( nNewCol < 0 || nNewCol > TABLE_CELLS_HORIZ ) + nNewCol = 0; + + if ( nNewLine < 0 || nNewLine > TABLE_CELLS_VERT ) + nNewLine = 0; + + if ( nNewCol != nCol || nNewLine != nLine ) + { + nCol = nNewCol; + nLine = nNewLine; + Invalidate( Rectangle( TABLE_POS_X, TABLE_POS_Y, TABLE_WIDTH, TABLE_HEIGHT ) ); + } +} + +// ----------------------------------------------------------------------- + +void TableWindow::TableDialog( const Sequence< PropertyValue >& rArgs ) +{ + Window* pParent = rTbx.GetParent(); + USHORT nId = GetId(); + pParent->UserEvent(SVX_EVENT_COLUM_WINDOW_EXECUTE, reinterpret_cast(nId)); + + Reference< XDispatchProvider > xDispatchProvider( mxFrame, UNO_QUERY ); + if ( xDispatchProvider.is() ) + { + com::sun::star::util::URL aTargetURL; + Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( + rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), + UNO_QUERY ); + aTargetURL.Complete = maCommand; + xTrans->parseStrict( aTargetURL ); + + Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, rtl::OUString(), 0 ); + if ( xDispatch.is() ) + xDispatch->dispatch( aTargetURL, rArgs ); + } +} + +// ----------------------------------------------------------------------- + +void TableWindow::CloseAndShowTableDialog() +{ + // close the toolbar tool + EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL ); + + // and open the table dialog instead + TableDialog( Sequence< PropertyValue >() ); +} + // class ColumnsWindow --------------------------------------------------- class ColumnsWindow : public SfxPopupWindow @@ -469,6 +412,7 @@ private: ::Color aHighlightLineColor; ::Color aFillColor; ::Color aHighlightFillColor; + ::Color aFaceColor; long nCol; long nWidth; long nMX; @@ -481,7 +425,7 @@ private: void UpdateSize_Impl( long nNewCol ); public: - ColumnsWindow( USHORT nId, const ::rtl::OUString& rCmd, ToolBox& rParentTbx, const Reference< XFrame >& rFrame ); + ColumnsWindow( USHORT nId, const ::rtl::OUString& rCmd, const String& rText, ToolBox& rParentTbx, const Reference< XFrame >& rFrame ); void KeyInput( const KeyEvent& rKEvt ); virtual void MouseMove( const MouseEvent& rMEvt ); @@ -496,8 +440,8 @@ public: // ----------------------------------------------------------------------- -ColumnsWindow::ColumnsWindow( USHORT nId, const ::rtl::OUString& rCmd, ToolBox& rParentTbx, const Reference< XFrame >& rFrame ) : - SfxPopupWindow( nId, rFrame, WB_SYSTEMWINDOW ), +ColumnsWindow::ColumnsWindow( USHORT nId, const ::rtl::OUString& rCmd, const String& rText, ToolBox& rParentTbx, const Reference< XFrame >& rFrame ) : + SfxPopupWindow( nId, rFrame, WB_STDPOPUP ), bInitialKeyInput(TRUE), m_bMod1(FALSE), rTbx(rParentTbx), @@ -510,18 +454,21 @@ ColumnsWindow::ColumnsWindow( USHORT nId, const ::rtl::OUString& rCmd, ToolBox& aHighlightLineColor = rStyles.GetHighlightTextColor(); aFillColor = rStyles.GetWindowColor(); aHighlightFillColor = rStyles.GetHighlightColor(); + aFaceColor = rStyles.GetFaceColor(); nTextHeight = GetTextHeight()+1; SetBackground(); Font aFont( GetFont() ); aFont.SetColor( aLineColor ); - aFont.SetFillColor( aFillColor ); + aFont.SetFillColor( aFaceColor ); aFont.SetTransparent( FALSE ); SetFont( aFont ); nCol = 0; nWidth = 4; + SetText( rText ); + Size aLogicSize = LogicToPixel( Size( 95, 155 ), MapMode( MAP_10TH_MM ) ); nMX = aLogicSize.Width(); SetOutputSizePixel( Size( nMX*nWidth-1, aLogicSize.Height()+nTextHeight ) ); @@ -532,7 +479,7 @@ ColumnsWindow::ColumnsWindow( USHORT nId, const ::rtl::OUString& rCmd, ToolBox& SfxPopupWindow* ColumnsWindow::Clone() const { - return new ColumnsWindow( GetId(), maCommand, rTbx, mxFrame ); + return new ColumnsWindow( GetId(), maCommand, GetText(), rTbx, mxFrame ); } // ----------------------------------------------------------------------- @@ -730,12 +677,13 @@ void ColumnsWindow::Paint( const Rectangle& ) } SetLineColor(); - SetFillColor( aFillColor ); + SetFillColor( aFaceColor ); String aText; if ( nCol ) aText = String( String::CreateFromInt32(nCol) ); else - aText = Button::GetStandardText( BUTTON_CANCEL ); + aText = Button::GetStandardText( BUTTON_CANCEL ).EraseAllChars( '~' ); + Size aTextSize(GetTextWidth( aText ), GetTextHeight()); DrawText( Point( ( aSize.Width() - aTextSize.Width() ) / 2, aSize.Height() - nTextHeight + 2 ), aText ); @@ -744,7 +692,7 @@ void ColumnsWindow::Paint( const Rectangle& ) SetLineColor( aLineColor ); SetFillColor(); - DrawRect( Rectangle( Point(0,0), aSize ) ); + DrawRect( Rectangle( 0, 0, aSize.Width() - 1, aSize.Height() - nTextHeight + 1 ) ); } // ----------------------------------------------------------------------- @@ -802,7 +750,7 @@ SfxPopupWindow* SvxTableToolBoxControl::CreatePopupWindow() if ( bEnabled ) { ToolBox& rTbx = GetToolBox(); - TableWindow* pWin = new TableWindow( GetSlotId(), m_aCommandURL, rTbx, m_xFrame ); + TableWindow* pWin = new TableWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), rTbx, m_xFrame ); pWin->StartPopupMode( &rTbx, FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOKEYCLOSE ); SetPopupWindow( pWin ); return pWin; @@ -815,7 +763,7 @@ SfxPopupWindow* SvxTableToolBoxControl::CreatePopupWindow() SfxPopupWindow* SvxTableToolBoxControl::CreatePopupWindowCascading() { if ( bEnabled ) - return new TableWindow( GetSlotId(), m_aCommandURL, GetToolBox(), m_xFrame ); + return new TableWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame ); return 0; } @@ -868,7 +816,7 @@ SfxPopupWindow* SvxColumnsToolBoxControl::CreatePopupWindow() ColumnsWindow* pWin = 0; if(bEnabled) { - pWin = new ColumnsWindow( GetSlotId(), m_aCommandURL, GetToolBox(), m_xFrame ); + pWin = new ColumnsWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame ); pWin->StartPopupMode( &GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOKEYCLOSE ); SetPopupWindow( pWin ); @@ -883,7 +831,7 @@ SfxPopupWindow* SvxColumnsToolBoxControl::CreatePopupWindowCascading() ColumnsWindow* pWin = 0; if(bEnabled) { - pWin = new ColumnsWindow( GetSlotId(), m_aCommandURL, GetToolBox(), m_xFrame ); + pWin = new ColumnsWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame ); } return pWin; } -- cgit From 20439a8dd19933c0fb956502c4f85dc5b92aa50d Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 11:50:57 +0200 Subject: toolbar-decorations-svx-undo-redo.diff: Update "Undo" and "Redo" widgets. --- svx/source/tbxctrls/lboxctrl.cxx | 5 +---- svx/source/tbxctrls/lboxctrl.src | 13 +++---------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx index 6d05c8bdb946..d61001738bad 100644 --- a/svx/source/tbxctrls/lboxctrl.cxx +++ b/svx/source/tbxctrls/lboxctrl.cxx @@ -70,7 +70,6 @@ class SvxPopupWindowListBox : public SfxPopupWindow { using FloatingWindow::StateChanged; - FixedInfo aInfo; ListBox * pListBox; ToolBox & rToolBox; BOOL bUserSel; @@ -95,7 +94,6 @@ public: void StartSelection(); inline ListBox & GetListBox() { return *pListBox; } - inline FixedInfo & GetInfo() { return aInfo; } BOOL IsUserSelected() const { return bUserSel; } void SetUserSelected( BOOL bVal ) { bUserSel = bVal; } @@ -106,7 +104,6 @@ public: SvxPopupWindowListBox::SvxPopupWindowListBox( USHORT nSlotId, const rtl::OUString& rCommandURL, USHORT nId, ToolBox& rTbx ) : SfxPopupWindow( nSlotId, Reference< XFrame >(), SVX_RES( RID_SVXTBX_UNDO_REDO_CTRL ) ), - aInfo ( this, SVX_RES( FT_NUM_OPERATIONS ) ), rToolBox ( rTbx ), bUserSel ( FALSE ), nTbxId ( nId ), @@ -242,7 +239,7 @@ void SvxListBoxControl::Impl_SetInfo( USHORT nCount ) String aText( aActionStr ); aText.SearchAndReplaceAllAscii( "$(ARG1)", String::CreateFromInt32( nCount ) ); - pPopupWin->GetInfo().SetText( aText ); + pPopupWin->SetText( aText ); } diff --git a/svx/source/tbxctrls/lboxctrl.src b/svx/source/tbxctrls/lboxctrl.src index 18e345675532..2022ddd0ee3c 100644 --- a/svx/source/tbxctrls/lboxctrl.src +++ b/svx/source/tbxctrls/lboxctrl.src @@ -32,27 +32,20 @@ FloatingWindow RID_SVXTBX_UNDO_REDO_CTRL { Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 150 , 74 ) ; + Size = MAP_APPFONT ( 102 , 87 ) ; HelpID = HID_SVXTBX_UNDO_REDO_CTRL ; - SysWin = TRUE; - Border = TRUE ; + StdPopup = TRUE; Hide = TRUE ; - SVLook = TRUE ; OutputSize = TRUE ; ListBox LB_SVXTBX_UNDO_REDO_CTRL { Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 150 , 60 ) ; + Size = MAP_APPFONT ( 100 , 85 ) ; Border = TRUE ; DropDown = FALSE ; OutputSize = TRUE ; }; - FixedText FT_NUM_OPERATIONS - { - Pos = MAP_APPFONT ( 6 , 64 ) ; - Size = MAP_APPFONT ( 138 , 10 ) ; - }; }; String RID_SVXSTR_NUM_UNDO_ACTIONS -- cgit From a3aeca6c6c4f2efb964b590b8e5d838706229da9 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 11:25:20 +0200 Subject: vcl-better-fallback.diff: Try all when some of the plugins are not available i#50857 --- vcl/unx/source/plugadapt/salplug.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx index a438760cffba..67d2796c8674 100644 --- a/vcl/unx/source/plugadapt/salplug.cxx +++ b/vcl/unx/source/plugadapt/salplug.cxx @@ -233,9 +233,11 @@ SalInstance *CreateSalInstance() if( ! pInst ) pInst = autodetect_plugin(); - // fallback to gen - if( ! pInst ) - pInst = tryInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "gen" ) ) ); + // fallback, try everything + const char* pPlugin[] = { "gtk", "kde", "gen", 0 }; + + for ( int i = 0; !pInst && pPlugin[ i ]; ++i ) + pInst = tryInstance( OUString::createFromAscii( pPlugin[ i ] ) ); if( ! pInst ) { -- cgit From c2edb892cf8ddbac641737a04b58ab0db7e6cd21 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 11:34:48 +0200 Subject: vcl-bitmap2-negative-height.diff: Load bitmaps even when height is negative n#228839 --- vcl/source/gdi/bitmap2.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx index de926a0446ca..6da78c697525 100644 --- a/vcl/source/gdi/bitmap2.cxx +++ b/vcl/source/gdi/bitmap2.cxx @@ -172,7 +172,7 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset ) { const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) ); - const Size aSizePixel( aHeader.nWidth, aHeader.nHeight ); + const Size aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) ); BitmapPalette aDummyPal; Bitmap aNewBmp( aSizePixel, nBitCount, &aDummyPal ); BitmapWriteAccess* pAcc = aNewBmp.AcquireWriteAccess(); @@ -244,7 +244,7 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset ) Fraction( 1000, aHeader.nYPelsPerMeter ) ); aNewBmp.SetPrefMapMode( aMapMode ); - aNewBmp.SetPrefSize( Size( aHeader.nWidth, aHeader.nHeight ) ); + aNewBmp.SetPrefSize( Size( aHeader.nWidth, abs(aHeader.nHeight) ) ); } } @@ -365,7 +365,7 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal else { rIStm >> rHeader.nWidth; - rIStm >> rHeader.nHeight; + rIStm >> rHeader.nHeight; //rHeader.nHeight=abs(rHeader.nHeight); rIStm >> rHeader.nPlanes; rIStm >> rHeader.nBitCount; rIStm >> rHeader.nCompression; @@ -461,7 +461,13 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri if( rHeader.nColsUsed && rHeader.nBitCount > 8 ) rIStm.SeekRel( rHeader.nColsUsed * ( ( rHeader.nSize != DIBCOREHEADERSIZE ) ? 4 : 3 ) ); - rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth ); + if ( rHeader.nHeight > 0 ) + rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth ); + else + { + for( int i = abs(rHeader.nHeight)-1; i >= 0; i-- ) + rIStm.Read( ((char*)rAcc.GetBuffer()) + (nAlignedWidth*i), nAlignedWidth ); + } } else { @@ -504,7 +510,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri else { const long nWidth = rHeader.nWidth; - const long nHeight = rHeader.nHeight; + const long nHeight = abs(rHeader.nHeight); BYTE* pBuf = new BYTE[ nAlignedWidth ]; // true color DIB's can have a (optimization) palette @@ -1061,7 +1067,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, BOOL bRLE4 ) { Scanline pRLE = pBuffer; - long nY = rHeader.nHeight - 1L; + long nY = abs(rHeader.nHeight) - 1L; const ULONG nWidth = rAcc.Width(); ULONG nCountByte; ULONG nRunByte; -- cgit From aaa59999755571532fe090245dcea99f57202b10 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 11:46:59 +0200 Subject: toolbar-decorations-rsc.diff: Improved toolbar popups. --- rsc/inc/rscdb.hxx | 1 + rsc/inc/vclrsc.hxx | 5 +++++ rsc/source/parser/rscicpx.cxx | 1 + rsc/source/parser/rscinit.cxx | 2 ++ 4 files changed, 9 insertions(+) diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 1d5af35de9ff..4a32d954efa6 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -97,6 +97,7 @@ class RscTypCont Atom nMinimizeId; Atom nMaximizeId; Atom nCloseableId; + Atom nStdPopupId; Atom nAppId; Atom nTabstopId; Atom nGroupId; diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx index 49847bd91e69..f84c11136700 100644 --- a/rsc/inc/vclrsc.hxx +++ b/rsc/inc/vclrsc.hxx @@ -84,6 +84,10 @@ typedef sal_Int64 WinBits; #define WB_AUTOVSCROLL ((WinBits)0x40000000) #define WB_HIDE ((WinBits)0x80000000) + +// system floating window +#define WB_POPUP ((WinBits)0x20000000) + #define WB_HSCROLL WB_HORZ #define WB_VSCROLL WB_VERT #define WB_TOPIMAGE WB_TOP @@ -152,6 +156,7 @@ typedef sal_Int64 WinBits; #define WB_STDMODAL (WB_STDDIALOG) #define WB_STDTABDIALOG (WB_STDDIALOG) #define WB_STDTABCONTROL 0 +#define WB_STDPOPUP (WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL) // For TreeListBox #define WB_HASBUTTONS ((WinBits)0x00800000) diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 625417769f45..b401cf677612 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -2218,6 +2218,7 @@ RscTop * RscTypCont::InitClassFloatingWindow( RscTop * pSuper, INS_WINBIT(pClassFloatingWindow,Zoomable) INS_WINBIT(pClassFloatingWindow,HideWhenDeactivate) INS_WINBIT(pClassFloatingWindow,EnableResizing) + INS_WINBIT(pClassFloatingWindow,StdPopup) return pClassFloatingWindow; } diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx index a763b92f0bb1..9c15bde0ffad 100644 --- a/rsc/source/parser/rscinit.cxx +++ b/rsc/source/parser/rscinit.cxx @@ -374,6 +374,8 @@ void RscTypCont::Init() aWinBits.SetConstant( nSingleLineId, sal::static_int_cast(WB_SINGLELINE) ); nSysWinId = pHS->getID( "WB_SYSTEMWINDOW" ); aWinBits.SetConstant( nSysWinId, sal::static_int_cast(WB_SYSTEMWINDOW) ); + nStdPopupId = pHS->getID( "WB_STDPOPUP" ); + aWinBits.SetConstant( nStdPopupId, sal::static_int_cast(WB_STDPOPUP) ); } { /********** I n i t B a s i c T y p e s **************************/ -- cgit From 0b586586c21e59b3b434aea1990ba254a0217d1b Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 11:47:36 +0200 Subject: toolbar-decorations-vcl.diff: Improved toolbar popups. --- tools/inc/tools/wintypes.hxx | 2 ++ vcl/inc/vcl/brdwin.hxx | 3 ++- vcl/inc/vcl/floatwin.hxx | 3 ++- vcl/source/app/settings.cxx | 2 +- vcl/source/window/brdwin.cxx | 46 +++++++++++++++++++++++++------- vcl/source/window/floatwin.cxx | 8 ++++-- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 6 +++-- vcl/unx/kde/salnativewidgets-kde.cxx | 9 ++++--- vcl/unx/kde4/KDESalFrame.cxx | 15 ++++++----- 9 files changed, 68 insertions(+), 26 deletions(-) diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx index 7d6296b76e8c..4ce2b24ac717 100644 --- a/tools/inc/tools/wintypes.hxx +++ b/tools/inc/tools/wintypes.hxx @@ -193,6 +193,7 @@ typedef sal_Int64 WinBits; #define WB_OWNERDRAWDECORATION ((WinBits)SAL_CONST_INT64(0x2000000000)) #define WB_DEFAULTWIN ((WinBits)SAL_CONST_INT64(0x4000000000)) #define WB_NEEDSFOCUS ((WinBits)SAL_CONST_INT64(0x1000000000)) +#define WB_POPUP ((WinBits)SAL_CONST_INT64(0x20000000)) #define WB_HSCROLL WB_HORZ #define WB_VSCROLL WB_VERT @@ -272,6 +273,7 @@ typedef sal_Int64 WinBits; #define WB_STDMODAL (WB_STDDIALOG) #define WB_STDTABDIALOG (WB_STDDIALOG) #define WB_STDTABCONTROL 0 +#define WB_STDPOPUP (WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL) // For TreeListBox #define WB_HASBUTTONS ((WinBits)0x00800000) diff --git a/vcl/inc/vcl/brdwin.hxx b/vcl/inc/vcl/brdwin.hxx index bf76174150e2..d34d0df34928 100644 --- a/vcl/inc/vcl/brdwin.hxx +++ b/vcl/inc/vcl/brdwin.hxx @@ -84,7 +84,8 @@ class ImplBorderWindowView; #define BORDERWINDOW_TITLE_NORMAL ((USHORT)0x0001) #define BORDERWINDOW_TITLE_SMALL ((USHORT)0x0002) #define BORDERWINDOW_TITLE_TEAROFF ((USHORT)0x0004) -#define BORDERWINDOW_TITLE_NONE ((USHORT)0x0008) +#define BORDERWINDOW_TITLE_POPUP ((USHORT)0x0008) +#define BORDERWINDOW_TITLE_NONE ((USHORT)0x0010) // -------------------- // - ImplBorderWindow - diff --git a/vcl/inc/vcl/floatwin.hxx b/vcl/inc/vcl/floatwin.hxx index 8b7c9be6499c..af2f985edb65 100644 --- a/vcl/inc/vcl/floatwin.hxx +++ b/vcl/inc/vcl/floatwin.hxx @@ -65,7 +65,8 @@ class PopupModeEvent; #define FLOATWIN_TITLE_NORMAL ((USHORT)0x0001) #define FLOATWIN_TITLE_TEAROFF ((USHORT)0x0002) -#define FLOATWIN_TITLE_NONE ((USHORT)0x0004) +#define FLOATWIN_TITLE_POPUP ((USHORT)0x0004) +#define FLOATWIN_TITLE_NONE ((USHORT)0x0008) // ------------------ // - FloatingWindow - diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 7f97ba2d8720..f3dc3259d264 100755 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -562,8 +562,8 @@ void ImplStyleData::SetStandardStyles() maPushButtonFont = aStdFont; maFieldFont = aStdFont; maIconFont = aStdFont; - maFloatTitleFont = aStdFont; aStdFont.SetWeight( WEIGHT_BOLD ); + maFloatTitleFont = aStdFont; maTitleFont = aStdFont; maFaceColor = Color( COL_LIGHTGRAY ); diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index b221d1f7d928..48d01e4f2059 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -211,7 +211,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData ) { ImplBorderWindow* pBorderWindow = pData->mpBorderWindow; - if ( !(pBorderWindow->GetStyle() & WB_MOVEABLE) || + if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) ) { pData->mnTitleType = BORDERWINDOW_TITLE_NONE; @@ -276,7 +276,7 @@ USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Poin // no corner resize for floating toolbars, which would lead to jumps while formatting // setting nSizeWidth = 0 will only return pure left,top,right,bottom - if( pBorderWindow->GetStyle() & WB_OWNERDRAWDECORATION ) + if( pBorderWindow->GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP) ) nSizeWidth = 0; if ( rPos.X() < pData->mnLeftBorder ) @@ -1494,7 +1494,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh pData->mnTitleType = pBorderWindow->mnTitleType; pData->mbFloatWindow = pBorderWindow->mbFloatWindow; - if ( !(pBorderWindow->GetStyle() & WB_MOVEABLE) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) ) + if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) ) pData->mnBorderSize = 0; else if ( pData->mnTitleType == BORDERWINDOW_TITLE_TEAROFF ) pData->mnBorderSize = 0; @@ -1519,7 +1519,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh // set a proper background for drawing // highlighted buttons in the title - pBorderWindow->SetBackground( rStyleSettings.GetWindowColor() ); + pBorderWindow->SetBackground( rStyleSettings.GetFaceColor() ); pData->maTitleRect.Left() = pData->mnLeftBorder; pData->maTitleRect.Right() = nWidth-pData->mnRightBorder-1; @@ -1662,19 +1662,43 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD Rectangle aInRect( aTmpPoint, Size( pData->mnWidth, pData->mnHeight ) ); const StyleSettings& rStyleSettings = pData->mpOutDev->GetSettings().GetStyleSettings(); DecorationView aDecoView( pDev ); - Color aFrameColor( rStyleSettings.GetFaceColor() ); + Color aFaceColor( rStyleSettings.GetFaceColor() ); + Color aFrameColor( aFaceColor ); aFrameColor.DecreaseContrast( (UINT8) (0.50 * 255)); // Draw Frame if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME ) { + Region oldClipRgn( pDev->GetClipRegion( ) ); + + // for popups, don't draw part of the frame + if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP ) + { + FloatingWindow *pWin = dynamic_cast< FloatingWindow* >( pData->mpBorderWindow->GetWindow( WINDOW_CLIENT ) ); + if ( pWin ) + { + Region aClipRgn( aInRect ); + Rectangle aItemClipRect( pWin->ImplGetItemEdgeClipRect() ); + if( !aItemClipRect.IsEmpty() ) + { + aItemClipRect.SetPos( pData->mpBorderWindow->AbsoluteScreenToOutputPixel( aItemClipRect.TopLeft() ) ); + aClipRgn.Exclude( aItemClipRect ); + pDev->SetClipRegion( aClipRgn ); + } + } + } + // single line frame pDev->SetLineColor( aFrameColor ); pDev->SetFillColor(); pDev->DrawRect( aInRect ); aInRect.nLeft++; aInRect.nRight--; aInRect.nTop++; aInRect.nBottom--; + + // restore + if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP ) + pDev->SetClipRegion( oldClipRgn ); } else aInRect = aDecoView.DrawFrame( aInRect, FRAME_DRAW_DOUBLEOUT | FRAME_DRAW_NODRAW); @@ -1701,7 +1725,11 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD aInRect = pData->maTitleRect; // use no gradient anymore, just a static titlecolor - pDev->SetFillColor( aFrameColor ); + if ( pData->mnTitleType != BORDERWINDOW_TITLE_POPUP ) + pDev->SetFillColor( aFrameColor ); + else + pDev->SetFillColor( aFaceColor ); + pDev->SetTextColor( rStyleSettings.GetButtonTextColor() ); Rectangle aTitleRect( pData->maTitleRect ); if( pOffset ) @@ -1836,7 +1864,7 @@ void ImplBorderWindow::ImplInit( Window* pParent, { // Alle WindowBits entfernen, die wir nicht haben wollen WinBits nOrgStyle = nStyle; - WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_NEEDSFOCUS); + WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_NEEDSFOCUS | WB_POPUP); if ( nTypeStyle & BORDERWINDOW_STYLE_APP ) nTestStyle |= WB_APP; nStyle &= nTestStyle; @@ -1851,7 +1879,7 @@ void ImplBorderWindow::ImplInit( Window* pParent, mpWindowImpl->mbFrame = TRUE; mbFrameBorder = FALSE; } - else if( (nStyle & WB_OWNERDRAWDECORATION) ) + else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) ) { mpWindowImpl->mbOverlapWin = TRUE; mpWindowImpl->mbFrame = TRUE; @@ -2103,7 +2131,7 @@ void ImplBorderWindow::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - if ( !mpWindowImpl->mbFrame || (GetStyle() & WB_OWNERDRAWDECORATION) ) + if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) ) UpdateView( TRUE, ImplGetWindow()->GetOutputSizePixel() ); } diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 323bbe3b0d74..d775e9f2bf6e 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -138,7 +138,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle ) mpNextFloat = NULL; mpFirstPopupModeWin = NULL; mnPostId = 0; - mnTitle = (nStyle & WB_MOVEABLE) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE; + mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE; mnOldTitle = mnTitle; mnPopupModeFlags = 0; mbInPopupMode = FALSE; @@ -652,6 +652,8 @@ void FloatingWindow::SetTitleType( USHORT nTitle ) nTitleStyle = BORDERWINDOW_TITLE_SMALL; else if ( nTitle == FLOATWIN_TITLE_TEAROFF ) nTitleStyle = BORDERWINDOW_TITLE_TEAROFF; + else if ( nTitle == FLOATWIN_TITLE_POPUP ) + nTitleStyle = BORDERWINDOW_TITLE_POPUP; else // nTitle == FLOATWIN_TITLE_NONE nTitleStyle = BORDERWINDOW_TITLE_NONE; ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetTitleType( nTitleStyle, aOutSize ); @@ -672,7 +674,9 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags ) // remove title mnOldTitle = mnTitle; - if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF ) + if ( ( mpWindowImpl->mnStyle & WB_POPUP ) && GetText().Len() ) + SetTitleType( FLOATWIN_TITLE_POPUP ); + else if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF ) SetTitleType( FLOATWIN_TITLE_TEAROFF ); else SetTitleType( FLOATWIN_TITLE_NONE ); diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 9d3ce6b137cd..329b96a52e70 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -3571,8 +3571,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetAppFont( aFont ); aStyleSet.SetHelpFont( aFont ); - aStyleSet.SetTitleFont( aFont ); - aStyleSet.SetFloatTitleFont( aFont ); aStyleSet.SetMenuFont( aFont ); aStyleSet.SetToolFont( aFont ); aStyleSet.SetLabelFont( aFont ); @@ -3583,6 +3581,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetIconFont( aFont ); aStyleSet.SetGroupFont( aFont ); + aFont.SetWeight( WEIGHT_BOLD ); + aStyleSet.SetTitleFont( aFont ); + aStyleSet.SetFloatTitleFont( aFont ); + // get cursor blink time GtkSettings *pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gEditBoxWidget ); gboolean blink = false; diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 29d79f88ffb3..7e07ca6e8d4d 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -1943,9 +1943,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetAppFont( aFont ); aStyleSettings.SetHelpFont( aFont ); - if( !bSetTitleFont ) - aStyleSettings.SetTitleFont( aFont ); - aStyleSettings.SetFloatTitleFont( aFont ); aStyleSettings.SetMenuFont( aFont ); // will be changed according to pMenuBar aStyleSettings.SetToolFont( aFont ); // will be changed according to pToolBar aStyleSettings.SetLabelFont( aFont ); @@ -1955,6 +1952,12 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetFieldFont( aFont ); aStyleSettings.SetIconFont( aFont ); aStyleSettings.SetGroupFont( aFont ); + + aFont.SetWeight( WEIGHT_BOLD ); + if( !bSetTitleFont ) + aStyleSettings.SetTitleFont( aFont ); + aStyleSettings.SetFloatTitleFont( aFont ); + int flash_time = QApplication::cursorFlashTime(); aStyleSettings.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME ); diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index 0c8f04f9fe41..b3ff198785c1 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -288,12 +288,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) style.SetAppFont( aFont ); style.SetHelpFont( aFont ); - if( !bSetTitleFont ) - { - style.SetTitleFont( aFont ); - } - - style.SetFloatTitleFont( aFont ); style.SetMenuFont( aFont ); // will be changed according to pMenuBar //style.SetToolFont( aFont ); //already set above style.SetLabelFont( aFont ); @@ -304,6 +298,13 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) style.SetIconFont( aFont ); style.SetGroupFont( aFont ); + aFont.SetWeight( WEIGHT_BOLD ); + if( !bSetTitleFont ) + { + style.SetTitleFont( aFont ); + } + style.SetFloatTitleFont( aFont ); + int flash_time = QApplication::cursorFlashTime(); style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME ); @@ -402,4 +403,4 @@ SalGraphics* KDESalFrame::GetGraphics() } return NULL; -} \ No newline at end of file +} -- cgit From b693b6b967e54b7186df5918bfd82e628301da6b Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 14:16:20 +0200 Subject: g++44-debug.diff: Fixed some imports for debug more --- writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 4 ++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 1 + 2 files changed, 5 insertions(+) diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 958a96fbff7d..a7d9c6210816 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -36,6 +36,10 @@ #include #endif +#if OSL_DEBUG_LEVEL > 1 +#include +#endif + namespace writerfilter { namespace dmapper { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 4c176b59b4ef..efe89ed7a201 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -80,6 +80,7 @@ #include #if DEBUG +#include #include #include #endif -- cgit From f1279d1f591f492d5be347ebcb38dcbb9859c865 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 14:16:21 +0200 Subject: g++44-debug.diff: Fixed some imports for debug more --- sw/source/core/text/inftxt.cxx | 4 ++++ sw/source/filter/ww8/WW8Sttbf.cxx | 4 ++++ sw/source/filter/ww8/wrtww8gr.cxx | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 1fe2c363d70e..961c6a4ee560 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -84,6 +84,10 @@ #include +#ifdef DEBUG +#include +#endif + using namespace ::com::sun::star; using namespace ::com::sun::star::linguistic2; using namespace ::com::sun::star::uno; diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx index 796670385bd4..4794a674b47e 100644 --- a/sw/source/filter/ww8/WW8Sttbf.cxx +++ b/sw/source/filter/ww8/WW8Sttbf.cxx @@ -31,6 +31,10 @@ #include "WW8Sttbf.hxx" #include +#ifdef DEBUG +#include +#endif + namespace ww8 { WW8Struct::WW8Struct(SvStream& rSt, sal_uInt32 nPos, sal_uInt32 nSize) diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 5d96a74b009d..33196138a650 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -79,6 +79,10 @@ #include "docsh.hxx" #include +#if OSL_DEBUG_LEVEL > 0 +#include +#endif + using namespace ::com::sun::star; using namespace nsFieldFlags; -- cgit From a4f835d03a4cad5e4b454faa8eebbf3eefc0448c Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 14:20:04 +0200 Subject: idlc-error-offset.diff: Add character offset for idlc errors i#81780 --- idlc/inc/idlc/idlc.hxx | 8 ++++++++ idlc/source/errorhandler.cxx | 15 ++++++++++++--- idlc/source/idlc.cxx | 2 ++ idlc/source/parser.y | 7 ++++++- idlc/source/scanner.ll | 33 +++++++++++++++++++++++---------- 5 files changed, 51 insertions(+), 14 deletions(-) diff --git a/idlc/inc/idlc/idlc.hxx b/idlc/inc/idlc/idlc.hxx index cec8e58900fb..663698143f7e 100644 --- a/idlc/inc/idlc/idlc.hxx +++ b/idlc/inc/idlc/idlc.hxx @@ -102,6 +102,12 @@ public: { m_warningCount++; } sal_uInt32 getLineNumber() { return m_lineNumber; } + sal_uInt32 getOffsetStart() + { return m_offsetStart; } + sal_uInt32 getOffsetEnd() + { return m_offsetEnd; } + void setOffset( sal_uInt32 start, sal_uInt32 end) + { m_offsetStart = start; m_offsetEnd = end; } void setLineNumber(sal_uInt32 lineNumber) { m_lineNumber = lineNumber; } void incLineNumber() @@ -136,6 +142,8 @@ private: sal_uInt32 m_errorCount; sal_uInt32 m_warningCount; sal_uInt32 m_lineNumber; + sal_uInt32 m_offsetStart; + sal_uInt32 m_offsetEnd; ParseState m_parseState; StringSet m_includes; }; diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx index 4ab4844eeca7..2bc8a6699403 100644 --- a/idlc/source/errorhandler.cxx +++ b/idlc/source/errorhandler.cxx @@ -488,7 +488,7 @@ static OString flagToString(sal_uInt32 flag) return flagStr; } -static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber) +static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber, sal_uInt32 start, sal_uInt32 end) { OString file; if ( idlc()->getFileName() == idlc()->getRealFileName() ) @@ -496,14 +496,23 @@ static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber) else file = idlc()->getFileName(); - fprintf(stderr, "%s(%lu) : %s", file.getStr(), + fprintf(stderr, "%s:%lu [%lu:%lu] : %s", file.getStr(), sal::static_int_cast< unsigned long >(lineNumber), + sal::static_int_cast< unsigned long >(start), + sal::static_int_cast< unsigned long >(end), errorCodeToMessage(eCode)); } +static void errorHeader(ErrorCode eCode, sal_uInt32 lineNumber) +{ + errorHeader(eCode, lineNumber, + idlc()->getOffsetStart(), idlc()->getOffsetEnd()); +} + static void errorHeader(ErrorCode eCode) { - errorHeader(eCode, idlc()->getLineNumber()); + errorHeader(eCode, idlc()->getLineNumber(), + idlc()->getOffsetStart(), idlc()->getOffsetEnd()); } static void warningHeader(WarningCode wCode) diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx index 1477739cd531..f8317f3b55c0 100644 --- a/idlc/source/idlc.cxx +++ b/idlc/source/idlc.cxx @@ -219,6 +219,8 @@ Idlc::Idlc(Options* pOptions) , m_errorCount(0) , m_warningCount(0) , m_lineNumber(0) + , m_offsetStart(0) + , m_offsetEnd(0) , m_parseState(PS_NoState) { m_pScopes = new AstStack(); diff --git a/idlc/source/parser.y b/idlc/source/parser.y index 8da9c7ad63b5..b6c56c60faaf 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -103,13 +103,16 @@ #include #include + +#include using namespace ::rtl; #define YYDEBUG 1 #define YYERROR_VERBOSE 1 +#define YYLEX_PARAM &yylval, &yylloc -extern int yylex(void); +extern int yylex (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ); void yyerror(char const *); void checkIdentifier(::rtl::OString* id) @@ -262,6 +265,7 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) { #pragma warning(disable: 4273 4701 4706) #endif %} +%locations /* * Declare the type of values in the grammar */ @@ -972,6 +976,7 @@ attribute_get_raises: rtl::OStringToOUString( idlc()->getDocumentation(), RTL_TEXTENCODING_UTF8)); $$.exceptions = $2; + int line = @2.first_line; } ; diff --git a/idlc/source/scanner.ll b/idlc/source/scanner.ll index 4125195f5916..d8596585cb95 100644 --- a/idlc/source/scanner.ll +++ b/idlc/source/scanner.ll @@ -46,12 +46,21 @@ #include "attributeexceptions.hxx" + class AstExpression; class AstArray; class AstMember; #include +/* handle locations */ +int yycolumn = 1; + +#define YY_USER_ACTION yylloc->first_line = yylloc->last_line = yylineno; \ + yylloc->first_column = yycolumn; yylloc->last_column = yycolumn+yyleng-1; \ + idlc()->setOffset(yylloc->first_column, yylloc->last_column); \ + yycolumn += yyleng; + sal_Int32 beginLine = 0; ::rtl::OString docu; @@ -225,6 +234,7 @@ static void parseLineAndFile(sal_Char* pBuf) for (; *r != '\0' && *r != ' ' && *r != '\t'; r++) ; *r++ = 0; idlc()->setLineNumber((sal_uInt32)atol(h)); + yylineno = atol(h); /* Find file name, if present */ for (; *r != '"'; r++) @@ -260,6 +270,7 @@ static void parseLineAndFile(sal_Char* pBuf) #endif %} +%option bison-bridge bison-locations %option noyywrap %option never-interactive @@ -281,8 +292,10 @@ IDENTIFIER ("_"?({ALPHA}|{DIGIT})+)* %% [ \t\r]+ ; /* eat up whitespace */ -[\n] { - idlc()->incLineNumber(); +[\n] { + idlc()->incLineNumber(); + yycolumn = 1; + yylineno++; } attribute return IDL_ATTRIBUTE; @@ -347,39 +360,39 @@ published return IDL_PUBLISHED; "..." return IDL_ELLIPSIS; ("-")?{INT_LITERAL}+(l|L|u|U)? { - return asciiToInteger(yytext, &yylval.ival, &yylval.uval); + return asciiToInteger(yytext, &yylval->ival, &yylval->uval); } ("-")?{OCT_LITERAL}+(l|L|u|U)? { - return asciiToInteger(yytext, &yylval.ival, &yylval.uval); + return asciiToInteger(yytext, &yylval->ival, &yylval->uval); } ("-")?{HEX_LITERAL}+(l|L|u|U)? { - return asciiToInteger(yytext, &yylval.ival, &yylval.uval); + return asciiToInteger(yytext, &yylval->ival, &yylval->uval); } ("-")?{DIGIT}+(e|E){1}(("+"|"-")?{DIGIT}+)+(f|F)? | ("-")?"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? | ("-")?{DIGIT}*"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? { - yylval.dval = asciiToFloat( yytext ); + yylval->dval = asciiToFloat( yytext ); return IDL_FLOATING_PT_LITERAL; } {IDENTIFIER} { - yylval.sval = new ::rtl::OString(yytext); + yylval->sval = new ::rtl::OString(yytext); return IDL_IDENTIFIER; } \<\< { - yylval.strval = yytext; + yylval->strval = yytext; return IDL_LEFTSHIFT; } \>\> { - yylval.strval = yytext; + yylval->strval = yytext; return IDL_RIGHTSHIFT; } \:\: { - yylval.strval = yytext; + yylval->strval = yytext; return IDL_SCOPESEPARATOR; } -- cgit From cd954198c7d4bc596be4cb3e0fb9f3e216859251 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 14:28:15 +0200 Subject: sw-section-import-fix.diff: Additional paragraph imported from ww8 n#364533 --- sw/source/filter/ww8/ww8par.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 24f36b047a4e..0f4d7231da61 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2713,9 +2713,10 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) else if (!nInTable) { // Always insert a txtnode for a column break, e.g. ## - AppendTxtNode(*pPaM->GetPoint()); - rDoc.InsertPoolItem(*pPaM, - SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK), 0); + SwCntntNode *pCntNd=pPaM->GetCntntNode(); + if (pCntNd!=NULL && pCntNd->Len()>0) // if par is empty not break is needed + AppendTxtNode(*pPaM->GetPoint()); + rDoc.InsertPoolItem(*pPaM, SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK), 0); } break; case 0x7: -- cgit From 42532d42bfcdb12df86376cda009e8e315a82153 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 14:32:01 +0200 Subject: sw-allow-negative-spacing.diff: correctly display linespacing < 100% n#364534 --- sw/source/core/text/itrform2.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 0ae80fb5306f..0fe28f4f5c39 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1746,6 +1746,28 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine ) switch( pSpace->GetLineSpaceRule() ) { case SVX_LINE_SPACE_AUTO: + if (pSpace->GetInterLineSpaceRule()==SVX_INTER_LINE_SPACE_PROP) { + long nTmp = pSpace->GetPropLineSpace(); + if (nTmp<100) { // code adaped from fixed line height + nTmp *= nLineHeight; + nTmp /= 100; + if( !nTmp ) + ++nTmp; + nLineHeight = (KSHORT)nTmp; +/* + //@TODO figure out how WW maps ascent and descent + //in case of prop line spacing <100% + KSHORT nAsc = ( 4 * nLineHeight ) / 5; // 80% + if( nAsc < pCurr->GetAscent() || + nLineHeight - nAsc < pCurr->Height() - +pCurr->GetAscent() ) + pCurr->SetClipping( sal_True ); + pCurr->SetAscent( nAsc ); +*/ + pCurr->Height( nLineHeight ); + pInf->GetParaPortion()->SetFixLineHeight(); + } + } break; case SVX_LINE_SPACE_MIN: { -- cgit From de0866b507e259f1726d1015293aad8fcadd763a Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 14:36:01 +0200 Subject: sw-invert-border-spacing.diff: n#391591 --- sw/inc/IDocumentSettingAccess.hxx | 1 + sw/inc/doc.hxx | 1 + sw/source/core/doc/doc.cxx | 4 ++++ sw/source/core/doc/docnew.cxx | 1 + sw/source/core/layout/frmtool.cxx | 9 +++++++-- sw/source/core/layout/paintfrm.cxx | 2 +- sw/source/filter/rtf/swparrtf.cxx | 2 +- sw/source/filter/ww8/ww8par.cxx | 2 ++ sw/source/filter/ww8/ww8par6.cxx | 17 +++++++++++++---- sw/source/ui/uno/SwXDocumentSettings.cxx | 18 +++++++++++++++--- 10 files changed, 46 insertions(+), 11 deletions(-) diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 6be53158ddc8..32e6551a8f76 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -81,6 +81,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd // --> OD 2008-06-05 #i89181# TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- + INVERT_BORDER_SPACING, // COMPATIBILITY FLAGS END BROWSE_MODE, diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 1e26b0f0e2bd..bc4bc86ef12b 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -603,6 +603,7 @@ private: bool mbOldPrinterMetrics : 1; // FME 2007-05-14 #147385# bool mbTabRelativeToIndent : 1; // #i24363# tab stops relative to indent bool mbProtectForm : 1; + bool mbInvertBorderSpacing : 1; bool mbTabAtLeftIndentForParagraphsInList; // OD 2008-06-05 #i89181# - see above // #i78591# diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index fd45279d4d13..64c73c59d7b9 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -197,6 +197,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const // --> OD 2008-06-05 #i89181# case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList; // <-- + case INVERT_BORDER_SPACING: return mbInvertBorderSpacing; // COMPATIBILITY FLAGS END case BROWSE_MODE: return mbBrowseMode; @@ -320,6 +321,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) mbTabAtLeftIndentForParagraphsInList = value; break; // <-- + case INVERT_BORDER_SPACING: + mbInvertBorderSpacing = value; + break; // COMPATIBILITY FLAGS END case BROWSE_MODE: diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 1b3d5fe6eb55..8e3a2f5d4fdc 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -383,6 +383,7 @@ SwDoc::SwDoc() : // --> OD 2008-06-05 #i89181# mbTabAtLeftIndentForParagraphsInList = false; // hidden // <-- + mbInvertBorderSpacing = false; // hidden // // COMPATIBILITY FLAGS END diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 395009122063..b63178705803 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2002,8 +2002,9 @@ void SwBorderAttrs::_CalcBottom() long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const { - long nRight; + long nRight=0; + if (!pCaller->IsTxtFrm() || !((SwTxtFrm*)pCaller)->GetTxtNode()->GetDoc()->get(IDocumentSettingAccess::INVERT_BORDER_SPACING)) { // OD 23.01.2003 #106895# - for cell frame in R2L text direction the left // and right border are painted on the right respectively left. if ( pCaller->IsCellFrm() && pCaller->IsRightToLeft() ) @@ -2011,6 +2012,7 @@ long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const else nRight = CalcRightLine(); + } // for paragraphs, "left" is "before text" and "right" is "after text" if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() ) nRight += rLR.GetLeft(); @@ -2030,14 +2032,16 @@ long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const { - long nLeft; + long nLeft=0; + if (!pCaller->IsTxtFrm() || !((SwTxtFrm*)pCaller)->GetTxtNode()->GetDoc()->get(IDocumentSettingAccess::INVERT_BORDER_SPACING)) { // OD 23.01.2003 #106895# - for cell frame in R2L text direction the left // and right border are painted on the right respectively left. if ( pCaller->IsCellFrm() && pCaller->IsRightToLeft() ) nLeft = CalcRightLine(); else nLeft = CalcLeftLine(); + } // for paragraphs, "left" is "before text" and "right" is "after text" if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() ) @@ -2045,6 +2049,7 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const else nLeft += rLR.GetLeft(); + // --> OD 2008-01-21 #newlistlevelattrs# // correction: do not retrieve left margin for numbering in R2L-layout // if ( pCaller->IsTxtFrm() ) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 09fc6b00e03d..3664c4c99615 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4662,7 +4662,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage, const SwBorderAttrs &rAttrs ) const { //fuer (Row,Body,Ftn,Root,Column,NoTxt) gibt's hier nix zu tun - if ( (GetType() & 0x90C5) || (Prt().SSize() == Frm().SSize()) ) + if ( (GetType() & 0x90C5) ) return; if ( (GetType() & 0x2000) && //Cell diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index e83ab108bbc9..352ecd008589 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -296,7 +296,7 @@ void SwRTFParser::Continue( int nToken ) // --> FME 2006-02-10 #131283# pDoc->set(IDocumentSettingAccess::TABLE_ROW_KEEP, true); pDoc->set(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, true); - + pDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, true); // // COMPATIBILITY FLAGS END // diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0f4d7231da61..a8099b970aa9 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1394,6 +1394,8 @@ void SwWW8ImplReader::ImportDop() rDoc.set(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, true); // <-- + rDoc.set(IDocumentSettingAccess::INVERT_BORDER_SPACING, true); + // // COMPATIBILITY FLAGS END // diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index b298f3721b00..731f3da36015 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -4798,10 +4798,19 @@ void SwWW8ImplReader::Read_Border(USHORT , const BYTE* , short nLen) maTracer.Log(sw::log::eBorderDistOutside); - aBox.SetDistance( (USHORT)aInnerDist.Left(), BOX_LINE_LEFT ); - aBox.SetDistance( (USHORT)aInnerDist.Top(), BOX_LINE_TOP ); - aBox.SetDistance( (USHORT)aInnerDist.Right(), BOX_LINE_RIGHT ); - aBox.SetDistance( (USHORT)aInnerDist.Bottom(), BOX_LINE_BOTTOM ); + if ((nBorder & WW8_LEFT)==WW8_LEFT) { + aBox.SetDistance( (USHORT)aInnerDist.Left(), BOX_LINE_LEFT ); + } + if ((nBorder & WW8_TOP)==WW8_TOP) { + aBox.SetDistance( (USHORT)aInnerDist.Top(), BOX_LINE_TOP ); + } + if ((nBorder & WW8_RIGHT)==WW8_RIGHT) { + aBox.SetDistance( (USHORT)aInnerDist.Right(), BOX_LINE_RIGHT ); + } + + if ((nBorder & WW8_BOT)==WW8_BOT) { + aBox.SetDistance( (USHORT)aInnerDist.Bottom(), BOX_LINE_BOTTOM ); + } NewAttr( aBox ); diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index b0ad816df4a1..2804a122384a 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -124,7 +124,8 @@ enum SwDocumentSettingsPropertyHandles // --> OD 2008-06-05 #i89181# HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- - HANDLE_MODIFYPASSWORDINFO + HANDLE_MODIFYPASSWORDINFO, + HANDLE_INVERT_BORDER_SPACING }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -179,7 +180,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() // --> OD 2008-06-05 #i89181# { RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0}, - + { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to * find another solution before adding them to this property set - MTG @@ -688,6 +689,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf uno::Reference< uno::XInterface >() ); } break; + case HANDLE_INVERT_BORDER_SPACING: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, bTmp); + } + break; default: throw UnknownPropertyException(); } @@ -1020,7 +1027,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue <<= mpDocSh->GetModifyPasswordInfo(); } break; - + case HANDLE_INVERT_BORDER_SPACING: + { + sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::INVERT_BORDER_SPACING); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; default: throw UnknownPropertyException(); } -- cgit From 56b2cf0c10d9caa01ebae1d80465e342d046a85c Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 14:40:15 +0200 Subject: sw-collapse-empty-table-par-like-html.diff: n#376690 --- sw/inc/IDocumentSettingAccess.hxx | 1 + sw/inc/doc.hxx | 1 + sw/inc/ndtxt.hxx | 2 ++ sw/source/core/crsr/callnk.cxx | 50 ++++++++++++++++++++++++++++++++ sw/source/core/doc/doc.cxx | 4 +++ sw/source/core/doc/docnew.cxx | 1 + sw/source/core/inc/frame.hxx | 4 +++ sw/source/core/layout/calcmove.cxx | 43 +++++++++++++++++++++++++++ sw/source/core/layout/findfrm.cxx | 9 ++++++ sw/source/core/text/frmpaint.cxx | 34 ++++++++++++---------- sw/source/core/text/porrst.cxx | 16 ++++++++++ sw/source/filter/ww8/ww8par.cxx | 1 + sw/source/filter/ww8/ww8par2.cxx | 14 --------- sw/source/ui/uno/SwXDocumentSettings.cxx | 16 +++++++++- 14 files changed, 166 insertions(+), 30 deletions(-) diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 32e6551a8f76..3bd68f869097 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -82,6 +82,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- INVERT_BORDER_SPACING, + COLLAPSE_EMPTY_CELL_PARA, // COMPATIBILITY FLAGS END BROWSE_MODE, diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index bc4bc86ef12b..d8d4199d9092 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -604,6 +604,7 @@ private: bool mbTabRelativeToIndent : 1; // #i24363# tab stops relative to indent bool mbProtectForm : 1; bool mbInvertBorderSpacing : 1; + bool mbCollapseEmptyCellPara : 1; bool mbTabAtLeftIndentForParagraphsInList; // OD 2008-06-05 #i89181# - see above // #i78591# diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 53168d5a9cb4..811e445e7d0f 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -856,6 +856,8 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > MakeUnoObject(); + bool IsCollapse() const; + DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode) }; diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index bf06a19d83b0..276b8779e01a 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -43,10 +43,15 @@ #include #include #include +#include +#include +#include #include #include #include +#include + SwCallLink::SwCallLink( SwCrsrShell & rSh, ULONG nAktNode, xub_StrLen nAktCntnt, BYTE nAktNdTyp, long nLRPos, bool bAktSelection ) @@ -97,6 +102,51 @@ SwCallLink::~SwCallLink() if( !pCNd ) return; + bool bUpdatedTable = false; + SwFrm *myFrm=pCNd->GetFrm(); + if (myFrm!=NULL) + { + // We need to emulated a change of the row height in order + // to have the complete row redrawn + SwRowFrm* pRow = myFrm->FindRowFrm( ); + if ( pRow ) + { + const SwTableLine* pLine = pRow->GetTabLine( ); + SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( ); + pRow->Modify( NULL, &pSize ); + + bUpdatedTable = true; + } + } + + const SwDoc *pDoc=rShell.GetDoc(); + const SwCntntNode *pNode = NULL; + if ( ( pDoc != NULL && nNode < pDoc->GetNodes( ).Count( ) ) ) + { + pNode = pDoc->GetNodes()[nNode]->GetCntntNode(); + } + if ( pNode != NULL ) + { + SwFrm *myFrm2=pNode->GetFrm(); + if (myFrm2!=NULL) + { + // We need to emulated a change of the row height in order + // to have the complete row redrawn + SwRowFrm* pRow = myFrm2->FindRowFrm(); + if ( pRow ) + { + const SwTableLine* pLine = pRow->GetTabLine( ); + SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( ); + pRow->Modify( NULL, &pSize ); + + bUpdatedTable = true; + } + } + } + + if ( bUpdatedTable ) + rShell.GetWin( )->Invalidate( 0 ); + xub_StrLen nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex(); USHORT nNdWhich = pCNd->GetNodeType(); ULONG nAktNode = pCurCrsr->GetPoint()->nNode.GetIndex(); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 64c73c59d7b9..934909ebfd8a 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -198,6 +198,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList; // <-- case INVERT_BORDER_SPACING: return mbInvertBorderSpacing; + case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara; // COMPATIBILITY FLAGS END case BROWSE_MODE: return mbBrowseMode; @@ -324,6 +325,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) case INVERT_BORDER_SPACING: mbInvertBorderSpacing = value; break; + case COLLAPSE_EMPTY_CELL_PARA: + mbCollapseEmptyCellPara = value; + break; // COMPATIBILITY FLAGS END case BROWSE_MODE: diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 8e3a2f5d4fdc..78ee26f4c3b1 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -384,6 +384,7 @@ SwDoc::SwDoc() : mbTabAtLeftIndentForParagraphsInList = false; // hidden // <-- mbInvertBorderSpacing = false; // hidden + mbCollapseEmptyCellPara = true; // hidden // // COMPATIBILITY FLAGS END diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index e1560a230d7a..1cb7666ea850 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -624,6 +624,7 @@ public: SwRootFrm *FindRootFrm(); SwPageFrm *FindPageFrm(); SwFrm *FindColFrm(); + SwRowFrm *FindRowFrm(); SwFtnBossFrm *FindFtnBossFrm( BOOL bFootnotes = FALSE ); SwTabFrm *ImplFindTabFrm(); SwFtnFrm *ImplFindFtnFrm(); @@ -910,6 +911,9 @@ public: // FME 2007-08-30 #i81146# new loop control void ValidateThisAndAllLowers( const USHORT nStage ); + +public: + bool IsCollapse() const; }; inline BOOL SwFrm::IsInDocBody() const diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 28287c957ad1..377c58f329f4 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -63,6 +63,8 @@ #include // <-- +#include + //------------------------------------------------------------------------ // Move-Methoden //------------------------------------------------------------------------ @@ -952,6 +954,42 @@ void SwLayoutFrm::MakeAll() |* Letzte Aenderung MA 03. Mar. 96 |* |*************************************************************************/ +bool SwTxtNode::IsCollapse() const +{ + if ( GetDoc()->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA ) && GetTxt().Len()==0 ) { + ULONG nIdx=GetIndex(); + const SwEndNode *pNdBefore=GetNodes()[nIdx-1]->GetEndNode(); + const SwEndNode *pNdAfter=GetNodes()[nIdx+1]->GetEndNode(); + + // The paragraph is collapsed only if the NdAfter is the end of a cell + bool bInTable = this->FindTableNode( ) != NULL; + + SwSortedObjs* pObjs = this->GetFrm()->GetDrawObjs( ); + sal_uInt32 nObjs = ( pObjs != NULL ) ? pObjs->Count( ) : 0; + + if ( pNdBefore!=NULL && pNdAfter!=NULL && nObjs == 0 && bInTable ) { + return true; + } else { + return false; + } + } else + return false; +} + +bool SwFrm::IsCollapse() const +{ + if (IsTxtFrm()) { + const SwTxtFrm *pTxtFrm=(SwTxtFrm*)this; + const SwTxtNode *pTxtNode=pTxtFrm->GetTxtNode(); + if (pTxtNode && pTxtNode->IsCollapse()) { + return true; + } else { + return false; + } + } else { + return false; + } +} BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) { @@ -1054,6 +1092,11 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) // OD 2004-03-02 #106629# - use new method SwTwips nLower = CalcLowerSpace( &rAttrs ); + if (IsCollapse()) { + ViewShell *pSh = GetShell(); + nUpper=0; + nLower=0; + } // // in balanced columned section frames we do not want the // // common border // sal_Bool bCommonBorder = sal_True; diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 8a1e8fe9ea7a..a41d48bf1000 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -596,6 +596,15 @@ SwFrm *SwFrm::FindColFrm() return pFrm; } +SwRowFrm *SwFrm::FindRowFrm() +{ + SwFrm *pFrm = this; + do + { pFrm = pFrm->GetUpper(); + } while ( pFrm && !pFrm->IsRowFrm() ); + return dynamic_cast< SwRowFrm* >( pFrm ); +} + SwFrm* SwFrm::FindFooterOrHeader() { SwFrm* pRet = this; diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 443900e1942c..bbb2f28ad173 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -566,21 +566,25 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const } } - const XubString aTmp( CH_PAR ); - SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 ); - aDrawInf.SetLeft( rRect.Left() ); - aDrawInf.SetRight( rRect.Right() ); - aDrawInf.SetPos( aPos ); - aDrawInf.SetSpace( 0 ); - aDrawInf.SetKanaComp( 0 ); - aDrawInf.SetWrong( NULL ); - aDrawInf.SetGrammarCheck( NULL ); - aDrawInf.SetSmartTags( NULL ); // SMARTTAGS - aDrawInf.SetFrm( this ); - aDrawInf.SetFont( pFnt ); - aDrawInf.SetSnapToGrid( sal_False ); - - pFnt->_DrawText( aDrawInf ); + // Don't show the paragraph mark for collapsed paragraphs, when they are hidden + if ( EmptyHeight( ) > 1 ) + { + const XubString aTmp( CH_PAR ); + SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 ); + aDrawInf.SetLeft( rRect.Left() ); + aDrawInf.SetRight( rRect.Right() ); + aDrawInf.SetPos( aPos ); + aDrawInf.SetSpace( 0 ); + aDrawInf.SetKanaComp( 0 ); + aDrawInf.SetWrong( NULL ); + aDrawInf.SetGrammarCheck( NULL ); + aDrawInf.SetSmartTags( NULL ); // SMARTTAGS + aDrawInf.SetFrm( this ); + aDrawInf.SetFont( pFnt ); + aDrawInf.SetSnapToGrid( sal_False ); + + pFnt->_DrawText( aDrawInf ); + } delete pClip; } delete pFnt; diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 3bc8e566b335..be85b282eb5d 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -58,6 +58,8 @@ #include #include +#include + /************************************************************************* * class SwTmpEndPortion *************************************************************************/ @@ -228,6 +230,20 @@ SwLinePortion *SwArrowPortion::Compress() { return this; } SwTwips SwTxtFrm::EmptyHeight() const { + if (IsCollapse()) { + ViewShell *pSh = GetShell(); + if ( pSh->IsA( TYPE(SwCrsrShell) ) ) { + SwCrsrShell *pCrSh=(SwCrsrShell*)pSh; + SwCntntFrm *pCurrFrm=pCrSh->GetCurrFrm(); + if (pCurrFrm==(SwCntntFrm*)this) { + // do nothing + } else { + return 1; + } + } else { + return 1; + } + } ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::EmptyHeight with swapped frame" ); SwFont *pFnt; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index a8099b970aa9..c8f64fb32701 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1395,6 +1395,7 @@ void SwWW8ImplReader::ImportDop() // <-- rDoc.set(IDocumentSettingAccess::INVERT_BORDER_SPACING, true); + rDoc.set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, true); // // COMPATIBILITY FLAGS END diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index f24d29f2269d..6596e64acd68 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3639,22 +3639,8 @@ bool lcl_PamContainsFly(SwPaM & rPam) void SwWW8ImplReader::TabCellEnd() { if (nInTable && pTableDesc) - { pTableDesc->TableCellEnd(); - if (bReadTable - && pWFlyPara == NULL - && mpTableEndPaM.get() != NULL - && (! SwPaM::Overlap(*pPaM, *mpTableEndPaM)) - && SwPaM::LessThan(*mpTableEndPaM, *pPaM) - && mpTableEndPaM->GetPoint()->nNode.GetNode().IsTxtNode() - && !lcl_PamContainsFly(*mpTableEndPaM) - ) - { - rDoc.DelFullPara(*mpTableEndPaM); - } - } - bFirstPara = true; // We have come to the end of a cell so FirstPara flag bReadTable = false; mpTableEndPaM.reset(); diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 2804a122384a..a58090aaf7ab 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -125,7 +125,8 @@ enum SwDocumentSettingsPropertyHandles HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- HANDLE_MODIFYPASSWORDINFO, - HANDLE_INVERT_BORDER_SPACING + HANDLE_INVERT_BORDER_SPACING, + HANDLE_COLLAPSE_EMPTY_CELL_PARA }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -181,6 +182,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, CPPUTYPE_BOOLEAN, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to * find another solution before adding them to this property set - MTG @@ -695,6 +697,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, bTmp); } break; + case HANDLE_COLLAPSE_EMPTY_CELL_PARA: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, bTmp); + } + break; default: throw UnknownPropertyException(); } @@ -1033,6 +1041,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue.setValue( &bTmp, ::getBooleanCppuType() ); } break; + case HANDLE_COLLAPSE_EMPTY_CELL_PARA: + { + sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA ); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; default: throw UnknownPropertyException(); } -- cgit From f8e1d2438199c4a76ceeb36352678c415e25272c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Sep 2010 14:42:40 +0200 Subject: win32-dont-attempt-restart.diff: Don't attempt to restart OOo after crash n#524250 Don't attempt to restart soffice.bin immediately if it crashes. At such a restart, if the document recovery dialog is cancelled, an empty Writer document is opened even if the user was editing some other kind of document. Some customers are annoyed by this. And the automatic restart doesn't work on Linux anyway, so for consistency it doesn't hurt if we force it not to work on Windows, either. --- desktop/win32/source/officeloader/officeloader.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx index b85a72555935..1733e1f63bd5 100644 --- a/desktop/win32/source/officeloader/officeloader.cxx +++ b/desktop/win32/source/officeloader/officeloader.cxx @@ -417,8 +417,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int ) CloseHandle( aProcessInfo.hProcess ); CloseHandle( aProcessInfo.hThread ); } - } while ( fSuccess - && ( ::desktop::ExitHelper::E_CRASH_WITH_RESTART == dwExitCode || ::desktop::ExitHelper::E_NORMAL_RESTART == dwExitCode )); + } while ( false ); delete[] lpCommandLine; return fSuccess ? dwExitCode : -1; -- cgit From 68ee0b3cef504dfe65fff8c0f9212f7bf99c8cba Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Sep 2010 14:51:52 +0200 Subject: win32-multi-lang-installer.diff: Multi-language installer stuff i#66062, i#88638, i#88639 --- setup_native/prj/build.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst index df7b02484039..4793f6b1e013 100644 --- a/setup_native/prj/build.lst +++ b/setup_native/prj/build.lst @@ -9,6 +9,7 @@ pk setup_native\source\win32\customactions\rebase nmake - w sn_reba pk setup_native\source\win32\customactions\regactivex nmake - w sn_regactivex NULL pk setup_native\source\win32\customactions\regpatchactivex nmake - w sn_regpatchactivex NULL pk setup_native\source\win32\customactions\reg4allmsdoc nmake - w sn_reg4allmsdoc NULL +pk setup_native\source\win32\customactions\sellang nmake - w sn_sellang NULL pk setup_native\source\win32\customactions\reg64 nmake - w sn_reg64 NULL pk setup_native\source\win32\customactions\javafilter nmake - w sn_javafilter NULL pk setup_native\source\win32\customactions\quickstarter nmake - w sn_quickstarter NULL -- cgit From 6b1204329ad365a46214472bcff335e63c51bdf4 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 15:00:33 +0200 Subject: sw-table-join-fix-i99267.diff: n#417814 --- sw/source/core/layout/tabfrm.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index b747c4e7aaff..48f5706b5700 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2074,6 +2074,11 @@ void SwTabFrm::MakeAll() pPre->GetAttrSet()->GetKeep().GetValue()) ) { bCalcLowers = TRUE; + // --> OD 2009-03-06 #i99267# + // reset after forward move to assure that follows + // can be joined, if further space is available. + bSplit = FALSE; + // <-- } } -- cgit From bec52f8e61c7e433c32c7adc181ebb647a51c593 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 15:03:19 +0200 Subject: svtools-svrtf-token-ignore-case.diff: n#417814 --- svtools/source/svrtf/rtfkeywd.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx index 27ce3643f8cf..2b9cb48c0d93 100644 --- a/svtools/source/svrtf/rtfkeywd.cxx +++ b/svtools/source/svrtf/rtfkeywd.cxx @@ -1201,13 +1201,13 @@ _Optlink nRet = ((RTF_TokenEntry*)pFirst)->pUToken->CompareTo( *((RTF_TokenEntry*)pSecond)->pUToken ); else - nRet = ((RTF_TokenEntry*)pFirst)->pUToken->CompareToAscii( + nRet = ((RTF_TokenEntry*)pFirst)->pUToken->CompareIgnoreCaseToAscii( ((RTF_TokenEntry*)pSecond)->sToken ); } else { if( -1 == ((RTF_TokenEntry*)pSecond)->nToken ) - nRet = -1 * ((RTF_TokenEntry*)pSecond)->pUToken->CompareToAscii( + nRet = -1 * ((RTF_TokenEntry*)pSecond)->pUToken->CompareIgnoreCaseToAscii( ((RTF_TokenEntry*)pFirst)->sToken ); else nRet = strcmp( ((RTF_TokenEntry*)pFirst)->sToken, -- cgit From 793905906980e77a9853a8dd01fab95b65ca4f02 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 15:28:33 +0200 Subject: filled-tab-editeng.diff: Filled tab wasn't filled in shapes n#564454 --- .../drawinglayer/primitive2d/textprimitive2d.hxx | 8 ++++- .../source/primitive2d/textprimitive2d.cxx | 12 +++++-- drawinglayer/source/processor2d/vclprocessor2d.cxx | 41 ++++++++++++++++++---- editeng/inc/editeng/editeng.hxx | 8 +++++ editeng/inc/editeng/outliner.hxx | 15 ++++++++ editeng/source/editeng/editeng.cxx | 8 +++++ editeng/source/editeng/impedit3.cxx | 19 ++++++++++ editeng/source/outliner/outleeng.cxx | 9 +++++ editeng/source/outliner/outleeng.hxx | 8 +++++ editeng/source/outliner/outliner.cxx | 15 +++++++- svx/source/svdraw/svdotextdecomposition.cxx | 4 ++- 11 files changed, 134 insertions(+), 13 deletions(-) diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx index 6c67bded2b17..94c7ee2c192b 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx @@ -129,6 +129,8 @@ namespace drawinglayer /// #i96669# internal: add simple range buffering for this primitive basegfx::B2DRange maB2DRange; + bool mbFilled; // Whether to fill a given width with the text + long mnWidthToFill; // the width to fill protected: /// local decomposition. @@ -144,7 +146,9 @@ namespace drawinglayer const ::std::vector< double >& rDXArray, const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale, - const basegfx::BColor& rFontColor); + const basegfx::BColor& rFontColor, + bool bFilled = false, + long nWidthToFill = 0); /// helpers /** get text outlines as polygons and their according ObjectTransformation. Handles all @@ -161,6 +165,8 @@ namespace drawinglayer const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; } const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; } const basegfx::BColor& getFontColor() const { return maFontColor; } + bool isFilled() const { return mbFilled; } + long getWidthToFill() const { return mnWidthToFill; } /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index f5566246ef91..5e85d5dc3654 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -237,7 +237,9 @@ namespace drawinglayer const ::std::vector< double >& rDXArray, const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale, - const basegfx::BColor& rFontColor) + const basegfx::BColor& rFontColor, + bool bFilled, + long nWidthToFill) : BufferedDecompositionPrimitive2D(), maTextTransform(rNewTransform), maText(rText), @@ -247,7 +249,9 @@ namespace drawinglayer maFontAttribute(rFontAttribute), maLocale(rLocale), maFontColor(rFontColor), - maB2DRange() + maB2DRange(), + mbFilled(bFilled), + mnWidthToFill(nWidthToFill) { #ifdef DBG_UTIL const xub_StrLen aStringLength(getText().Len()); @@ -276,7 +280,9 @@ namespace drawinglayer && getDXArray() == rCompare.getDXArray() && getFontAttribute() == rCompare.getFontAttribute() && LocalesAreEqual(getLocale(), rCompare.getLocale()) - && getFontColor() == rCompare.getFontColor()); + && getFontColor() == rCompare.getFontColor() + && mbFilled == rCompare.mbFilled + && mnWidthToFill == rCompare.mnWidthToFill); } return false; diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index e49e54fb751c..ca53ae07e916 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -250,22 +250,49 @@ namespace drawinglayer mpOutputDevice->SetFont(aFont); mpOutputDevice->SetTextColor(Color(aRGBFontColor)); + String aText( rTextCandidate.getText() ); + xub_StrLen nPos = rTextCandidate.getTextPosition(); + xub_StrLen nLen = rTextCandidate.getTextLength(); + + sal_Int32* pDXArray = aTransformedDXArray.size() ? &(aTransformedDXArray[0]) : NULL ; + + if ( rTextCandidate.isFilled() ) + { + basegfx::B2DVector aOldFontScaling, aOldTranslate; + double fOldRotate, fOldShearX; + rTextCandidate.getTextTransform().decompose(aOldFontScaling, aOldTranslate, fOldRotate, fOldShearX); + + long nWidthToFill = rTextCandidate.getWidthToFill( ) * aFontScaling.getX() / aOldFontScaling.getX(); + + long nWidth = mpOutputDevice->GetTextArray( + rTextCandidate.getText(), pDXArray, 0, 1 ); + long nChars = 2; + if ( nWidth ) + nChars = nWidthToFill / nWidth; + + String aFilled; + aFilled.Fill( (USHORT)nChars, aText.GetChar( 0 ) ); + aText = aFilled; + nPos = 0; + nLen = nChars; + } + if(aTransformedDXArray.size()) { mpOutputDevice->DrawTextArray( aStartPoint, - rTextCandidate.getText(), - &(aTransformedDXArray[0]), - rTextCandidate.getTextPosition(), - rTextCandidate.getTextLength()); + aText, + pDXArray, + nPos, + nLen); } else { mpOutputDevice->DrawText( aStartPoint, - rTextCandidate.getText(), - rTextCandidate.getTextPosition(), - rTextCandidate.getTextLength()); + aText, + nPos, + nLen); } if(rTextCandidate.getFontAttribute().getRTL()) diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx index 84f4802e7b44..563da3cb74be 100755 --- a/editeng/inc/editeng/editeng.hxx +++ b/editeng/inc/editeng/editeng.hxx @@ -443,6 +443,14 @@ public: const Color& rOverlineColor, const Color& rTextLineColor); + virtual void DrawingTab( + const Point& rStartPos, long nWidth, const String& rChar, + const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, + bool bEndOfLine, + bool bEndOfParagraph, + const Color& rOverlineColor, + const Color& rTextLineColor); + virtual String GetUndoComment( USHORT nUndoId ) const; virtual BOOL FormattingParagraph( USHORT nPara ); virtual BOOL SpellNextDocument(); diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx index d167d2a30f8f..1825c74e302c 100644 --- a/editeng/inc/editeng/outliner.hxx +++ b/editeng/inc/editeng/outliner.hxx @@ -422,6 +422,9 @@ public: // #101498# BiDi level needs to be transported, too. BYTE mnBiDiLevel; + bool mbFilled; + long mnWidthToFill; + // bitfield unsigned mbEndOfLine : 1; unsigned mbEndOfParagraph : 1; @@ -445,6 +448,8 @@ public: const Color& rOverlineColor, const Color& rTextLineColor, BYTE nBiDiLevel, + bool bFilled, + long nWidthToFill, bool bEndOfLine, bool bEndOfParagraph, bool bEndOfBullet) @@ -462,6 +467,8 @@ public: maOverlineColor(rOverlineColor), maTextLineColor(rTextLineColor), mnBiDiLevel(nBiDiLevel), + mbFilled( bFilled ), + mnWidthToFill( nWidthToFill ), mbEndOfLine(bEndOfLine), mbEndOfParagraph(bEndOfParagraph), mbEndOfBullet(bEndOfBullet) @@ -895,6 +902,14 @@ public: const Color& rOverlineColor, const Color& rTextLineColor); + virtual void DrawingTab( + const Point& rStartPos, long nWidth, const String& rChar, + const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, + bool bEndOfLine, + bool bEndOfParagraph, + const Color& rOverlineColor, + const Color& rTextLineColor); + Size CalcTextSize(); Point GetDocPos( Paragraph* pPara ); diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 1b61a405dc18..8e4b2a4645a6 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2480,6 +2480,14 @@ void __EXPORT EditEngine::DrawingText( const Point&, const XubString&, USHORT, U DBG_CHKTHIS( EditEngine, 0 ); } +void __EXPORT EditEngine::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar, + const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, + bool bEndOfLine, bool bEndOfParagraph, + const Color& rOverlineColor, const Color& rTextLineColor) +{ + DBG_CHKTHIS( EditEngine, 0 ); +} + void __EXPORT EditEngine::PaintingFirstLine( sal_uInt16, const Point&, long, const Point&, short, OutputDevice* ) { DBG_CHKTHIS( EditEngine, 0 ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 08f50a0da884..524d69592298 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3517,7 +3517,26 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta String aText; aText.Fill( (USHORT)nChars, pTextPortion->GetExtraValue() ); + aTmpFont.QuickDrawText( pOutDev, aTmpPos, aText, 0, aText.Len(), NULL ); pOutDev->DrawStretchText( aTmpPos, pTextPortion->GetSize().Width(), aText ); + + if ( bStripOnly ) + { + // create EOL and EOP bools + const bool bEndOfLine(y == pLine->GetEndPortion()); + const bool bEndOfParagraph(bEndOfLine && nLine + 1 == nLines); + + const Color aOverlineColor(pOutDev->GetOverlineColor()); + const Color aTextLineColor(pOutDev->GetTextLineColor()); + + // StripPortions() data callback + GetEditEnginePtr()->DrawingTab( aTmpPos, + pTextPortion->GetSize().Width(), + pTextPortion->GetExtraValue(), + aTmpFont, n, nIndex, pTextPortion->GetRightToLeft(), + bEndOfLine, bEndOfParagraph, + aOverlineColor, aTextLineColor); + } } } break; diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index de0a555f004c..8e1f1e689961 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -204,6 +204,15 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rTex pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, bEndOfBullet, pLocale, rOverlineColor, rTextLineColor); } +void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar, + const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, + bool bEndOfLine, bool bEndOfParagraph, + const Color& rOverlineColor, const Color& rTextLineColor) +{ + pOwner->DrawingTab(rStartPos, nWidth, rChar, rFont, nPara, nIndex, nRightToLeft, + bEndOfLine, bEndOfParagraph, rOverlineColor, rTextLineColor ); +} + void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ) { EditEngine::FieldClicked( rField, nPara, nPos ); // Falls URL diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx index fadbd8779eea..70398c39620f 100644 --- a/editeng/source/outliner/outleeng.hxx +++ b/editeng/source/outliner/outleeng.hxx @@ -68,6 +68,14 @@ public: const Color& rOverlineColor, const Color& rTextLineColor); + virtual void DrawingTab( + const Point& rStartPos, long nWidth, const String& rChar, + const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, + bool bEndOfLine, + bool bEndOfParagraph, + const Color& rOverlineColor, + const Color& rTextLineColor); + virtual void StyleSheetChanged( SfxStyleSheet* pStyle ); virtual void ParaAttribsChanged( USHORT nPara ); virtual BOOL SpellNextDocument(); diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 328a762fec54..9e9b5dcc0e70 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1790,7 +1790,20 @@ void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, USHO { // #101498# DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, nPara, nIndex, pDXArray, pWrongSpellVector, - pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, bEndOfLine, bEndOfParagraph, bEndOfBullet); + pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, false, 0, bEndOfLine, bEndOfParagraph, bEndOfBullet); + + aDrawPortionHdl.Call( &aInfo ); + } +} + +void Outliner::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar, const SvxFont& rFont, + USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, bool bEndOfLine, bool bEndOfParagraph, + const Color& rOverlineColor, const Color& rTextLineColor) +{ + if(aDrawPortionHdl.IsSet()) + { + DrawPortionInfo aInfo( rStartPos, rChar, 0, rChar.Len(), rFont, nPara, nIndex, NULL, NULL, + NULL, NULL, rOverlineColor, rTextLineColor, nRightToLeft, true, nWidth, bEndOfLine, bEndOfParagraph, false); aDrawPortionHdl.Call( &aInfo ); } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 3675c7becac4..d67b18c0805b 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -370,7 +370,9 @@ namespace aDXArray, aFontAttribute, rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(), - aBFontColor); + aBFontColor, + rInfo.mbFilled, + rInfo.mnWidthToFill); } if(rInfo.mbEndOfBullet) -- cgit From 8e9c5a4285b3ab0213513f554a8f6c5656d9d8ba Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 15:33:58 +0200 Subject: metric-field-limits.diff: maximum values were wrong when changing unit --- cui/source/tabpages/numpages.cxx | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 9bf88e151770..69fc047eff9e 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -3087,29 +3087,6 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(Window* pParent, pPreviewWIN->SetPositionMode(); eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE)); - //HACK("der Wert sollte mal sinnvol gesetzt werden") - long nWidth = 10000; - nWidth = OutputDevice::LogicToLogic( nWidth, - (MapUnit)eCoreUnit, MAP_100TH_MM ); - - aDistBorderMF.SetMax(aDistBorderMF.Normalize( nWidth ), FUNIT_100TH_MM ); - aDistNumMF .SetMax(aDistNumMF .Normalize( nWidth ), FUNIT_100TH_MM ); - aIndentMF .SetMax(aIndentMF .Normalize( nWidth ), FUNIT_100TH_MM ); - // --> OD 2008-02-18 #newlistlevelattrs# - aListtabMF.SetMax(aListtabMF.Normalize( nWidth ), FUNIT_100TH_MM ); - aAlignedAtMF.SetMax(aAlignedAtMF.Normalize( nWidth ), FUNIT_100TH_MM ); - aIndentAtMF.SetMax(aIndentAtMF.Normalize( nWidth ), FUNIT_100TH_MM ); - // <-- - long nLast2 = nWidth /2; - aDistBorderMF.SetLast( aDistBorderMF.Normalize( nLast2 ), FUNIT_100TH_MM ); - aDistNumMF .SetLast( aDistNumMF .Normalize( nLast2 ), FUNIT_100TH_MM ); - aIndentMF .SetLast( aIndentMF .Normalize( nLast2 ), FUNIT_100TH_MM ); - // --> OD 2008-02-18 #newlistlevelattrs# - aListtabMF.SetLast(aListtabMF.Normalize( nLast2 ), FUNIT_100TH_MM ); - aAlignedAtMF.SetLast(aAlignedAtMF.Normalize( nLast2 ), FUNIT_100TH_MM ); - aIndentAtMF.SetLast(aIndentAtMF.Normalize( nLast2 ), FUNIT_100TH_MM ); - // <-- - #if OSL_DEBUG_LEVEL > 1 pDebugFixedText = new FixedText(this, 0); pDebugFixedText->Show(); -- cgit From ccec86c5d06e793133283381794a6b00a8b77f23 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 15:33:59 +0200 Subject: metric-field-limits.diff: maximum values were wrong when changing unit --- vcl/inc/vcl/field.hxx | 4 +++- vcl/source/control/field.cxx | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index e1f39cc78966..ccd164c56d0f 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -255,7 +255,7 @@ public: virtual void CustomConvert() = 0; virtual void Reformat(); - void SetUnit( FieldUnit meUnit ); + virtual void SetUnit( FieldUnit meUnit ); FieldUnit GetUnit() const { return meUnit; } void SetCustomUnitText( const XubString& rStr ); const XubString& GetCustomUnitText() const { return maCustomUnitText; } @@ -569,6 +569,8 @@ public: virtual void Last(); virtual void CustomConvert(); + virtual void SetUnit( FieldUnit meUnit ); + void SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit ); inline void SetFirst(sal_Int64 first) { SetFirst(first, FUNIT_NONE); } sal_Int64 GetFirst( FieldUnit eOutUnit ) const; diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index db8d210e2f67..ebdf090fb0ab 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1747,6 +1747,21 @@ MetricField::~MetricField() { } +void MetricField::SetUnit( FieldUnit nNewUnit ) +{ + sal_Int64 nMax = Denormalize( GetMax( nNewUnit ) ); + sal_Int64 nMin = Denormalize( GetMin( nNewUnit ) ); + sal_Int64 nFirst = Denormalize( GetFirst( nNewUnit ) ); + sal_Int64 nLast = Denormalize( GetLast( nNewUnit ) ); + + MetricFormatter::SetUnit( nNewUnit ); + + SetMax( Normalize( nMax ), nNewUnit ); + SetMin( Normalize( nMin ), nNewUnit ); + SetFirst( Normalize( nFirst ), nNewUnit ); + SetLast( Normalize( nLast ), nNewUnit ); +} + // ----------------------------------------------------------------------- void MetricField::SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit ) -- cgit From 0ec05d5b9d05cb36523dbed657fe38c73baab7b4 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 15:56:15 +0200 Subject: fields-enable.diff: Activate fields changes --- unotools/source/config/fltrcfg.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx index 94f7ff07d7d7..a93cc2d65687 100644 --- a/unotools/source/config/fltrcfg.cxx +++ b/unotools/source/config/fltrcfg.cxx @@ -530,8 +530,7 @@ void SvtFilterOptions::SetWriter2WinWord( BOOL bFlag ) BOOL SvtFilterOptions::IsUseEnhancedFields() const { - return false; // disable for now; -// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS ); + return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS ); } void SvtFilterOptions::SetUseEnhancedFields( BOOL bFlag ) -- cgit From 693b095ee8b7406c4aa0fd5b2bd0221bdcab304f Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 15:58:16 +0200 Subject: field-patch-uno-fix.diff: enhanced fields UNO fix --- sw/source/core/unocore/unocoll.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 0b8f938d307d..37001380df70 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1504,7 +1504,7 @@ sal_Int32 SwXBookmarks::getCount(void) vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw uno::RuntimeException(); - return GetDoc()->getIDocumentMarkAccess()->getBookmarksCount(); + return GetDoc()->getIDocumentMarkAccess()->getMarksCount(); } uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex) @@ -1514,11 +1514,11 @@ uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex) if(!IsValid()) throw uno::RuntimeException(); IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess(); - if(nIndex < 0 || nIndex >= pMarkAccess->getBookmarksCount()) + if(nIndex < 0 || nIndex >= pMarkAccess->getMarksCount()) throw IndexOutOfBoundsException(); uno::Any aRet; - ::sw::mark::IMark* pBkmk = pMarkAccess->getBookmarksBegin()[nIndex].get(); + ::sw::mark::IMark* pBkmk = pMarkAccess->getMarksBegin()[nIndex].get(); const uno::Reference< text::XTextContent > xRef = SwXBookmark::CreateXBookmark(*GetDoc(), *pBkmk); aRet <<= xRef; @@ -1533,8 +1533,8 @@ uno::Any SwXBookmarks::getByName(const rtl::OUString& rName) throw uno::RuntimeException(); IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess(); - IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findBookmark(rName); - if(ppBkmk == pMarkAccess->getBookmarksEnd()) + IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark(rName); + if(ppBkmk == pMarkAccess->getMarksEnd()) throw NoSuchElementException(); uno::Any aRet; @@ -1552,10 +1552,10 @@ uno::Sequence< OUString > SwXBookmarks::getElementNames(void) throw uno::RuntimeException(); IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess(); - uno::Sequence aSeq(pMarkAccess->getBookmarksCount()); + uno::Sequence aSeq(pMarkAccess->getMarksCount()); sal_Int32 nCnt = 0; - for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin(); - ppMark != pMarkAccess->getBookmarksEnd();) + for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); + ppMark != pMarkAccess->getMarksEnd();) aSeq[nCnt++] = (*ppMark++)->GetName(); return aSeq; } @@ -1568,7 +1568,7 @@ sal_Bool SwXBookmarks::hasByName(const OUString& rName) throw uno::RuntimeException(); IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess(); - return pMarkAccess->findBookmark(rName) != pMarkAccess->getBookmarksEnd(); + return pMarkAccess->findMark(rName) != pMarkAccess->getMarksEnd(); } uno::Type SAL_CALL SwXBookmarks::getElementType() -- cgit From 6bbe6e56c966c7896793dbd26d7b05a13d228403 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 16:00:07 +0200 Subject: field-patch-lock.diff: enhanced fields lock fix --- sw/source/core/crsr/pam.cxx | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index ec30b5aefbe0..b2a4abc2a6c9 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -825,21 +825,27 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const } //FIXME FieldBk // TODO: Form Protection when Enhanced Fields are enabled - if (!bRet) { - const SwDoc *pDoc = GetDoc(); - sw::mark::IMark* pA = NULL; - sw::mark::IMark* pB = NULL; - if ( pDoc ) - { - const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( ); - pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL; - pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA; - bRet = ( pA != pB ); - } + const SwDoc *pDoc = GetDoc(); + sw::mark::IMark* pA = NULL; + sw::mark::IMark* pB = NULL; + if ( pDoc ) + { + const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( ); + pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL; + pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA; + } + + if (!bRet) + { + bRet = ( pA != pB ); bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM ); if ( bProtectForm ) bRet |= ( pA == NULL || pB == NULL ); } + else + { + bRet = !( pA == pB && pA != NULL ); + } return bRet; } -- cgit From 95684c99842455d9dc8e9372b829a63c22f71535 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 16:12:59 +0200 Subject: sw-import-html-controls.diff: n#485609 --- sw/source/filter/ww8/ww8par.hxx | 2 ++ sw/source/filter/ww8/ww8par3.cxx | 8 ++++++++ sw/source/filter/ww8/ww8par5.cxx | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index c87035f208a1..beb29b02adfa 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1581,6 +1581,8 @@ public: // eigentlich private, geht aber leider nur public eF_ResT Read_F_OCX(WW8FieldDesc*, String&); eF_ResT Read_F_Hyperlink(WW8FieldDesc*, String& rStr); eF_ResT Read_F_Shape(WW8FieldDesc* pF, String& rStr); + eF_ResT Read_F_HTMLControl( WW8FieldDesc* pF, String& rStr); + void DeleteFormImpl(); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 75454dddbc58..00768d0ef470 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -321,6 +321,14 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, String& rStr) } } +eF_ResT SwWW8ImplReader::Read_F_HTMLControl( WW8FieldDesc* pF, String& rStr) +{ + if( bObj && nPicLocFc ) + nObjLocFc = nPicLocFc; + bEmbeddObj = true; + return FLD_TEXT; +} + void SwWW8ImplReader::DeleteFormImpl() { delete pFormImpl, pFormImpl = 0; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 93a39b1c390c..3cbddde5d52b 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -908,7 +908,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) &SwWW8ImplReader::Read_F_Hyperlink, // 88 0, // 89 0, // 90 - 0, // 91 + &SwWW8ImplReader::Read_F_HTMLControl, // 91 0, // 92 0, // 93 0, // 94 -- cgit From db387863014f00120a1b934f485ce53f70990fc0 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 16:12:59 +0200 Subject: sw-import-html-controls.diff: n#485609 --- filter/inc/filter/msfilter/msocximex.hxx | 34 +++++++++++ filter/source/msfilter/msocximex.cxx | 100 ++++++++++++++++++++++++++++++- 2 files changed, 133 insertions(+), 1 deletion(-) diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx index 173835495b12..a106b40d2852 100644 --- a/filter/inc/filter/msfilter/msocximex.hxx +++ b/filter/inc/filter/msfilter/msocximex.hxx @@ -1417,4 +1417,38 @@ public: const com::sun::star::awt::Size& rSize ); }; + +class HTML_TextBox : public OCX_ModernControl +{ +public: + HTML_TextBox() : OCX_ModernControl(rtl::OUString::createFromAscii("TextBox")) { + msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.TextField"); + msDialogType = rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlEditModel"); + mnBackColor = 0x80000005L; + mnForeColor = 0x80000008L; + nBorderColor = 0x80000006L; + aFontData.SetHasAlign(TRUE); + } + + using OCX_ModernControl::Import; // to not hide the other two import methods + virtual sal_Bool Import(com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet); + /* + sal_Bool Export(SotStorageRef &rObj, + const com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet, + const com::sun::star::awt::Size& rSize); + sal_Bool WriteContents(SotStorageStreamRef &rObj, + const com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet, + const com::sun::star::awt::Size& rSize); + */ + static OCX_Control *Create() { return new HTML_TextBox;} + + virtual sal_Bool Read(SotStorageStream *pS); + virtual sal_Bool ReadFontData(SotStorageStream *pS); +}; + + + #endif diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index 82663cdf2523..7cf51946fc03 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -4444,7 +4444,8 @@ OCX_map aOCXTab[] = {&OCX_GroupBox::Create,"", form::FormComponentType::GROUPBOX,""}, {&OCX_ProgressBar::Create,"", - form::FormComponentType::CONTROL,""} + form::FormComponentType::CONTROL,""}, + {&HTML_TextBox::Create,"5512D124-5CC6-11CF-8d67-00aa00bdce1d", form::FormComponentType::TEXTFIELD,"TextBox"}, }; const int NO_OCX = sizeof( aOCXTab ) / sizeof( *aOCXTab ); @@ -5142,6 +5143,103 @@ sal_Bool OCX_FontData::Export(SvStorageStreamRef &rContent, return sal_True; } + +sal_Bool HTML_TextBox::Import(com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet> &rPropSet) +{ + uno::Any aTmp(&sName,getCppuType((OUString *)0)); + rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp ); + + aTmp = bool2any( fEnabled != 0 ); + rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp); + + aTmp = bool2any( fLocked != 0 ); + rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp); + + aTmp = bool2any( fHideSelection != 0 ); + rPropSet->setPropertyValue( WW8_ASCII2STR( "HideInactiveSelection" ), aTmp); + + aTmp <<= ImportColor(mnForeColor); + rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp); + + aTmp <<= ImportColor(mnBackColor); + rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp); + + aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle); + rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp); + + aTmp <<= ImportColor( nBorderColor ); + rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp); + + aTmp = bool2any( fMultiLine != 0 ); + rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp); + + sal_uInt16 nTmp = static_cast(nMaxLength); + aTmp <<= nTmp; + rPropSet->setPropertyValue( WW8_ASCII2STR("MaxTextLen"), aTmp); + + + sal_Bool bTemp1,bTemp2; + uno::Any aBarsH,aBarsV; + switch(nScrollBars) + { + case 1: + bTemp1 = sal_True; + bTemp2 = sal_False; + break; + case 2: + bTemp1 = sal_False; + bTemp2 = sal_True; + break; + case 3: + bTemp1 = sal_True; + bTemp2 = sal_True; + break; + case 0: + default: + bTemp1 = sal_False; + bTemp2 = sal_False; + break; + } + + aBarsH = bool2any(bTemp1); + aBarsV = bool2any(bTemp2); + rPropSet->setPropertyValue( WW8_ASCII2STR("HScroll"), aBarsH); + rPropSet->setPropertyValue( WW8_ASCII2STR("VScroll"), aBarsV); + + nTmp = nPasswordChar; + aTmp <<= nTmp; + rPropSet->setPropertyValue( WW8_ASCII2STR("EchoChar"), aTmp); + + if (pValue) + { + aTmp <<= lclCreateOUString( pValue, nValueLen ); + // DefaultText seems to no longer be in UnoEditControlModel + if ( bSetInDialog ) + { + rPropSet->setPropertyValue( WW8_ASCII2STR("Text"), aTmp); + } + else + { + rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultText"), aTmp); + } + } + + // aFontData.Import(rPropSet); + return sal_True; +} + +sal_Bool HTML_TextBox::Read(SotStorageStream *pS) +{ + return sal_True; +} + +sal_Bool HTML_TextBox::ReadFontData(SotStorageStream *pS) +{ + return sal_True; +} + + // Doesn't really read anything but just skips the // record. sal_Bool OCX_TabStrip::Read(SotStorageStream *pS) -- cgit From 9a11bd42af0db32fd06c84dd955ee563134665ce Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Tue, 14 Sep 2010 16:20:45 +0200 Subject: sw-outline-numbering-broken-fix.diff: outline numbering fix in master docs i#96092, n#445536 --- sw/source/core/docnode/ndcopy.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 9c2ce7af3139..bb70e5c58f00 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -258,7 +258,7 @@ SwCntntNode* SwTxtNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const // kopiere Attribute/Text if( !pCpyAttrNd->HasSwAttrSet() ) // wurde ein AttrSet fuer die Numerierung angelegt, so loesche diesen! - pTxtNd->ResetAllAttr(); + pCpyAttrNd->ResetAllAttr(); // if Copy-Textnode unequal to Copy-Attrnode, then copy first // the attributes into the new Node. -- cgit From e2970420a1f5aad0c0a412ddbe47eed88c6ea405 Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Tue, 14 Sep 2010 16:23:16 +0200 Subject: sw-insert-pagebreak-in-numbered-paragraph.diff n#396648 --- sw/inc/doc.hxx | 1 + sw/source/core/docnode/ndtbl.cxx | 43 ++++++++++++++++++++++++++++++++++++++++ sw/source/ui/wrtsh/wrtsh1.cxx | 2 ++ 3 files changed, 46 insertions(+) diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index d8d4199d9092..bd4ed2836a2b 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1751,6 +1751,7 @@ public: void ChkBoxNumFmt( SwTableBox& rAktBox, sal_Bool bCallUpdate ); void SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet ); void ClearBoxNumAttrs( const SwNodeIndex& rNode ); + void ClearLineNumAttrs( SwPosition & rPos ); sal_Bool InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, const SwTable* pCpyTbl = 0, sal_Bool bCpyName = sal_False, diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index b213eb1d075d..450d0df35ac4 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -39,6 +39,7 @@ #include #include #include +#include // OD 06.08.2003 #i17174# #include #include @@ -4267,6 +4268,48 @@ void SwDoc::SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet ) SetModified(); } +void SwDoc::ClearLineNumAttrs( SwPosition & rPos ) +{ + SwPaM aPam(rPos); + aPam.Move(fnMoveBackward); + SwCntntNode *pNode = aPam.GetCntntNode(); + if ( 0 == pNode ) + return ; + if( pNode->IsTxtNode() ) + { + SwTxtNode * pTxtNode = pNode->GetTxtNode(); + if ( pTxtNode && pTxtNode->IsNumbered() && pTxtNode->GetTxt().Len()==0 ) + { + const SfxPoolItem* pFmtItem = 0; + SfxItemSet rSet( const_cast(pTxtNode->GetDoc()->GetAttrPool()), + RES_PARATR_BEGIN, RES_PARATR_END - 1, + 0); + pTxtNode->SwCntntNode::GetAttr( rSet ); + if ( SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE , FALSE , &pFmtItem ) ) + { + SwUndoDelNum * pUndo; + if( DoesUndo() ) + { + ClearRedo(); + AppendUndo( pUndo = new SwUndoDelNum( aPam ) ); + } + else + pUndo = 0; + SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : 0 ); + aRegH.RegisterInModify( pTxtNode , *pTxtNode ); + if ( pUndo ) + pUndo->AddNode( *pTxtNode , FALSE ); + String aStyle = String::CreateFromAscii(""); + SfxStringItem * pNewItem = (SfxStringItem*)pFmtItem->Clone(); + pNewItem->SetValue( aStyle ); + rSet.Put( *pNewItem ); + pTxtNode->SetAttr( rSet ); + delete pNewItem; + } + } + } +} + void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode ) { SwStartNode* pSttNd; diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 04f87e877aa5..6c9235104a7a 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -928,6 +928,8 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, USHORT nPgNum ) if(HasSelection()) DelRight(); SwFEShell::SplitNode(); + // delete the numbered attribute of the last line if the last line is empty + GetDoc()->ClearLineNumAttrs( *GetCrsr()->GetPoint() ); } const SwPageDesc *pDesc = pPageDesc -- cgit From 10b2731f1055326d9ec7b1081f14808ae9e2b908 Mon Sep 17 00:00:00 2001 From: Fong Lin Date: Tue, 14 Sep 2010 16:35:20 +0200 Subject: sw-ww8-textframe-background-fix.diff n#547308 --- sw/source/filter/ww8/ww8graf.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index ccfdf086c21c..992c0521fac9 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1901,6 +1901,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, } break; case XFILL_SOLID: + case XFILL_GRADIENT: { const Color aColor = static_cast< XFillColorItem const & >( rOldSet.Get(XATTR_FILLCOLOR)).GetColorValue(); @@ -1912,8 +1913,8 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, bBrushItemOk = true; } break; - case XFILL_GRADIENT: - break; + //case XFILL_GRADIENT: + //break; case XFILL_HATCH: break; case XFILL_BITMAP: -- cgit From 6eb19e82e01e395dc7013553ee561fd81668ac3b Mon Sep 17 00:00:00 2001 From: Fong Lin Date: Tue, 14 Sep 2010 16:39:57 +0200 Subject: sw-ww8-import-list-fix.diff:fix bullet indent issue n#547308 --- sw/source/filter/ww8/ww8par6.cxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 731f3da36015..47909addc253 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -3968,6 +3968,29 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen ) if( pLR ) aLR = *(const SvxLRSpaceItem*)pLR; + // Fix the regression issue: #i99822#: Discussion? + // Since the list lever formatting doesn't apply into paragraph style + // for list levels of mode LABEL_ALIGNMENT.(see ww8par3.cxx + // W8ImplReader::RegisterNumFmtOnTxtNode). + // Need to apply the list format to the paragraph here. + SwTxtNode* pTxtNode = pPaM->GetNode()->GetTxtNode(); + if( pTxtNode && pTxtNode->AreListLevelIndentsApplicable() ) + { + SwNumRule * pNumRule = pTxtNode->GetNumRule(); + if( pNumRule ) + { + BYTE nLvl = static_cast< BYTE >(pTxtNode->GetActualListLevel()); + const SwNumFmt* pFmt = pNumRule->GetNumFmt( nLvl ); + if ( pFmt && pFmt->GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) + { + aLR.SetTxtLeft( pFmt->GetIndentAt() ); + aLR.SetTxtFirstLineOfst( static_cast(pFmt->GetFirstLineIndent()) ); + // make paragraph have hard-set indent attributes + pTxtNode->SetAttr( aLR ); + } + } + } + /* The older word sprms mean left/right, while the new ones mean before/after. Writer now also works with before after, so when we see old left/right and -- cgit From 8fdc083c3cedabdf145ef4a09b3d3ce98e207c93 Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Tue, 14 Sep 2010 16:41:16 +0200 Subject: extensions_packinfo.diff: extension integration, setup_native part. --- .../source/packinfo/packinfo_extensions.txt | 258 +++++++++++++++++++++ 1 file changed, 258 insertions(+) create mode 100644 setup_native/source/packinfo/packinfo_extensions.txt diff --git a/setup_native/source/packinfo/packinfo_extensions.txt b/setup_native/source/packinfo/packinfo_extensions.txt new file mode 100644 index 000000000000..b3f020852305 --- /dev/null +++ b/setup_native/source/packinfo/packinfo_extensions.txt @@ -0,0 +1,258 @@ +# Format: + +# Start +# scpModule +# shellscript file (optional) +# solarispackagename +# solarisrequires (optional) +# solarisprovides (optional) +# packagename +# linuxreplaces (optional) +# requires (optional) +# provides (optional) +# copyright +# vendor +# description +# destpath +# End + +Start +module = "gid_Module_Optional_Extensions_MINIMIZER" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-presentation-minimizer" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-presentation-minimizer" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "1999-2008 by OpenOffice.org" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Presentation Minimizer extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_REPORTDESIGN" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-report-builder" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-report-builder" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "1999-2008 by OpenOffice.org" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Report Builder extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_MEDIAWIKI" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-mediawiki-publisher" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-mediawiki-publisher" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "1999-2008 by OpenOffice.org" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "MediaWiki publisher extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_PRESENTER_SCREEN" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-presenter-screen" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-presenter-screen" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "1999-2008 by OpenOffice.org" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Presenter Screen extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_PDFIMPORT" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-pdf-import" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-pdf-import" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "1999-2008 by OpenOffice.org" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "PDF import extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_LightProof" +script = "shellscripts_extensions.txt" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-lightproof" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-lightproof" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2009 by FSF.hu" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Lightproof extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_NumberText" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-numbertext" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-numbertext" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2009 by FSF.hu" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Numbertext extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_HunArt" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-hunart" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-hunart" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2009 by FSF.hu" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Hungarian Cross-reference Toolbar extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_Typo" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-typo" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-typo" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2010 by FSF.hu" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Typography Toolbar extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_CT2N" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-ct2n" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-ct2n" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "Copyright (c) 2008 Cor Nouws" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "ConvertTextToNumber extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_Watch_Window" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-watch-window" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-watch-window" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2009 by Tibor Hornyák" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Watch Window extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_Google_Docs" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-google-docs" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-google-docs" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2009 by Przemyslaw Rumik" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Google Docs extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_NLPSolver" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-nlpsolver" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-nlpsolver" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2009 by Sun Microsystems, Inc." +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "NLPSolver extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_LanguageTool" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-languagetool" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-languagetool" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2005-2009 by Daniel Naber" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "LanguageTool extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_MySQLConnector" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-mysql-connector" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-mysql-connector" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2008 by Sun Mcrosystems, Inc." +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "MySQL Connector extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_OOoBlogger" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-oooblogger" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-oooblogger" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "2005 by Caolan McNamara" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "oooblogger extension for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End -- cgit From c97e202d82f423eff31bfa7a01c6f608de2bdc93 Mon Sep 17 00:00:00 2001 From: Fong Lin Date: Tue, 14 Sep 2010 16:42:39 +0200 Subject: sw-changes-format-fix.diff: show insertion change first n#545815 --- sw/source/core/doc/docredln.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 9997eabd79c3..d989c39ffecf 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1574,6 +1574,27 @@ const SwRedline* SwDoc::GetRedline( const SwPosition& rPos, --nM; pRedl = (*pRedlineTbl)[ nM ]; } + // if there are format and insert changes in the same position + // show insert change first. + // since the redlines are sorted by position, only check the redline + // before and after the current redline + if( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() ) + { + if( nM && rPos >= *(*pRedlineTbl)[ nM - 1 ]->Start() && + rPos <= *(*pRedlineTbl)[ nM - 1 ]->End() && + ( nsRedlineType_t::REDLINE_INSERT == (*pRedlineTbl)[ nM - 1 ]->GetType() ) ) + { + --nM; + pRedl = (*pRedlineTbl)[ nM ]; + } + else if( ( nM + 1 ) <= nO && rPos >= *(*pRedlineTbl)[ nM + 1 ]->Start() && + rPos <= *(*pRedlineTbl)[ nM + 1 ]->End() && + ( nsRedlineType_t::REDLINE_INSERT == (*pRedlineTbl)[ nM + 1 ]->GetType() ) ) + { + ++nM; + pRedl = (*pRedlineTbl)[ nM ]; + } + } if( pFndPos ) *pFndPos = nM; -- cgit From 681fb611831d25b1e3a54b9205f77c04de5625f7 Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Tue, 14 Sep 2010 16:44:59 +0200 Subject: premium-splitted-language-packages.diff: Language dependent definitions. --- .../source/packinfo/packinfo_office_lang.txt | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/setup_native/source/packinfo/packinfo_office_lang.txt b/setup_native/source/packinfo/packinfo_office_lang.txt index 8f3f6dddefbd..3ac23d947295 100755 --- a/setup_native/source/packinfo/packinfo_office_lang.txt +++ b/setup_native/source/packinfo/packinfo_office_lang.txt @@ -207,3 +207,107 @@ destpath = "/opt" packageversion = "%OOOPACKAGEVERSION" pkg_list_entry = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-onlineupdate" End + +Start +module = "gid_Module_Optional_Extensions_Sun_T_Pack" +script = "shellscripts_extensions.txt" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-sun-templates-pack-%LANGUAGESTRING" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-sun-templates-pack-%LANGUAGESTRING" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "1999-2008 by OpenOffice.org" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "SUN Template Pack (%LANGUAGESTRING) %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%OOOPACKAGEVERSION" +End + +Start +module = "gid_Module_Optional_Extensions_LightProof_M" +script = "shellscripts_extensions.txt" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-extension-lightproof-%LANGUAGESTRING" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-extension-lightproof-%LANGUAGESTRING" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07" +linuxpatchrequires = "" +copyright = "1999-2008 by OpenOffice.org" +solariscopyright = "solariscopyrightfile" +vendor = "OpenOffice.org" +description = "Lightproof (%LANGUAGESTRING) %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%OOOPACKAGEVERSION" +End + +# Language depended package definitions for OxygenOffice Professional + +# 1/4 Templates + +Start +module = "gid_Module_Optional_Accessories_Tem" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-templates" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING-extra-templates" +provides = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-templates" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING" +copyright = "1999-2008 by %PRODUCTNAME" +solariscopyright = "solariscopyrightfile" +vendor = "%PRODUCTNAME" +description = "Extra templates for %PRODUCTNAME %PRODUCTVERSION, language %LANGUAGESTRING" +destpath = "/opt" +packageversion = "%OOOPACKAGEVERSION" +End + +# 2/4 Samples + +Start +module = "gid_Module_Optional_Accessories_Sam" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-samples" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING-extra-samples" +provides = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-samples" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING" +copyright = "1999-2008 by %PRODUCTNAME" +solariscopyright = "solariscopyrightfile" +vendor = "%PRODUCTNAME" +description = "Extra samples for %PRODUCTNAME %PRODUCTVERSION, language %LANGUAGESTRING" +destpath = "/opt" +packageversion = "%OOOPACKAGEVERSION" +End + +# 3/4 Documentations + +Start +module = "gid_Module_Optional_Accessories_Doc" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-documentations" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING-extra-documentations" +provides = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-documentations" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING" +copyright = "1999-2008 by %PRODUCTNAME" +solariscopyright = "solariscopyrightfile" +vendor = "%PRODUCTNAME" +description = "Extra documentations for %PRODUCTNAME %PRODUCTVERSION, language %LANGUAGESTRING" +destpath = "/opt" +packageversion = "%OOOPACKAGEVERSION" +End + +# 4/4 Advertisement + +Start +module = "gid_Module_Optional_Accessories_Adv" +solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-advertisement" +solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING" +packagename = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING-extra-advertisement" +provides = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-%LANGUAGESTRING-extra-advertisement" +requires = "%BASISPACKAGEPREFIX%OOOBASEVERSION-%LANGUAGESTRING" +copyright = "1999-2008 by %PRODUCTNAME" +solariscopyright = "solariscopyrightfile" +vendor = "%PRODUCTNAME" +description = "Extra advertisement for %PRODUCTNAME %PRODUCTVERSION, language %LANGUAGESTRING" +destpath = "/opt" +packageversion = "%OOOPACKAGEVERSION" +End + +# END OF Language depended package definitions -- cgit From 0a63782de97158cbb6c76f5bc77778399f1f79a3 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 16:54:36 +0200 Subject: sw-paste-table.diff: Refresh the cell formatting after pasting in it n#564789 --- sw/source/filter/basflt/shellio.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 963c5c847500..99f4fecc2c78 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -209,6 +209,16 @@ ULONG SwReader::Read( const Reader& rOptions ) else nEndCntnt = nLen - nEndCntnt; pPam->GetPoint()->nContent.Assign( pCNd, nEndCntnt ); + + const SwStartNode* pTblBoxStart = pCNd->FindTableBoxStartNode(); + if ( pTblBoxStart ) + { + SwTableBox* pBox = pTblBoxStart->GetTblBox(); + if ( pBox ) + { + pDoc->ChkBoxNumFmt( *pBox, TRUE ); + } + } } if( pCrsr ) -- cgit From 7240a160d97a6f7c75a695bd465057b6957f8da6 Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Tue, 14 Sep 2010 16:57:26 +0200 Subject: extensions_deliver.diff: Deliver extensions to the solver --- sdext/prj/d.lst | 3 +++ swext/prj/d.lst | 1 + 2 files changed, 4 insertions(+) diff --git a/sdext/prj/d.lst b/sdext/prj/d.lst index 71a91653c3d2..6d0ca9c36424 100644 --- a/sdext/prj/d.lst +++ b/sdext/prj/d.lst @@ -1,6 +1,9 @@ mkdir: %_DEST%\bin%_EXT%\minimizer mkdir: %_DEST%\bin%_EXT%\presenter mkdir: %_DEST%\bin%_EXT%\pdfimport +..\%__SRC%\bin\presentation-minimizer.oxt %_DEST%\bin%_EXT%\presentation-minimizer.oxt +..\%__SRC%\bin\presenter-screen.oxt %_DEST%\bin%_EXT%\presenter-screen.oxt +..\%__SRC%\bin\pdfimport.oxt %_DEST%\bin%_EXT%\pdfimport.oxt ..\%__SRC%\bin\pdf2xml.* %_DEST%\bin%_EXT%\pdf2xml.* ..\%__SRC%\bin\pdfunzip.* %_DEST%\bin%_EXT%\pdfunzip.* ..\%__SRC%\bin\pdfimport.oxt %_DEST%\bin%_EXT%\pdfimport\pdfimport.oxt diff --git a/swext/prj/d.lst b/swext/prj/d.lst index 108d9cd73b49..0624f506937a 100644 --- a/swext/prj/d.lst +++ b/swext/prj/d.lst @@ -1,4 +1,5 @@ mkdir: %_DEST%\bin%_EXT%\swext ..\%__SRC%\bin\wiki-publisher.oxt %_DEST%\bin%_EXT%\swext\wiki-publisher.oxt +..\%__SRC%\bin\wiki-publisher.oxt %_DEST%\bin%_EXT%\wiki-publisher.oxt ..\%__SRC%\bin\mediawiki_develop.zip %_DEST%\bin%_EXT%\swext\mediawiki_develop.zip -- cgit From 9c45034904590f4174db87b9f996b220a9e5823b Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Tue, 14 Sep 2010 17:04:28 +0200 Subject: sw-html-insert-unknown-tags.diff: paste html text between 2 unknown tags i#59064 --- sw/source/filter/html/swhtml.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index fba6a477757d..7c5092ed26ef 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1237,6 +1237,21 @@ void __EXPORT SwHTMLParser::NextToken( int nToken ) } else if( aUnknownToken.Len() ) { + // Fix i#59064 : Paste content of unknown tags. + if (aToken.Len() > 0) + { + if( !bDocInitalized ) + DocumentDetected(); + pDoc->InsertString( *pPam, aToken ); + + // wenn es noch vorlaefige Absatz-Attribute gibt, der Absatz aber + // nicht leer ist, dann sind die Absatz-Attribute entgueltig. + if( aParaAttrs.Count() ) + aParaAttrs.Remove( 0, aParaAttrs.Count() ); + + SetAttr(); + } + // Unbekannte Token im Header werden nur durch ein passendes // End-Token, oder wieder beendet. Darin wird Text // ignoriert. @@ -1254,6 +1269,7 @@ void __EXPORT SwHTMLParser::NextToken( int nToken ) case HTML_TEXTTOKEN: return; default: + aUnknownToken.Erase(); break; } } -- cgit From ea0fb16e08d4970451d7fd9539e6ec541e7732ea Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 17:09:23 +0200 Subject: languagetool-prj-build-lst.diff: build list for languagetool module --- languagetool/prj/build.lst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 languagetool/prj/build.lst diff --git a/languagetool/prj/build.lst b/languagetool/prj/build.lst new file mode 100644 index 000000000000..98e25c36b3fc --- /dev/null +++ b/languagetool/prj/build.lst @@ -0,0 +1,3 @@ +lt languagetool : javaunohelper jurt ridljar unoil NULL +lt languagetool usr1 - all lt_mkout NULL +lt languagatool nmake - all lt_languagetool NULL -- cgit From e1d8558cd028f938f9ed69497b4ea92e3c0ca4a4 Mon Sep 17 00:00:00 2001 From: Florian Reuter Date: Tue, 14 Sep 2010 17:11:44 +0200 Subject: sw-graphic-save-problem.diff: n240770 --- sw/source/core/graphic/ndgrf.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index bcbdc826dd66..46b92c7233d0 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -858,6 +858,10 @@ void SwGrfNode::_GetStreamStorageNames( String& rStrmName, if( !aUserData.Len() ) return; + if (aNewStrmName.Len()>0) { + aUserData=aNewStrmName; + } + String aProt( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.Package:" ) ); if( 0 == aUserData.CompareTo( aProt, aProt.Len() ) ) { -- cgit From 3d4605268439d2d4e3adb74f9c5c3dd37ed4223c Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 17:11:46 +0200 Subject: languagetool-prj-d-lst.diff: languagetool deliver list --- languagetool/prj/d.lst | 1 + 1 file changed, 1 insertion(+) create mode 100644 languagetool/prj/d.lst diff --git a/languagetool/prj/d.lst b/languagetool/prj/d.lst new file mode 100644 index 000000000000..b3c00b321cc9 --- /dev/null +++ b/languagetool/prj/d.lst @@ -0,0 +1 @@ +..\%__SRC%\misc\build\JLanguageTool*\dist\LanguageTool.oxt %_DEST%\bin%_EXT%\ -- cgit From 1da2229be2b1a7fd4a82f70a15c16df21345ad34 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 17:13:53 +0200 Subject: languagetool-jlanguagetool-1-0-0-patch.diff: build patch for languagetool --- languagetool/JLanguageTool-1.0.0.patch | 137 +++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 languagetool/JLanguageTool-1.0.0.patch diff --git a/languagetool/JLanguageTool-1.0.0.patch b/languagetool/JLanguageTool-1.0.0.patch new file mode 100644 index 000000000000..2b025c904394 --- /dev/null +++ b/languagetool/JLanguageTool-1.0.0.patch @@ -0,0 +1,137 @@ +--- misc/JLanguageTool-1.0.0/build.properties 2009-11-01 17:02:22.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/build.properties 2010-03-10 15:33:21.000000000 +0100 +@@ -54,10 +54,10 @@ + ext.log4j.lib = ${ext.dir}/build/cobertura/log4j-1.2.9.jar + ext.jakarta-oro.lib = ${ext.dir}/build/cobertura/jakarta-oro-2.0.8.jar + +-ext.ooo.juh.lib = ${ext.ooo.dir}/juh.jar +-ext.ooo.unoil.lib = ${ext.ooo.dir}/unoil.jar +-ext.ooo.ridl.lib = ${ext.ooo.dir}/ridl.jar +-ext.ooo.jurt.lib = ${ext.ooo.dir}/jurt.jar ++ext.ooo.juh.lib = ${solver.ooo.dir}/juh.jar ++ext.ooo.unoil.lib = ${solver.ooo.dir}/unoil.jar ++ext.ooo.ridl.lib = ${solver.ooo.dir}/ridl.jar ++ext.ooo.jurt.lib = ${solver.ooo.dir}/jurt.jar + + build.meta-inf = ${build.dir}/META-INF + final.name = LanguageTool +--- misc/JLanguageTool-1.0.0/build.xml 2009-10-26 14:28:30.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/build.xml 2010-03-10 15:33:21.000000000 +0100 +@@ -20,6 +20,8 @@ + + + ++ ++ + + + +@@ -367,11 +369,11 @@ + + + +- ++ + + + +- ++ + + + +@@ -402,11 +404,6 @@ + + + +- +- +- +- +- + + + +@@ -472,7 +472,6 @@ + + + +- + + + +@@ -494,7 +493,6 @@ + + + +- + + + +--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2009-01-01 23:39:30.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2010-03-10 15:33:21.000000000 +0100 +@@ -23,6 +23,7 @@ + import java.io.FileNotFoundException; + import java.io.FileOutputStream; + import java.io.IOException; ++import java.lang.ClassLoader; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Properties; +@@ -154,8 +155,19 @@ + final String motherTongueStr = (String) props + .get(MOTHER_TONGUE_CONFIG_KEY); + if (motherTongueStr != null) { ++ // FIXME: hack to disable the functionality for JRE 1.5 ++ // javax.xml.bind.JAXBException is part of JRE 1.6 ++ boolean isJRE15 = false; ++ try { ++ ClassLoader cl = ClassLoader.getSystemClassLoader(); ++ cl.loadClass("javax.xml.bind.JAXBException"); ++ } catch (ClassNotFoundException e) { ++ isJRE15 = true; ++ } ++ if (!isJRE15) { + motherTongue = Language.getLanguageForShortName(motherTongueStr); + } ++ } + final String runServerString = (String) props.get(SERVER_RUN_CONFIG_KEY); + if (runServerString != null) { + runServer = runServerString.equals("true"); +--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2009-10-24 16:52:03.000000000 +0200 ++++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2010-03-10 15:33:21.000000000 +0100 +@@ -24,6 +24,7 @@ + * @author Marcin Miłkowski + */ + import java.io.File; ++import java.lang.ClassLoader; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Comparator; +@@ -455,6 +456,14 @@ + * @return An array of Locales supported by LT. + */ + public final Locale[] getLocales() { ++ // FIXME: hack to disable the functionality for JRE 1.5 ++ // javax.xml.bind.JAXBException is part of JRE 1.6 ++ try { ++ ClassLoader cl = ClassLoader.getSystemClassLoader(); ++ cl.loadClass("javax.xml.bind.JAXBException"); ++ } catch (ClassNotFoundException e) { ++ return new Locale[0]; ++ } + try { + int dims = 0; + for (final Language element : Language.LANGUAGES) { +@@ -609,9 +618,9 @@ + if (version != null + && (version.startsWith("1.0") || version.startsWith("1.1") + || version.startsWith("1.2") || version.startsWith("1.3") || version +- .startsWith("1.4"))) { ++ .startsWith("1.4") || version.startsWith("1.5"))) { + final DialogThread dt = new DialogThread( +- "Error: LanguageTool requires Java 1.5 or later. Current version: " ++ "Error: LanguageTool requires Java 1.6 or later. Current version: " + + version); + dt.start(); + return false; -- cgit From 7343e687fc9a180d453bf0112318c563801f303d Mon Sep 17 00:00:00 2001 From: Jiao Jianhua Date: Tue, 14 Sep 2010 17:14:11 +0200 Subject: sw-default-cjk-fontsize.diff: default CJK font fontsize as 10.5pt i#72010 --- sw/source/ui/config/fontcfg.cxx | 5 ++++- sw/source/ui/inc/fontcfg.hxx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx index e1b951c1c879..92582b0f09d3 100644 --- a/sw/source/ui/config/fontcfg.cxx +++ b/sw/source/ui/config/fontcfg.cxx @@ -303,7 +303,10 @@ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(USHORT nFontType, LanguageType eL case FONT_OUTLINE_CJK: case FONT_OUTLINE_CTL: nRet = FONTSIZE_OUTLINE; - break; + break; + case FONT_STANDARD_CJK: + nRet = FONTSIZE_CJK_DEFAULT; + break; } if( eLang == LANGUAGE_THAI && nFontType >= FONT_STANDARD_CTL ) { diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx index 71cbdf3ad5d2..92d1afde3d53 100644 --- a/sw/source/ui/inc/fontcfg.hxx +++ b/sw/source/ui/inc/fontcfg.hxx @@ -58,6 +58,7 @@ //pt-size of fonts #define FONTSIZE_DEFAULT 240 +#define FONTSIZE_CJK_DEFAULT 210 #define FONTSIZE_OUTLINE 280 -- cgit From 87084c7ce023e1481a4bb2375493999bf88aef19 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 17:16:24 +0200 Subject: languagetool-makefile-mk.diff: makefile for languagetool --- languagetool/makefile.mk | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 languagetool/makefile.mk diff --git a/languagetool/makefile.mk b/languagetool/makefile.mk new file mode 100644 index 000000000000..d96d702030ce --- /dev/null +++ b/languagetool/makefile.mk @@ -0,0 +1,67 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.10 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=. + +PRJNAME=languagetool +TARGET=languagetool + +.IF "$(SOLAR_JAVA)"!="" +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : antsettings.mk + +# --- Files -------------------------------------------------------- + +TARFILE_NAME=JLanguageTool-1.0.0 +TARFILE_MD5=47e1edaa44269bc537ae8cabebb0f638 +TARFILE_ROOTDIR=JLanguageTool-1.0.0 +PATCH_FILES=JLanguageTool-1.0.0.patch + +.IF "$(JAVACISGCJ)"=="yes" +JAVA_HOME= +.EXPORT : JAVA_HOME +BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dbuild.compiler=gcj dist +.ELSE +BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) dist +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk + +.ELSE +all: + @echo java disabled +.ENDIF -- cgit From 8bbfa2e577af71811df23d9f315c0d9b57960010 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 17:21:03 +0200 Subject: cjk-default-compatibility.diff: Don't expand spaces with manual breaks i#54320 --- cui/source/options/optgdlg.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index e2fe5a273474..3ccc902d356f 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -1587,6 +1588,11 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) // the end of this method pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang ); rSet.Put( SfxBoolItem( SID_OPT_LOCALE_CHANGED, TRUE ) ); + + sal_uInt16 nNewType = SvtLanguageOptions::GetScriptTypeOfLanguage( eNewLocale ); + bool bNewCJK = ( nNewType & SCRIPTTYPE_ASIAN ) != 0; + SvtCompatibilityOptions aCompatOpts; + aCompatOpts.SetDefault( COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE, !bNewCJK ); } if(aDecimalSeparatorCB.GetSavedValue() != aDecimalSeparatorCB.IsChecked()) -- cgit From 615e2b4075b2d285c033aae5e722ffa382e8520e Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Tue, 14 Sep 2010 17:21:03 +0200 Subject: cjk-default-compatibility.diff: Don't expand spaces with manual breaks i#54320 --- unotools/inc/unotools/compatibility.hxx | 2 ++ unotools/source/config/compatibility.cxx | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/unotools/inc/unotools/compatibility.hxx b/unotools/inc/unotools/compatibility.hxx index eb01e43f3ba0..17fa55d2f434 100644 --- a/unotools/inc/unotools/compatibility.hxx +++ b/unotools/inc/unotools/compatibility.hxx @@ -153,6 +153,8 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options void Clear(); + void SetDefault( ::rtl::OUString sName, bool bValue ); + /*-****************************************************************************************************//** @short return complete specified list @descr Call it to get all entries of compatibility options. diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index 61ebe0211817..5f733e194464 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -247,6 +248,8 @@ class SvtCompatibilityOptions_Impl : public ConfigItem SvtCompatibilityOptions_Impl(); ~SvtCompatibilityOptions_Impl(); + void SetDefault( OUString sName, bool bValue ); + //--------------------------------------------------------------------------------------------------------- // overloaded methods of baseclass //--------------------------------------------------------------------------------------------------------- @@ -425,6 +428,12 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() if ( !bDefaultFound && aItem.sName.equals( COMPATIBILITY_DEFAULT_NAME ) != sal_False ) { + SvtSysLocale aSysLocale; + com::sun::star::lang::Locale aLocale = aSysLocale.GetLocale(); + if ( aLocale.Language.equalsAscii( "zh" ) || aLocale.Language.equalsAscii( "ja" ) || + aLocale.Language.equalsAscii( "ko" ) ) + aItem.bExpandWordSpace = false; + m_aDefOptions = aItem; bDefaultFound = true; } @@ -443,6 +452,32 @@ SvtCompatibilityOptions_Impl::~SvtCompatibilityOptions_Impl() } } +void SvtCompatibilityOptions_Impl::SetDefault( OUString sName, bool bValue ) +{ + if ( COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS.equals( sName ) ) + m_aDefOptions.SetUsePrtMetrics( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_ADDSPACING.equals( sName ) ) + m_aDefOptions.SetAddSpacing( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES.equals( sName ) ) + m_aDefOptions.SetAddSpacingAtPages( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS.equals( sName ) ) + m_aDefOptions.SetUseOurTabStops( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_NOEXTLEADING.equals( sName ) ) + m_aDefOptions.SetNoExtLeading( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_USELINESPACING.equals( sName ) ) + m_aDefOptions.SetUseLineSpacing( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING.equals( sName ) ) + m_aDefOptions.SetAddTableSpacing( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING.equals( sName ) ) + m_aDefOptions.SetUseObjPos( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING.equals( sName ) ) + m_aDefOptions.SetUseOurTextWrapping( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE.equals( sName ) ) + m_aDefOptions.SetConsiderWrappingStyle( bValue ); + else if ( COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE.equals( sName ) ) + m_aDefOptions.SetExpandWordSpace( bValue ); +} + //***************************************************************************************************************** // public method //***************************************************************************************************************** @@ -680,6 +715,11 @@ void SvtCompatibilityOptions::Clear() m_pDataContainer->Clear(); } +void SvtCompatibilityOptions::SetDefault( ::rtl::OUString sName, bool bValue ) +{ + m_pDataContainer->SetDefault( sName, bValue ); +} + //***************************************************************************************************************** // public method //***************************************************************************************************************** -- cgit From 382e4f6965d485e6599c4f779f868e6a26db8177 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 14 Sep 2010 17:23:00 +0200 Subject: Fix numbering restart on ppt import Set proper default for numbering scheme high bits, such that changes in bullet property don't automatically restart numbering. This fixes n#632546 --- filter/source/msfilter/svdfppt.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index f334c86bbc5f..f65a65b30986 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -3677,7 +3677,7 @@ BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManag UINT32 nBuFlags = 0; UINT16 nHasAnm = 0; - UINT32 nAnmScheme = 0x10003; + UINT32 nAnmScheme = 0xFFFF0003; UINT16 nBuBlip = 0xffff; const PPTExtParaProv* pParaProv = pExtParaProv; -- cgit From 4ce7dc44f25400b35e1c4f397d18d16bf628fc55 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 17:27:42 +0200 Subject: moving languagetool to the right repository --- .../languagetool/JLanguageTool-1.0.0.patch | 137 +++++++++++++++++++++ languagetool/languagetool/makefile.mk | 67 ++++++++++ languagetool/languagetool/prj/build.lst | 3 + languagetool/languagetool/prj/d.lst | 1 + 4 files changed, 208 insertions(+) create mode 100644 languagetool/languagetool/JLanguageTool-1.0.0.patch create mode 100644 languagetool/languagetool/makefile.mk create mode 100644 languagetool/languagetool/prj/build.lst create mode 100644 languagetool/languagetool/prj/d.lst diff --git a/languagetool/languagetool/JLanguageTool-1.0.0.patch b/languagetool/languagetool/JLanguageTool-1.0.0.patch new file mode 100644 index 000000000000..2b025c904394 --- /dev/null +++ b/languagetool/languagetool/JLanguageTool-1.0.0.patch @@ -0,0 +1,137 @@ +--- misc/JLanguageTool-1.0.0/build.properties 2009-11-01 17:02:22.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/build.properties 2010-03-10 15:33:21.000000000 +0100 +@@ -54,10 +54,10 @@ + ext.log4j.lib = ${ext.dir}/build/cobertura/log4j-1.2.9.jar + ext.jakarta-oro.lib = ${ext.dir}/build/cobertura/jakarta-oro-2.0.8.jar + +-ext.ooo.juh.lib = ${ext.ooo.dir}/juh.jar +-ext.ooo.unoil.lib = ${ext.ooo.dir}/unoil.jar +-ext.ooo.ridl.lib = ${ext.ooo.dir}/ridl.jar +-ext.ooo.jurt.lib = ${ext.ooo.dir}/jurt.jar ++ext.ooo.juh.lib = ${solver.ooo.dir}/juh.jar ++ext.ooo.unoil.lib = ${solver.ooo.dir}/unoil.jar ++ext.ooo.ridl.lib = ${solver.ooo.dir}/ridl.jar ++ext.ooo.jurt.lib = ${solver.ooo.dir}/jurt.jar + + build.meta-inf = ${build.dir}/META-INF + final.name = LanguageTool +--- misc/JLanguageTool-1.0.0/build.xml 2009-10-26 14:28:30.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/build.xml 2010-03-10 15:33:21.000000000 +0100 +@@ -20,6 +20,8 @@ + + + ++ ++ + + + +@@ -367,11 +369,11 @@ + + + +- ++ + + + +- ++ + + + +@@ -402,11 +404,6 @@ + + + +- +- +- +- +- + + + +@@ -472,7 +472,6 @@ + + + +- + + + +@@ -494,7 +493,6 @@ + + + +- + + + +--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2009-01-01 23:39:30.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2010-03-10 15:33:21.000000000 +0100 +@@ -23,6 +23,7 @@ + import java.io.FileNotFoundException; + import java.io.FileOutputStream; + import java.io.IOException; ++import java.lang.ClassLoader; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Properties; +@@ -154,8 +155,19 @@ + final String motherTongueStr = (String) props + .get(MOTHER_TONGUE_CONFIG_KEY); + if (motherTongueStr != null) { ++ // FIXME: hack to disable the functionality for JRE 1.5 ++ // javax.xml.bind.JAXBException is part of JRE 1.6 ++ boolean isJRE15 = false; ++ try { ++ ClassLoader cl = ClassLoader.getSystemClassLoader(); ++ cl.loadClass("javax.xml.bind.JAXBException"); ++ } catch (ClassNotFoundException e) { ++ isJRE15 = true; ++ } ++ if (!isJRE15) { + motherTongue = Language.getLanguageForShortName(motherTongueStr); + } ++ } + final String runServerString = (String) props.get(SERVER_RUN_CONFIG_KEY); + if (runServerString != null) { + runServer = runServerString.equals("true"); +--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2009-10-24 16:52:03.000000000 +0200 ++++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2010-03-10 15:33:21.000000000 +0100 +@@ -24,6 +24,7 @@ + * @author Marcin Miłkowski + */ + import java.io.File; ++import java.lang.ClassLoader; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Comparator; +@@ -455,6 +456,14 @@ + * @return An array of Locales supported by LT. + */ + public final Locale[] getLocales() { ++ // FIXME: hack to disable the functionality for JRE 1.5 ++ // javax.xml.bind.JAXBException is part of JRE 1.6 ++ try { ++ ClassLoader cl = ClassLoader.getSystemClassLoader(); ++ cl.loadClass("javax.xml.bind.JAXBException"); ++ } catch (ClassNotFoundException e) { ++ return new Locale[0]; ++ } + try { + int dims = 0; + for (final Language element : Language.LANGUAGES) { +@@ -609,9 +618,9 @@ + if (version != null + && (version.startsWith("1.0") || version.startsWith("1.1") + || version.startsWith("1.2") || version.startsWith("1.3") || version +- .startsWith("1.4"))) { ++ .startsWith("1.4") || version.startsWith("1.5"))) { + final DialogThread dt = new DialogThread( +- "Error: LanguageTool requires Java 1.5 or later. Current version: " ++ "Error: LanguageTool requires Java 1.6 or later. Current version: " + + version); + dt.start(); + return false; diff --git a/languagetool/languagetool/makefile.mk b/languagetool/languagetool/makefile.mk new file mode 100644 index 000000000000..d96d702030ce --- /dev/null +++ b/languagetool/languagetool/makefile.mk @@ -0,0 +1,67 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.10 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=. + +PRJNAME=languagetool +TARGET=languagetool + +.IF "$(SOLAR_JAVA)"!="" +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : antsettings.mk + +# --- Files -------------------------------------------------------- + +TARFILE_NAME=JLanguageTool-1.0.0 +TARFILE_MD5=47e1edaa44269bc537ae8cabebb0f638 +TARFILE_ROOTDIR=JLanguageTool-1.0.0 +PATCH_FILES=JLanguageTool-1.0.0.patch + +.IF "$(JAVACISGCJ)"=="yes" +JAVA_HOME= +.EXPORT : JAVA_HOME +BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dbuild.compiler=gcj dist +.ELSE +BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) dist +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk + +.ELSE +all: + @echo java disabled +.ENDIF diff --git a/languagetool/languagetool/prj/build.lst b/languagetool/languagetool/prj/build.lst new file mode 100644 index 000000000000..98e25c36b3fc --- /dev/null +++ b/languagetool/languagetool/prj/build.lst @@ -0,0 +1,3 @@ +lt languagetool : javaunohelper jurt ridljar unoil NULL +lt languagetool usr1 - all lt_mkout NULL +lt languagatool nmake - all lt_languagetool NULL diff --git a/languagetool/languagetool/prj/d.lst b/languagetool/languagetool/prj/d.lst new file mode 100644 index 000000000000..b3c00b321cc9 --- /dev/null +++ b/languagetool/languagetool/prj/d.lst @@ -0,0 +1 @@ +..\%__SRC%\misc\build\JLanguageTool*\dist\LanguageTool.oxt %_DEST%\bin%_EXT%\ -- cgit From f7203f730d2c81f1396ffcaa03ba76f682d08985 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 17:27:58 +0200 Subject: Moving languagetool out of the wront repository --- languagetool/JLanguageTool-1.0.0.patch | 137 --------------------------------- languagetool/makefile.mk | 67 ---------------- languagetool/prj/build.lst | 3 - languagetool/prj/d.lst | 1 - 4 files changed, 208 deletions(-) delete mode 100644 languagetool/JLanguageTool-1.0.0.patch delete mode 100644 languagetool/makefile.mk delete mode 100644 languagetool/prj/build.lst delete mode 100644 languagetool/prj/d.lst diff --git a/languagetool/JLanguageTool-1.0.0.patch b/languagetool/JLanguageTool-1.0.0.patch deleted file mode 100644 index 2b025c904394..000000000000 --- a/languagetool/JLanguageTool-1.0.0.patch +++ /dev/null @@ -1,137 +0,0 @@ ---- misc/JLanguageTool-1.0.0/build.properties 2009-11-01 17:02:22.000000000 +0100 -+++ misc/build/JLanguageTool-1.0.0/build.properties 2010-03-10 15:33:21.000000000 +0100 -@@ -54,10 +54,10 @@ - ext.log4j.lib = ${ext.dir}/build/cobertura/log4j-1.2.9.jar - ext.jakarta-oro.lib = ${ext.dir}/build/cobertura/jakarta-oro-2.0.8.jar - --ext.ooo.juh.lib = ${ext.ooo.dir}/juh.jar --ext.ooo.unoil.lib = ${ext.ooo.dir}/unoil.jar --ext.ooo.ridl.lib = ${ext.ooo.dir}/ridl.jar --ext.ooo.jurt.lib = ${ext.ooo.dir}/jurt.jar -+ext.ooo.juh.lib = ${solver.ooo.dir}/juh.jar -+ext.ooo.unoil.lib = ${solver.ooo.dir}/unoil.jar -+ext.ooo.ridl.lib = ${solver.ooo.dir}/ridl.jar -+ext.ooo.jurt.lib = ${solver.ooo.dir}/jurt.jar - - build.meta-inf = ${build.dir}/META-INF - final.name = LanguageTool ---- misc/JLanguageTool-1.0.0/build.xml 2009-10-26 14:28:30.000000000 +0100 -+++ misc/build/JLanguageTool-1.0.0/build.xml 2010-03-10 15:33:21.000000000 +0100 -@@ -20,6 +20,8 @@ - - - -+ -+ - - - -@@ -367,11 +369,11 @@ - - - -- -+ - - - -- -+ - - - -@@ -402,11 +404,6 @@ - - - -- -- -- -- -- - - - -@@ -472,7 +472,6 @@ - - - -- - - - -@@ -494,7 +493,6 @@ - - - -- - - - ---- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2009-01-01 23:39:30.000000000 +0100 -+++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2010-03-10 15:33:21.000000000 +0100 -@@ -23,6 +23,7 @@ - import java.io.FileNotFoundException; - import java.io.FileOutputStream; - import java.io.IOException; -+import java.lang.ClassLoader; - import java.util.HashSet; - import java.util.Iterator; - import java.util.Properties; -@@ -154,8 +155,19 @@ - final String motherTongueStr = (String) props - .get(MOTHER_TONGUE_CONFIG_KEY); - if (motherTongueStr != null) { -+ // FIXME: hack to disable the functionality for JRE 1.5 -+ // javax.xml.bind.JAXBException is part of JRE 1.6 -+ boolean isJRE15 = false; -+ try { -+ ClassLoader cl = ClassLoader.getSystemClassLoader(); -+ cl.loadClass("javax.xml.bind.JAXBException"); -+ } catch (ClassNotFoundException e) { -+ isJRE15 = true; -+ } -+ if (!isJRE15) { - motherTongue = Language.getLanguageForShortName(motherTongueStr); - } -+ } - final String runServerString = (String) props.get(SERVER_RUN_CONFIG_KEY); - if (runServerString != null) { - runServer = runServerString.equals("true"); ---- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2009-10-24 16:52:03.000000000 +0200 -+++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2010-03-10 15:33:21.000000000 +0100 -@@ -24,6 +24,7 @@ - * @author Marcin Miłkowski - */ - import java.io.File; -+import java.lang.ClassLoader; - import java.util.ArrayList; - import java.util.Arrays; - import java.util.Comparator; -@@ -455,6 +456,14 @@ - * @return An array of Locales supported by LT. - */ - public final Locale[] getLocales() { -+ // FIXME: hack to disable the functionality for JRE 1.5 -+ // javax.xml.bind.JAXBException is part of JRE 1.6 -+ try { -+ ClassLoader cl = ClassLoader.getSystemClassLoader(); -+ cl.loadClass("javax.xml.bind.JAXBException"); -+ } catch (ClassNotFoundException e) { -+ return new Locale[0]; -+ } - try { - int dims = 0; - for (final Language element : Language.LANGUAGES) { -@@ -609,9 +618,9 @@ - if (version != null - && (version.startsWith("1.0") || version.startsWith("1.1") - || version.startsWith("1.2") || version.startsWith("1.3") || version -- .startsWith("1.4"))) { -+ .startsWith("1.4") || version.startsWith("1.5"))) { - final DialogThread dt = new DialogThread( -- "Error: LanguageTool requires Java 1.5 or later. Current version: " -+ "Error: LanguageTool requires Java 1.6 or later. Current version: " - + version); - dt.start(); - return false; diff --git a/languagetool/makefile.mk b/languagetool/makefile.mk deleted file mode 100644 index d96d702030ce..000000000000 --- a/languagetool/makefile.mk +++ /dev/null @@ -1,67 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.10 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=. - -PRJNAME=languagetool -TARGET=languagetool - -.IF "$(SOLAR_JAVA)"!="" -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : antsettings.mk - -# --- Files -------------------------------------------------------- - -TARFILE_NAME=JLanguageTool-1.0.0 -TARFILE_MD5=47e1edaa44269bc537ae8cabebb0f638 -TARFILE_ROOTDIR=JLanguageTool-1.0.0 -PATCH_FILES=JLanguageTool-1.0.0.patch - -.IF "$(JAVACISGCJ)"=="yes" -JAVA_HOME= -.EXPORT : JAVA_HOME -BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dbuild.compiler=gcj dist -.ELSE -BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) dist -.ENDIF - -# --- Targets ------------------------------------------------------ - -.INCLUDE : set_ext.mk -.INCLUDE : target.mk -.INCLUDE : tg_ext.mk - -.ELSE -all: - @echo java disabled -.ENDIF diff --git a/languagetool/prj/build.lst b/languagetool/prj/build.lst deleted file mode 100644 index 98e25c36b3fc..000000000000 --- a/languagetool/prj/build.lst +++ /dev/null @@ -1,3 +0,0 @@ -lt languagetool : javaunohelper jurt ridljar unoil NULL -lt languagetool usr1 - all lt_mkout NULL -lt languagatool nmake - all lt_languagetool NULL diff --git a/languagetool/prj/d.lst b/languagetool/prj/d.lst deleted file mode 100644 index b3c00b321cc9..000000000000 --- a/languagetool/prj/d.lst +++ /dev/null @@ -1 +0,0 @@ -..\%__SRC%\misc\build\JLanguageTool*\dist\LanguageTool.oxt %_DEST%\bin%_EXT%\ -- cgit From aa613d6ffbbbc7baef2a133a5b9a7f17ec92b25d Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 14 Sep 2010 20:19:08 +0200 Subject: idlc-error-offset.diff: yylineno is not defined by default i#81780 --- idlc/source/scanner.ll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/idlc/source/scanner.ll b/idlc/source/scanner.ll index d8596585cb95..9955a8c808db 100644 --- a/idlc/source/scanner.ll +++ b/idlc/source/scanner.ll @@ -25,6 +25,8 @@ * ************************************************************************/ +%option yylineno + %{ /* * scanner.ll - Lexical scanner for IDLC 1.0 -- cgit From 4843a4657a729dad2a69076e6608a0da0092f091 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 19:21:36 +0200 Subject: kde4-buildfix-connectivity.diff: Fix KDE4 build. --- connectivity/source/drivers/kab/makefile.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk index 2a0dc5cd8999..5e32a5d3365f 100644 --- a/connectivity/source/drivers/kab/makefile.mk +++ b/connectivity/source/drivers/kab/makefile.mk @@ -106,14 +106,14 @@ SHL2VERSIONMAP=$(TARGET2).map SHL2TARGET= $(TARGET2)$(KAB_MAJOR) SHL2OBJS=$(SLO2FILES) +SHL2LINKFLAGS+=$(KAB_LIB) SHL2STDLIBS=\ $(CPPULIB) \ $(CPPUHELPERLIB) \ $(VOSLIB) \ $(SALLIB) \ $(DBTOOLSLIB) \ - $(COMPHELPERLIB) \ - $(KAB_LIB) + $(COMPHELPERLIB) SHL2DEPN= SHL2IMPLIB= i$(TARGET2) -- cgit From 287bc0aab7a848b991266586737b53630332b987 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 14 Sep 2010 20:05:34 +0200 Subject: Kill the migration wizard for good. Extends default-no-startup-wizard.diff and desktop-disable-startup-registration.diff. --- desktop/source/app/app.cxx | 34 +- desktop/source/migration/makefile.mk | 6 - desktop/source/migration/migration.cxx | 0 desktop/source/migration/pages.cxx | 673 --------------------- desktop/source/migration/pages.hxx | 214 ------- desktop/source/migration/services/migrationoo3.map | 0 .../migration/services/wordbookmigration.cxx | 0 .../migration/services/wordbookmigration.hxx | 0 desktop/source/migration/wizard.cxx | 654 -------------------- desktop/source/migration/wizard.hrc | 99 --- desktop/source/migration/wizard.hxx | 106 ---- desktop/source/migration/wizard.src | 424 ------------- desktop/source/splash/firststart.cxx | 156 ----- desktop/source/splash/firststart.hxx | 90 --- desktop/source/splash/makefile.mk | 5 +- desktop/source/splash/services_spl.cxx | 5 - desktop/util/makefile.mk | 3 +- 17 files changed, 5 insertions(+), 2464 deletions(-) mode change 100755 => 100644 desktop/source/migration/migration.cxx delete mode 100644 desktop/source/migration/pages.cxx delete mode 100644 desktop/source/migration/pages.hxx mode change 100755 => 100644 desktop/source/migration/services/migrationoo3.map mode change 100755 => 100644 desktop/source/migration/services/wordbookmigration.cxx mode change 100755 => 100644 desktop/source/migration/services/wordbookmigration.hxx delete mode 100644 desktop/source/migration/wizard.cxx delete mode 100644 desktop/source/migration/wizard.hrc delete mode 100644 desktop/source/migration/wizard.hxx delete mode 100644 desktop/source/migration/wizard.src delete mode 100755 desktop/source/splash/firststart.cxx delete mode 100755 desktop/source/splash/firststart.hxx diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 61ddde2405a5..83310c3402b5 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -47,7 +47,7 @@ #include "userinstall.hxx" #include "desktopcontext.hxx" #include "exithelper.hxx" -#include "../migration/pages.hxx" +#include "../migration/migration.hxx" #include #include @@ -1710,37 +1710,9 @@ void Desktop::Main() bool bAbort = CheckExtensionDependencies(); if ( bAbort ) return; - // First Start Wizard allowed ? - if ( ! pCmdLineArgs->IsNoFirstStartWizard()) - { - RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ FirstStartWizard" ); - if (IsFirstStartWizardNeeded()) - { - ::utl::RegOptions().removeReminder(); // remove patch registration reminder - Reference< XJob > xFirstStartJob( xSMgr->createInstance( - DEFINE_CONST_UNICODE( "com.sun.star.comp.desktop.FirstStart" ) ), UNO_QUERY ); - if (xFirstStartJob.is()) - { - sal_Bool bDone = sal_False; - Sequence< NamedValue > lArgs(2); - lArgs[0].Name = ::rtl::OUString::createFromAscii("LicenseNeedsAcceptance"); - lArgs[0].Value <<= LicenseNeedsAcceptance(); - lArgs[1].Name = ::rtl::OUString::createFromAscii("LicensePath"); - lArgs[1].Value <<= GetLicensePath(); - - xFirstStartJob->execute(lArgs) >>= bDone; - if ( !bDone ) - { - return; - } - } - } - else if ( RegistrationPage::hasReminderDateCome() ) - RegistrationPage::executeSingleMode(); - - RTL_LOGFILE_CONTEXT_TRACE( aLog, "} FirstStartWizard" ); - } + if ( Migration::checkMigration() ) + Migration::doMigration(); // keep a language options instance... pLanguageOptions.reset( new SvtLanguageOptions(sal_True)); diff --git a/desktop/source/migration/makefile.mk b/desktop/source/migration/makefile.mk index bc0cd9a62b10..753293f5e936 100644 --- a/desktop/source/migration/makefile.mk +++ b/desktop/source/migration/makefile.mk @@ -45,14 +45,8 @@ CDEFS+=-I..$/app SLOFILES = \ $(SLO)$/migration.obj \ - $(SLO)$/wizard.obj \ - $(SLO)$/pages.obj \ $(SLO)$/cfgfilter.obj -SRS1NAME= wizard -SRC1FILES= wizard.src - - # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx old mode 100755 new mode 100644 diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx deleted file mode 100644 index 53ec488c2082..000000000000 --- a/desktop/source/migration/pages.cxx +++ /dev/null @@ -1,673 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" - -#include "pages.hxx" -#include "wizard.hrc" -#include "wizard.hxx" -#include "migration.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace rtl; -using namespace osl; -using namespace utl; -using namespace svt; -using namespace com::sun::star; -using namespace com::sun::star::frame; -using namespace com::sun::star::lang; -using namespace com::sun::star::util; -using namespace com::sun::star::beans; -using namespace com::sun::star::uno; -using namespace com::sun::star::container; - -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - -namespace desktop { - -static void _setBold(FixedText& ft) -{ - Font f = ft.GetControlFont(); - f.SetWeight(WEIGHT_BOLD); - ft.SetControlFont(f); -} - -WelcomePage::WelcomePage( svt::OWizardMachine* parent, const ResId& resid, sal_Bool bLicenseNeedsAcceptance ) - : OWizardPage(parent, resid) - , m_ftHead(this, WizardResId(FT_WELCOME_HEADER)) - , m_ftBody(this, WizardResId(FT_WELCOME_BODY)) - , m_pParent(parent) - , m_bLicenseNeedsAcceptance( bLicenseNeedsAcceptance ) - , bIsEvalVersion(false) - , bNoEvalText(false) -{ - FreeResource(); - - _setBold(m_ftHead); - - checkEval(); - - // check for migration - if (Migration::checkMigration()) - { - String aText(WizardResId(STR_WELCOME_MIGRATION)); - // replace %OLDPRODUCT with found version name - aText.SearchAndReplaceAll( UniString::CreateFromAscii("%OLD_VERSION"), Migration::getOldVersionName()); - m_ftBody.SetText( aText ); - } - else if ( ! m_bLicenseNeedsAcceptance ) - { - String aText(WizardResId(STR_WELCOME_WITHOUT_LICENSE)); - m_ftBody.SetText( aText ); - } -} - - -void WelcomePage::checkEval() -{ - Reference< XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - Reference< XMaterialHolder > xHolder(xFactory->createInstance( - OUString::createFromAscii("com.sun.star.tab.tabreg")), UNO_QUERY); - if (xHolder.is()) { - Any aData = xHolder->getMaterial(); - Sequence < NamedValue > aSeq; - if (aData >>= aSeq) { - bIsEvalVersion = true; - for (int i=0; i< aSeq.getLength(); i++) { - if (aSeq[i].Name.equalsAscii("NoEvalText")) { - aSeq[i].Value >>= bNoEvalText; - } - } - } - } -} - - -void WelcomePage::ActivatePage() -{ - OWizardPage::ActivatePage(); - // this page has no controls, so forwarding to default - // button (next) won't work if we grap focus - // GrabFocus(); -} - -LicensePage::LicensePage( svt::OWizardMachine* parent, const ResId& resid, const rtl::OUString &rLicensePath ) - : OWizardPage(parent, resid) - , m_pParent(parent) - , m_ftHead(this, WizardResId(FT_LICENSE_HEADER)) - , m_ftBody1(this, WizardResId(FT_LICENSE_BODY_1)) - , m_ftBody1Txt(this, WizardResId(FT_LICENSE_BODY_1_TXT)) - , m_ftBody2(this, WizardResId(FT_LICENSE_BODY_2)) - , m_ftBody2Txt(this, WizardResId(FT_LICENSE_BODY_2_TXT)) - , m_mlLicense(this, WizardResId(ML_LICENSE)) - , m_pbDown(this, WizardResId(PB_LICENSE_DOWN)) - , m_bLicenseRead(sal_False) -{ - FreeResource(); - - _setBold(m_ftHead); - - m_mlLicense.SetEndReachedHdl( LINK(this, LicensePage, EndReachedHdl) ); - m_mlLicense.SetScrolledHdl( LINK(this, LicensePage, ScrolledHdl) ); - m_pbDown.SetClickHdl( LINK(this, LicensePage, PageDownHdl) ); - - // We want a automatic repeating page down button - WinBits aStyle = m_pbDown.GetStyle(); - aStyle |= WB_REPEAT; - m_pbDown.SetStyle( aStyle ); - - // replace %PAGEDOWN in text2 with button text - String aText = m_ftBody1Txt.GetText(); - aText.SearchAndReplaceAll( UniString::CreateFromAscii("%PAGEDOWN"), - MnemonicGenerator::EraseAllMnemonicChars(m_pbDown.GetText())); - - m_ftBody1Txt.SetText( aText ); - - // load license text - File aLicenseFile(rLicensePath); - if ( aLicenseFile.open(OpenFlag_Read) == FileBase::E_None) - { - DirectoryItem d; - DirectoryItem::get(rLicensePath, d); - FileStatus fs(FileStatusMask_FileSize); - d.getFileStatus(fs); - sal_uInt64 nBytesRead = 0; - sal_uInt64 nPosition = 0; - sal_uInt32 nBytes = (sal_uInt32)fs.getFileSize(); - sal_Char *pBuffer = new sal_Char[nBytes]; - // FileBase RC r = FileBase::E_None; - while (aLicenseFile.read(pBuffer+nPosition, nBytes-nPosition, nBytesRead) == FileBase::E_None - && nPosition + nBytesRead < nBytes) - { - nPosition += nBytesRead; - } - OUString aLicenseString(pBuffer, nBytes, RTL_TEXTENCODING_UTF8, - OSTRING_TO_OUSTRING_CVTFLAGS | RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE); - delete[] pBuffer; - m_mlLicense.SetText(aLicenseString); - - } -} - -void LicensePage::ActivatePage() -{ - OWizardPage::ActivatePage(); - m_bLicenseRead = m_mlLicense.IsEndReached(); - m_pbDown.GrabFocus(); - updateDialogTravelUI(); -} - -bool LicensePage::canAdvance() const -{ - if (m_mlLicense.IsEndReached()) - const_cast< LicensePage* >( this )->m_pbDown.Disable(); - else - const_cast< LicensePage* >( this )->m_pbDown.Enable(); - - return m_bLicenseRead; -} - -IMPL_LINK( LicensePage, PageDownHdl, PushButton *, EMPTYARG ) -{ - m_mlLicense.ScrollDown( SCROLL_PAGEDOWN ); - return 0; -} - -IMPL_LINK( LicensePage, EndReachedHdl, LicenseView *, EMPTYARG ) -{ - m_bLicenseRead = TRUE; - updateDialogTravelUI(); - return 0; -} - -IMPL_LINK( LicensePage, ScrolledHdl, LicenseView *, EMPTYARG ) -{ - updateDialogTravelUI(); - return 0; -} - - -LicenseView::LicenseView( Window* pParent, const ResId& rResId ) - : MultiLineEdit( pParent, rResId ) -{ - SetLeftMargin( 5 ); - mbEndReached = IsEndReached(); - StartListening( *GetTextEngine() ); -} - -LicenseView::~LicenseView() -{ - maEndReachedHdl = Link(); - maScrolledHdl = Link(); - EndListeningAll(); -} - -void LicenseView::ScrollDown( ScrollType eScroll ) -{ - ScrollBar* pScroll = GetVScrollBar(); - if ( pScroll ) - pScroll->DoScrollAction( eScroll ); -} - -BOOL LicenseView::IsEndReached() const -{ - BOOL bEndReached; - - ExtTextView* pView = GetTextView(); - ExtTextEngine* pEdit = GetTextEngine(); - ULONG nHeight = pEdit->GetTextHeight(); - Size aOutSize = pView->GetWindow()->GetOutputSizePixel(); - Point aBottom( 0, aOutSize.Height() ); - - if ( (ULONG) pView->GetDocPos( aBottom ).Y() >= nHeight - 1 ) - bEndReached = TRUE; - else - bEndReached = FALSE; - - return bEndReached; -} - -void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint ) -{ - if ( rHint.IsA( TYPE(TextHint) ) ) - { - BOOL bLastVal = EndReached(); - ULONG nId = ((const TextHint&)rHint).GetId(); - - if ( nId == TEXT_HINT_PARAINSERTED ) - { - if ( bLastVal ) - mbEndReached = IsEndReached(); - } - else if ( nId == TEXT_HINT_VIEWSCROLLED ) - { - if ( ! mbEndReached ) - mbEndReached = IsEndReached(); - maScrolledHdl.Call( this ); - } - - if ( EndReached() && !bLastVal ) - { - maEndReachedHdl.Call( this ); - } - } -} - - - -// ------------------------------------------------------------------- - -class MigrationThread : public ::osl::Thread -{ - public: - MigrationThread(); - - virtual void SAL_CALL run(); - virtual void SAL_CALL onTerminated(); -}; - -MigrationThread::MigrationThread() -{ -} - -void MigrationThread::run() -{ - try - { - Migration::doMigration(); - } - catch ( uno::Exception& ) - { - } -} - -void MigrationThread::onTerminated() -{ -} - -// ------------------------------------------------------------------- - -MigrationPage::MigrationPage( - svt::OWizardMachine* parent, - const ResId& resid, - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber) - : OWizardPage(parent, resid) - , m_ftHead(this, WizardResId(FT_MIGRATION_HEADER)) - , m_ftBody(this, WizardResId(FT_MIGRATION_BODY)) - , m_cbMigration(this, WizardResId(CB_MIGRATION)) - , m_bMigrationDone(sal_False) - , m_xThrobber(xThrobber) -{ - FreeResource(); - _setBold(m_ftHead); - - // replace %OLDPRODUCT with found version name - String aText = m_ftBody.GetText(); - aText.SearchAndReplaceAll( UniString::CreateFromAscii("%OLDPRODUCT"), Migration::getOldVersionName()); - m_ftBody.SetText( aText ); -} - -sal_Bool MigrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason ) -{ - if (_eReason == svt::WizardTypes::eTravelForward && m_cbMigration.IsChecked() && !m_bMigrationDone) - { - GetParent()->EnterWait(); - FirstStartWizard* pWizard = dynamic_cast< FirstStartWizard* >( GetParent() ); - if ( pWizard ) - pWizard->DisableButtonsWhileMigration(); - - uno::Reference< awt::XWindow > xWin( m_xThrobber, uno::UNO_QUERY ); - xWin->setVisible( true ); - m_xThrobber->start(); - MigrationThread* pMigThread = new MigrationThread(); - pMigThread->create(); - - while ( pMigThread->isRunning() ) - { - Application::Reschedule(); - } - - m_xThrobber->stop(); - GetParent()->LeaveWait(); - // Next state will enable buttons - so no EnableButtons necessary! - xWin->setVisible( false ); - pMigThread->join(); - delete pMigThread; - m_bMigrationDone = sal_True; - } - else - Migration::cancelMigration(); - return sal_True; -} - -void MigrationPage::ActivatePage() -{ - OWizardPage::ActivatePage(); - GrabFocus(); -} - -UserPage::UserPage( svt::OWizardMachine* parent, const ResId& resid) - : OWizardPage(parent, resid) - , m_ftHead(this, WizardResId(FT_USER_HEADER)) - , m_ftBody(this, WizardResId(FT_USER_BODY)) - , m_ftFirst(this, WizardResId(FT_USER_FIRST)) - , m_edFirst(this, WizardResId(ED_USER_FIRST)) - , m_ftLast(this, WizardResId(FT_USER_LAST)) - , m_edLast(this, WizardResId(ED_USER_LAST)) - , m_ftInitials(this, WizardResId(FT_USER_INITIALS)) - , m_edInitials(this, WizardResId(ED_USER_INITIALS)) - , m_ftFather(this, WizardResId(FT_USER_FATHER)) - , m_edFather(this, WizardResId(ED_USER_FATHER)) - , m_lang(Application::GetSettings().GetUILanguage()) -{ - FreeResource(); - _setBold(m_ftHead); - - // check whether this is a russian version. otherwise - // we'll hide the 'Fathers name' field - SvtUserOptions aUserOpt; - m_edFirst.SetText(aUserOpt.GetFirstName()); - m_edLast.SetText(aUserOpt.GetLastName()); -#if 0 - rtl::OUString aUserName; - vos::OSecurity().getUserName( aUserName ); - aUserOpt.SetID( aUserName ); -#endif - - m_edInitials.SetText(aUserOpt.GetID()); - if (m_lang == LANGUAGE_RUSSIAN) - { - m_ftFather.Show(); - m_edFather.Show(); - m_edFather.SetText(aUserOpt.GetFathersName()); - } -} - -sal_Bool UserPage::commitPage( svt::WizardTypes::CommitPageReason ) -{ - SvtUserOptions aUserOpt; - aUserOpt.SetFirstName(m_edFirst.GetText()); - aUserOpt.SetLastName(m_edLast.GetText()); - aUserOpt.SetID( m_edInitials.GetText()); - - if (m_lang == LANGUAGE_RUSSIAN) - aUserOpt.SetFathersName(m_edFather.GetText()); - - return sal_True; -} - -void UserPage::ActivatePage() -{ - OWizardPage::ActivatePage(); - GrabFocus(); -} - -// ------------------------------------------------------------------- -UpdateCheckPage::UpdateCheckPage( svt::OWizardMachine* parent, const ResId& resid) - : OWizardPage(parent, resid) - , m_ftHead(this, WizardResId(FT_UPDATE_CHECK_HEADER)) - , m_ftBody(this, WizardResId(FT_UPDATE_CHECK_BODY)) - , m_cbUpdateCheck(this, WizardResId(CB_UPDATE_CHECK)) -{ - FreeResource(); - _setBold(m_ftHead); -} - -sal_Bool UpdateCheckPage::commitPage( svt::WizardTypes::CommitPageReason _eReason ) -{ - if ( _eReason == svt::WizardTypes::eTravelForward ) - { - try { - Reference < XNameReplace > xUpdateAccess; - Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - - xUpdateAccess = Reference < XNameReplace >( - xFactory->createInstance( UNISTRING( "com.sun.star.setup.UpdateCheckConfig" ) ), UNO_QUERY_THROW ); - - if ( !xUpdateAccess.is() ) - return sal_False; - - sal_Bool bAutoUpdChk = m_cbUpdateCheck.IsChecked(); - xUpdateAccess->replaceByName( UNISTRING("AutoCheckEnabled"), makeAny( bAutoUpdChk ) ); - - Reference< XChangesBatch > xChangesBatch( xUpdateAccess, UNO_QUERY); - if( xChangesBatch.is() && xChangesBatch->hasPendingChanges() ) - xChangesBatch->commitChanges(); - } catch (RuntimeException) - { - } - } - - return sal_True; -} - -void UpdateCheckPage::ActivatePage() -{ - OWizardPage::ActivatePage(); - GrabFocus(); -} - -// ------------------------------------------------------------------- -RegistrationPage::RegistrationPage( Window* pParent, const ResId& rResid ) - : OWizardPage( pParent, rResid ) - , m_ftHeader(this, WizardResId(FT_REGISTRATION_HEADER)) - , m_ftBody(this, WizardResId(FT_REGISTRATION_BODY)) - , m_rbNow(this, WizardResId(RB_REGISTRATION_NOW)) - , m_rbLater(this, WizardResId(RB_REGISTRATION_LATER)) - , m_rbNever(this, WizardResId(RB_REGISTRATION_NEVER)) - , m_flSeparator(this, WizardResId(FL_REGISTRATION)) - , m_ftEnd(this, WizardResId(FT_REGISTRATION_END)) - , m_bNeverVisible( sal_True ) -{ - FreeResource(); - - // another text for OOo - sal_Int32 nOpenSourceContext = 0; - try - { - ::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::OPENSOURCECONTEXT ) >>= nOpenSourceContext; - } - catch( Exception& ) - { - DBG_ERRORFILE( "RegistrationPage::RegistrationPage(): error while getting open source context" ); - } - - if ( nOpenSourceContext > 0 ) - { - String sBodyText( WizardResId( STR_REGISTRATION_OOO ) ); - m_ftBody.SetText( sBodyText ); - } - - // calculate height of body text and rearrange the buttons - Size aSize = m_ftBody.GetSizePixel(); - Size aMinSize = m_ftBody.CalcMinimumSize( aSize.Width() ); - long nTxtH = aMinSize.Height(); - long nCtrlH = aSize.Height(); - long nDelta = ( nCtrlH - nTxtH ); - aSize.Height() -= nDelta; - m_ftBody.SetSizePixel( aSize ); - Window* pWins[] = { &m_rbNow, &m_rbLater, &m_rbNever }; - Window** pCurrent = pWins; - for ( sal_uInt32 i = 0; i < sizeof( pWins ) / sizeof( pWins[ 0 ] ); ++i, ++pCurrent ) - { - Point aNewPos = (*pCurrent)->GetPosPixel(); - aNewPos.Y() -= nDelta; - (*pCurrent)->SetPosPixel( aNewPos ); - } - - _setBold(m_ftHeader); - impl_retrieveConfigurationData(); - updateButtonStates(); -} - -bool RegistrationPage::canAdvance() const -{ - return false; -} - -void RegistrationPage::ActivatePage() -{ - OWizardPage::ActivatePage(); - GrabFocus(); -} - -void RegistrationPage::impl_retrieveConfigurationData() -{ - static ::rtl::OUString PACKAGE = ::rtl::OUString::createFromAscii("org.openoffice.FirstStartWizard"); - static ::rtl::OUString PATH = ::rtl::OUString::createFromAscii("TabPages/Registration/RegistrationOptions/NeverButton"); - static ::rtl::OUString KEY = ::rtl::OUString::createFromAscii("Visible"); - - ::com::sun::star::uno::Any aValue; - try - { - aValue = ::comphelper::ConfigurationHelper::readDirectKey( - ::comphelper::getProcessServiceFactory(), - PACKAGE, - PATH, - KEY, - ::comphelper::ConfigurationHelper::E_READONLY); - } - catch(const ::com::sun::star::uno::Exception&) - { aValue.clear(); } - - aValue >>= m_bNeverVisible; -} - -void RegistrationPage::updateButtonStates() -{ - m_rbNever.Show( m_bNeverVisible ); -} - -sal_Bool RegistrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason ) -{ - if ( _eReason == svt::WizardTypes::eFinish ) - { - ::utl::RegOptions aOptions; - rtl::OUString aEvent; - - if ( m_rbNow.IsChecked()) - { - aEvent = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RegistrationRequired" ) ); - } - else if (m_rbLater.IsChecked()) - { - aOptions.activateReminder(7); - // avtivate a reminder job... - } - // aOptions.markSessionDone(); - - try - { - // create the Desktop component which can load components - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - if( xFactory.is() ) - { - Reference< com::sun::star::task::XJobExecutor > xProductRegistration( - xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.setup.ProductRegistration" ) ) ), - UNO_QUERY_THROW ); - - // tell it that the user wants to register - xProductRegistration->trigger( aEvent ); - } - } - catch( const Exception& ) - { - } - } - return sal_True; -} - -RegistrationPage::RegistrationMode RegistrationPage::getRegistrationMode() const -{ - RegistrationPage::RegistrationMode eMode = rmNow; - if ( m_rbLater.IsChecked() ) - eMode = rmLater; - else if ( m_rbNever.IsChecked() ) - eMode = rmNever; - return eMode; -} - -void RegistrationPage::prepareSingleMode() -{ - // remove wizard text (hide and cut) - m_flSeparator.Hide(); - m_ftEnd.Hide(); - Size aNewSize = GetSizePixel(); - aNewSize.Height() -= ( aNewSize.Height() - m_flSeparator.GetPosPixel().Y() ); - SetSizePixel( aNewSize ); -} - -bool RegistrationPage::hasReminderDateCome() -{ - return ::utl::RegOptions().hasReminderDateCome(); -} - -void RegistrationPage::executeSingleMode() -{ - // opens the page in a single tabdialog - SfxSingleTabDialog aSingleDlg( NULL, TP_REGISTRATION ); - RegistrationPage* pPage = new RegistrationPage( &aSingleDlg, WizardResId( TP_REGISTRATION ) ); - pPage->prepareSingleMode(); - aSingleDlg.SetPage( pPage ); - aSingleDlg.SetText( pPage->getSingleModeTitle() ); - aSingleDlg.Execute(); - // the registration modes "Now" and "Later" are handled by the page - RegistrationPage::RegistrationMode eMode = pPage->getRegistrationMode(); - if ( eMode == RegistrationPage::rmNow || eMode == RegistrationPage::rmLater ) - pPage->commitPage( WizardTypes::eFinish ); - if ( eMode != RegistrationPage::rmLater ) - ::utl::RegOptions().removeReminder(); -} - -} // namespace desktop diff --git a/desktop/source/migration/pages.hxx b/desktop/source/migration/pages.hxx deleted file mode 100644 index 776268eb475c..000000000000 --- a/desktop/source/migration/pages.hxx +++ /dev/null @@ -1,214 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _PAGES_HXX_ -#define _PAGES_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace desktop -{ -class WelcomePage : public svt::OWizardPage -{ -private: - FixedText m_ftHead; - FixedText m_ftBody; - svt::OWizardMachine *m_pParent; - sal_Bool m_bLicenseNeedsAcceptance; - enum OEMType - { - OEM_NONE, OEM_NORMAL, OEM_EXTENDED - }; - bool bIsEvalVersion; - bool bNoEvalText; - void checkEval(); - - -public: - WelcomePage( svt::OWizardMachine* parent, const ResId& resid, sal_Bool bLicenseNeedsAcceptance ); -protected: - virtual void ActivatePage(); -}; - -class LicenseView : public MultiLineEdit, public SfxListener -{ - BOOL mbEndReached; - Link maEndReachedHdl; - Link maScrolledHdl; - -public: - LicenseView( Window* pParent, const ResId& rResId ); - ~LicenseView(); - - void ScrollDown( ScrollType eScroll ); - - BOOL IsEndReached() const; - BOOL EndReached() const { return mbEndReached; } - void SetEndReached( BOOL bEnd ) { mbEndReached = bEnd; } - - void SetEndReachedHdl( const Link& rHdl ) { maEndReachedHdl = rHdl; } - const Link& GetAutocompleteHdl() const { return maEndReachedHdl; } - - void SetScrolledHdl( const Link& rHdl ) { maScrolledHdl = rHdl; } - const Link& GetScrolledHdl() const { return maScrolledHdl; } - - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - -protected: - using MultiLineEdit::Notify; -}; - -class LicensePage : public svt::OWizardPage -{ -private: - svt::OWizardMachine *m_pParent; - FixedText m_ftHead; - FixedText m_ftBody1; - FixedText m_ftBody1Txt; - FixedText m_ftBody2; - FixedText m_ftBody2Txt; - LicenseView m_mlLicense; - PushButton m_pbDown; - sal_Bool m_bLicenseRead; -public: - LicensePage( svt::OWizardMachine* parent, const ResId& resid, const rtl::OUString &rLicensePath ); -private: - DECL_LINK(PageDownHdl, PushButton*); - DECL_LINK(EndReachedHdl, LicenseView*); - DECL_LINK(ScrolledHdl, LicenseView*); -protected: - virtual bool canAdvance() const; - virtual void ActivatePage(); -}; - -class MigrationPage : public svt::OWizardPage -{ -private: - FixedText m_ftHead; - FixedText m_ftBody; - CheckBox m_cbMigration; - sal_Bool m_bMigrationDone; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber; -public: - MigrationPage( svt::OWizardMachine* parent, const ResId& resid, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber ); - virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason ); - -protected: - virtual void ActivatePage(); -}; - -class UserPage : public svt::OWizardPage -{ -private: - FixedText m_ftHead; - FixedText m_ftBody; - FixedText m_ftFirst; - Edit m_edFirst; - FixedText m_ftLast; - Edit m_edLast; - FixedText m_ftInitials; - Edit m_edInitials; - FixedText m_ftFather; - Edit m_edFather; - LanguageType m_lang; - -public: - UserPage( svt::OWizardMachine* parent, const ResId& resid); - virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason ); -protected: - virtual void ActivatePage(); -}; - -class UpdateCheckPage : public svt::OWizardPage -{ -private: - FixedText m_ftHead; - FixedText m_ftBody; - CheckBox m_cbUpdateCheck; -public: - UpdateCheckPage( svt::OWizardMachine* parent, const ResId& resid); - virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason ); - -protected: - virtual void ActivatePage(); -}; - - -class RegistrationPage : public svt::OWizardPage -{ -private: - FixedText m_ftHeader; - FixedText m_ftBody; - RadioButton m_rbNow; - RadioButton m_rbLater; - RadioButton m_rbNever; - FixedLine m_flSeparator; - FixedText m_ftEnd; - - sal_Bool m_bNeverVisible; - - void updateButtonStates(); - void impl_retrieveConfigurationData(); - -protected: - virtual bool canAdvance() const; - virtual void ActivatePage(); - - virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason ); - -public: - RegistrationPage( Window* parent, const ResId& resid); - - enum RegistrationMode - { - rmNow, // register now - rmLater, // register later - rmNever // register never - }; - - RegistrationMode getRegistrationMode() const; - void prepareSingleMode(); - inline String getSingleModeTitle() const { return m_ftHeader.GetText(); } - - static bool hasReminderDateCome(); - static void executeSingleMode(); -}; - -} // namespace desktop - -#endif // #ifndef _PAGES_HXX_ - diff --git a/desktop/source/migration/services/migrationoo3.map b/desktop/source/migration/services/migrationoo3.map old mode 100755 new mode 100644 diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx old mode 100755 new mode 100644 diff --git a/desktop/source/migration/services/wordbookmigration.hxx b/desktop/source/migration/services/wordbookmigration.hxx old mode 100755 new mode 100644 diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx deleted file mode 100644 index 81a789a613b9..000000000000 --- a/desktop/source/migration/wizard.cxx +++ /dev/null @@ -1,654 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" - -#include -#include "wizard.hxx" -#include "wizard.hrc" -#include "pages.hxx" -#include "app.hxx" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace svt; -using namespace rtl; -using namespace osl; -using namespace utl; -using namespace com::sun::star; -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::beans; -using namespace com::sun::star::util; -using namespace com::sun::star::container; - -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - -namespace desktop -{ - -const FirstStartWizard::WizardState FirstStartWizard::STATE_WELCOME = 0; -const FirstStartWizard::WizardState FirstStartWizard::STATE_LICENSE = 1; -const FirstStartWizard::WizardState FirstStartWizard::STATE_MIGRATION = 2; -const FirstStartWizard::WizardState FirstStartWizard::STATE_USER = 3; -const FirstStartWizard::WizardState FirstStartWizard::STATE_UPDATE_CHECK = 4; -const FirstStartWizard::WizardState FirstStartWizard::STATE_REGISTRATION = 5; - -static uno::Reference< uno::XComponentContext > getComponentContext( const uno::Reference< lang::XMultiServiceFactory >& rFactory ) -{ - uno::Reference< uno::XComponentContext > rContext; - uno::Reference< beans::XPropertySet > rPropSet( rFactory, uno::UNO_QUERY ); - uno::Any a = rPropSet->getPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ); - a >>= rContext; - return rContext; -} - -static sal_Int32 getBuildId() -{ - ::rtl::OUString aDefault; - ::rtl::OUString aBuildIdData = utl::Bootstrap::getBuildIdData( aDefault ); - sal_Int32 nBuildId( 0 ); - sal_Int32 nIndex1 = aBuildIdData.indexOf(':'); - sal_Int32 nIndex2 = aBuildIdData.indexOf(')'); - if (( nIndex1 > 0 ) && ( nIndex2 > 0 ) && ( nIndex2-1 > nIndex1+1 )) - { - ::rtl::OUString aBuildId = aBuildIdData.copy( nIndex1+1, nIndex2-nIndex1-1 ); - nBuildId = aBuildId.toInt32(); - } - return nBuildId; -} - -WizardResId::WizardResId( USHORT nId ) : - ResId( nId, *FirstStartWizard::GetResManager() ) -{ -} - -ResMgr *FirstStartWizard::pResMgr = 0; - -ResMgr *FirstStartWizard::GetResManager() -{ - if ( !FirstStartWizard::pResMgr ) - { - String aMgrName = String::CreateFromAscii( "dkt" ); - FirstStartWizard::pResMgr = ResMgr::CreateResMgr( OUStringToOString( aMgrName, RTL_TEXTENCODING_UTF8 )); - } - return FirstStartWizard::pResMgr; -} - -FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAcceptance, const rtl::OUString &rLicensePath ) - :RoadmapWizard( pParent, WizardResId(DLG_FIRSTSTART_WIZARD), - WZB_NEXT|WZB_PREVIOUS|WZB_FINISH|WZB_CANCEL|WZB_HELP) - ,m_bOverride(sal_False) - ,m_aDefaultPath(0) - ,m_aMigrationPath(0) - ,m_bDone(sal_False) - ,m_bLicenseNeedsAcceptance( bLicenseNeedsAcceptance ) - ,m_bLicenseWasAccepted(sal_False) - ,m_bAutomaticUpdChk(sal_True) - ,m_aLicensePath( rLicensePath ) -{ - // --- - // FreeResource(); -// enableState(STATE_USER, sal_False); -// enableState(STATE_REGISTRATION, sal_False); - - try - { - Point pos(5, 210 ); - Size size(11, 11 ); - - pos = LogicToPixel( pos, MAP_APPFONT ); - size = LogicToPixel( size, MAP_APPFONT ); - - uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - uno::Reference< awt::XToolkit > xToolkit( - uno::Reference< lang::XMultiComponentFactory >( - xFactory, uno::UNO_QUERY_THROW)-> - createInstanceWithContext( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")), - getComponentContext(xFactory)), - uno::UNO_QUERY_THROW); - - m_xThrobber = uno::Reference< awt::XThrobber >( - xToolkit->createWindow( - awt::WindowDescriptor( - awt::WindowClass_SIMPLE, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Throbber")), - GetComponentInterface(), 0, - awt::Rectangle( - pos.X(), pos.Y(), size.Width(), size.Height()), - awt::WindowAttribute::SHOW)), - uno::UNO_QUERY_THROW); - } - catch (uno::RuntimeException &) - { - throw; - } - catch (Exception& ) - { - } - - uno::Reference< awt::XWindow > xThrobberWin( m_xThrobber, uno::UNO_QUERY ); - if ( xThrobberWin.is() ) - xThrobberWin->setVisible( false ); - - Size aTPSize(TP_WIDTH, TP_HEIGHT); - SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT)); - - //set help id - m_pPrevPage->SetHelpId(HID_FIRSTSTART_PREV); - m_pNextPage->SetHelpId(HID_FIRSTSTART_NEXT); - m_pCancel->SetHelpId(HID_FIRSTSTART_CANCEL); - m_pFinish->SetHelpId(HID_FIRSTSTART_FINISH); - // m_pHelp->SetUniqueId(UID_FIRSTSTART_HELP); - m_pHelp->Hide(); - m_pHelp->Disable(); - - // save button lables - m_sNext = m_pNextPage->GetText(); - m_sCancel = m_pCancel->GetText(); - - // save cancel click handler - m_lnkCancel = m_pCancel->GetClickHdl(); - - m_aDefaultPath = defineWizardPagesDependingFromContext(); - activatePath(m_aDefaultPath, sal_True); - - enterState(STATE_WELCOME); - ActivatePage(); - - // set text of finish putton: - m_pFinish->SetText(String(WizardResId(STR_FINISH))); - // disable "finish button" - enableButtons(WZB_FINISH, sal_False); - defaultButton(WZB_NEXT); -} - -void FirstStartWizard::DisableButtonsWhileMigration() -{ - enableButtons(0xff, sal_False); -} - -::svt::RoadmapWizardTypes::PathId FirstStartWizard::defineWizardPagesDependingFromContext() -{ - ::svt::RoadmapWizardTypes::PathId aDefaultPath = 0; - - sal_Bool bPage_Welcome = sal_True; - sal_Bool bPage_License = sal_True; - sal_Bool bPage_Migration = sal_True; - sal_Bool bPage_User = sal_True; - sal_Bool bPage_UpdateCheck = sal_True; - sal_Bool bPage_Registration = sal_True; - - bPage_License = m_bLicenseNeedsAcceptance; - bPage_Migration = Migration::checkMigration(); - bPage_UpdateCheck = showOnlineUpdatePage(); - - WizardPath aPath; - if (bPage_Welcome) - aPath.push_back(STATE_WELCOME); - if (bPage_License) - aPath.push_back(STATE_LICENSE); - if (bPage_Migration) - aPath.push_back(STATE_MIGRATION); - if (bPage_User) - aPath.push_back(STATE_USER); - if (bPage_UpdateCheck) - aPath.push_back(STATE_UPDATE_CHECK); - if (bPage_Registration) - aPath.push_back(STATE_REGISTRATION); - - declarePath(aDefaultPath, aPath); - - // a) If license must be accepted by the user, all direct links - // to wizard tab pages must be disabled. Because such pages - // should be accessible only in case license was accepted ! - // b) But if no license should be shown at all ... - // such direct links can be enabled by default. - sal_Bool bAllowDirectLink = ( ! bPage_License); - - if (bPage_User) - enableState(STATE_USER, bAllowDirectLink); - if (bPage_UpdateCheck) - enableState(STATE_UPDATE_CHECK, bAllowDirectLink); - if (bPage_Migration) - enableState(STATE_MIGRATION, bAllowDirectLink); - if (bPage_Registration) - enableState(STATE_REGISTRATION, bAllowDirectLink); - - return aDefaultPath; -} - -// catch F1 and disable help -long FirstStartWizard::PreNotify( NotifyEvent& rNEvt ) -{ - if( rNEvt.GetType() == EVENT_KEYINPUT ) - { - const KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode(); - if( rKey.GetCode() == KEY_F1 && ! rKey.GetModifier() ) - return TRUE; - } - return RoadmapWizard::PreNotify(rNEvt); -} - - -void FirstStartWizard::enterState(WizardState _nState) -{ - RoadmapWizard::enterState(_nState); - // default state - // all on - enableButtons(0xff, sal_True); - // finish off - enableButtons(WZB_FINISH, sal_False); - // default text - m_pCancel->SetText(m_sCancel); - m_pCancel->SetClickHdl(m_lnkCancel); - m_pNextPage->SetText(m_sNext); - - // default - defaultButton(WZB_NEXT); - - // specialized state - switch (_nState) - { - case STATE_WELCOME: - enableButtons(WZB_PREVIOUS, sal_False); - break; - case STATE_LICENSE: - m_pCancel->SetText(String(WizardResId(STR_LICENSE_DECLINE))); - m_pNextPage->SetText(String(WizardResId(STR_LICENSE_ACCEPT))); - enableButtons(WZB_NEXT, sal_False); - // attach warning dialog to cancel/decline button - m_pCancel->SetClickHdl( LINK(this, FirstStartWizard, DeclineHdl) ); - break; - case STATE_REGISTRATION: - enableButtons(WZB_NEXT, sal_False); - enableButtons(WZB_FINISH, sal_True); - defaultButton(WZB_FINISH); - break; - } - - // focus - -} - -IMPL_LINK( FirstStartWizard, DeclineHdl, PushButton *, EMPTYARG ) -{ - QueryBox aBox(this, WizardResId(QB_ASK_DECLINE)); - sal_Int32 ret = aBox.Execute(); - if ( ret == BUTTON_OK || ret == BUTTON_YES) - { - Close(); - return sal_False; - } - else - return sal_True; -} - - -TabPage* FirstStartWizard::createPage(WizardState _nState) -{ - TabPage *pTabPage = 0; - switch (_nState) - { - case STATE_WELCOME: - pTabPage = new WelcomePage(this, WizardResId(TP_WELCOME), m_bLicenseNeedsAcceptance); - break; - case STATE_LICENSE: - pTabPage = new LicensePage(this, WizardResId(TP_LICENSE), m_aLicensePath); - break; - case STATE_MIGRATION: - pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_xThrobber ); - break; - case STATE_USER: - pTabPage = new UserPage(this, WizardResId(TP_USER)); - break; - case STATE_UPDATE_CHECK: - pTabPage = new UpdateCheckPage(this, WizardResId(TP_UPDATE_CHECK)); - break; - case STATE_REGISTRATION: - pTabPage = new RegistrationPage(this, WizardResId(TP_REGISTRATION)); - break; - } - pTabPage->Show(); - - return pTabPage; -} - -String FirstStartWizard::getStateDisplayName( WizardState _nState ) const -{ - String sName; - switch(_nState) - { - case STATE_WELCOME: - sName = String(WizardResId(STR_STATE_WELCOME)); - break; - case STATE_LICENSE: - sName = String(WizardResId(STR_STATE_LICENSE)); - break; - case STATE_MIGRATION: - sName = String(WizardResId(STR_STATE_MIGRATION)); - break; - case STATE_USER: - sName = String(WizardResId(STR_STATE_USER)); - break; - case STATE_UPDATE_CHECK: - sName = String(WizardResId(STR_STATE_UPDATE_CHECK)); - break; - case STATE_REGISTRATION: - sName = String(WizardResId(STR_STATE_REGISTRATION)); - break; - } - return sName; -} - -sal_Bool FirstStartWizard::prepareLeaveCurrentState( CommitPageReason _eReason ) -{ - // the license acceptance is handled here, because it needs to change the state - // of the roadmap wizard which the page implementation does not know. - if ( - (_eReason == eTravelForward) && - (getCurrentState() == STATE_LICENSE ) && - (m_bLicenseWasAccepted == sal_False ) - ) - { - if (Migration::checkMigration()) - enableState(FirstStartWizard::STATE_MIGRATION, sal_True); - if ( showOnlineUpdatePage() ) - enableState(FirstStartWizard::STATE_UPDATE_CHECK, sal_True); - enableState(FirstStartWizard::STATE_USER, sal_True); - enableState(FirstStartWizard::STATE_REGISTRATION, sal_True); - - storeAcceptDate(); - m_bLicenseWasAccepted = sal_True; - } - - return svt::RoadmapWizard::prepareLeaveCurrentState(_eReason); -} - -sal_Bool FirstStartWizard::leaveState(WizardState) -{ - if (( getCurrentState() == STATE_MIGRATION ) && m_bLicenseWasAccepted ) - { - // Store accept date and patch level now as it has been - // overwritten by the migration process! - storeAcceptDate(); - setPatchLevel(); - } - - return sal_True; -} - -sal_Bool FirstStartWizard::onFinish() -{ - // return sal_True; - if ( svt::RoadmapWizard::onFinish() ) - { -#ifndef OS2 // cannot enable quickstart on first startup, see shutdownicon.cxx comments. - enableQuickstart(); -#endif - disableWizard(); - return sal_True; - } - else - return sal_False; -} - -short FirstStartWizard::Execute() -{ - return svt::RoadmapWizard::Execute(); -} - -static OUString _makeDateTimeString (const DateTime& aDateTime, sal_Bool bUTC = sal_False) -{ - OStringBuffer aDateTimeString; - aDateTimeString.append((sal_Int32)aDateTime.GetYear()); - aDateTimeString.append("-"); - if (aDateTime.GetMonth()<10) aDateTimeString.append("0"); - aDateTimeString.append((sal_Int32)aDateTime.GetMonth()); - aDateTimeString.append("-"); - if (aDateTime.GetDay()<10) aDateTimeString.append("0"); - aDateTimeString.append((sal_Int32)aDateTime.GetDay()); - aDateTimeString.append("T"); - if (aDateTime.GetHour()<10) aDateTimeString.append("0"); - aDateTimeString.append((sal_Int32)aDateTime.GetHour()); - aDateTimeString.append(":"); - if (aDateTime.GetMin()<10) aDateTimeString.append("0"); - aDateTimeString.append((sal_Int32)aDateTime.GetMin()); - aDateTimeString.append(":"); - if (aDateTime.GetSec()<10) aDateTimeString.append("0"); - aDateTimeString.append((sal_Int32)aDateTime.GetSec()); - if (bUTC) aDateTimeString.append("Z"); - - return OStringToOUString(aDateTimeString.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); -} - -static OUString _getCurrentDateString() -{ - OUString aString; - return _makeDateTimeString(DateTime()); -} - - -static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ); -static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ); -static const OUString sReadSrvc ( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ) ); - -void FirstStartWizard::storeAcceptDate() -{ - - try { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - // get configuration provider - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( - xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); - Sequence< Any > theArgs(1); - NamedValue v(OUString::createFromAscii("NodePath"), - makeAny(OUString::createFromAscii("org.openoffice.Setup/Office"))); - theArgs[0] <<= v; - Reference< XPropertySet > pset = Reference< XPropertySet >( - theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); - Any result = pset->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate")); - - OUString aAcceptDate = _getCurrentDateString(); - pset->setPropertyValue(OUString::createFromAscii("LicenseAcceptDate"), makeAny(aAcceptDate)); - Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges(); - - // since the license is accepted the local user registry can be cleaned if required - cleanOldOfficeRegKeys(); - } catch (const Exception&) - { - } - -} - -void FirstStartWizard::setPatchLevel() -{ - try { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - // get configuration provider - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( - xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); - Sequence< Any > theArgs(1); - NamedValue v(OUString::createFromAscii("NodePath"), - makeAny(OUString::createFromAscii("org.openoffice.Office.Common/Help/Registration"))); - theArgs[0] <<= v; - Reference< XPropertySet > pset = Reference< XPropertySet >( - theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); - Any result = pset->getPropertyValue(OUString::createFromAscii("ReminderDate")); - - OUString aPatchLevel( RTL_CONSTASCII_USTRINGPARAM( "Patch" )); - aPatchLevel += OUString::valueOf( getBuildId(), 10 ); - pset->setPropertyValue(OUString::createFromAscii("ReminderDate"), makeAny(aPatchLevel)); - Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges(); - } catch (const Exception&) - { - } -} - -#ifdef WNT -typedef int ( __stdcall * CleanCurUserRegProc ) ( wchar_t* ); -#endif - -void FirstStartWizard::cleanOldOfficeRegKeys() -{ -#ifdef WNT - // after the wizard is completed clean OOo1.1.x entries in the current user registry if required - // issue i47658 - - OUString aBaseLocationPath; - OUString aSharedLocationPath; - OUString aInstallMode; - - ::utl::Bootstrap::PathStatus aBaseLocateResult = - ::utl::Bootstrap::locateBaseInstallation( aBaseLocationPath ); - ::utl::Bootstrap::PathStatus aSharedLocateResult = - ::utl::Bootstrap::locateSharedData( aSharedLocationPath ); - aInstallMode = ::utl::Bootstrap::getAllUsersValue( ::rtl::OUString() ); - - // TODO: replace the checking for install mode - if ( aBaseLocateResult == ::utl::Bootstrap::PATH_EXISTS && aSharedLocateResult == ::utl::Bootstrap::PATH_EXISTS - && aInstallMode.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "1" ) ) ) ) - { - ::rtl::OUString aDeregCompletePath = - aBaseLocationPath + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/program/regcleanold.dll" ) ); - ::rtl::OUString aExecCompletePath = - aSharedLocationPath + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/regdeinstall/userdeinst.exe" ) ); - - osl::Module aCleanModule( aDeregCompletePath ); - CleanCurUserRegProc pNativeProc = ( CleanCurUserRegProc )( - aCleanModule.getFunctionSymbol( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CleanCurUserOldSystemRegistry" ) ) ) ); - - if( pNativeProc!=NULL ) - { - ::rtl::OUString aExecCompleteSysPath; - if ( osl::File::getSystemPathFromFileURL( aExecCompletePath, aExecCompleteSysPath ) == FileBase::E_None - && aExecCompleteSysPath.getLength() ) - { - ( *pNativeProc )( (wchar_t*)( aExecCompleteSysPath.getStr() ) ); - } - } - } -#endif -} - -void FirstStartWizard::disableWizard() -{ - - try { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - // get configuration provider - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( - xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); - Sequence< Any > theArgs(1); - NamedValue v(OUString::createFromAscii("NodePath"), - makeAny(OUString::createFromAscii("org.openoffice.Setup/Office"))); - theArgs[0] <<= v; - Reference< XPropertySet > pset = Reference< XPropertySet >( - theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); - pset->setPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"), makeAny(sal_True)); - Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges(); - } catch (const Exception&) - { - } - -} - - -void FirstStartWizard::enableQuickstart() -{ - sal_Bool bQuickstart( sal_True ); - sal_Bool bAutostart( sal_True ); - Sequence< Any > aSeq( 2 ); - aSeq[0] <<= bQuickstart; - aSeq[1] <<= bAutostart; - - Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance( - OUString::createFromAscii( "com.sun.star.office.Quickstart" )),UNO_QUERY ); - if ( xQuickstart.is() ) - xQuickstart->initialize( aSeq ); - -} - -sal_Bool FirstStartWizard::showOnlineUpdatePage() -{ - try { - Reference < XNameReplace > xUpdateAccess; - Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - - xUpdateAccess = Reference < XNameReplace >( - xFactory->createInstance( UNISTRING( "com.sun.star.setup.UpdateCheckConfig" ) ), UNO_QUERY_THROW ); - - if ( xUpdateAccess.is() ) - { - sal_Bool bAutoUpdChk = sal_False; - Any result = xUpdateAccess->getByName( UNISTRING( "AutoCheckEnabled" ) ); - result >>= bAutoUpdChk; - if ( bAutoUpdChk == sal_False ) - return sal_True; - else - return sal_False; - } - } catch (const Exception&) - { - } - return sal_False; -} - -} diff --git a/desktop/source/migration/wizard.hrc b/desktop/source/migration/wizard.hrc deleted file mode 100644 index fdad97a8174b..000000000000 --- a/desktop/source/migration/wizard.hrc +++ /dev/null @@ -1,99 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "desktop.hrc" -#include "helpid.hrc" - -#define TP_WIDTH 220 -#define TP_HEIGHT 205 - -#define DLG_FIRSTSTART_WIZARD RID_FIRSTSTSTART_START+1 - // FREE -#define TP_WELCOME RID_FIRSTSTSTART_START+3 -#define TP_REGISTRATION RID_FIRSTSTSTART_START+4 -#define TP_MIGRATION RID_FIRSTSTSTART_START+5 -#define TP_USER RID_FIRSTSTSTART_START+6 -#define TP_LICENSE RID_FIRSTSTSTART_START+7 -#define TP_UPDATE_CHECK RID_FIRSTSTSTART_START+8 -#define ERRBOX_REG_NOSYSBROWSER RID_FIRSTSTSTART_START+29 -#define QB_ASK_DECLINE RID_FIRSTSTSTART_START+30 - -// local resIDs - -#define FT_WELCOME_HEADER 1 -#define FT_WELCOME_BODY 2 -#define FT_LICENSE_HEADER 1 -#define FT_LICENSE_BODY_1 2 -#define FT_LICENSE_BODY_1_TXT 3 -#define FT_LICENSE_BODY_2 4 -#define FT_LICENSE_BODY_2_TXT 5 -#define ML_LICENSE 6 -#define PB_LICENSE_DOWN 7 -#define FT_MIGRATION_HEADER 1 -#define FT_MIGRATION_BODY 2 -#define CB_MIGRATION 3 -#define FT_UPDATE_CHECK_HEADER 1 -#define FT_UPDATE_CHECK_BODY 2 -#define CB_UPDATE_CHECK 3 -#define FT_REGISTRATION_HEADER 1 -#define FT_REGISTRATION_BODY 2 -#define FL_REGISTRATION 3 -#define FT_REGISTRATION_END 4 -#define RB_REGISTRATION_NOW 5 -#define RB_REGISTRATION_LATER 6 -#define RB_REGISTRATION_NEVER 7 -#define RB_REGISTRATION_REG 8 -#define IMG_REGISTRATION 9 -#define FT_USER_HEADER 10 -#define FT_USER_BODY 11 -#define FT_USER_FIRST 12 -#define FT_USER_LAST 13 -#define FT_USER_FATHER 14 -#define FT_USER_INITIALS 15 -#define ED_USER_FIRST 16 -#define ED_USER_LAST 17 -#define ED_USER_FATHER 18 -#define ED_USER_INITIALS 19 -#define TR_WAITING 20 - -// global strings -#define STR_STATE_WELCOME RID_FIRSTSTSTART_START+100 -#define STR_STATE_LICENSE RID_FIRSTSTSTART_START+101 -#define STR_STATE_MIGRATION RID_FIRSTSTSTART_START+102 -#define STR_STATE_REGISTRATION RID_FIRSTSTSTART_START+103 -#define STR_WELCOME_MIGRATION RID_FIRSTSTSTART_START+104 -// FREE RID_FIRSTSTSTART_START+105 -// FREE RID_FIRSTSTSTART_START+106 -#define STR_LICENSE_ACCEPT RID_FIRSTSTSTART_START+107 -#define STR_LICENSE_DECLINE RID_FIRSTSTSTART_START+108 -#define STR_FINISH RID_FIRSTSTSTART_START+109 -#define STR_STATE_USER RID_FIRSTSTSTART_START+110 -// FREE RID_FIRSTSTSTART_START+111 -#define STR_STATE_UPDATE_CHECK RID_FIRSTSTSTART_START+112 -#define STR_WELCOME_WITHOUT_LICENSE RID_FIRSTSTSTART_START+113 -#define STR_REGISTRATION_OOO RID_FIRSTSTSTART_START+114 - diff --git a/desktop/source/migration/wizard.hxx b/desktop/source/migration/wizard.hxx deleted file mode 100644 index 3317880f8bd6..000000000000 --- a/desktop/source/migration/wizard.hxx +++ /dev/null @@ -1,106 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _WIZARD_HXX_ -#define _WIZARD_HXX_ - -#include -#include -#include -#include -#include - -namespace desktop -{ - -class WizardResId : public ResId -{ -public: - WizardResId( USHORT nId ); -}; - -class FirstStartWizard : public svt::RoadmapWizard -{ - -public: - static const WizardState STATE_WELCOME; - static const WizardState STATE_LICENSE; - static const WizardState STATE_MIGRATION; - static const WizardState STATE_USER; - static const WizardState STATE_UPDATE_CHECK; - static const WizardState STATE_REGISTRATION; - - static ResMgr* pResMgr; - static ResMgr* GetResManager(); - - FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAcceptance, const rtl::OUString &rLicensePath ); - - virtual short Execute(); - virtual long PreNotify( NotifyEvent& rNEvt ); - - void DisableButtonsWhileMigration(); - -private: - sal_Bool m_bOverride; - WizardState _currentState; - ::svt::RoadmapWizardTypes::PathId m_aDefaultPath; - ::svt::RoadmapWizardTypes::PathId m_aMigrationPath; - String m_sNext; - String m_sCancel; - sal_Bool m_bDone; - sal_Bool m_bLicenseNeedsAcceptance; - sal_Bool m_bLicenseWasAccepted; - sal_Bool m_bAutomaticUpdChk; - Link m_lnkCancel; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber; - - rtl::OUString m_aLicensePath; - - void storeAcceptDate(); - void setPatchLevel(); - void disableWizard(); - void enableQuickstart(); - - DECL_LINK(DeclineHdl, PushButton*); - - void cleanOldOfficeRegKeys(); - sal_Bool showOnlineUpdatePage(); - ::svt::RoadmapWizardTypes::PathId defineWizardPagesDependingFromContext(); - -protected: - // from svt::WizardMachine - virtual TabPage* createPage(WizardState _nState); - virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason ); - virtual sal_Bool leaveState(WizardState _nState ); - virtual sal_Bool onFinish(); - virtual void enterState(WizardState _nState); - - // from svt::RoadmapWizard - virtual String getStateDisplayName( WizardState _nState ) const; -}; -} -#endif diff --git a/desktop/source/migration/wizard.src b/desktop/source/migration/wizard.src deleted file mode 100644 index 9c1ab5496d39..000000000000 --- a/desktop/source/migration/wizard.src +++ /dev/null @@ -1,424 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - /* - * encoding for resources: windows-1252 - */ - -#include "wizard.hrc" -#include - -ModalDialog DLG_FIRSTSTART_WIZARD -{ - Text [ en-US ] = "Welcome to %PRODUCTNAME %PRODUCTVERSION"; - - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE; - HelpID = HID_FIRSTSTART_DIALOG; -}; - -String STR_STATE_WELCOME -{ - Text [ en-US ] = "Welcome"; -}; -String STR_STATE_LICENSE -{ - Text [ en-US ] = "License Agreement"; -}; -String STR_STATE_MIGRATION -{ - Text [ en-US ] = "Personal Data"; -}; -String STR_STATE_USER -{ - Text [ en-US ] = "User name"; -}; - -String STR_STATE_UPDATE_CHECK -{ - Text [ en-US ] = "Online Update"; -}; - -String STR_STATE_REGISTRATION -{ - Text [ en-US ] = "Registration"; -}; - -String STR_WELCOME_MIGRATION -{ - Text [ en-US ] = "This wizard will guide you through the license agreement, the transfer of user data from %OLD_VERSION and the registration of %PRODUCTNAME.\n\nClick 'Next' to continue."; - -}; - -String STR_WELCOME_WITHOUT_LICENSE -{ - Text [ en-US ] = "This wizard will guide you through the registration of %PRODUCTNAME.\n\nClick 'Next' to continue."; -}; - -String STR_FINISH -{ - Text [ en-US ] = "~Finish"; -}; - -String STR_REGISTRATION_OOO -{ - Text [ en-US ] = "You now have the opportunity to support and contribute to the fastest growing open source community in the world.\n\nHelp us prove that %PRODUCTNAME has already gained significant market share by registering.\n\nRegistering is voluntary and without obligation."; -}; - -ErrorBox ERRBOX_REG_NOSYSBROWSER -{ - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - - Message [ en-US ] = "An error occurred in starting the web browser.\nPlease check the %PRODUCTNAME and web browser settings."; -}; - -QueryBox QB_ASK_DECLINE -{ - Buttons = WB_YES_NO; - DefButton = WB_DEF_NO; - - Message [ en-US ] = "Do you really want to decline?"; -}; - - -#define ROWHEIGHT 8 -#define MARGINLEFT 10 -#define MARGINRIGHT 10 -#define BODYWIDTH TP_WIDTH-MARGINLEFT-MARGINRIGHT -#define MARGINTOP 10 -#define MARGINBOTTOM 2 -#define BODYHEIGHT TP_HEIGHT-MARGINTOP-MARGINBOTTOM -#define INDENT 10 -#define INDENT2 12 - -TabPage TP_WELCOME -{ - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT(TP_WIDTH, TP_HEIGHT); - HelpID = HID_FIRSTSTART_WELCOME; - // bold fixedtext for header - FixedText FT_WELCOME_HEADER - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINRIGHT, MARGINTOP); - Size = MAP_APPFONT( BODYWIDTH, ROWHEIGHT ); - Text [ en-US ] = "Welcome to %PRODUCTNAME %PRODUCTVERSION"; - }; - FixedText FT_WELCOME_BODY - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP + 2*ROWHEIGHT); - Size = MAP_APPFONT( BODYWIDTH, BODYHEIGHT-MARGINTOP - 2*ROWHEIGHT ); - WordBreak = TRUE; - Text [ en-US ] = "This wizard will guide you through the license agreement and the registration of %PRODUCTNAME.\n\nClick 'Next' to continue."; - }; -}; - -TabPage TP_LICENSE -{ - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT(TP_WIDTH, TP_HEIGHT); - HelpID = HID_FIRSTSTART_LICENSE; - FixedText FT_LICENSE_HEADER - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP); - Size = MAP_APPFONT( BODYWIDTH, ROWHEIGHT ); - NoLabel = TRUE; - Text [ en-US ] = "Please follow these steps to accept the license"; - }; - FixedText FT_LICENSE_BODY_1 - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP + 2*ROWHEIGHT); - Size = MAP_APPFONT( INDENT, ROWHEIGHT ); - NoLabel = TRUE; - Text [ en-US ] = "1."; - }; - FixedText FT_LICENSE_BODY_1_TXT - { - Pos = MAP_APPFONT(MARGINLEFT+INDENT, MARGINTOP +2*ROWHEIGHT); - Size = MAP_APPFONT( BODYWIDTH-INDENT, 3*ROWHEIGHT); - WordBreak = TRUE; - NoLabel = TRUE; - Text [ en-US ] = "View the complete License Agreement. Please use the scrollbar or the '%PAGEDOWN' button in this dialog to view the entire license text."; - }; - FixedText FT_LICENSE_BODY_2 - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP + 5*ROWHEIGHT); - Size = MAP_APPFONT(INDENT, ROWHEIGHT ); - NoLabel = TRUE; - Text [ en-US ] = "2."; - }; - FixedText FT_LICENSE_BODY_2_TXT - { - Pos = MAP_APPFONT(MARGINLEFT+INDENT, MARGINTOP + 5*ROWHEIGHT); - Size = MAP_APPFONT( BODYWIDTH-INDENT, 2*ROWHEIGHT); - WordBreak = TRUE; - NoLabel = TRUE; - Text [ en-US ] = "Click 'Accept' to accept the terms of the Agreement."; - }; - MultiLineEdit ML_LICENSE - { - PosSize = MAP_APPFONT (MARGINLEFT+INDENT, MARGINTOP + 8*ROWHEIGHT, BODYWIDTH-INDENT , BODYHEIGHT - 8*ROWHEIGHT - 20-2*MARGINBOTTOM) ; - Border = TRUE; - VScroll = TRUE; - ReadOnly = TRUE; - }; - PushButton PB_LICENSE_DOWN - { - TabStop = TRUE ; - Pos = MAP_APPFONT ( TP_WIDTH-MARGINRIGHT-50 , TP_HEIGHT-MARGINBOTTOM-18 ) ; - Size = MAP_APPFONT ( 50, 15 ) ; - Text [ en-US ] = "Scroll Do~wn"; - }; -}; - -String STR_LICENSE_ACCEPT -{ - Text [ en-US ] = "~Accept"; -}; -String STR_LICENSE_DECLINE -{ - Text [ en-US ] = "~Decline"; -}; - - -TabPage TP_MIGRATION -{ - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT(TP_WIDTH, TP_HEIGHT); - HelpID = HID_FIRSTSTART_MIGRATION; - - FixedText FT_MIGRATION_HEADER - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP); - Size = MAP_APPFONT( BODYWIDTH, ROWHEIGHT ); - Text [ en-US ] = "Transfer personal data"; - - }; - - FixedText FT_MIGRATION_BODY - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*2); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*8); - WordBreak = TRUE; - Text [ en-US ] = "Most personal data from %OLDPRODUCT installation can be reused in %PRODUCTNAME %PRODUCTVERSION.\n\nIf you do not want to reuse any settings in %PRODUCTNAME %PRODUCTVERSION, unmark the check box."; - - }; - - CheckBox CB_MIGRATION - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*10); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*2); - Check = TRUE; - Text [ en-US ] = "Transfer personal data"; - }; -}; - -TabPage TP_UPDATE_CHECK -{ - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT(TP_WIDTH, TP_HEIGHT); - HelpID = HID_FIRSTSTART_UPDATE_CHECK; - - FixedText FT_UPDATE_CHECK_HEADER - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP); - Size = MAP_APPFONT( BODYWIDTH, ROWHEIGHT ); - Text [ en-US ] = "Online Update"; - - }; - - FixedText FT_UPDATE_CHECK_BODY - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*2); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*8); - WordBreak = TRUE; - Text [ en-US ] = "%PRODUCTNAME searches automatically at regular intervals for new versions.\nIn doing so online update does not transfer personal data.\nAs soon as a new version is available, you will be notified.\n\nYou can configure this feature at Tools / Options... / %PRODUCTNAME / Online Update."; - - }; - - CheckBox CB_UPDATE_CHECK - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*10); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*2); - Check = TRUE; - Text [ en-US ] = "~Check for updates automatically"; - }; -}; - -#define USERINDENT 40 -#define EDHEIGHT 12 -#define INITIALSWIDTH 50 -#define FTADD 2 - -TabPage TP_USER -{ - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT(TP_WIDTH, TP_HEIGHT); - HelpID = HID_FIRSTSTART_USER; - - FixedText FT_USER_HEADER - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP); - Size = MAP_APPFONT( BODYWIDTH, ROWHEIGHT ); - Text [ en-US ] = "Provide your full name and initials below"; - - }; - - FixedText FT_USER_BODY - { - NoLabel = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*2); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*3); - WordBreak = TRUE; - Text [ en-US ] = "The user name will be used in the document properties, templates and when you record changes made to documents."; - }; - - - FixedText FT_USER_FIRST - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*7+FTADD); - Size = MAP_APPFONT(USERINDENT, ROWHEIGHT); - Text [ en-US ] = "~First name"; - }; - Edit ED_USER_FIRST - { - Border = TRUE; - Pos = MAP_APPFONT(MARGINLEFT+USERINDENT, MARGINTOP+ROWHEIGHT*7); - Size = MAP_APPFONT(BODYWIDTH-USERINDENT, EDHEIGHT); - }; - FixedText FT_USER_LAST - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*9+FTADD); - Size = MAP_APPFONT(USERINDENT, ROWHEIGHT); - Text [ en-US ] = "~Last name"; - }; - Edit ED_USER_LAST - { - Border = TRUE; - Pos = MAP_APPFONT(MARGINLEFT+USERINDENT, MARGINTOP+ROWHEIGHT*9); - Size = MAP_APPFONT(BODYWIDTH-USERINDENT, EDHEIGHT); - }; - FixedText FT_USER_INITIALS - { - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*11+FTADD); - Size = MAP_APPFONT(USERINDENT, ROWHEIGHT); - Text [ en-US ] = "~Initials"; - }; - Edit ED_USER_INITIALS - { - Border = TRUE; - Pos = MAP_APPFONT(MARGINLEFT+USERINDENT, MARGINTOP+ROWHEIGHT*11); - Size = MAP_APPFONT(INITIALSWIDTH, EDHEIGHT); - }; - - FixedText FT_USER_FATHER - { - Hide = TRUE; - Pos = MAP_APPFONT(MARGINLEFT+USERINDENT+INITIALSWIDTH+10, MARGINTOP+ROWHEIGHT*11+FTADD); - Size = MAP_APPFONT(USERINDENT, ROWHEIGHT); - Text [ en-US ] = "~Father's name"; - }; - Edit ED_USER_FATHER - { - Border = TRUE; - Hide = TRUE; - Pos = MAP_APPFONT(MARGINLEFT+USERINDENT*2+INITIALSWIDTH+10, MARGINTOP+ROWHEIGHT*11); - Size = MAP_APPFONT(BODYWIDTH-10-USERINDENT*2-INITIALSWIDTH, EDHEIGHT); - }; -}; - -#define RB_HEIGHT (RSC_CD_CHECKBOX_HEIGHT+RSC_SP_GRP_SPACE_Y) - -TabPage TP_REGISTRATION -{ - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT(TP_WIDTH, TP_HEIGHT); - HelpID = HID_FIRSTSTART_REGISTRATION; - FixedText FT_REGISTRATION_HEADER - { - NoLabel = TRUE; - Text [ en-US ] = "%PRODUCTNAME Registration"; - Pos = MAP_APPFONT(MARGINLEFT, MARGINRIGHT); - Size = MAP_APPFONT(BODYWIDTH, MARGINRIGHT); - }; - FixedText FT_REGISTRATION_BODY - { - NoLabel = TRUE; - Text [ en-US ] = "You now have the opportunity to register as a %PRODUCTNAME user. Registration is voluntary and is without obligation.\n\nIf you register, we can inform you about new developments concerning this product."; - WordBreak = TRUE; - Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*2); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*8); - }; - RadioButton RB_REGISTRATION_NOW - { - Text [ en-US ] = "I want to register ~now"; - Pos = MAP_APPFONT(MARGINLEFT+INDENT2, ROWHEIGHT*12+2); - Size = MAP_APPFONT(BODYWIDTH-INDENT2, RSC_CD_CHECKBOX_HEIGHT); - Check = TRUE; - }; - RadioButton RB_REGISTRATION_LATER - { - Text [ en-US ] = "I want to register ~later"; - Pos = MAP_APPFONT(MARGINLEFT+INDENT2, ROWHEIGHT*12+2+RB_HEIGHT); - Size = MAP_APPFONT(BODYWIDTH-INDENT2, RSC_CD_CHECKBOX_HEIGHT); - }; - RadioButton RB_REGISTRATION_NEVER - { - Text [ en-US ] = "I do not want to ~register"; - Pos = MAP_APPFONT(MARGINLEFT+INDENT2, ROWHEIGHT*12+2+RB_HEIGHT*2); - Size = MAP_APPFONT(BODYWIDTH-INDENT2, RSC_CD_CHECKBOX_HEIGHT); - }; - FixedLine FL_REGISTRATION - { - Pos = MAP_APPFONT(MARGINLEFT, TP_HEIGHT-MARGINBOTTOM-ROWHEIGHT*6); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT); - }; - FixedText FT_REGISTRATION_END - { - NoLabel = TRUE; - Text [ en-US ] = "We hope you enjoy working with %PRODUCTNAME.\n\nTo exit the wizard, click 'Finish'."; - Pos = MAP_APPFONT(MARGINLEFT, TP_HEIGHT-MARGINBOTTOM-ROWHEIGHT*4); - Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*4); - }; -}; - diff --git a/desktop/source/splash/firststart.cxx b/desktop/source/splash/firststart.cxx deleted file mode 100755 index 21a0a562269a..000000000000 --- a/desktop/source/splash/firststart.cxx +++ /dev/null @@ -1,156 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" - -#include "firststart.hxx" -#include "../migration/wizard.hxx" -#include - -using namespace rtl; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::beans; - -namespace desktop{ - - -const char* FirstStart::interfaces[] = -{ - "com.sun.star.task.XJob", - NULL, -}; -const char* FirstStart::implementationName = "com.sun.star.comp.desktop.FirstStart"; -const char* FirstStart::serviceName = "com.sun.star.task.Job"; - -OUString FirstStart::GetImplementationName() -{ - return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationName)); -} - -Sequence< OUString > FirstStart::GetSupportedServiceNames() -{ - sal_Int32 nSize = (sizeof( interfaces ) / sizeof( const char *)) - 1; - Sequence< OUString > aResult( nSize ); - - for( sal_Int32 i = 0; i < nSize; i++ ) - aResult[i] = OUString::createFromAscii( interfaces[i] ); - return aResult; -} - -Reference< XInterface > SAL_CALL FirstStart::CreateInstance( - const Reference< XMultiServiceFactory >& rSMgr ) -{ - static osl::Mutex aMutex; - osl::MutexGuard guard( aMutex ); - return (XComponent*) ( new FirstStart( rSMgr ) ); -} - -FirstStart::FirstStart( const Reference< XMultiServiceFactory >& xFactory ) : - m_aListeners( m_aMutex ), - m_xServiceManager( xFactory ) -{ -} - -FirstStart::~FirstStart() -{ -} - -// XComponent -void SAL_CALL FirstStart::dispose() throw ( RuntimeException ) -{ - EventObject aObject; - aObject.Source = (XComponent*)this; - m_aListeners.disposeAndClear( aObject ); -} - -void SAL_CALL FirstStart::addEventListener( const Reference< XEventListener > & aListener) throw ( RuntimeException ) -{ - m_aListeners.addInterface( aListener ); -} - -void SAL_CALL FirstStart::removeEventListener( const Reference< XEventListener > & aListener ) throw ( RuntimeException ) -{ - m_aListeners.removeInterface( aListener ); -} - -// XServiceInfo -::rtl::OUString SAL_CALL FirstStart::getImplementationName() -throw ( RuntimeException ) -{ - return FirstStart::GetImplementationName(); -} - -sal_Bool SAL_CALL FirstStart::supportsService( const ::rtl::OUString& rServiceName ) -throw ( RuntimeException ) -{ - sal_Int32 nSize = sizeof( interfaces ) / sizeof( const char *); - - for( sal_Int32 i = 0; i < nSize; i++ ) - if ( rServiceName.equalsAscii( interfaces[i] )) - return sal_True; - return sal_False; -} - -Sequence< ::rtl::OUString > SAL_CALL FirstStart::getSupportedServiceNames() -throw ( RuntimeException ) -{ - return FirstStart::GetSupportedServiceNames(); -} - -// XJob -Any SAL_CALL FirstStart::execute(const Sequence& args) -throw ( RuntimeException ) -{ - static const ::rtl::OUString ARG_LICENSENEEDED( RTL_CONSTASCII_USTRINGPARAM( "LicenseNeedsAcceptance" ) ); - static const ::rtl::OUString ARG_LICENSEPATH( RTL_CONSTASCII_USTRINGPARAM( "LicensePath" ) ); - - ::comphelper::SequenceAsHashMap lArgs(args); - - sal_Bool bLicenseNeeded = lArgs.getUnpackedValueOrDefault( ARG_LICENSENEEDED, (sal_Bool)sal_True ); - rtl::OUString aLicensePath = lArgs.getUnpackedValueOrDefault( ARG_LICENSEPATH, rtl::OUString() ); - - FirstStartWizard fsw( NULL, bLicenseNeeded && ( aLicensePath.getLength() > 0 ), aLicensePath ); - return makeAny( (sal_Bool)fsw.Execute() ); -} - -// XJobExecutor -void SAL_CALL FirstStart::trigger(const OUString&) -throw ( RuntimeException ) -{ - // trigger wizard with override, so it gets started regardless of - // configuration - Sequence seq(1); - seq[0] = NamedValue( - OUString::createFromAscii("Override"), - makeAny(sal_True)); - execute(seq); -} - - -} // namespace desktop diff --git a/desktop/source/splash/firststart.hxx b/desktop/source/splash/firststart.hxx deleted file mode 100755 index fe45833cfae7..000000000000 --- a/desktop/source/splash/firststart.hxx +++ /dev/null @@ -1,90 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SOCOMP_FIRSTSTART_HXX_ -#define _SOCOMP_FIRSTSTART_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::task; - -namespace desktop{ - -class FirstStart : public ::cppu::WeakImplHelper4< XJob, XJobExecutor, XComponent, XServiceInfo > -{ - -private: - ::osl::Mutex m_aMutex; - ::cppu::OInterfaceContainerHelper m_aListeners; - Reference< XMultiServiceFactory > m_xServiceManager; - -public: - FirstStart( const Reference < XMultiServiceFactory >& xFactory ); - virtual ~FirstStart(); - - static ::rtl::OUString GetImplementationName(); - static Sequence< rtl::OUString > GetSupportedServiceNames(); - - - // XComponent - virtual void SAL_CALL dispose() throw ( RuntimeException ); - virtual void SAL_CALL addEventListener( const Reference< XEventListener > & aListener) throw ( RuntimeException ); - virtual void SAL_CALL removeEventListener(const Reference< XEventListener > & aListener) throw ( RuntimeException ); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( RuntimeException ); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw ( RuntimeException ); - virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( RuntimeException ); - - //XJob - virtual Any SAL_CALL execute(const Sequence& args)throw ( RuntimeException ); - //XJobExecutor - virtual void SAL_CALL trigger(const rtl::OUString& arg)throw ( RuntimeException ); - - static const char* interfaces[]; - static const char* implementationName; - static const char* serviceName; - static Reference SAL_CALL CreateInstance( - const Reference< XMultiServiceFactory >&); - - -}; -} - -#endif // _SOCOMP_FIRSTSTART_HXX_ diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk index 89609687438c..ae97a607cc39 100644 --- a/desktop/source/splash/makefile.mk +++ b/desktop/source/splash/makefile.mk @@ -40,13 +40,10 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- SLOFILES = $(SLO)$/splash.obj \ - $(SLO)$/firststart.obj \ $(SLO)$/services_spl.obj SHL1DEPN= makefile.mk SHL1OBJS= $(SLOFILES) \ - $(SLO)$/pages.obj \ - $(SLO)$/wizard.obj \ $(SLO)$/migration.obj \ $(SLO)$/cfgfilter.obj @@ -65,7 +62,7 @@ SHL1STDLIBS= \ $(COMPHELPERLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ - $(UCBHELPERLIB) \ + $(UCBHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(VOSLIB) \ diff --git a/desktop/source/splash/services_spl.cxx b/desktop/source/splash/services_spl.cxx index 349ec2ec0a78..7c2bb1133c68 100755 --- a/desktop/source/splash/services_spl.cxx +++ b/desktop/source/splash/services_spl.cxx @@ -35,7 +35,6 @@ #include #include "splash.hxx" -#include "firststart.hxx" using namespace rtl; @@ -48,14 +47,12 @@ using namespace ::desktop; static const char* pServices[] = { SplashScreen::serviceName, - FirstStart::serviceName, NULL }; static const char* pImplementations[] = { SplashScreen::implementationName, - FirstStart::implementationName, NULL }; @@ -64,7 +61,6 @@ typedef Reference(* fProvider)(const Reference static const fProvider pInstanceProviders[] = { SplashScreen::getInstance, - FirstStart::CreateInstance, NULL }; @@ -72,7 +68,6 @@ static const fProvider pInstanceProviders[] = static const char** pSupportedServices[] = { SplashScreen::interfaces, - FirstStart::interfaces, NULL }; diff --git a/desktop/util/makefile.mk b/desktop/util/makefile.mk index 8cf03f157254..480fee550c46 100644 --- a/desktop/util/makefile.mk +++ b/desktop/util/makefile.mk @@ -71,8 +71,7 @@ LINKFLAGSAPPGUI!:= $(LINKFLAGSAPPGUI:s/-bind_at_load//) RESLIB1NAME= dkt RESLIB1IMAGES= $(PRJ)$/res -RESLIB1SRSFILES= $(SRS)$/desktop.srs \ - $(SRS)$/wizard.srs +RESLIB1SRSFILES= $(SRS)$/desktop.srs .IF "$(L10N_framework)"=="" .IF "$(LINK_SO)"=="TRUE" -- cgit From 09f05507559ad8630cbf7426c0cdafca98d160d3 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Wed, 15 Sep 2010 08:28:44 +0200 Subject: Committing the files for WPG and WPS importer I forgot to commit yesterday --- .../source/config/fragments/filters/MS_Works.xcu | 13 + .../fragments/filters/WordPerfectGraphics.xcu | 13 + .../fragments/types/draw_WordPerfect_Graphics.xcu | 12 + .../fragments/types/writer_MS_Works_Document.xcu | 12 + writerperfect/source/wpgimp/OdgExporter.cxx | 510 +++++++++++++++++++++ writerperfect/source/wpgimp/OdgExporter.hxx | 78 ++++ writerperfect/source/wpgimp/WPGImportFilter.cxx | 302 ++++++++++++ writerperfect/source/wpgimp/WPGImportFilter.hxx | 128 ++++++ writerperfect/source/wpgimp/makefile.mk | 35 ++ .../source/wpgimp/wpgimport_genericfilter.cxx | 101 ++++ writerperfect/source/wpsimp/MSWorksCollector.cxx | 48 ++ writerperfect/source/wpsimp/MSWorksCollector.hxx | 41 ++ .../source/wpsimp/MSWorksImportFilter.cxx | 277 +++++++++++ .../source/wpsimp/MSWorksImportFilter.hxx | 129 ++++++ writerperfect/source/wpsimp/makefile.mk | 29 ++ .../source/wpsimp/msworks_genericfilter.cxx | 101 ++++ 16 files changed, 1829 insertions(+) create mode 100644 filter/source/config/fragments/filters/MS_Works.xcu create mode 100644 filter/source/config/fragments/filters/WordPerfectGraphics.xcu create mode 100644 filter/source/config/fragments/types/draw_WordPerfect_Graphics.xcu create mode 100644 filter/source/config/fragments/types/writer_MS_Works_Document.xcu create mode 100644 writerperfect/source/wpgimp/OdgExporter.cxx create mode 100644 writerperfect/source/wpgimp/OdgExporter.hxx create mode 100644 writerperfect/source/wpgimp/WPGImportFilter.cxx create mode 100644 writerperfect/source/wpgimp/WPGImportFilter.hxx create mode 100644 writerperfect/source/wpgimp/makefile.mk create mode 100644 writerperfect/source/wpgimp/wpgimport_genericfilter.cxx create mode 100644 writerperfect/source/wpsimp/MSWorksCollector.cxx create mode 100644 writerperfect/source/wpsimp/MSWorksCollector.hxx create mode 100644 writerperfect/source/wpsimp/MSWorksImportFilter.cxx create mode 100644 writerperfect/source/wpsimp/MSWorksImportFilter.hxx create mode 100644 writerperfect/source/wpsimp/makefile.mk create mode 100644 writerperfect/source/wpsimp/msworks_genericfilter.cxx diff --git a/filter/source/config/fragments/filters/MS_Works.xcu b/filter/source/config/fragments/filters/MS_Works.xcu new file mode 100644 index 000000000000..29d11f7c63c4 --- /dev/null +++ b/filter/source/config/fragments/filters/MS_Works.xcu @@ -0,0 +1,13 @@ + + IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER + + com.sun.star.comp.Writer.MSWorksImportFilter + WPS + + Microsoft Works Document + + 0 + writer_MS_Works_Document + + com.sun.star.text.TextDocument + diff --git a/filter/source/config/fragments/filters/WordPerfectGraphics.xcu b/filter/source/config/fragments/filters/WordPerfectGraphics.xcu new file mode 100644 index 000000000000..9e5d002cc5bd --- /dev/null +++ b/filter/source/config/fragments/filters/WordPerfectGraphics.xcu @@ -0,0 +1,13 @@ + + IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERRED + + com.sun.star.comp.Draw.WPGImportFilter + + + WordPerfect Graphics + + 0 + draw_WordPerfect_Graphics + + com.sun.star.drawing.DrawingDocument + diff --git a/filter/source/config/fragments/types/draw_WordPerfect_Graphics.xcu b/filter/source/config/fragments/types/draw_WordPerfect_Graphics.xcu new file mode 100644 index 000000000000..4968294c13cf --- /dev/null +++ b/filter/source/config/fragments/types/draw_WordPerfect_Graphics.xcu @@ -0,0 +1,12 @@ + + com.sun.star.comp.Draw.WPGImportFilter + + wpg + image/x-wpg + true + WordPerfect Graphics + + WordPerfect Graphics + + + diff --git a/filter/source/config/fragments/types/writer_MS_Works_Document.xcu b/filter/source/config/fragments/types/writer_MS_Works_Document.xcu new file mode 100644 index 000000000000..0b074d8f4003 --- /dev/null +++ b/filter/source/config/fragments/types/writer_MS_Works_Document.xcu @@ -0,0 +1,12 @@ + + com.sun.star.comp.Writer.MSWorksImportFilter + + wps + + true + MS_Works + + Microsoft Works Document + + + diff --git a/writerperfect/source/wpgimp/OdgExporter.cxx b/writerperfect/source/wpgimp/OdgExporter.cxx new file mode 100644 index 000000000000..d87ce086547d --- /dev/null +++ b/writerperfect/source/wpgimp/OdgExporter.cxx @@ -0,0 +1,510 @@ +/* libwpg + * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org) + * Copyright (C) 2006-2007 Fridrich Strba (fridrich.strba@bluewin.ch) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02111-1301 USA + * + * For further information visit http://libwpg.sourceforge.net + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ + +#include "OdgExporter.hxx" +#include "filter/DocumentElement.hxx" +#include "filter/DocumentHandler.hxx" +#include + + +OdgExporter::OdgExporter(DocumentHandler *pHandler): + mpHandler(pHandler), + m_fillRule(AlternatingFill), + m_gradientIndex(1), + m_dashIndex(1), + m_styleIndex(1) +{ +} + +OdgExporter::~OdgExporter() +{ +} + +void OdgExporter::startDocument(double width, double height) +{ + m_gradientIndex = 1; + m_dashIndex = 1; + m_styleIndex = 1; + + mpHandler->startDocument(); + TagOpenElement tmpOfficeDocumentContent("office:document"); + tmpOfficeDocumentContent.addAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0"); + tmpOfficeDocumentContent.addAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0"); + tmpOfficeDocumentContent.addAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0"); + tmpOfficeDocumentContent.addAttribute("xmlns:draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"); + tmpOfficeDocumentContent.addAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/"); + tmpOfficeDocumentContent.addAttribute("xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"); + tmpOfficeDocumentContent.addAttribute("xmlns:fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"); + tmpOfficeDocumentContent.addAttribute("office:version", "1.0"); + tmpOfficeDocumentContent.write(mpHandler); + + TagOpenElement("office:styles").write(mpHandler); + TagCloseElement("office:styles").write(mpHandler); + + TagOpenElement("office:automatic-styles").write(mpHandler); + + TagOpenElement tmpStylePageLayoutOpenElement("style:page-layout"); + tmpStylePageLayoutOpenElement.addAttribute("style:name", "PM0"); + tmpStylePageLayoutOpenElement.write(mpHandler); + + TagOpenElement tmpStylePageLayoutPropertiesOpenElement("style:page-layout-properties"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-top", "0cm"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-bottom", "0cm"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-left", "0cm"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-right", "0cm"); + WPXString sValue; + sValue = doubleToString(2.54 * width); sValue.append("cm"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-width", sValue); + sValue = doubleToString(2.54 * height); sValue.append("cm"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-height", sValue); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("style:print-orientation", "portrait"); + tmpStylePageLayoutPropertiesOpenElement.write(mpHandler); + + TagCloseElement("style:page-layout-properties").write(mpHandler); + + TagCloseElement("style:page-layout").write(mpHandler); + + TagOpenElement tmpStyleStyleOpenElement("style:style"); + tmpStyleStyleOpenElement.addAttribute("style:name", "dp1"); + tmpStyleStyleOpenElement.addAttribute("style:family", "drawing-page"); + tmpStyleStyleOpenElement.write(mpHandler); + + TagOpenElement tmpStyleDrawingPagePropertiesOpenElement("style:drawing-page-properties"); + tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:background-size", "border"); + tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:fill", "none"); + tmpStyleDrawingPagePropertiesOpenElement.write(mpHandler); + + TagCloseElement("style:drawing-page-properties").write(mpHandler); + + TagCloseElement("style:style").write(mpHandler); +} + +void OdgExporter::endDocument() +{ + TagCloseElement("office:automatic-styles").write(mpHandler); + + TagOpenElement("office:master-styles").write(mpHandler); + + TagOpenElement tmpStyleMasterPageOpenElement("style:master-page"); + tmpStyleMasterPageOpenElement.addAttribute("style:name", "Default"); + tmpStyleMasterPageOpenElement.addAttribute("style:page-layout-name", "PM0"); + tmpStyleMasterPageOpenElement.addAttribute("draw:style-name", "dp1"); + tmpStyleMasterPageOpenElement.write(mpHandler); + + TagCloseElement("style:master-page").write(mpHandler); + + TagCloseElement("office:master-styles").write(mpHandler); + + TagOpenElement("office:body").write(mpHandler); + + TagOpenElement("office:drawing").write(mpHandler); + + TagOpenElement tmpDrawPageOpenElement("draw:page"); + tmpDrawPageOpenElement.addAttribute("draw:name", "page1"); + tmpDrawPageOpenElement.addAttribute("draw:style-name", "dp1"); + tmpDrawPageOpenElement.addAttribute("draw:master-page-name", "Default"); + tmpDrawPageOpenElement.write(mpHandler); + + for (std::vector::const_iterator bodyIter = mpBodyElements.begin(); + bodyIter != mpBodyElements.end(); bodyIter++) + { + (*bodyIter)->write(mpHandler); + } + + TagCloseElement("draw:page").write(mpHandler); + TagCloseElement("office:drawing").write(mpHandler); + TagCloseElement("office:body").write(mpHandler); + TagCloseElement("office:document").write(mpHandler); + + mpHandler->endDocument(); +} + +void OdgExporter::setPen(const libwpg::WPGPen& pen) +{ + m_pen = pen; +} + +void OdgExporter::setBrush(const libwpg::WPGBrush& brush) +{ + m_brush = brush; +} + +void OdgExporter::setFillRule(FillRule rule) +{ + m_fillRule = rule; +} + +void OdgExporter::startLayer(unsigned int /* id */) +{ +} + +void OdgExporter::endLayer(unsigned int) +{ +} + +void OdgExporter::drawRectangle(const libwpg::WPGRect& rect, double rx, double /* ry */) +{ + writeStyle(); + TagOpenElement *pDrawRectElement = new TagOpenElement("draw:rect"); + WPXString sValue; + sValue.sprintf("gr%i", m_styleIndex-1); + pDrawRectElement->addAttribute("draw:style-name", sValue); + sValue = doubleToString(2.54 * rect.x1); sValue.append("cm"); + pDrawRectElement->addAttribute("svg:x", sValue); + sValue = doubleToString(2.54 * rect.y1); sValue.append("cm"); + pDrawRectElement->addAttribute("svg:y", sValue); + sValue = doubleToString(2.54 * (rect.x2-rect.x1)); sValue.append("cm"); + pDrawRectElement->addAttribute("svg:width", sValue); + sValue = doubleToString(2.54 * (rect.y2-rect.y1)); sValue.append("cm"); + pDrawRectElement->addAttribute("svg:height", sValue); + sValue = doubleToString(2.54 * rx); sValue.append("cm"); + // FIXME: what to do when rx != ry ? + pDrawRectElement->addAttribute("draw:corner-radius", sValue); + mpBodyElements.push_back(static_cast(pDrawRectElement)); + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:rect"))); +} + +void OdgExporter::drawEllipse(const libwpg::WPGPoint& center, double rx, double ry) +{ + writeStyle(); + TagOpenElement *pDrawEllipseElement = new TagOpenElement("draw:ellipse"); + WPXString sValue; + sValue.sprintf("gr%i", m_styleIndex-1); + pDrawEllipseElement->addAttribute("draw:style-name", sValue); + sValue = doubleToString(2.54 * (center.x-rx)); sValue.append("cm"); + pDrawEllipseElement->addAttribute("svg:x", sValue); + sValue = doubleToString(2.54 * (center.y-ry)); sValue.append("cm"); + pDrawEllipseElement->addAttribute("svg:y", sValue); + sValue = doubleToString(2 * 2.54 * rx); sValue.append("cm"); + pDrawEllipseElement->addAttribute("svg:width", sValue); + sValue = doubleToString(2 * 2.54 * ry); sValue.append("cm"); + pDrawEllipseElement->addAttribute("svg:height", sValue); + mpBodyElements.push_back(static_cast(pDrawEllipseElement)); + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:ellipse"))); +} + +void OdgExporter::drawPolygon(const libwpg::WPGPointArray& vertices) +{ + if(vertices.count() < 2) + return; + + if(vertices.count() == 2) + { + const libwpg::WPGPoint& p1 = vertices[0]; + const libwpg::WPGPoint& p2 = vertices[1]; + + writeStyle(); + TagOpenElement *pDrawLineElement = new TagOpenElement("draw:line"); + WPXString sValue; + sValue.sprintf("gr%i", m_styleIndex-1); + pDrawLineElement->addAttribute("draw:style-name", sValue); + pDrawLineElement->addAttribute("draw:text-style-name", "P1"); + pDrawLineElement->addAttribute("draw:layer", "layout"); + sValue = doubleToString(2.54 * p1.x); sValue.append("cm"); + pDrawLineElement->addAttribute("svg:x1", sValue); + sValue = doubleToString(2.54 * p1.y); sValue.append("cm"); + pDrawLineElement->addAttribute("svg:y1", sValue); + sValue = doubleToString(2.54 * p2.x); sValue.append("cm"); + pDrawLineElement->addAttribute("svg:x2", sValue); + sValue = doubleToString(2.54 * p2.y); sValue.append("cm"); + pDrawLineElement->addAttribute("svg:y2", sValue); + mpBodyElements.push_back(static_cast(pDrawLineElement)); + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:line"))); + } + else + { + // draw as path + libwpg::WPGPath path; + path.moveTo(vertices[0]); + for(unsigned long ii = 1; ii < vertices.count(); ii++) + path.lineTo(vertices[ii]); + path.closed = true; + drawPath(path); + } +} + +void OdgExporter::drawPath(const libwpg::WPGPath& path) +{ + if(path.count() == 0) + return; + + // try to find the bounding box + // this is simple convex hull technique, the bounding box might not be + // accurate but that should be enough for this purpose + libwpg::WPGPoint p = path.element(0).point; + libwpg::WPGPoint q = path.element(0).point; + for(unsigned k = 0; k < path.count(); k++) + { + libwpg::WPGPathElement element = path.element(k); + p.x = (p.x > element.point.x) ? element.point.x : p.x; + p.y = (p.y > element.point.y) ? element.point.y : p.y; + q.x = (q.x < element.point.x) ? element.point.x : q.x; + q.y = (q.y < element.point.y) ? element.point.y : q.y; + if(element.type == libwpg::WPGPathElement::CurveToElement) + { + p.x = (p.x > element.extra1.x) ? element.extra1.x : p.x; + p.y = (p.y > element.extra1.y) ? element.extra1.y : p.y; + q.x = (q.x < element.extra1.x) ? element.extra1.x : q.x; + q.y = (q.y < element.extra1.y) ? element.extra1.y : q.y; + p.x = (p.x > element.extra2.x) ? element.extra2.x : p.x; + p.y = (p.y > element.extra2.y) ? element.extra2.y : p.y; + q.x = (q.x < element.extra2.x) ? element.extra2.x : q.x; + q.y = (q.y < element.extra2.y) ? element.extra2.y : q.y; + } + } + double vw = q.x - p.x; + double vh = q.y - p.y; + + writeStyle(); + + TagOpenElement *pDrawPathElement = new TagOpenElement("draw:path"); + WPXString sValue; + sValue.sprintf("gr%i", m_styleIndex-1); + pDrawPathElement->addAttribute("draw:style-name", sValue); + pDrawPathElement->addAttribute("draw:text-style-name", "P1"); + pDrawPathElement->addAttribute("draw:layer", "layout"); + sValue = doubleToString(2.54 * p.x); sValue.append("cm"); + pDrawPathElement->addAttribute("svg:x", sValue); + sValue = doubleToString(2.54 * p.y); sValue.append("cm"); + pDrawPathElement->addAttribute("svg:y", sValue); + sValue = doubleToString(2.54 * vw); sValue.append("cm"); + pDrawPathElement->addAttribute("svg:width", sValue); + sValue = doubleToString(2.54 * vh); sValue.append("cm"); + pDrawPathElement->addAttribute("svg:height", sValue); + sValue.sprintf("%i %i %i %i", 0, 0, (int)(vw*2540), (int)(vh*2540)); + pDrawPathElement->addAttribute("svg:viewBox", sValue); + + sValue.clear(); + for(unsigned i = 0; i < path.count(); i++) + { + libwpg::WPGPathElement element = path.element(i); + libwpg::WPGPoint point = element.point; + WPXString sElement; + switch(element.type) + { + // 2540 is 2.54*1000, 2.54 cm = 1 inch + case libwpg::WPGPathElement::MoveToElement: + sElement.sprintf("M%i %i", (int)((point.x-p.x)*2540), (int)((point.y-p.y)*2540)); + break; + + case libwpg::WPGPathElement::LineToElement: + sElement.sprintf("L%i %i", (int)((point.x-p.x)*2540), (int)((point.y-p.y)*2540)); + break; + + case libwpg::WPGPathElement::CurveToElement: + sElement.sprintf("C%i %i %i %i %i %i", (int)((element.extra1.x-p.x)*2540), + (int)((element.extra1.y-p.y)*2540), (int)((element.extra2.x-p.x)*2540), + (int)((element.extra2.y-p.y)*2540), (int)((point.x-p.x)*2540), (int)((point.y-p.y)*2540)); + break; + + default: + break; + } + sValue.append(sElement); + } + if(path.closed) + sValue.append(" Z"); + pDrawPathElement->addAttribute("svg:d", sValue); + mpBodyElements.push_back(static_cast(pDrawPathElement)); + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:path"))); +} + +void OdgExporter::drawBitmap(const libwpg::WPGBitmap& bitmap) +{ + TagOpenElement *pDrawFrameElement = new TagOpenElement("draw:frame"); + WPXString sValue; + sValue = doubleToString(2.54 * bitmap.rect.x1); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:x", sValue); + sValue = doubleToString(2.54 * bitmap.rect.y1); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:y", sValue); + sValue = doubleToString(2.54 * bitmap.rect.height()); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:height", sValue); + sValue = doubleToString(2.54 * bitmap.rect.width()); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:width", sValue); + mpBodyElements.push_back(static_cast(pDrawFrameElement)); + + mpBodyElements.push_back(static_cast(new TagOpenElement("draw:image"))); + + mpBodyElements.push_back(static_cast(new TagOpenElement("office:binary-data"))); + + libwpg::WPGString base64Binary; + bitmap.generateBase64DIB(base64Binary); + mpBodyElements.push_back(static_cast(new CharDataElement(base64Binary.cstr()))); + + mpBodyElements.push_back(static_cast(new TagCloseElement("office:binary-data"))); + + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:image"))); + + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:frame"))); +} + +void OdgExporter::drawImageObject(const libwpg::WPGBinaryData& binaryData) +{ + if (binaryData.mimeType.length() <= 0) + return; + + TagOpenElement *pDrawFrameElement = new TagOpenElement("draw:frame"); + WPXString sValue; + sValue = doubleToString(2.54 * binaryData.rect.x1); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:x", sValue); + sValue = doubleToString(2.54 * binaryData.rect.y1); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:y", sValue); + sValue = doubleToString(2.54 * binaryData.rect.height()); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:height", sValue); + sValue = doubleToString(2.54 * binaryData.rect.width()); sValue.append("cm"); + pDrawFrameElement->addAttribute("svg:width", sValue); + mpBodyElements.push_back(static_cast(pDrawFrameElement)); + + mpBodyElements.push_back(static_cast(new TagOpenElement("draw:image"))); + + mpBodyElements.push_back(static_cast(new TagOpenElement("office:binary-data"))); + + libwpg::WPGString base64Binary = binaryData.getBase64Data();; + mpBodyElements.push_back(static_cast(new CharDataElement(base64Binary.cstr()))); + + mpBodyElements.push_back(static_cast(new TagCloseElement("office:binary-data"))); + + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:image"))); + + mpBodyElements.push_back(static_cast(new TagCloseElement("draw:frame"))); +} + +void OdgExporter::writeStyle() +{ + if(!m_pen.solid && (m_pen.dashArray.count() >=2 ) ) + { + // ODG only supports dashes with the same length of spaces inbetween + // here we take the first space and assume everything else the same + // note that dash length is written in percentage + double distance = m_pen.dashArray.at(1); + TagOpenElement tmpDrawStrokeDashElement("draw:stroke-dash"); + tmpDrawStrokeDashElement.addAttribute("draw:style", "rect"); + WPXString sValue; + sValue.sprintf("Dash_%i", m_dashIndex++); + tmpDrawStrokeDashElement.addAttribute("draw:name", sValue); + sValue.sprintf("%i \%", distance*100); + tmpDrawStrokeDashElement.addAttribute("draw:distance", sValue); + WPXString sName; + for(unsigned i = 0; i < m_pen.dashArray.count()/2; i++) + { + sName.sprintf("draw:dots%i", i+1); + tmpDrawStrokeDashElement.addAttribute(sName.cstr(), "1"); + sName.sprintf("draw:dots%i-length", i+1); + sValue.sprintf("%i\%", 100*m_pen.dashArray.at(i*2)); + tmpDrawStrokeDashElement.addAttribute(sName.cstr(), sValue); + } + tmpDrawStrokeDashElement.write(mpHandler); + TagCloseElement("draw:stroke-dash").write(mpHandler); + } + + if(m_brush.style == libwpg::WPGBrush::Gradient) + { + TagOpenElement tmpDrawGradientElement("draw:gradient"); + tmpDrawGradientElement.addAttribute("draw:style", "linear"); + WPXString sValue; + sValue.sprintf("Gradient_%i", m_gradientIndex++); + tmpDrawGradientElement.addAttribute("draw:name", sValue); + + // ODG angle unit is 0.1 degree + double angle = -m_brush.gradient.angle(); + while(angle < 0) + angle += 360; + while(angle > 360) + angle -= 360; + + sValue.sprintf("%i", angle*10); + tmpDrawGradientElement.addAttribute("draw:angle", sValue); + + libwpg::WPGColor startColor = m_brush.gradient.stopColor(0); + libwpg::WPGColor stopColor = m_brush.gradient.stopColor(1); + sValue.sprintf("#%.2x%.2x%.2x", (startColor.red & 0xff), (startColor.green & 0xff), (startColor.blue & 0xff)); + tmpDrawGradientElement.addAttribute("draw:start-color", sValue); + sValue.sprintf("#%.2x%.2x%.2x", (stopColor.red & 0xff), (stopColor.green & 0xff), (stopColor.blue & 0xff)); + tmpDrawGradientElement.addAttribute("draw:end-color", sValue); + tmpDrawGradientElement.addAttribute("draw:start-intensity", "100%"); + tmpDrawGradientElement.addAttribute("draw:end-intensity", "100%"); + tmpDrawGradientElement.addAttribute("draw:border", "0%"); + tmpDrawGradientElement.write(mpHandler); + TagCloseElement("draw:gradient").write(mpHandler); + } + + TagOpenElement tmpStyleStyleElement("style:style"); + WPXString sValue; + sValue.sprintf("gr%i", m_styleIndex); + tmpStyleStyleElement.addAttribute("style:name", sValue); + tmpStyleStyleElement.addAttribute("style:family", "graphic"); + tmpStyleStyleElement.addAttribute("style:parent-style-name", "standard"); + tmpStyleStyleElement.write(mpHandler); + + TagOpenElement tmpStyleGraphicPropertiesElement("style:graphic-properties"); + + if(m_pen.width > 0.0) + { + sValue = doubleToString(2.54 * m_pen.width); sValue.append("cm"); + tmpStyleGraphicPropertiesElement.addAttribute("svg:stroke-width", sValue); + sValue.sprintf("#%.2x%.2x%.2x", (m_pen.foreColor.red & 0xff), + (m_pen.foreColor.green & 0xff), (m_pen.foreColor.blue & 0xff)); + tmpStyleGraphicPropertiesElement.addAttribute("svg:stroke-color", sValue); + + if(!m_pen.solid) + { + tmpStyleGraphicPropertiesElement.addAttribute("draw:stroke", "dash"); + sValue.sprintf("Dash_%i", m_dashIndex-1); + tmpStyleGraphicPropertiesElement.addAttribute("draw:stroke-dash", sValue); + } + } + else + tmpStyleGraphicPropertiesElement.addAttribute("draw:stroke", "none"); + + if(m_brush.style == libwpg::WPGBrush::NoBrush) + tmpStyleGraphicPropertiesElement.addAttribute("draw:fill", "none"); + + if(m_brush.style == libwpg::WPGBrush::Solid) + { + tmpStyleGraphicPropertiesElement.addAttribute("draw:fill", "solid"); + sValue.sprintf("#%.2x%.2x%.2x", (m_brush.foreColor.red & 0xff), + (m_brush.foreColor.green & 0xff), (m_brush.foreColor.blue & 0xff)); + tmpStyleGraphicPropertiesElement.addAttribute("draw:fill-color", sValue); + } + + if(m_brush.style == libwpg::WPGBrush::Gradient) + { + tmpStyleGraphicPropertiesElement.addAttribute("draw:fill", "gradient"); + sValue.sprintf("Gradient_%i", m_gradientIndex-1); + tmpStyleGraphicPropertiesElement.addAttribute("draw:fill-gradient-name", sValue); + } + + tmpStyleGraphicPropertiesElement.write(mpHandler); + TagCloseElement("style:graphic-properties").write(mpHandler); + + TagCloseElement("style:style").write(mpHandler); + m_styleIndex++; +} + +WPXString OdgExporter::doubleToString(const double value) +{ + return WPXString((char *)::rtl::math::doubleToString(value, rtl_math_StringFormat_F, 4, '.').getStr()); +} diff --git a/writerperfect/source/wpgimp/OdgExporter.hxx b/writerperfect/source/wpgimp/OdgExporter.hxx new file mode 100644 index 000000000000..881acb47b67f --- /dev/null +++ b/writerperfect/source/wpgimp/OdgExporter.hxx @@ -0,0 +1,78 @@ +/* libwpg + * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org) + * Copyright (C) 2007 Fridrich Strba (fridrich_strba@bluewin.ch) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02111-1301 USA + * + * For further information visit http://libwpg.sourceforge.net + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ + +#ifndef __ODGEXPORTER_HXX__ +#define __ODGEXPORTER_HXX__ + +#include +#include +#include + +#include +#include +#include +#include "filter/DocumentElement.hxx" +#include "filter/DocumentHandler.hxx" + +class OdgExporter : public libwpg::WPGPaintInterface { +public: + OdgExporter(DocumentHandler *pHandler); + ~OdgExporter(); + + void startDocument(double width, double height); + void startGraphics(double width, double height) { startDocument(width, height); } + void endDocument(); + void endGraphics() { endDocument(); }; + void startLayer(unsigned int id); + void endLayer(unsigned int id); + + void setPen(const libwpg::WPGPen& pen); + void setBrush(const libwpg::WPGBrush& brush); + void setFillRule(FillRule rule); + + void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry); + void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry); + void drawPolygon(const libwpg::WPGPointArray& vertices); + void drawPath(const libwpg::WPGPath& path); + void drawBitmap(const libwpg::WPGBitmap& bitmap); + void drawImageObject(const libwpg::WPGBinaryData& binaryData); + +private: + std::vector mpBodyElements; + std::vector mpStylesElements; + DocumentHandler *mpHandler; + + libwpg::WPGPen m_pen; + libwpg::WPGBrush m_brush; + FillRule m_fillRule; + int m_gradientIndex; + int m_dashIndex; + int m_styleIndex; + void writeStyle(); + WPXString doubleToString(const double value); +}; + +#endif // __ODGEXPORTER_HXX__ diff --git a/writerperfect/source/wpgimp/WPGImportFilter.cxx b/writerperfect/source/wpgimp/WPGImportFilter.cxx new file mode 100644 index 000000000000..5d890beb845b --- /dev/null +++ b/writerperfect/source/wpgimp/WPGImportFilter.cxx @@ -0,0 +1,302 @@ +/* WPGImportFilter: Sets up the filter, and calls OdgExporter + * to do the actual filtering + * + * Copyright (C) 2000 by Sun Microsystems, Inc. + * Copyright (C) 2002-2004 William Lachance (wlach@interlog.com) + * Copyright (C) 2004 Net Integration Technologies (http://www.net-itech.com) + * Copyright (C) 2004-2006 Fridrich Strba + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Contributor(s): Martin Gallwey (gallwey@sun.com) + * + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "filter/DocumentHandler.hxx" +#include "OdgExporter.hxx" +#include "WPGImportFilter.hxx" +#include "stream/WPXSvStream.h" + +#include + +using namespace ::com::sun::star::uno; +using com::sun::star::uno::Reference; +using com::sun::star::io::XInputStream; +using com::sun::star::io::XSeekable; +using com::sun::star::uno::Sequence; +using namespace ::rtl; +using rtl::OString; +using rtl::OUString; +using com::sun::star::uno::Sequence; +using com::sun::star::uno::Reference; +using com::sun::star::uno::Any; +using com::sun::star::uno::UNO_QUERY; +using com::sun::star::uno::XInterface; +using com::sun::star::uno::Exception; +using com::sun::star::uno::RuntimeException; +using com::sun::star::lang::XMultiServiceFactory; +using com::sun::star::beans::PropertyValue; +using com::sun::star::document::XFilter; +using com::sun::star::document::XExtendedFilterDetection; + +using com::sun::star::io::XInputStream; +using com::sun::star::document::XImporter; +using com::sun::star::xml::sax::InputSource; +using com::sun::star::xml::sax::XAttributeList; +using com::sun::star::xml::sax::XDocumentHandler; +using com::sun::star::xml::sax::XParser; + + +sal_Bool SAL_CALL WPGImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::filter" << std::endl; +#endif + sal_Int32 nLength = aDescriptor.getLength(); + const PropertyValue * pValue = aDescriptor.getConstArray(); + OUString sURL; + Reference < XInputStream > xInputStream; + for ( sal_Int32 i = 0 ; i < nLength; i++) + { + if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) ) + pValue[i].Value >>= xInputStream; + else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) ) + pValue[i].Value >>= sURL; + } + if ( !xInputStream.is() ) + { + OSL_ASSERT( 0 ); + return sal_False; + } + OString sFileName; + sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII); + + // An XML import service: what we push sax messages to.. + OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.XMLOasisImporter" ) ); + Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + + // The XImporter sets up an empty target document for XDocumentHandler to write to.. + Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); + xImporter->setTargetDocument( mxDoc ); + + // OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here + // writes to in-memory target doc + DocumentHandler xHandler(xInternalHandler); + + WPXInputStream* input = new WPXSvInputStream( xInputStream ); + + if (input->isOLEStream()) + { + WPXInputStream* olestream = input->getDocumentOLEStream(); + if (olestream) + { + delete input; + input = olestream; + } + } + + OdgExporter exporter(&xHandler); + bool tmpParseResult = libwpg::WPGraphics::parse(input, &exporter); + if (input) + delete input; + xInputStream->closeInput(); + return tmpParseResult; +} + +void SAL_CALL WPGImportFilter::cancel( ) + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::cancel" << std::endl; +#endif +} + +// XImporter +void SAL_CALL WPGImportFilter::setTargetDocument( const Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::setTargetDocument" << std::endl; +#endif + meType = FILTER_IMPORT; + mxDoc = xDoc; +} + +// XExtendedFilterDetection +OUString SAL_CALL WPGImportFilter::detect( com::sun::star::uno::Sequence< PropertyValue >& Descriptor ) + throw( com::sun::star::uno::RuntimeException ) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::detect" << std::endl; +#endif + OUString sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "" ) ); + sal_Int32 nLength = Descriptor.getLength(); + sal_Int32 location = nLength; + const PropertyValue * pValue = Descriptor.getConstArray(); + Reference < XInputStream > xInputStream; + for ( sal_Int32 i = 0 ; i < nLength; i++) + { + if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TypeName" ) ) ) + location=i; + else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) ) + pValue[i].Value >>= xInputStream; + } + + WPXInputStream* input = new WPXSvInputStream( xInputStream ); + + if (input->isOLEStream()) + { + WPXInputStream* olestream = input->getDocumentOLEStream(); + if (olestream) + { + delete input; + input = olestream; + } + } + + if (libwpg::WPGraphics::isSupported(input)) + sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "draw_WordPerfect_Graphics" ) ); + + if (input) + delete input; + + if (!sTypeName.equalsAscii("")) + { + if ( location == Descriptor.getLength() ) + { + Descriptor.realloc(nLength+1); + Descriptor[location].Name = ::rtl::OUString::createFromAscii( "TypeName" ); + } + + Descriptor[location].Value <<=sTypeName; + } + return sTypeName; +} + + +// XInitialization +void SAL_CALL WPGImportFilter::initialize( const Sequence< Any >& aArguments ) + throw (Exception, RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::initialize" << std::endl; +#endif + Sequence < PropertyValue > aAnySeq; + sal_Int32 nLength = aArguments.getLength(); + if ( nLength && ( aArguments[0] >>= aAnySeq ) ) + { + const PropertyValue * pValue = aAnySeq.getConstArray(); + nLength = aAnySeq.getLength(); + for ( sal_Int32 i = 0 ; i < nLength; i++) + { + if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Type" ) ) ) + { + pValue[i].Value >>= msFilterName; + break; + } + } + } +} +OUString WPGImportFilter_getImplementationName () + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter_getImplementationName" << std::endl; +#endif + return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.WPGImportFilter" ) ); +} + +#define SERVICE_NAME1 "com.sun.star.document.ImportFilter" +#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection" +sal_Bool SAL_CALL WPGImportFilter_supportsService( const OUString& ServiceName ) + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter_supportsService" << std::endl; +#endif + return (ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) || + ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) ) ); +} +Sequence< OUString > SAL_CALL WPGImportFilter_getSupportedServiceNames( ) + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter_getSupportedServiceNames" << std::endl; +#endif + Sequence < OUString > aRet(2); + OUString* pArray = aRet.getArray(); + pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) ); + pArray[1] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) ); + return aRet; +} +#undef SERVICE_NAME2 +#undef SERVICE_NAME1 + +Reference< XInterface > SAL_CALL WPGImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) + throw( Exception ) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter_createInstance" << std::endl; +#endif + return (cppu::OWeakObject*) new WPGImportFilter( rSMgr ); +} + +// XServiceInfo +OUString SAL_CALL WPGImportFilter::getImplementationName( ) + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::getImplementationName" << std::endl; +#endif + return WPGImportFilter_getImplementationName(); +} +sal_Bool SAL_CALL WPGImportFilter::supportsService( const OUString& rServiceName ) + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::supportsService" << std::endl; +#endif + return WPGImportFilter_supportsService( rServiceName ); +} +Sequence< OUString > SAL_CALL WPGImportFilter::getSupportedServiceNames( ) + throw (RuntimeException) +{ +#ifdef DEBUG + std::cerr << "WPGImportFilter::getSupportedServiceNames" << std::endl; +#endif + return WPGImportFilter_getSupportedServiceNames(); +} diff --git a/writerperfect/source/wpgimp/WPGImportFilter.hxx b/writerperfect/source/wpgimp/WPGImportFilter.hxx new file mode 100644 index 000000000000..e200b2b1df5d --- /dev/null +++ b/writerperfect/source/wpgimp/WPGImportFilter.hxx @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2000 by Sun Microsystems, Inc. + * Copyright (C) 2002-2004 William Lachance (wlach@interlog.com) + * Copyright (C) 2004 Net Integration Technologies (http://www.net-itech.com) + * Copyright (C) 2004 Fridrich Strba + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Contributor(s): Martin Gallwey (gallwey@sun.com) + * + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ +#ifndef _WPGIMPORTFILTER_HXX +#define _WPGIMPORTFILTER_HXX + +#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_ +#include +#endif +#ifndef _CPPUHELPER_IMPLBASE5_HXX_ +#include +#endif + +#include + +enum FilterType +{ + FILTER_IMPORT, + FILTER_EXPORT +}; +/* This component will be instantiated for both import or export. Whether it calls + * setSourceDocument or setTargetDocument determines which Impl function the filter + * member calls */ +class WPGImportFilter : public cppu::WeakImplHelper5 +< + com::sun::star::document::XFilter, + com::sun::star::document::XImporter, + com::sun::star::document::XExtendedFilterDetection, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +{ +protected: + // oo.org declares + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc; + ::rtl::OUString msFilterName; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; + + FilterType meType; + +public: + WPGImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF) + : mxMSF( rxMSF ) {} + virtual ~WPGImportFilter() {} + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XImporter + virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + //XExtendedFilterDetection + virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor ) + throw( com::sun::star::uno::RuntimeException ); + + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (::com::sun::star::uno::RuntimeException); + +}; + +::rtl::OUString WPGImportFilter_getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL WPGImportFilter_supportsService( const ::rtl::OUString& ServiceName ) + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL WPGImportFilter_getSupportedServiceNames( ) + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > +SAL_CALL WPGImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( ::com::sun::star::uno::Exception ); + +#endif diff --git a/writerperfect/source/wpgimp/makefile.mk b/writerperfect/source/wpgimp/makefile.mk new file mode 100644 index 000000000000..3bb58c112af4 --- /dev/null +++ b/writerperfect/source/wpgimp/makefile.mk @@ -0,0 +1,35 @@ +PRJ=..$/.. + +PRJNAME=writerperfect +TARGET=wpgimp +ENABLE_EXCEPTIONS=true + +.INCLUDE : settings.mk + +.IF "$(SYSTEM_LIBWPD)" == "YES" +INCPRE+=$(LIBWPD_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd +.ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwps +.ENDIF + +.IF "$(SYSTEM_LIBWPG)" == "YES" +INCPRE+=$(LIBWPG_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpg +.ENDIF + +# broken but ... necessary, internal include shafted ... +INCPRE+= -I.. + +SLOFILES= \ + $(SLO)$/OdgExporter.obj \ + $(SLO)$/WPGImportFilter.obj \ + $(SLO)$/wpgimport_genericfilter.obj + +.INCLUDE : target.mk diff --git a/writerperfect/source/wpgimp/wpgimport_genericfilter.cxx b/writerperfect/source/wpgimp/wpgimport_genericfilter.cxx new file mode 100644 index 000000000000..4666abd5d6d1 --- /dev/null +++ b/writerperfect/source/wpgimp/wpgimport_genericfilter.cxx @@ -0,0 +1,101 @@ +/* genericfilter: mostly generic code for registering the filter + * + * Portions of this code Copyright 2000 by Sun Microsystems, Inc. + * Rest is Copyright (C) 2002 William Lachance (wlach@interlog.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ +#include + +#include +#include +#include + +#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_ +#include +#endif + +#include "WPGImportFilter.hxx" + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::registry; + +extern "C" +{ +//================================================================================================== +void SAL_CALL component_getImplementationEnvironment( + const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} +//================================================================================================== +sal_Bool SAL_CALL component_writeInfo( + void * /* pServiceManager */, void * pRegistryKey ) +{ + if (pRegistryKey) + { + try + { + sal_Int32 nPos = 0; + Reference< XRegistryKey > xNewKey( + reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( WPGImportFilter_getImplementationName() ) ); + xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); + + const Sequence< OUString > & rSNL = WPGImportFilter_getSupportedServiceNames(); + const OUString * pArray = rSNL.getConstArray(); + for ( nPos = rSNL.getLength(); nPos--; ) + xNewKey->createKey( pArray[nPos] ); + + return sal_True; + } + catch (InvalidRegistryException &) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); + } + } + return sal_False; +} +//================================================================================================== +void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) +{ + void * pRet = 0; + + OUString implName = OUString::createFromAscii( pImplName ); + if ( pServiceManager && implName.equals(WPGImportFilter_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + WPGImportFilter_createInstance, WPGImportFilter_getSupportedServiceNames() ) ); + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + return pRet; +} +} diff --git a/writerperfect/source/wpsimp/MSWorksCollector.cxx b/writerperfect/source/wpsimp/MSWorksCollector.cxx new file mode 100644 index 000000000000..f562365a7941 --- /dev/null +++ b/writerperfect/source/wpsimp/MSWorksCollector.cxx @@ -0,0 +1,48 @@ +/* MSWorksCollector: Collects sections and runs of text from a + * wordperfect file (and styles to go along with them) and writes them + * to a Writer target document + * + * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For further information visit http://libwpd.sourceforge.net + * + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ + +#include "MSWorksCollector.hxx" +#include + +MSWorksCollector::MSWorksCollector(WPSInputStream *pInput, DocumentHandler *pHandler) : + DocumentCollector(pInput, pHandler) +{ +} + +MSWorksCollector::~MSWorksCollector() +{ +} + +bool MSWorksCollector::parseSourceDocument(WPSInputStream &input) +{ + WPSResult result = WPSDocument::parse(&input, static_cast(this)); + if (result != WPS_OK) + return false; + + return true; +} diff --git a/writerperfect/source/wpsimp/MSWorksCollector.hxx b/writerperfect/source/wpsimp/MSWorksCollector.hxx new file mode 100644 index 000000000000..3b137c41f697 --- /dev/null +++ b/writerperfect/source/wpsimp/MSWorksCollector.hxx @@ -0,0 +1,41 @@ +/* MSWorksCollector: Collects sections and runs of text from a + * wordperfect file (and styles to go along with them) and writes them + * to a Writer target document + * + * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For further information visit http://libwpd.sourceforge.net + * + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ + +#ifndef _MSWORKSCOLLECTOR_HXX +#define _MSWORKSCOLLECTOR_HXX + +#include "filter/DocumentCollector.hxx" + +class MSWorksCollector : public DocumentCollector +{ +public: + MSWorksCollector(WPSInputStream *pInput, DocumentHandler *pHandler); + virtual ~MSWorksCollector(); + bool parseSourceDocument(WPSInputStream &input); +}; +#endif diff --git a/writerperfect/source/wpsimp/MSWorksImportFilter.cxx b/writerperfect/source/wpsimp/MSWorksImportFilter.cxx new file mode 100644 index 000000000000..eed5f00280bf --- /dev/null +++ b/writerperfect/source/wpsimp/MSWorksImportFilter.cxx @@ -0,0 +1,277 @@ +/* MSWorksImportFilter: Sets up the filter, and calls DocumentCollector + * to do the actual filtering + * + * Copyright (C) 2000 by Sun Microsystems, Inc. + * Copyright (C) 2002-2004 William Lachance (wlach@interlog.com) + * Copyright (C) 2004 Net Integration Technologies (http://www.net-itech.com) + * Copyright (C) 2004 Fridrich Strba + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Contributor(s): Martin Gallwey (gallwey@sun.com) + * + */ +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "filter/FilterInternal.hxx" +#include "filter/DocumentHandler.hxx" +#include "filter/DocumentCollector.hxx" +#include "stream/WPXSvStream.h" + +#include +#include "MSWorksImportFilter.hxx" +#include "MSWorksCollector.hxx" + +// using namespace ::rtl; +using rtl::OString; +using rtl::OUString; +using com::sun::star::uno::Sequence; +using com::sun::star::uno::Reference; +using com::sun::star::uno::Any; +using com::sun::star::uno::UNO_QUERY; +using com::sun::star::uno::XInterface; +using com::sun::star::uno::Exception; +using com::sun::star::uno::RuntimeException; +using com::sun::star::lang::XMultiServiceFactory; +using com::sun::star::beans::PropertyValue; +using com::sun::star::document::XFilter; +using com::sun::star::document::XExtendedFilterDetection; +using com::sun::star::ucb::XCommandEnvironment; + +using com::sun::star::io::XInputStream; +using com::sun::star::document::XImporter; +using com::sun::star::xml::sax::InputSource; +using com::sun::star::xml::sax::XAttributeList; +using com::sun::star::xml::sax::XDocumentHandler; +using com::sun::star::xml::sax::XParser; + +void callHandler(Reference < XDocumentHandler > xDocHandler); + +sal_Bool SAL_CALL MSWorksImportFilter::importImpl( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (RuntimeException) +{ + WRITER_DEBUG_MSG(("MSWorksImportFilter::importImpl: Got here!\n")); + + sal_Int32 nLength = aDescriptor.getLength(); + const PropertyValue * pValue = aDescriptor.getConstArray(); + OUString sURL; + Reference < XInputStream > xInputStream; + for ( sal_Int32 i = 0 ; i < nLength; i++) + { + if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) ) + pValue[i].Value >>= xInputStream; + else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) ) + pValue[i].Value >>= sURL; + } + if ( !xInputStream.is() ) + { + OSL_ASSERT( 0 ); + return sal_False; + } + OString sFileName; + sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII); + + // An XML import service: what we push sax messages to.. + OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.XMLImporter" ) ); + Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY ); + + // The XImporter sets up an empty target document for XDocumentHandler to write to.. + Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY); + xImporter->setTargetDocument(mxDoc); + + // OO Document Handler: abstract class to handle document SAX messages, concrete implementation here + // writes to in-memory target doc + DocumentHandler xHandler(xInternalHandler); + + WPXSvInputStream input( xInputStream ); + + MSWorksCollector collector(&input, &xHandler); + collector.filter(); + + return true; +} + +sal_Bool SAL_CALL MSWorksImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (RuntimeException) +{ + WRITER_DEBUG_MSG(("MSWorksImportFilter::filter: Got here!\n")); + return importImpl ( aDescriptor ); +} +void SAL_CALL MSWorksImportFilter::cancel( ) + throw (RuntimeException) +{ + WRITER_DEBUG_MSG(("MSWorksImportFilter::cancel: Got here!\n")); +} + +// XImporter +void SAL_CALL MSWorksImportFilter::setTargetDocument( const Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException) +{ + WRITER_DEBUG_MSG(("MSWorksImportFilter::getTargetDocument: Got here!\n")); + meType = FILTER_IMPORT; + mxDoc = xDoc; +} + +// XExtendedFilterDetection +OUString SAL_CALL MSWorksImportFilter::detect( com::sun::star::uno::Sequence< PropertyValue >& Descriptor ) + throw( com::sun::star::uno::RuntimeException ) +{ + WRITER_DEBUG_MSG(("MSWorksImportFilter::detect: Got here!\n")); + + WPSConfidence confidence = WPS_CONFIDENCE_NONE; + OUString sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "" ) ); + sal_Int32 nLength = Descriptor.getLength(); + sal_Int32 location = nLength; + OUString sURL; + const PropertyValue * pValue = Descriptor.getConstArray(); + Reference < XInputStream > xInputStream; + for ( sal_Int32 i = 0 ; i < nLength; i++) + { + if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "TypeName" ) ) ) + location=i; + else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) ) + pValue[i].Value >>= xInputStream; + else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "URL" ) ) ) + pValue[i].Value >>= sURL; + } + + Reference< com::sun::star::ucb::XCommandEnvironment > xEnv; + if (!xInputStream.is()) + { + try + { + ::ucbhelper::Content aContent(sURL, xEnv); + xInputStream = aContent.openStream(); + } + catch ( ... ) + { + return ::rtl::OUString(); + } + + if (!xInputStream.is()) + return ::rtl::OUString(); + } + + WPXSvInputStream input( xInputStream ); + + if (input.atEOS()) + return ::rtl::OUString(); + + confidence = WPSDocument::isFileFormatSupported(&input, false); + + if ((confidence == WPS_CONFIDENCE_EXCELLENT) || (confidence == WPS_CONFIDENCE_GOOD)) + sTypeName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer_MS_Works_Document" ) ); + + if (sTypeName.getLength()) + { + if ( location == Descriptor.getLength() ) + { + Descriptor.realloc(nLength+1); + Descriptor[location].Name = ::rtl::OUString::createFromAscii( "TypeName" ); + } + + Descriptor[location].Value <<=sTypeName; + } + + return sTypeName; +} + + +// XInitialization +void SAL_CALL MSWorksImportFilter::initialize( const Sequence< Any >& aArguments ) + throw (Exception, RuntimeException) +{ + WRITER_DEBUG_MSG(("MSWorksImportFilter::initialize: Got here!\n")); + Sequence < PropertyValue > aAnySeq; + sal_Int32 nLength = aArguments.getLength(); + if ( nLength && ( aArguments[0] >>= aAnySeq ) ) + { + const PropertyValue * pValue = aAnySeq.getConstArray(); + nLength = aAnySeq.getLength(); + for ( sal_Int32 i = 0 ; i < nLength; i++) + { + if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Type" ) ) ) + { + pValue[i].Value >>= msFilterName; + break; + } + } + } +} +OUString MSWorksImportFilter_getImplementationName () + throw (RuntimeException) +{ + return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.MSWorksImportFilter" ) ); +} + +#define SERVICE_NAME1 "com.sun.star.document.ImportFilter" +#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection" +sal_Bool SAL_CALL MSWorksImportFilter_supportsService( const OUString& ServiceName ) + throw (RuntimeException) +{ + return (ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) || + ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) ) ); +} +Sequence< OUString > SAL_CALL MSWorksImportFilter_getSupportedServiceNames( ) + throw (RuntimeException) +{ + Sequence < OUString > aRet(2); + OUString* pArray = aRet.getArray(); + pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) ); + pArray[1] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) ); + return aRet; +} +#undef SERVICE_NAME2 +#undef SERVICE_NAME1 + +Reference< XInterface > SAL_CALL MSWorksImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) + throw( Exception ) +{ + return (cppu::OWeakObject*) new MSWorksImportFilter( rSMgr ); +} + +// XServiceInfo +OUString SAL_CALL MSWorksImportFilter::getImplementationName( ) + throw (RuntimeException) +{ + return MSWorksImportFilter_getImplementationName(); +} +sal_Bool SAL_CALL MSWorksImportFilter::supportsService( const OUString& rServiceName ) + throw (RuntimeException) +{ + return MSWorksImportFilter_supportsService( rServiceName ); +} +Sequence< OUString > SAL_CALL MSWorksImportFilter::getSupportedServiceNames( ) + throw (RuntimeException) +{ + return MSWorksImportFilter_getSupportedServiceNames(); +} diff --git a/writerperfect/source/wpsimp/MSWorksImportFilter.hxx b/writerperfect/source/wpsimp/MSWorksImportFilter.hxx new file mode 100644 index 000000000000..aca9b18817da --- /dev/null +++ b/writerperfect/source/wpsimp/MSWorksImportFilter.hxx @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2000 by Sun Microsystems, Inc. + * Copyright (C) 2002-2004 William Lachance (wlach@interlog.com) + * Copyright (C) 2004 Net Integration Technologies (http://www.net-itech.com) + * Copyright (C) 2004 Fridrich Strba + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Contributor(s): Martin Gallwey (gallwey@sun.com) + * + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ +#ifndef _WORDPERFECTIMPORTFILTER_HXX +#define _WORDPERFECTIMPORTFILTER_HXX + +#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include +#endif +#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_ +#include +#endif +#ifndef _CPPUHELPER_IMPLBASE5_HXX_ +#include +#endif + +enum FilterType +{ + FILTER_IMPORT, + FILTER_EXPORT +}; +/* This component will be instantiated for both import or export. Whether it calls + * setSourceDocument or setTargetDocument determines which Impl function the filter + * member calls */ +class MSWorksImportFilter : public cppu::WeakImplHelper5 +< + com::sun::star::document::XFilter, + com::sun::star::document::XImporter, + com::sun::star::document::XExtendedFilterDetection, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +{ +protected: + // oo.org declares + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc; + ::rtl::OUString msFilterName; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; + + FilterType meType; + + sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + +public: + MSWorksImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF) + : mxMSF( rxMSF ) {} + virtual ~MSWorksImportFilter() {} + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XImporter + virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + //XExtendedFilterDetection + virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor ) + throw( com::sun::star::uno::RuntimeException ); + + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (::com::sun::star::uno::RuntimeException); + +}; + +::rtl::OUString MSWorksImportFilter_getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL MSWorksImportFilter_supportsService( const ::rtl::OUString& ServiceName ) + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL MSWorksImportFilter_getSupportedServiceNames( ) + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > +SAL_CALL MSWorksImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( ::com::sun::star::uno::Exception ); + +#endif diff --git a/writerperfect/source/wpsimp/makefile.mk b/writerperfect/source/wpsimp/makefile.mk new file mode 100644 index 000000000000..da17e806f9b0 --- /dev/null +++ b/writerperfect/source/wpsimp/makefile.mk @@ -0,0 +1,29 @@ +PRJ=..$/.. + +PRJNAME=writerperfect +TARGET=wpsimp +ENABLE_EXCEPTIONS=true + +.INCLUDE : settings.mk + +.IF "$(SYSTEM_LIBWPD)" == "YES" +INCPRE+=$(LIBWPD_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd +.ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwps +.ENDIF + +# broken but ... necessary, internal include shafted ... +INCPRE+= -I.. + +SLOFILES= \ + $(SLO)$/MSWorksCollector.obj \ + $(SLO)$/MSWorksImportFilter.obj \ + $(SLO)$/msworks_genericfilter.obj + +.INCLUDE : target.mk diff --git a/writerperfect/source/wpsimp/msworks_genericfilter.cxx b/writerperfect/source/wpsimp/msworks_genericfilter.cxx new file mode 100644 index 000000000000..f77b9c2bbb47 --- /dev/null +++ b/writerperfect/source/wpsimp/msworks_genericfilter.cxx @@ -0,0 +1,101 @@ +/* genericfilter: mostly generic code for registering the filter + * + * Portions of this code Copyright 2000 by Sun Microsystems, Inc. + * Rest is Copyright (C) 2002 William Lachance (wlach@interlog.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +/* "This product is not manufactured, approved, or supported by + * Corel Corporation or Corel Corporation Limited." + */ +#include + +#include +#include +#include + +#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_ +#include +#endif + +#include "MSWorksImportFilter.hxx" + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::registry; + +extern "C" +{ +//================================================================================================== +void SAL_CALL component_getImplementationEnvironment( + const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} +//================================================================================================== +sal_Bool SAL_CALL component_writeInfo( + void * /* pServiceManager */, void * pRegistryKey ) +{ + if (pRegistryKey) + { + try + { + sal_Int32 nPos = 0; + Reference< XRegistryKey > xNewKey( + reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( MSWorksImportFilter_getImplementationName() ) ); + xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) ); + + const Sequence< OUString > & rSNL = MSWorksImportFilter_getSupportedServiceNames(); + const OUString * pArray = rSNL.getConstArray(); + for ( nPos = rSNL.getLength(); nPos--; ) + xNewKey->createKey( pArray[nPos] ); + + return sal_True; + } + catch (InvalidRegistryException &) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); + } + } + return sal_False; +} +//================================================================================================== +void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) +{ + void * pRet = 0; + + OUString implName = OUString::createFromAscii( pImplName ); + if ( pServiceManager && implName.equals(MSWorksImportFilter_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + MSWorksImportFilter_createInstance, MSWorksImportFilter_getSupportedServiceNames() ) ); + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + return pRet; +} +} -- cgit From 8e2479923515094206b331d67bf3ac07e5e51106 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Sep 2010 08:43:41 +0200 Subject: Commit missing files in setup_native/source/win32/customactions/sellang/ --- .../source/win32/customactions/sellang/exports.dxp | 1 + .../source/win32/customactions/sellang/makefile.mk | 79 +++++ .../source/win32/customactions/sellang/sellang.cxx | 347 +++++++++++++++++++++ 3 files changed, 427 insertions(+) create mode 100644 setup_native/source/win32/customactions/sellang/exports.dxp create mode 100644 setup_native/source/win32/customactions/sellang/makefile.mk create mode 100644 setup_native/source/win32/customactions/sellang/sellang.cxx diff --git a/setup_native/source/win32/customactions/sellang/exports.dxp b/setup_native/source/win32/customactions/sellang/exports.dxp new file mode 100644 index 000000000000..cc6dd8d32e47 --- /dev/null +++ b/setup_native/source/win32/customactions/sellang/exports.dxp @@ -0,0 +1 @@ +SelectLanguage diff --git a/setup_native/source/win32/customactions/sellang/makefile.mk b/setup_native/source/win32/customactions/sellang/makefile.mk new file mode 100644 index 000000000000..e2110ce708c9 --- /dev/null +++ b/setup_native/source/win32/customactions/sellang/makefile.mk @@ -0,0 +1,79 @@ +#************************************************************************* +# +# OpenOffice.org - a multi-platform office productivity suite +# +# The Contents of this file are made available subject to +# the terms of GNU Lesser General Public License Version 3. +# +# +# GNU Lesser General Public License Version 3 +# ============================================= +# Copyright 2005 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +#************************************************************************* + +PRJ=..$/..$/..$/.. +PRJNAME=setup_native +TARGET=sellangmsi + +.IF "$(GUI)"=="WNT" + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=TRUE +NO_DEFAULT_STL=TRUE +DYNAMIC_CRT= +USE_DEFFILE=TRUE + +.INCLUDE : settings.mk + +CFLAGS+=-D_STLP_USE_STATIC_LIB + +# --- Files -------------------------------------------------------- + +UWINAPILIB= + +SLOFILES = \ + $(SLO)$/sellang.obj + +SHL1STDLIBS= kernel32.lib\ + user32.lib\ + advapi32.lib\ + shell32.lib\ + msi.lib\ + $(LIBSTLPORTST) + +SHL1LIBS = $(SLB)$/$(TARGET).lib + +SHL1TARGET = $(TARGET) +SHL1IMPLIB = i$(TARGET) + +SHL1DEF = $(MISC)$/$(SHL1TARGET).def +SHL1DEPN = $(SLB)$/$(TARGET).lib +SHL1BASE = 0x1c000000 +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=exports.dxp + +# --- Targets -------------------------------------------------------------- + +.INCLUDE : target.mk + +# ------------------------------------------------------------------------- + + +.ENDIF diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx new file mode 100644 index 000000000000..365ddcafb058 --- /dev/null +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -0,0 +1,347 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + * + * GNU Lesser General Public License Version 3 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#define WIN32_LEAN_AND_MEAN +#define _WIN32_WINNT 0x0500 +#undef WINVER +#define WINVER 0x0500 + +#pragma warning(push, 1) /* disable warnings within system headers as + * warnings are now treated as errors... + */ +#include +#include +#include + +#ifdef UNICODE +#define _UNICODE +#define _tstring wstring +#else +#define _tstring string +#endif +#include +#include +#include +#pragma warning(pop) + +#include + +/* #define VERBOSE_DEBUG_OUTPUT 1 */ + +static const char * +langid_to_string( LANGID langid, int *have_default_lang ) +{ + /* Map from LANGID to string. The languages below are in the same + * seemingly random order as in + * setup_native/source/win32/msi-encodinglist.txt. + * Only the language part is returned in the string. + */ + switch (PRIMARYLANGID (langid)) { + case LANG_ENGLISH: + if (have_default_lang != NULL && + langid == MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)) + *have_default_lang = 1; + return "en"; +#define CASE(primary, name) \ + case LANG_##primary: return #name + CASE(PORTUGUESE, pt); + CASE(RUSSIAN, ru); + CASE(GREEK, el); + CASE(DUTCH, nl); + CASE(FRENCH, fr); + CASE(SPANISH, es); + CASE(FINNISH, fi); + CASE(HUNGARIAN, hu); + CASE(CATALAN, ca); + CASE(ITALIAN, it); + CASE(CZECH, cs); + CASE(SLOVAK, sk); + CASE(DANISH, da); + CASE(SWEDISH, sv); + CASE(POLISH, pl); + CASE(GERMAN, de); + CASE(THAI, th); + CASE(ESTONIAN, et); + CASE(JAPANESE, ja); + CASE(KOREAN, ko); + // CASE(KHMER, km); + // CASE(WELSH, cy); + CASE(CHINESE, zh); + CASE(TURKISH, tr); + CASE(HINDI, hi); + CASE(PUNJABI, pa); + CASE(TAMIL, ta); + CASE(ARABIC, ar); + CASE(HEBREW, he); + CASE(AFRIKAANS, af); + CASE(ALBANIAN, sq); + CASE(ARMENIAN, hy); + CASE(BASQUE, eu); + CASE(BELARUSIAN, be); + CASE(BENGALI, bn); + CASE(BULGARIAN, bg); + CASE(ICELANDIC, is); + CASE(INDONESIAN, id); + // CASE(LAO, lo); + CASE(LATVIAN, lv); + CASE(LITHUANIAN, lt); + // CASE(MALTESE, mt); + // CASE(ROMANSH, rm); + CASE(ROMANIAN, ro); + // CASE(KINYARWANDA, rw); + CASE(SANSKRIT, sa); + // CASE(SETSWANA, tn); + CASE(FARSI, fa); + CASE(FAEROESE, fo); + CASE(SLOVENIAN, sl); + // CASE(SORBIAN, sb); + // CASE(SUTU, st); + CASE(SWAHILI, sw); + CASE(TATAR, tt); + // CASE(TSONGA, ts); + CASE(UKRAINIAN, uk); + CASE(URDU, ur); + CASE(VIETNAMESE, vi); + // CASE(XHOSA, xh); + // CASE(YIDDISH, yi); + // CASE(ZULU, zu); + CASE(GUJARATI, gu); + // CASE(BRETON, br); + CASE(NEPALI, ne); + // CASE(NDEBELE, nr); + // CASE(SWAZI, ss); + // CASE(VENDA, ve); + // CASE(IRISH, ga); + CASE(MACEDONIAN, mk); + CASE(TELUGU, te); + CASE(MALAYALAM, ml); + CASE(MARATHI, mr); + CASE(ORIYA, or); + // CASE(KURDISH, ku); + // CASE(TAGALOG, tg); + // CASE(TIGRINYA, ti); + CASE(GALICIAN, gl); + CASE(KANNADA, kn); + CASE(MALAY, ms); + // CASE(TAJIK, tg); + CASE(GEORGIAN, ka); + // CASE(ESPERANTO, eo); +#undef CASE + /* Special cases */ + default: + switch (langid) { + case MAKELANGID(LANG_SERBIAN, 0x05): return "bs"; +#define CASE(primary, sub, name) \ + case MAKELANGID(LANG_##primary, SUBLANG_##sub): return #name + + CASE(NORWEGIAN, NORWEGIAN_BOKMAL, nb); + CASE(NORWEGIAN, NORWEGIAN_NYNORSK, nn); + CASE(SERBIAN, DEFAULT, hr); + CASE(SERBIAN, SERBIAN_LATIN, sh); + CASE(SERBIAN, SERBIAN_CYRILLIC, sr); + // CASE(SOTHO, DEFAULT, ns); + // CASE(SOTHO, SOTHO_SOUTHERN, st); +#undef CASE + default: return ""; + } + } +} + +static const char *ui_langs[100]; +static int num_ui_langs = 0; + +BOOL CALLBACK +enum_ui_lang_proc (LPTSTR language, LONG_PTR /* unused_lParam */) +{ + long langid = strtol(language, NULL, 16); + if (langid > 0xFFFF) + return TRUE; + ui_langs[num_ui_langs] = langid_to_string((LANGID) langid, NULL); + num_ui_langs++; + if (num_ui_langs == sizeof(ui_langs) / sizeof(ui_langs[0])) + return FALSE; + return TRUE; +} + +static BOOL +present_in_ui_langs(const char *lang) +{ + for (int i = 0; i < num_ui_langs; i++) + if (memcmp (ui_langs[i], lang, 2) == 0) + return TRUE; + return FALSE; +} + +extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle ) +{ +#ifdef VERBOSE_DEBUG_OUTPUT + char tem[2000]; +#endif + char feature[100]; + MSIHANDLE database, view, record; + DWORD length; + int nlangs = 0; + /* Keeping this code simple and stupid... won't bother with any + * dynamic arrays or whatnot. 100 is more than enough for this purpose. + */ + char langs[100][6]; + + database = MsiGetActiveDatabase(handle); + + if (MsiDatabaseOpenViewA(database, "SELECT Feature from Feature WHERE Feature_Parent = 'gm_Langpack_Languageroot'", &view) != ERROR_SUCCESS) { + MsiCloseHandle(database); + return ERROR_SUCCESS; + } + +#ifdef VERBOSE_DEBUG_OUTPUT + MessageBoxA(NULL, "MsiDatabaseOpenViewA success!", "SelectLanguage", MB_OK); +#endif + + if (MsiViewExecute(view, NULL) != ERROR_SUCCESS) { + MsiCloseHandle(view); + MsiCloseHandle(database); + return ERROR_SUCCESS; + } + +#ifdef VERBOSE_DEBUG_OUTPUT + MessageBoxA(NULL, "MsiViewExecute success!", "SelectLanguage", MB_OK); +#endif + + while (MsiViewFetch(view, &record) == ERROR_SUCCESS) { + length = sizeof(feature); + if (MsiRecordGetStringA(record, 1, feature, &length) != ERROR_SUCCESS) { + MsiCloseHandle(record); + MsiCloseHandle(view); + MsiCloseHandle(database); + return ERROR_SUCCESS; + } + + /* Keep track of what languages are included in this installer, if + * it is a multilanguage one. + */ + if (strcmp(feature, "gm_Langpack_r_en_US") != 0) + strcpy(langs[nlangs++], feature + strlen("gm_Langpack_r_")); + + MsiCloseHandle(record); + } + + MsiCloseHandle(view); + + if (nlangs > 0) { + /* Deselect those languages that don't match any of the UI languages + * available on the system. + */ + + int i; + int have_system_default_lang = 0; + const char *system_default_lang = langid_to_string(GetSystemDefaultUILanguage(), &have_system_default_lang); + const char *user_locale_lang = langid_to_string(LANGIDFROMLCID(GetThreadLocale()), NULL); + +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "GetSystemDefaultUILanguage(): %#x = %s", GetSystemDefaultUILanguage(), system_default_lang); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + + EnumUILanguagesA(enum_ui_lang_proc, 0, 0); + +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "Have %d UI languages: ", num_ui_langs); + for (i = 0; i < num_ui_langs; i++) { + char *p = tem + strlen(tem); + sprintf(p, "%s%s", + ui_langs[i], + (i + 1 < num_ui_langs) ? ", " : ""); + } + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + + /* If one of the alternative languages in a multi-language installer + * is the system default UI language, deselect those languages that + * aren't among the UI languages available on the system. + * (On most Windows installations, just one UI language is present, + * which obviously is the same as the default UI language. But + * we want to be generic.) + * If none of the languages in a multi-language installer is the + * system default UI language (this happens now in 2.4.0 where we + * cannot put as many UI languages into the installer as we would + * like, but only half a dozen: en-US,de,es,fr,it,pt-BR), pretend + * that English is the system default UI language, + * so that we will by default deselect everything except + * English. We don't want to by default install all half dozen + * languages for an unsuspecting user of a Finnish Windows, for + * instance. Sigh. + */ + if (system_default_lang[0]) { + for (i = 0; i < nlangs; i++) { + if (memcmp (system_default_lang, langs[i], 2) == 0) { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "We have the system default language %s in the installer", system_default_lang); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + have_system_default_lang = 1; + } + } + } + + if (!have_system_default_lang) { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "We don't have the system default language %s in the installer, so pretend that English is the system default, sigh.", system_default_lang); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + system_default_lang = "en"; + have_system_default_lang = 1; + } + if (have_system_default_lang) { + for (i = 0; i < nlangs; i++) { + if (memcmp(system_default_lang, langs[i], 2) != 0 && + memcmp(user_locale_lang, langs[i], 2) != 0 && + !present_in_ui_langs(langs[i])) { + UINT rc; + sprintf(feature, "gm_Langpack_r_%s", langs[i]); + rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); + if (rc != ERROR_SUCCESS) { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "MsiSetFeatureStateA %s failed: %d", feature, rc); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + } else { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "MsiSetFeatureStateA %s OK!", feature); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + } + } + } + } + } + + MsiCloseHandle(database); + + return ERROR_SUCCESS; +} -- cgit From 61dd5267df2b16c98e32f29e1c84b8673887a987 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 10:51:18 +0200 Subject: default-no-registration.diff: Do not force to register. --- officecfg/registry/data/org/openoffice/Office/Jobs.xcu | 9 --------- 1 file changed, 9 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Jobs.xcu b/officecfg/registry/data/org/openoffice/Office/Jobs.xcu index cc7dbaf84ca4..3f64c9b53d89 100644 --- a/officecfg/registry/data/org/openoffice/Office/Jobs.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Jobs.xcu @@ -35,14 +35,5 @@ - - - - - 2003-01-01T00:00:00+00:01 - - - - -- cgit From abe06e115ad3cc0b7b3ee3c89c2dd6bb848c0d1c Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 10:52:06 +0200 Subject: default-no-registration-menu.diff: Remove registration from menu. --- dbaccess/uiconfig/dbapp/menubar/menubar.xml | 1 - dbaccess/uiconfig/dbquery/menubar/menubar.xml | 1 - dbaccess/uiconfig/dbrelation/menubar/menubar.xml | 1 - dbaccess/uiconfig/dbtable/menubar/menubar.xml | 1 - reportdesign/uiconfig/dbreport/menubar/menubar.xml | 1 - 5 files changed, 5 deletions(-) diff --git a/dbaccess/uiconfig/dbapp/menubar/menubar.xml b/dbaccess/uiconfig/dbapp/menubar/menubar.xml index baafddcae8ad..e0e15ed5c2a2 100644 --- a/dbaccess/uiconfig/dbapp/menubar/menubar.xml +++ b/dbaccess/uiconfig/dbapp/menubar/menubar.xml @@ -134,7 +134,6 @@ - diff --git a/dbaccess/uiconfig/dbquery/menubar/menubar.xml b/dbaccess/uiconfig/dbquery/menubar/menubar.xml index a3a965290fd6..715b04314da2 100644 --- a/dbaccess/uiconfig/dbquery/menubar/menubar.xml +++ b/dbaccess/uiconfig/dbquery/menubar/menubar.xml @@ -75,7 +75,6 @@ - diff --git a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml index 542395e58e9a..0bb81c061b62 100644 --- a/dbaccess/uiconfig/dbrelation/menubar/menubar.xml +++ b/dbaccess/uiconfig/dbrelation/menubar/menubar.xml @@ -58,7 +58,6 @@ - diff --git a/dbaccess/uiconfig/dbtable/menubar/menubar.xml b/dbaccess/uiconfig/dbtable/menubar/menubar.xml index 18bdde9ec991..d1323096e25a 100644 --- a/dbaccess/uiconfig/dbtable/menubar/menubar.xml +++ b/dbaccess/uiconfig/dbtable/menubar/menubar.xml @@ -59,7 +59,6 @@ - diff --git a/reportdesign/uiconfig/dbreport/menubar/menubar.xml b/reportdesign/uiconfig/dbreport/menubar/menubar.xml index 8fa04f47ba7f..a0de35edd1c9 100644 --- a/reportdesign/uiconfig/dbreport/menubar/menubar.xml +++ b/reportdesign/uiconfig/dbreport/menubar/menubar.xml @@ -414,7 +414,6 @@ - -- cgit From 6e71bad72b491bb5f1d2bf59a599c2127589d948 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 10:52:07 +0200 Subject: default-no-registration-menu.diff: Remove registration from menu. --- chart2/uiconfig/menubar/menubar.xml | 1 - sc/uiconfig/scalc/menubar/menubar.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/chart2/uiconfig/menubar/menubar.xml b/chart2/uiconfig/menubar/menubar.xml index 788dac2fc90b..0d100eea927d 100644 --- a/chart2/uiconfig/menubar/menubar.xml +++ b/chart2/uiconfig/menubar/menubar.xml @@ -148,7 +148,6 @@ - diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index a6b772cca012..9132cc2d647f 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -441,7 +441,6 @@ - -- cgit From 4181a72a21a037954876e97140e7532218ba3a14 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 10:52:07 +0200 Subject: default-no-registration-menu.diff: Remove registration from menu. --- basctl/uiconfig/basicide/menubar/menubar.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/basctl/uiconfig/basicide/menubar/menubar.xml b/basctl/uiconfig/basicide/menubar/menubar.xml index 2079c29e6646..9a40215699f2 100644 --- a/basctl/uiconfig/basicide/menubar/menubar.xml +++ b/basctl/uiconfig/basicide/menubar/menubar.xml @@ -82,7 +82,6 @@ - -- cgit From e0d0007a4b134cfd545954e0c8bf540e17457d78 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 10:52:08 +0200 Subject: default-no-registration-menu.diff: Remove registration from menu. --- starmath/uiconfig/smath/menubar/menubar.xml | 1 - sw/uiconfig/sglobal/menubar/menubar.xml | 1 - sw/uiconfig/sweb/menubar/menubar.xml | 1 - sw/uiconfig/swriter/menubar/menubar.xml | 1 - 4 files changed, 4 deletions(-) diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml index 63bf72c0cf62..dc3af9220291 100644 --- a/starmath/uiconfig/smath/menubar/menubar.xml +++ b/starmath/uiconfig/smath/menubar/menubar.xml @@ -113,7 +113,6 @@ - diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml index c3bef67c8c12..8945195e0a98 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -453,7 +453,6 @@ - diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml index 4b482e373d3f..a99cdeeda935 100644 --- a/sw/uiconfig/sweb/menubar/menubar.xml +++ b/sw/uiconfig/sweb/menubar/menubar.xml @@ -382,7 +382,6 @@ - diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index fb10ca615b50..98eeddd9850a 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -456,7 +456,6 @@ - -- cgit From 5cce527cf9c7f30ab7d75e7ccc6c94679fbb5a6e Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 10:52:08 +0200 Subject: default-no-registration-menu.diff: Remove registration from menu. --- framework/source/services/backingwindow.cxx | 8 -------- framework/uiconfig/startmodule/menubar/menubar.xml | 1 - svx/inc/globlmn_tmpl.hrc | 4 ---- 3 files changed, 13 deletions(-) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 17def8e1c684..8bb5ca5cbeaf 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -185,7 +185,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) : } String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) ); - String aRegHelpText( FwkResId( STR_BACKING_REGHELP ) ); String aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) ); String aTplRepHelpText( FwkResId( STR_BACKING_TPLREP ) ); @@ -214,12 +213,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) : maToolbox.SetItemCommand( nItemId_Extensions, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Extensions" ) ) ); maToolbox.ShowItem( nItemId_Extensions ); - maToolbox.InsertItem( nItemId_Reg, Image() ); - maToolbox.SetQuickHelpText( nItemId_Reg, aRegHelpText ); - maToolbox.SetItemText( nItemId_Reg, aRegHelpText ); - maToolbox.SetItemCommand( nItemId_Reg, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Register" ) ) ); - maToolbox.ShowItem( nItemId_Reg ); - maToolbox.InsertItem( nItemId_Info, Image() ); maToolbox.SetItemText( nItemId_Info, aInfoHelpText ); maToolbox.SetQuickHelpText( nItemId_Info, aInfoHelpText ); @@ -431,7 +424,6 @@ void BackingWindow::initBackground() maBackgroundRight = BitmapEx( FwkResId( BMP_BACKING_BACKGROUND_RIGHT ) ); } maToolbox.SetItemImage( nItemId_Extensions, BitmapEx( FwkResId( BMP_BACKING_EXT ) ) ); - maToolbox.SetItemImage( nItemId_Reg, BitmapEx( FwkResId( BMP_BACKING_REG ) ) ); maToolbox.SetItemImage( nItemId_Info, BitmapEx( FwkResId( BMP_BACKING_INFO ) ) ); maToolbox.SetItemImage( nItemId_TplRep, BitmapEx( FwkResId( BMP_BACKING_TPLREP ) ) ); diff --git a/framework/uiconfig/startmodule/menubar/menubar.xml b/framework/uiconfig/startmodule/menubar/menubar.xml index b5e52e7afac2..e9a0f333f4ce 100644 --- a/framework/uiconfig/startmodule/menubar/menubar.xml +++ b/framework/uiconfig/startmodule/menubar/menubar.xml @@ -75,7 +75,6 @@ - diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc index be037a1ca3cc..e2208596bab4 100644 --- a/svx/inc/globlmn_tmpl.hrc +++ b/svx/inc/globlmn_tmpl.hrc @@ -1109,10 +1109,6 @@ ITEM_HELP_SUPPORTPAGE\ };\ MenuItem\ - {\ - ITEM_HELP_ONLINE_REGISTRATION\ - };\ - MenuItem\ {\ Separator = TRUE ; \ };\ -- cgit From ba3f54db1c0751d836c5a4f876fd08d5bf6320d5 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 10:52:40 +0200 Subject: default-no-registration-menu-sd.diff: Remove registration from menu. --- sd/uiconfig/sdraw/menubar/menubar.xml | 1 - sd/uiconfig/simpress/menubar/menubar.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index 176f25cb06ff..0ded1f0bb1e3 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -324,7 +324,6 @@ - diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml index bf669992c86a..4fb01e39f981 100755 --- a/sd/uiconfig/simpress/menubar/menubar.xml +++ b/sd/uiconfig/simpress/menubar/menubar.xml @@ -298,7 +298,6 @@ - -- cgit From b6c0a3105e40eededeaa108b526a2f26da47d66f Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:03:16 +0200 Subject: sw-auto-scrollbars.diff: Hide scrollbars in Writer when not necessary. --- sw/source/ui/inc/view.hxx | 1 + sw/source/ui/uiview/viewmdi.cxx | 33 +++++++++++++++++++++++++++++++++ sw/source/ui/uiview/viewport.cxx | 5 +++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index d63149eb7c4f..17069743c583 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -330,6 +330,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell SW_DLLPRIVATE int _CreateScrollbar( BOOL bHori ); SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * ); SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * ); + SW_DLLPRIVATE DECL_LINK( WindowChildEventListener, VclSimpleEvent* ); SW_DLLPRIVATE BOOL UpdateScrollbars(); SW_DLLPRIVATE void CalcVisArea( const Size &rPixelSz ); diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index 9dfa8e79ecfa..d7813109e9b9 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -308,6 +308,35 @@ void SwView::SetViewLayout( USHORT nColumns, bool bBookMode, BOOL bViewOnly ) * Scrollbar - Handler */ +IMPL_LINK( SwView, WindowChildEventListener, VclSimpleEvent*, pEvent ) +{ + DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" ); + if ( pEvent && pEvent->ISA( VclWindowEvent ) ) + { + VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent ); + DBG_ASSERT( pVclEvent->GetWindow(), "Window???" ); + Window* pChildWin = static_cast< Window* >( pVclEvent->GetData() ); + + switch ( pVclEvent->GetId() ) + { + case VCLEVENT_WINDOW_HIDE: + if( pChildWin == pHScrollbar ) + ShowHScrollbar( FALSE ); + else if( pChildWin == pVScrollbar ) + ShowVScrollbar( FALSE ); + break; + case VCLEVENT_WINDOW_SHOW: + if( pChildWin == pHScrollbar ) + ShowHScrollbar( TRUE ); + else if( pChildWin == pVScrollbar ) + ShowVScrollbar( TRUE ); + break; + } + } + + return 0; +} + int SwView::_CreateScrollbar( BOOL bHori ) { Window *pMDI = &GetViewFrame()->GetWindow(); @@ -328,6 +357,10 @@ int SwView::_CreateScrollbar( BOOL bHori ) (*ppScrollbar)->EnableDrag( TRUE ); + (*ppScrollbar)->SetAuto( TRUE ); + + pMDI->AddChildEventListener( LINK( this, SwView, WindowChildEventListener )); + if(GetWindow()) InvalidateBorder(); diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index b343619f2ea8..e0cf6526c2ee 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -1135,6 +1135,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) { bShowH = pVOpt->IsViewHScrollBar(); bShowV = pVOpt->IsViewVScrollBar(); + bAuto = bHAuto = TRUE; break; } } @@ -1156,10 +1157,10 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) { bShowH = bShowV = bHAuto = bAuto = FALSE; } - if(pHScrollbar->IsVisible(FALSE) != bShowH) + if(pHScrollbar->IsVisible(FALSE) != bShowH && !bHAuto) ShowHScrollbar(bShowH); pHScrollbar->SetAuto( bHAuto ); - if(pVScrollbar->IsVisible(FALSE) != bShowV) + if(pVScrollbar->IsVisible(FALSE) != bShowV && !bAuto) ShowVScrollbar(bShowV); pVScrollbar->SetAuto(bAuto); -- cgit From 6169b36f2330b279ef173342d5aa6e3bd42e28fe Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:04:02 +0200 Subject: sw-auto-scrollbars-1.diff: Hide scrollbars in Writer update. --- sw/source/ui/uiview/view.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 1b7b56c6e75d..27a20bf3bd5d 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -1108,6 +1108,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pDocSh->EnableSetModified( sal_True ); InvalidateBorder(); + if( !pHScrollbar->IsVisible( TRUE ) ) + ShowHScrollbar( FALSE ); + if( !pVScrollbar->IsVisible( TRUE ) ) + ShowVScrollbar( FALSE ); } /*-------------------------------------------------------------------- -- cgit From d9b653f2a61397bf7aba71f1bc422b294742a74b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:04:24 +0200 Subject: sw-auto-scrollbars-2.diff: Hide scrollbars in Writer - final. --- sw/source/ui/uiview/view.cxx | 3 +++ sw/source/ui/uiview/viewmdi.cxx | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 27a20bf3bd5d..36f900e002c5 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -1112,6 +1112,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) ShowHScrollbar( FALSE ); if( !pVScrollbar->IsVisible( TRUE ) ) ShowVScrollbar( FALSE ); + + GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) ); } /*-------------------------------------------------------------------- @@ -1121,6 +1123,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) SwView::~SwView() { + GetViewFrame()->GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) ); delete mpPostItMgr; // --> OD 2009-03-10 #i100035# mpPostItMgr = 0; diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index d7813109e9b9..3dba8745485a 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -359,8 +359,6 @@ int SwView::_CreateScrollbar( BOOL bHori ) (*ppScrollbar)->SetAuto( TRUE ); - pMDI->AddChildEventListener( LINK( this, SwView, WindowChildEventListener )); - if(GetWindow()) InvalidateBorder(); -- cgit From 5b96fe6b4ef66123c55c58ccfcb22000d0c4117c Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:16:13 +0200 Subject: emf+-scp2-renderer.diff: emf+ import - make the renderer install --- scp2/source/canvas/makefile.mk | 3 ++- scp2/source/canvas/mtfrenderer.scp | 40 ++++++++++++++++++++++++++++++++++++++ scp2/util/makefile.mk | 3 ++- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 scp2/source/canvas/mtfrenderer.scp diff --git a/scp2/source/canvas/makefile.mk b/scp2/source/canvas/makefile.mk index f89e1c685b08..7cb5a6cd0a80 100644 --- a/scp2/source/canvas/makefile.mk +++ b/scp2/source/canvas/makefile.mk @@ -47,7 +47,8 @@ SCPDEFS+=-DSYSTEM_AGG .ENDIF PARFILES= canvascommons.par \ - vclcanvas.par + vclcanvas.par \ + mtfrenderer.par .IF "$(ENABLE_CAIRO)" == "TRUE" PARFILES+= cairocanvas.par diff --git a/scp2/source/canvas/mtfrenderer.scp b/scp2/source/canvas/mtfrenderer.scp new file mode 100644 index 000000000000..b8867cac94c7 --- /dev/null +++ b/scp2/source/canvas/mtfrenderer.scp @@ -0,0 +1,40 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "macros.inc" + +File gid_File_Lib_MtfRenderer + TXT_FILE_BODY; + Styles = (PACKED,UNO_COMPONENT); + RegistryID = gid_Starregistry_Services_Rdb; + Dir = gid_Dir_Program; + #ifdef UNX + Name = STRING(CONCAT2(libmtfrenderer.uno,UNXSUFFIX)); + #else + Name = "mtfrenderer.uno.dll"; + #endif +End diff --git a/scp2/util/makefile.mk b/scp2/util/makefile.mk index 12c401982e0d..d7cf32034f50 100644 --- a/scp2/util/makefile.mk +++ b/scp2/util/makefile.mk @@ -181,7 +181,8 @@ SCP1FILES += \ .ENDIF SCP1FILES += \ - vclcanvas.par + vclcanvas.par \ + mtfrenderer.par .IF "$(ENABLE_CAIRO)" == "TRUE" SCP1FILES += cairocanvas.par -- cgit From cb39099f75b8919d6d7d34572a031a080ab3dbe3 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 15 Sep 2010 11:31:55 +0200 Subject: Source ooenv in the soffice wrapper if it exists (for linked builds). --- desktop/scripts/soffice.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh index 0215f88d1ff0..2c14f12a8e09 100644 --- a/desktop/scripts/soffice.sh +++ b/desktop/scripts/soffice.sh @@ -55,6 +55,11 @@ fi sd_prog=`pwd` cd "$sd_cwd" +# linked build needs additional settings +if [ -e ooenv ] ; then + source ooenv +fi + sd_binary=`basename "$0"`.bin #collect all bootstrap variables specified on the command line -- cgit From b00fc9462d26083b6d09f72ea44abb1e11546b63 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 15 Sep 2010 11:54:10 +0200 Subject: sc-date-fix.diff: Parse 'june-2007' as June 1 2007 in en-US locales n#358750 --- svl/source/numbers/zforfind.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 8c63ed903825..bdf150f515d4 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1109,9 +1109,16 @@ input for the following reasons: switch (DateFmt) { case MDY: - case YMD: - pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) ); + case YMD: { + USHORT nDay = ImplGetDay(0); + USHORT nYear = ImplGetYear(0); + if (nDay == 0 || nDay > 32) { + pCal->setValue( CalendarFieldIndex::YEAR, nYear); + } + else + pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) ); break; + } case DMY: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; @@ -1550,6 +1557,13 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString, } } + // skip any trailing '-' or '/' chars + if (nPos < rString.Len()) + { + while (SkipChar ('-', rString, nPos) || SkipChar ('/', rString, nPos)) { + // do nothing + } + } if (nPos < rString.Len()) // not everything consumed { // Does input StartString equal StartString of format? -- cgit From 92d67985baf4d6f834190f2ed8d8c09bf56a8a57 Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Wed, 15 Sep 2010 14:06:36 +0200 Subject: remove useless license prompt for extensions --- mysqlc/source/description.xml | 5 ----- reportbuilder/util/description.xml | 5 ----- sdext/source/minimizer/description.xml | 6 ------ sdext/source/pdfimport/config/description.xml | 6 ------ sdext/source/presenter/description.xml | 6 ------ sdext/source/presenter/makefile.mk | 17 ----------------- swext/mediawiki/build.xml | 2 -- swext/mediawiki/src/description.xml | 5 ----- swext/mediawiki/src/makefile.mk | 18 +----------------- 9 files changed, 1 insertion(+), 69 deletions(-) diff --git a/mysqlc/source/description.xml b/mysqlc/source/description.xml index bc7563d39177..458ee6efb4d1 100755 --- a/mysqlc/source/description.xml +++ b/mysqlc/source/description.xml @@ -5,11 +5,6 @@ - - - - - #TITLE# diff --git a/reportbuilder/util/description.xml b/reportbuilder/util/description.xml index c274526edc06..06c9adc0aa66 100755 --- a/reportbuilder/util/description.xml +++ b/reportbuilder/util/description.xml @@ -6,11 +6,6 @@ Oracle Report Builder - - - - - diff --git a/sdext/source/minimizer/description.xml b/sdext/source/minimizer/description.xml index 64a67a05b343..455c92a8a392 100755 --- a/sdext/source/minimizer/description.xml +++ b/sdext/source/minimizer/description.xml @@ -11,12 +11,6 @@ - - - - - - diff --git a/sdext/source/pdfimport/config/description.xml b/sdext/source/pdfimport/config/description.xml index b22b81587fc7..0b4031a5a63f 100755 --- a/sdext/source/pdfimport/config/description.xml +++ b/sdext/source/pdfimport/config/description.xml @@ -10,12 +10,6 @@ - - - - - - diff --git a/sdext/source/presenter/description.xml b/sdext/source/presenter/description.xml index ede52f0bf1bb..cbe292c04152 100755 --- a/sdext/source/presenter/description.xml +++ b/sdext/source/presenter/description.xml @@ -11,12 +11,6 @@ - - - - - - diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk index 08a3470fc24d..17bc1ed2cf59 100755 --- a/sdext/source/presenter/makefile.mk +++ b/sdext/source/presenter/makefile.mk @@ -115,12 +115,6 @@ ZIP1LIST= * DESCRIPTION:=$(ZIP1DIR)$/description.xml -.IF "$(GUI)" == "WIN" || "$(GUI)" == "WNT" -PACKLICS:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registry$/license_$i) -.ELSE -PACKLICS:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registry$/LICENSE_$i) -.ENDIF - .IF "$(WITH_LANG)"=="" FIND_XCU=registry/data .ELSE # "$(WITH_LANG)"=="" @@ -254,7 +248,6 @@ COMPONENT_HELP= \ # $(foreach,l,$(alllangiso) $(ZIP1DIR)$/help$/$l$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp) ZIP1DEPS= \ - $(PACKLICS) \ $(DESCRIPTION) \ $(COMPONENT_MANIFEST) \ $(COMPONENT_FILES) \ @@ -343,16 +336,6 @@ $(COMPONENT_LIBRARY) : $(DLLDEST)$/$$(@:f) .ENDIF -.IF "$(GUI)" == "WIN" || "$(GUI)" == "WNT" -$(PACKLICS) : $(SOLARBINDIR)$/osl$/license$$(@:b:s/_/./:e:s/./_/)$$(@:e).txt - @@-$(MKDIRHIER) $(@:d) - $(GNUCOPY) $< $@ -.ELSE -$(PACKLICS) : $(SOLARBINDIR)$/osl$/LICENSE$$(@:b:s/_/./:e:s/./_/)$$(@:e) - @@-$(MKDIRHIER) $(@:d) - $(GNUCOPY) $< $@ -.ENDIF - $(ZIP1DIR)/%.xcu : %.xcu @@-$(MKDIRHIER) $(@:d) diff --git a/swext/mediawiki/build.xml b/swext/mediawiki/build.xml index ff96fe578ca6..5e65177ad976 100644 --- a/swext/mediawiki/build.xml +++ b/swext/mediawiki/build.xml @@ -148,7 +148,6 @@ - @@ -171,7 +170,6 @@ - diff --git a/swext/mediawiki/src/description.xml b/swext/mediawiki/src/description.xml index 369efc141274..7f533d97d320 100644 --- a/swext/mediawiki/src/description.xml +++ b/swext/mediawiki/src/description.xml @@ -5,11 +5,6 @@ @WIKIEXTENSIONPRODUCTNAME@ - - - - - diff --git a/swext/mediawiki/src/makefile.mk b/swext/mediawiki/src/makefile.mk index ab656fe01733..8d920ab20976 100644 --- a/swext/mediawiki/src/makefile.mk +++ b/swext/mediawiki/src/makefile.mk @@ -38,27 +38,11 @@ ENABLE_EXCEPTIONS=TRUE DESCRIPTION:=$(MISC)$/$(TARGET)$/description.xml -# .IF "$(GUI)" == "WIN" || "$(GUI)" == "WNT" -# PACKLICS:=$(foreach,i,$(alllangiso) $(MISC)$/$(TARGET)$/license$/license_$i) -# .ELSE -PACKLICS:=$(foreach,i,$(alllangiso) $(MISC)$/$(TARGET)$/license$/LICENSE_$i) -# .ENDIF - common_build_zip= .INCLUDE : target.mk -.IF "$(GUI)" == "WIN" || "$(GUI)" == "WNT" -$(PACKLICS) : $(SOLARBINDIR)$/osl$/license$$(@:b:s/_/./:e:s/./_/)$$(@:e).txt - @@-$(MKDIRHIER) $(@:d) - $(GNUCOPY) $< $@ -.ELSE -$(PACKLICS) : $(SOLARBINDIR)$/osl$/LICENSE$$(@:b:s/_/./:e:s/./_/)$$(@:e) - @@-$(MKDIRHIER) $(@:d) - $(GNUCOPY) $< $@ -.ENDIF - -ALLTAR: $(PACKLICS) $(DESCRIPTION) +ALLTAR: $(DESCRIPTION) .INCLUDE .IGNORE : $(MISC)$/$(TARGET)_lang_track.mk .IF "$(LAST_WITH_LANG)"!="$(WITH_LANG)" -- cgit From 66c8185103c1ce07687602bfbd664c9f34ea7df3 Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 15 Sep 2010 11:12:54 +0200 Subject: sc-autofilter-empty-nonempty.diff: adds to Autofilter Empty-NonEmpty options i#35578, bxc#62165 --- sc/source/ui/view/gridwin.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 0f07b8772254..e61e31d35126 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -140,6 +140,8 @@ const BYTE SC_NESTEDBUTTON_UP = 2; #define SC_AUTOFILTER_ALL 0 #define SC_AUTOFILTER_TOP10 1 #define SC_AUTOFILTER_CUSTOM 2 +#define SC_AUTOFILTER_EMPTY 3 +#define SC_AUTOFILTER_NOTEMPTY 4 // Modi fuer die FilterListBox enum ScFilterBoxMode @@ -940,7 +942,7 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, BOOL bDataSelect ) long nMaxText = 0; // default entries - static const USHORT nDefIDs[] = { SCSTR_ALLFILTER, SCSTR_TOP10FILTER, SCSTR_STDFILTER }; + static const USHORT nDefIDs[] = { SCSTR_ALLFILTER, SCSTR_TOP10FILTER, SCSTR_STDFILTER, SCSTR_EMPTY, SCSTR_NOTEMPTY }; const USHORT nDefCount = sizeof(nDefIDs) / sizeof(USHORT); for (i=0; iErase(); + rNewEntry.bQueryByString = FALSE; + rNewEntry.eOp = SC_EQUAL; + rNewEntry.nVal = SC_EMPTYFIELDS; + + } + else if (nSel == SC_AUTOFILTER_NOTEMPTY) + { + rNewEntry.pStr->Erase(); + rNewEntry.bQueryByString = FALSE; + rNewEntry.eOp = SC_EQUAL; + rNewEntry.nVal = SC_NONEMPTYFIELDS; + } else { rNewEntry.eOp = SC_EQUAL; -- cgit From 8a14ea8b583649510dc7db4d3054c7657a9874de Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 15 Sep 2010 11:22:37 +0200 Subject: sc-filters-fill-fix.diff: fix Autofill doesnt fill filtered rows bxc#62499 --- sc/source/core/data/table4.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 434144d06e00..38534b4bd31e 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1345,6 +1345,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { for (rInner = nIMin; rInner <= nIMax; rInner++) { + if (pDocument->RowFiltered( rInner, nTab)) + continue; ULONG nInd = nActFormCnt; FillFormula(nInd, bFirst, (ScFormulaCell*)pSrcCell, static_cast(nCol), nRow, (rInner == nIEnd) ); @@ -1356,6 +1358,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { for (rInner = nIMin; rInner <= nIMax; rInner++) { + if (pDocument->RowFiltered( rInner, nTab)) + continue; ScAddress aDestPos( static_cast(nCol), static_cast(nRow), nTab ); aCol[nCol].Insert( aDestPos.Row(), pSrcCell->CloneWithoutNote( *pDocument ) ); } -- cgit From 20f5f0613f2a66671ad64accb551f893eb80c379 Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 15 Sep 2010 11:30:22 +0200 Subject: sc-datapilot-autoformat.diff: Provision for data-pilot to give autoformat i#37388, bxc#62162 --- sc/inc/sc.hrc | 3 ++ sc/sdi/pivotsh.sdi | 1 + sc/sdi/scalc.sdi | 24 ++++++++++++ sc/source/ui/docshell/dbdocfun.cxx | 30 +++++++++++++++ sc/source/ui/inc/dbfunc.hxx | 8 ++-- sc/source/ui/inc/viewdata.hxx | 4 ++ sc/source/ui/miscdlgs/makefile.mk | 2 + sc/source/ui/src/popup.src | 78 ++++++++++++++++++++++++++++++++++++++ sc/source/ui/view/dbfunc3.cxx | 22 +++++++++++ sc/source/ui/view/pivotsh.cxx | 44 +++++++++++++++++++++ sc/source/ui/view/viewdata.cxx | 16 ++++++++ 11 files changed, 228 insertions(+), 4 deletions(-) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 4a697dc57558..c076bafcf6a3 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1653,6 +1653,9 @@ #define MID_3 3 #define MID_4 4 +// Autoformat for DataPilot +#define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 1) + #endif diff --git a/sc/sdi/pivotsh.sdi b/sc/sdi/pivotsh.sdi index d763aa8c995a..51ff6c7d7af6 100644 --- a/sc/sdi/pivotsh.sdi +++ b/sc/sdi/pivotsh.sdi @@ -31,6 +31,7 @@ interface Pivot SID_PIVOT_RECALC [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] SID_PIVOT_KILL [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] SID_DP_FILTER [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] + SID_PIVOT_AFMT [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] } shell ScPivotShell diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 1e42ce5fb1dc..6d55f05874d7 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -1872,6 +1872,30 @@ SfxVoidItem DeletePivotTable SID_PIVOT_KILL GroupId = GID_DATA; ] +SfxVoidItem AutoFormatPivotTable SID_PIVOT_AFMT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = FALSE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_DATA; +] + //-------------------------------------------------------------------------- SfxVoidItem DeletePrintArea SID_DELETE_PRINTAREA () diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index cf149d258062..66c9a4db58ea 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1413,6 +1413,36 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb delete pNewUndoDoc; delete pUndoDPObj; + if (pNewObj && pNewObj->GetAutoFormatIndex() != 65535) + { + ScViewData* pViewData = rDocShell.GetViewData(); + ScTabViewShell* pViewShell = pViewData->GetViewShell(); + pViewShell->GetDBData( TRUE, SC_DB_OLD ); + const ScMarkData& rMark1 = pViewData->GetMarkData(); + SCCOL nStartCol; + SCROW nStartRow; + SCTAB nStartTab; + SCCOL nEndCol; + SCROW nEndRow; + SCTAB nEndTab; + + rDocShell.GetViewData()->GetSimpleArea( nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab ); + ScRange Outrange = pNewObj->GetOutRange(); + if (( (Outrange.aStart.Col() <= nStartCol) && (nStartCol <= Outrange.aEnd.Col() )&& (nStartTab == Outrange.aStart.Tab())) + && ( (Outrange.aStart.Row() <= nStartRow) && (nStartRow <= Outrange.aEnd.Row() )) ) + { + + if ( !rMark1.IsMarked() && !rMark1.IsMultiMarked() ) + pViewShell->MarkDataArea( TRUE ); + //FIXME: Autoformat even when clicked from a non-dp cell. + pViewData->MoveNextRow(); + sal_uInt16 nAutoFmtIndex = pNewObj->GetAutoFormatIndex(); + pViewShell->AutoFormat(nAutoFmtIndex); + pViewShell->AutoFormatPivotTable(const_cast(pNewObj), nAutoFmtIndex); + pViewData->MovePrevRow(); + } + } + if (bDone) { // notify API objects diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx index baadae0a64dc..3880aaedef16 100644 --- a/sc/source/ui/inc/dbfunc.hxx +++ b/sc/source/ui/inc/dbfunc.hxx @@ -86,10 +86,10 @@ public: bool MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest, BOOL bNewTable, const ScDPObject& rSource, BOOL bApi = FALSE ); void DeletePivotTable(); - // Wang Xu Ming -- 2009-6-17 - // DataPilot Migration - ULONG RecalcPivotTable(); - // End Comments + ULONG RecalcPivotTable(); + void AutoFormatPivotTable(USHORT nIndex); + void AutoFormatPivotTable(ScDPObject* pDPObj, USHORT nIndex); + BOOL HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts ); BOOL HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo ); void GroupDataPilot(); diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index fb9c674a4488..05560b0872b2 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -332,6 +332,10 @@ public: ScMarkType GetSimpleArea( SCCOL& rStartCol, SCROW& rStartRow, SCTAB& rStartTab, SCCOL& rEndCol, SCROW& rEndRow, SCTAB& rEndTab ) const; ScMarkType GetSimpleArea( ScRange& rRange ) const; + + void MoveNextRow(); + void MovePrevRow(); + /// May modify rNewMark using MarkToSimple(). ScMarkType GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) const; void GetMultiArea( ScRangeListRef& rRange ) const; diff --git a/sc/source/ui/miscdlgs/makefile.mk b/sc/source/ui/miscdlgs/makefile.mk index d34994341ade..8c561010432e 100644 --- a/sc/source/ui/miscdlgs/makefile.mk +++ b/sc/source/ui/miscdlgs/makefile.mk @@ -118,6 +118,8 @@ LIB1OBJFILES = \ $(SLO)$/warnbox.obj \ $(SLO)$/conflictsdlg.obj \ $(SLO)$/sharedocdlg.obj \ + $(SLO)$/scuiautofmt.obj \ + $(SLO)$/strindlg.obj \ $(SLO)$/protectiondlg.obj \ $(SLO)$/retypepassdlg.obj diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src index 9753aa1590e3..5ced53410d60 100644 --- a/sc/source/ui/src/popup.src +++ b/sc/source/ui/src/popup.src @@ -224,6 +224,84 @@ Menu RID_POPUP_PIVOT Text [ en-US ] = "~Start..." ; }; MenuItem + { + Identifier = SID_PIVOT_AFMT ; + HelpId = SID_PIVOT_AFMT ; + Text [ en-US ] = "~AutoFormat..." ; + Text [ de ] = "A~utoFormat" ; + Text [ af ] = "OutoFormateer..." ; + Text [ ar ] = "تنسيق تلقائي..." ; + Text [ as-IN ] = "স্বয়ংক্ৰিয় ফৰমেট ..." ; + Text [ be-BY ] = "Аўта-фармат..." ; + Text [ bg ] = "Автоформат..." ; + Text [ br ] = "EmVentrezhañ..." ; + Text [ bs ] = "AutoFormat..." ; + Text [ ca ] = "Formatació automàtica..." ; + Text [ cs ] = "Automatický formát..." ; + Text [ cy ] = "AwtoFformat..." ; + Text [ da ] = "Autoformat..." ; + Text [ el ] = "Αυτόματη μορφοποίηση..." ; + Text [ en-GB ] = "AutoFormat..." ; + Text [ en-ZA ] = "AutoFormat..." ; + Text [ eo ] = "Aŭtomate Formati..." ; + Text [ es ] = "Formateado automático..." ; + Text [ et ] = "Automaatvormindus..." ; + Text [ fa ] = "قالب‌بندی خودکار..." ; + Text [ fi ] = "Automaattinen muotoilu..." ; + Text [ fr ] = "AutoFormat..." ; + Text [ ga ] = "UathFhormáidigh..." ; + Text [ gu ] = "આપોઆપબંધારણ..." ; + Text [ gu-IN ] = "આપોઆપબંધારણ..." ; + Text [ hi-IN ] = "स्वचालित ढंग से रचना..." ; + Text [ hr ] = "SamoOblikovanje..." ; + Text [ hu ] = "Automatikus formázás..." ; + Text [ it ] = "Formattazione automatica..." ; + Text [ ja ] = "オートフォーマット..." ; + Text [ ka ] = "ავტო-ფორმატირება..." ; + Text [ km ] = "ទ្រង់ទ្រាយ​ស្វ័យប្រវត្តិ..." ; + Text [ ko ] = "자동 서식..." ; + Text [ ku ] = "TeşekirinaBixweber..." ; + Text [ lt ] = "Automatinis formatavimas..." ; + Text [ mk ] = "Автоматско форматирање..." ; + Text [ ml-IN ] = "സ്വയം രൂപപ്പെടുത്തുക..." ; + Text [ mr-IN ] = "स्वंयचलित रचना..." ; + Text [ nb ] = "Autoformatering..." ; + Text [ nl ] = "AutoOpmaak..." ; + Text [ nn ] = "Autoformatering..." ; + Text [ nr ] = "Fometha ngokuzenzakalela..." ; + Text [ ns ] = "Fomate ye e Itiragalelago..." ; + Text [ or-IN ] = "ସ୍ବଯଂଚାଳିତଫର୍ମାଟ..." ; + Text [ pa-IN ] = "ਸਵੈ-ਫਾਰਮਿਟ..." ; + Text [ pl ] = "Autoformatowanie..." ; + Text [ pt ] = "Formatação automática..." ; + Text [ pt-BR ] = "AutoFormatar..." ; + Text [ ru ] = "Автоформат..." ; + Text [ rw ] = "Nyamwihamiterere..." ; + Text [ sh-YU ] = "Automatsko formatiranje..." ; + Text [ sk ] = "Automatický formát..." ; + Text [ sl ] = "Samooblikovanje..." ; + Text [ sr-CS ] = "Аутоматско форматирање..." ; + Text [ ss ] = "Kutifomethekela..." ; + Text [ st ] = "Fomate e iketsahallang..." ; + Text [ sv ] = "Autoformat..." ; + Text [ sw-TZ ] = "AutoFormat..." ; + Text [ ta ] = "தானியக்க வடிவம்..." ; + Text [ ta-IN ] = "தானியக்க வடிவம்..." ; + Text [ te-IN ] = "స్వయంరూపలావణ్యం..." ; + Text [ tg ] = "Автоформат..." ; + Text [ th ] = "AutoFormat..." ; + Text [ tr ] = "Otomatik Biçimlendirme..." ; + Text [ ts ] = "Fomati yo tiendlekela hi yoxe..." ; + Text [ uk ] = "Автоформат..." ; + Text [ ur-IN ] = "خودکارطریقہ..." ; + Text [ ve ] = "OthoFomathi..." ; + Text [ vi ] = "Tự định dạng..." ; + Text [ xh ] = "Ulungiselelo Oluzenzekelayo..." ; + Text [ zh-CN ] = "自动格式..." ; + Text [ zh-TW ] = "自動格式..." ; + Text [ zu ] = "Isakhiwo esizenzekelayo..." ; + }; + MenuItem { Identifier = SID_PIVOT_RECALC ; HelpId = SID_PIVOT_RECALC ; diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index dbdeae1ae0b1..af2beec4afae 100755 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -2370,6 +2370,28 @@ void ScDBFunc::RepeatDB( BOOL bRecord ) ErrorMessage(STR_MSSG_REPEATDB_0); } +void ScDBFunc::AutoFormatPivotTable(USHORT nIndex) +{ + ScDocument* pDoc = GetViewData()->GetDocument(); + + // old pivot not used any more + + ScDPObject* pDPObj = pDoc->GetDPAtCursor( + GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); + + if ( pDPObj ) + { + pDPObj->SetAutoFormatIndex(nIndex); + } + else + ErrorMessage(STR_PIVOT_NOTFOUND); + +} + +void ScDBFunc::AutoFormatPivotTable(ScDPObject* pDPObj, USHORT nIndex) +{ + pDPObj->SetAutoFormatIndex(nIndex); +} diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index a65f86ffed2c..a946b18f7855 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -53,6 +53,12 @@ #include "uiitems.hxx" //CHINA001 #include "pfiltdlg.hxx" #include "scabstdlg.hxx" //CHINA001 + +#include "autoform.hxx" +#include "scuiautofmt.hxx" +#include "editable.hxx" + + //------------------------------------------------------------------------ #define ScPivotShell @@ -99,7 +105,45 @@ void ScPivotShell::Execute( SfxRequest& rReq ) case SID_PIVOT_RECALC: pViewShell->RecalcPivotTable(); break; + case SID_PIVOT_AFMT: + { + ScViewData* pViewData = pViewShell->GetViewData(); + + pViewShell->GetDBData( TRUE, SC_DB_OLD ); + const ScMarkData& rMark1 = pViewData->GetMarkData(); + if ( !rMark1.IsMarked() && !rMark1.IsMultiMarked() ) + pViewShell->MarkDataArea( TRUE ); + Window* pDlgParent = pViewShell->GetDialogParent(); + + pViewData->MoveNextRow(); + + ScGlobal::ClearAutoFormat(); + ScAutoFormatData* pNewEntry = pViewShell->CreateAutoFormatData(); + ScAutoFormatDlg* pDlg = new ScAutoFormatDlg( + pDlgParent, ScGlobal::GetAutoFormat(), pNewEntry, pViewData->GetDocument() ); + + if ( pDlg->Execute() == RET_OK ) + { + ScEditableTester aTester( pViewShell ); + if ( !aTester.IsEditable() ) + { + pViewShell->ErrorMessage(aTester.GetMessageId()); + } + else + { + /* AutoFormat and Store the index */ + pViewShell->AutoFormat( pDlg->GetIndex() ); + pViewShell->AutoFormatPivotTable( pDlg->GetIndex() ); + } + } + delete pDlg; + delete pNewEntry; + + //pViewShell->DeletePivotTable(); + //pViewShell->RecalcPivotTable(); + } + break; case SID_PIVOT_KILL: pViewShell->DeletePivotTable(); break; diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 7b35328f68bb..8f463c2a86b3 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -754,6 +754,22 @@ void ScViewData::RefreshZoom() aLogicMode.SetScaleY( GetZoomY() ); } +void ScViewData::MoveNextRow() +{ + ScRange aMarkRange; + aMarkData.GetMarkArea(aMarkRange); + aMarkRange.aStart.Set(aMarkRange.aStart.Col(), aMarkRange.aStart.Row() +1, aMarkRange.aStart.Tab()); + aMarkData.SetMarkArea(aMarkRange); +} + +void ScViewData::MovePrevRow() +{ + ScRange aMarkRange; + aMarkData.GetMarkArea(aMarkRange); + aMarkRange.aStart.Set(aMarkRange.aStart.Col(), aMarkRange.aStart.Row() -1, aMarkRange.aStart.Tab()); + aMarkData.SetMarkArea(aMarkRange); +} + void ScViewData::SetPagebreakMode( BOOL bSet ) { bPagebreak = bSet; -- cgit From 568969f0612722df82202760e850e4a6c0a05a10 Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 15 Sep 2010 11:33:09 +0200 Subject: sc-change-record-dnd.diff: Allow dnd in Change record mode for Data source i#44982 --- sc/source/ui/docshell/dbdocimp.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index a073e50d105c..da5cd4dc9fc6 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -65,6 +65,7 @@ #include "dbdocutl.hxx" #include "editable.hxx" #include "hints.hxx" +#include "chgtrack.hxx" using namespace com::sun::star; @@ -216,6 +217,8 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, const SbaSelectionList* pSelection, BOOL bRecord, BOOL bAddrInsert ) { ScDocument* pDoc = rDocShell.GetDocument(); + ScChangeTrack *pChangeTrack = NULL; + ScRange aChangedRange; if (bRecord && !pDoc->IsUndoEnabled()) bRecord = FALSE; @@ -490,11 +493,9 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, nErrStringId = aTester.GetMessageId(); bSuccess = FALSE; } - else if ( pDoc->GetChangeTrack() != NULL ) - { - nErrStringId = STR_PROTECTIONERR; - bSuccess = FALSE; - } + else if ( (pChangeTrack = pDoc->GetChangeTrack()) != NULL ) + aChangedRange = ScRange(rParam.nCol1, rParam.nRow1, nTab, + nEndCol+nFormulaCols, nEndRow, nTab ); } if ( bSuccess && bMoveCells ) @@ -712,6 +713,9 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, delete pImportDoc; + if (bSuccess && pChangeTrack) + pChangeTrack->AppendInsert ( aChangedRange ); + return bSuccess; } -- cgit From 38ec0c1814d9fda19611d42df1cc7a663456d171 Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 15 Sep 2010 11:40:21 +0200 Subject: sc-dp-gridlayout.diff: Something with grid layout :) i#68544, n#190970 --- sc/source/filter/xml/XMLExportDataPilot.cxx | 3 +++ sc/source/filter/xml/xmldpimp.cxx | 9 ++++++++- sc/source/filter/xml/xmldpimp.hxx | 1 + sc/source/filter/xml/xmlimprt.cxx | 1 + sc/source/filter/xml/xmlimprt.hxx | 3 ++- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index e43ff21a114d..3079119dcbbd 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -809,6 +809,9 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference GetDrillDown()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE); + if ((*pDPs)[i]->GetHeaderLayout()) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TRUE); + SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True); // grand total elements. diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index ba107347b46a..491941b36152 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -139,7 +139,8 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, bTargetRangeAddress(sal_False), bSourceCellRange(sal_False), bShowFilter(sal_True), - bDrillDown(sal_True) + bDrillDown(sal_True), + bHeaderGridLayout(sal_False) { sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotTableAttrTokenMap(); @@ -219,6 +220,11 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, bDrillDown = IsXMLToken(sValue, XML_TRUE); } break; + case XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT : + { + bHeaderGridLayout = IsXMLToken(sValue, XML_TRUE); + } + break; } } @@ -396,6 +402,7 @@ void ScXMLDataPilotTableContext::EndElement() pDPObject->SetName(sDataPilotTableName); pDPObject->SetTag(sApplicationData); pDPObject->SetOutRange(aTargetRangeAddress); + pDPObject->SetHeaderLayout(bHeaderGridLayout); switch (nSourceType) { case SQL : diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx index 32300138bc3b..27643c9e596a 100644 --- a/sc/source/filter/xml/xmldpimp.hxx +++ b/sc/source/filter/xml/xmldpimp.hxx @@ -126,6 +126,7 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext sal_Bool bSourceCellRange; sal_Bool bShowFilter; sal_Bool bDrillDown; + sal_Bool bHeaderGridLayout; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 269e1dd9a7e4..edba3eb8b1d9 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1329,6 +1329,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableAttrTokenMap() { XML_NAMESPACE_TABLE, XML_BUTTONS, XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS }, { XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON }, { XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN }, + { XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT }, XML_TOKEN_MAP_END }; diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 9771655ebd4b..5ba4de9f2602 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -481,7 +481,8 @@ enum ScXMLDataPilotTableAttrTokens XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS, XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS, XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON, - XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN + XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN, + XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT }; enum ScXMLDataPilotTableElemTokens -- cgit From 164aca5f32927cc2ad42e16d7b9a9089c3bdfc8b Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 15 Sep 2010 11:44:06 +0200 Subject: sc-read-only-colrow-resize.diff: Allow resizing Cols/Rows if document is R/O n#165980 --- sc/source/ui/view/colrowba.cxx | 6 ++---- sc/source/ui/view/viewfunc.cxx | 6 +++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index d802c08f642f..f2322f6de317 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -216,8 +216,7 @@ BOOL ScColBar::IsDisabled() BOOL ScColBar::ResizeAllowed() { - return !pViewData->HasEditView( pViewData->GetActivePart() ) && - !pViewData->GetDocShell()->IsReadOnly(); + return !pViewData->HasEditView( pViewData->GetActivePart() ); } void ScColBar::DrawInvert( long nDragPosP ) @@ -383,8 +382,7 @@ BOOL ScRowBar::IsDisabled() BOOL ScRowBar::ResizeAllowed() { - return !pViewData->HasEditView( pViewData->GetActivePart() ) && - !pViewData->GetDocShell()->IsReadOnly(); + return !pViewData->HasEditView( pViewData->GetActivePart() ); } void ScRowBar::DrawInvert( long nDragPosP ) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 231eb4e67562..12fc573973dd 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2111,7 +2111,10 @@ void ScViewFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pR bOnlyMatrix; } } - if ( !bAllowed ) + + // Allow users to resize cols/rows in readonly docs despite the r/o state. + // It is frustrating to be unable to see content in mis-sized cells. + if( !bAllowed && !pDocSh->IsReadOnly() ) { ErrorMessage(STR_PROTECTIONERR); return; @@ -2328,6 +2331,7 @@ void ScViewFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pR } pDocSh->UpdateOle(GetViewData()); + if( !pDocSh->IsReadOnly() ) aModificator.SetDocumentModified(); ShowCursor(); -- cgit From 82edbbe8b797ad085008f3e148ef1b9bf3c6f802 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 15 Sep 2010 11:49:27 +0200 Subject: sc-xls-builtin-name-scope.diff: Print_Area/_Titles only for sheet local names n#191005, n#257422 --- sc/source/filter/excel/excform.cxx | 17 +++++++++-------- sc/source/filter/excel/excform8.cxx | 17 +++++++++-------- sc/source/filter/excel/frmbase.cxx | 26 ++++++++++++++++++-------- sc/source/filter/excel/xiname.cxx | 6 ++++-- sc/source/filter/inc/excform.hxx | 4 ++-- sc/source/filter/inc/formel.hxx | 6 +++--- 6 files changed, 45 insertions(+), 31 deletions(-) diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 0652363e8822..1157a9cc2cf6 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -898,7 +898,8 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s // stream seeks to first byte after -ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, const FORMULA_TYPE eFT ) +ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, + SCsTAB nTab, const FORMULA_TYPE eFT ) { RootData& rR = GetOldRoot(); BYTE nOp, nLen; @@ -1066,7 +1067,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal ExcRelToScRel( nUINT16, nByte, aSRD, bRangeName ); - rRangeList.Append( aSRD ); + rRangeList.Append( aSRD, nTab ); break; case 0x45: case 0x65: @@ -1093,7 +1094,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal else if( IsComplRowRange( nRowFirst, nRowLast ) ) SetComplRow( aCRD ); - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); } break; case 0x46: @@ -1130,7 +1131,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal ExcRelToScRel( nUINT16, nByte, aSRD, bRNorSF ); - rRangeList.Append( aSRD ); + rRangeList.Append( aSRD, nTab ); } break; case 0x4D: @@ -1156,7 +1157,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal else if( IsComplRowRange( nRowFirst, nRowLast ) ) SetComplRow( aCRD ); - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); } break; case 0x49: @@ -1226,10 +1227,10 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal b3D = ( static_cast(nTabLast) != aEingPos.Tab() ); aCRD.Ref2.SetFlag3D( b3D ); aCRD.Ref2.SetTabRel( FALSE ); - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); } else - rRangeList.Append( aSRD ); + rRangeList.Append( aSRD, nTab ); } } @@ -1284,7 +1285,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal else if( IsComplRowRange( nRowFirst, nRowLast ) ) SetComplRow( aCRD ); - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); }//ENDE in aktuellem Workbook } break; diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index 148b1542913a..3b07bf28b4e8 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -871,7 +871,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, // stream seeks to first byte after -ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, const FORMULA_TYPE eFT ) +ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, + SCsTAB nTab, const FORMULA_TYPE eFT ) { BYTE nOp, nLen;//, nByte; BOOL bError = FALSE; @@ -1002,7 +1003,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa ExcRelToScRel8( nRow, nCol, aSRD, bRangeName ); - rRangeList.Append( aSRD ); + rRangeList.Append( aSRD, nTab ); } break; case 0x45: @@ -1030,7 +1031,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa else if( IsComplRowRange( nRowFirst, nRowLast ) ) SetComplRow( aCRD ); - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); } break; case 0x46: @@ -1074,7 +1075,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF ); - rRangeList.Append( aSRD ); + rRangeList.Append( aSRD, nTab ); } break; case 0x4D: @@ -1100,7 +1101,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa else if( IsComplRowRange( nRowFirst, nRowLast ) ) SetComplRow( aCRD ); - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); } break; case 0x4E: @@ -1142,10 +1143,10 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa aCRD.Ref2.nCol = aSRD.nCol; aCRD.Ref2.nRow = aSRD.nRow; aCRD.Ref2.nTab = nLastScTab; - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); } else - rRangeList.Append( aSRD ); + rRangeList.Append( aSRD, nTab ); } } break; @@ -1178,7 +1179,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa else if( IsComplRowRange( nRw1, nRw2 ) ) SetComplRow( aCRD ); - rRangeList.Append( aCRD ); + rRangeList.Append( aCRD, nTab ); } } break; diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx index 78883b4a5c76..b550bfa92ef4 100644 --- a/sc/source/filter/excel/frmbase.cxx +++ b/sc/source/filter/excel/frmbase.cxx @@ -78,7 +78,7 @@ _ScRangeListTabs::~_ScRangeListTabs() } -void _ScRangeListTabs::Append( ScSingleRefData a, const BOOL b ) +void _ScRangeListTabs::Append( ScSingleRefData a, SCsTAB nTab, const BOOL b ) { if( b ) { @@ -98,19 +98,24 @@ void _ScRangeListTabs::Append( ScSingleRefData a, const BOOL b ) bHasRanges = TRUE; - if( a.nTab >= 0 ) + if( nTab == SCTAB_MAX) + return; + if( nTab < 0) + nTab = a.nTab; + + if( nTab >= 0 ) { - _ScRangeList* p = ppTabLists[ a.nTab ]; + _ScRangeList* p = ppTabLists[ nTab ]; if( !p ) - p = ppTabLists[ a.nTab ] = new _ScRangeList; + p = ppTabLists[ nTab ] = new _ScRangeList; p->Append( a ); } } -void _ScRangeListTabs::Append( ScComplexRefData a, const BOOL b ) +void _ScRangeListTabs::Append( ScComplexRefData a, SCsTAB nTab, const BOOL b ) { if( b ) { @@ -158,12 +163,17 @@ void _ScRangeListTabs::Append( ScComplexRefData a, const BOOL b ) bHasRanges = TRUE; - if( a.Ref1.nTab >= 0 ) + if( nTab == SCTAB_MAX) + return; + if( nTab < -1) + nTab = a.Ref1.nTab; + + if( nTab >= 0 ) { - _ScRangeList* p = ppTabLists[ a.Ref1.nTab ]; + _ScRangeList* p = ppTabLists[ nTab ]; if( !p ) - p = ppTabLists[ a.Ref1.nTab ] = new _ScRangeList; + p = ppTabLists[ nTab ] = new _ScRangeList; p->Append( a ); } diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 5d21d91c9f53..5c0eac63de92 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -158,16 +158,18 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : } else if( bBuiltIn ) { + SCsTAB const nLocalTab = (nXclTab == EXC_NAME_GLOBAL) ? SCTAB_MAX : (nXclTab - 1); + // --- print ranges or title ranges --- rStrm.PushPosition(); switch( mcBuiltIn ) { case EXC_BUILTIN_PRINTAREA: - if( rFmlaConv.Convert( GetPrintAreaBuffer(), rStrm, nFmlaSize, FT_RangeName ) == ConvOK ) + if( rFmlaConv.Convert( GetPrintAreaBuffer(), rStrm, nFmlaSize, nLocalTab, FT_RangeName ) == ConvOK ) nNameType |= RT_PRINTAREA; break; case EXC_BUILTIN_PRINTTITLES: - if( rFmlaConv.Convert( GetTitleAreaBuffer(), rStrm, nFmlaSize, FT_RangeName ) == ConvOK ) + if( rFmlaConv.Convert( GetTitleAreaBuffer(), rStrm, nFmlaSize, nLocalTab, FT_RangeName ) == ConvOK ) nNameType |= RT_COLHEADER | RT_ROWHEADER; break; } diff --git a/sc/source/filter/inc/excform.hxx b/sc/source/filter/inc/excform.hxx index ed771637b704..5d6041923a37 100644 --- a/sc/source/filter/inc/excform.hxx +++ b/sc/source/filter/inc/excform.hxx @@ -61,7 +61,7 @@ public: virtual ConvErr Convert( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ); - virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, const FORMULA_TYPE eFT = FT_CellFormula ); + virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ); virtual ConvErr ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen, const String& rUrl, const ::std::vector& rTabNames ); @@ -137,7 +137,7 @@ public: virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ); - virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, const FORMULA_TYPE eFT = FT_CellFormula ); + virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ); virtual ConvErr ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen, const String& rUrl, const ::std::vector& rTabNames ); diff --git a/sc/source/filter/inc/formel.hxx b/sc/source/filter/inc/formel.hxx index 6c7d4288c372..8ffb3857ec63 100644 --- a/sc/source/filter/inc/formel.hxx +++ b/sc/source/filter/inc/formel.hxx @@ -151,8 +151,8 @@ public: _ScRangeListTabs( void ); virtual ~_ScRangeListTabs(); - void Append( ScSingleRefData aSRD, const BOOL bLimit = TRUE ); - void Append( ScComplexRefData aCRD, const BOOL bLimit = TRUE ); + void Append( ScSingleRefData aSRD, SCsTAB nTab, const BOOL bLimit = TRUE ); + void Append( ScComplexRefData aCRD, SCsTAB nTab, const BOOL bLimit = TRUE ); inline BOOL HasRanges( void ) const; @@ -213,7 +213,7 @@ public: virtual ConvErr Convert( const ScTokenArray*& rpErg, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) = 0; - virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, + virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ) = 0; }; -- cgit From 833272e9bb6220b63e6d1674283855cd12311bee Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 15 Sep 2010 11:57:32 +0200 Subject: sc-extra-cell-margins.diff: Add extra padding the the cell height n#361358 --- sc/source/core/data/docpool.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 8b2f48d8a2cc..4714286c838f 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -274,7 +274,10 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts ) ppPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_SHRINKTOFIT ); ppPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR ); ppPoolDefaults[ ATTR_BORDER_BLTR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_BLTR ); - ppPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = new SvxMarginItem( ATTR_MARGIN ); + SvxMarginItem* pItem = new SvxMarginItem( ATTR_MARGIN ); + pItem->SetTopMargin( 27 ); + pItem->SetBottomMargin( 27 ); + ppPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = pItem; ppPoolDefaults[ ATTR_MERGE - ATTR_STARTINDEX ] = new ScMergeAttr; ppPoolDefaults[ ATTR_MERGE_FLAG - ATTR_STARTINDEX ] = new ScMergeFlagAttr; ppPoolDefaults[ ATTR_VALUE_FORMAT - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALUE_FORMAT, 0 ); -- cgit From 7e905a8c791eee19d905f6655e4d5f0eeded38a2 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 15 Sep 2010 12:01:56 +0200 Subject: sc-print-selected-sheets.diff: Make Print Preview consistent with Print output n#335684, i#45497 --- sc/source/ui/inc/preview.hxx | 2 ++ sc/source/ui/view/preview.cxx | 10 ++++++++++ sc/source/ui/view/tabvwsh4.cxx | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx index 87d15dcdaf86..41f62c2ce9fc 100644 --- a/sc/source/ui/inc/preview.hxx +++ b/sc/source/ui/inc/preview.hxx @@ -63,6 +63,8 @@ private: ScPreviewLocationData* pLocationData; // stores table layout for accessibility API FmFormView* pDrawView; + SCTAB nCurTab; + // intern: BOOL bInPaint; BOOL bInGetState; diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 83fdab9000e6..3ab6dc140484 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -109,6 +109,7 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView bLocationValid( FALSE ), pLocationData( NULL ), pDrawView( NULL ), + nCurTab ( ScDocShell::GetCurTab() ), bInPaint( FALSE ), bInGetState( FALSE ), pDocShell( pDocSh ), @@ -249,8 +250,17 @@ void ScPreview::CalcPages( SCTAB /*nToWhichTab*/ ) // but always all sheets are used (there is no selected sheet) ScPrintOptions aOptions = SC_MOD()->GetPrintOptions(); + ScMarkData aMarkData; + aMarkData.SelectTable( nCurTab, TRUE ); + for (SCTAB i=nStart; i 0 ? nFirstAttr[i-1] : 1; long nThisStart = nTotalPages; diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index ed09ec85ee8c..55f6e9c2f796 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1189,8 +1189,13 @@ PrintDialog* __EXPORT ScTabViewShell::CreatePrintDialog( Window *pParent ) // instead of a separate progress for each sheet from ScPrintFunc pDocShell->UpdatePendingRowHeights( MAXTAB, true ); + ScMarkData aMarkData; + aMarkData.SelectTable( GetViewData()->GetTabNo(), TRUE ); + for ( SCTAB i=0; i Date: Wed, 15 Sep 2010 12:05:15 +0200 Subject: sc-print-lines.diff: print & page preview for files containing only lines n#351468, i#85076 --- sc/source/core/data/column2.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 2adf6d926f0f..fadd75248a66 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1321,6 +1321,10 @@ BOOL ScColumn::IsEmpty() const BOOL ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow, bool bIgnoreNotes) const { + Rectangle aRect; + if (pAttrArray->HasLines(nStartRow, nEndRow, aRect, TRUE, TRUE)) + return FALSE; + if ( nCount == 0 || !pItems ) return TRUE; -- cgit From 8c929c317b4c69d1f5933a95e7c34c1d24f7fb8e Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 15 Sep 2010 12:07:16 +0200 Subject: calc-filter-xml-free-context.diff: Don't use pShapeContext after deleting it n#467536 --- sc/source/filter/xml/xmlannoi.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx index 14fc34954564..8db7a554256c 100644 --- a/sc/source/filter/xml/xmlannoi.cxx +++ b/sc/source/filter/xml/xmlannoi.cxx @@ -192,6 +192,7 @@ void ScXMLAnnotationContext::EndElement() { pShapeContext->EndElement(); delete pShapeContext; + pShapeContext = NULL; } mrAnnotationData.maAuthor = maAuthorBuffer.makeStringAndClear(); -- cgit From 879dfb1acaaffa5eb6a44c84561235ff55d2c8b3 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 12:14:58 +0200 Subject: sc-natural-sort.diff: Add a 'Natural' variant of sorting i#26565 --- sc/inc/dbcolect.hxx | 1 + sc/inc/sc.hrc | 1 + sc/inc/sortparam.hxx | 1 + sc/sdi/scalc.sdi | 2 +- sc/source/core/data/sortparam.cxx | 6 +- sc/source/core/data/table3.cxx | 166 ++++++++++++++++++++++++++++++++++++-- sc/source/core/tool/dbcolect.cxx | 4 + sc/source/ui/dbgui/tpsort.cxx | 19 +++-- sc/source/ui/inc/sortdlg.hrc | 3 +- sc/source/ui/inc/tpsort.hxx | 7 +- sc/source/ui/src/sortdlg.src | 37 ++++++--- sc/source/ui/view/cellsh2.cxx | 7 +- 12 files changed, 219 insertions(+), 35 deletions(-) diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx index 72356683d1a4..55f476aea296 100644 --- a/sc/inc/dbcolect.hxx +++ b/sc/inc/dbcolect.hxx @@ -60,6 +60,7 @@ private: BOOL bStripData; // SortParam BOOL bSortCaseSens; + BOOL bSortNaturalSort; BOOL bIncludePattern; BOOL bSortInplace; BOOL bSortUserDef; diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index c076bafcf6a3..cc9cc9b582a2 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1124,6 +1124,7 @@ #define SID_SORT_CASESENS (SC_PARAM_START+2) #define SID_SORT_ATTRIBS (SC_PARAM_START+3) #define SID_SORT_USERDEF (SC_PARAM_START+4) +#define SID_SORT_NATURALSORT (SC_PARAM_START+5) // Resourcen ------------------------------------------------------------- diff --git a/sc/inc/sortparam.hxx b/sc/inc/sortparam.hxx index 650293893678..9791939cde35 100644 --- a/sc/inc/sortparam.hxx +++ b/sc/inc/sortparam.hxx @@ -49,6 +49,7 @@ struct SC_DLLPUBLIC ScSortParam BOOL bHasHeader; BOOL bByRow; BOOL bCaseSens; + BOOL bNaturalSort; BOOL bUserDef; USHORT nUserIndex; BOOL bIncludePattern; diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 6d55f05874d7..9a5d959d9d5b 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -1574,7 +1574,7 @@ SfxVoidItem DataSelect SID_DATA_SELECT //-------------------------------------------------------------------------- SfxVoidItem DataSort SID_SORT -(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6) +(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem NaturalSort SID_SORT_NATURALSORT,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6) [ /* flags: */ AutoUpdate = FALSE, diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx index 9e8d355e74fa..a3f6fe91133a 100644 --- a/sc/source/core/data/sortparam.cxx +++ b/sc/source/core/data/sortparam.cxx @@ -48,7 +48,7 @@ ScSortParam::ScSortParam() ScSortParam::ScSortParam( const ScSortParam& r ) : nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2), - bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens), + bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),bNaturalSort(r.bNaturalSort), bUserDef(r.bUserDef),nUserIndex(r.nUserIndex),bIncludePattern(r.bIncludePattern), bInplace(r.bInplace), nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow), @@ -71,7 +71,7 @@ void ScSortParam::Clear() nCompatHeader = 2; nDestTab = 0; nUserIndex = 0; - bHasHeader=bCaseSens=bUserDef = FALSE; + bHasHeader=bCaseSens=bUserDef=bNaturalSort = FALSE; bByRow=bIncludePattern=bInplace = TRUE; aCollatorLocale = ::com::sun::star::lang::Locale(); aCollatorAlgorithm.Erase(); @@ -94,6 +94,7 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r ) nRow2 = r.nRow2; bHasHeader = r.bHasHeader; bCaseSens = r.bCaseSens; + bNaturalSort = r.bNaturalSort; bByRow = r.bByRow; bUserDef = r.bUserDef; nUserIndex = r.nUserIndex; @@ -135,6 +136,7 @@ BOOL ScSortParam::operator==( const ScSortParam& rOther ) const && (bHasHeader == rOther.bHasHeader) && (bByRow == rOther.bByRow) && (bCaseSens == rOther.bCaseSens) + && (bNaturalSort == rOther.bNaturalSort) && (bUserDef == rOther.bUserDef) && (nUserIndex == rOther.nUserIndex) && (bIncludePattern == rOther.bIncludePattern) diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index bd6a2c92c442..edda2148dcb6 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -62,6 +62,143 @@ #include +using namespace ::com::sun::star; + +namespace naturalsort { + +using namespace ::com::sun::star::i18n; + +/** Splits a given string into three parts: the prefix, number string, and + the suffix. + + @param sWhole + Original string to be split into pieces + + @param sPrefix + Prefix string that consists of the part before the first number token + + @param sSuffix + String after the last number token. This may still contain number strings. + + @param fNum + Number converted from the middle number string + + @return Returns TRUE if a numeral element is found in a given string, or + FALSE if no numeral element is found. +*/ +bool SplitString( const rtl::OUString &sWhole, + rtl::OUString &sPrefix, rtl::OUString &sSuffix, double &fNum ) +{ + i18n::LocaleDataItem aLocaleItem = ScGlobal::pLocaleData->getLocaleItem(); + + // Get prefix element + rtl::OUString sEmpty, sUser = rtl::OUString::createFromAscii( "-" ); + ParseResult aPRPre = ScGlobal::pCharClass->parsePredefinedToken( + KParseType::IDENTNAME, sWhole, 0, + KParseTokens::ANY_LETTER, sUser, KParseTokens::ANY_LETTER, sUser ); + sPrefix = sWhole.copy( 0, aPRPre.EndPos ); + + // Return FALSE if no numeral element is found + if ( aPRPre.EndPos == sWhole.getLength() ) + return false; + + // Get numeral element + sUser = aLocaleItem.decimalSeparator; + ParseResult aPRNum = ScGlobal::pCharClass->parsePredefinedToken( + KParseType::ANY_NUMBER, sWhole, aPRPre.EndPos, + KParseTokens::ANY_NUMBER, sEmpty, KParseTokens::ANY_NUMBER, sUser ); + + if ( aPRNum.EndPos == aPRPre.EndPos ) + return false; + + fNum = aPRNum.Value; + sSuffix = sWhole.copy( aPRNum.EndPos ); + + return true; +} + +/** Naturally compares two given strings. + + This is the main function that should be called externally. It returns + either 1, 0, or -1 depending on the comparison result of given two strings. + + @param sInput1 + Input string 1 + + @param sInput2 + Input string 2 + + @param bCaseSens + Boolean value for case sensitivity + + @param pData + Pointer to user defined sort list + + @param pCW + Pointer to collator wrapper for normal string comparison + + @return Returnes 1 if sInput1 is greater, 0 if sInput1 == sInput2, and -1 if + sInput2 is greater. +*/ +short Compare( const String &sInput1, const String &sInput2, + const BOOL bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW ) +{ + rtl::OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2; + + do + { + double nNum1, nNum2; + BOOL bNumFound1 = SplitString( sStr1, sPre1, sSuf1, nNum1 ); + BOOL bNumFound2 = SplitString( sStr2, sPre2, sSuf2, nNum2 ); + + short nPreRes; // Prefix comparison result + if ( pData ) + { + if ( bCaseSens ) + { + if ( !bNumFound1 || !bNumFound2 ) + return static_cast(pData->Compare( sStr1, sStr2 )); + else + nPreRes = pData->Compare( sPre1, sPre2 ); + } + else + { + if ( !bNumFound1 || !bNumFound2 ) + return static_cast(pData->ICompare( sStr1, sStr2 )); + else + nPreRes = pData->ICompare( sPre1, sPre2 ); + } + } + else + { + if ( !bNumFound1 || !bNumFound2 ) + return static_cast(pCW->compareString( sStr1, sStr2 )); + else + nPreRes = static_cast(pCW->compareString( sPre1, sPre2 )); + } + + // Prefix strings differ. Return immediately. + if ( nPreRes != 0 ) return nPreRes; + + if ( nNum1 != nNum2 ) + { + if ( nNum1 < nNum2 ) return -1; + return static_cast( nNum1 > nNum2 ); + } + + // The prefix and the first numerical elements are equal, but the suffix + // strings may still differ. Stay in the loop. + + sStr1 = sSuf1; + sStr2 = sSuf2; + + } while (true); + + return 0; +} + +} + // STATIC DATA ----------------------------------------------------------- const USHORT nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam @@ -280,25 +417,40 @@ short ScTable::CompareCell( USHORT nSort, ((ScStringCell*)pCell2)->GetString(aStr2); else GetString(nCell2Col, nCell2Row, aStr2); - BOOL bUserDef = aSortParam.bUserDef; + + BOOL bUserDef = aSortParam.bUserDef; // custom sort order + BOOL bNaturalSort = aSortParam.bNaturalSort; // natural sort + BOOL bCaseSens = aSortParam.bCaseSens; // case sensitivity + if (bUserDef) { ScUserListData* pData = - (ScUserListData*)(ScGlobal::GetUserList()->At( - aSortParam.nUserIndex)); + static_cast( (ScGlobal::GetUserList()->At( + aSortParam.nUserIndex)) ); + if (pData) { - if ( aSortParam.bCaseSens ) - nRes = sal::static_int_cast( pData->Compare(aStr1, aStr2) ); + if ( bNaturalSort ) + nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, pData, pSortCollator ); else - nRes = sal::static_int_cast( pData->ICompare(aStr1, aStr2) ); + { + if ( bCaseSens ) + nRes = sal::static_int_cast( pData->Compare(aStr1, aStr2) ); + else + nRes = sal::static_int_cast( pData->ICompare(aStr1, aStr2) ); + } } else bUserDef = FALSE; } if (!bUserDef) - nRes = (short) pSortCollator->compareString( aStr1, aStr2 ); + { + if ( bNaturalSort ) + nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, NULL, pSortCollator ); + else + nRes = static_cast( pSortCollator->compareString( aStr1, aStr2 ) ); + } } else if ( bStr1 ) // String <-> Zahl nRes = 1; // Zahl vorne diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx index 7f94cb64c827..141389d76ec1 100644 --- a/sc/source/core/tool/dbcolect.cxx +++ b/sc/source/core/tool/dbcolect.cxx @@ -102,6 +102,7 @@ ScDBData::ScDBData( const ScDBData& rData ) : bKeepFmt (rData.bKeepFmt), bStripData (rData.bStripData), bSortCaseSens (rData.bSortCaseSens), + bSortNaturalSort (rData.bSortNaturalSort), bIncludePattern (rData.bIncludePattern), bSortInplace (rData.bSortInplace), bSortUserDef (rData.bSortUserDef), @@ -196,6 +197,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData) bKeepFmt = rData.bKeepFmt; bStripData = rData.bStripData; bSortCaseSens = rData.bSortCaseSens; + bSortNaturalSort = rData.bSortNaturalSort; bIncludePattern = rData.bIncludePattern; bSortInplace = rData.bSortInplace; nSortDestTab = rData.nSortDestTab; @@ -448,6 +450,7 @@ void ScDBData::GetSortParam( ScSortParam& rSortParam ) const rSortParam.bByRow = bByRow; rSortParam.bHasHeader = bHasHeader; rSortParam.bCaseSens = bSortCaseSens; + rSortParam.bNaturalSort = bSortNaturalSort; rSortParam.bInplace = bSortInplace; rSortParam.nDestTab = nSortDestTab; rSortParam.nDestCol = nSortDestCol; @@ -468,6 +471,7 @@ void ScDBData::GetSortParam( ScSortParam& rSortParam ) const void ScDBData::SetSortParam( const ScSortParam& rSortParam ) { bSortCaseSens = rSortParam.bCaseSens; + bSortNaturalSort = rSortParam.bNaturalSort; bIncludePattern = rSortParam.bIncludePattern; bSortInplace = rSortParam.bInplace; nSortDestTab = rSortParam.nDestTab; diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 18c1eb25664a..8fcea2a0e7e7 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -564,6 +564,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, aBtnHeader ( this, ScResId( BTN_LABEL ) ), aBtnFormats ( this, ScResId( BTN_FORMATS ) ), aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ), + aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ), aLbOutPos ( this, ScResId( LB_OUTAREA ) ), aEdOutPos ( this, ScResId( ED_OUTAREA ) ), aBtnSortUser ( this, ScResId( BTN_SORT_USER ) ), @@ -575,7 +576,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, aLineDirection ( this, ScResId( FL_DIRECTION ) ), aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ), aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ), - aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), +// aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), // aFtArea ( this, ScResId( FT_AREA ) ), // #if ENABLE_LAYOUT_EXPERIMENTAL @@ -619,8 +620,8 @@ __EXPORT ScTabPageSortOptions::~ScTabPageSortOptions() void ScTabPageSortOptions::Init() { - aStrAreaLabel = aFtAreaLabel.GetText(); - aStrAreaLabel.Append( (sal_Unicode) ' ' ); +// aStrAreaLabel = aFtAreaLabel.GetText(); +// aStrAreaLabel.Append( (sal_Unicode) ' ' ); // CollatorRessource has user-visible names for sort algorithms pColRes = new CollatorRessource(); @@ -699,8 +700,8 @@ void ScTabPageSortOptions::Init() theArea += ')'; //aFtArea.SetText( theArea ); - theArea.Insert( aStrAreaLabel, 0 ); - aFtAreaLabel.SetText( theArea ); + //theArea.Insert( aStrAreaLabel, 0 ); + //aFtAreaLabel.SetText( theArea ); aBtnHeader.SetText( aStrColLabel ); } @@ -749,9 +750,10 @@ void __EXPORT ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) aLbSortUser.SelectEntryPos( 0 ); } - aBtnCase.Check ( rSortData.bCaseSens ); - aBtnFormats.Check ( rSortData.bIncludePattern ); - aBtnHeader.Check ( rSortData.bHasHeader ); + aBtnCase.Check ( rSortData.bCaseSens ); + aBtnFormats.Check ( rSortData.bIncludePattern ); + aBtnHeader.Check ( rSortData.bHasHeader ); + aBtnNaturalSort.Check ( rSortData.bNaturalSort ); if ( rSortData.bByRow ) { @@ -817,6 +819,7 @@ BOOL __EXPORT ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) theSortData.bByRow = aBtnTopDown.IsChecked(); theSortData.bHasHeader = aBtnHeader.IsChecked(); theSortData.bCaseSens = aBtnCase.IsChecked(); + theSortData.bNaturalSort = aBtnNaturalSort.IsChecked(); theSortData.bIncludePattern = aBtnFormats.IsChecked(); theSortData.bInplace = !aBtnCopyResult.IsChecked(); theSortData.nDestCol = theOutPos.Col(); diff --git a/sc/source/ui/inc/sortdlg.hrc b/sc/source/ui/inc/sortdlg.hrc index 387690531cfd..d079ea560779 100644 --- a/sc/source/ui/inc/sortdlg.hrc +++ b/sc/source/ui/inc/sortdlg.hrc @@ -63,7 +63,7 @@ #define LB_SORT_USER 2 #define LB_OUTAREA 3 #define ED_OUTAREA 4 -#define FT_AREA_LABEL 5 +//#define FT_AREA_LABEL 5 //#define FT_AREA 6 #define BTN_SORT_USER 7 #define BTN_CASESENSITIVE 8 @@ -78,6 +78,7 @@ #define LB_LANGUAGE 17 #define FT_ALGORITHM 18 #define LB_ALGORITHM 19 +#define BTN_NATURALSORT 20 //#define RID_SCDLG_SORT_WARNING #define FT_TEXT 1 diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx index d1ba772a8ca2..6b7a11f10802 100644 --- a/sc/source/ui/inc/tpsort.hxx +++ b/sc/source/ui/inc/tpsort.hxx @@ -50,7 +50,7 @@ class ScSortDlg; struct ScSortParam; //======================================================================== -// Kriterien +// Kriterien (Sort Criteria) class ScTabPageSortFields : public SfxTabPage { @@ -122,7 +122,7 @@ private: }; //======================================================================== -// Sortieroptionen: +// Sortieroptionen (Sort Options) class ScDocument; class ScRangeData; @@ -164,6 +164,7 @@ private: CheckBox aBtnCase; CheckBox aBtnHeader; CheckBox aBtnFormats; + CheckBox aBtnNaturalSort; CheckBox aBtnCopyResult; ListBox aLbOutPos; @@ -181,7 +182,7 @@ private: RadioButton aBtnTopDown; RadioButton aBtnLeftRight; - FixedText aFtAreaLabel; +// FixedText aFtAreaLabel; // FixedInfo aFtArea; LocalizedString aStrRowLabel; LocalizedString aStrColLabel; diff --git a/sc/source/ui/src/sortdlg.src b/sc/source/ui/src/sortdlg.src index 3aca09211edd..1062eb58e1dc 100644 --- a/sc/source/ui/src/sortdlg.src +++ b/sc/source/ui/src/sortdlg.src @@ -151,17 +151,28 @@ TabPage RID_SCPAGE_SORT_OPTIONS Text [ en-US ] = "Include ~formats" ; TabStop = TRUE ; }; - CheckBox BTN_COPYRESULT + CheckBox BTN_NATURALSORT { Pos = MAP_APPFONT ( 12 , 48 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ de ] = "Enable ~natural sort" ; + Text [ en-US ] = "Enable ~natural sort" ; + Text [ cs ] = "Aktivovat přirozené třídění" ; + Text [ sk ] = "Aktivovať prirodzené triedenie" ; + TabStop = TRUE ; + Text [ x-comment ] = " " ; + }; + CheckBox BTN_COPYRESULT + { + Pos = MAP_APPFONT ( 12 , 62 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; Text [ en-US ] = "~Copy sort results to:" ; TabStop = TRUE ; }; ListBox LB_OUTAREA { Border = TRUE ; - Pos = MAP_APPFONT ( 20 , 59 ) ; + Pos = MAP_APPFONT ( 20 , 73 ) ; Size = MAP_APPFONT ( 93 , 90 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -170,13 +181,13 @@ TabPage RID_SCPAGE_SORT_OPTIONS { Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 119 , 59 ) ; + Pos = MAP_APPFONT ( 119 , 73 ) ; Size = MAP_APPFONT ( 132 , 12 ) ; TabStop = TRUE ; }; CheckBox BTN_SORT_USER { - Pos = MAP_APPFONT ( 12 , 75 ) ; + Pos = MAP_APPFONT ( 12 , 89 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; Text [ en-US ] = "Custom sort ~order" ; TabStop = TRUE ; @@ -185,21 +196,21 @@ TabPage RID_SCPAGE_SORT_OPTIONS { Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 20 , 86 ) ; + Pos = MAP_APPFONT ( 20 , 100 ) ; Size = MAP_APPFONT ( 231 , 90 ) ; TabStop = TRUE ; DropDown = TRUE ; }; FixedText FT_LANGUAGE { - Pos = MAP_APPFONT ( 12 , 104 ) ; + Pos = MAP_APPFONT ( 12 , 118 ) ; Size = MAP_APPFONT ( 101 , 8 ) ; Text [ en-US ] = "~Language"; }; ListBox LB_LANGUAGE { Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 115 ) ; + Pos = MAP_APPFONT ( 12 , 129 ) ; Size = MAP_APPFONT ( 101 , 90 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -207,44 +218,46 @@ TabPage RID_SCPAGE_SORT_OPTIONS }; FixedText FT_ALGORITHM { - Pos = MAP_APPFONT ( 119 , 104 ) ; + Pos = MAP_APPFONT ( 119 , 118 ) ; Size = MAP_APPFONT ( 132 , 8 ) ; Text [ en-US ] = "O~ptions"; }; ListBox LB_ALGORITHM { Border = TRUE ; - Pos = MAP_APPFONT ( 119 , 115 ) ; + Pos = MAP_APPFONT ( 119 , 129 ) ; Size = MAP_APPFONT ( 132 , 90 ) ; TabStop = TRUE ; DropDown = TRUE ; }; FixedLine FL_DIRECTION { - Pos = MAP_APPFONT ( 6 , 133 ) ; + Pos = MAP_APPFONT ( 6 , 147 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; Text [ en-US ] = "Direction" ; }; RadioButton BTN_TOP_DOWN { - Pos = MAP_APPFONT ( 12 , 144 ) ; + Pos = MAP_APPFONT ( 12 , 158 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; Text [ en-US ] = "~Top to bottom (sort rows)" ; TabStop = TRUE ; }; RadioButton BTN_LEFT_RIGHT { - Pos = MAP_APPFONT ( 12 , 158 ) ; + Pos = MAP_APPFONT ( 12 , 172 ) ; Size = MAP_APPFONT ( 242 , 10 ) ; Text [ en-US ] = "L~eft to right (sort columns)" ; TabStop = TRUE ; }; +/* FixedText FT_AREA_LABEL { Pos = MAP_APPFONT ( 6 , 171 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; Text [ en-US ] = "Data area:" ; }; +*/ }; TabDialog RID_SCDLG_SORT { diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 086160263739..c46d4c5558e5 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -438,6 +438,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) aSortParam.bHasHeader = bHasHeader; aSortParam.bByRow = TRUE; aSortParam.bCaseSens = FALSE; + aSortParam.bNaturalSort = FALSE; aSortParam.bIncludePattern = TRUE; aSortParam.bInplace = TRUE; aSortParam.bDoSort[0] = TRUE; @@ -489,6 +490,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) aSortParam.bHasHeader = ((const SfxBoolItem*)pItem)->GetValue(); if ( pArgs->GetItemState( SID_SORT_CASESENS, TRUE, &pItem ) == SFX_ITEM_SET ) aSortParam.bCaseSens = ((const SfxBoolItem*)pItem)->GetValue(); + if ( pArgs->GetItemState( SID_SORT_NATURALSORT, TRUE, &pItem ) == SFX_ITEM_SET ) + aSortParam.bNaturalSort = ((const SfxBoolItem*)pItem)->GetValue(); if ( pArgs->GetItemState( SID_SORT_ATTRIBS, TRUE, &pItem ) == SFX_ITEM_SET ) aSortParam.bIncludePattern = ((const SfxBoolItem*)pItem)->GetValue(); if ( pArgs->GetItemState( SID_SORT_USERDEF, TRUE, &pItem ) == SFX_ITEM_SET ) @@ -552,7 +555,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) pDlg = pFact->CreateScSortDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SORT ); DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001 - pDlg->SetCurPageId(1); + pDlg->SetCurPageId(1); // 1=sort field tab 2=sort options tab if ( pDlg->Execute() == RET_OK ) { @@ -571,6 +574,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) rOutParam.bHasHeader ) ); rReq.AppendItem( SfxBoolItem( SID_SORT_CASESENS, rOutParam.bCaseSens ) ); + rReq.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT, + rOutParam.bNaturalSort ) ); rReq.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, rOutParam.bIncludePattern ) ); USHORT nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0; -- cgit From ff7de59de6bbdee615b8337707318e81a4891479 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 12:18:21 +0200 Subject: calc-multiline-pattern-fix.diff: Fix bolding in multi-line cell contents n#359690, n#437137, i#99291 For multi-line cell contents, bolding the first line shouldn't bold the entire cell. --- sc/source/ui/app/inputhdl.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 55aa0986d2ec..601eefa79c03 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2504,13 +2504,27 @@ void ScInputHandler::EnterHandler( BYTE nBlockMode ) USHORT nParCnt = pEngine->GetParagraphCount(); if ( nParCnt == 0 ) nParCnt = 1; + + bool bUniformAttribs = true; + SfxItemSet aPara1Attribs = pEngine->GetAttribs(0, 0, pEngine->GetTextLen(0)); + for (USHORT nPara = 1; nPara < nParCnt; ++nPara) + { + SfxItemSet aPara2Attribs = pEngine->GetAttribs(nPara, 0, pEngine->GetTextLen(nPara)); + if (!(aPara1Attribs == aPara2Attribs)) + { + // paragraph format different from that of the 1st paragraph. + bUniformAttribs = false; + break; + } + } + ESelection aSel( 0, 0, nParCnt-1, pEngine->GetTextLen(nParCnt-1) ); SfxItemSet aOldAttribs = pEngine->GetAttribs( aSel ); const SfxPoolItem* pItem = NULL; // find common (cell) attributes before RemoveAdjust - if ( pActiveViewSh ) + if ( pActiveViewSh && bUniformAttribs ) { SfxItemSet* pCommonAttrs = NULL; for (USHORT nId = EE_CHAR_START; nId <= EE_CHAR_END; nId++) -- cgit From d50261fd21f2e7b6bd83f68f07d1dc078f0de779 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 15 Sep 2010 12:21:49 +0200 Subject: sc-drwlayer-units.diff: Unit conversion fixes in ScDrawLayer i#83735 --- sc/source/core/data/drwlayer.cxx | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) mode change 100644 => 100755 sc/source/core/data/drwlayer.cxx diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx old mode 100644 new mode 100755 index 4df709768279..167f5c2b6e98 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -82,6 +82,10 @@ #include "attrib.hxx" #include "charthelper.hxx" +#ifndef _SV_FIELD_HXX //autogen +#include +#endif + #define DET_ARROW_OFFSET 1000 // Abstand zur naechsten Zelle beim Loeschen (bShrink), damit der Anker @@ -170,16 +174,26 @@ __EXPORT ScTabSizeChangedHint::~ScTabSizeChangedHint() #define MAXMM 10000000 +inline long TwipsToHmm (long nVal) +{ + return static_cast< long >( MetricField::ConvertDoubleValue (static_cast(nVal), 0, 0, + FUNIT_TWIP, FUNIT_100TH_MM) ); +} + +inline long HmmToTwips (long nVal) +{ + return static_cast< long > ( MetricField::ConvertDoubleValue (static_cast(nVal), 0, 0, + FUNIT_100TH_MM, FUNIT_TWIP) ); +} + inline void TwipsToMM( long& nVal ) { - nVal = (long) ( nVal * HMM_PER_TWIPS ); + nVal = TwipsToHmm (nVal); } inline void ReverseTwipsToMM( long& nVal ) { - // reverse the effect of TwipsToMM - round up here (add 1) - - nVal = ((long) ( nVal / HMM_PER_TWIPS )) + 1; + nVal = HmmToTwips (nVal); } void lcl_TwipsToMM( Point& rPoint ) @@ -571,8 +585,8 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b // Berechnung und Werte wie in detfunc.cxx - Size aSize( (long)(pDoc->GetColWidth( nCol1, nTab1 ) * HMM_PER_TWIPS), - (long)(pDoc->GetRowHeight( nRow1, nTab1 ) * HMM_PER_TWIPS) ); + Size aSize( (long)( TwipsToHmm( pDoc->GetColWidth( nCol1, nTab1) ) ), + (long)( TwipsToHmm( pDoc->GetRowHeight( nRow1, nTab1) ) ) ); Rectangle aRect( aPos, aSize ); aRect.Left() -= 250; aRect.Right() += 250; @@ -732,16 +746,16 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co SCCOL nEndCol = rRange.aEnd.Col(); for (i=nStartCol; i<=nEndCol; i++) nEndX += pDoc->GetColWidth(i,nTab); - nStartX = (long)(nStartX * HMM_PER_TWIPS); - nEndX = (long)(nEndX * HMM_PER_TWIPS); + nStartX = TwipsToHmm( nStartX ); + nEndX = TwipsToHmm( nEndX ); } if (!bSetVer) { nStartY = pDoc->GetRowHeight( 0, rRange.aStart.Row()-1, nTab); nEndY = nStartY + pDoc->GetRowHeight( rRange.aStart.Row(), rRange.aEnd.Row(), nTab); - nStartY = (long)(nStartY * HMM_PER_TWIPS); - nEndY = (long)(nEndY * HMM_PER_TWIPS); + nStartY = TwipsToHmm( nStartY ); + nEndY = TwipsToHmm( nEndY ); } if ( bNegativePage ) @@ -799,8 +813,8 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co if (bSetHor) { - nStartX = (long) (nStartX / HMM_PER_TWIPS); - nEndX = (long) (nEndX / HMM_PER_TWIPS); + nStartX = HmmToTwips( nStartX ); + nEndX = HmmToTwips( nEndX ); long nWidth; SCCOL i; @@ -817,8 +831,8 @@ BOOL ScDrawLayer::GetPrintArea( ScRange& rRange, BOOL bSetHor, BOOL bSetVer ) co if (bSetVer) { - nStartY = (long) (nStartY / HMM_PER_TWIPS); - nEndY = (long) (nEndY / HMM_PER_TWIPS); + nStartY = HmmToTwips( nStartY ); + nEndY = HmmToTwips( nEndY ); SCROW nRow = pDoc->GetRowForHeight( nTab, nStartY); rRange.aStart.SetRow( nRow>0 ? (nRow-1) : 0); nRow = pDoc->GetRowForHeight( nTab, nEndY); -- cgit From 0018eb8a1e2aaa52ce3a798a958331e59f68250a Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 12:24:31 +0200 Subject: sc-excel-chart-default-xlabels.diff: Change x-y plot chart numbering scheme n#257079, i#83679 Change default numbering scheme of x-y plot chart from Row 1, Row2, ... to 1, 2, 3... when the X labels are not explicitly given. This is what Excel does. --- sc/source/ui/unoobj/chart2uno.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 8a8081e412d3..f87818553ee1 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -3690,14 +3690,9 @@ uno::Sequence< rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::getTextualDat } else { - for (sal_Int32 nRow = p->aStart.Row(); nRow <= p->aEnd.Row(); ++nRow) - { - String aString = ScGlobal::GetRscString(STR_ROW); - aString += ' '; - aString += String::CreateFromInt32( nRow+1 ); - pArr[nCount] = aString; - ++nCount; - } + sal_Int32 n = p->aEnd.Row() - p->aStart.Row() + 1; + for (sal_Int32 i = 0; i < n; ++i) + pArr[nCount++] = String::CreateFromInt32( i+1 ); } } return aSeq; -- cgit From 4ef978de83610b0e1912bce1d59432b9c382b9fc Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 12:28:47 +0200 Subject: sc-overwrite-char-font-attrs.diff: overwrite character level font attributes n#374580, i#53545, i#96853 Overwrite character level font attributes when changing them at cell level --- sc/inc/attarray.hxx | 10 ++++- sc/inc/cell.hxx | 51 ++++++++++++++++++++++ sc/inc/column.hxx | 6 ++- sc/inc/document.hxx | 6 ++- sc/inc/table.hxx | 6 ++- sc/source/core/data/attarray.cxx | 37 ++++++++++++++-- sc/source/core/data/cell2.cxx | 94 ++++++++++++++++++++++++++++++++++++++++ sc/source/core/data/column.cxx | 9 ++-- sc/source/core/data/document.cxx | 11 ++--- sc/source/core/data/table2.cxx | 9 ++-- sc/source/ui/docshell/docsh.cxx | 46 ++++++++++---------- sc/source/ui/inc/undoblk.hxx | 7 +++ sc/source/ui/inc/undocell.hxx | 11 ++++- sc/source/ui/undo/undoblk3.cxx | 26 +++++++++++ sc/source/ui/undo/undocell.cxx | 24 ++++++++-- sc/source/ui/view/viewfunc.cxx | 37 +++++++++++----- 16 files changed, 326 insertions(+), 64 deletions(-) diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 11b21bab0162..c8bd4c330677 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -32,6 +32,7 @@ #include "attrib.hxx" class ScDocument; +class ScEditDataArray; class ScMarkArray; class ScPatternAttr; class ScStyleSheet; @@ -102,6 +103,9 @@ friend void lcl_IterGetNumberFormat( ULONG& nFormat, SCROW nStartRow, SCROW nEndRow, BOOL bLeft, SCCOL nDistRight, BOOL bTop, SCROW nDistBottom ); + void RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow, + const ScPatternAttr* pPattern, ScEditDataArray* pDataArray ); + public: ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc ); ~ScAttrArray(); @@ -124,9 +128,11 @@ public: SCROW nStartRow, SCROW nEndRow, BOOL bLeft, SCCOL nDistRight ); void SetPattern( SCROW nRow, const ScPatternAttr* pPattern, BOOL bPutToPool = FALSE ); - void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pPattern, BOOL bPutToPool = FALSE); + void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pPattern, + BOOL bPutToPool = FALSE, ScEditDataArray* pDataArray = NULL ); void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* pStyle ); - void ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache ); + void ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache, + ScEditDataArray* pDataArray = NULL ); void ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, const SvxBorderLine* pLine, BOOL bColorOnly ); diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index ad9ed02a0415..fcedbbb06335 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -31,6 +31,9 @@ #include #include +#include +#include + #include #include #include "global.hxx" @@ -56,6 +59,7 @@ class SvtBroadcaster; class ScCodeArray; class ScProgress; class ScPostIt; +class ScPatternAttr; // ============================================================================ @@ -276,6 +280,53 @@ public: void GetString( String& rString ) const; const EditTextObject* GetData() const { return pData; } + + /** Removes character attribute based on new pattern attributes. */ + void RemoveCharAttribs( const ScPatternAttr& rAttr ); +}; + +// ============================================================================ + +class ScEditDataArray +{ +public: + class Item + { + public: + explicit Item(SCTAB nTab, SCCOL nCol, SCROW nRow, + EditTextObject* pOldData, EditTextObject* pNewData); + ~Item(); + + const EditTextObject* GetOldData() const; + const EditTextObject* GetNewData() const; + SCTAB GetTab() const; + SCCOL GetCol() const; + SCROW GetRow() const; + + private: + Item(); // disabled + + private: + ::boost::shared_ptr mpOldData; + ::boost::shared_ptr mpNewData; + SCTAB mnTab; + SCCOL mnCol; + SCROW mnRow; + + }; + + ScEditDataArray(); + ~ScEditDataArray(); + + void AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow, + EditTextObject* pOldData, EditTextObject* pNewData); + + const Item* First(); + const Item* Next(); + +private: + ::std::vector::const_iterator maIter; + ::std::vector maArray; }; // ============================================================================ diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index af6292bbd830..1a021dcb0cce 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -53,6 +53,7 @@ class ScAttrIterator; class ScAttrArray; class ScBaseCell; class ScDocument; +class ScEditDataArray; class ScFormulaCell; class ScMarkData; class ScPatternAttr; @@ -311,7 +312,8 @@ public: void ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr ); void ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr ); - void ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr ); + void ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr, + ScEditDataArray* pDataArray = NULL ); void SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr, BOOL bPutToPool = FALSE ); void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr, BOOL bPutToPool = FALSE ); @@ -343,7 +345,7 @@ public: void RemoveProtected( SCROW nStartRow, SCROW nEndRow ); - SCsROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark ); + SCsROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray = NULL ); void DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ); void ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rMark ); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 5c4685223281..f393b679efed 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1206,7 +1206,8 @@ public: const ScPatternAttr& rAttr ); SC_DLLPUBLIC void ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - const ScMarkData& rMark, const ScPatternAttr& rAttr ); + const ScMarkData& rMark, const ScPatternAttr& rAttr, + ScEditDataArray* pDataArray = NULL ); SC_DLLPUBLIC void ApplyPatternAreaTab( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr& rAttr ); @@ -1268,7 +1269,8 @@ public: SCCOL nVCol, SCROW nVRow, SCTAB nVTab, const String& sValStr, double& nX); - void ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark ); + void ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark, + ScEditDataArray* pDataArray = NULL ); void DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ); void DeleteSelectionTab( SCTAB nTab, USHORT nDelFlag, const ScMarkData& rMark ); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 63cefe22626a..aacce96bc711 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -64,6 +64,7 @@ class ScAutoFormatData; class ScBaseCell; class ScDocument; class ScDrawLayer; +class ScEditDataArray; class ScFormulaCell; class ScOutlineTable; class ScPostIt; @@ -536,7 +537,8 @@ public: void ApplyAttr( SCCOL nCol, SCROW nRow, const SfxPoolItem& rAttr ); void ApplyPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr ); - void ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScPatternAttr& rAttr ); + void ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + const ScPatternAttr& rAttr, ScEditDataArray* pDataArray = NULL ); void SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr, BOOL bPutToPool = FALSE ) { if (ValidColRow(rPos.Col(),rPos.Row())) @@ -567,7 +569,7 @@ public: BOOL ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, INT16 nFlags ); BOOL RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, INT16 nFlags ); - void ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark ); + void ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray = NULL ); void DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark ); void ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rMark ); diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index f3443312bd4e..9d784b373465 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ #include "rechead.hxx" #include "globstr.hrc" #include "segmenttree.hxx" +#include "cell.hxx" #undef DBG_INVALIDATE #define DBGOUTPUT(s) \ @@ -299,8 +301,31 @@ void ScAttrArray::SetPattern( SCROW nRow, const ScPatternAttr* pPattern, BOOL bP SetPatternArea( nRow, nRow, pPattern, bPutToPool ); } +void ScAttrArray::RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow, + const ScPatternAttr* pPattern, ScEditDataArray* pDataArray ) +{ + for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow) + { + ScBaseCell* pCell; + pDocument->GetCell(nCol, nRow, nTab, pCell); + if (pCell && pCell->GetCellType() == CELLTYPE_EDIT) + { + EditTextObject* pOldData = NULL; + ScEditCell* pEditCell = static_cast(pCell); + if (pDataArray) + pOldData = pEditCell->GetData()->Clone(); + pEditCell->RemoveCharAttribs(*pPattern); + if (pDataArray) + { + EditTextObject* pNewData = pEditCell->GetData()->Clone(); + pDataArray->AddItem(nTab, nCol, nRow, pOldData, pNewData); + } + } + } +} -void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr *pPattern, BOOL bPutToPool ) +void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr *pPattern, + BOOL bPutToPool, ScEditDataArray* pDataArray ) { if (ValidRow(nStartRow) && ValidRow(nEndRow)) { @@ -470,6 +495,12 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern pData[nInsert-1].nRow = nStartRow - 1; pData[nInsert].nRow = nEndRow; pData[nInsert].pPattern = pPattern; + + // Remove character attributes from these cells if the pattern + // is applied during normal session. + if (pDataArray) + RemoveCellCharAttribs(nStartRow, nEndRow, pPattern, pDataArray); + nCount++; } @@ -711,7 +742,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, #undef SET_LINE -void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache ) +void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache, ScEditDataArray* pDataArray ) { #ifdef DBG_UTIL TestData(); @@ -746,7 +777,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac { if (nY1 < nStartRow) nY1=nStartRow; if (nY2 > nEndRow) nY2=nEndRow; - SetPatternArea( nY1, nY2, pNewPattern ); + SetPatternArea( nY1, nY2, pNewPattern, false, pDataArray ); Search( nStart, nPos ); } else diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index 1aab26acf3aa..b3e3d2c3eed2 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -51,6 +51,8 @@ #include "editutil.hxx" #include "chgtrack.hxx" #include "externalrefmgr.hxx" +#include "scitems.hxx" +#include "patattr.hxx" using namespace formula; @@ -139,6 +141,28 @@ void ScEditCell::GetString( String& rString ) const rString.Erase(); } +void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr ) +{ + const struct { + USHORT nAttrType; + USHORT nCharType; + } AttrTypeMap[] = { + { ATTR_FONT, EE_CHAR_FONTINFO }, + { ATTR_FONT_HEIGHT, EE_CHAR_FONTHEIGHT }, + { ATTR_FONT_WEIGHT, EE_CHAR_WEIGHT }, + { ATTR_FONT_COLOR, EE_CHAR_COLOR } + }; + USHORT nMapCount = sizeof(AttrTypeMap) / sizeof(AttrTypeMap[0]); + + const SfxItemSet& rSet = rAttr.GetItemSet(); + const SfxPoolItem* pItem; + for (USHORT i = 0; i < nMapCount; ++i) + { + if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SFX_ITEM_SET ) + pData->RemoveCharAttribs(AttrTypeMap[i].nCharType); + } +} + void ScEditCell::SetTextObject( const EditTextObject* pObject, const SfxItemPool* pFromPool ) { @@ -174,6 +198,76 @@ void ScEditCell::SetTextObject( const EditTextObject* pObject, pData = NULL; } +ScEditDataArray::ScEditDataArray() +{ +} + +ScEditDataArray::~ScEditDataArray() +{ +} + +void ScEditDataArray::AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow, + EditTextObject* pOldData, EditTextObject* pNewData) +{ + maArray.push_back(Item(nTab, nCol, nRow, pOldData, pNewData)); +} + +const ScEditDataArray::Item* ScEditDataArray::First() +{ + maIter = maArray.begin(); + if (maIter == maArray.end()) + return NULL; + return &(*maIter++); +} + +const ScEditDataArray::Item* ScEditDataArray::Next() +{ + if (maIter == maArray.end()) + return NULL; + return &(*maIter++); +} + +// ============================================================================ + +ScEditDataArray::Item::Item(SCTAB nTab, SCCOL nCol, SCROW nRow, + EditTextObject* pOldData, EditTextObject* pNewData) : + mnTab(nTab), + mnCol(nCol), + mnRow(nRow) +{ + mpOldData.reset(pOldData); + mpNewData.reset(pNewData); +} + +ScEditDataArray::Item::~Item() +{ +} + +const EditTextObject* ScEditDataArray::Item::GetOldData() const +{ + return mpOldData.get(); +} + +const EditTextObject* ScEditDataArray::Item::GetNewData() const +{ + return mpNewData.get(); +} + +SCTAB ScEditDataArray::Item::GetTab() const +{ + return mnTab; +} + +SCCOL ScEditDataArray::Item::GetCol() const +{ + return mnCol; +} + +SCROW ScEditDataArray::Item::GetRow() const +{ + return mnRow; +} + // ============================================================================ namespace diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index e9fd26ced939..d3c76518c035 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -361,7 +361,7 @@ ULONG ScColumn::GetNumberFormat( SCROW nRow ) const } -SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark ) +SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray ) { SCROW nTop = 0; SCROW nBottom = 0; @@ -372,7 +372,7 @@ SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData ScMarkArrayIter aMarkIter( rMark.GetArray() + nCol ); while (aMarkIter.Next( nTop, nBottom )) { - pAttrArray->ApplyCacheArea( nTop, nBottom, pCache ); + pAttrArray->ApplyCacheArea( nTop, nBottom, pCache, pDataArray ); bFound = TRUE; } } @@ -446,11 +446,12 @@ void ScColumn::ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr ) } -void ScColumn::ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr ) +void ScColumn::ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr, + ScEditDataArray* pDataArray ) { const SfxItemSet* pSet = &rPatAttr.GetItemSet(); SfxItemPoolCache aCache( pDocument->GetPool(), pSet ); - pAttrArray->ApplyCacheArea( nStartRow, nEndRow, &aCache ); + pAttrArray->ApplyCacheArea( nStartRow, nEndRow, &aCache, pDataArray ); } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 1efe32446eef..17763c909b47 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3865,12 +3865,13 @@ void ScDocument::ApplyPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatte void ScDocument::ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark, - const ScPatternAttr& rAttr ) + const ScPatternAttr& rAttr, + ScEditDataArray* pDataArray ) { for (SCTAB i=0; i <= MAXTAB; i++) if (pTab[i]) if (rMark.GetTableSelect(i)) - pTab[i]->ApplyPatternArea( nStartCol, nStartRow, nEndCol, nEndRow, rAttr ); + pTab[i]->ApplyPatternArea( nStartCol, nStartRow, nEndCol, nEndRow, rAttr, pDataArray ); } @@ -4805,7 +4806,7 @@ void ScDocument::ApplyFrameAreaTab( const ScRange& rRange, } -void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark ) +void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark, ScEditDataArray* pDataArray ) { const SfxItemSet* pSet = &rAttr.GetItemSet(); BOOL bSet = FALSE; @@ -4822,7 +4823,7 @@ void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMark ScRange aRange; rMark.GetMarkArea( aRange ); ApplyPatternArea( aRange.aStart.Col(), aRange.aStart.Row(), - aRange.aEnd.Col(), aRange.aEnd.Row(), rMark, rAttr ); + aRange.aEnd.Col(), aRange.aEnd.Row(), rMark, rAttr, pDataArray ); } else { @@ -4830,7 +4831,7 @@ void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMark for (SCTAB nTab=0; nTab<=MAXTAB; nTab++) if (pTab[nTab]) if (rMark.GetTableSelect(nTab)) - pTab[nTab]->ApplySelectionCache( &aCache, rMark ); + pTab[nTab]->ApplySelectionCache( &aCache, rMark, pDataArray ); } } } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index d54e16b8cbd7..66e385a13b85 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1871,14 +1871,14 @@ void ScTable::ApplyPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr ) void ScTable::ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - const ScPatternAttr& rAttr ) + const ScPatternAttr& rAttr, ScEditDataArray* pDataArray ) { if (ValidColRow(nStartCol, nStartRow) && ValidColRow(nEndCol, nEndRow)) { PutInOrder(nStartCol, nEndCol); PutInOrder(nStartRow, nEndRow); for (SCCOL i = nStartCol; i <= nEndCol; i++) - aCol[i].ApplyPatternArea(nStartRow, nEndRow, rAttr); + aCol[i].ApplyPatternArea(nStartRow, nEndRow, rAttr, pDataArray); } } @@ -2074,10 +2074,11 @@ void ScTable::ApplyAttr( SCCOL nCol, SCROW nRow, const SfxPoolItem& rAttr ) } -void ScTable::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark ) +void ScTable::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, + ScEditDataArray* pDataArray ) { for (SCCOL i=0; i<=MAXCOL; i++) - aCol[i].ApplySelectionCache( pCache, rMark ); + aCol[i].ApplySelectionCache( pCache, rMark, pDataArray ); } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index d5d7f6e09292..99b7cb1e2483 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -394,6 +394,27 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) aDocument.DisableIdle( FALSE ); } +namespace { + +class LoadMediumGuard +{ +public: + explicit LoadMediumGuard(ScDocument* pDoc) : + mpDoc(pDoc) + { + mpDoc->SetLoadingMedium(true); + } + + ~LoadMediumGuard() + { + mpDoc->SetLoadingMedium(false); + } +private: + ScDocument* mpDoc; +}; + +} + BOOL ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor ) { RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScDocShell::LoadXML" ); @@ -450,7 +471,7 @@ BOOL ScDocShell::SaveXML( SfxMedium* pSaveMedium, const ::com::sun::star::uno::R BOOL __EXPORT ScDocShell::Load( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::Load" ); - + LoadMediumGuard aLoadGuard(&aDocument); ScRefreshTimerProtector( aDocument.GetRefreshTimerControlAddress() ); // only the latin script language is loaded @@ -933,7 +954,7 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) BOOL __EXPORT ScDocShell::LoadFrom( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::LoadFrom" ); - + LoadMediumGuard aLoadGuard(&aDocument); ScRefreshTimerProtector( aDocument.GetRefreshTimerControlAddress() ); WaitObject aWait( GetActiveDialogParent() ); @@ -985,27 +1006,6 @@ static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLa rDateConvert = static_cast(aTokens[1].toInt32()); } -namespace { - -class LoadMediumGuard -{ -public: - explicit LoadMediumGuard(ScDocument* pDoc) : - mpDoc(pDoc) - { - mpDoc->SetLoadingMedium(true); - } - - ~LoadMediumGuard() - { - mpDoc->SetLoadingMedium(false); - } -private: - ScDocument* mpDoc; -}; - -} - BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ConvertFrom" ); diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index 574926ecbf52..b910baccc766 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -32,6 +32,10 @@ #include "viewutil.hxx" #include "spellparam.hxx" +#include "cell.hxx" + +#include + class ScDocShell; class ScBaseCell; class ScDocument; @@ -351,9 +355,11 @@ public: virtual String GetComment() const; + ScEditDataArray* GetDataArray(); private: ScMarkData aMarkData; ScRange aRange; + ScEditDataArray aDataArray; ScDocument* pUndoDoc; BOOL bMulti; ScPatternAttr* pApplyPattern; @@ -361,6 +367,7 @@ private: SvxBoxInfoItem* pLineInner; void DoChange( const BOOL bUndo ); + void ChangeEditData( const bool bUndo ); }; diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx index 53f129166d10..8d7f17f81a85 100644 --- a/sc/source/ui/inc/undocell.hxx +++ b/sc/source/ui/inc/undocell.hxx @@ -31,6 +31,8 @@ #include "undobase.hxx" #include "postit.hxx" +#include + class ScDocShell; class ScBaseCell; class ScPatternAttr; @@ -59,6 +61,11 @@ public: virtual String GetComment() const; + /** once the objects are passed to this class, their life-cycle is + managed by this class; the calling function must pass new'ed + objects to this method. */ + void SetEditData( EditTextObject* pOld, EditTextObject* pNew ); + private: SCCOL nCol; SCROW nRow; @@ -66,9 +73,11 @@ private: ScPatternAttr* pOldPattern; ScPatternAttr* pNewPattern; ScPatternAttr* pApplyPattern; + ::boost::shared_ptr pOldEditData; + ::boost::shared_ptr pNewEditData; BOOL bIsAutomatic; - void DoChange( const ScPatternAttr* pWhichPattern ) const; + void DoChange( const ScPatternAttr* pWhichPattern, const ::boost::shared_ptr& pEditData ) const; }; diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 506afeac138e..4140d85f5051 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -479,6 +479,12 @@ String __EXPORT ScUndoSelectionAttr::GetComment() const return ScGlobal::GetRscString( pLineOuter ? STR_UNDO_SELATTRLINES : STR_UNDO_SELATTR ); } +//---------------------------------------------------------------------------- + +ScEditDataArray* ScUndoSelectionAttr::GetDataArray() +{ + return &aDataArray; +} //---------------------------------------------------------------------------- @@ -497,6 +503,8 @@ void ScUndoSelectionAttr::DoChange( const BOOL bUndo ) USHORT nExtFlags = 0; pDocShell->UpdatePaintExt( nExtFlags, aEffRange ); + ChangeEditData(bUndo); + if (bUndo) // nur bei Undo { ScRange aCopyRange = aRange; @@ -521,6 +529,24 @@ void ScUndoSelectionAttr::DoChange( const BOOL bUndo ) ShowTable( aRange ); } +void ScUndoSelectionAttr::ChangeEditData( const bool bUndo ) +{ + ScDocument* pDoc = pDocShell->GetDocument(); + for (const ScEditDataArray::Item* pItem = aDataArray.First(); pItem; pItem = aDataArray.Next()) + { + ScBaseCell* pCell; + pDoc->GetCell(pItem->GetCol(), pItem->GetRow(), pItem->GetTab(), pCell); + if (!pCell || pCell->GetCellType() != CELLTYPE_EDIT) + continue; + + ScEditCell* pEditCell = static_cast(pCell); + if (bUndo) + pEditCell->SetData(pItem->GetOldData(), NULL); + else + pEditCell->SetData(pItem->GetNewData(), NULL); + } +} + //---------------------------------------------------------------------------- diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index cc13ce9f1412..a9376e5e9b1d 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -54,6 +54,8 @@ #include "sc.hrc" #include "docuno.hxx" +using ::boost::shared_ptr; + // STATIC DATA ----------------------------------------------------------- TYPEINIT1(ScUndoCursorAttr, ScSimpleUndo); @@ -82,6 +84,8 @@ ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell, nCol( nNewCol ), nRow( nNewRow ), nTab( nNewTab ), + pOldEditData( static_cast(NULL) ), + pNewEditData( static_cast(NULL) ), bIsAutomatic( bAutomatic ) { ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool(); @@ -106,9 +110,21 @@ String __EXPORT ScUndoCursorAttr::GetComment() const return ScGlobal::GetRscString( nId ); } -void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern ) const +void ScUndoCursorAttr::SetEditData( EditTextObject* pOld, EditTextObject* pNew ) +{ + pOldEditData.reset(pOld); + pNewEditData.reset(pNew); +} + +void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern, const shared_ptr& pEditData ) const { - pDocShell->GetDocument()->SetPattern( nCol, nRow, nTab, *pWhichPattern, TRUE ); + ScDocument* pDoc = pDocShell->GetDocument(); + pDoc->SetPattern( nCol, nRow, nTab, *pWhichPattern, TRUE ); + + ScBaseCell* pCell; + pDoc->GetCell(nCol, nRow, nTab, pCell); + if (pCell && pCell->GetCellType() == CELLTYPE_EDIT && pEditData.get()) + static_cast(pCell)->SetData(pEditData.get(), NULL); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) @@ -134,7 +150,7 @@ void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern ) const void __EXPORT ScUndoCursorAttr::Undo() { BeginUndo(); - DoChange(pOldPattern); + DoChange(pOldPattern, pOldEditData); if ( bIsAutomatic ) { @@ -152,7 +168,7 @@ void __EXPORT ScUndoCursorAttr::Undo() void __EXPORT ScUndoCursorAttr::Redo() { BeginRedo(); - DoChange(pNewPattern); + DoChange(pNewPattern, pNewEditData); EndRedo(); } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 12fc573973dd..ed812540f9c7 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1313,6 +1313,8 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, SCROW nEndRow = aMarkRange.aEnd.Row(); SCTAB nEndTab = aMarkRange.aEnd.Tab(); + ScUndoSelectionAttr* pUndoAttr = NULL; + ScEditDataArray* pEditDataArray = NULL; if (bRecord) { ScRange aCopyRange = aMarkRange; @@ -1328,15 +1330,14 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, aFuncMark.MarkToMulti(); - pDocSh->GetUndoManager()->AddUndoAction( - new ScUndoSelectionAttr( - pDocSh, aFuncMark, - nStartCol, nStartRow, nStartTab, - nEndCol, nEndRow, nEndTab, - pUndoDoc, bMulti, &rAttr ) ); + pUndoAttr = new ScUndoSelectionAttr( + pDocSh, aFuncMark, nStartCol, nStartRow, nStartTab, + nEndCol, nEndRow, nEndTab, pUndoDoc, bMulti, &rAttr ); + pDocSh->GetUndoManager()->AddUndoAction(pUndoAttr); + pEditDataArray = pUndoAttr->GetDataArray(); } - pDoc->ApplySelectionPattern( rAttr, aFuncMark ); + pDoc->ApplySelectionPattern( rAttr, aFuncMark, pEditDataArray ); pDocSh->PostPaint( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab, @@ -1350,6 +1351,19 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, SCCOL nCol = pViewData->GetCurX(); SCROW nRow = pViewData->GetCurY(); SCTAB nTab = pViewData->GetTabNo(); + + ScBaseCell* pCell; + pDoc->GetCell(nCol, nRow, nTab, pCell); + EditTextObject* pOldEditData = NULL; + EditTextObject* pNewEditData = NULL; + if (pCell && pCell->GetCellType() == CELLTYPE_EDIT) + { + ScEditCell* pEditCell = static_cast(pCell); + pOldEditData = pEditCell->GetData()->Clone(); + pEditCell->RemoveCharAttribs(rAttr); + pNewEditData = pEditCell->GetData()->Clone(); + } + aChangeRanges.Append( ScRange( nCol, nRow, nTab ) ); ScPatternAttr* pOldPat = new ScPatternAttr(*pDoc->GetPattern( nCol, nRow, nTab )); @@ -1359,11 +1373,10 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, if (bRecord) { - pDocSh->GetUndoManager()->AddUndoAction( - new ScUndoCursorAttr( pDocSh, - nCol, nRow, nTab, - pOldPat, pNewPat, &rAttr, - FALSE ) ); // FALSE = nicht automatisch + ScUndoCursorAttr* pUndo = new ScUndoCursorAttr( + pDocSh, nCol, nRow, nTab, pOldPat, pNewPat, &rAttr, false ); + pUndo->SetEditData(pOldEditData, pNewEditData); + pDocSh->GetUndoManager()->AddUndoAction(pUndo); } delete pOldPat; // wird im Undo kopiert (Pool) -- cgit From 98b4e6ddc7a1062b2fb3dc396431b54366925f13 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 12:32:47 +0200 Subject: chart-odf-always-calc-a1.diff: always store ranges in ODF using A1 syntax n#463305 --- sc/inc/rangeutl.hxx | 5 ++++ sc/source/core/tool/rangeutl.cxx | 57 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx index ea5d2a901b54..b5c5ac166852 100644 --- a/sc/inc/rangeutl.hxx +++ b/sc/inc/rangeutl.hxx @@ -35,6 +35,11 @@ #include #include +// Chart always stores cell range addresses using CONV_OOO convention. But +// if parsing with CONV_OOO fails, try parsing it using the current address +// convention. +#define CHART_ADDRESS_CONV_WORKAROUND 1 + //------------------------------------------------------------------------ class SvStream; diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 9f6526a54cf6..a2d624d935f7 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -476,6 +476,11 @@ sal_Bool ScRangeStringConverter::GetAddressFromString( { if ((rAddress.Parse( sToken, const_cast(pDocument), eConv ) & SCA_VALID) == SCA_VALID) return true; +#if CHART_ADDRESS_CONV_WORKAROUND + ::formula::FormulaGrammar::AddressConvention eConvUI = pDocument->GetAddressConvention(); + if (eConv != eConvUI) + return ((rAddress.Parse(sToken, const_cast(pDocument), eConvUI) & SCA_VALID) == SCA_VALID); +#endif } return sal_False; } @@ -502,6 +507,11 @@ sal_Bool ScRangeStringConverter::GetRangeFromString( if ( aUIString.GetChar(0) == (sal_Unicode) '.' ) aUIString.Erase( 0, 1 ); bResult = ((rRange.aStart.Parse( aUIString, const_cast (pDocument), eConv) & SCA_VALID) == SCA_VALID); +#if CHART_ADDRESS_CONV_WORKAROUND + if (!bResult && eConv != eConv) + bResult = ((rRange.aStart.Parse( + aUIString, const_cast(pDocument), eConv) & SCA_VALID) == SCA_VALID); +#endif rRange.aEnd = rRange.aStart; } else @@ -526,6 +536,15 @@ sal_Bool ScRangeStringConverter::GetRangeFromString( eConv) & SCA_VALID) == SCA_VALID) && ((rRange.aEnd.Parse( aUIString.Copy((xub_StrLen)nIndex+1), const_cast(pDocument), eConv) & SCA_VALID) == SCA_VALID); +#if CHART_ADDRESS_CONV_WORKAROUND + if (!bResult && eConv != eConv) + { + bResult = ((rRange.aStart.Parse( aUIString.Copy(0, (xub_StrLen)nIndex), const_cast(pDocument), + eConv) & SCA_VALID) == SCA_VALID) && + ((rRange.aEnd.Parse( aUIString.Copy((xub_StrLen)nIndex+1), const_cast(pDocument), + eConv) & SCA_VALID) == SCA_VALID); + } +#endif } } } @@ -860,6 +879,8 @@ static void lcl_appendCellRangeAddress( void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, const OUString& rXMLRange, ScDocument* pDoc ) { + FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); + const OUString aRangeSep = GetScCompilerNativeSymbol(ocSep); const sal_Unicode cSep = ' '; const sal_Unicode cQuote = '\''; @@ -912,13 +933,37 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con rtl::OUString aBuf; USHORT nRet = aCell1.Parse(aBeginCell, pDoc, FormulaGrammar::CONV_OOO, &aExtInfo1); if ((nRet & SCA_VALID) != SCA_VALID) + { // first cell is invalid. +#if CHART_ADDRESS_CONV_WORKAROUND + if (eConv == FormulaGrammar::CONV_OOO) + continue; + + nRet = aCell1.Parse(aBeginCell, pDoc, eConv, &aExtInfo1); + if ((nRet & SCA_VALID) != SCA_VALID) + // first cell is really invalid. + continue; +#else continue; +#endif + } nRet = aCell2.Parse(aEndCell, pDoc, FormulaGrammar::CONV_OOO, &aExtInfo2); if ((nRet & SCA_VALID) != SCA_VALID) + { // second cell is invalid. +#if CHART_ADDRESS_CONV_WORKAROUND + if (eConv == FormulaGrammar::CONV_OOO) + continue; + + nRet = aCell2.Parse(aEndCell, pDoc, eConv, &aExtInfo2); + if ((nRet & SCA_VALID) != SCA_VALID) + // second cell is really invalid. + continue; +#else continue; +#endif + } if (aExtInfo1.mnFileId != aExtInfo2.mnFileId || aExtInfo1.mbExternal != aExtInfo2.mbExternal) // external info inconsistency. @@ -929,7 +974,7 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con if (bFirst) bFirst = false; else - aRetStr.appendAscii(";"); + aRetStr.append(aRangeSep); lcl_appendCellRangeAddress(aRetStr, pDoc, aCell1, aCell2, aExtInfo1, aExtInfo2); } @@ -940,14 +985,22 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con ScAddress aCell; USHORT nRet = aCell.Parse(aToken, pDoc, ::formula::FormulaGrammar::CONV_OOO, &aExtInfo); if ((nRet & SCA_VALID) != SCA_VALID) + { +#if CHART_ADDRESS_CONV_WORKAROUND + nRet = aCell.Parse(aToken, pDoc, eConv, &aExtInfo); + if ((nRet & SCA_VALID) != SCA_VALID) + continue; +#else continue; +#endif + } // Looks good! if (bFirst) bFirst = false; else - aRetStr.appendAscii(";"); + aRetStr.append(aRangeSep); lcl_appendCellAddress(aRetStr, pDoc, aCell, aExtInfo); } -- cgit From 31b4717cdd1742a200cef4a2134681d667de56ce Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Wed, 15 Sep 2010 11:41:11 +0200 Subject: sc-dp-gridlayout.diff: Something with grid layout :) i#68544, n#190970 --- xmloff/inc/xmloff/xmltoken.hxx | 1 + xmloff/source/core/xmltoken.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index f4843d54ace1..90e9e113e9d7 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -2511,6 +2511,7 @@ namespace xmloff { namespace token { XML_SHOW_FILTER_BUTTON, XML_DRILL_DOWN_ON_DOUBLE_CLICK, + XML_HEADER_GRID_LAYOUT, XML_GROUPED_BY, XML_DAYS, XML_MONTHS, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index a3d4a0c48d02..22c148fd25c1 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -2516,6 +2516,7 @@ namespace xmloff { namespace token { TOKEN( "show-filter-button", XML_SHOW_FILTER_BUTTON ), TOKEN( "drill-down-on-double-click", XML_DRILL_DOWN_ON_DOUBLE_CLICK ), + TOKEN( "header-grid-layout", XML_HEADER_GRID_LAYOUT ), TOKEN( "grouped-by", XML_GROUPED_BY ), TOKEN( "days", XML_DAYS ), TOKEN( "months", XML_MONTHS ), -- cgit From 392e4db4192abb549be4062c48a732a6d04d1753 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 12:12:18 +0200 Subject: sc-save-password-minlength.diff: Display min password length in dialog i#21923 --- sfx2/inc/sfx2/passwd.hxx | 6 ++++++ sfx2/source/dialog/passwd.cxx | 26 ++++++++++++++++++++++++++ sfx2/source/dialog/passwd.hrc | 3 +++ sfx2/source/dialog/passwd.src | 16 ++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx index 4f4a04834257..cad348887670 100644 --- a/sfx2/inc/sfx2/passwd.hxx +++ b/sfx2/inc/sfx2/passwd.hxx @@ -55,6 +55,7 @@ private: Edit maPasswordED; FixedText maConfirmFT; Edit maConfirmED; + FixedText maMinLengthFT; FixedLine maPasswordBox; OKButton maOKBtn; @@ -63,12 +64,17 @@ private: String maConfirmStr; USHORT mnMinLen; + String maMinLenPwdStr; + String maEmptyPwdStr; + String maMainPwdStr; USHORT mnExtras; bool mbAsciiOnly; DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* ); DECL_DLLPRIVATE_LINK( OKHdl, OKButton* ); + void SetPasswdText(); + public: SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL ); diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index e7cc73ca04bf..72415b63cee1 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -103,6 +103,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maPasswordED ( this, SfxResId( ED_PASSWD_PASSWORD ) ), maConfirmFT ( this, SfxResId( FT_PASSWD_CONFIRM ) ), maConfirmED ( this, SfxResId( ED_PASSWD_CONFIRM ) ), + maMinLengthFT ( this, SfxResId( FT_PASSWD_MINLEN ) ), maPasswordBox ( this, SfxResId( GB_PASSWD_PASSWORD ) ), maOKBtn ( this, SfxResId( BTN_PASSWD_OK ) ), maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ), @@ -110,6 +111,9 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ), mnMinLen ( 5 ), + maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ) ), + maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ) ), + maMainPwdStr ( ), mnExtras ( 0 ), mbAsciiOnly ( false ) @@ -123,6 +127,25 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText if ( pGroupText ) maPasswordBox.SetText( *pGroupText ); + +//set the text to the pasword length + SetPasswdText(); +} + +// ----------------------------------------------------------------------- + +void SfxPasswordDialog::SetPasswdText( ) +{ +//set the new string to the minimum password length + if( mnMinLen == 0 ) + maMinLengthFT.SetText( maEmptyPwdStr ); + else + { + maMainPwdStr = maMinLenPwdStr; + maMainPwdStr.SearchAndReplace( String::CreateFromAscii( "$(MINLEN)" ), String::CreateFromInt32((sal_Int32) mnMinLen ), 0); + maMinLengthFT.SetText( maMainPwdStr ); + maMinLengthFT.Show(); + } } // ----------------------------------------------------------------------- @@ -130,6 +153,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText void SfxPasswordDialog::SetMinLen( USHORT nLen ) { mnMinLen = nLen; + SetPasswdText(); EditModifyHdl( NULL ); } @@ -189,8 +213,10 @@ short SfxPasswordDialog::Execute() aPos = maUserED.GetPosPixel(); maPasswordED.SetPosPixel( aPos ); + aPos = maConfirmFT.GetPosPixel(); maConfirmFT.SetPosPixel( aPwdPos1 ); maConfirmED.SetPosPixel( aPwdPos2 ); + maMinLengthFT.SetPosPixel(aPos); } Size aBoxSize = maPasswordBox.GetSizePixel(); diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc index 5be0446fd752..b29af8bae9ee 100644 --- a/sfx2/source/dialog/passwd.hrc +++ b/sfx2/source/dialog/passwd.hrc @@ -36,12 +36,15 @@ #define ED_PASSWD_PASSWORD 14 #define FT_PASSWD_CONFIRM 15 #define ED_PASSWD_CONFIRM 16 +#define FT_PASSWD_MINLEN 17 #define BTN_PASSWD_OK 20 #define BTN_PASSWD_CANCEL 21 #define BTN_PASSWD_HELP 22 #define STR_PASSWD_CONFIRM 30 +#define STR_PASSWD_MIN_LEN 31 +#define STR_PASSWD_EMPTY 32 #endif diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src index fc58ecfda219..bba03b7e8fe9 100644 --- a/sfx2/source/dialog/passwd.src +++ b/sfx2/source/dialog/passwd.src @@ -77,6 +77,22 @@ ModalDialog DLG_PASSWD Pos = MAP_APPFONT( 57, 44 ); Size = MAP_APPFONT( 75, 12 ); }; + + String STR_PASSWD_MIN_LEN + { + Text [ en-US ] = "(Minimum $(MINLEN) characters)" ; + }; + String STR_PASSWD_EMPTY + { + Text [ en-US ] = "(The password can be empty)" ; + }; + + FixedText FT_PASSWD_MINLEN + { + Pos = MAP_APPFONT(12, 65 ); + Size = MAP_APPFONT( 126, 10 ); + }; + FixedLine GB_PASSWD_PASSWORD { Pos = MAP_APPFONT( 6, 3 ); -- cgit From 051069550353d01c88adaa3c94d9395c5e7520ac Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Wed, 15 Sep 2010 14:23:24 +0200 Subject: regcomp-fix-spelling.diff: succesful -> successful, i#113958 --- cpputools/source/registercomponent/registercomponent.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpputools/source/registercomponent/registercomponent.cxx b/cpputools/source/registercomponent/registercomponent.cxx index 70e469ddba23..8aea6252b6bc 100644 --- a/cpputools/source/registercomponent/registercomponent.cxx +++ b/cpputools/source/registercomponent/registercomponent.cxx @@ -584,7 +584,7 @@ void DoIt::operator() (const OUString & url) throw() if ( ! _bSilent ) { - fprintf(stderr, "register component '%s' in registry '%s' succesful!\n", sUrl.getStr(), _sRegName.getStr()); + fprintf(stderr, "register component '%s' in registry '%s' successful!\n", sUrl.getStr(), _sRegName.getStr()); } } @@ -613,7 +613,7 @@ void DoIt::operator() (const OUString & url) throw() if (bRet) { if ( ! _bSilent ) - fprintf(stderr, "revoke component '%s' from registry '%s' succesful!\n", sUrl.getStr(), _sRegName.getStr()); + fprintf(stderr, "revoke component '%s' from registry '%s' successful!\n", sUrl.getStr(), _sRegName.getStr()); } else { -- cgit From bd7a2fdda3a870186bf7122634ee8939d266a1b0 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Wed, 15 Sep 2010 14:42:28 +0200 Subject: about-dialog-cleanup.diff: clean up about dialog, i#111425 --- sfx2/inc/about.hxx | 3 ++- sfx2/inc/sfx2/sfx.hrc | 3 ++- sfx2/source/dialog/about.cxx | 54 ++++++++++++++++++++++---------------------- svx/source/intro/ooo.src | 14 ++++++++---- 4 files changed, 41 insertions(+), 33 deletions(-) diff --git a/sfx2/inc/about.hxx b/sfx2/inc/about.hxx index b3b347917ddc..000f50bd6fca 100644 --- a/sfx2/inc/about.hxx +++ b/sfx2/inc/about.hxx @@ -47,7 +47,7 @@ private: OKButton aOKButton; Image aAppLogo; - FixedInfo aVersionText; + MultiLineEdit aVersionText; MultiLineEdit aCopyrightText; FixedInfo aBuildData; @@ -55,6 +55,7 @@ private: String aDevVersionStr; String aAccelStr; String aVersionData; + String aVersionTextStr; String aCopyrightTextStr; AccelList aAccelList; diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index a49b003b5b49..5daac0b91ae2 100755 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -216,7 +216,8 @@ #define ABOUT_STR_DEVELOPER_ARY 1 #define ABOUT_STR_FRENCH_COPYRIGHT 2 #define ABOUT_STR_ACCEL 3 -#define ABOUT_STR_COPYRIGHT 4 +#define ABOUT_STR_VERSION 4 +#define ABOUT_STR_COPYRIGHT 5 #define RID_APPTITLE (RID_SFX_START+4) #define RID_BUILDVERSION (RID_SFX_START+5) diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx index fab379f9f215..14cf5fb25cc0 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -67,22 +67,6 @@ #define WELCOME_URL DEFINE_CONST_UNICODE( "http://www.openoffice.org/welcome/credits.html" ) // class AboutDialog ----------------------------------------------------- -static void layoutText( FixedInfo &rText, long &nY, long nTextWidth, Size a6Size ) -{ - Point aTextPos = rText.GetPosPixel(); - aTextPos.X() = a6Size.Width() * 2; - aTextPos.Y() = nY; - rText.SetPosPixel( aTextPos ); - - Size aTxtSiz = rText.GetSizePixel(); - aTxtSiz.Width() = nTextWidth; - Size aCalcSize = rText.CalcMinimumSize( nTextWidth ); - aTxtSiz.Height() = aCalcSize.Height(); - rText.SetSizePixel( aTxtSiz ); - - nY += aTxtSiz.Height(); -} - static bool impl_loadBitmap( const rtl::OUString &rPath, const rtl::OUString &rBmpFileName, Image &rLogo ) @@ -158,10 +142,12 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ), aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ), aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ), + // FIXME: What is the purpose of the aBuildData when it is not connected to any widget? aBuildData ( this ), aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ), aDevVersionStr ( rVerStr ), aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ), + aVersionTextStr( ResId( ABOUT_STR_VERSION, *rId.GetResMgr() ) ), aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ), aTimer (), nOff ( 0 ), @@ -181,10 +167,15 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS SetFont( aFont ); // if necessary more info - String sVersion = aVersionText.GetText(); + String sVersion = aVersionTextStr; sVersion.SearchAndReplaceAscii( "$(VER)", Application::GetDisplayName() ); sVersion += '\n'; sVersion += rVerStr; +#ifdef BUILD_VER_STRING + String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) ); + sVersion += '\n'; + sVersion += aBuildString; +#endif aVersionText.SetText( sVersion ); // Initialisierung fuer Aufruf Entwickler @@ -235,28 +226,37 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS aNewFont.SetSize( aSmaller ); aBuildData.SetFont( aNewFont ); aBuildData.SetBackground( aWall ); -#ifdef BUILD_VER_STRING - String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) ); -#else - String aBuildString; -#endif - aBuildData.SetText( aBuildString ); + // FIXME: What is the purpose of the build data? + // they are not showed even when set, so??? + String aBuildDataString; + aBuildData.SetText( aBuildDataString ); aBuildData.Show(); + aCopyrightText.SetText( aCopyrightTextStr ); + // determine size and position of the dialog & elements Size aAppLogoSiz = aAppLogo.GetSizePixel(); Size aOutSiz = GetOutputSizePixel(); aOutSiz.Width() = aAppLogoSiz.Width(); + // analyze size of the aVersionText widget + // character size Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); + // preferred Version widget size + Size aVTSize = aVersionText.CalcMinimumSize(); long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 ); - long nDlgMargin = a6Size.Width() * 4 ; - long nCtrlMargin = a6Size.Height() * 2; + long nDlgMargin = a6Size.Width() * 3 ; + long nCtrlMargin = aVTSize.Height() + ( a6Size.Height() * 2 ); long nTextWidth = aOutSiz.Width() - nDlgMargin; - aCopyrightText.SetText( aCopyrightTextStr ); + // finally set the aVersionText widget position and size + Size aVTCopySize = aVTSize; + Point aVTCopyPnt; + aVTCopySize.Width() = nTextWidth; + aVTCopyPnt.X() = ( aOutSiz.Width() - aVTCopySize.Width() ) / 2; + aVTCopyPnt.Y() = nY; + aVersionText.SetPosSizePixel( aVTCopyPnt, aVTCopySize ); - layoutText( aVersionText, nY, nTextWidth, a6Size ); nY += nCtrlMargin; // OK-Button-Position (at the bottom and centered) diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src index 49f6f68fd7e4..c4500231cce3 100644 --- a/svx/source/intro/ooo.src +++ b/svx/source/intro/ooo.src @@ -75,22 +75,28 @@ ModalDialog RID_DEFAULTABOUT Pos = MAP_APPFONT ( 174 , 6 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; - FixedText ABOUT_FTXT_VERSION + MultiLineEdit ABOUT_FTXT_VERSION { + Border = FALSE ; Pos = MAP_APPFONT ( 54 , 6 ) ; Size = MAP_APPFONT ( 118 , 16 ) ; - WordBreak = TRUE ; - Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ; + IgnoreTab = TRUE ; + ReadOnly = TRUE ; + AutoVScroll = TRUE ; }; MultiLineEdit ABOUT_FTXT_COPYRIGHT { - Border = TRUE ; + Border = FALSE ; Pos = MAP_APPFONT ( 54 , 25 ) ; Size = MAP_APPFONT ( 168 , 51 ) ; IgnoreTab = TRUE ; ReadOnly = TRUE ; AutoVScroll = TRUE ; }; + String ABOUT_STR_VERSION + { + Text[ en-US ] = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION"; + }; String ABOUT_STR_COPYRIGHT { Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by %OOOVENDOR, based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html."; -- cgit From d651046b62f0ed979c3276dc57a82cd6b74f8930 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 15:06:06 +0200 Subject: enable-sheet-protection-options.diff: Enable sheet protection options --- sc/inc/tabprotection.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx index d8dbd45d27fa..128102500b4a 100644 --- a/sc/inc/tabprotection.hxx +++ b/sc/inc/tabprotection.hxx @@ -35,7 +35,7 @@ #include #include -#define ENABLE_SHEET_PROTECTION 0 +#define ENABLE_SHEET_PROTECTION 1 class ScDocument; class ScTableProtectionImpl; -- cgit From e1380111b4057192732ca70b81b4723f00d894b2 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 15:11:13 +0200 Subject: sc-dbrange-dynamic-resize.diff: Dynamically resize filtered range. n#352662, i#85305 Dynamically resize filtered range when new data rows are present. --- sc/inc/dbcolect.hxx | 6 ++++-- sc/inc/document.hxx | 3 +++ sc/inc/queryparam.hxx | 2 ++ sc/source/core/data/documen3.cxx | 14 ++++++++++++++ sc/source/core/data/table3.cxx | 3 ++- sc/source/core/tool/dbcolect.cxx | 16 ++++++++++++---- sc/source/core/tool/queryparam.cxx | 16 +++++++++++++--- sc/source/ui/dbgui/filtdlg.cxx | 2 +- sc/source/ui/inc/dbfunc.hxx | 2 +- sc/source/ui/view/dbfunc.cxx | 15 ++++++++++++--- sc/source/ui/view/gridwin.cxx | 1 + sc/source/ui/view/tabvwshc.cxx | 6 ++++-- 12 files changed, 69 insertions(+), 17 deletions(-) diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx index 55f476aea296..5e61b63500e6 100644 --- a/sc/inc/dbcolect.hxx +++ b/sc/inc/dbcolect.hxx @@ -91,6 +91,7 @@ private: ScQueryConnect eQueryConnect[MAXQUERY]; BOOL bIsAdvanced; // TRUE if created by advanced filter ScRange aAdvSource; // source range + SCROW nDynamicEndRow; // SubTotalParam BOOL bSubRemoveOnly; BOOL bSubReplace; @@ -138,9 +139,10 @@ public: const String& GetName() const { return aName; } void GetName(String& rName) const { rName = aName; } void SetName(const String& rName) { aName = rName; } - void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const; - SC_DLLPUBLIC void GetArea(ScRange& rRange) const; + void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, bool bUseDynamicRange = false) const; + SC_DLLPUBLIC void GetArea(ScRange& rRange, bool bUseDynamicRange = false) const; void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); + void SetDynamicEndRow(SCROW nRow); void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); BOOL IsByRow() const { return bByRow; } void SetByRow(BOOL bByR) { bByRow = bByR; } diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index f393b679efed..e8d84880f0ad 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1475,6 +1475,9 @@ public: SCTAB nTab, ScQueryParam& rQueryParam ); void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr); + /** Update the dynamic end row position of a current data area. */ + void UpdateDynamicEndRow(ScDBData& rDBData) const; + BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates); SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 8e84f1e53e36..12f3842bc26b 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -86,6 +86,8 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT SCTAB nDestTab; SCCOL nDestCol; SCROW nDestRow; + SCROW nDynamicEndRow; + bool bUseDynamicRange; ScQueryParam(); ScQueryParam( const ScQueryParam& r ); diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 8fea4b8af2b9..e95087363090 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1334,6 +1334,18 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, //return FALSE; } +void ScDocument::UpdateDynamicEndRow(ScDBData& rDBData) const +{ + SCCOL nCol1, nCol2; + SCROW nRow1, nRow2; + SCTAB nTab; + rDBData.GetArea(nTab, nCol1, nRow1, nCol2, nRow2); + SCCOL nCol1a = nCol1, nCol2a = nCol2; + SCROW nRow1a = nRow1, nRow2a = nRow2; + GetDataArea(nTab, nCol1a, nRow1a, nCol2a, nRow2a, false, false); + rDBData.SetDynamicEndRow(nRow2a); +} + // // GetFilterEntries - Eintraege fuer AutoFilter-Listbox // @@ -1346,6 +1358,7 @@ BOOL ScDocument::GetFilterEntries( ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!?? if (pDBData) { + UpdateDynamicEndRow(*pDBData); SCTAB nAreaTab; SCCOL nStartCol; SCROW nStartRow; @@ -1357,6 +1370,7 @@ BOOL ScDocument::GetFilterEntries( ScQueryParam aParam; pDBData->GetQueryParam( aParam ); + nEndRow = aParam.nDynamicEndRow; rStrings.SetCaseSensitive( aParam.bCaseSens ); // return all filter entries, if a filter condition is connected with a boolean OR diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index edda2148dcb6..185e5982d370 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -1633,6 +1633,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) BOOL* pSpecial = new BOOL[nEntryCount]; lcl_PrepareQuery( pDocument, this, aParam, pSpecial ); + SCROW nEndRow = aParam.bUseDynamicRange ? aParam.nDynamicEndRow : aParam.nRow2; if (!aParam.bInplace) { nOutRow = aParam.nDestRow + nHeader; @@ -1641,7 +1642,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) aParam.nDestCol, aParam.nDestRow, aParam.nDestTab ); } - for (SCROW j=aParam.nRow1 + nHeader; j<=aParam.nRow2; j++) + for (SCROW j=aParam.nRow1 + nHeader; j<=nEndRow; j++) { BOOL bResult; // Filterergebnis BOOL bValid = ValidQuery(j, aParam, pSpecial); diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx index 141389d76ec1..ae7267f1adbe 100644 --- a/sc/source/core/tool/dbcolect.cxx +++ b/sc/source/core/tool/dbcolect.cxx @@ -378,18 +378,20 @@ String ScDBData::GetOperations() const return aVal; } -void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const +void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, + bool bUseDynamicRange) const { rTab = nTable; rCol1 = nStartCol; rRow1 = nStartRow; rCol2 = nEndCol; - rRow2 = nEndRow; + rRow2 = bUseDynamicRange ? nDynamicEndRow : nEndRow; } -void ScDBData::GetArea(ScRange& rRange) const +void ScDBData::GetArea(ScRange& rRange, bool bUseDynamicRange) const { - rRange = ScRange( nStartCol,nStartRow,nTable, nEndCol,nEndRow,nTable ); + SCROW nNewEndRow = bUseDynamicRange ? nDynamicEndRow : nEndRow; + rRange = ScRange( nStartCol, nStartRow, nTable, nEndCol, nNewEndRow, nTable ); } void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) @@ -401,6 +403,11 @@ void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nEndRow = nRow2; } +void ScDBData::SetDynamicEndRow(SCROW nRow) +{ + nDynamicEndRow = nRow; +} + void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) { USHORT i; @@ -508,6 +515,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const rQueryParam.nDestTab = nQueryDestTab; rQueryParam.nDestCol = nQueryDestCol; rQueryParam.nDestRow = nQueryDestRow; + rQueryParam.nDynamicEndRow = nDynamicEndRow; rQueryParam.Resize( MAXQUERY ); for (SCSIZE i=0; i( nCol2 + nDifX ); nRow2 = sal::static_int_cast( nRow2 + nDifY ); nTab = sal::static_int_cast( nTab + nDifZ ); + nDynamicEndRow = sal::static_int_cast( nDynamicEndRow + nDifY ); size_t n = maEntries.size(); for (size_t i=0; iGetDocShell(); ScDBData* pData = NULL; @@ -179,10 +179,19 @@ ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode, ScGetDBSelection e GetViewData()->GetTabNo() ), eMode, SC_DBSEL_KEEP ); - if ( pData && bMark ) + if (!pData) + return NULL; + + if (bExpandRows) + { + // Dynamically expand rows to include any new data rows that are + // immediately below the original range. + GetViewData()->GetDocument()->UpdateDynamicEndRow(*pData); + } + if (bMark) { ScRange aFound; - pData->GetArea(aFound); + pData->GetArea(aFound, bExpandRows); MarkRange( aFound, FALSE ); } return pData; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index e61e31d35126..59fbffc43a1e 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1314,6 +1314,7 @@ void ScGridWindow::ExecFilter( ULONG nSel, pViewData->GetViewShell()->UpdateInputHandler(); } + aParam.bUseDynamicRange = true; pViewData->GetView()->Query( aParam, NULL, TRUE ); pDBData->SetQueryParam( aParam ); // speichern } diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 7d1cbb05761b..0a14ad6c1eba 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -175,8 +175,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( SCITEM_QUERYDATA, SCITEM_QUERYDATA ); - ScDBData* pDBData = GetDBData( TRUE, SC_DB_MAKE, SC_DBSEL_ROW_DOWN); + ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true, true); pDBData->GetQueryParam( aQueryParam ); + aQueryParam.bUseDynamicRange = true; ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam ); ScRange aAdvSource; @@ -200,8 +201,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( SCITEM_QUERYDATA, SCITEM_QUERYDATA ); - ScDBData* pDBData = GetDBData( TRUE, SC_DB_MAKE, SC_DBSEL_ROW_DOWN); + ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true, true); pDBData->GetQueryParam( aQueryParam ); + aQueryParam.bUseDynamicRange = true; aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, GetViewData(), -- cgit From 5e3d27c198bf6dd05641e6473766c7062c248244 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 15:15:32 +0200 Subject: sc-cellbackground-over-gridlines.diff: Have cell bg paint over the gridlines n#361360, i#3907 --- sc/source/ui/inc/output.hxx | 1 + sc/source/ui/view/gridwin4.cxx | 3 ++- sc/source/ui/view/output.cxx | 27 ++++++++++++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index 42844513af92..6812d9a5181e 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -223,6 +223,7 @@ public: void DrawGrid( BOOL bGrid, BOOL bPage ); void DrawStrings( BOOL bPixelToLogic = FALSE ); + void DrawDocumentBackground(); void DrawBackground(); void DrawShadow(); void DrawExtraShadow(BOOL bLeft, BOOL bTop, BOOL bRight, BOOL bBottom); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index ba73fbf00269..69deeb4e432f 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -729,9 +729,10 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod aOutputData.SetSolidBackground(TRUE); pContentDev->SetMapMode(MAP_PIXEL); - aOutputData.DrawBackground(); + aOutputData.DrawDocumentBackground(); if ( bGridFirst && ( bGrid || bPage ) ) aOutputData.DrawGrid( bGrid, bPage ); + aOutputData.DrawBackground(); if ( bPageMode ) { // #87655# DrawPagePreview draws complete lines/page numbers, must always be clipped diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 7b27ddf3f8cc..38622bf18752 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -795,14 +795,23 @@ BOOL lcl_EqualBack( const RowInfo& rFirst, const RowInfo& rOther, return TRUE; } -void ScOutputData::DrawBackground() +void ScOutputData::DrawDocumentBackground() { - FindRotated(); //! von aussen ? + if ( !bSolidBackground ) + return; - ScModule* pScMod = SC_MOD(); + Size aOnePixel = pDev->PixelToLogic(Size(1,1)); + long nOneX = aOnePixel.Width(); + long nOneY = aOnePixel.Height(); + Rectangle aRect(nScrX - nOneX, nScrY - nOneY, nScrX + nScrW, nScrY + nScrH); + Color aBgColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor ); + pDev->SetFillColor(aBgColor); + pDev->DrawRect(aRect); +} - // used only if bSolidBackground is set (only for ScGridWindow): - Color aBgColor( pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor ); +void ScOutputData::DrawBackground() +{ + FindRotated(); //! von aussen ? Rectangle aRect; Size aOnePixel = pDev->PixelToLogic(Size(1,1)); @@ -851,7 +860,7 @@ void ScOutputData::DrawBackground() long nPosX = nScrX; if ( bLayoutRTL ) nPosX += nMirrorW - nOneX; - aRect = Rectangle( nPosX,nPosY, nPosX,nPosY+nRowHeight-nOneY ); + aRect = Rectangle( nPosX, nPosY-nOneY, nPosX, nPosY+nRowHeight-nOneY ); const SvxBrushItem* pOldBackground = NULL; const SvxBrushItem* pBackground; @@ -899,15 +908,13 @@ void ScOutputData::DrawBackground() if (pOldBackground) // ==0 if hidden { Color aBackCol = pOldBackground->GetColor(); - if ( bSolidBackground && aBackCol.GetTransparency() ) - aBackCol = aBgColor; if ( !aBackCol.GetTransparency() ) //! partial transparency? { pDev->SetFillColor( aBackCol ); pDev->DrawRect( aRect ); } } - aRect.Left() = nPosX; + aRect.Left() = nPosX - nSignedOneX; pOldBackground = pBackground; } nPosX += pRowInfo[0].pCellInfo[nX+1].nWidth * nLayoutSign; @@ -916,8 +923,6 @@ void ScOutputData::DrawBackground() if (pOldBackground) { Color aBackCol = pOldBackground->GetColor(); - if ( bSolidBackground && aBackCol.GetTransparency() ) - aBackCol = aBgColor; if ( !aBackCol.GetTransparency() ) //! partial transparency? { pDev->SetFillColor( aBackCol ); -- cgit From 0701397a485c6cce318fbf8751bf8894dca314c4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 17:11:24 +0200 Subject: sc-cellformat-icon-toggle.diff: Cell number format toolbar icons togglable n#358548, i#86377 Make cell number format toolbar icons togglable & remove the standard format button. --- sc/inc/column.hxx | 1 + sc/inc/document.hxx | 1 + sc/inc/table.hxx | 1 + sc/sdi/formatsh.sdi | 10 +-- sc/source/core/data/column.cxx | 16 ++++ sc/source/core/data/document.cxx | 26 ++++++ sc/source/core/data/table2.cxx | 8 ++ sc/source/ui/inc/formatsh.hxx | 3 + sc/source/ui/view/formatsh.cxx | 124 ++++++++++++++++++++++++-- sc/source/ui/view/tabview3.cxx | 7 ++ sc/uiconfig/scalc/toolbar/formatobjectbar.xml | 2 +- 11 files changed, 184 insertions(+), 15 deletions(-) diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 1a021dcb0cce..2fa63eb91d74 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -301,6 +301,7 @@ public: const ScPatternAttr* GetMostUsedPattern( SCROW nStartRow, SCROW nEndRow ) const; ULONG GetNumberFormat( SCROW nRow ) const; + sal_uInt32 GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const; void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, BOOL bDeep ) const; void MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, BOOL bDeep ) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index e8d84880f0ad..cecf424501cf 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -794,6 +794,7 @@ public: SC_DLLPUBLIC double RoundValueAsShown( double fVal, ULONG nFormat ); SC_DLLPUBLIC void GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt32& rFormat ); + sal_uInt32 GetNumberFormat( const ScRange& rRange ) const; SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScAddress& ) const; /** If no number format attribute is set and the cell pointer passed is of type formula cell, the calculated diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index aacce96bc711..18aa7ce82fd5 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -522,6 +522,7 @@ public: 0; } ULONG GetNumberFormat( SCCOL nCol, SCROW nRow ) const; + sal_uInt32 GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const; void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, BOOL bDeep ) const; void MergePatternArea( ScMergePatternState& rState, SCCOL nCol1, SCROW nRow1, diff --git a/sc/sdi/formatsh.sdi b/sc/sdi/formatsh.sdi index 31ccf5c8af84..8b84a7b730c6 100644 --- a/sc/sdi/formatsh.sdi +++ b/sc/sdi/formatsh.sdi @@ -117,11 +117,11 @@ interface FormatForSelection SID_ATTR_NUMBERFORMAT_VALUE [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;] SID_NUMBER_FORMAT [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;] SID_NUMBER_TWODEC [ ExecMethod = ExecuteNumFormat;] - SID_NUMBER_SCIENTIFIC [ ExecMethod = ExecuteNumFormat;] - SID_NUMBER_DATE [ ExecMethod = ExecuteNumFormat;] - SID_NUMBER_CURRENCY [ ExecMethod = ExecuteNumFormat;] - SID_NUMBER_PERCENT [ ExecMethod = ExecuteNumFormat;] - SID_NUMBER_TIME [ ExecMethod = ExecuteNumFormat;] + SID_NUMBER_SCIENTIFIC [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ] + SID_NUMBER_DATE [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ] + SID_NUMBER_CURRENCY [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ] + SID_NUMBER_PERCENT [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ] + SID_NUMBER_TIME [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ] SID_NUMBER_STANDARD [ ExecMethod = ExecuteNumFormat;] SID_NUMBER_INCDEC [ ExecMethod = ExecuteNumFormat;] SID_NUMBER_DECDEC [ ExecMethod = ExecuteNumFormat;] diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index d3c76518c035..2e2b595137ef 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -354,6 +354,22 @@ const ScPatternAttr* ScColumn::GetMostUsedPattern( SCROW nStartRow, SCROW nEndRo return pMaxPattern; } +sal_uInt32 ScColumn::GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const +{ + SCROW nPatStartRow, nPatEndRow; + const ScPatternAttr* pPattern = pAttrArray->GetPatternRange(nPatStartRow, nPatEndRow, nStartRow); + sal_uInt32 nFormat = pPattern->GetNumberFormat(pDocument->GetFormatTable()); + while (nEndRow > nPatEndRow) + { + nStartRow = nPatEndRow + 1; + pPattern = pAttrArray->GetPatternRange(nPatStartRow, nPatEndRow, nStartRow); + sal_uInt32 nTmpFormat = pPattern->GetNumberFormat(pDocument->GetFormatTable()); + if (nFormat != nTmpFormat) + return 0; + } + return nFormat; +} + ULONG ScColumn::GetNumberFormat( SCROW nRow ) const { diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 17763c909b47..aa1672aecd75 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2723,6 +2723,32 @@ void ScDocument::GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab, rFormat = 0; } +sal_uInt32 ScDocument::GetNumberFormat( const ScRange& rRange ) const +{ + SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab(); + SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col(); + SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row(); + + if (!ValidTab(nTab1) || !ValidTab(nTab2) || !pTab[nTab1] || !pTab[nTab2]) + return 0; + + sal_uInt32 nFormat = 0; + bool bFirstItem = true; + for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab) + for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) + { + sal_uInt32 nThisFormat = pTab[nTab]->GetNumberFormat(nCol, nRow1, nRow2); + if (bFirstItem) + { + nFormat = nThisFormat; + bFirstItem = false; + } + else if (nThisFormat != nFormat) + return 0; + } + + return nFormat; +} sal_uInt32 ScDocument::GetNumberFormat( const ScAddress& rPos ) const { diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 66e385a13b85..eee6e6e72bb8 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1329,6 +1329,14 @@ ULONG ScTable::GetNumberFormat( SCCOL nCol, SCROW nRow ) const return 0; } +sal_uInt32 ScTable::GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const +{ + if (!ValidCol(nCol) || !ValidRow(nStartRow) || !ValidRow(nEndRow)) + return 0; + + return aCol[nCol].GetNumberFormat(nStartRow, nEndRow); +} + const ScPatternAttr* ScTable::GetPattern( SCCOL nCol, SCROW nRow ) const { diff --git a/sc/source/ui/inc/formatsh.hxx b/sc/source/ui/inc/formatsh.hxx index e45fb99c54ef..689e6da6e22f 100644 --- a/sc/source/ui/inc/formatsh.hxx +++ b/sc/source/ui/inc/formatsh.hxx @@ -74,6 +74,9 @@ public: void ExecFormatPaintbrush( SfxRequest& rReq ); void StateFormatPaintbrush( SfxItemSet& rSet ); + +private: + short GetCurrentNumberFormatType(); }; #endif diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 12a1bb87211b..3b809c9d65aa 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -55,6 +55,7 @@ #include #include +#include #include #include #include @@ -925,6 +926,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); const SfxItemSet* pReqArgs = rReq.GetArgs(); USHORT nSlot = rReq.GetSlot(); + SfxBindings& rBindings = pTabViewShell->GetViewFrame()->GetBindings(); pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox @@ -957,6 +959,8 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) } } + short nType = GetCurrentNumberFormatType(); + SfxItemSet aSet( GetPool(), nSlot, nSlot ); switch ( nSlot ) { case SID_NUMBER_TWODEC: @@ -964,23 +968,48 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) rReq.Done(); break; case SID_NUMBER_SCIENTIFIC: - pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC ); + if ((nType & NUMBERFORMAT_SCIENTIFIC)) + pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER ); + else + pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC ); + aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_SCIENTIFIC)) ); + rBindings.Invalidate( nSlot ); rReq.Done(); break; case SID_NUMBER_DATE: - pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE ); + if ((nType & NUMBERFORMAT_DATE)) + pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER ); + else + pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE ); + aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_DATE)) ); + rBindings.Invalidate( nSlot ); rReq.Done(); break; case SID_NUMBER_TIME: - pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME ); + if ((nType & NUMBERFORMAT_TIME)) + pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER ); + else + pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME ); + aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_TIME)) ); + rBindings.Invalidate( nSlot ); rReq.Done(); break; case SID_NUMBER_CURRENCY: - pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY ); + if ((nType & NUMBERFORMAT_CURRENCY)) + pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER ); + else + pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY ); + aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_CURRENCY)) ); + rBindings.Invalidate( nSlot ); rReq.Done(); break; case SID_NUMBER_PERCENT: - pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT ); + if ((nType & NUMBERFORMAT_PERCENT)) + pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER ); + else + pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT ); + aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_PERCENT)) ); + rBindings.Invalidate( nSlot ); rReq.Done(); break; case SID_NUMBER_STANDARD: @@ -1986,9 +2015,8 @@ void ScFormatShell::GetAlignState( SfxItemSet& rSet ) void ScFormatShell::GetNumFormatState( SfxItemSet& rSet ) { ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); - - // ScViewData* pViewData = GetViewData(); - ScDocument* pDoc = pViewData->GetDocument(); + ScDocument* pDoc = pViewData->GetDocument(); + short nType = GetCurrentNumberFormatType(); SfxWhichIter aIter(rSet); USHORT nWhich = aIter.FirstWhich(); @@ -2015,7 +2043,21 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet ) rSet.Put( SfxStringItem( nWhich, aFormatCode ) ); } break; - + case SID_NUMBER_SCIENTIFIC: + rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_SCIENTIFIC)) ); + break; + case SID_NUMBER_DATE: + rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_DATE)) ); + break; + case SID_NUMBER_CURRENCY: + rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_CURRENCY)) ); + break; + case SID_NUMBER_PERCENT: + rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_PERCENT)) ); + break; + case SID_NUMBER_TIME: + rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_TIME)) ); + break; } nWhich = aIter.NextWhich(); } @@ -2166,3 +2208,67 @@ void ScFormatShell::StateFormatPaintbrush( SfxItemSet& rSet ) rSet.Put( SfxBoolItem( SID_FORMATPAINTBRUSH, pViewData->GetView()->HasPaintBrush() ) ); } +short ScFormatShell::GetCurrentNumberFormatType() +{ + short nType = NUMBERFORMAT_ALL; + ScDocument* pDoc = GetViewData()->GetDocument(); + ScMarkData aMark(GetViewData()->GetMarkData()); + const SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); + if (!pFormatter) + return nType; + + // TODO: Find out how to get a selected table range in case multiple tables + // are selected. Currently we only check for the current active table. + + if ( aMark.IsMarked() || aMark.IsMultiMarked() ) + { + aMark.MarkToMulti(); + ScRange aRange; + aMark.GetMultiMarkArea(aRange); + + const ScMarkArray* pArray = aMark.GetArray(); + if (!pArray) + return nType; + + short nComboType = NUMBERFORMAT_ALL; + bool bFirstItem = true; + for (SCCOL nCol = aRange.aStart.Col(); nCol <= aRange.aEnd.Col(); ++nCol) + { + const ScMarkArray& rColArray = pArray[nCol]; + if (!rColArray.HasMarks()) + continue; + + SCROW nRow1, nRow2; + ScMarkArrayIter aMarkIter(&rColArray); + while (aMarkIter.Next(nRow1, nRow2)) + { + ScRange aColRange(nCol, nRow1, aRange.aStart.Tab()); + aColRange.aEnd.SetRow(nRow2); + sal_uInt32 nNumFmt = pDoc->GetNumberFormat(aColRange); + const SvNumberformat* pEntry = pFormatter->GetEntry(nNumFmt); + if (!pEntry) + return 0; + + short nThisType = pEntry->GetType(); + if (bFirstItem) + { + bFirstItem = false; + nComboType = nThisType; + } + else if (nComboType != nThisType) + // mixed number format type. + return NUMBERFORMAT_ALL; + } + } + nType = nComboType; + } + else + { + sal_uInt32 nNumFmt; + pDoc->GetNumberFormat( pViewData->GetCurX(), pViewData->GetCurY(), + pViewData->GetTabNo(), nNumFmt ); + const SvNumberformat* pEntry = pFormatter->GetEntry( nNumFmt ); + nType = pEntry ? pEntry->GetType() : 0; + } + return nType; +} diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 90bfe0c24e5c..5d48f3e60b1f 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -264,6 +264,13 @@ void ScTabView::InvalidateAttribs() rBindings.Invalidate( SID_ALIGN_ANY_VCENTER ); rBindings.Invalidate( SID_ALIGN_ANY_BOTTOM ); + rBindings.Invalidate( SID_NUMBER_CURRENCY ); + rBindings.Invalidate( SID_NUMBER_SCIENTIFIC ); + rBindings.Invalidate( SID_NUMBER_DATE ); + rBindings.Invalidate( SID_NUMBER_CURRENCY ); + rBindings.Invalidate( SID_NUMBER_PERCENT ); + rBindings.Invalidate( SID_NUMBER_TIME ); + // rBindings.Invalidate( SID_RANGE_VALUE ); // rBindings.Invalidate( SID_RANGE_FORMULA ); } diff --git a/sc/uiconfig/scalc/toolbar/formatobjectbar.xml b/sc/uiconfig/scalc/toolbar/formatobjectbar.xml index 13b6abcf9bcf..49c31d72f176 100644 --- a/sc/uiconfig/scalc/toolbar/formatobjectbar.xml +++ b/sc/uiconfig/scalc/toolbar/formatobjectbar.xml @@ -33,7 +33,7 @@ - + -- cgit From d8c68b41b4ffd318744d5fc2ca0e60bdc37aca4e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 17:18:15 +0200 Subject: sc-fit-to-width-height-skip-breaks.diff: Increase Excel compatibility n#404232, n#404563, i#94698 ignore manual breaks when the "fit to x pages wide and x pages tall" option is used, for Excel interoperability. --- sc/source/core/data/table5.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 7c13756aab38..fc4f55e7d681 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -135,6 +135,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) bool bSkipColBreaks = false; bool bSkipRowBreaks = false; + bool bSkipBreaks = false; if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, FALSE, &pItem ) == SFX_ITEM_SET ) { @@ -152,6 +153,15 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) bSkipRowBreaks = true; } + if (!bSkipBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, false, &pItem) == SFX_ITEM_SET) + { + const ScPageScaleToItem& rScaleToItem = static_cast( + pStyleSet->Get(ATTR_PAGE_SCALETO)); + if (rScaleToItem.GetWidth() > 0 || rScaleToItem.GetHeight() > 0) + // when fitting to a fixed width x height, ignore manual breaks. + bSkipBreaks = true; + } + //-------------------------------------------------------------------------- long nPageSizeX = aPageSizeTwips.Width(); -- cgit From 340f9bd08cfe91054d3ed36e13c26d4fccce154f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 17:23:05 +0200 Subject: calc-dp-default-new-sheet.diff: default output to new sheet i#50886 --- sc/source/ui/dbgui/pvlaydlg.cxx | 36 ++++++++++++++++++++++++------------ sc/source/ui/inc/pvlaydlg.hxx | 5 +++-- sc/source/ui/view/tabvwshc.cxx | 7 ++++++- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 1eca44a787ed..a6796739c841 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -105,7 +105,7 @@ PointerStyle lclGetPointerForField( ScDPFieldType eType ) //---------------------------------------------------------------------------- ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, - const ScDPObject& rDPObject ) + const ScDPObject& rDPObject, bool bNewOutput ) : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ), aFlLayout ( this, ScResId( FL_LAYOUT ) ), aFtPage ( this, ScResId( FT_PAGE ) ), @@ -165,7 +165,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar xDlgDPObject->FillOldParam( thePivotData, FALSE ); xDlgDPObject->FillLabelData( thePivotData ); - Init(); + Init(bNewOutput); FreeResource(); } @@ -200,7 +200,7 @@ ScDPFieldWindow& ScDPLayoutDlg::GetFieldWindow( ScDPFieldType eType ) return aWndSelect; } -void __EXPORT ScDPLayoutDlg::Init() +void __EXPORT ScDPLayoutDlg::Init(bool bNewOutput) { DBG_ASSERT( pViewData && pDoc, "Ctor-Initialisierung fehlgeschlagen!" ); @@ -301,19 +301,31 @@ void __EXPORT ScDPLayoutDlg::Init() } } - if ( thePivotData.nTab != MAXTAB+1 ) + if (bNewOutput) { - String aStr; - ScAddress( thePivotData.nCol, - thePivotData.nRow, - thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); - aEdOutPos.SetText( aStr ); - EdModifyHdl(0); + // Output to a new sheet by default for a brand-new output. + aLbOutPos.SelectEntryPos(1); + aEdOutPos.Disable(); + aRbOutPos.Disable(); } else { - aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 ); - SelAreaHdl(NULL); + // Modifying an existing dp output. + + if ( thePivotData.nTab != MAXTAB+1 ) + { + String aStr; + ScAddress( thePivotData.nCol, + thePivotData.nRow, + thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); + aEdOutPos.SetText( aStr ); + EdModifyHdl(0); + } + else + { + aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 ); + SelAreaHdl(NULL); + } } aBtnIgnEmptyRows.Check( thePivotData.bIgnoreEmptyRows ); diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index c74b9e028d2f..2b77b37c67ad 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -87,7 +87,8 @@ public: SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, - const ScDPObject& rDPObject ); + const ScDPObject& rDPObject, + bool bNewOutput ); virtual ~ScDPLayoutDlg(); virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); @@ -189,7 +190,7 @@ private: private: ScDPFieldWindow& GetFieldWindow ( ScDPFieldType eType ); - void Init (); + void Init (bool bNewOutput); void InitWndSelect ( const ::std::vector& rLabels ); void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType ); void InitFocus (); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 0a14ad6c1eba..fa3ba10db0d2 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -252,8 +252,13 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( if( pDialogDPObject ) { + // Check for an existing datapilot output. + ScViewData* pViewData = GetViewData(); + ScDPObject* pObj = GetViewData()->GetDocument()->GetDPAtCursor( + pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo()); + GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() ); - pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject ); + pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject, pObj == NULL); } } break; -- cgit From 2951e4f0694ea091455225e9f46910b91c53c86a Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 10:50:58 +0200 Subject: emf+-cppcanvas-renderer.diff: emf+ import - rendering part in cppcanvas --- cppcanvas/prj/build.lst | 1 + cppcanvas/prj/d.lst | 1 + cppcanvas/source/uno/exports.dxp | 3 ++ cppcanvas/source/uno/exports.map | 9 ++++ cppcanvas/source/uno/makefile.mk | 62 +++++++++++++++++++++++++ cppcanvas/source/uno/uno_mtfrenderer.cxx | 80 ++++++++++++++++++++++++++++++++ cppcanvas/source/uno/uno_mtfrenderer.hxx | 60 ++++++++++++++++++++++++ 7 files changed, 216 insertions(+) create mode 100644 cppcanvas/source/uno/exports.dxp create mode 100644 cppcanvas/source/uno/exports.map create mode 100644 cppcanvas/source/uno/makefile.mk create mode 100644 cppcanvas/source/uno/uno_mtfrenderer.cxx create mode 100644 cppcanvas/source/uno/uno_mtfrenderer.hxx diff --git a/cppcanvas/prj/build.lst b/cppcanvas/prj/build.lst index 3fc4eb7abdac..317e3276c249 100644 --- a/cppcanvas/prj/build.lst +++ b/cppcanvas/prj/build.lst @@ -5,3 +5,4 @@ cx cppcanvas\source\tools nmake - all cx_tools cx_inc NULL cx cppcanvas\source\wrapper nmake - all cx_wrapper cx_inc NULL cx cppcanvas\source\mtfrenderer nmake - all cx_mtfrenderer cx_inc NULL cx cppcanvas\util nmake - all cx_util cx_tools cx_wrapper cx_mtfrenderer NULL +cx cppcanvas\source\uno nmake - all cx_uno cx_tools cx_wrapper cx_mtfrenderer cx_util NULL diff --git a/cppcanvas/prj/d.lst b/cppcanvas/prj/d.lst index f0f3237b80d0..7ed2d10bad26 100644 --- a/cppcanvas/prj/d.lst +++ b/cppcanvas/prj/d.lst @@ -1,4 +1,5 @@ ..\%__SRC%\bin\cppcanv*.dll %_DEST%\bin%_EXT%\cppcanv*.dll +..\%__SRC%\bin\mtfrenderer*.dll %_DEST%\bin%_EXT%\mtfrenderer*.dll ..\%__SRC%\lib\icppcanvas.lib %_DEST%\lib%_EXT%\icppcanvas.lib ..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.* diff --git a/cppcanvas/source/uno/exports.dxp b/cppcanvas/source/uno/exports.dxp new file mode 100644 index 000000000000..9630d7e06768 --- /dev/null +++ b/cppcanvas/source/uno/exports.dxp @@ -0,0 +1,3 @@ +component_getImplementationEnvironment +component_writeInfo +component_getFactory diff --git a/cppcanvas/source/uno/exports.map b/cppcanvas/source/uno/exports.map new file mode 100644 index 000000000000..31a8b65a1f93 --- /dev/null +++ b/cppcanvas/source/uno/exports.map @@ -0,0 +1,9 @@ +UDK_3_0_0 { + global: +_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; + local: + *; +}; diff --git a/cppcanvas/source/uno/makefile.mk b/cppcanvas/source/uno/makefile.mk new file mode 100644 index 000000000000..76d259474c58 --- /dev/null +++ b/cppcanvas/source/uno/makefile.mk @@ -0,0 +1,62 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2010 Novell, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=cppcanvas +TARGET=mtfrenderer +ENABLE_EXCEPTIONS=TRUE + + +# --- Settings ----------------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Common ---------------------------------------------------------- + +.IF "$(verbose)"!="" || "$(VERBOSE)"!="" +CDEFS+= -DVERBOSE +.ENDIF + +SLOFILES = $(SLO)$/uno_mtfrenderer.obj + +SHL1TARGET=$(TARGET).uno + +SHL1STDLIBS= $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB) $(COMPHELPERLIB) $(CPPCANVASLIB) $(BASEGFXLIB) + +SHL1IMPLIB=i$(TARGET) +SHL1LIBS=$(SLB)$/$(TARGET).lib +SHL1DEF=$(MISC)$/$(SHL1TARGET).def + +SHL1VERSIONMAP=exports.map + +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=exports.dxp + +# ========================================================================== + +.INCLUDE : target.mk diff --git a/cppcanvas/source/uno/uno_mtfrenderer.cxx b/cppcanvas/source/uno/uno_mtfrenderer.cxx new file mode 100644 index 000000000000..a5ba6e6386b9 --- /dev/null +++ b/cppcanvas/source/uno/uno_mtfrenderer.cxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "uno_mtfrenderer.hxx" +#include +#include +#include + +using namespace ::com::sun::star; + +void MtfRenderer::setMetafile (const uno::Sequence< sal_Int8 >& rMtf) throw (uno::RuntimeException) +{ + // printf ("MtfRenderer::setMetafile unimplemented, use fast property set or implement me\n"); +} + +void MtfRenderer::draw (double fScaleX, double fScaleY) throw (uno::RuntimeException) +{ + if (mpMetafile && mxCanvas.get()) { + cppcanvas::VCLFactory& factory = cppcanvas::VCLFactory::getInstance(); + cppcanvas::BitmapCanvasSharedPtr canvas = factory.createCanvas (mxCanvas); + cppcanvas::RendererSharedPtr renderer = factory.createRenderer (canvas, *mpMetafile, cppcanvas::Renderer::Parameters ()); + ::basegfx::B2DHomMatrix aMatrix; + aMatrix.scale( fScaleX, fScaleY ); + canvas->setTransformation( aMatrix ); + renderer->draw (); + } +} + +void MtfRenderer::setFastPropertyValue( sal_Int32 nHandle, const uno::Any& aAny) throw (uno::RuntimeException) +{ + if (nHandle == 0) { + mpMetafile = (GDIMetaFile*) *reinterpret_cast(aAny.getValue()); + } +} + +MtfRenderer::MtfRenderer (uno::Sequence const& aArgs, uno::Reference const&) : MtfRendererBase (m_aMutex), mpMetafile (NULL) +{ + if( aArgs.getLength() == 1 ) { + aArgs[0] >>= mxCanvas; + } +} + +namespace sdecl = comphelper::service_decl; +#if defined (__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ <= 3) + sdecl::class_ > serviceImpl; + const sdecl::ServiceDecl MtfRendererDecl( + serviceImpl, +#else + const sdecl::ServiceDecl MtfRendererDecl( + sdecl::class_ >(), +#endif + "com.sun.star.comp.rendering.MtfRenderer", + "com.sun.star.rendering.MtfRenderer" ); + +// The C shared lib entry points +COMPHELPER_SERVICEDECL_EXPORTS1(MtfRendererDecl) diff --git a/cppcanvas/source/uno/uno_mtfrenderer.hxx b/cppcanvas/source/uno/uno_mtfrenderer.hxx new file mode 100644 index 000000000000..a20ce5487430 --- /dev/null +++ b/cppcanvas/source/uno/uno_mtfrenderer.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _UNO_MTF_RENDERER_HXX_ +#define _UNO_MTF_RENDERER_HXX_ +#include +#include +#include +#include +#include +#include +#include + +typedef cppu::WeakComponentImplHelper2 MtfRendererBase; + +class MtfRenderer : private cppu::BaseMutex, public MtfRendererBase +{ +public: + MtfRenderer (com::sun::star::uno::Sequence const& args, + com::sun::star::uno::Reference const&); + + // XMtfRenderer iface + void SAL_CALL setMetafile (const ::com::sun::star::uno::Sequence< sal_Int8 >& rMtf) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL draw (double fScaleX, double fScaleY) throw (::com::sun::star::uno::RuntimeException); + + // XFastPropertySet + // setFastPropertyValue (0, GDIMetaFile*) is used to speedup the rendering + virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) throw (::com::sun::star::uno::RuntimeException) { return ::com::sun::star::uno::Any(); } + virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, const ::com::sun::star::uno::Any&) throw (::com::sun::star::uno::RuntimeException); + +private: + GDIMetaFile* mpMetafile; + com::sun::star::uno::Reference mxCanvas; +}; + +#endif -- cgit From 52505ffb37ed4e4faf9fc9496205e82edc2512ae Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 10:54:38 +0200 Subject: emf+-cppcanvas-renderer.diff: emf+ import - rendering implementation --- cppcanvas/source/inc/implrenderer.hxx | 134 +++ cppcanvas/source/mtfrenderer/emfplus.cxx | 1357 +++++++++++++++++++++++++ cppcanvas/source/mtfrenderer/implrenderer.cxx | 32 + cppcanvas/source/mtfrenderer/makefile.mk | 1 + cppcanvas/util/makefile.mk | 2 +- 5 files changed, 1525 insertions(+), 1 deletion(-) create mode 100644 cppcanvas/source/mtfrenderer/emfplus.cxx diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx index 8c1f7941abc4..b550fca2ebbd 100644 --- a/cppcanvas/source/inc/implrenderer.hxx +++ b/cppcanvas/source/inc/implrenderer.hxx @@ -47,6 +47,11 @@ class Gradient; class BitmapEx; class MapMode; class Size; +class Rectangle; +class Font; +class PolyPolygon; +class Point; +class MetaCommentAction; namespace basegfx { class B2DPolyPolygon; @@ -60,11 +65,110 @@ namespace cppcanvas { struct OutDevState; struct ActionFactoryParameters; + struct EMFPObject; + struct XForm; // state stack of OutputDevice, to correctly handle // push/pop actions typedef ::std::vector< OutDevState > VectorOfOutDevStates; + // EMF+ + // TODO: replace? + struct XForm + { + float eM11; + float eM12; + float eM21; + float eM22; + float eDx; + float eDy; + XForm() + { + SetIdentity (); + }; + + void SetIdentity () + { + eM11 = eM22 = 1.0f; + eDx = eDy = eM12 = eM21 = 0.0f; + } + + void Set (float m11, float m12, float dx, float m21, float m22, float dy) + { + eM11 = m11; + eM12 = m12; + eDx = dx; + eM21 = m21; + eM22 = m22; + eDy = dy; + } + + void Set (XForm f) + { + eM11 = f.eM11; + eM12 = f.eM12; + eM21 = f.eM21; + eM22 = f.eM22; + eDx = f.eDx; + eDy = f.eDy; + } + + void Multiply (float m11, float m12, float dx, float m21, float m22, float dy) + { + eM11 = eM11*m11 + eM12*m21; + eM12 = eM11*m12 + eM12*m22; + eM21 = eM21*m11 + eM22*m21; + eM22 = eM21*m12 + eM22*m22; + eDx *= eDx*m11 + eDy*m21 + dx; + eDy *= eDx*m12 + eDy*m22 + dy; + } + + void Multiply (XForm f) + { + eM11 = eM11*f.eM11 + eM12*f.eM21; + eM12 = eM11*f.eM12 + eM12*f.eM22; + eM21 = eM21*f.eM11 + eM22*f.eM21; + eM22 = eM21*f.eM12 + eM22*f.eM22; + eDx *= eDx*f.eM11 + eDy*f.eM21 + f.eDx; + eDy *= eDx*f.eM12 + eDy*f.eM22 + f.eDy; + } + +#ifdef OSL_BIGENDIAN +// currently unused +static float GetSwapFloat( SvStream& rSt ) +{ + float fTmp; + sal_Int8* pPtr = (sal_Int8*)&fTmp; + rSt >> pPtr[3] >> pPtr[2] >> pPtr[1] >> pPtr[0]; // Little Endian <-> Big Endian switch + return fTmp; +} +#endif + + friend SvStream& operator>>( SvStream& rIn, XForm& rXForm ) + { + if ( sizeof( float ) != 4 ) + { + DBG_ERROR( "EnhWMFReader::sizeof( float ) != 4" ); + rXForm = XForm(); + } + else + { +#ifdef OSL_BIGENDIAN + rXForm.eM11 = GetSwapFloat( rIn ); + rXForm.eM12 = GetSwapFloat( rIn ); + rXForm.eM21 = GetSwapFloat( rIn ); + rXForm.eM22 = GetSwapFloat( rIn ); + rXForm.eDx = GetSwapFloat( rIn ); + rXForm.eDy = GetSwapFloat( rIn ); +#else + rIn >> rXForm.eM11 >> rXForm.eM12 >> rXForm.eM21 >> rXForm.eM22 + >> rXForm.eDx >> rXForm.eDy; +#endif + } + return rIn; + } + }; + class ImplRenderer : public virtual Renderer, protected CanvasGraphicHelper { public: @@ -103,6 +207,14 @@ namespace cppcanvas // (externally not visible) typedef ::std::vector< MtfAction > ActionVector; + /* EMF+ */ + void ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, sal_uInt32 flags = 0); + void ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags = 0); + void MapToDevice (double &x, double &y); + ::basegfx::B2DPoint Map (::basegfx::B2DPoint& p); + ::basegfx::B2DPoint Map (double ix, double iy); + ::basegfx::B2DSize MapSize (double iwidth, double iheight); + ::basegfx::B2DRange MapRectangle (double ix, double iy, double iwidth, double iheight); private: // default: disabled copy/assignment @@ -155,8 +267,30 @@ namespace cppcanvas ActionVector::const_iterator& o_rRangeBegin, ActionVector::const_iterator& o_rRangeEnd ) const; + void processEMFPlus( MetaCommentAction* pAct, const ActionFactoryParameters& rFactoryParms, OutDevState& rState, const CanvasSharedPtr& rCanvas ); + void EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, bool isColor, sal_uInt32 brushIndexOrColor); ActionVector maActions; + + /* EMF+ */ + XForm aBaseTransform; + XForm aWorldTransform; + EMFPObject* aObjects [256]; + float fPageScale; + sal_Int32 nOriginX; + sal_Int32 nOriginY; + sal_Int32 nHDPI; + sal_Int32 nVDPI; + ::PolyPolygon aClippingPolygon; + /* EMF+ emf header info */ + sal_Int32 nFrameLeft; + sal_Int32 nFrameTop; + sal_Int32 nFrameRight; + sal_Int32 nFrameBottom; + sal_Int32 nPixX; + sal_Int32 nPixY; + sal_Int32 nMmX; + sal_Int32 nMmY; }; diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx new file mode 100644 index 000000000000..ef1e76a335f4 --- /dev/null +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -0,0 +1,1357 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#define EmfPlusRecordTypeHeader 16385 +#define EmfPlusRecordTypeEndOfFile 16386 +#define EmfPlusRecordTypeGetDC 16388 +#define EmfPlusRecordTypeObject 16392 +#define EmfPlusRecordTypeFillRects 16394 +#define EmfPlusRecordTypeFillPolygon 16396 +#define EmfPlusRecordTypeDrawLines 16397 +#define EmfPlusRecordTypeFillPath 16404 +#define EmfPlusRecordTypeDrawPath 16405 +#define EmfPlusRecordTypeDrawImagePoints 16411 +#define EmfPlusRecordTypeDrawString 16412 +#define EmfPlusRecordTypeSetRenderingOrigin 16413 +#define EmfPlusRecordTypeSetAntiAliasMode 16414 +#define EmfPlusRecordTypeSetTextRenderingHint 16415 +#define EmfPlusRecordTypeSetInterpolationMode 16417 +#define EmfPlusRecordTypeSetPixelOffsetMode 16418 +#define EmfPlusRecordTypeSetCompositingQuality 16420 +#define EmfPlusRecordTypeSave 16421 +#define EmfPlusRecordTypeSetWorldTransform 16426 +#define EmfPlusRecordTypeResetWorldTransform 16427 +#define EmfPlusRecordTypeSetPageTransform 16432 +#define EmfPlusRecordTypeSetClipPath 16435 +#define EmfPlusRecordTypeSetClipRegion 16436 +#define EmfPlusRecordTypeDrawDriverString 16438 + +#define EmfPlusObjectTypeBrush 0x100 +#define EmfPlusObjectTypePen 0x200 +#define EmfPlusObjectTypePath 0x300 +#define EmfPlusObjectTypeRegion 0x400 +#define EmfPlusObjectTypeImage 0x500 +#define EmfPlusObjectTypeFont 0x600 +#define EmfPlusObjectTypeStringFormat 0x700 +#define EmfPlusObjectTypeImageAttributes 0x800 + +#define EmfPlusRegionInitialStateRectangle 0x10000000 +#define EmfPlusRegionInitialStatePath 0x10000001 +#define EmfPlusRegionInitialStateEmpty 0x10000002 +#define EmfPlusRegionInitialStateInfinite 0x10000003 + +#define EMFP_DEBUG(x) +//#define EMFP_DEBUG(x) x + +using namespace ::com::sun::star; + +namespace cppcanvas +{ + namespace internal + { + + EMFP_DEBUG (void dumpWords (SvStream& s, int i) + { + sal_uInt32 pos = s.Tell (); + INT16 data; + for (; i > 0; i --) { + s >> data; + printf ("EMF+\tdata: %04hX\n", data); + } + s.Seek (pos); + }); + + struct EMFPObject + { + }; + + struct EMFPPath : public EMFPObject + { + ::basegfx::B2DPolyPolygon aPolygon; + sal_Int32 nPoints; + float* pPoints; + sal_uInt8* pPointTypes; + + public: + EMFPPath (sal_Int32 _nPoints, bool bLines = false) + { + nPoints = _nPoints; + pPoints = new float [nPoints*2]; + if (!bLines) + pPointTypes = new sal_uInt8 [_nPoints]; + else + pPointTypes = NULL; + } + + ~EMFPPath () + { + delete [] pPoints; + delete [] pPointTypes; + } + + // TODO: remove rR argument when debug code is not longer needed + void Read (SvStream& s, UINT32 pathFlags, ImplRenderer& rR) + { + for (int i = 0; i < nPoints; i ++) { + if (pathFlags & 0x4000) { + // points are stored in short 16bit integer format + UINT16 x, y; + + s >> x >> y; + EMFP_DEBUG (printf ("EMF+\tpoint [x,y]: %hd,%hd\n", x, y)); + pPoints [i*2] = x; + pPoints [i*2 + 1] = y; + } else { + // points are stored in Single (float) format + s >> pPoints [i*2] >> pPoints [i*2 + 1]; + EMFP_DEBUG (printf ("EMF+\tpoint [x,y]: %f,%f\n", pPoints [i*2], pPoints [i*2 + 1])); + } + } + + if (pPointTypes) + for (int i = 0; i < nPoints; i ++) { + UINT8 pathType; + + s >> pPointTypes [i]; + EMFP_DEBUG (printf ("EMF+\tpoint type: %x\n", pPointTypes [i])); + } + + aPolygon.clear (); + + // debug code + const ::basegfx::B2DRectangle aBounds (::basegfx::tools::getRange (GetPolygon (rR))); + EMFP_DEBUG (printf ("EMF+\tpolygon bounding box: %f,%f %fx%f (mapped)\n", aBounds.getMinX (), aBounds.getMinY (), aBounds.getWidth (), aBounds.getHeight ())); + } + + ::basegfx::B2DPolyPolygon& GetPolygon (ImplRenderer& rR, bool bMapIt = true) + { + ::basegfx::B2DPolygon polygon; + sal_Int32 points = nPoints; + + aPolygon.clear (); + + int last_normal = 0, p = 0; + ::basegfx::B2DPoint prev, mapped; + bool hasPrev = false; + for (int i = 0; i < nPoints; i ++) { + if (p && pPointTypes && (pPointTypes [i] == 0)) { + aPolygon.append (polygon); + last_normal = i; + p = 0; + polygon.clear (); + } + + if (bMapIt) + mapped = rR.Map (pPoints [i*2], pPoints [i*2 + 1]); + else + mapped = ::basegfx::B2DPoint (pPoints [i*2], pPoints [i*2 + 1]); + //EMFP_DEBUG (printf ("polygon point: %f,%f mapped: %f,%f\n", pPoints [i*2], pPoints [i*2 + 1], mapped.getX (), mapped.getY ())); + if (pPointTypes) { + if ((pPointTypes [i] & 0x07) == 3) { + if (((i - last_normal )% 3) == 1) { + polygon.setNextControlPoint (p - 1, mapped); + continue; + } else if (((i - last_normal) % 3) == 2) { + prev = mapped; + hasPrev = true; + continue; + } + } else + last_normal = i; + } + polygon.append (mapped); + if (hasPrev) { + polygon.setPrevControlPoint (p, prev); + hasPrev = false; + } + p ++; + if (pPointTypes && (pPointTypes [i] & 0x80)) { // closed polygon + polygon.setClosed (true); + aPolygon.append (polygon); + last_normal = i + 1; + p = 0; + polygon.clear (); + } + } + + if (polygon.count ()) + aPolygon.append (polygon); + + return aPolygon; + } + }; + + struct EMFPRegion : public EMFPObject + { + sal_Int32 parts; + sal_Int32 *combineMode; + sal_Int32 initialState; + EMFPPath *initialPath; + float ix, iy, iw, ih; + + EMFPRegion () + { + combineMode = NULL; + initialPath = NULL; + } + + ~EMFPRegion () + { + if (combineMode) { + delete [] combineMode; + combineMode = NULL; + } + if (initialPath) { + delete initialPath; + initialPath = NULL; + } + } + + void Read (SvStream& s) + { + sal_uInt32 header; + + s >> header >> parts; + + EMFP_DEBUG (printf ("EMF+\tregion\n")); + EMFP_DEBUG (printf ("EMF+\theader: 0x%08x parts: %d\n", header, parts)); + + if (parts) { + combineMode = new sal_Int32 [parts]; + + for (int i = 0; i < parts; i ++) { + s >> combineMode [i]; + EMFP_DEBUG (printf ("EMF+\tcombine mode [%d]: 0x%08x\n", i, combineMode [i])); + } + } + + s >> initialState; + EMFP_DEBUG (printf ("EMF+\tinitial state: 0x%08x\n", initialState)); + } + }; + + struct EMFPBrush : public EMFPObject + { + ::Color solidColor; + sal_uInt32 type; + sal_uInt32 additionalFlags; + + /* linear gradient */ + sal_Int32 wrapMode; + float areaX, areaY, areaWidth, areaHeight; + ::Color secondColor; // first color is stored in solidColor; + XForm transformation; + bool hasTransformation; + sal_Int32 blendPoints; + float* blendPositions; + float* blendFactors; + sal_Int32 colorblendPoints; + float* colorblendPositions; + ::Color* colorblendColors; + sal_Int32 surroundColorsNumber; + ::Color* surroundColors; + EMFPPath *path; + + public: + EMFPBrush () + { + blendPositions = NULL; + colorblendPositions = NULL; + colorblendColors = NULL; + surroundColors = NULL; + path = NULL; + hasTransformation = false; + } + + ~EMFPBrush () + { + if (blendPositions != NULL) { + delete[] blendPositions; + blendPositions = NULL; + } + if (colorblendPositions != NULL) { + delete[] colorblendPositions; + colorblendPositions = NULL; + } + if (colorblendColors != NULL) { + delete[] colorblendColors; + colorblendColors = NULL; + } + if (surroundColors != NULL) { + delete[] surroundColors; + surroundColors = NULL; + } + if (path) { + delete path; + path = NULL; + } + } + + UINT32 GetType () { return type; } + const ::Color& GetColor () { return solidColor; } + + void Read (SvStream& s, ImplRenderer& rR) + { + UINT32 header; + + s >> header >> type; + + EMFP_DEBUG (printf ("EMF+\tbrush\nEMF+\theader: 0x%08x type: %d\n", header, type)); + + switch (type) { + case 0: + { + UINT32 color; + + s >> color; + solidColor = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); + EMFP_DEBUG (printf ("EMF+\tsolid color: 0x%08x\n", color)); + + break; + } + // path gradient + case 3: + { + s >> additionalFlags >> wrapMode; + + EMFP_DEBUG (printf ("EMF+\tpath gradient, additional flags: 0x%02x\n", additionalFlags)); + + UINT32 color; + + s >> color; + solidColor = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); + EMFP_DEBUG (printf ("EMF+\tcenter color: 0x%08x\n", color)); + + s >> areaX >> areaY; + EMFP_DEBUG (printf ("EMF+\tcenter point: %f,%f\n", areaX, areaY)); + + s >> surroundColorsNumber; + EMFP_DEBUG (printf ("EMF+\tsurround colors: %d\n", surroundColorsNumber)); + + surroundColors = new ::Color [surroundColorsNumber]; + for (int i = 0; i < surroundColorsNumber; i++) { + s >> color; + surroundColors[i] = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); + if (i == 0) + secondColor = surroundColors [0]; + EMFP_DEBUG (printf ("EMF+\tsurround color[%d]: 0x%08x\n", i, color)); + } + + if (additionalFlags & 0x01) { + sal_Int32 pathLength; + + s >> pathLength; + EMFP_DEBUG (printf ("EMF+\tpath length: %d\n", pathLength)); + + sal_uInt32 pos = s.Tell (); + EMFP_DEBUG (dumpWords (s, 32)); + + sal_uInt32 pathHeader; + sal_Int32 pathPoints, pathFlags; + s >> pathHeader >> pathPoints >> pathFlags; + + EMFP_DEBUG (printf ("EMF+\tpath (brush path gradient)\n")); + EMFP_DEBUG (printf ("EMF+\theader: 0x%08x points: %d additional flags: 0x%08x\n", pathHeader, pathPoints, pathFlags)); + + path = new EMFPPath (pathPoints); + path->Read (s, pathFlags, rR); + + s.Seek (pos + pathLength); + + const ::basegfx::B2DRectangle aBounds (::basegfx::tools::getRange (path->GetPolygon (rR, false))); + areaWidth = aBounds.getWidth (); + areaHeight = aBounds.getHeight (); + + EMFP_DEBUG (printf ("EMF+\tpolygon bounding box: %f,%f %fx%f\n", aBounds.getMinX (), aBounds.getMinY (), aBounds.getWidth (), aBounds.getHeight ())); + + + if (additionalFlags & 0x02) { + EMFP_DEBUG (printf ("EMF+\tuse transformation\n", color)); + s >> transformation; + hasTransformation = true; + EMFP_DEBUG (printf ("EMF+\tm11: %f m12: %f\nEMF+\tm21: %f m22: %f\nEMF+\tdx: %f dy: %f\n", + transformation.eM11, transformation.eM12, + transformation.eM21, transformation.eM22, + transformation.eDx, transformation.eDy)); + } + if (additionalFlags & 0x08) { + s >> blendPoints; + EMFP_DEBUG (printf ("EMF+\tuse blend, points: %d\n", blendPoints)); + blendPositions = new float [2*blendPoints]; + blendFactors = blendPositions + blendPoints; + for (int i=0; i < blendPoints; i ++) { + s >> blendPositions [i]; + EMFP_DEBUG (printf ("EMF+\tposition[%d]: %f\n", i, blendPositions [i])); + } + for (int i=0; i < blendPoints; i ++) { + s >> blendFactors [i]; + EMFP_DEBUG (printf ("EMF+\tfactor[%d]: %f\n", i, blendFactors [i])); + } + } + + if (additionalFlags & 0x04) { + s >> colorblendPoints; + EMFP_DEBUG (printf ("EMF+\tuse color blend, points: %d\n", colorblendPoints)); + colorblendPositions = new float [colorblendPoints]; + colorblendColors = new ::Color [colorblendPoints]; + for (int i=0; i < colorblendPoints; i ++) { + s >> colorblendPositions [i]; + EMFP_DEBUG (printf ("EMF+\tposition[%d]: %f\n", i, colorblendPositions [i])); + } + for (int i=0; i < colorblendPoints; i ++) { + s >> color; + colorblendColors [i] = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); + EMFP_DEBUG (printf ("EMF+\tcolor[%d]: 0x%08x\n", i, color)); + } + } + } else + EMFP_DEBUG (dumpWords (s, 1024)); + + break; + } + // linear gradient + case 4: + { + s >> additionalFlags >> wrapMode; + + EMFP_DEBUG (printf ("EMF+\tlinear gradient, additional flags: 0x%02x\n", additionalFlags)); + + s >> areaX >> areaY >> areaWidth >> areaHeight; + + EMFP_DEBUG (printf ("EMF+\tarea: %f,%f - %fx%f\n", areaX, areaY, areaWidth, areaHeight)); + + UINT32 color; + + s >> color; + solidColor = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); + EMFP_DEBUG (printf ("EMF+\tfirst color: 0x%08x\n", color)); + + s >> color; + secondColor = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); + EMFP_DEBUG (printf ("EMF+\tsecond color: 0x%08x\n", color)); + + // repeated colors, unknown meaning, see http://www.aces.uiuc.edu/~jhtodd/Metafile/MetafileRecords/ObjectBrush.html + s >> color; + s >> color; + + if (additionalFlags & 0x02) { + EMFP_DEBUG (printf ("EMF+\tuse transformation\n", color)); + s >> transformation; + hasTransformation = true; + EMFP_DEBUG (printf ("EMF+\tm11: %f m12: %f\nEMF+\tm21: %f m22: %f\nEMF+\tdx: %f dy: %f\n", + transformation.eM11, transformation.eM12, + transformation.eM21, transformation.eM22, + transformation.eDx, transformation.eDy)); + } + if (additionalFlags & 0x08) { + s >> blendPoints; + EMFP_DEBUG (printf ("EMF+\tuse blend, points: %d\n", blendPoints)); + blendPositions = new float [2*blendPoints]; + blendFactors = blendPositions + blendPoints; + for (int i=0; i < blendPoints; i ++) { + s >> blendPositions [i]; + EMFP_DEBUG (printf ("EMF+\tposition[%d]: %f\n", i, blendPositions [i])); + } + for (int i=0; i < blendPoints; i ++) { + s >> blendFactors [i]; + EMFP_DEBUG (printf ("EMF+\tfactor[%d]: %f\n", i, blendFactors [i])); + } + } + + if (additionalFlags & 0x04) { + s >> colorblendPoints; + EMFP_DEBUG (printf ("EMF+\tuse color blend, points: %d\n", colorblendPoints)); + colorblendPositions = new float [colorblendPoints]; + colorblendColors = new ::Color [colorblendPoints]; + for (int i=0; i < colorblendPoints; i ++) { + s >> colorblendPositions [i]; + EMFP_DEBUG (printf ("EMF+\tposition[%d]: %f\n", i, colorblendPositions [i])); + } + for (int i=0; i < colorblendPoints; i ++) { + s >> color; + colorblendColors [i] = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); + EMFP_DEBUG (printf ("EMF+\tcolor[%d]: 0x%08x\n", i, color)); + } + } + + break; + } + default: + EMFP_DEBUG (printf ("EMF+\tunhandled brush type: %d\n", type)); + } + } + }; + + struct EMFPPen : public EMFPBrush + { + XForm transformation; + float width; + sal_Int32 startCap; + sal_Int32 endCap; + sal_Int32 lineJoin; + float mitterLimit; + sal_Int32 dashStyle; + sal_Int32 dashCap; + float dashOffset; + sal_Int32 dashPatternLen; + float *dashPattern; + sal_Int32 alignment; + sal_Int32 compoundArrayLen; + float *compoundArray; + sal_Int32 customStartCapLen; + sal_uInt8 *customStartCap; + sal_Int32 customEndCapLen; + sal_uInt8 *customEndCap; + + public: + EMFPPen () : EMFPBrush () + { + } + + void SetStrokeAttributes (rendering::StrokeAttributes& rStrokeAttributes, ImplRenderer& rR, const OutDevState& rState) + { + rStrokeAttributes.StrokeWidth = (rState.mapModeTransform * rR.MapSize (width, 0)).getX (); + } + + void Read (SvStream& s, ImplRenderer& rR, sal_Int32 nHDPI, sal_Int32 nVDPI) + { + UINT32 header, unknown, penFlags, unknown2; + int i; + + s >> header >> unknown >> penFlags >> unknown2 >> width; + + EMFP_DEBUG (printf ("EMF+\tpen\nEMF+\theader: 0x%08x unknown: 0x%08x additional flags: 0x%08x unknown: 0x%08x width: %f\n", header, unknown, penFlags, unknown2, width)); + + if (penFlags & 1) + s >> transformation; + + if (penFlags & 2) + s >> startCap; + else + startCap = 0; + + if (penFlags & 4) + s >> endCap; + else + endCap = 0; + + if (penFlags & 8) + s >> lineJoin; + else + lineJoin = 0; + + if (penFlags & 16) + s >> mitterLimit; + else + mitterLimit = 0; + + if (penFlags & 32) + s >> dashStyle; + else + dashStyle = 0; + + if (penFlags & 64) + s >> dashCap; + else + dashCap = 0; + + if (penFlags & 128) + s >> dashOffset; + else + dashOffset = 0; + + if (penFlags & 256) { + s >> dashPatternLen; + dashPattern = new float [dashPatternLen]; + for (i = 0; i < dashPatternLen; i++) + s >> dashPattern [i]; + } else + dashPatternLen = 0; + + if (penFlags & 512) + s >> alignment; + else + alignment = 0; + + if (penFlags & 1024) { + s >> compoundArrayLen; + compoundArray = new float [compoundArrayLen]; + for (i = 0; i < compoundArrayLen; i++) + s >> compoundArray [i]; + } else + compoundArrayLen = 0; + + if (penFlags & 2048) { + s >> customStartCapLen; + customStartCap = new sal_uInt8 [customStartCapLen]; + for (i = 0; i < customStartCapLen; i++) + s >> customStartCap [i]; + } else + customStartCapLen = 0; + + if (penFlags & 4096) { + s >> customEndCapLen; + customEndCap = new sal_uInt8 [customEndCapLen]; + for (i = 0; i < customEndCapLen; i++) + s >> customEndCap [i]; + } else + customEndCapLen = 0; + + EMFPBrush::Read (s, rR); + } + }; + + struct EMFPImage : public EMFPObject + { + sal_uInt32 type; + sal_Int32 width; + sal_Int32 height; + sal_Int32 stride; + sal_Int32 pixelFormat; + Graphic graphic; + + + void Read (SvStream &s) + { + sal_uInt32 header, unknown; + + s >> header >> type; + + EMFP_DEBUG (printf ("EMF+\timage\nEMF+\theader: 0x%08x type: 0x%08x\n", header, type)); + + if (type == 1) { // bitmap + s >> width >> height >> stride >> pixelFormat >> unknown; + EMFP_DEBUG (printf ("EMF+\tbitmap width: %d height: %d stride: %d pixelFormat: 0x%08x\n", width, height, stride, pixelFormat)); + if (width == 0) { // non native formats + GraphicFilter filter; + + filter.ImportGraphic (graphic, String (), s); + EMFP_DEBUG (printf ("EMF+\tbitmap width: %d height: %d\n", graphic.GetBitmap ().GetSizePixel ().Width (), graphic.GetBitmap ().GetSizePixel ().Height ())); + } + + } + } + }; + + void ImplRenderer::ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, sal_uInt32 flags) + { + if (flags & 0x4000) { + sal_Int16 ix, iy, iw, ih; + + s >> ix >> iy >> iw >> ih; + + x = ix; + y = iy; + width = iw; + height = ih; + } else + s >> x >> y >> width >> height; + } + + void ImplRenderer::ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags) + { + if (flags & 0x4000) { + sal_Int16 ix, iy; + + s >> ix >> iy; + + x = ix; + y = iy; + } else + s >> x >> y; + } + + void ImplRenderer::MapToDevice (double& x, double& y) + { + // TODO: other untis + x = 100*nMmX*x/nPixX; + y = 100*nMmY*y/nPixY; + } + + ::basegfx::B2DPoint ImplRenderer::Map (::basegfx::B2DPoint& p) + { + return Map (p.getX (), p.getY ()); + } + + ::basegfx::B2DPoint ImplRenderer::Map (double ix, double iy) + { + double x, y; + + x = ix*aWorldTransform.eM11 + iy*aWorldTransform.eM21 + aWorldTransform.eDx; + y = ix*aWorldTransform.eM12 + iy*aWorldTransform.eM22 + aWorldTransform.eDy; + + MapToDevice (x, y); + + x -= nFrameLeft; + y -= nFrameTop; + + x *= aBaseTransform.eM11; + y *= aBaseTransform.eM22; + + return ::basegfx::B2DPoint (x, y); + } + + ::basegfx::B2DSize ImplRenderer::MapSize (double iwidth, double iheight) + { + double w, h; + + w = iwidth*aWorldTransform.eM11 + iheight*aWorldTransform.eM21; + h = iwidth*aWorldTransform.eM12 + iheight*aWorldTransform.eM22; + + MapToDevice (w, h); + + w *= aBaseTransform.eM11; + h *= aBaseTransform.eM22; + + return ::basegfx::B2DSize (w, h); + } + + ::basegfx::B2DRange ImplRenderer::MapRectangle (double ix, double iy, double iwidth, double iheight) + { + double x, y, w, h; + + x = ix*aWorldTransform.eM11 + iy*aWorldTransform.eM21 + aWorldTransform.eDx; + y = ix*aWorldTransform.eM12 + iy*aWorldTransform.eM22 + aWorldTransform.eDy; + w = iwidth*aWorldTransform.eM11 + iheight*aWorldTransform.eM21; + h = iwidth*aWorldTransform.eM12 + iheight*aWorldTransform.eM22; + + MapToDevice (x, y); + MapToDevice (w, h); + + x -= nFrameLeft; + y -= nFrameTop; + + x *= aBaseTransform.eM11; + y *= aBaseTransform.eM22; + w *= aBaseTransform.eM11; + h *= aBaseTransform.eM22; + + return ::basegfx::B2DRange (x, y, x + w, y + h); + } + + void ImplRenderer::EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, + OutDevState& rState, const CanvasSharedPtr& rCanvas, bool isColor, sal_uInt32 brushIndexOrColor) + { + sal_uInt8 transparency; + ::basegfx::B2DPolyPolygon localPolygon (polygon); + + EMFP_DEBUG (printf ("EMF+\tfill polygon\n")); + + localPolygon.transform( rState.mapModeTransform ); + + ActionSharedPtr pPolyAction; + + if (isColor) { + EMFP_DEBUG (printf ("EMF+\t\tcolor fill\n")); + + transparency = 0xff - (brushIndexOrColor >> 24); + + rState.isFillColorSet = true; + rState.isLineColorSet = false; + rState.fillColor = ::vcl::unotools::colorToDoubleSequence( ::Color (transparency, + (brushIndexOrColor >> 16) & 0xff, + (brushIndexOrColor >> 8) & 0xff, + brushIndexOrColor & 0xff), + rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace()); + + pPolyAction = ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, rParms.mrCanvas, rState ) ); + + } else { + rState.isFillColorSet = true; + // extract UseBrush + EMFPBrush* brush = (EMFPBrush*) aObjects [brushIndexOrColor]; + EMFP_DEBUG (printf ("EMF+\tbrush fill slot: %d (type: %d)\n", brushIndexOrColor, brush->GetType ())); + + rState.isFillColorSet = false; + rState.isLineColorSet = false; + + if (brush->type == 3 || brush->type == 4) { + + if (brush->type == 3 && !(brush->additionalFlags & 0x1)) + return; // we are unable to parse these brushes yet + + ::basegfx::B2DHomMatrix aTextureTransformation; + ::basegfx::B2DHomMatrix aWorldTransformation; + ::basegfx::B2DHomMatrix aBaseTransformation; + rendering::Texture aTexture; + double nRotation( 0.0 ); + const ::basegfx::B2DRectangle aBounds( ::basegfx::tools::getRange( localPolygon ) ); + const double nScale( ::basegfx::pruneScaleValue( fabs( aBounds.getHeight()*sin(nRotation) ) + + fabs( aBounds.getWidth()*cos(nRotation) ))); + + aWorldTransformation.set (0, 0, aWorldTransform.eM11); + aWorldTransformation.set (0, 1, aWorldTransform.eM21); + aWorldTransformation.set (0, 2, aWorldTransform.eDx); + aWorldTransformation.set (1, 0, aWorldTransform.eM12); + aWorldTransformation.set (1, 1, aWorldTransform.eM22); + aWorldTransformation.set (1, 2, aWorldTransform.eDy); + + aBaseTransformation.set (0, 0, aBaseTransform.eM11); + aBaseTransformation.set (0, 1, aBaseTransform.eM21); + aBaseTransformation.set (0, 2, aBaseTransform.eDx); + aBaseTransformation.set (1, 0, aBaseTransform.eM12); + aBaseTransformation.set (1, 1, aBaseTransform.eM22); + aBaseTransformation.set (1, 2, aBaseTransform.eDy); + + if (brush->type == 4) { + aTextureTransformation.scale (brush->areaWidth, brush->areaHeight); + aTextureTransformation.translate (brush->areaX, brush->areaY); + } else { + aTextureTransformation.translate (-0.5, -0.5); + aTextureTransformation.scale (brush->areaWidth, brush->areaHeight); + aTextureTransformation.translate (brush->areaX,brush->areaY); + } + + if (brush->hasTransformation) { + ::basegfx::B2DHomMatrix aTransformation; + + aTransformation.set (0, 0, brush->transformation.eM11); + aTransformation.set (0, 1, brush->transformation.eM21); + aTransformation.set (0, 2, brush->transformation.eDx); + aTransformation.set (1, 0, brush->transformation.eM12); + aTransformation.set (1, 1, brush->transformation.eM22); + aTransformation.set (1, 2, brush->transformation.eDy); + + aTextureTransformation *= aTransformation; + } + + aTextureTransformation *= aWorldTransformation; + aTextureTransformation.scale (100.0*nMmX/nPixX, 100.0*nMmY/nPixY); + aTextureTransformation.translate (-nFrameLeft, -nFrameTop); + aTextureTransformation *= rState.mapModeTransform; + aTextureTransformation *= aBaseTransformation; + + aTexture.RepeatModeX = rendering::TexturingMode::CLAMP; + aTexture.RepeatModeY = rendering::TexturingMode::CLAMP; + aTexture.Alpha = 1.0; + + uno::Reference< rendering::XParametricPolyPolygon2DFactory > xFactory( + rParms.mrCanvas->getUNOCanvas()->getDevice()->getParametricPolyPolygonFactory() ); + + if( xFactory.is() ) { + const uno::Sequence< double > aStartColor( + ::vcl::unotools::colorToDoubleSequence( brush->solidColor, + rParms.mrCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() ) ); + const uno::Sequence< double > aEndColor( + ::vcl::unotools::colorToDoubleSequence( brush->secondColor, + rParms.mrCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() ) ); + uno::Sequence< uno::Sequence < double > > aColors (2); + uno::Sequence< double > aStops (2); + + if (brush->blendPositions) { + EMFP_DEBUG (printf ("EMF+\t\tuse blend\n")); + aColors.realloc (brush->blendPoints); + aStops.realloc (brush->blendPoints); + int length = aStartColor.getLength (); + uno::Sequence< double > aColor (length); + + OSL_ASSERT (length == aEndColor.getLength()); + + for (int i = 0; i < brush->blendPoints; i++) { + aStops[i] = brush->blendPositions [i]; + + for (int j = 0; j < length; j++) { + if (brush->type == 4) { +// // gamma correction +// if (brush->additionalFlags & 0x80) +// aColor [j] = pow (aStartColor [j]*(1 - brush->blendFactors[i]) + aEndColor [j]*brush->blendFactors[i], 1/2.2); +// else + aColor [j] = aStartColor [j]*(1 - brush->blendFactors[i]) + aEndColor [j]*brush->blendFactors[i]; + } else + aColor [j] = aStartColor [j]*brush->blendFactors[i] + aEndColor [j]*(1 - brush->blendFactors[i]); + } + + aColors[i] = aColor; + } + } else if (brush->colorblendPositions) { + EMFP_DEBUG (printf ("EMF+\t\tuse color blend\n")); + aColors.realloc (brush->colorblendPoints); + aStops.realloc (brush->colorblendPoints); + + for (int i = 0; i < brush->colorblendPoints; i++) { + aStops[i] = brush->colorblendPositions [i]; + aColors[(brush->type == 4) ? i : brush->colorblendPoints - 1 - i] = ::vcl::unotools::colorToDoubleSequence( brush->colorblendColors [i], + rParms.mrCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() ); + } + } else { + aStops[0] = 0.0; + aStops[1] = 1.0; + + if (brush->type == 4) { + aColors[0] = aStartColor; + aColors[1] = aEndColor; + } else { + aColors[1] = aStartColor; + aColors[0] = aEndColor; + } + } + + EMFP_DEBUG (printf ("EMF+\t\tset gradient\n")); + if (brush->type == 4) + aTexture.Gradient = xFactory->createLinearHorizontalGradient( aColors, + aStops ); + else { + geometry::RealRectangle2D aBoundsRectangle (0, 0, 1, 1); + aTexture.Gradient = xFactory->createEllipticalGradient( aColors, + aStops, + aBoundsRectangle); + } + } + + ::basegfx::unotools::affineMatrixFromHomMatrix( aTexture.AffineTransform, + aTextureTransformation ); + + pPolyAction = + ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, + rParms.mrCanvas, + rState, + aTexture ) ); + } + } + + if( pPolyAction ) + { + EMFP_DEBUG (printf ("EMF+\t\tadd poly action\n")); + + maActions.push_back( + MtfAction( + pPolyAction, + rParms.mrCurrActionIndex ) ); + + rParms.mrCurrActionIndex += pPolyAction->getActionCount()-1; + } + } + + void ImplRenderer::processEMFPlus( MetaCommentAction* pAct, const ActionFactoryParameters& rFactoryParms, + OutDevState& rState, const CanvasSharedPtr& rCanvas ) + { + sal_uInt32 length = pAct->GetDataSize (); + SvMemoryStream rMF ((void*) pAct->GetData (), length, STREAM_READ); + + length -= 4; + + while (length > 0) { + UINT16 type, flags; + UINT32 size, dataSize; + sal_uInt32 next; + + rMF >> type >> flags >> size >> dataSize; + + next = rMF.Tell() + ( size - 12 ); + + EMFP_DEBUG (printf ("EMF+ record size: %d type: %04hx flags: %04hx data size: %d\n", size, type, flags, dataSize)); + + switch (type) { + case EmfPlusRecordTypeHeader: + UINT32 header, version; + + rMF >> header >> version >> nHDPI >> nVDPI; + + EMFP_DEBUG (printf ("EMF+ Header\n")); + EMFP_DEBUG (printf ("EMF+\theader: 0x%08x version: %d horizontal DPI: %d vertical DPI: %d dual: %d\n", header, version, nHDPI, nVDPI, flags & 1)); + + break; + case EmfPlusRecordTypeEndOfFile: + EMFP_DEBUG (printf ("EMF+ EndOfFile\n")); + break; + case EmfPlusRecordTypeGetDC: + EMFP_DEBUG (printf ("EMF+ GetDC\n")); + EMFP_DEBUG (printf ("EMF+\talready used in svtools wmf/emf filter parser\n")); + break; + case EmfPlusRecordTypeObject: + { + UINT32 objectLen; + sal_uInt32 index; + + EMFP_DEBUG (printf ("EMF+ Object slot: %hd flags: %hx\n", flags & 0xff, flags & 0xff00)); + + index = flags & 0xff; + if (aObjects [index] != NULL) { + delete aObjects [index]; + aObjects [index] = NULL; + } + + switch (flags & 0xff00) { + case EmfPlusObjectTypeBrush: + { + EMFPBrush *brush; + aObjects [index] = brush = new EMFPBrush (); + brush->Read (rMF, *this); + + break; + } + case EmfPlusObjectTypePen: + { + EMFPPen *pen; + aObjects [index] = pen = new EMFPPen (); + pen->Read (rMF, *this, nHDPI, nVDPI); + + break; + } + case EmfPlusObjectTypePath: + sal_uInt32 header, pathFlags; + sal_Int32 points; + + rMF >> header >> points >> pathFlags; + + EMFP_DEBUG (printf ("EMF+\tpath\n")); + EMFP_DEBUG (printf ("EMF+\theader: 0x%08x points: %d additional flags: 0x%08x\n", header, points, pathFlags)); + + EMFPPath *path; + aObjects [index] = path = new EMFPPath (points); + path->Read (rMF, pathFlags, *this); + + break; + case EmfPlusObjectTypeRegion: { + EMFPRegion *region; + + aObjects [index] = region = new EMFPRegion (); + region->Read (rMF); + + break; + } + case EmfPlusObjectTypeImage: + { + EMFPImage *image; + aObjects [index] = image = new EMFPImage (); + image->Read (rMF); + + break; + } + default: + EMFP_DEBUG (printf ("EMF+\tObject unhandled flags: 0x%04x\n", flags & 0xff00)); + break; + } + + break; + } + case EmfPlusRecordTypeFillPath: + { + sal_uInt32 index = flags & 0xff; + sal_uInt32 brushIndexOrColor; + + rMF >> brushIndexOrColor; + + EMFP_DEBUG (printf ("EMF+ FillPath slot: %d\n", index)); + + EMFPPlusFillPolygon (((EMFPPath*) aObjects [index])->GetPolygon (*this), rFactoryParms, rState, rCanvas, flags & 0x8000, brushIndexOrColor); + } + break; + case EmfPlusRecordTypeFillRects: + { + EMFP_DEBUG (printf ("EMF+ FillRects\n")); + + sal_uInt32 brushIndexOrColor; + sal_Int32 rectangles; + ::basegfx::B2DPolygon polygon; + + rMF >> brushIndexOrColor >> rectangles; + + EMFP_DEBUG (printf ("EMF+\t%s: 0x%08x\n", (flags & 0x8000) ? "color" : "brush index", brushIndexOrColor)); + + for (int i=0; i < rectangles; i++) { + if (flags & 0x4000) { + /* 16bit integers */ + sal_Int16 x, y, width, height; + + rMF >> x >> y >> width >> height; + + polygon.append (Map (x, y)); + polygon.append (Map (x + width, y)); + polygon.append (Map (x + width, y + height)); + polygon.append (Map (x, y + height)); + + EMFP_DEBUG (printf ("EMF+\trectangle: %d,%d %dx%d\n", x, y, width, height)); + } else { + /* Single's */ + float x, y, width, height; + + rMF >> x >> y >> width >> height; + + polygon.append (Map (x, y)); + polygon.append (Map (x + width, y)); + polygon.append (Map (x + width, y + height)); + polygon.append (Map (x, y + height)); + + EMFP_DEBUG (printf ("EMF+\trectangle: %f,%f %fx%f\n", x, y, width, height)); + } + + ::basegfx::B2DPolyPolygon polyPolygon (polygon); + + EMFPPlusFillPolygon (polyPolygon, rFactoryParms, rState, rCanvas, flags & 0x8000, brushIndexOrColor); + } + break; + } + case EmfPlusRecordTypeFillPolygon: + { + sal_uInt8 index = flags & 0xff; + sal_uInt32 brushIndexOrColor; + sal_Int32 brushIndex; + sal_Int32 points; + UINT32 color; + USHORT transparency = 0; + + rMF >> brushIndexOrColor; + rMF >> points; + + EMFP_DEBUG (printf ("EMF+ FillPolygon in slot: %d points: %d\n", index, points)); + EMFP_DEBUG (printf ("EMF+\twith solid color (ARGB): 0x%08X\n", color)); + + EMFPPath path (points, true); + path.Read (rMF, flags, *this); + + + EMFPPlusFillPolygon (path.GetPolygon (*this), rFactoryParms, rState, rCanvas, flags & 0x8000, brushIndexOrColor); + + break; + } + case EmfPlusRecordTypeDrawLines: + { + sal_uInt32 index = flags & 0xff; + sal_uInt32 points; + + rMF >> points; + + EMFP_DEBUG (printf ("EMF+ DrawLines in slot: %d points: %d\n", index, points)); + + EMFPPath path (points, true); + path.Read (rMF, flags, *this); + + EMFPPen* pen = (EMFPPen*) aObjects [index]; + + rState.isFillColorSet = false; + rState.isLineColorSet = true; + rState.lineColor = ::vcl::unotools::colorToDoubleSequence (pen->GetColor (), + rCanvas->getUNOCanvas ()->getDevice()->getDeviceColorSpace() ); + ::basegfx::B2DPolyPolygon& polygon (path.GetPolygon (*this)); + + polygon.transform( rState.mapModeTransform ); + + rendering::StrokeAttributes aStrokeAttributes; + + pen->SetStrokeAttributes (aStrokeAttributes, *this, rState); + + ActionSharedPtr pPolyAction( + internal::PolyPolyActionFactory::createPolyPolyAction( + polygon, rFactoryParms.mrCanvas, rState, aStrokeAttributes ) ); + + if( pPolyAction ) + { + maActions.push_back( + MtfAction( + pPolyAction, + rFactoryParms.mrCurrActionIndex ) ); + + rFactoryParms.mrCurrActionIndex += pPolyAction->getActionCount()-1; + } + + break; + } + case EmfPlusRecordTypeDrawPath: + { + UINT32 penIndex; + + rMF >> penIndex; + + EMFP_DEBUG (printf ("EMF+ DrawPath\n")); + EMFP_DEBUG (printf ("EMF+\tpen: %d\n", penIndex)); + + EMFPPath* path = (EMFPPath*) aObjects [flags & 0xff]; + EMFPPen* pen = (EMFPPen*) aObjects [penIndex]; + + rState.isFillColorSet = false; + rState.isLineColorSet = true; + rState.lineColor = ::vcl::unotools::colorToDoubleSequence (pen->GetColor (), + rCanvas->getUNOCanvas ()->getDevice()->getDeviceColorSpace()); + ::basegfx::B2DPolyPolygon& polygon (path->GetPolygon (*this)); + + polygon.transform( rState.mapModeTransform ); + rendering::StrokeAttributes aStrokeAttributes; + + pen->SetStrokeAttributes (aStrokeAttributes, *this, rState); + + ActionSharedPtr pPolyAction( + internal::PolyPolyActionFactory::createPolyPolyAction( + polygon, rFactoryParms.mrCanvas, rState, aStrokeAttributes ) ); + + if( pPolyAction ) + { + maActions.push_back( + MtfAction( + pPolyAction, + rFactoryParms.mrCurrActionIndex ) ); + + rFactoryParms.mrCurrActionIndex += pPolyAction->getActionCount()-1; + } + break; + } + case EmfPlusRecordTypeDrawImagePoints: + { + sal_uInt32 attrIndex; + sal_Int32 sourceUnit; + + rMF >> attrIndex >> sourceUnit; + + EMFP_DEBUG (printf ("EMF+ DrawImagePoints attributes index: %d source unit: %d\n", attrIndex, sourceUnit)); + EMFP_DEBUG (printf ("EMF+\tTODO: use image attributes\n")); + + if (sourceUnit == 2 && aObjects [flags & 0xff]) { // we handle only GraphicsUnit.Pixel now + EMFPImage& image = *(EMFPImage *) aObjects [flags & 0xff]; + float sx, sy, sw, sh; + sal_Int32 unknown; + + ReadRectangle (rMF, sx, sy, sw, sh); + + rMF >> unknown; + + EMFP_DEBUG (printf ("EMF+ DrawImagePoints source rectangle: %f,%f %fx%f unknown: 0x%08x\n", sx, sy, sw, sh, unknown)); + + if (unknown == 3) { // it probably means number of points defining destination rectangle + float x1, y1, x2, y2, x3, y3; + + ReadPoint (rMF, x1, y1); + ReadPoint (rMF, x2, y2); + ReadPoint (rMF, x3, y3); + + BitmapEx aBmp( image.graphic.GetBitmapEx () ); + const Rectangle aCropRect (::vcl::unotools::pointFromB2DPoint (Map (sx, sy)), + ::vcl::unotools::sizeFromB2DSize (MapSize(sw, sh))); + aBmp.Crop( aCropRect ); + + + ActionSharedPtr pBmpAction ( + internal::BitmapActionFactory::createBitmapAction ( + aBmp, + rState.mapModeTransform * Map (x1, y1), + rState.mapModeTransform * MapSize(x2 - x1, y3 - y1), + rCanvas, + rState)); + + if( pBmpAction ) { + maActions.push_back( MtfAction( pBmpAction, + rFactoryParms.mrCurrActionIndex ) ); + + rFactoryParms.mrCurrActionIndex += pBmpAction->getActionCount()-1; + } + } else + EMFP_DEBUG (printf ("EMF+ DrawImagePoints TODO (fixme)\n")); + } + break; + } + case EmfPlusRecordTypeDrawString: + EMFP_DEBUG (printf ("EMF+ DrawString\n")); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSetPageTransform: + rMF >> fPageScale; + + EMFP_DEBUG (printf ("EMF+ SetPageTransform\n")); + EMFP_DEBUG (printf ("EMF+\tscale: %f unit: %d\n", fPageScale, flags)); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSetRenderingOrigin: + rMF >> nOriginX >> nOriginY; + EMFP_DEBUG (printf ("EMF+ SetRenderingOrigin\n")); + EMFP_DEBUG (printf ("EMF+\torigin [x,y]: %d,%d\n", nOriginX, nOriginY)); + break; + case EmfPlusRecordTypeSetTextRenderingHint: + EMFP_DEBUG (printf ("EMF+ SetTextRenderingHint\n")); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSetAntiAliasMode: + EMFP_DEBUG (printf ("EMF+ SetAntiAliasMode\n")); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSetInterpolationMode: + EMFP_DEBUG (printf ("EMF+ InterpolationMode\n")); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSetPixelOffsetMode: + EMFP_DEBUG (printf ("EMF+ SetPixelOffsetMode\n")); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSetCompositingQuality: + EMFP_DEBUG (printf ("EMF+ SetCompositingQuality\n")); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSave: + EMFP_DEBUG (printf ("EMF+ Save\n")); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + case EmfPlusRecordTypeSetWorldTransform: { + EMFP_DEBUG (printf ("EMF+ SetWorldTransform\n")); + XForm transform; + rMF >> transform; + aWorldTransform.Set (transform); + EMFP_DEBUG (printf ("EMF+\tm11: %f m12: %f\nEMF+\tm21: %f m22: %f\nEMF+\tdx: %f dy: %f\n", + aWorldTransform.eM11, aWorldTransform.eM12, + aWorldTransform.eM21, aWorldTransform.eM22, + aWorldTransform.eDx, aWorldTransform.eDy)); + break; + } + case EmfPlusRecordTypeResetWorldTransform: + EMFP_DEBUG (printf ("EMF+ ResetWorldTransform\n")); + aWorldTransform.SetIdentity (); + break; + case EmfPlusRecordTypeSetClipPath: + { + EMFP_DEBUG (printf ("EMF+ SetClipPath\n")); + EMFP_DEBUG (printf ("EMF+\tpath in slot: %d\n", flags & 0xff)); + + EMFPPath& path = *(EMFPPath*) aObjects [flags & 0xff]; + ::basegfx::B2DPolyPolygon& clipPoly (path.GetPolygon (*this)); + + clipPoly.transform (rState.mapModeTransform); + updateClipping (clipPoly, rFactoryParms, false); + + break; + } + case EmfPlusRecordTypeSetClipRegion: { + EMFP_DEBUG (printf ("EMF+ SetClipRegion\n")); + EMFP_DEBUG (printf ("EMF+\tregion in slot: %d combine mode: %d\n", flags & 0xff, (flags & 0xff00) >> 8)); + EMFPRegion& region = *(EMFPRegion*) aObjects [flags & 0xff]; + + // reset clip + if (region.parts == 0 && region.initialState == EmfPlusRegionInitialStateInfinite) { + updateClipping (::basegfx::B2DPolyPolygon (), rFactoryParms, false); + } else + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + } + case EmfPlusRecordTypeDrawDriverString: + EMFP_DEBUG (printf ("EMF+ DrawDriverString, flags: 0x%04x\n", flags)); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + break; + default: + EMFP_DEBUG (printf ("EMF+ unhandled record type: %d\n", type)); + EMFP_DEBUG (printf ("EMF+\tTODO\n")); + } + + rMF.Seek (next); + + length -= size; + } + } + } +} diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 1423cd42ed93..b83cbacdcd29 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -92,6 +92,8 @@ #include "outdevstate.hxx" #include +#define EMFP_DEBUG(x) +//#define EMFP_DEBUG(x) x using namespace ::com::sun::star; @@ -1808,6 +1810,33 @@ namespace cppcanvas } } } + // Handle drawing layer fills + else if( pAct->GetComment().Equals( "EMF_PLUS" ) ) { + static int count = -1, limit = 0x7fffffff; + if (count == -1) { + count = 0; + char *env; + if (env = getenv ("EMF_PLUS_LIMIT")) { + limit = atoi (env); + } + } + EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer, size: %d\n", pAct->GetDataSize ())); + if (count < limit) + processEMFPlus( pAct, rFactoryParms, getState( rStates ), rCanvas ); + count ++; + } else if( pAct->GetComment().Equals( "EMF_PLUS_HEADER_INFO" ) ) { + EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer - header info, size: %d\n", pAct->GetDataSize ())); + + SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ); + + rMF >> nFrameLeft >> nFrameTop >> nFrameRight >> nFrameBottom; + EMFP_DEBUG (printf ("EMF+ picture frame: %d,%d - %d,%d\n", nFrameLeft, nFrameTop, nFrameRight, nFrameBottom)); + rMF >> nPixX >> nPixY >> nMmX >> nMmY; + EMFP_DEBUG (printf ("EMF+ ref device pixel size: %dx%d mm size: %dx%d\n", nPixX, nPixY, nMmX, nMmY)); + + rMF >> aBaseTransform; + //aWorldTransform.Set (aBaseTransform); + } } break; @@ -2976,6 +3005,9 @@ namespace cppcanvas aParms ); } + /* EMF+ */ + memset (aObjects, 0, sizeof (aObjects)); + createActions( const_cast(rMtf), // HACK(Q2): // we're // changing diff --git a/cppcanvas/source/mtfrenderer/makefile.mk b/cppcanvas/source/mtfrenderer/makefile.mk index dfe6e28030bf..1109ce2a3950 100644 --- a/cppcanvas/source/mtfrenderer/makefile.mk +++ b/cppcanvas/source/mtfrenderer/makefile.mk @@ -44,6 +44,7 @@ CDEFS+= -DVERBOSE SLOFILES = $(SLO)$/cachedprimitivebase.obj \ $(SLO)$/bitmapaction.obj \ + $(SLO)$/emfplus.obj \ $(SLO)$/implrenderer.obj \ $(SLO)$/lineaction.obj \ $(SLO)$/pointaction.obj \ diff --git a/cppcanvas/util/makefile.mk b/cppcanvas/util/makefile.mk index f0d6fc7426a4..01cf6234602c 100644 --- a/cppcanvas/util/makefile.mk +++ b/cppcanvas/util/makefile.mk @@ -46,7 +46,7 @@ LIB1FILES=\ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1IMPLIB= i$(TARGET) -SHL1STDLIBS= $(TOOLSLIB) $(CPPULIB) $(SALLIB) $(VCLLIB) $(COMPHELPERLIB) $(CANVASTOOLSLIB) $(CPPUHELPERLIB) $(BASEGFXLIB) $(I18NISOLANGLIB) +SHL1STDLIBS= $(TOOLSLIB) $(CPPULIB) $(SALLIB) $(VCLLIB) $(COMPHELPERLIB) $(CANVASTOOLSLIB) $(CPPUHELPERLIB) $(BASEGFXLIB) $(I18NISOLANGLIB) $(SVTOOLLIB) .IF "$(debug)$(dbgutil)"!="" SHL1STDLIBS += $(CPPUHELPERLIB) -- cgit From 25a9a8773910d245977d57e8bdf4e5c7ab8c916b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:00:19 +0200 Subject: added copyright notice --- cppcanvas/source/mtfrenderer/emfplus.cxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index ef1e76a335f4..46f643f2345a 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -1,3 +1,30 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + #include #include #include -- cgit From cc3f43692add98b83f3a344690698c5f7026dcb0 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:02:24 +0200 Subject: emf+-vcl-bitmap.diff: emf+ import - create vcl bitmap from XBitmap --- vcl/aqua/inc/salbmp.h | 3 +++ vcl/aqua/source/gdi/salbmp.cxx | 7 +++++++ vcl/inc/vcl/salbmp.hxx | 5 +++++ vcl/unx/headless/svpbmp.cxx | 5 +++++ vcl/unx/headless/svpbmp.hxx | 3 +++ vcl/unx/inc/salbmp.h | 3 +++ vcl/unx/source/gdi/salbmp.cxx | 26 ++++++++++++++++++++++++++ vcl/win/inc/salbmp.h | 3 +++ vcl/win/source/gdi/salbmp.cxx | 7 +++++++ 9 files changed, 62 insertions(+) diff --git a/vcl/aqua/inc/salbmp.h b/vcl/aqua/inc/salbmp.h index 1c427cce0cd5..532febb1e7a1 100644 --- a/vcl/aqua/inc/salbmp.h +++ b/vcl/aqua/inc/salbmp.h @@ -74,6 +74,9 @@ public: bool Create( const SalBitmap& rSalBmp ); bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics ); bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); void Destroy(); diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx index 0e58c35b5fad..ad1cf16830b4 100644 --- a/vcl/aqua/source/gdi/salbmp.cxx +++ b/vcl/aqua/source/gdi/salbmp.cxx @@ -153,6 +153,13 @@ bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, USHORT nNewBitCount ) // ------------------------------------------------------------------ +bool AquaSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > /*xBitmapCanvas*/, Size& /*rSize*/, bool /*bMask*/ ) +{ + return false; +} + +// ------------------------------------------------------------------ + void AquaSalBitmap::Destroy() { DestroyContext(); diff --git a/vcl/inc/vcl/salbmp.hxx b/vcl/inc/vcl/salbmp.hxx index 4aca4a9277e9..678b57fbf56f 100644 --- a/vcl/inc/vcl/salbmp.hxx +++ b/vcl/inc/vcl/salbmp.hxx @@ -33,6 +33,8 @@ #endif #include +#include + struct BitmapBuffer; class SalGraphics; class BitmapPalette; @@ -52,6 +54,9 @@ public: SalGraphics* pGraphics ) = 0; virtual bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount ) = 0; + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ) = 0; virtual void Destroy() = 0; virtual Size GetSize() const = 0; virtual USHORT GetBitCount() const = 0; diff --git a/vcl/unx/headless/svpbmp.cxx b/vcl/unx/headless/svpbmp.cxx index 7c84c4a7a579..885b2723aa19 100644 --- a/vcl/unx/headless/svpbmp.cxx +++ b/vcl/unx/headless/svpbmp.cxx @@ -116,6 +116,11 @@ bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/, return false; } +bool SvpSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > /*xBitmapCanvas*/, Size& /*rSize*/, bool /*bMask*/ ) +{ + return false; +} + void SvpSalBitmap::Destroy() { m_aBitmap.reset(); diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx index dc775e66aaf1..6b0e43006b0d 100644 --- a/vcl/unx/headless/svpbmp.hxx +++ b/vcl/unx/headless/svpbmp.hxx @@ -53,6 +53,9 @@ public: SalGraphics* pGraphics ); virtual bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); virtual void Destroy(); virtual Size GetSize() const; virtual USHORT GetBitCount() const; diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h index 23e038f30ab1..2d02c7d6b9b4 100644 --- a/vcl/unx/inc/salbmp.h +++ b/vcl/unx/inc/salbmp.h @@ -110,6 +110,9 @@ public: SalGraphics* pGraphics ); virtual bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); virtual void Destroy(); diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index cc7934b0a798..3f8e8de564be 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -47,6 +47,7 @@ #include #include #include +#include // ----------- // - Defines - @@ -744,6 +745,31 @@ bool X11SalBitmap::Create( const SalBitmap&, USHORT ) // ----------------------------------------------------------------------------- +bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, Size& rSize, bool bMask ) +{ + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY ); + if( xFastPropertySet.get() ) { + long pixmapHandle; + sal_Int32 depth; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > args; + + if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) { + if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) { + bool bSuccess = ImplCreateFromDrawable( pixmapHandle, 0, depth, 0, 0, (long) rSize.Width(), (long) rSize.Height() ); + bool bFreePixmap; + if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap ) + XFreePixmap( GetX11SalData()->GetDisplay()->GetDisplay(), pixmapHandle ); + + return bSuccess; + } + } + } + + return false; +} + +// ----------------------------------------------------------------------------- + void X11SalBitmap::Destroy() { if( mpDIB ) diff --git a/vcl/win/inc/salbmp.h b/vcl/win/inc/salbmp.h index 7a31add2ae19..0705d27aa8dc 100644 --- a/vcl/win/inc/salbmp.h +++ b/vcl/win/inc/salbmp.h @@ -74,6 +74,9 @@ public: virtual bool Create( const SalBitmap& rSalBmpImpl ); virtual bool Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics ); virtual bool Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); virtual void Destroy(); diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx index 444df039dd69..2717a45bfbe0 100644 --- a/vcl/win/source/gdi/salbmp.cxx +++ b/vcl/win/source/gdi/salbmp.cxx @@ -264,6 +264,13 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, USHORT nNewBitCount ) // ------------------------------------------------------------------ +bool WinSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > /*xBitmapCanvas*/, Size& /*rSize*/, bool /*bMask*/ ) +{ + return false; +} + +// ------------------------------------------------------------------ + void WinSalBitmap::Destroy() { if( mhDIB ) -- cgit From ac58ef65487c17d91e1dd6d10adc9666c434e88b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:11:04 +0200 Subject: emf+-vcl-renderer.diff: emf+ import - use cppcanvas renderer in vcl --- vcl/inc/vcl/gdimtf.hxx | 1 + vcl/source/gdi/gdimtf.cxx | 92 ++++++++++++++++++++++++++++++++++++++++++++-- vcl/source/gdi/metaact.cxx | 27 ++++++++++++++ 3 files changed, 117 insertions(+), 3 deletions(-) diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index 636fc4a979f3..5660bb139f3b 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -135,6 +135,7 @@ private: const OutputDevice& rMapDev, const PolyPolygon& rPolyPoly, const Gradient& rGrad ); + SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize ); //#endif // __PRIVATE diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index d36a18a1afba..8f0f7abfdf19 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -35,12 +35,24 @@ #include #include #include -#ifndef _SV_CVTSVM_HXX #include -#endif #include +#include +#include +#include +#include #include #include +#include +#include + +#include +#include +#include +#include +#include + +using namespace com::sun::star; // ----------- // - Defines - @@ -475,6 +487,76 @@ void GDIMetaFile::Play( OutputDevice* pOut, ULONG nPos ) // ------------------------------------------------------------------------ +bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize ) +{ + const Window* win = dynamic_cast ( pOut ); + + if (!win) + win = Application::GetActiveTopWindow(); + if (!win) + win = Application::GetFirstTopLevelWindow(); + + if (win) { + const uno::Reference& xCanvas = win->GetCanvas (); + Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1); + const uno::Reference& xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize)); + uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); + if( xFactory.is() && xBitmap.is () ) { + uno::Reference< rendering::XMtfRenderer > xMtfRenderer; + uno::Sequence< uno::Any > args (1); + uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY ); + if( xBitmapCanvas.is() ) { + args[0] = uno::Any( xBitmapCanvas ); + xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.rendering.MtfRenderer" ), + args ), uno::UNO_QUERY ); + + if( xMtfRenderer.is() ) { + xBitmapCanvas->clear(); + uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY ); + if( xMtfFastPropertySet.is() ) + // set this metafile to the renderer to + // speedup things (instead of copying data to + // sequence of bytes passed to renderer) + xMtfFastPropertySet->setFastPropertyValue( 0, uno::Any( reinterpret_cast( this ) ) ); + + xMtfRenderer->draw( rDestSize.Width(), rDestSize.Height() ); + + uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY ); + if( xFastPropertySet.get() ) { + // 0 means get BitmapEx + uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 ); + BitmapEx* pBitmapEx = (BitmapEx*) *reinterpret_cast(aAny.getValue()); + if( pBitmapEx ) { + pOut->DrawBitmapEx( rPos, *pBitmapEx ); + delete pBitmapEx; + return true; + } + } + + SalBitmap* pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap(); + SalBitmap* pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap(); + + if( pSalBmp->Create( xBitmapCanvas, aSize ) && pSalMask->Create( xBitmapCanvas, aSize, true ) ) { + Bitmap aBitmap( pSalBmp ); + Bitmap aMask( pSalMask ); + AlphaMask aAlphaMask( aMask ); + BitmapEx aBitmapEx( aBitmap, aAlphaMask ); + pOut->DrawBitmapEx( rPos, aBitmapEx ); + return true; + } + + delete pSalBmp; + delete pSalMask; + } + } + } + } + + return false; +} + +// ------------------------------------------------------------------------ + void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, const Size& rSize, ULONG nPos ) { @@ -484,9 +566,13 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, if( aDestSize.Width() && aDestSize.Height() ) { - Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) ); GDIMetaFile* pMtf = pOut->GetConnectMetaFile(); + if( !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) ) + return; + + Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) ); + if( !aTmpPrefSize.Width() ) aTmpPrefSize.Width() = aDestSize.Width(); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 94f07b8f17d1..1102569d0844 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -4093,6 +4093,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove ) // SJ: 25.07.06 #i56656# we are not able to mirrorcertain kind of // comments properly, especially the XPATHSTROKE and XPATHFILL lead to // problems, so it is better to remove these comments when mirroring +// FIXME: fake comment to apply the next hunk in the right location void MetaCommentAction::Scale( double fXScale, double fYScale ) { if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) ) @@ -4126,6 +4127,32 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) } delete[] mpData; ImplInitDynamicData( static_cast( aDest.GetData() ), aDest.Tell() ); + } else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) { + SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ ); + SvMemoryStream aDest; + + sal_Int32 nLeft, nRight, nTop, nBottom; + sal_Int32 nPixX, nPixY, nMillX, nMillY; + float m11, m12, m21, m22, mdx, mdy; + + // read data + aMemStm >> nLeft >> nTop >> nRight >> nBottom; + aMemStm >> nPixX >> nPixY >> nMillX >> nMillY; + aMemStm >> m11 >> m12 >> m21 >> m22 >> mdx >> mdy; + + // add scale to the transformation + m11 *= fXScale; + m12 *= fXScale; + m22 *= fYScale; + m21 *= fYScale; + + // prepare new data + aDest << nLeft << nTop << nRight << nBottom; + aDest << nPixX << nPixY << nMillX << nMillY; + aDest << m11 << m12 << m21 << m22 << mdx << mdy; + + // save them + ImplInitDynamicData( static_cast( aDest.GetData() ), aDest.Tell() ); } } } -- cgit From 33bf550d54f0a9f98edd2e7aec1ece5ba11a1def Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:12:11 +0200 Subject: emf+-svtools.diff: emf+ import - parse emf+, pass it along in comments --- svtools/source/filter.vcl/wmf/enhwmf.cxx | 141 +++++++++++++++++++++++++++++++ svtools/source/filter.vcl/wmf/winmtf.cxx | 36 ++++++++ svtools/source/filter.vcl/wmf/winmtf.hxx | 9 +- 3 files changed, 185 insertions(+), 1 deletion(-) diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx index 1e49e0d61446..a11c739022e5 100644 --- a/svtools/source/filter.vcl/wmf/enhwmf.cxx +++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx @@ -158,6 +158,8 @@ #define EMR_SETLINKEDUFIS 119 #define EMR_SETTEXTJUSTIFICATION 120 +#define EMFP_DEBUG(x) +//#define EMFP_DEBUG(x) x //----------------------------------------------------------------------------------- @@ -229,6 +231,110 @@ static sal_Bool ImplReadRegion( PolyPolygon& rPolyPoly, SvStream& rSt, sal_uInt3 return bOk; } +EMFP_DEBUG(void dumpWords( SvStream& s, int i ) +{ + sal_uInt32 pos = s.Tell(); + INT16 data; + for( ; i > 0; i -- ) { + s >> data; + EMFP_DEBUG(printf ("\t\t\tdata: %04hx\n", data)); + } + s.Seek (pos); +}); + +void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) +{ + if (!bEMFPlus) { + pOut->PassEMFPlusHeaderInfo(); + + // debug code - write the stream to debug file /tmp/emf-stream.emf + EMFP_DEBUG(int pos = pWMF->Tell(); + pWMF->Seek(0); + SvFileStream file( UniString::CreateFromAscii( "/tmp/emf-stream.emf" ), STREAM_WRITE | STREAM_TRUNC ); + + *pWMF >> file; + file.Flush(); + file.Close(); + + pWMF->Seek( pos );) + } + bEMFPlus = true; + + void *buffer = malloc( length ); + + int count = 0, next, pos = pWMF->Tell(); + pOut->PassEMFPlus( buffer, pWMF->Read( buffer, length ) ); + pWMF->Seek( pos ); + + bHaveDC = false; + + length -= 4; + + while (length > 0) { + UINT16 type, flags; + UINT32 size, dataSize; + sal_uInt32 next; + + *pWMF >> type >> flags >> size >> dataSize; + + EMFP_DEBUG(printf ("\t\tEMF+ record type: %d\n", type)); + + // GetDC + if( type == 16388 ) { + bHaveDC = true; + EMFP_DEBUG(printf ("\t\tEMF+ lock DC (device context)\n", type)); + } + + next = pWMF->Tell() + ( size - 12 ); + + length -= size; + + pWMF->Seek( next ); + } + + free( buffer ); +} + +void EnhWMFReader::ReadGDIComment() +{ + sal_uInt32 type; + + *pWMF >> type; + + switch( type ) { + case 2: { + sal_Int32 x, y, r, b; + + EMFP_DEBUG(printf ("\t\tBEGINGROUP\n")); + + *pWMF >> x >> y >> r >> b; + EMFP_DEBUG(printf ("\t\tbounding rectangle: %d,%d x %d,%d\n", x, y, r, b)); + + sal_uInt32 l; + + *pWMF >> l; + EMFP_DEBUG(printf ("\t\tdescription length: %d\n", l)); + + break; + } + case 3: { + sal_uInt32 x, y, w, h; + + EMFP_DEBUG(printf ("\t\tENDGROUP\n")); + break; + } + case 0x40000004: { + sal_uInt32 x, y, w, h; + + EMFP_DEBUG(printf ("\t\tMULTIFORMATS\n")); + break; + } + default: + EMFP_DEBUG(printf ("\t\tunknown GDIComment\n")); + EMFP_DEBUG(dumpWords (*pWMF, 16)); + } +} + BOOL EnhWMFReader::ReadEnhWMF() { sal_uInt32 nStretchBltMode = 0; @@ -239,6 +345,14 @@ BOOL EnhWMFReader::ReadEnhWMF() sal_Int16 nX16, nY16; sal_Bool bFlag, bStatus = ReadHeader(); + sal_Bool bHaveDC = false; + +#ifdef UNX + static sal_Bool bEnableEMFPlus = ( getenv( "EMF_PLUS_DISABLE" ) == NULL ); +#else + // TODO: make it possible to disable emf+ on windows + static sal_Bool bEnableEMFPlus = sal_True; +#endif while( bStatus && nRecordCount-- ) { @@ -263,6 +377,33 @@ BOOL EnhWMFReader::ReadEnhWMF() bFlag = sal_False; + EMFP_DEBUG(printf ("0x%04x-0x%04x record type: %d size: %d\n", nNextPos - nRecSize, nNextPos, nRecType, nRecSize)); + + if( bEnableEMFPlus && nRecType == EMR_GDICOMMENT ) { + sal_uInt32 length; + + *pWMF >> length; + + EMFP_DEBUG(printf ("\tGDI comment\n\t\tlength: %d\n", length)); + + if( length >= 4 ) { + UINT32 id; + + *pWMF >> id; + + EMFP_DEBUG(printf ("\t\tbegin %c%c%c%c id: 0x%x\n", (char)(id & 0xff), (char)((id & 0xff00) >> 8), (char)((id & 0xff0000) >> 16), (char)((id & 0xff000000) >> 24), id)); + + // EMF+ comment (fixme: BE?) + if( id == 0x2B464D45 && nRecSize >= 12 ) + ReadEMFPlusComment( length, bHaveDC ); + // GDIC comment, doesn't do anything useful yet => enabled only for debug + else if( id == 0x43494447 && nRecSize >= 12 ) + EMFP_DEBUG(ReadGDIComment()); + else + EMFP_DEBUG(printf ("\t\tunknown id: 0x%x\n", id)); + } + } else if( !bEMFPlus || bHaveDC || nRecType == EMR_EOF ) + switch( nRecType ) { case EMR_POLYBEZIERTO : diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index 787e6522b890..4579c5bda9f6 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -38,6 +38,9 @@ #define WIN_MTF_MAX_CLIP_DEPTH 16 +#define EMFP_DEBUG(x) +//#define EMFP_DEBUG(x) x + void WinMtfClipPath::ImpUpdateType() { if ( !aPolyPoly.Count() ) @@ -2201,3 +2204,36 @@ void WinMtfOutput::AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ) rGDIMetaFile.Play( *mpGDIMetaFile, 0xFFFFFFFF ); } +void WinMtfOutput::PassEMFPlusHeaderInfo() +{ + EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS header info\n")); + + SvMemoryStream mem; + sal_Int32 nLeft, nRight, nTop, nBottom; + + nLeft = mrclFrame.Left(); + nTop = mrclFrame.Top(); + nRight = mrclFrame.Right(); + nBottom = mrclFrame.Bottom(); + + // emf header info + mem << nLeft << nTop << nRight << nBottom; + mem << mnPixX << mnPixY << mnMillX << mnMillY; + + float one, zero; + + one = 1; + zero = 0; + + // add transformation matrix to be used in vcl's metaact.cxx for + // rotate and scale operations + mem << one << zero << zero << one << zero << zero; + + mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const BYTE*) mem.GetData(), mem.GetEndOfData() ) ); +} + +void WinMtfOutput::PassEMFPlus( void* pBuffer, UINT32 nLength ) +{ + EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS comment length %d\n", nLength)); + mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast(pBuffer), nLength ) ); +} diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx index fb4fd2fe0c57..aa630d6ebfa4 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.hxx +++ b/svtools/source/filter.vcl/wmf/winmtf.hxx @@ -672,6 +672,9 @@ class WinMtfOutput void UpdateClipRegion(); void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ); + void PassEMFPlus( void* pBuffer, UINT32 nLength ); + void PassEMFPlusHeaderInfo(); + WinMtfOutput( GDIMetaFile& rGDIMetaFile ); virtual ~WinMtfOutput(); }; @@ -710,6 +713,8 @@ class EnhWMFReader : public WinMtf { sal_Bool bRecordPath; sal_Int32 nRecordCount; + BOOL bEMFPlus; + BOOL ReadHeader(); Rectangle ReadRectangle( INT32, INT32, INT32, INT32 ); // Liesst und konvertiert ein Rechteck @@ -717,10 +722,12 @@ class EnhWMFReader : public WinMtf public: EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL ) - : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ) {}; + : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus (FALSE) {}; ~EnhWMFReader(); BOOL ReadEnhWMF(); + void ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC); + void ReadGDIComment(); }; //============================ WMFReader ================================== -- cgit From acd8f4caef83c5daf8bea61ace7e5024d192b413 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:19:07 +0200 Subject: emf+-crash-fix.diff: emf+ import - fix crash n#361534 --- cppcanvas/source/mtfrenderer/emfplus.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 46f643f2345a..699c2d4cb8d2 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -810,6 +810,10 @@ namespace cppcanvas EMFPBrush* brush = (EMFPBrush*) aObjects [brushIndexOrColor]; EMFP_DEBUG (printf ("EMF+\tbrush fill slot: %d (type: %d)\n", brushIndexOrColor, brush->GetType ())); + // give up in case something wrong happened + if( !brush ) + return; + rState.isFillColorSet = false; rState.isLineColorSet = false; @@ -1019,7 +1023,8 @@ namespace cppcanvas aObjects [index] = NULL; } - switch (flags & 0xff00) { + // not sure yet, what 0x8000 means + switch (flags & 0x7f00) { case EmfPlusObjectTypeBrush: { EMFPBrush *brush; -- cgit From 0f0e1c12029ade01ff1780a5f5f93bf75e16eb3a Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:27:19 +0200 Subject: vcl-grey-alpha-unix-sal-bitmap.diff: emf+ import support 8bit alph bitmaps vcl(unx) --- vcl/unx/inc/salbmp.h | 4 +++- vcl/unx/source/gdi/salbmp.cxx | 45 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h index 2d02c7d6b9b4..925d7d135a2d 100644 --- a/vcl/unx/inc/salbmp.h +++ b/vcl/unx/inc/salbmp.h @@ -57,7 +57,8 @@ private: int nScreen, long nDrawableDepth, long nX, long nY, - long nWidth, long nHeight ); + long nWidth, long nHeight, + bool bGrey ); public: @@ -78,6 +79,7 @@ private: BitmapBuffer* mpDIB; ImplSalDDB* mpDDB; + bool mbGrey; public: diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index 3f8e8de564be..a23a49a24838 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -71,7 +71,8 @@ ULONG X11SalBitmap::mnCacheInstCount = 0; X11SalBitmap::X11SalBitmap() : mpDIB( NULL ), - mpDDB( NULL ) + mpDDB( NULL ), + mbGrey( false ) { } @@ -191,7 +192,8 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, int nScreen, long nDrawableDepth, long nX, long nY, - long nWidth, long nHeight ) + long nWidth, long nHeight, + bool bGrey ) { BitmapBuffer* pDIB = NULL; @@ -302,6 +304,21 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, rPal[ 0 ] = Color( COL_BLACK ); rPal[ 1 ] = Color( COL_WHITE ); } + else if( pImage->depth == 8 && bGrey ) + { + rPal.SetEntryCount( 256 ); + pDstPal = &rPal; + + for( USHORT i = 0; i < 256; i++ ) + { + BitmapColor& rBmpCol = rPal[ i ]; + + rBmpCol.SetRed( i ); + rBmpCol.SetGreen( i ); + rBmpCol.SetBlue( i ); + } + + } else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); @@ -345,7 +362,8 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long mpDDB->ImplGetDepth(), 0, 0, mpDDB->ImplGetWidth(), - mpDDB->ImplGetHeight() ); + mpDDB->ImplGetHeight(), + mbGrey ); } if( mpDIB && mpDIB->mnWidth && mpDIB->mnHeight ) @@ -428,6 +446,20 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long (*pPal)[ 0 ] = Color( COL_BLACK ); (*pPal)[ 1 ] = Color( COL_WHITE ); } + else if( pImage->depth == 8 && mbGrey ) + { + pPal = new BitmapPalette( 256 ); + + for( USHORT i = 0; i < 256; i++ ) + { + BitmapColor& rBmpCol = (*pPal)[ i ]; + + rBmpCol.SetRed( i ); + rBmpCol.SetGreen( i ); + rBmpCol.SetBlue( i ); + } + + } else if( pImage->depth <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); @@ -592,7 +624,8 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable, mpDDB->ImplGetDepth(), 0, 0, mpDDB->ImplGetWidth(), - mpDDB->ImplGetHeight() ); + mpDDB->ImplGetHeight(), + mbGrey ); } delete mpDDB, const_cast(this)->mpDDB = NULL; @@ -755,6 +788,8 @@ bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::s if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) { if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) { + + mbGrey = bMask; bool bSuccess = ImplCreateFromDrawable( pixmapHandle, 0, depth, 0, 0, (long) rSize.Width(), (long) rSize.Height() ); bool bFreePixmap; if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap ) @@ -824,7 +859,7 @@ BitmapBuffer* X11SalBitmap::AcquireBuffer( bool ) mpDIB = ImplCreateDIB( mpDDB->ImplGetPixmap(), mpDDB->ImplGetScreen(), mpDDB->ImplGetDepth(), - 0, 0, mpDDB->ImplGetWidth(), mpDDB->ImplGetHeight() ); + 0, 0, mpDDB->ImplGetWidth(), mpDDB->ImplGetHeight(), mbGrey ); } return mpDIB; -- cgit From a529db20d67dd8ac6979865a86f814b62661f0fc Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:29:57 +0200 Subject: emf+-multipart-objects.diff: emf+ import - support multipart objects --- cppcanvas/source/inc/implrenderer.hxx | 5 + cppcanvas/source/mtfrenderer/emfplus.cxx | 157 +++++++++++++++----------- cppcanvas/source/mtfrenderer/implrenderer.cxx | 1 + 3 files changed, 96 insertions(+), 67 deletions(-) diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx index b550fca2ebbd..abae942eaa15 100644 --- a/cppcanvas/source/inc/implrenderer.hxx +++ b/cppcanvas/source/inc/implrenderer.hxx @@ -267,6 +267,7 @@ static float GetSwapFloat( SvStream& rSt ) ActionVector::const_iterator& o_rRangeBegin, ActionVector::const_iterator& o_rRangeEnd ) const; + void processObjectRecord(SvMemoryStream& rObjectStream, UINT16 flags); void processEMFPlus( MetaCommentAction* pAct, const ActionFactoryParameters& rFactoryParms, OutDevState& rState, const CanvasSharedPtr& rCanvas ); void EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, bool isColor, sal_uInt32 brushIndexOrColor); @@ -291,6 +292,10 @@ static float GetSwapFloat( SvStream& rSt ) sal_Int32 nPixY; sal_Int32 nMmX; sal_Int32 nMmY; + /* multipart object data */ + bool mbMultipart; + UINT16 mMFlags; + SvMemoryStream mMStream; }; diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 699c2d4cb8d2..8d22704ee23f 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -663,6 +663,8 @@ namespace cppcanvas { sal_uInt32 header, unknown; + EMFP_DEBUG (dumpWords(s, 16)); + s >> header >> type; EMFP_DEBUG (printf ("EMF+\timage\nEMF+\theader: 0x%08x type: 0x%08x\n", header, type)); @@ -974,6 +976,72 @@ namespace cppcanvas } } + void ImplRenderer::processObjectRecord(SvMemoryStream& rObjectStream, UINT16 flags) + { + UINT32 objectLen; + sal_uInt32 index; + + EMFP_DEBUG (printf ("EMF+ Object slot: %hd flags: %hx\n", flags & 0xff, flags & 0xff00)); + + index = flags & 0xff; + if (aObjects [index] != NULL) { + delete aObjects [index]; + aObjects [index] = NULL; + } + + switch (flags & 0x7f00) { + case EmfPlusObjectTypeBrush: + { + EMFPBrush *brush; + aObjects [index] = brush = new EMFPBrush (); + brush->Read (rObjectStream, *this); + + break; + } + case EmfPlusObjectTypePen: + { + EMFPPen *pen; + aObjects [index] = pen = new EMFPPen (); + pen->Read (rObjectStream, *this, nHDPI, nVDPI); + + break; + } + case EmfPlusObjectTypePath: + sal_uInt32 header, pathFlags; + sal_Int32 points; + + rObjectStream >> header >> points >> pathFlags; + + EMFP_DEBUG (printf ("EMF+\tpath\n")); + EMFP_DEBUG (printf ("EMF+\theader: 0x%08x points: %d additional flags: 0x%08x\n", header, points, pathFlags)); + + EMFPPath *path; + aObjects [index] = path = new EMFPPath (points); + path->Read (rObjectStream, pathFlags, *this); + + break; + case EmfPlusObjectTypeRegion: { + EMFPRegion *region; + + aObjects [index] = region = new EMFPRegion (); + region->Read (rObjectStream); + + break; + } + case EmfPlusObjectTypeImage: + { + EMFPImage *image; + aObjects [index] = image = new EMFPImage (); + image->Read (rObjectStream); + + break; + } + default: + EMFP_DEBUG (printf ("EMF+\tObject unhandled flags: 0x%04x\n", flags & 0xff00)); + break; + } + } + void ImplRenderer::processEMFPlus( MetaCommentAction* pAct, const ActionFactoryParameters& rFactoryParms, OutDevState& rState, const CanvasSharedPtr& rCanvas ) { @@ -993,6 +1061,26 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+ record size: %d type: %04hx flags: %04hx data size: %d\n", size, type, flags, dataSize)); + if (type == EmfPlusRecordTypeObject && (mbMultipart && flags & 0x7fff == mMFlags & 0x7fff || flags & 0x8000)) { + if (!mbMultipart) { + mbMultipart = true; + mMFlags = flags; + mMStream.Seek(0); + } + EMFP_DEBUG (dumpWords(rMF, 16)); + // 1st 4 bytes are unknown + mMStream.Write (((const char *)rMF.GetData()) + rMF.Tell() + 4, dataSize - 4); + EMFP_DEBUG (printf ("EMF+ read next object part size: %d type: %04hx flags: %04hx data size: %d\n", size, type, flags, dataSize)); + } else { + if (mbMultipart) { + EMFP_DEBUG (printf ("EMF+ multipart record flags: %04hx\n", mMFlags)); + mMStream.Seek (0); + processObjectRecord (mMStream, mMFlags); + } + mbMultipart = false; + } + + if (type != EmfPlusRecordTypeObject || !(flags & 0x8000)) switch (type) { case EmfPlusRecordTypeHeader: UINT32 header, version; @@ -1011,73 +1099,8 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+\talready used in svtools wmf/emf filter parser\n")); break; case EmfPlusRecordTypeObject: - { - UINT32 objectLen; - sal_uInt32 index; - - EMFP_DEBUG (printf ("EMF+ Object slot: %hd flags: %hx\n", flags & 0xff, flags & 0xff00)); - - index = flags & 0xff; - if (aObjects [index] != NULL) { - delete aObjects [index]; - aObjects [index] = NULL; - } - - // not sure yet, what 0x8000 means - switch (flags & 0x7f00) { - case EmfPlusObjectTypeBrush: - { - EMFPBrush *brush; - aObjects [index] = brush = new EMFPBrush (); - brush->Read (rMF, *this); - - break; - } - case EmfPlusObjectTypePen: - { - EMFPPen *pen; - aObjects [index] = pen = new EMFPPen (); - pen->Read (rMF, *this, nHDPI, nVDPI); - - break; - } - case EmfPlusObjectTypePath: - sal_uInt32 header, pathFlags; - sal_Int32 points; - - rMF >> header >> points >> pathFlags; - - EMFP_DEBUG (printf ("EMF+\tpath\n")); - EMFP_DEBUG (printf ("EMF+\theader: 0x%08x points: %d additional flags: 0x%08x\n", header, points, pathFlags)); - - EMFPPath *path; - aObjects [index] = path = new EMFPPath (points); - path->Read (rMF, pathFlags, *this); - - break; - case EmfPlusObjectTypeRegion: { - EMFPRegion *region; - - aObjects [index] = region = new EMFPRegion (); - region->Read (rMF); - - break; - } - case EmfPlusObjectTypeImage: - { - EMFPImage *image; - aObjects [index] = image = new EMFPImage (); - image->Read (rMF); - - break; - } - default: - EMFP_DEBUG (printf ("EMF+\tObject unhandled flags: 0x%04x\n", flags & 0xff00)); - break; - } - - break; - } + processObjectRecord (rMF, flags); + break; case EmfPlusRecordTypeFillPath: { sal_uInt32 index = flags & 0xff; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index b83cbacdcd29..080c7d39740b 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -3007,6 +3007,7 @@ namespace cppcanvas /* EMF+ */ memset (aObjects, 0, sizeof (aObjects)); + mbMultipart = false; createActions( const_cast(rMtf), // HACK(Q2): // we're -- cgit From f59b7f548242b6079b9af303cc74b672d94e74db Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:31:43 +0200 Subject: emf+-use-canvas-only-for-emf+.diff: emf+ import - use canvas rendering only for emf+ --- svtools/source/filter.vcl/wmf/winmtf.cxx | 1 + vcl/inc/vcl/gdimtf.hxx | 3 +++ vcl/source/gdi/gdimtf.cxx | 14 +++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index 4579c5bda9f6..eba616f2fea4 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -2230,6 +2230,7 @@ void WinMtfOutput::PassEMFPlusHeaderInfo() mem << one << zero << zero << one << zero << zero; mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const BYTE*) mem.GetData(), mem.GetEndOfData() ) ); + mpGDIMetaFile->UseCanvas( TRUE ); } void WinMtfOutput::PassEMFPlus( void* pBuffer, UINT32 nLength ) diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index 5660bb139f3b..e1eb25d4b46a 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -107,6 +107,7 @@ private: ImpLabelList* pLabelList; BOOL bPause; BOOL bRecord; + BOOL bUseCanvas; //#if 0 // _SOLAR__PRIVATE @@ -246,6 +247,8 @@ public: friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const GDIMetaFile& rGDIMetaFile ); BOOL CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const; + + void UseCanvas( BOOL _bUseCanvas ); }; #endif // _SV_GDIMTF_HXX diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 8f0f7abfdf19..b811fbc18a3a 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -212,7 +212,8 @@ GDIMetaFile::GDIMetaFile() : pOutDev ( NULL ), pLabelList ( NULL ), bPause ( FALSE ), - bRecord ( FALSE ) + bRecord ( FALSE ), + bUseCanvas ( FALSE ) { } @@ -227,7 +228,8 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) : pNext ( rMtf.pNext ), pOutDev ( NULL ), bPause ( FALSE ), - bRecord ( FALSE ) + bRecord ( FALSE ), + bUseCanvas ( rMtf.bUseCanvas ) { // RefCount der MetaActions erhoehen for( void* pAct = First(); pAct; pAct = Next() ) @@ -281,6 +283,7 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf ) pOutDev = NULL; bPause = FALSE; bRecord = FALSE; + bUseCanvas = rMtf.bUseCanvas; if( rMtf.bRecord ) { @@ -568,7 +571,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, { GDIMetaFile* pMtf = pOut->GetConnectMetaFile(); - if( !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) ) + if( bUseCanvas && !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) ) return; Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) ); @@ -3117,3 +3120,8 @@ BOOL GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent, return !rBmpEx.IsEmpty(); } + +void GDIMetaFile::UseCanvas( BOOL _bUseCanvas ) +{ + bUseCanvas = _bUseCanvas; +} -- cgit From 590282f4f078142495858a8cb6385316da0a4a8f Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:34:17 +0200 Subject: emf+-embedded-mf-image.diff: emf+ import - support for embedded MF images --- cppcanvas/source/mtfrenderer/emfplus.cxx | 24 ++++++++++++++++++++---- cppcanvas/source/mtfrenderer/implrenderer.cxx | 1 + 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 8d22704ee23f..a82aad0b9c3f 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -659,12 +659,10 @@ namespace cppcanvas Graphic graphic; - void Read (SvStream &s) + void Read (SvMemoryStream &s) { sal_uInt32 header, unknown; - EMFP_DEBUG (dumpWords(s, 16)); - s >> header >> type; EMFP_DEBUG (printf ("EMF+\timage\nEMF+\theader: 0x%08x type: 0x%08x\n", header, type)); @@ -679,6 +677,24 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+\tbitmap width: %d height: %d\n", graphic.GetBitmap ().GetSizePixel ().Width (), graphic.GetBitmap ().GetSizePixel ().Height ())); } + } else if (type == 2) { + sal_Int32 mfType, mfSize; + + s >> mfType >> mfSize; + EMFP_DEBUG (printf ("EMF+\tmetafile type: %d dataSize: %d\n", mfType, mfSize)); + + GraphicFilter filter; + SvMemoryStream mfStream (((char *)s.GetData()) + s.Tell(), mfSize, STREAM_READ); + + filter.ImportGraphic (graphic, String (), mfStream); + + // debug code - write the stream to debug file /tmp/emf-stream.emf + EMFP_DEBUG(mfStream.Seek(0); + SvFileStream file( UniString::CreateFromAscii( "/tmp/emf-embedded-stream.emf" ), STREAM_WRITE | STREAM_TRUNC ); + + mfStream >> file; + file.Flush(); + file.Close()); } } }; @@ -1067,7 +1083,7 @@ namespace cppcanvas mMFlags = flags; mMStream.Seek(0); } - EMFP_DEBUG (dumpWords(rMF, 16)); + // 1st 4 bytes are unknown mMStream.Write (((const char *)rMF.GetData()) + rMF.Tell() + 4, dataSize - 4); EMFP_DEBUG (printf ("EMF+ read next object part size: %d type: %04hx flags: %04hx data size: %d\n", size, type, flags, dataSize)); diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 080c7d39740b..af1f20904560 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -1818,6 +1818,7 @@ namespace cppcanvas char *env; if (env = getenv ("EMF_PLUS_LIMIT")) { limit = atoi (env); + EMFP_DEBUG (printf ("EMF+ records limit: %d\n", limit)); } } EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer, size: %d\n", pAct->GetDataSize ())); -- cgit From dbdacbcbeaa376c19a6337504195d4aed19343a3 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Wed, 15 Sep 2010 11:40:21 +0200 Subject: vcl-pluggable-mtf-renderer.diff: emf+ import - pluggable renderer Added a way to delegate mtf action rendering to external services. plan to add a librsvg-based SVG renderer this way. Limit exposure to arbitrary binary data to zero existing services, some cleanup. --- vcl/inc/vcl/gdimtf.hxx | 26 ++++++++++ vcl/source/gdi/gdimtf.cxx | 129 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 154 insertions(+), 1 deletion(-) diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index e1eb25d4b46a..0591c8f572ff 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -38,6 +38,7 @@ class OutputDevice; class ImpLabelList; class MetaAction; +class MetaCommentAction; class SvStream; class Color; class BitmapEx; @@ -137,6 +138,7 @@ private: const PolyPolygon& rPolyPoly, const Gradient& rGrad ); SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize ); + SAL_DLLPRIVATE void ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut ); //#endif // __PRIVATE @@ -251,5 +253,29 @@ public: void UseCanvas( BOOL _bUseCanvas ); }; +/** Create a special metaaction that delegates rendering to specified + service. + + This factory function creates a MetaCommentAction that delegates + rendering to the specified services, once played back in the + metafile. + + @param rRendererServiceName + Renderer service. Gets an awt::XGraphic on instantiation + + @param rGraphicServiceName + Graphic service. Gets the raw data on instantiation + + @param pData + Raw data. Gets copied + + @param nDataSize + Length, in byte, of raw data + */ +MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererServiceName, + const rtl::OUString& rGraphicServiceName, + const void* pData, + sal_uInt32 nDataSize ); + #endif // _SV_GDIMTF_HXX diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index b811fbc18a3a..c1695f6bf7bd 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -51,6 +51,10 @@ #include #include #include +#include +#include +#include +#include using namespace com::sun::star; @@ -474,7 +478,16 @@ void GDIMetaFile::Play( OutputDevice* pOut, ULONG nPos ) { if( !Hook() ) { - pAction->Execute( pOut ); + MetaCommentAction* pCommentAct = static_cast(pAction); + if( pAction->GetType() == META_COMMENT_ACTION && + pCommentAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") ) + { + ImplDelegate2PluggableRenderer(pCommentAct, pOut); + } + else + { + pAction->Execute( pOut ); + } // flush output from time to time if( i++ > nSyncCount ) @@ -560,6 +573,77 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S // ------------------------------------------------------------------------ +void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut ) +{ + OSL_ASSERT( pAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") ); + + // read payload - string of service name, followed by raw render input + const BYTE* pData = pAct->GetData(); + const BYTE* const pEndData = pData + pAct->GetDataSize(); + if( !pData ) + return; + + ::rtl::OUStringBuffer aBuffer; + while( pData(*pData++)); + const ::rtl::OUString aRendererServiceName=aBuffer.makeStringAndClear(); + ++pData; + + while( pData(*pData++)); + const ::rtl::OUString aGraphicServiceName=aBuffer.makeStringAndClear(); + ++pData; + + uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); + if( pData aRendererArgs(1); + aRendererArgs[0] = makeAny(uno::Reference(pOut->CreateUnoGraphics())); + uno::Reference xRenderer( + xFactory->createInstanceWithArguments( + aRendererServiceName, + aRendererArgs), + uno::UNO_QUERY ); + + // instantiate graphic service + uno::Reference xGraphic( + xFactory->createInstance( + aGraphicServiceName), + uno::UNO_QUERY ); + + uno::Reference xInit( + xGraphic, uno::UNO_QUERY); + + if(xGraphic.is() && xRenderer.is() && xInit.is()) + { + // delay intialization of XGraphic, to only expose + // XGraphic-generating services to arbitrary binary data + uno::Sequence< sal_Int8 > aSeq( + (sal_Int8*)&pData, pEndData-pData ); + uno::Sequence aGraphicsArgs(1); + aGraphicsArgs[0] = makeAny(aSeq); + xInit->initialize(aGraphicsArgs); + + xRenderer->render(xGraphic); + } + } + catch( uno::RuntimeException& ) + { + // runtime errors are fatal + throw; + } + catch( uno::Exception& ) + { + // ignore errors, no way of reporting them here + } + } +} + +// ------------------------------------------------------------------------ + void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, const Size& rSize, ULONG nPos ) { @@ -3125,3 +3209,46 @@ void GDIMetaFile::UseCanvas( BOOL _bUseCanvas ) { bUseCanvas = _bUseCanvas; } + +// ------------------------------------------------------------------------ + +MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererServiceName, + const rtl::OUString& rGraphicServiceName, + const void* _pData, + sal_uInt32 nDataSize ) +{ + const BYTE* pData=(BYTE*)_pData; + + // data gets copied twice, unfortunately + rtl::OString aRendererServiceName( + rRendererServiceName.getStr(), + rRendererServiceName.getLength(), + RTL_TEXTENCODING_ASCII_US); + rtl::OString aGraphicServiceName( + rGraphicServiceName.getStr(), + rGraphicServiceName.getLength(), + RTL_TEXTENCODING_ASCII_US); + + std::vector aMem( + aRendererServiceName.getLength()+ + aGraphicServiceName.getLength()+2+nDataSize); + sal_uInt8* pMem=&aMem[0]; + + std::copy(aRendererServiceName.getStr(), + aRendererServiceName.getStr()+aRendererServiceName.getLength()+1, + pMem); + pMem+=aRendererServiceName.getLength()+1; + std::copy(aGraphicServiceName.getStr(), + aGraphicServiceName.getStr()+aGraphicServiceName.getLength()+1, + pMem); + pMem+=aGraphicServiceName.getLength()+1; + + std::copy(pData,pData+nDataSize, + pMem); + + return new MetaCommentAction( + "DELEGATE_PLUGGABLE_RENDERER", + 0, + &aMem[0], + aMem.size()); +} -- cgit From f3b377d331a9666b9e59af7d573d993815b8eabf Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Wed, 15 Sep 2010 11:43:39 +0200 Subject: vcl-pluggable-mtf-renderer.diff: emf+ import - checks for valid input in emf+ renderer, small changes to the patch by Radek (rodo@novell.com) --- cppcanvas/source/mtfrenderer/emfplus.cxx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index a82aad0b9c3f..6a881b53d0d7 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -123,6 +123,8 @@ namespace cppcanvas public: EMFPPath (sal_Int32 _nPoints, bool bLines = false) { + if( _nPoints<0 || _nPoints>SAL_MAX_INT32/(2*sizeof(float)) ) + _nPoints = SAL_MAX_INT32/(2*sizeof(float)); nPoints = _nPoints; pPoints = new float [nPoints*2]; if (!bLines) @@ -265,6 +267,9 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+\theader: 0x%08x parts: %d\n", header, parts)); if (parts) { + if( parts<0 || parts>SAL_MAX_INT32/sizeof(sal_Int32) ) + parts = SAL_MAX_INT32/sizeof(sal_Int32); + combineMode = new sal_Int32 [parts]; for (int i = 0; i < parts; i ++) { @@ -376,6 +381,9 @@ namespace cppcanvas s >> surroundColorsNumber; EMFP_DEBUG (printf ("EMF+\tsurround colors: %d\n", surroundColorsNumber)); + if( surroundColorsNumber<0 || surroundColorsNumber>SAL_MAX_INT32/sizeof(::Color) ) + surroundColorsNumber = SAL_MAX_INT32/sizeof(::Color); + surroundColors = new ::Color [surroundColorsNumber]; for (int i = 0; i < surroundColorsNumber; i++) { s >> color; @@ -425,6 +433,8 @@ namespace cppcanvas if (additionalFlags & 0x08) { s >> blendPoints; EMFP_DEBUG (printf ("EMF+\tuse blend, points: %d\n", blendPoints)); + if( blendPoints<0 || blendPoints>SAL_MAX_INT32/(2*sizeof(float)) ) + blendPoints = SAL_MAX_INT32/(2*sizeof(float)); blendPositions = new float [2*blendPoints]; blendFactors = blendPositions + blendPoints; for (int i=0; i < blendPoints; i ++) { @@ -440,6 +450,10 @@ namespace cppcanvas if (additionalFlags & 0x04) { s >> colorblendPoints; EMFP_DEBUG (printf ("EMF+\tuse color blend, points: %d\n", colorblendPoints)); + if( colorblendPoints<0 || colorblendPoints>SAL_MAX_INT32/sizeof(float) ) + colorblendPoints = SAL_MAX_INT32/sizeof(float); + if( colorblendPoints>SAL_MAX_INT32/sizeof(::Color) ) + colorblendPoints = SAL_MAX_INT32/sizeof(::Color); colorblendPositions = new float [colorblendPoints]; colorblendColors = new ::Color [colorblendPoints]; for (int i=0; i < colorblendPoints; i ++) { @@ -494,6 +508,8 @@ namespace cppcanvas if (additionalFlags & 0x08) { s >> blendPoints; EMFP_DEBUG (printf ("EMF+\tuse blend, points: %d\n", blendPoints)); + if( blendPoints<0 || blendPoints>SAL_MAX_INT32/(2*sizeof(float)) ) + blendPoints = SAL_MAX_INT32/(2*sizeof(float)); blendPositions = new float [2*blendPoints]; blendFactors = blendPositions + blendPoints; for (int i=0; i < blendPoints; i ++) { @@ -509,6 +525,10 @@ namespace cppcanvas if (additionalFlags & 0x04) { s >> colorblendPoints; EMFP_DEBUG (printf ("EMF+\tuse color blend, points: %d\n", colorblendPoints)); + if( colorblendPoints<0 || colorblendPoints>SAL_MAX_INT32/sizeof(float) ) + colorblendPoints = SAL_MAX_INT32/sizeof(float); + if( colorblendPoints>SAL_MAX_INT32/sizeof(::Color) ) + colorblendPoints = SAL_MAX_INT32/sizeof(::Color); colorblendPositions = new float [colorblendPoints]; colorblendColors = new ::Color [colorblendPoints]; for (int i=0; i < colorblendPoints; i ++) { @@ -610,6 +630,8 @@ namespace cppcanvas if (penFlags & 256) { s >> dashPatternLen; + if( dashPatternLen<0 || dashPatternLen>SAL_MAX_INT32/sizeof(float) ) + dashPatternLen = SAL_MAX_INT32/sizeof(float); dashPattern = new float [dashPatternLen]; for (i = 0; i < dashPatternLen; i++) s >> dashPattern [i]; @@ -623,6 +645,8 @@ namespace cppcanvas if (penFlags & 1024) { s >> compoundArrayLen; + if( compoundArrayLen<0 || compoundArrayLen>SAL_MAX_INT32/sizeof(float) ) + compoundArrayLen = SAL_MAX_INT32/sizeof(float); compoundArray = new float [compoundArrayLen]; for (i = 0; i < compoundArrayLen; i++) s >> compoundArray [i]; @@ -631,6 +655,8 @@ namespace cppcanvas if (penFlags & 2048) { s >> customStartCapLen; + if( customStartCapLen<0 ) + customStartCapLen=0; customStartCap = new sal_uInt8 [customStartCapLen]; for (i = 0; i < customStartCapLen; i++) s >> customStartCap [i]; @@ -639,6 +665,8 @@ namespace cppcanvas if (penFlags & 4096) { s >> customEndCapLen; + if( customEndCapLen<0 ) + customEndCapLen=0; customEndCap = new sal_uInt8 [customEndCapLen]; for (i = 0; i < customEndCapLen; i++) s >> customEndCap [i]; -- cgit From 2191eefb0ccb75925b37a5dd1e9f7fd1cc0d2837 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:46:38 +0200 Subject: emf+-driver-string.diff: emf+ import - extended string rendering\n\nn#519715 --- cppcanvas/source/mtfrenderer/emfplus.cxx | 153 +++++++++++++++++++++++++++++-- 1 file changed, 143 insertions(+), 10 deletions(-) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 6a881b53d0d7..07f75c591ba4 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include #include @@ -48,6 +50,7 @@ #include #include #include +#include #define EmfPlusRecordTypeHeader 16385 #define EmfPlusRecordTypeEndOfFile 16386 @@ -727,6 +730,39 @@ namespace cppcanvas } }; + struct EMFPFont : public EMFPObject + { + sal_uInt32 version; + float emSize; + sal_uInt32 sizeUnit; + sal_Int32 fontFlags; + rtl::OUString family; + + void Read (SvMemoryStream &s) + { + sal_uInt32 header; + sal_uInt32 reserved; + sal_uInt32 length; + + s >> header >> emSize >> sizeUnit >> fontFlags >> reserved >> length; + + OSL_ASSERT( ( header >> 12 ) == 0xdbc01 ); + + EMFP_DEBUG (printf ("EMF+\tfont\nEMF+\theader: 0x%08x version: 0x%08x size: %f unit: 0x%08x\n", header >> 12, header & 0x1fff, emSize, sizeUnit)); + EMFP_DEBUG (printf ("EMF+\tflags: 0x%08x reserved: 0x%08x length: 0x%08x\n", fontFlags, reserved, length)); + + if( length > 0 && length < 0x4000 ) { + sal_Unicode *chars = (sal_Unicode *) alloca( sizeof( sal_Unicode ) * length ); + + for( int i = 0; i < length; i++ ) + s >> chars[ i ]; + + family = ::rtl::OUString( chars, length ); + EMFP_DEBUG (printf ("EMF+\tfamily: %s\n", rtl::OUStringToOString( family, RTL_TEXTENCODING_UTF8).getStr())); + } + } + }; + void ImplRenderer::ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, sal_uInt32 flags) { if (flags & 0x4000) { @@ -823,10 +859,22 @@ namespace cppcanvas return ::basegfx::B2DRange (x, y, x + w, y + h); } +#define COLOR(x) \ + ::vcl::unotools::colorToDoubleSequence( ::Color (0xff - (x >> 24), \ + (x >> 16) & 0xff, \ + (x >> 8) & 0xff, \ + x & 0xff), \ + rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace()); +#define SET_FILL_COLOR(x) \ + rState.fillColor = COLOR(x); +#define SET_LINE_COLOR(x) \ + rState.lineColor = COLOR(x); +#define SET_TEXT_COLOR(x) \ + rState.textColor = COLOR(x); + void ImplRenderer::EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, bool isColor, sal_uInt32 brushIndexOrColor) { - sal_uInt8 transparency; ::basegfx::B2DPolyPolygon localPolygon (polygon); EMFP_DEBUG (printf ("EMF+\tfill polygon\n")); @@ -838,15 +886,9 @@ namespace cppcanvas if (isColor) { EMFP_DEBUG (printf ("EMF+\t\tcolor fill\n")); - transparency = 0xff - (brushIndexOrColor >> 24); - rState.isFillColorSet = true; rState.isLineColorSet = false; - rState.fillColor = ::vcl::unotools::colorToDoubleSequence( ::Color (transparency, - (brushIndexOrColor >> 16) & 0xff, - (brushIndexOrColor >> 8) & 0xff, - brushIndexOrColor & 0xff), - rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace()); + SET_FILL_COLOR(brushIndexOrColor); pPolyAction = ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, rParms.mrCanvas, rState ) ); @@ -1078,6 +1120,14 @@ namespace cppcanvas aObjects [index] = image = new EMFPImage (); image->Read (rObjectStream); + break; + } + case EmfPlusObjectTypeFont: + { + EMFPFont *font; + aObjects [index] = font = new EMFPFont (); + font->Read (rObjectStream); + break; } default: @@ -1438,10 +1488,93 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+\tTODO\n")); break; } - case EmfPlusRecordTypeDrawDriverString: + case EmfPlusRecordTypeDrawDriverString: { EMFP_DEBUG (printf ("EMF+ DrawDriverString, flags: 0x%04x\n", flags)); - EMFP_DEBUG (printf ("EMF+\tTODO\n")); + sal_uInt32 brushIndexOrColor; + sal_uInt32 optionFlags; + sal_uInt32 hasMatrix; + sal_uInt32 glyphsCount; + + rMF >> brushIndexOrColor >> optionFlags >> hasMatrix >> glyphsCount; + + EMFP_DEBUG (printf ("EMF+\t%s: 0x%08x\n", (flags & 0x8000) ? "color" : "brush index", brushIndexOrColor)); + EMFP_DEBUG (printf ("EMF+\toption flags: 0x%08x\n", optionFlags)); + EMFP_DEBUG (printf ("EMF+\thas matrix: %d\n", hasMatrix)); + EMFP_DEBUG (printf ("EMF+\tglyphs: %d\n", glyphsCount)); + + if( ( optionFlags & 1 ) && glyphsCount > 0 ) { + sal_uInt16 *chars = new sal_uInt16[glyphsCount]; + float *charsPosX = new float[glyphsCount]; + float *charsPosY = new float[glyphsCount]; + + for( int i=0; i> chars[i]; + EMFP_DEBUG (printf ("EMF+\tglyph[%d]: 0x%04x\n", + i, chars[i])); + } + for( int i=0; i> charsPosX[i] >> charsPosY[i]; + EMFP_DEBUG (printf ("EMF+\tglyphPosition[%d]: %f, %f\n", i, charsPosX[i], charsPosY[i])); + } + + XForm transform; + if( hasMatrix ) { + rMF >> transform; + EMFP_DEBUG (printf ("EMF+\tmatrix:: %f, %f, %f, %f, %f, %f\n", transform.eM11, transform.eM12, transform.eM21, transform.eM22, transform.eDx, transform.eDy)); + } + + // create and add the text action + XubString text( chars, glyphsCount ); + + EMFPFont *font = (EMFPFont*) aObjects[ flags & 0xff ]; + + rendering::FontRequest aFontRequest; + aFontRequest.FontDescription.FamilyName = font->family; + aFontRequest.CellSize = (rState.mapModeTransform*MapSize( font->emSize, 0 )).getX(); + rState.xFont = rFactoryParms.mrCanvas->getUNOCanvas()->createFont( aFontRequest, + uno::Sequence< beans::PropertyValue >(), + geometry::Matrix2D() ); + if( flags & 0x8000 ) + SET_TEXT_COLOR(brushIndexOrColor); + + ActionSharedPtr pTextAction( + TextActionFactory::createTextAction( + ::vcl::unotools::pointFromB2DPoint ( Map( charsPosX[0], charsPosY[0] ) ), + ::Size(), + ::Color(), + ::Size(), + ::Color(), + text, + 0, + glyphsCount, + NULL, + rFactoryParms.mrVDev, + rFactoryParms.mrCanvas, + rState, + rFactoryParms.mrParms, + false ) ); + + if( pTextAction ) + { + EMFP_DEBUG (printf ("EMF+\t\tadd text action\n")); + + maActions.push_back( + MtfAction( + pTextAction, + rFactoryParms.mrCurrActionIndex ) ); + + rFactoryParms.mrCurrActionIndex += pTextAction->getActionCount()-1; + } + + delete[] chars; + delete[] charsPosX; + delete[] charsPosY; + } else { + EMFP_DEBUG (printf ("EMF+\tTODO: fonts (non-unicode glyphs chars)\n")); + } + break; + } default: EMFP_DEBUG (printf ("EMF+ unhandled record type: %d\n", type)); EMFP_DEBUG (printf ("EMF+\tTODO\n")); -- cgit From 5edd416e833b294958dca3f7f053636705b3c5d9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:49:33 +0200 Subject: emf+-canvas-vcl-clear.diff: emf+ import - fix vcl canvas clearing of empty canvas --- canvas/source/vcl/canvashelper.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index a83b260d52d5..30cb5761066d 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -156,8 +156,8 @@ namespace vclcanvas tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); rOutDev.EnableMapMode( FALSE ); - rOutDev.SetLineColor( COL_WHITE ); - rOutDev.SetFillColor( COL_WHITE ); + rOutDev.SetLineColor( COL_TRANSPARENT ); + rOutDev.SetFillColor( COL_TRANSPARENT ); rOutDev.DrawRect( Rectangle( Point(), rOutDev.GetOutputSizePixel()) ); @@ -167,8 +167,8 @@ namespace vclcanvas rOutDev2.SetDrawMode( DRAWMODE_DEFAULT ); rOutDev2.EnableMapMode( FALSE ); - rOutDev2.SetLineColor( COL_WHITE ); - rOutDev2.SetFillColor( COL_WHITE ); + rOutDev2.SetLineColor( COL_TRANSPARENT ); + rOutDev2.SetFillColor( COL_TRANSPARENT ); rOutDev2.DrawRect( Rectangle( Point(), rOutDev2.GetOutputSizePixel()) ); rOutDev2.SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT | -- cgit From 4386aa5455376e366ae012d69bff816dafaf4b08 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:53:32 +0200 Subject: emf+-cppcanvas-replace-poly-factory-and-clean.diff: emf+ import - replace deprecated polygon factory and clean the code a bit --- cppcanvas/source/mtfrenderer/emfplus.cxx | 131 ++++++++++++++++++------------- 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 07f75c591ba4..40d208bf1990 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,6 @@ #include #include -#include #include #include @@ -126,7 +126,7 @@ namespace cppcanvas public: EMFPPath (sal_Int32 _nPoints, bool bLines = false) { - if( _nPoints<0 || _nPoints>SAL_MAX_INT32/(2*sizeof(float)) ) + if( _nPoints<0 || sal_uInt32(_nPoints)>SAL_MAX_INT32/(2*sizeof(float)) ) _nPoints = SAL_MAX_INT32/(2*sizeof(float)); nPoints = _nPoints; pPoints = new float [nPoints*2]; @@ -163,8 +163,6 @@ namespace cppcanvas if (pPointTypes) for (int i = 0; i < nPoints; i ++) { - UINT8 pathType; - s >> pPointTypes [i]; EMFP_DEBUG (printf ("EMF+\tpoint type: %x\n", pPointTypes [i])); } @@ -179,7 +177,6 @@ namespace cppcanvas ::basegfx::B2DPolyPolygon& GetPolygon (ImplRenderer& rR, bool bMapIt = true) { ::basegfx::B2DPolygon polygon; - sal_Int32 points = nPoints; aPolygon.clear (); @@ -270,7 +267,7 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+\theader: 0x%08x parts: %d\n", header, parts)); if (parts) { - if( parts<0 || parts>SAL_MAX_INT32/sizeof(sal_Int32) ) + if( parts<0 || sal_uInt32(parts)>SAL_MAX_INT32/sizeof(sal_Int32) ) parts = SAL_MAX_INT32/sizeof(sal_Int32); combineMode = new sal_Int32 [parts]; @@ -384,7 +381,7 @@ namespace cppcanvas s >> surroundColorsNumber; EMFP_DEBUG (printf ("EMF+\tsurround colors: %d\n", surroundColorsNumber)); - if( surroundColorsNumber<0 || surroundColorsNumber>SAL_MAX_INT32/sizeof(::Color) ) + if( surroundColorsNumber<0 || sal_uInt32(surroundColorsNumber)>SAL_MAX_INT32/sizeof(::Color) ) surroundColorsNumber = SAL_MAX_INT32/sizeof(::Color); surroundColors = new ::Color [surroundColorsNumber]; @@ -436,7 +433,7 @@ namespace cppcanvas if (additionalFlags & 0x08) { s >> blendPoints; EMFP_DEBUG (printf ("EMF+\tuse blend, points: %d\n", blendPoints)); - if( blendPoints<0 || blendPoints>SAL_MAX_INT32/(2*sizeof(float)) ) + if( blendPoints<0 || sal_uInt32(blendPoints)>SAL_MAX_INT32/(2*sizeof(float)) ) blendPoints = SAL_MAX_INT32/(2*sizeof(float)); blendPositions = new float [2*blendPoints]; blendFactors = blendPositions + blendPoints; @@ -453,9 +450,9 @@ namespace cppcanvas if (additionalFlags & 0x04) { s >> colorblendPoints; EMFP_DEBUG (printf ("EMF+\tuse color blend, points: %d\n", colorblendPoints)); - if( colorblendPoints<0 || colorblendPoints>SAL_MAX_INT32/sizeof(float) ) + if( colorblendPoints<0 || sal_uInt32(colorblendPoints)>SAL_MAX_INT32/sizeof(float) ) colorblendPoints = SAL_MAX_INT32/sizeof(float); - if( colorblendPoints>SAL_MAX_INT32/sizeof(::Color) ) + if( sal_uInt32(colorblendPoints)>SAL_MAX_INT32/sizeof(::Color) ) colorblendPoints = SAL_MAX_INT32/sizeof(::Color); colorblendPositions = new float [colorblendPoints]; colorblendColors = new ::Color [colorblendPoints]; @@ -469,9 +466,9 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+\tcolor[%d]: 0x%08x\n", i, color)); } } - } else + } else { EMFP_DEBUG (dumpWords (s, 1024)); - + } break; } // linear gradient @@ -511,7 +508,7 @@ namespace cppcanvas if (additionalFlags & 0x08) { s >> blendPoints; EMFP_DEBUG (printf ("EMF+\tuse blend, points: %d\n", blendPoints)); - if( blendPoints<0 || blendPoints>SAL_MAX_INT32/(2*sizeof(float)) ) + if( blendPoints<0 || sal_uInt32(blendPoints)>SAL_MAX_INT32/(2*sizeof(float)) ) blendPoints = SAL_MAX_INT32/(2*sizeof(float)); blendPositions = new float [2*blendPoints]; blendFactors = blendPositions + blendPoints; @@ -528,10 +525,10 @@ namespace cppcanvas if (additionalFlags & 0x04) { s >> colorblendPoints; EMFP_DEBUG (printf ("EMF+\tuse color blend, points: %d\n", colorblendPoints)); - if( colorblendPoints<0 || colorblendPoints>SAL_MAX_INT32/sizeof(float) ) + if( colorblendPoints<0 || sal_uInt32(colorblendPoints)>SAL_MAX_INT32/sizeof(float) ) colorblendPoints = SAL_MAX_INT32/sizeof(float); - if( colorblendPoints>SAL_MAX_INT32/sizeof(::Color) ) - colorblendPoints = SAL_MAX_INT32/sizeof(::Color); + if( sal_uInt32(colorblendPoints)>SAL_MAX_INT32/sizeof(::Color) ) + colorblendPoints = sal_uInt32(SAL_MAX_INT32)/sizeof(::Color); colorblendPositions = new float [colorblendPoints]; colorblendColors = new ::Color [colorblendPoints]; for (int i=0; i < colorblendPoints; i ++) { @@ -584,7 +581,7 @@ namespace cppcanvas rStrokeAttributes.StrokeWidth = (rState.mapModeTransform * rR.MapSize (width, 0)).getX (); } - void Read (SvStream& s, ImplRenderer& rR, sal_Int32 nHDPI, sal_Int32 nVDPI) + void Read (SvStream& s, ImplRenderer& rR, sal_Int32, sal_Int32 ) { UINT32 header, unknown, penFlags, unknown2; int i; @@ -633,7 +630,7 @@ namespace cppcanvas if (penFlags & 256) { s >> dashPatternLen; - if( dashPatternLen<0 || dashPatternLen>SAL_MAX_INT32/sizeof(float) ) + if( dashPatternLen<0 || sal_uInt32(dashPatternLen)>SAL_MAX_INT32/sizeof(float) ) dashPatternLen = SAL_MAX_INT32/sizeof(float); dashPattern = new float [dashPatternLen]; for (i = 0; i < dashPatternLen; i++) @@ -648,7 +645,7 @@ namespace cppcanvas if (penFlags & 1024) { s >> compoundArrayLen; - if( compoundArrayLen<0 || compoundArrayLen>SAL_MAX_INT32/sizeof(float) ) + if( compoundArrayLen<0 || sal_uInt32(compoundArrayLen)>SAL_MAX_INT32/sizeof(float) ) compoundArrayLen = SAL_MAX_INT32/sizeof(float); compoundArray = new float [compoundArrayLen]; for (i = 0; i < compoundArrayLen; i++) @@ -754,7 +751,7 @@ namespace cppcanvas if( length > 0 && length < 0x4000 ) { sal_Unicode *chars = (sal_Unicode *) alloca( sizeof( sal_Unicode ) * length ); - for( int i = 0; i < length; i++ ) + for( sal_uInt32 i = 0; i < length; i++ ) s >> chars[ i ]; family = ::rtl::OUString( chars, length ); @@ -914,10 +911,6 @@ namespace cppcanvas ::basegfx::B2DHomMatrix aWorldTransformation; ::basegfx::B2DHomMatrix aBaseTransformation; rendering::Texture aTexture; - double nRotation( 0.0 ); - const ::basegfx::B2DRectangle aBounds( ::basegfx::tools::getRange( localPolygon ) ); - const double nScale( ::basegfx::pruneScaleValue( fabs( aBounds.getHeight()*sin(nRotation) ) + - fabs( aBounds.getWidth()*cos(nRotation) ))); aWorldTransformation.set (0, 0, aWorldTransform.eM11); aWorldTransformation.set (0, 1, aWorldTransform.eM21); @@ -965,10 +958,9 @@ namespace cppcanvas aTexture.RepeatModeY = rendering::TexturingMode::CLAMP; aTexture.Alpha = 1.0; - uno::Reference< rendering::XParametricPolyPolygon2DFactory > xFactory( - rParms.mrCanvas->getUNOCanvas()->getDevice()->getParametricPolyPolygonFactory() ); + basegfx::ODFGradientInfo aGradInfo; + rtl::OUString aGradientService; - if( xFactory.is() ) { const uno::Sequence< double > aStartColor( ::vcl::unotools::colorToDoubleSequence( brush->solidColor, rParms.mrCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() ) ); @@ -1027,25 +1019,56 @@ namespace cppcanvas } EMFP_DEBUG (printf ("EMF+\t\tset gradient\n")); - if (brush->type == 4) - aTexture.Gradient = xFactory->createLinearHorizontalGradient( aColors, - aStops ); - else { - geometry::RealRectangle2D aBoundsRectangle (0, 0, 1, 1); - aTexture.Gradient = xFactory->createEllipticalGradient( aColors, - aStops, - aBoundsRectangle); + basegfx::B2DRange aBoundsRectangle (0, 0, 1, 1); + if (brush->type == 4) { + aGradientService = rtl::OUString::createFromAscii("LinearGradient"); + basegfx::tools::createLinearODFGradientInfo( aGradInfo, + aBoundsRectangle, + aStops.getLength(), + 0, + 0 ); + + } else { + aGradientService = rtl::OUString::createFromAscii("EllipticalGradient"); + basegfx::tools::createEllipticalODFGradientInfo( aGradInfo, + aBoundsRectangle, + ::basegfx::B2DVector( 0, 0 ), + aStops.getLength(), + 0, + 0 ); } - } - ::basegfx::unotools::affineMatrixFromHomMatrix( aTexture.AffineTransform, - aTextureTransformation ); + uno::Reference< lang::XMultiServiceFactory > xFactory( + rParms.mrCanvas->getUNOCanvas()->getDevice()->getParametricPolyPolygonFactory() ); + + if( xFactory.is() ) { + uno::Sequence args( 3 ); + beans::PropertyValue aProp; + aProp.Name = rtl::OUString::createFromAscii( "Colors" ); + aProp.Value <<= aColors; + args[0] <<= aProp; + aProp.Name = rtl::OUString::createFromAscii( "Stops" ); + aProp.Value <<= aStops; + args[1] <<= aProp; + aProp.Name = rtl::OUString::createFromAscii( "AspectRatio" ); + aProp.Value <<= static_cast(1); + args[2] <<= aProp; + + aTexture.Gradient.set( + xFactory->createInstanceWithArguments( aGradientService, + args ), + uno::UNO_QUERY); + } + + ::basegfx::unotools::affineMatrixFromHomMatrix( aTexture.AffineTransform, + aTextureTransformation ); - pPolyAction = - ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, - rParms.mrCanvas, - rState, - aTexture ) ); + if( aTexture.Gradient.is() ) + pPolyAction = + ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, + rParms.mrCanvas, + rState, + aTexture ) ); } } @@ -1064,7 +1087,7 @@ namespace cppcanvas void ImplRenderer::processObjectRecord(SvMemoryStream& rObjectStream, UINT16 flags) { - UINT32 objectLen; + EMFP_DEBUG (UINT32 objectLen); sal_uInt32 index; EMFP_DEBUG (printf ("EMF+ Object slot: %hd flags: %hx\n", flags & 0xff, flags & 0xff00)); @@ -1155,7 +1178,7 @@ namespace cppcanvas EMFP_DEBUG (printf ("EMF+ record size: %d type: %04hx flags: %04hx data size: %d\n", size, type, flags, dataSize)); - if (type == EmfPlusRecordTypeObject && (mbMultipart && flags & 0x7fff == mMFlags & 0x7fff || flags & 0x8000)) { + if (type == EmfPlusRecordTypeObject && ((mbMultipart && (flags & 0x7fff) == (mMFlags & 0x7fff)) || (flags & 0x8000))) { if (!mbMultipart) { mbMultipart = true; mMFlags = flags; @@ -1254,12 +1277,12 @@ namespace cppcanvas } case EmfPlusRecordTypeFillPolygon: { - sal_uInt8 index = flags & 0xff; + EMFP_DEBUG (sal_uInt8 index = flags & 0xff); sal_uInt32 brushIndexOrColor; - sal_Int32 brushIndex; + EMFP_DEBUG (sal_Int32 brushIndex); sal_Int32 points; - UINT32 color; - USHORT transparency = 0; + EMFP_DEBUG (UINT32 color); + EMFP_DEBUG (USHORT transparency = 0); rMF >> brushIndexOrColor; rMF >> points; @@ -1403,8 +1426,9 @@ namespace cppcanvas rFactoryParms.mrCurrActionIndex += pBmpAction->getActionCount()-1; } - } else + } else { EMFP_DEBUG (printf ("EMF+ DrawImagePoints TODO (fixme)\n")); + } } break; } @@ -1484,8 +1508,9 @@ namespace cppcanvas // reset clip if (region.parts == 0 && region.initialState == EmfPlusRegionInitialStateInfinite) { updateClipping (::basegfx::B2DPolyPolygon (), rFactoryParms, false); - } else + } else { EMFP_DEBUG (printf ("EMF+\tTODO\n")); + } break; } case EmfPlusRecordTypeDrawDriverString: { @@ -1507,12 +1532,12 @@ namespace cppcanvas float *charsPosX = new float[glyphsCount]; float *charsPosY = new float[glyphsCount]; - for( int i=0; i> chars[i]; EMFP_DEBUG (printf ("EMF+\tglyph[%d]: 0x%04x\n", i, chars[i])); } - for( int i=0; i> charsPosX[i] >> charsPosY[i]; EMFP_DEBUG (printf ("EMF+\tglyphPosition[%d]: %f, %f\n", i, charsPosX[i], charsPosY[i])); } -- cgit From e687e92c88498bdd4c64b10625c7663d982dd072 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 12:09:15 +0200 Subject: wmf-pattern-brush.diff: emf+ import - added pattern brushes support to wmf n#232232 --- svtools/source/filter.vcl/wmf/enhwmf.cxx | 57 ++++++++++++++++++++++++++++++-- svtools/source/filter.vcl/wmf/winmtf.cxx | 36 ++++++++++++++++++-- svtools/source/filter.vcl/wmf/winmtf.hxx | 40 +++++++++++++++------- svtools/source/filter.vcl/wmf/winwmf.cxx | 4 +-- 4 files changed, 117 insertions(+), 20 deletions(-) diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx index a11c739022e5..a81fcab66db0 100644 --- a/svtools/source/filter.vcl/wmf/enhwmf.cxx +++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx @@ -1008,7 +1008,10 @@ BOOL EnhWMFReader::ReadEnhWMF() Rectangle aCropRect( Point( xSrc, ySrc ), Size( cxSrc, cySrc ) ); aBitmap.Crop( aCropRect ); } - aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop ), LIST_APPEND ); + /* Pseudocomment to add more context so that make patch.unapply + * works better. Ha! + */ + aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop, pOut->GetFillStyle () ), LIST_APPEND ); } } } @@ -1062,7 +1065,8 @@ BOOL EnhWMFReader::ReadEnhWMF() Rectangle aCropRect( Point( xSrc, ySrc ), Size( cxSrc, cySrc ) ); aBitmap.Crop( aCropRect ); } - aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop ), LIST_APPEND ); + /* Another pseudocomment to make make patch.unapply work better */ + aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop, pOut->GetFillStyle () ), LIST_APPEND ); } } } @@ -1333,6 +1337,54 @@ BOOL EnhWMFReader::ReadEnhWMF() } break; + case EMR_CREATEDIBPATTERNBRUSHPT : + { + static int count = 0; + UINT32 nStart = pWMF->Tell() - 8; + Bitmap aBitmap; + + *pWMF >> nIndex; + + if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) + { + UINT32 usage, offBmi, cbBmi, offBits, cbBits; + + *pWMF >> usage; + *pWMF >> offBmi; + *pWMF >> cbBmi; + *pWMF >> offBits; + *pWMF >> cbBits; + + if ( (cbBits > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBits < cbBmi) ) + bStatus = FALSE; + else if ( offBmi ) + { + UINT32 nSize = cbBmi + cbBits + 14; + if ( nSize <= ( nEndPos - nStartPos ) ) + { + char* pBuf = new char[ nSize ]; + + SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE ); + aTmp.ObjectOwnsMemory( TRUE ); + aTmp << (BYTE)'B' + << (BYTE)'M' + << (UINT32)cbBits + << (UINT16)0 + << (UINT16)0 + << (UINT32)cbBmi + 14; + pWMF->Seek( nStart + offBmi ); + pWMF->Read( pBuf + 14, cbBmi ); + pWMF->Seek( nStart + offBits ); + pWMF->Read( pBuf + 14 + cbBmi, cbBits ); + aTmp.Seek( 0 ); + aBitmap.Read( aTmp, TRUE ); + } + } + } + + pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( aBitmap ) ); + } + break; #ifdef WIN_MTF_ASSERT default : WinMtfAssertHandler( "Unknown Meta Action" ); break; @@ -1352,7 +1404,6 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_ANGLEARC : WinMtfAssertHandler( "AngleArc" ); break; case EMR_SETCOLORADJUSTMENT : WinMtfAssertHandler( "SetColorAdjustment" ); break; case EMR_POLYDRAW16 : WinMtfAssertHandler( "PolyDraw16" ); break; - case EMR_CREATEDIBPATTERNBRUSHPT : WinMtfAssertHandler( "CreateDibPatternBrushPt" ); break; case EMR_POLYTEXTOUTA : WinMtfAssertHandler( "PolyTextOutA" ); break; case EMR_POLYTEXTOUTW : WinMtfAssertHandler( "PolyTextOutW" ); break; case EMR_CREATECOLORSPACE : WinMtfAssertHandler( "CreateColorSpace" ); break; diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index eba616f2fea4..a2619bc967f8 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -31,6 +31,7 @@ #include "winmtf.hxx" #include +#include #include #include @@ -1041,7 +1042,8 @@ void WinMtfOutput::UpdateFillStyle() if (!( maLatestFillStyle == maFillStyle ) ) { maLatestFillStyle = maFillStyle; - mpGDIMetaFile->AddAction( new MetaFillColorAction( maFillStyle.aFillColor, !maFillStyle.bTransparent ) ); + if (maFillStyle.aType == FillStyleSolid) + mpGDIMetaFile->AddAction( new MetaFillColorAction( maFillStyle.aFillColor, !maFillStyle.bTransparent ) ); } } @@ -1369,7 +1371,35 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath ) else { UpdateLineStyle(); - mpGDIMetaFile->AddAction( new MetaPolygonAction( rPolygon ) ); + + if (maLatestFillStyle.aType != FillStylePattern) + mpGDIMetaFile->AddAction( new MetaPolygonAction( rPolygon ) ); + else { + SvtGraphicFill aFill = SvtGraphicFill( PolyPolygon( rPolygon ), + Color(), + 0.0, + SvtGraphicFill::fillNonZero, + SvtGraphicFill::fillTexture, + SvtGraphicFill::Transform(), + true, + SvtGraphicFill::hatchSingle, + Color(), + SvtGraphicFill::gradientLinear, + Color(), + Color(), + 0, + Graphic (maLatestFillStyle.aBmp) ); + + SvMemoryStream aMemStm; + + aMemStm << aFill; + + mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0, + static_cast(aMemStm.GetData()), + aMemStm.Seek( STREAM_SEEK_TO_END ) ) ); + mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_END" ) ); + } + } } } @@ -1712,7 +1742,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList ) if ( ( nRasterOperation & 0xaa ) != ( ( nRasterOperation & 0x55 ) << 1 ) ) nUsed |= 4; // destination is used - if ( (nUsed & 1) && (( nUsed & 2 ) == 0) ) + if ( (nUsed & 1) && (( nUsed & 2 ) == 0) && nWinRop != PATINVERT ) { // patterns aren't well supported yet sal_uInt32 nOldRop = SetRasterOp( ROP_OVERPAINT ); // in this case nRasterOperation is either 0 or 0xff UpdateFillStyle(); diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx index aa630d6ebfa4..a9903a641014 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.hxx +++ b/svtools/source/filter.vcl/wmf/winmtf.hxx @@ -364,10 +364,17 @@ struct WinMtfFontStyle // ----------------------------------------------------------------------------- +typedef enum { + FillStyleSolid, + FillStylePattern +} WinMtfFillStyleType; + struct WinMtfFillStyle { - Color aFillColor; - BOOL bTransparent; + Color aFillColor; + BOOL bTransparent; + WinMtfFillStyleType aType; + Bitmap aBmp; WinMtfFillStyle() : aFillColor ( Color( COL_BLACK ) ), @@ -377,16 +384,23 @@ struct WinMtfFillStyle WinMtfFillStyle( const Color& rColor, BOOL bTrans = FALSE ) : aFillColor ( rColor ), - bTransparent( bTrans ) + bTransparent( bTrans ), + aType ( FillStyleSolid ) + { + }; + + WinMtfFillStyle( Bitmap& rBmp ) : + aBmp ( rBmp ), + aType( FillStylePattern ) { }; BOOL operator==( const WinMtfFillStyle& rStyle ) - { return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) ); }; + { return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) && ( aType == rStyle.aType ) ); }; BOOL operator==( WinMtfFillStyle* pStyle ) - { return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) ); }; - void operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; }; - void operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; }; + { return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) && ( aType == pStyle->aType ) ); }; + void operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; aBmp = rStyle.aBmp; aType = rStyle.aType; }; + void operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; aBmp = pStyle->aBmp; aType = pStyle->aType; }; }; // ----------------------------------------------------------------------------- @@ -478,12 +492,13 @@ typedef ::boost::shared_ptr< SaveStruct > SaveStructPtr; struct BSaveStruct { - Bitmap aBmp; - Rectangle aOutRect; - UINT32 nWinRop; + Bitmap aBmp; + Rectangle aOutRect; + UINT32 nWinRop; + WinMtfFillStyle aStyle; - BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop ) : - aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ){}; + BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop, WinMtfFillStyle& rStyle ) : + aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ), aStyle ( rStyle ){}; }; // ----------------------------------------------------------------------------- @@ -638,6 +653,7 @@ class WinMtfOutput void DeleteObject( INT32 nIndex ); void SelectObject( INT32 nIndex ); CharSet GetCharSet(){ return maFont.GetCharSet(); }; + WinMtfFillStyle& GetFillStyle () { return maFillStyle; } void SetFont( const Font& rFont ); const Font& GetFont() const; void SetTextLayoutMode( const sal_uInt32 nLayoutMode ); diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx index cea1ab490b04..a8fdc86604fc 100644 --- a/svtools/source/filter.vcl/wmf/winwmf.cxx +++ b/svtools/source/filter.vcl/wmf/winwmf.cxx @@ -569,7 +569,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) aBmp.Crop( aCropRect ); } Rectangle aDestRect( aPoint, Size( nSxe, nSye ) ); - aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP ), LIST_APPEND ); + aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP, pOut->GetFillStyle () ), LIST_APPEND ); } } } @@ -619,7 +619,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) Rectangle aCropRect( Point( nSx, nSy ), Size( nSxe, nSye ) ); aBmp.Crop( aCropRect ); } - aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP ), LIST_APPEND ); + aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP, pOut->GetFillStyle () ), LIST_APPEND ); } } } -- cgit From b78a66703cc5bfa94d3fb2bbb8344220f057deed Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 12:10:46 +0200 Subject: svtools-wmf-clean-warnings.diff: emf+ import - clean the code a bit to avoid compiler warnings --- svtools/source/filter.vcl/wmf/enhwmf.cxx | 12 ++++-------- svtools/source/filter.vcl/wmf/winmtf.hxx | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx index a81fcab66db0..7f041adfae5b 100644 --- a/svtools/source/filter.vcl/wmf/enhwmf.cxx +++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx @@ -262,7 +262,7 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) void *buffer = malloc( length ); - int count = 0, next, pos = pWMF->Tell(); + int pos = pWMF->Tell(); pOut->PassEMFPlus( buffer, pWMF->Read( buffer, length ) ); pWMF->Seek( pos ); @@ -318,14 +318,10 @@ void EnhWMFReader::ReadGDIComment() break; } case 3: { - sal_uInt32 x, y, w, h; - EMFP_DEBUG(printf ("\t\tENDGROUP\n")); break; } case 0x40000004: { - sal_uInt32 x, y, w, h; - EMFP_DEBUG(printf ("\t\tMULTIFORMATS\n")); break; } @@ -397,10 +393,11 @@ BOOL EnhWMFReader::ReadEnhWMF() if( id == 0x2B464D45 && nRecSize >= 12 ) ReadEMFPlusComment( length, bHaveDC ); // GDIC comment, doesn't do anything useful yet => enabled only for debug - else if( id == 0x43494447 && nRecSize >= 12 ) + else if( id == 0x43494447 && nRecSize >= 12 ) { EMFP_DEBUG(ReadGDIComment()); - else + } else { EMFP_DEBUG(printf ("\t\tunknown id: 0x%x\n", id)); + } } } else if( !bEMFPlus || bHaveDC || nRecType == EMR_EOF ) @@ -1339,7 +1336,6 @@ BOOL EnhWMFReader::ReadEnhWMF() case EMR_CREATEDIBPATTERNBRUSHPT : { - static int count = 0; UINT32 nStart = pWMF->Tell() - 8; Bitmap aBitmap; diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx index a9903a641014..61e737022946 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.hxx +++ b/svtools/source/filter.vcl/wmf/winmtf.hxx @@ -390,8 +390,8 @@ struct WinMtfFillStyle }; WinMtfFillStyle( Bitmap& rBmp ) : - aBmp ( rBmp ), - aType( FillStylePattern ) + aType( FillStylePattern ), + aBmp ( rBmp ) { }; -- cgit From 3ef384b8606b6434903c0e6bbf6e5c33be49ac5d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:00:46 +0200 Subject: emf+-cppcanvas-offapi-renderer.diff: emf+ import - renderer iface definition --- offapi/com/sun/star/rendering/MtfRenderer.idl | 46 +++++++++++++++++++++++++++ offapi/com/sun/star/rendering/makefile.mk | 1 + 2 files changed, 47 insertions(+) create mode 100644 offapi/com/sun/star/rendering/MtfRenderer.idl diff --git a/offapi/com/sun/star/rendering/MtfRenderer.idl b/offapi/com/sun/star/rendering/MtfRenderer.idl new file mode 100644 index 000000000000..dbcc850c3e1c --- /dev/null +++ b/offapi/com/sun/star/rendering/MtfRenderer.idl @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_rendering_MtfRenderer_idl__ +#define __com_sun_star_rendering_MtfRenderer_idl__ + +#ifndef __com_sun_star_uno_XCanvas_idl__ +#include +#endif + +module com { module sun { module star { module rendering { + + interface XMtfRenderer : ::com::sun::star::uno::XInterface + { + void setMetafile( [in] sequence< byte > aMtf ); + void draw( [in] double fScaleX, [in] double fScaleY ); + }; + + service MtfRenderer : XMtfRenderer; +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/rendering/makefile.mk b/offapi/com/sun/star/rendering/makefile.mk index 6b59d156d35e..888d0b7f9c3f 100644 --- a/offapi/com/sun/star/rendering/makefile.mk +++ b/offapi/com/sun/star/rendering/makefile.mk @@ -56,6 +56,7 @@ IDLFILES=\ FontRequest.idl \ IntegerBitmapLayout.idl \ InterpolationMode.idl \ + MtfRenderer.idl \ Panose.idl \ PanoseArmStyle.idl \ PanoseContrast.idl \ -- cgit From ef1a462bfc67c88c48717a0efd11834c92503db9 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 18:05:52 +0200 Subject: calc-menu-manual-page-break.diff: 'Manual Break' -> 'Page Break' in menu texts --- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 5c72d948436f..6b4831341baf 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -1502,7 +1502,7 @@ - ~Manual Break + Page ~Break @@ -1512,7 +1512,7 @@ - Delete Manual ~Break + Delete Page ~Break -- cgit From 7600034a9fb9aa683e503dda82235c4ed680c683 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 15 Sep 2010 18:11:14 +0200 Subject: calc-new-acceleration.diff: Ctrl +/- to insert/delete a complete line in calc i#67029, X#62530 --- officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 5c735744104b..55efa6a29a6e 100755 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -429,7 +429,7 @@ I10N SHORTCUTS - NO TRANSLATE - .uno:DataSelect + .uno:FillDown -- cgit From fe8f3ddf3a6eef5320ea185a32d042a22fb94a30 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:15:49 +0200 Subject: sc-sheet-gridline-toggle.diff: Toggle gridline display per sheet. i#14893 --- sc/inc/ViewSettingsSequenceDefines.hxx | 3 ++- sc/inc/sc.hrc | 3 +++ sc/inc/scextopt.hxx | 1 + sc/sdi/docsh.sdi | 1 + sc/sdi/scalc.sdi | 27 +++++++++++++++++++++++++++ sc/source/filter/excel/xeview.cxx | 2 +- sc/source/filter/excel/xiview.cxx | 4 +++- sc/source/ui/inc/viewdata.hxx | 5 +++++ sc/source/ui/view/gridwin4.cxx | 3 ++- sc/source/ui/view/scextopt.cxx | 3 ++- sc/source/ui/view/tabvwshf.cxx | 16 ++++++++++++++++ sc/source/ui/view/viewdata.cxx | 17 +++++++++++++++++ sc/uiconfig/scalc/toolbar/formatobjectbar.xml | 2 ++ 13 files changed, 82 insertions(+), 5 deletions(-) diff --git a/sc/inc/ViewSettingsSequenceDefines.hxx b/sc/inc/ViewSettingsSequenceDefines.hxx index f23229d31a43..a8086fbdbe40 100644 --- a/sc/inc/ViewSettingsSequenceDefines.hxx +++ b/sc/inc/ViewSettingsSequenceDefines.hxx @@ -61,7 +61,7 @@ // this are the defines for the position of the settings in the // TableViewSettingsSequence -#define SC_TABLE_VIEWSETTINGS_COUNT 15 +#define SC_TABLE_VIEWSETTINGS_COUNT 16 #define SC_CURSOR_X 0 #define SC_CURSOR_Y 1 @@ -78,6 +78,7 @@ #define SC_TABLE_ZOOM_VALUE 12 #define SC_TABLE_PAGE_VIEW_ZOOM_VALUE 13 #define SC_TABLE_TAB_BG_COLOR 14 +#define SC_TABLE_SHOWGRID 15 #define SC_CURSORPOSITIONX "CursorPositionX" #define SC_CURSORPOSITIONY "CursorPositionY" diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index cc9cc9b582a2..c73abeef4df8 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1657,6 +1657,9 @@ // Autoformat for DataPilot #define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 1) +// Toggle sheet grid +#define FID_TAB_TOGGLE_GRID (SC_OOO_BUILD_START + 2) + #endif diff --git a/sc/inc/scextopt.hxx b/sc/inc/scextopt.hxx index ad3fd4b1b51e..4b3c86e14b18 100644 --- a/sc/inc/scextopt.hxx +++ b/sc/inc/scextopt.hxx @@ -76,6 +76,7 @@ struct ScExtTabSettings bool mbSelected; /// true = Sheet is selected. bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits. bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode. + bool mbShowGrid; /// Whether or not to display gridlines. explicit ScExtTabSettings(); }; diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi index 94cd06d9f699..edf00e877e1f 100644 --- a/sc/sdi/docsh.sdi +++ b/sc/sdi/docsh.sdi @@ -61,6 +61,7 @@ interface TableSelection FID_TAB_RENAME [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] FID_TAB_RTL [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] FID_TAB_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + FID_TAB_TOGGLE_GRID [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] SID_TABLE_ACTIVATE [ ExecMethod = Execute; ] } diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 9a5d959d9d5b..e88d3725b8aa 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -7798,6 +7798,33 @@ SfxVoidItem ShareDocument SID_SHARE_DOC GroupId = GID_OPTIONS; ] +//-------------------------------------------------------------------------- +SfxBoolItem ToggleSheetGrid FID_TAB_TOGGLE_GRID + +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + + + //-------------------------------------------------------------------------- SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 035afd0a5830..9cc691db940d 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -313,7 +313,6 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc const ScViewOptions& rViewOpt = GetDoc().GetViewOptions(); maData.mbShowFormulas = rViewOpt.GetOption( VOPT_FORMULAS ); - maData.mbShowGrid = rViewOpt.GetOption( VOPT_GRID ); maData.mbShowHeadings = rViewOpt.GetOption( VOPT_HEADER ); maData.mbShowZeros = rViewOpt.GetOption( VOPT_NULLVALS ); maData.mbShowOutline = rViewOpt.GetOption( VOPT_OUTLINER ); @@ -388,6 +387,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc else maData.maGridColor = rGridColor; } + maData.mbShowGrid = rTabSett.mbShowGrid; // view mode and zoom maData.mbPageMode = (GetBiff() == EXC_BIFF8) && rTabSett.mbPageMode; diff --git a/sc/source/filter/excel/xiview.cxx b/sc/source/filter/excel/xiview.cxx index f75032ff461e..1b047de977ab 100644 --- a/sc/source/filter/excel/xiview.cxx +++ b/sc/source/filter/excel/xiview.cxx @@ -274,6 +274,9 @@ void XclImpTabViewSettings::Finalize() else rTabSett.maGridColor = maData.maGridColor; + // show grid option + rTabSett.mbShowGrid = maData.mbShowGrid; + // view mode and zoom if( maData.mnCurrentZoom != 0 ) (maData.mbPageMode ? maData.mnPageZoom : maData.mnNormalZoom) = maData.mnCurrentZoom; @@ -288,7 +291,6 @@ void XclImpTabViewSettings::Finalize() // set Excel sheet settings globally at Calc document, take settings from displayed sheet ScViewOptions aViewOpt( rDoc.GetViewOptions() ); aViewOpt.SetOption( VOPT_FORMULAS, maData.mbShowFormulas ); - aViewOpt.SetOption( VOPT_GRID, maData.mbShowGrid ); aViewOpt.SetOption( VOPT_HEADER, maData.mbShowHeadings ); aViewOpt.SetOption( VOPT_NULLVALS, maData.mbShowZeros ); aViewOpt.SetOption( VOPT_OUTLINER, maData.mbShowOutline ); diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 05560b0872b2..52923d1d240c 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -139,6 +139,8 @@ private: SCCOL nPosX[2]; SCROW nPosY[2]; + bool bShowGrid; // per-sheet show grid-lines option. + BOOL bOldCurValid; // "virtuelle" Cursorpos. bei zusammengefassten ScViewDataTable(); @@ -320,6 +322,9 @@ public: const Fraction& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; } const Fraction& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; } + void SetShowGrid( bool bShow ); + bool GetShowGrid() const { return pThisTab->bShowGrid; } + const MapMode& GetLogicMode( ScSplitPos eWhich ); const MapMode& GetLogicMode(); // Offset 0 diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 69deeb4e432f..ae18459d8d97 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -572,7 +572,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod aOutputData.SetEditObject( GetEditObject() ); aOutputData.SetViewShell( pViewData->GetViewShell() ); - BOOL bGrid = rOpts.GetOption( VOPT_GRID ); + BOOL bGrid = rOpts.GetOption( VOPT_GRID ) && pViewData->GetShowGrid(); + BOOL bPage = rOpts.GetOption( VOPT_PAGEBREAKS ); if ( eMode == SC_UPDATE_CHANGED ) diff --git a/sc/source/ui/view/scextopt.cxx b/sc/source/ui/view/scextopt.cxx index d5816ecdd289..fe5a91f54bd4 100644 --- a/sc/source/ui/view/scextopt.cxx +++ b/sc/source/ui/view/scextopt.cxx @@ -57,7 +57,8 @@ ScExtTabSettings::ScExtTabSettings() : mnPageZoom( 0 ), mbSelected( false ), mbFrozenPanes( false ), - mbPageMode( false ) + mbPageMode( false ), + mbShowGrid( true ) { } diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 20a10f149a3a..39a188e176d5 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -32,6 +32,7 @@ #include "scitems.hxx" #include +#include #include #include #include @@ -691,6 +692,17 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) } break; + case FID_TAB_TOGGLE_GRID: + { + bool bShowGrid = pViewData->GetShowGrid(); + pViewData->SetShowGrid(!bShowGrid); + SfxBindings& rBindings = GetViewFrame()->GetBindings(); + rBindings.Invalidate( FID_TAB_TOGGLE_GRID ); + PaintGrid(); + rReq.Done(); + } + break; + case FID_TAB_SET_TAB_BG_COLOR: case FID_TAB_MENU_SET_TAB_BG_COLOR: { @@ -954,6 +966,10 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet ) rSet.Put( SvxColorItem( aColor, nWhich ) ); } break; + + case FID_TAB_TOGGLE_GRID: + rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) ); + break; } nWhich = aIter.NextWhich(); } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 8f463c2a86b3..d662c2e6d018 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -101,6 +101,7 @@ ScViewDataTable::ScViewDataTable() : nFixPosY( 0 ), nCurX( 0 ), nCurY( 0 ), + bShowGrid( true ), bOldCurValid( FALSE ) { nPosX[0]=nPosX[1]=0; @@ -160,6 +161,9 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence pSettings[SC_TABLE_ZOOM_VALUE].Value <<= nZoomValue; pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_PAGEVIEWZOOMVALUE)); pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue; + + pSettings[SC_TABLE_SHOWGRID].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_SHOWGRID)); + pSettings[SC_TABLE_SHOWGRID].Value <<= static_cast(bShowGrid); } } @@ -264,6 +268,10 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence >= bShowGrid; + } else if (sName.compareToAscii(SC_TABLESELECTED) == 0) { bool bSelected = false; @@ -743,6 +751,12 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAl SetZoom( rNewX, rNewY, vTabs ); } +void ScViewData::SetShowGrid( bool bShow ) +{ + CreateSelectedTabData(); + pTabData[nTabNo]->bShowGrid = bShow; +} + void ScViewData::RefreshZoom() { // recalculate zoom-dependent values (only for current sheet) @@ -2526,6 +2540,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const if( rGridColor.GetColor() != SC_STD_GRIDCOLOR ) rTabSett.maGridColor = rGridColor; } + rTabSett.mbShowGrid = pViewTab->bShowGrid; // view mode and zoom rTabSett.mbPageMode = bPagebreak; @@ -2658,6 +2673,8 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt ) if( rTabSett.mnPageZoom ) rViewTab.aPageZoomX = rViewTab.aPageZoomY = Fraction( rTabSett.mnPageZoom, 100L ); + rViewTab.bShowGrid = rTabSett.mbShowGrid; + // get some settings from displayed Excel sheet, set at Calc document if( nTab == GetTabNo() ) { diff --git a/sc/uiconfig/scalc/toolbar/formatobjectbar.xml b/sc/uiconfig/scalc/toolbar/formatobjectbar.xml index 49c31d72f176..773befcc8ac7 100644 --- a/sc/uiconfig/scalc/toolbar/formatobjectbar.xml +++ b/sc/uiconfig/scalc/toolbar/formatobjectbar.xml @@ -50,4 +50,6 @@ + + -- cgit From ddd9cef65af458a505f19db64e368f66e51f473f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:16:21 +0200 Subject: sc-sheet-gridline-toggle.diff: Toggle gridline display per sheet. i#14893 --- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 6b4831341baf..073a2bbc5435 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -1493,6 +1493,14 @@ S~hare Document... + + + Toggle Grid Lines for Current Sheet + + + 1 + + -- cgit From d1b6cb4619dd20d38e352b2b9d950696b716ba1d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:19:24 +0200 Subject: calc-formula-variable-separators-sc.diff: formula separators changeable n#447164, i#92056 Make the formula separators changeable per locale setting, and add new configuration page for formula syntax and separators. --- sc/inc/docoptio.hxx | 36 +++++++ sc/inc/sc.hrc | 4 + sc/source/core/data/documen3.cxx | 7 ++ sc/source/core/tool/docoptio.cxx | 200 ++++++++++++++++++++++++++++++++++++- sc/source/ui/app/scmod.cxx | 7 ++ sc/source/ui/attrdlg/scdlgfact.cxx | 3 + sc/source/ui/inc/optdlg.hrc | 14 +++ sc/source/ui/optdlg/makefile.mk | 2 + sc/source/ui/src/optdlg.src | 99 ++++++++++++++++++ 9 files changed, 370 insertions(+), 2 deletions(-) diff --git a/sc/inc/docoptio.hxx b/sc/inc/docoptio.hxx index 6f6d4c859a5c..c9f06a9e5a35 100644 --- a/sc/inc/docoptio.hxx +++ b/sc/inc/docoptio.hxx @@ -34,6 +34,8 @@ #include "scdllapi.h" #include "optutil.hxx" +#include "formula/grammar.hxx" + class SC_DLLPUBLIC ScDocOptions { double fIterEps; // Epsilon-Wert dazu @@ -51,6 +53,11 @@ class SC_DLLPUBLIC ScDocOptions BOOL bDoAutoSpell; // Auto-Spelling BOOL bLookUpColRowNames; // Spalten-/Zeilenbeschriftungen automagisch suchen BOOL bFormulaRegexEnabled; // regular expressions in formulas enabled + ::formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax + + ::rtl::OUString aFormulaSepArg; + ::rtl::OUString aFormulaSepArrayRow; + ::rtl::OUString aFormulaSepArrayCol; public: ScDocOptions(); @@ -97,6 +104,20 @@ public: void SetFormulaRegexEnabled( BOOL bVal ) { bFormulaRegexEnabled = bVal; } BOOL IsFormulaRegexEnabled() const { return bFormulaRegexEnabled; } + + void SetFormulaSyntax( ::formula::FormulaGrammar::Grammar eGram ) { eFormulaGrammar = eGram; } + ::formula::FormulaGrammar::Grammar GetFormulaSyntax() const { return eFormulaGrammar; } + + void SetFormulaSepArg(const ::rtl::OUString& rSep) { aFormulaSepArg = rSep; } + ::rtl::OUString GetFormulaSepArg() const { return aFormulaSepArg; } + + void SetFormulaSepArrayRow(const ::rtl::OUString& rSep) { aFormulaSepArrayRow = rSep; } + ::rtl::OUString GetFormulaSepArrayRow() const { return aFormulaSepArrayRow; } + + void SetFormulaSepArrayCol(const ::rtl::OUString& rSep) { aFormulaSepArrayCol = rSep; } + ::rtl::OUString GetFormulaSepArrayCol() const { return aFormulaSepArrayCol; } + + const LocaleDataWrapper& GetLocaleDataWrapper() const; }; @@ -117,6 +138,10 @@ inline void ScDocOptions::CopyTo(ScDocOptions& rOpt) rOpt.bDoAutoSpell = bDoAutoSpell; rOpt.bLookUpColRowNames = bLookUpColRowNames; rOpt.bFormulaRegexEnabled = bFormulaRegexEnabled; + rOpt.eFormulaGrammar = eFormulaGrammar; + rOpt.aFormulaSepArg = aFormulaSepArg; + rOpt.aFormulaSepArrayRow = aFormulaSepArrayRow; + rOpt.aFormulaSepArrayCol = aFormulaSepArrayCol; } inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy ) @@ -136,6 +161,10 @@ inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy ) bDoAutoSpell = rCpy.bDoAutoSpell; bLookUpColRowNames = rCpy.bLookUpColRowNames; bFormulaRegexEnabled= rCpy.bFormulaRegexEnabled; + eFormulaGrammar = rCpy.eFormulaGrammar; + aFormulaSepArg = rCpy.aFormulaSepArg; + aFormulaSepArrayRow = rCpy.aFormulaSepArrayRow; + aFormulaSepArrayCol = rCpy.aFormulaSepArrayCol; return *this; } @@ -158,6 +187,10 @@ inline int ScDocOptions::operator==( const ScDocOptions& rOpt ) const && rOpt.bDoAutoSpell == bDoAutoSpell && rOpt.bLookUpColRowNames == bLookUpColRowNames && rOpt.bFormulaRegexEnabled == bFormulaRegexEnabled + && rOpt.eFormulaGrammar == eFormulaGrammar + && rOpt.aFormulaSepArg == aFormulaSepArg + && rOpt.aFormulaSepArrayRow == aFormulaSepArrayRow + && rOpt.aFormulaSepArrayCol == aFormulaSepArrayCol ); } @@ -197,12 +230,15 @@ private: class ScDocCfg : public ScDocOptions { ScLinkConfigItem aCalcItem; + ScLinkConfigItem aFormulaItem; ScLinkConfigItem aLayoutItem; DECL_LINK( CalcCommitHdl, void* ); + DECL_LINK( FormulaCommitHdl, void* ); DECL_LINK( LayoutCommitHdl, void* ); com::sun::star::uno::Sequence GetCalcPropertyNames(); + com::sun::star::uno::Sequence GetFormulaPropertyNames(); com::sun::star::uno::Sequence GetLayoutPropertyNames(); public: diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index c73abeef4df8..e08c6dfbd060 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1660,6 +1660,10 @@ // Toggle sheet grid #define FID_TAB_TOGGLE_GRID (SC_OOO_BUILD_START + 2) +// Formula options page +#define RID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 3) +#define HID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 4) + #endif diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index e95087363090..368ac22c0ebd 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -53,6 +53,7 @@ #include "rangelst.hxx" #include "chartarr.hxx" #include "chartlock.hxx" +#include "compiler.hxx" #include "refupdat.hxx" #include "docoptio.hxx" #include "viewopti.hxx" @@ -1858,6 +1859,12 @@ void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) *pDocOptions = rOpt; xPoolHelper->SetFormTableOpt(rOpt); + + SetGrammar( rOpt.GetFormulaSyntax() ); + + // Update the separators. + ScCompiler::UpdateSeparatorsNative( + rOpt.GetFormulaSepArg(), rOpt.GetFormulaSepArrayCol(), rOpt.GetFormulaSepArrayRow()); } const ScViewOptions& ScDocument::GetViewOptions() const diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index 95ce357b3217..7490dfec77df 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -35,6 +35,8 @@ #include #include +#include +#include #include "cfgids.hxx" #include "docoptio.hxx" @@ -42,10 +44,13 @@ #include "scresid.hxx" #include "sc.hrc" #include "miscuno.hxx" +#include "global.hxx" using namespace utl; using namespace rtl; using namespace com::sun::star::uno; +using ::com::sun::star::lang::Locale; +using ::com::sun::star::i18n::LocaleDataItem; //------------------------------------------------------------------------ @@ -97,7 +102,11 @@ ScDocOptions::ScDocOptions( const ScDocOptions& rCpy ) bMatchWholeCell( rCpy.bMatchWholeCell ), bDoAutoSpell( rCpy.bDoAutoSpell ), bLookUpColRowNames( rCpy.bLookUpColRowNames ), - bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ) + bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ), + eFormulaGrammar( rCpy.eFormulaGrammar ), + aFormulaSepArg( rCpy.aFormulaSepArg ), + aFormulaSepArrayRow( rCpy.aFormulaSepArrayRow ), + aFormulaSepArrayCol( rCpy.aFormulaSepArrayCol ) { } @@ -126,6 +135,67 @@ void ScDocOptions::ResetDocOptions() bDoAutoSpell = FALSE; bLookUpColRowNames = TRUE; bFormulaRegexEnabled= TRUE; + eFormulaGrammar = ::formula::FormulaGrammar::GRAM_NATIVE; + + do + { + const Locale& rLocale = *ScGlobal::GetLocale(); + const OUString& rLang = rLocale.Language; + if (rLang.equalsAscii("ru")) + // Don't do automatic guess for these languages, and fall back to + // the old separator set. + break; + + const LocaleDataWrapper& rLocaleData = GetLocaleDataWrapper(); + const OUString& rDecSep = rLocaleData.getNumDecimalSep(); + const OUString& rListSep = rLocaleData.getListSep(); + + if (!rDecSep.getLength() || !rListSep.getLength()) + // Something is wrong. Stick with the default separators. + break; + + sal_Unicode cDecSep = rDecSep.getStr()[0]; + sal_Unicode cListSep = rListSep.getStr()[0]; + + // Excel by default uses system's list separator as the parameter + // separator, which in English locales is a comma. However, OOo's list + // separator value is set to ';' for all English locales. Because of this + // discrepancy, we will hardcode the separator value here, for now. + if (cDecSep == sal_Unicode('.')) + cListSep = sal_Unicode(','); + + // Special case for de_CH locale. + if (rLocale.Language.equalsAsciiL("de", 2) && rLocale.Country.equalsAsciiL("CH", 2)) + cListSep = sal_Unicode(';'); + + // by default, the parameter separator equals the locale-specific + // list separator. + aFormulaSepArg = OUString(cListSep); + + if (cDecSep == cListSep && cDecSep != sal_Unicode(';')) + // if the decimal and list separators are equal, set the + // parameter separator to be ';', unless they are both + // semicolon in which case don't change the decimal separator. + aFormulaSepArg = OUString::createFromAscii(";"); + + aFormulaSepArrayCol = OUString::createFromAscii(","); + if (cDecSep == sal_Unicode(',')) + aFormulaSepArrayCol = OUString::createFromAscii("."); + aFormulaSepArrayRow = OUString::createFromAscii(";"); + + return; + } + while (false); + + // Defaults to the old separator values. + aFormulaSepArg = OUString::createFromAscii(";"); + aFormulaSepArrayCol = OUString::createFromAscii(";"); + aFormulaSepArrayRow = OUString::createFromAscii("|"); +} + +const LocaleDataWrapper& ScDocOptions::GetLocaleDataWrapper() const +{ + return *ScGlobal::pLocaleData; } //======================================================================== @@ -203,6 +273,13 @@ SfxPoolItem* __EXPORT ScTpCalcItem::Clone( SfxItemPool * ) const #define SCCALCOPT_REGEX 11 #define SCCALCOPT_COUNT 12 +#define CFGPATH_FORMULA "Office.Calc/Formula" +#define SCFORMULAOPT_GRAMMAR 0 +#define SCFORMULAOPT_SEP_ARG 1 +#define SCFORMULAOPT_SEP_ARRAY_ROW 2 +#define SCFORMULAOPT_SEP_ARRAY_COL 3 +#define SCFORMULAOPT_COUNT 4 + #define CFGPATH_DOCLAYOUT "Office.Calc/Layout/Other" #define SCDOCLAYOUTOPT_TABSTOP 0 @@ -224,7 +301,7 @@ Sequence ScDocCfg::GetCalcPropertyNames() "Other/Precision", // SCCALCOPT_PRECISION "Other/SearchCriteria", // SCCALCOPT_SEARCHCRIT "Other/FindLabel", // SCCALCOPT_FINDLABEL - "Other/RegularExpressions" // SCCALCOPT_REGEX + "Other/RegularExpressions", // SCCALCOPT_REGEX }; Sequence aNames(SCCALCOPT_COUNT); OUString* pNames = aNames.getArray(); @@ -234,6 +311,23 @@ Sequence ScDocCfg::GetCalcPropertyNames() return aNames; } +Sequence ScDocCfg::GetFormulaPropertyNames() +{ + static const char* aPropNames[] = + { + "Syntax/Grammar", // SCFORMULAOPT_GRAMMAR + "Syntax/SeparatorArg", // SCFORMULAOPT_SEP_ARG + "Syntax/SeparatorArrayRow", // SCFORMULAOPT_SEP_ARRAY_ROW + "Syntax/SeparatorArrayCol", // SCFORMULAOPT_SEP_ARRAY_COL + }; + Sequence aNames(SCFORMULAOPT_COUNT); + OUString* pNames = aNames.getArray(); + for (int i = 0; i < SCFORMULAOPT_COUNT; ++i) + pNames[i] = OUString::createFromAscii(aPropNames[i]); + + return aNames; +} + Sequence ScDocCfg::GetLayoutPropertyNames() { static const char* aPropNames[] = @@ -254,6 +348,7 @@ Sequence ScDocCfg::GetLayoutPropertyNames() ScDocCfg::ScDocCfg() : aCalcItem( OUString::createFromAscii( CFGPATH_CALC ) ), + aFormulaItem(OUString::createFromAscii(CFGPATH_FORMULA)), aLayoutItem( OUString::createFromAscii( CFGPATH_DOCLAYOUT ) ) { sal_Int32 nIntVal = 0; @@ -325,6 +420,69 @@ ScDocCfg::ScDocCfg() : SetDate( nDateDay, nDateMonth, nDateYear ); + aNames = GetFormulaPropertyNames(); + aValues = aFormulaItem.GetProperties(aNames); + aFormulaItem.EnableNotification(aNames); + pValues = aValues.getConstArray(); + if (aValues.getLength() == aNames.getLength()) + { + for (int nProp = 0; nProp < aNames.getLength(); ++nProp) + { + switch (nProp) + { + case SCFORMULAOPT_GRAMMAR: + { + ::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT; + + do + { + if (!(pValues[nProp] >>= nIntVal)) + // extractino failed. + break; + + switch (nIntVal) + { + case 0: // Calc A1 + eGram = ::formula::FormulaGrammar::GRAM_NATIVE; + break; + case 1: // Excel A1 + eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1; + break; + case 2: // Excel R1C1 + eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1; + break; + } + } + while (false); + SetFormulaSyntax(eGram); + } + break; + case SCFORMULAOPT_SEP_ARG: + { + OUString aSep; + if ((pValues[nProp] >>= aSep) && aSep.getLength()) + SetFormulaSepArg(aSep); + } + break; + case SCFORMULAOPT_SEP_ARRAY_ROW: + { + OUString aSep; + if ((pValues[nProp] >>= aSep) && aSep.getLength()) + SetFormulaSepArrayRow(aSep); + } + break; + case SCFORMULAOPT_SEP_ARRAY_COL: + { + OUString aSep; + if ((pValues[nProp] >>= aSep) && aSep.getLength()) + SetFormulaSepArrayCol(aSep); + } + break; + } + } + } + aFormulaItem.SetCommitLink( LINK(this, ScDocCfg, FormulaCommitHdl) ); + aNames = GetLayoutPropertyNames(); aValues = aLayoutItem.GetProperties(aNames); aLayoutItem.EnableNotification(aNames); @@ -407,6 +565,43 @@ IMPL_LINK( ScDocCfg, CalcCommitHdl, void *, EMPTYARG ) return 0; } +IMPL_LINK( ScDocCfg, FormulaCommitHdl, void *, EMPTYARG ) +{ + Sequence aNames = GetFormulaPropertyNames(); + Sequence aValues(aNames.getLength()); + Any* pValues = aValues.getArray(); + + for (int nProp = 0; nProp < aNames.getLength(); ++nProp) + { + switch (nProp) + { + case SCFORMULAOPT_GRAMMAR : + { + sal_Int32 nVal = 0; + switch (GetFormulaSyntax()) + { + case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1: nVal = 1; break; + case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1: nVal = 2; break; + } + pValues[nProp] <<= nVal; + } + break; + case SCFORMULAOPT_SEP_ARG: + pValues[nProp] <<= GetFormulaSepArg(); + break; + case SCFORMULAOPT_SEP_ARRAY_ROW: + pValues[nProp] <<= GetFormulaSepArrayRow(); + break; + case SCFORMULAOPT_SEP_ARRAY_COL: + pValues[nProp] <<= GetFormulaSepArrayCol(); + break; + } + } + aFormulaItem.PutProperties(aNames, aValues); + + return 0; +} + IMPL_LINK( ScDocCfg, LayoutCommitHdl, void *, EMPTYARG ) { Sequence aNames = GetLayoutPropertyNames(); @@ -436,6 +631,7 @@ void ScDocCfg::SetOptions( const ScDocOptions& rNew ) *(ScDocOptions*)this = rNew; aCalcItem.SetModified(); + aFormulaItem.SetModified(); aLayoutItem.SetModified(); } diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 272852efcf71..eca5f1a8dcfb 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2109,6 +2109,13 @@ SfxTabPage* ScModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItem pRet = (*ScTpCalcOptionsCreate)(pParent, rSet); } break; + case SID_SC_TP_FORMULA: + { + ::CreateTabPage ScTpFormulaOptionsCreate = pFact->GetTabPageCreatorFunc (RID_SCPAGE_FORMULA); + if (ScTpFormulaOptionsCreate) + pRet = (*ScTpFormulaOptionsCreate)(pParent, rSet); + } + break; case SID_SC_TP_CHANGES: { //CHINA001 pRet = ScRedlineOptionsTabPage::Create(pParent, rSet); ::CreateTabPage ScRedlineOptionsTabPageCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_OPREDLINE ); diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 73a5f1a1c4ee..afb5ff65cb24 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -79,6 +79,7 @@ #include "tpstat.hxx" //add for ScDocStatPage #include "tpusrlst.hxx" //add for ScTpUserLists #include "tpview.hxx" //add for ScTpContentOptions +#include "tpformula.hxx" // ause #include "editutil.hxx" @@ -1554,6 +1555,8 @@ CreateTabPage ScAbstractDialogFactory_Impl::GetTabPageCreatorFunc( USHORT nId ) case RID_SCPAGE_CALC : return ScTpCalcOptions::Create; //break; + case RID_SCPAGE_FORMULA: + return ScTpFormulaOptions::Create; case RID_SCPAGE_PRINT : return ScTpPrintOptions::Create; //break; diff --git a/sc/source/ui/inc/optdlg.hrc b/sc/source/ui/inc/optdlg.hrc index 27b8976e3541..9d98f7237e65 100644 --- a/sc/source/ui/inc/optdlg.hrc +++ b/sc/source/ui/inc/optdlg.hrc @@ -49,6 +49,7 @@ #define TP_LAYOUT 12 #define TP_INPUT 13 #define TP_CHANGES 14 +#define TP_FORMULA 15 // TP_CALC: #define BTN_ITERATE 1 @@ -190,3 +191,16 @@ #define CB_TEXTFMT 78 #define CB_REPLWARN 79 + +// TP_FORMULA +#define FL_FORMULA_OPTIONS 80 +#define FT_FORMULA_SYNTAX 81 +#define LB_FORMULA_SYNTAX 82 +#define FL_FORMULA_SEPS 83 +#define FT_FORMULA_SEP_ARG 84 +#define ED_FORMULA_SEP_ARG 85 +#define FT_FORMULA_SEP_ARRAY_R 86 +#define ED_FORMULA_SEP_ARRAY_R 87 +#define FT_FORMULA_SEP_ARRAY_C 88 +#define ED_FORMULA_SEP_ARRAY_C 89 +#define BTN_FORMULA_SEP_RESET 90 diff --git a/sc/source/ui/optdlg/makefile.mk b/sc/source/ui/optdlg/makefile.mk index 52df7072ecf8..f09eb9238f8c 100644 --- a/sc/source/ui/optdlg/makefile.mk +++ b/sc/source/ui/optdlg/makefile.mk @@ -43,6 +43,7 @@ CXXFILES = \ tpusrlst.cxx \ tpview.cxx \ tpcalc.cxx \ + tpformula.cxx \ tpprint.cxx \ opredlin.cxx @@ -50,6 +51,7 @@ SLOFILES = \ $(SLO)$/tpusrlst.obj \ $(SLO)$/tpview.obj \ $(SLO)$/tpcalc.obj \ + $(SLO)$/tpformula.obj \ $(SLO)$/tpprint.obj \ $(SLO)$/opredlin.obj diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src index 4c64e312bc2d..c0d2f8255837 100644 --- a/sc/source/ui/src/optdlg.src +++ b/sc/source/ui/src/optdlg.src @@ -179,6 +179,105 @@ TabPage RID_SCPAGE_CALC /* */ /**************************************************************************/ +TabPage RID_SCPAGE_FORMULA +{ + HelpId = HID_SCPAGE_FORMULA ; + SVLook = TRUE ; + Hide = TRUE ; + Pos = MAP_APPFONT ( 0 , 0 ) ; + Size = MAP_APPFONT ( 260 , 185 ) ; + + FixedLine FL_FORMULA_OPTIONS + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Formula options"; + }; + + FixedText FT_FORMULA_SYNTAX + { + Pos = MAP_APPFONT ( 21, 16 ) ; + Size = MAP_APPFONT ( 80, 8 ) ; + Text [ en-US ] = "Formula ~syntax" ; + }; + + ListBox LB_FORMULA_SYNTAX + { + Border = TRUE ; + Pos = MAP_APPFONT ( 85, 14 ) ; + Size = MAP_APPFONT ( 60, 46 ) ; + DropDown = TRUE ; + StringList [ en-US ] = + { + < "Calc A1" ; Default ; > ; + < "Excel A1" ; Default ; > ; + < "Excel R1C1" ; Default ; > ; + }; + }; + + FixedLine FL_FORMULA_SEPS + { + Pos = MAP_APPFONT ( 6 , 32 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Separators"; + }; + + FixedText FT_FORMULA_SEP_ARG + { + Pos = MAP_APPFONT ( 21, 45 ); + Size = MAP_APPFONT ( 40, 8 ); + Text [ en-US ] = "~Function"; + }; + + Edit ED_FORMULA_SEP_ARG + { + Border = TRUE; + Pos = MAP_APPFONT ( 65, 43 ); + Size = MAP_APPFONT ( 10, 12 ); + }; + + FixedText FT_FORMULA_SEP_ARRAY_C + { + Pos = MAP_APPFONT ( 21, 63 ); + Size = MAP_APPFONT ( 40, 8 ); + Text [ en-US ] = "Array co~lumn"; + }; + + Edit ED_FORMULA_SEP_ARRAY_C + { + Border = TRUE; + Pos = MAP_APPFONT ( 65, 61 ); + Size = MAP_APPFONT ( 10, 12 ); + }; + + FixedText FT_FORMULA_SEP_ARRAY_R + { + Pos = MAP_APPFONT ( 21, 81 ); + Size = MAP_APPFONT ( 40, 8 ); + Text [ en-US ] = "Array ~row"; + }; + + Edit ED_FORMULA_SEP_ARRAY_R + { + Border = TRUE; + Pos = MAP_APPFONT ( 65, 79 ); + Size = MAP_APPFONT ( 10, 12 ); + }; + + PushButton BTN_FORMULA_SEP_RESET + { + Pos = MAP_APPFONT ( 21, 99 ); + Size = MAP_APPFONT ( 40, 14 ); + Text [ en-US ] = "Rese~t"; + }; +}; + +/**************************************************************************/ +/* */ +/* */ +/* */ +/**************************************************************************/ + TabPage RID_SCPAGE_USERLISTS { HelpId = HID_SCPAGE_USERLISTS ; -- cgit From f8f34f8cd713d4ef8c9f370001c36c4950634563 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:20:46 +0200 Subject: calc-formula-variable-separators-sc.diff: formula separators changeable n#447164, i#92056 Make the formula separators changeable per locale setting, and add new configuration page for formula syntax and separators. --- formula/inc/formula/FormulaCompiler.hxx | 2 ++ formula/source/core/api/FormulaCompiler.cxx | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx index 8d04084d64d8..97b7b980678a 100644 --- a/formula/inc/formula/FormulaCompiler.hxx +++ b/formula/inc/formula/FormulaCompiler.hxx @@ -242,6 +242,8 @@ public: including an address reference convention. */ inline FormulaGrammar::Grammar GetGrammar() const { return meGrammar; } + static void UpdateSeparatorsNative( const rtl::OUString& rSep, const rtl::OUString& rArrayColSep, const rtl::OUString& rArrayRowSep ); + protected: virtual String FindAddInFunction( const String& rUpperName, BOOL bLocalFirst ) const; virtual void fillFromAddInCollectionUpperName( NonConstOpCodeMapPtr xMap ) const; diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 2010679907d2..607700960ca1 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -1678,6 +1678,17 @@ void FormulaCompiler::AppendString( rtl::OUStringBuffer& rBuffer, const String & rBuffer.append(sal_Unicode('"')); } } + +void FormulaCompiler::UpdateSeparatorsNative( + const rtl::OUString& rSep, const rtl::OUString& rArrayColSep, const rtl::OUString& rArrayRowSep ) +{ + NonConstOpCodeMapPtr xSymbolsNative; + lcl_fillNativeSymbols(xSymbolsNative); + xSymbolsNative->putOpCode(rSep, ocSep); + xSymbolsNative->putOpCode(rArrayColSep, ocArrayColSep); + xSymbolsNative->putOpCode(rArrayRowSep, ocArrayRowSep); +} + // ----------------------------------------------------------------------------- OpCode FormulaCompiler::NextToken() { -- cgit From ecb7248b14e7096efae40966f0d49b5192993306 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:26:26 +0200 Subject: calc-formula-variable-separators-svx.diff: formula separators changeable n#447164, i#92056 Make the formula separators changeable per locale setting, and add new configuration page for formula syntax and separators. --- cui/source/options/treeopt.cxx | 1 + cui/source/options/treeopt.src | 1 + 2 files changed, 2 insertions(+) diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 45925a4ca4fb..f014c320fedc 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -451,6 +451,7 @@ static OptionsMapping_Impl __READONLY_DATA OptionsMap_Impl[] = { "Calc", "View", SID_SC_TP_CONTENT }, { "Calc", "International", RID_OFA_TP_INTERNATIONAL }, { "Calc", "Calculate", SID_SC_TP_CALC }, + { "Calc", "Formula", SID_SC_TP_FORMULA }, { "Calc", "SortLists", SID_SC_TP_USERLISTS }, { "Calc", "Changes", SID_SC_TP_CHANGES }, { "Calc", "Grid", SID_SC_TP_GRID }, diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src index cba8cd1e411b..5b5d9bf06a27 100644 --- a/cui/source/options/treeopt.src +++ b/cui/source/options/treeopt.src @@ -239,6 +239,7 @@ Resource RID_OFADLG_OPTIONS_TREE_PAGES < "View" ; SID_SC_TP_CONTENT ;> ; < "International" ; RID_OFA_TP_INTERNATIONAL ;> ; < "Calculate" ; SID_SC_TP_CALC ;> ; + < "Formula" ; SID_SC_TP_FORMULA ;> ; < "Sort Lists" ; SID_SC_TP_USERLISTS ;> ; < "Changes" ; SID_SC_TP_CHANGES ;> ; < "Grid" ; SID_SC_TP_GRID ;> ; -- cgit From f1ed85df61f12ef37b3ac293e9af548c19616898 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:27:09 +0200 Subject: calc-formula-variable-separators-svx.diff: formula separators changeable n#447164, i#92056 Make the formula separators changeable per locale setting, and add new configuration page for formula syntax and separators. --- svx/inc/svx/dialogs.hrc | 1 + 1 file changed, 1 insertion(+) diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index 059eee0100d1..80957c5c46f6 100755 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -1056,3 +1056,4 @@ #endif +#define SID_SC_TP_FORMULA (SVX_OOO_BUILD_START + 1) -- cgit From 81571e00b1b423929459ffdb34fd519e7f3d0961 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:29:01 +0200 Subject: calc-formula-variable-separators-officecfg.diff: formula separators changeable n#447164, i#92056 Make the formula separators changeable per locale setting, and add new configuration page for formula syntax and separators. --- .../registry/schema/org/openoffice/Office/Calc.xcs | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 913902731f29..2db99d25807c 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1217,6 +1217,31 @@ true + + + + + kyoshida + Specifies what formula syntax type to use. + + + + + Calc A1 + + + + + Excel A1 + + + + + Excel R1C1 + + + + Specifies the date that is represented by the number 0. @@ -1224,6 +1249,64 @@ + + + Contains settings that affect formula handling. + + + + Contains settings for formula syntax. + + + + + kyoshida + Specifies what formula syntax type to use. + + + + + Calc A1 + + + + + Excel A1 + + + + + Excel R1C1 + + + + + + + + kyoshida + Argument separator in worksheet function + + + + + + + kyoshida + Row separator in array constant + + + + + + + kyoshida + Column separator in array constant + + + + + Contains settings that affect revision marking. -- cgit From 28092ca22e452be06c0d8261b200ecc74ab1816d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:38:36 +0200 Subject: chart-subtitle-xls-export.diff: Export chart subtitle i#92357 Squeeze chart's subtitle into the 2nd line of the main title when exporting to xls. --- sc/source/filter/excel/xechart.cxx | 45 ++++++++++++++++++++++++++++++++++---- sc/source/filter/inc/xechart.hxx | 4 +++- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index b6b136da4b1e..7ca4bb724477 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -1016,6 +1017,13 @@ void XclExpChSourceLink::ConvertNumFmt( const ScfPropertySet& rPropSet, bool bPe } } +void XclExpChSourceLink::AppendString( const String& rStr ) +{ + if (!mxString.is()) + return; + XclExpStringHelper::AppendString( *mxString, GetRoot(), rStr ); +} + void XclExpChSourceLink::Save( XclExpStream& rStrm ) { // CHFORMATRUNS record @@ -1145,7 +1153,7 @@ void XclExpChText::SetRotation( sal_uInt16 nRotation ) ::insert_value( maData.mnFlags, XclTools::GetXclOrientFromRot( nRotation ), 8, 3 ); } -void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget ) +void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget, const String* pSubTitle ) { switch( nTarget ) { @@ -1167,6 +1175,14 @@ void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget // string sequence mxSrcLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_TITLE ) ); sal_uInt16 nFontIdx = mxSrcLink->ConvertStringSequence( xTitle->getText() ); + if (pSubTitle) + { + // append subtitle as the 2nd line of the title. + String aSubTitle = String::CreateFromAscii("\n"); + aSubTitle.Append(*pSubTitle); + mxSrcLink->AppendString(aSubTitle); + } + ConvertFontBase( GetChRoot(), nFontIdx ); // rotation @@ -1375,14 +1391,15 @@ void XclExpChText::WriteBody( XclExpStream& rStrm ) namespace { /** Creates and returns an Excel text object from the passed title. */ -XclExpChTextRef lclCreateTitle( const XclExpChRoot& rRoot, Reference< XTitled > xTitled, sal_uInt16 nTarget ) +XclExpChTextRef lclCreateTitle( const XclExpChRoot& rRoot, Reference< XTitled > xTitled, sal_uInt16 nTarget, + const String* pSubTitle = NULL ) { Reference< XTitle > xTitle; if( xTitled.is() ) xTitle = xTitled->getTitleObject(); XclExpChTextRef xText( new XclExpChText( rRoot ) ); - xText->ConvertTitle( xTitle, nTarget ); + xText->ConvertTitle( xTitle, nTarget, pSubTitle ); /* Do not delete the CHTEXT group for the main title. A missing CHTEXT will be interpreted as auto-generated title showing the series title in charts that contain exactly one data series. */ @@ -3124,6 +3141,23 @@ void XclExpChAxesSet::WriteBody( XclExpStream& rStrm ) // The chart object =========================================================== +static void lcl_getChartSubTitle(const Reference& xChartDoc, + String& rSubTitle) +{ + Reference< ::com::sun::star::chart::XChartDocument > xChartDoc1(xChartDoc, UNO_QUERY); + if (!xChartDoc1.is()) + return; + + Reference< XPropertySet > xProp(xChartDoc1->getSubTitle(), UNO_QUERY); + if (!xProp.is()) + return; + + OUString aTitle; + Any any = xProp->getPropertyValue( OUString::createFromAscii("String") ); + if (any >>= aTitle) + rSubTitle = aTitle; +} + XclExpChChart::XclExpChChart( const XclExpRoot& rRoot, Reference< XChartDocument > xChartDoc, const Rectangle& rChartRect ) : XclExpChGroupBase( XclExpChRoot( rRoot, *this ), EXC_CHFRBLOCK_TYPE_CHART, EXC_ID_CHCHART, 16 ) @@ -3161,7 +3195,10 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot, // chart title Reference< XTitled > xTitled( xChartDoc, UNO_QUERY ); - mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE ); + String aSubTitle; + lcl_getChartSubTitle(xChartDoc, aSubTitle); + mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE, + aSubTitle.Len() ? &aSubTitle : NULL ); // diagrams (axes sets) sal_uInt16 nFreeGroupIdx = mxPrimAxesSet->Convert( xDiagram, 0 ); diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx index 5bb75e029210..8e81ae8278f6 100644 --- a/sc/source/filter/inc/xechart.hxx +++ b/sc/source/filter/inc/xechart.hxx @@ -418,6 +418,8 @@ public: /** Converts the number format from the passed property set. */ void ConvertNumFmt( const ScfPropertySet& rPropSet, bool bPercent ); + void AppendString( const String& rStr ); + /** Returns true, if this source link contains explicit string data. */ inline bool HasString() const { return mxString.is() && !mxString->IsEmpty(); } @@ -529,7 +531,7 @@ public: virtual void SetRotation( sal_uInt16 nRotation ); /** Converts all text settings of the passed title text object. */ - void ConvertTitle( XTitleRef xTitle, sal_uInt16 nTarget ); + void ConvertTitle( XTitleRef xTitle, sal_uInt16 nTarget, const String* pSubTitle = NULL ); /** Converts all text settings of the passed legend. */ void ConvertLegend( const ScfPropertySet& rPropSet ); /** Converts all settings of the passed data point caption text object. */ -- cgit From cd52a0ae7cb4e08ba9e15ad7ef23fcccaa25bec6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:43:57 +0200 Subject: calc-external-defined-names-enable.diff: Enable external defined names Enable external defined name import on xls documents. --- sc/source/core/tool/compiler.cxx | 2 +- sc/source/filter/excel/excform8.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 828c9ae64c7d..07b9f8a2a8f3 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2987,7 +2987,7 @@ bool ScCompiler::IsExternalNamedRange( const String& rSymbol ) * spec first. Until then don't pretend to support external names that * wouldn't survive a save and reload cycle, return false instead. */ -#if 0 +#if 1 if (!pConv) return false; diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index 3b07bf28b4e8..c444de3c8eeb 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -636,7 +636,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, * external name reference can be stored in ODF, * which remains to be done for #i3740#. Until then * create a #NAME? token. */ -#if 0 +#if 1 sal_uInt16 nFileId; if (!GetExternalFileIdFromXti(nXtiIndex, nFileId) || !pExtName->HasFormulaTokens()) { -- cgit From 1363fe2fa6849aa1ac678ea444c58a82d417eb47 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:47:40 +0200 Subject: calc-xls-disable-adjust-row-height.diff: Don't adjust row height on xls load Don't adjust row height on xls load for better layout preservation and faster file load. --- sc/source/filter/excel/read.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index cfe5aedb867e..e035d4d37c8f 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -1212,10 +1212,13 @@ FltError ImportExcel8::Read( void ) GetPivotTableManager().ConvertPivotTables(); pProgress.reset(); - +#if 0 + // Excel documents look much better without this call; better in the + // sense that the row heights are identical to the original heights in + // Excel. if (pD->IsAdjustHeightEnabled()) AdjustRowHeight(); - +#endif PostDocLoad(); pD->CalcAfterLoad(); -- cgit From 9191a63d2cd8f4adad9c70f04cb32be9fdff9649 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 16 Sep 2010 06:58:02 +0200 Subject: docx-export-enable.diff: Enable the .docx export. --- .../source/config/fragments/filters/MS_Word_2007_XML.xcu | 2 +- oox/inc/oox/vml/vmldrawing.hxx | 3 ++- oox/prj/build.lst | 5 +++-- oox/prj/d.lst | 3 +++ oox/source/export/drawingml.cxx | 16 +++++++++------- oox/util/makefile.mk | 11 +++++++++-- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/filter/source/config/fragments/filters/MS_Word_2007_XML.xcu b/filter/source/config/fragments/filters/MS_Word_2007_XML.xcu index d8a37406fe93..c8c9f00ccbd2 100644 --- a/filter/source/config/fragments/filters/MS_Word_2007_XML.xcu +++ b/filter/source/config/fragments/filters/MS_Word_2007_XML.xcu @@ -1,5 +1,5 @@ - IMPORT ALIEN 3RDPARTYFILTER + IMPORT EXPORT ALIEN 3RDPARTYFILTER com.sun.star.comp.Writer.WriterFilter OXML diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx index c2f8432dca6f..ff8751a58f72 100644 --- a/oox/inc/oox/vml/vmldrawing.hxx +++ b/oox/inc/oox/vml/vmldrawing.hxx @@ -30,7 +30,8 @@ #include #include -#include "oox/ole/oleobjecthelper.hxx" + +#include namespace com { namespace sun { namespace star { namespace awt { struct Rectangle; } diff --git a/oox/prj/build.lst b/oox/prj/build.lst index 345c72e00558..14585dfeb84a 100644 --- a/oox/prj/build.lst +++ b/oox/prj/build.lst @@ -1,4 +1,4 @@ -oox oox : vos cppu cppuhelper comphelper sal offapi sax basegfx xmlscript tools vcl BOOST:boost OPENSSL:openssl NULL +oox oox : vos cppu cppuhelper comphelper sal offapi sax basegfx svx xmlscript tools vcl BOOST:boost OPENSSL:openssl NULL oox oox usr1 - all oox_mkout NULL oox oox\prj get - all oox_prj NULL oox oox\source\token nmake - all oox_token NULL @@ -15,4 +15,5 @@ oox oox\source\vml nmake - all oox_vml oox_token NULL oox oox\source\xls nmake - all oox_xls oox_token NULL oox oox\source\dump nmake - all oox_dump oox_token NULL oox oox\source\shape nmake - all oox_shape oox_token NULL -oox oox\util nmake - all oox_util oox_token oox_helper oox_core oox_ole oox_vml oox_drawingml oox_diagram oox_chart oox_table oox_ppt oox_xls oox_dump oox_shape oox_docprop NULL +oox oox\source\export nmake - all oox_export oox_token NULL +oox oox\util nmake - all oox_util oox_token oox_helper oox_core oox_ole oox_vml oox_drawingml oox_diagram oox_chart oox_table oox_ppt oox_xls oox_dump oox_export oox_shape oox_docprop NULL diff --git a/oox/prj/d.lst b/oox/prj/d.lst index f20db064d7b2..70c7c1ea52ef 100644 --- a/oox/prj/d.lst +++ b/oox/prj/d.lst @@ -4,6 +4,7 @@ mkdir: %_DEST%\inc%_EXT%\oox\core mkdir: %_DEST%\inc%_EXT%\oox\drawingml mkdir: %_DEST%\inc%_EXT%\oox\drawingml\chart mkdir: %_DEST%\inc%_EXT%\oox\drawingml\table +mkdir: %_DEST%\inc%_EXT%\oox\export mkdir: %_DEST%\inc%_EXT%\oox\ole mkdir: %_DEST%\inc%_EXT%\oox\vml mkdir: %_DEST%\inc%_EXT%\oox\xls @@ -34,8 +35,10 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls ..\inc\oox\drawingml\chart\chartconverter.hxx %_DEST%\inc%_EXT%\oox\drawingml\chart\chartconverter.hxx ..\inc\oox\drawingml\table\tablestylelist.hxx %_DEST%\inc%_EXT%\oox\drawingml\table\tablestylelist.hxx ..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx +..\inc\oox\ole\oleobjecthelper.hxx %_DEST%\inc%_EXT%\oox\ole\oleobjecthelper.hxx ..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx ..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx +..\inc\oox\export\*.hxx %_DEST%\inc%_EXT%\oox\export\*.hxx dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi" diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 5aeb56883d2d..c3fce8e269fc 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -484,13 +486,13 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic ) case DOCUMENT_XLSX: pComponent = "xl"; break; } - Reference< XOutputStream > xOutStream = mpFB->openOutputStream( OUStringBuffer() - .appendAscii( pComponent ) - .appendAscii( "/media/image" ) - .append( (sal_Int32) mnImageCounter ) - .appendAscii( sExtension ) - .makeStringAndClear(), - sMediaType ); + Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() + .appendAscii( pComponent ) + .appendAscii( "/media/image" ) + .append( (sal_Int32) mnImageCounter ) + .appendAscii( sExtension ) + .makeStringAndClear(), + sMediaType ); xOutStream->writeBytes( Sequence< sal_Int8 >( (const sal_Int8*) aData, nDataSize ) ); xOutStream->closeOutput(); diff --git a/oox/util/makefile.mk b/oox/util/makefile.mk index 8bbf8a3650f2..deb8dbb6a0e7 100644 --- a/oox/util/makefile.mk +++ b/oox/util/makefile.mk @@ -53,7 +53,8 @@ LIB1FILES= \ $(SLB)$/table.lib\ $(SLB)$/shape.lib\ $(SLB)$/dump.lib\ - $(SLB)$/docprop.lib + $(SLB)$/docprop.lib\ + $(SLB)$/export.lib # --- Shared-Library ----------------------------------------------- @@ -69,7 +70,13 @@ SHL1STDLIBS= \ $(SALLIB) \ $(BASEGFXLIB) \ $(SAXLIB) \ - $(XMLSCRIPTLIB) + $(XMLSCRIPTLIB) \ + $(VCLLIB) \ + $(GOODIESLIB) \ + $(SVTOOLLIB) \ + $(SVXCORELIB) \ + $(SVXMSFILTERLIB) \ + $(TOOLSLIB) # link openssl, copied this bit from ucb/source/ucp/webdav/makefile.mk .IF "$(GUI)"=="WNT" -- cgit From 5a939ba4542f347e0268afa56ad9308c29694f56 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 16 Sep 2010 06:58:03 +0200 Subject: docx-export-enable.diff: Enable the .docx export. --- sw/source/filter/ww8/WW8TableInfo.hxx | 1 + sw/source/filter/ww8/docxattributeoutput.cxx | 14 +++++++------- sw/source/filter/ww8/docxattributeoutput.hxx | 2 ++ sw/source/filter/ww8/docxexport.cxx | 29 +++++++++++++++++++--------- sw/source/filter/ww8/docxexport.hxx | 5 +++-- sw/source/filter/ww8/docxexportfilter.cxx | 4 ++-- sw/source/filter/ww8/docxexportfilter.hxx | 4 ++-- sw/source/filter/ww8/makefile.mk | 4 ++++ sw/source/filter/ww8/wrtw8sty.cxx | 4 ---- sw/source/filter/ww8/wrtww8.hxx | 4 ---- sw/util/makefile.mk | 2 ++ 11 files changed, 43 insertions(+), 30 deletions(-) diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index b844615fecad..94b966458fe3 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0a6151b98388..a0d67d725087 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -453,7 +453,7 @@ void DocxAttributeOutput::StartField_Impl( FieldInfos& rInfos, sal_Bool bWriteRu if ( rInfos.pField && rInfos.eType == ww::eUNKNOWN ) { // Expand unsupported fields - RunText( rInfos.pField->Expand( ) ); + RunText( rInfos.pField->GetCntnt() ); } else if ( rInfos.eType != ww::eNONE ) // HYPERLINK fields are just commands { @@ -558,7 +558,7 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos ) m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); // Find another way for hyperlinks - RunText( rInfos.pField->Expand( ) ); + RunText( rInfos.pField->GetCntnt() ); m_pSerializer->endElementNS( XML_w, XML_r ); } @@ -1125,7 +1125,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point TableBackgrounds( pTableTextNodeInfoInner ); // Cell prefered width - SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )[ pTableTextNodeInfoInner->getCell() ]; + SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() ); m_pSerializer->singleElementNS( XML_w, XML_tcW, FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( nWidth ) ).getStr( ), FSNS( XML_w, XML_type ), "dxa", @@ -1166,7 +1166,7 @@ void DocxAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t bool bRelBoxSize = false; // Create the SwWriteTable instance to use col spans (and maybe other infos) - GetTablePageSize( pTableTextNodeInfoInner, nPageSize, bRelBoxSize ); + GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize ); const SwTable* pTable = pTableTextNodeInfoInner->getTable( ); const SwFrmFmt *pFmt = pTable->GetFrmFmt( ); @@ -1266,7 +1266,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t bool bRelBoxSize = false; // Create the SwWriteTable instance to use col spans (and maybe other infos) - GetTablePageSize( pTableTextNodeInfoInner, nPageSize, bRelBoxSize ); + GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize ); // Output the table prefered width if ( nPageSize != 0 ) @@ -1318,8 +1318,8 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t // Write the table grid infos m_pSerializer->startElementNS( XML_w, XML_tblGrid, FSEND ); - std::vector gridCols = GetGridCols( pTableTextNodeInfoInner ); - for ( std::vector::const_iterator it = gridCols.begin(); it != gridCols.end(); ++it ) + ww8::GridColsPtr pGridCols = GetGridCols( pTableTextNodeInfoInner ); + for ( ww8::GridCols::const_iterator it = pGridCols->begin(); it != pGridCols->end(); ++it ) m_pSerializer->singleElementNS( XML_w, XML_gridCol, FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( *it ) ).getStr( ), FSEND ); diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 841f39372f97..11e8055055b3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -160,6 +160,8 @@ public: virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + virtual void TableRowEnd( sal_uInt32 nDepth = 1 ); /// Start of the styles table. diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 0962edd65085..41190ac4c034 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -312,7 +312,7 @@ bool DocxExport::DisallowInheritingOutlineNumbering( const SwFmt& rFmt ) } void DocxExport::WriteHeadersFooters( BYTE nHeadFootFlags, - const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt ) + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE /*nBreakCode*/ ) { // headers if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN ) @@ -333,6 +333,10 @@ void DocxExport::WriteHeadersFooters( BYTE nHeadFootFlags, if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST ) WriteHeaderFooter( rFirstPageFmt, false, "first" ); + +#if OSL_DEBUG_LEVEL > 0 + fprintf( stderr, "DocxExport::WriteHeadersFooters() - nBreakCode introduced, but ignored\n" ); +#endif } void DocxExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, BYTE nMode ) @@ -345,6 +349,13 @@ void DocxExport::WriteFormData( const ::sw::mark::IFieldmark& /*rFieldmark*/ ) OSL_TRACE( "TODO DocxExport::WriteFormData()\n" ); } +void DocxExport::WriteHyperlinkData( const ::sw::mark::IFieldmark& /*rFieldmark*/ ) +{ +#if OSL_DEBUG_LEVEL > 0 + fprintf( stderr, "TODO DocxExport::WriteHyperlinkData()\n" ); +#endif +} + void DocxExport::DoComboBox(const rtl::OUString& rName, const rtl::OUString& rHelp, const rtl::OUString& rToolTip, @@ -528,7 +539,7 @@ void DocxExport::InitStyles() S( "styles.xml" ) ); ::sax_fastparser::FSHelperPtr pStylesFS = - m_pFilter->openOutputStreamWithSerializer( S( "word/styles.xml" ), + m_pFilter->openFragmentStreamWithSerializer( S( "word/styles.xml" ), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" ) ); // switch the serializer to redirect the output to word/styles.xml @@ -551,7 +562,7 @@ void DocxExport::WriteFootnotesEndnotes() S( "footnotes.xml" ) ); ::sax_fastparser::FSHelperPtr pFootnotesFS = - m_pFilter->openOutputStreamWithSerializer( S( "word/footnotes.xml" ), + m_pFilter->openFragmentStreamWithSerializer( S( "word/footnotes.xml" ), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" ) ); // switch the serializer to redirect the output to word/footnotes.xml @@ -572,7 +583,7 @@ void DocxExport::WriteFootnotesEndnotes() S( "endnotes.xml" ) ); ::sax_fastparser::FSHelperPtr pEndnotesFS = - m_pFilter->openOutputStreamWithSerializer( S( "word/endnotes.xml" ), + m_pFilter->openFragmentStreamWithSerializer( S( "word/endnotes.xml" ), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml" ) ); // switch the serializer to redirect the output to word/endnotes.xml @@ -595,7 +606,7 @@ void DocxExport::WriteNumbering() S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" ), S( "numbering.xml" ) ); - ::sax_fastparser::FSHelperPtr pNumberingFS = m_pFilter->openOutputStreamWithSerializer( S( "word/numbering.xml" ), + ::sax_fastparser::FSHelperPtr pNumberingFS = m_pFilter->openFragmentStreamWithSerializer( S( "word/numbering.xml" ), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" ) ); // switch the serializer to redirect the output to word/nubering.xml @@ -628,7 +639,7 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char* S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" ), aName ); - pFS = m_pFilter->openOutputStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(), + pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml" ) ); pFS->startElementNS( XML_w, XML_hdr, @@ -643,7 +654,7 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char* S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" ), aName ); - pFS = m_pFilter->openOutputStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(), + pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml" ) ); pFS->startElementNS( XML_w, XML_ftr, @@ -686,7 +697,7 @@ void DocxExport::WriteFonts() S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" ), S( "fontTable.xml" ) ); - ::sax_fastparser::FSHelperPtr pFS = m_pFilter->openOutputStreamWithSerializer( + ::sax_fastparser::FSHelperPtr pFS = m_pFilter->openFragmentStreamWithSerializer( S( "word/fontTable.xml" ), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" ) ); @@ -774,7 +785,7 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur S( "word/document.xml" ) ); // the actual document - m_pDocumentFS = m_pFilter->openOutputStreamWithSerializer( S( "word/document.xml" ), + m_pDocumentFS = m_pFilter->openFragmentStreamWithSerializer( S( "word/document.xml" ), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ) ); // the DrawingML access diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 4bb9070c3c93..4566485fd428 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -113,7 +113,7 @@ public: /// Output the actual headers and footers. virtual void WriteHeadersFooters( BYTE nHeadFootFlags, - const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt ); + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE nBreakCode ); /// Write the field virtual void OutputField( const SwField* pFld, ww::eField eFldType, @@ -121,6 +121,7 @@ public: /// Write the data of the form field virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ); + virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark ); virtual void DoComboBox(const rtl::OUString &rName, const rtl::OUString &rHelp, @@ -154,7 +155,7 @@ protected: virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum ); - virtual void SectionBreaksAndFrames( const SwTxtNode& rNode ) {} + virtual void SectionBreaksAndFrames( const SwTxtNode& /*rNode*/ ) {} /// Get ready for a new section. virtual void PrepareNewPageDesc( const SfxItemSet* pSet, diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index 13715fcd2bbe..c2b329db583e 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -47,7 +47,7 @@ DocxExportFilter::DocxExportFilter( const uno::Reference< lang::XMultiServiceFac bool DocxExportFilter::exportDocument() { - OSL_TRACE(, "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me + OSL_TRACE( "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me // get SwDoc* uno::Reference< uno::XInterface > xIfc( getModel(), uno::UNO_QUERY ); @@ -76,7 +76,7 @@ bool DocxExportFilter::exportDocument() aExport.ExportDocument( true ); // FIXME support exporting selection only } - commit(); + commitStorage(); // delete the pCurPam if ( pCurPam ) diff --git a/sw/source/filter/ww8/docxexportfilter.hxx b/sw/source/filter/ww8/docxexportfilter.hxx index 6565ad26c77c..7bc76986a6c0 100644 --- a/sw/source/filter/ww8/docxexportfilter.hxx +++ b/sw/source/filter/ww8/docxexportfilter.hxx @@ -30,7 +30,7 @@ #include #include -#include +#include #include @@ -45,7 +45,7 @@ public: virtual bool importDocument() { return false; } virtual const ::oox::drawingml::Theme* getCurrentTheme() const { return NULL; } virtual sal_Int32 getSchemeClr( sal_Int32 ) const { return 0; } - virtual const ::oox::vml::DrawingPtr getDrawings() { return ::oox::vml::DrawingPtr(); } + virtual ::oox::vml::Drawing* getVmlDrawing() { return NULL; } virtual ::oox::drawingml::chart::ChartConverter& getChartConverter() { static ::oox::drawingml::chart::ChartConverter aConverter; return aConverter; } virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() { return ::oox::drawingml::table::TableStyleListPtr(); } diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk index b25887e3e2bf..653c36fbef9a 100644 --- a/sw/source/filter/ww8/makefile.mk +++ b/sw/source/filter/ww8/makefile.mk @@ -58,6 +58,7 @@ EXCEPTIONSFILES = \ $(SLO)$/wrtw8num.obj \ $(SLO)$/wrtw8sty.obj \ $(SLO)$/wrtww8.obj \ + $(SLO)$/docxexportfilter.obj \ $(SLO)$/ww8atr.obj \ $(SLO)$/ww8par.obj \ $(SLO)$/ww8par6.obj \ @@ -77,6 +78,9 @@ SLOFILES = \ $(SLO)$/wrtw8sty.obj \ $(SLO)$/wrtww8.obj \ $(SLO)$/wrtww8gr.obj \ + $(SLO)$/docxattributeoutput.obj \ + $(SLO)$/docxexportfilter.obj \ + $(SLO)$/docxexport.obj \ $(SLO)$/ww8atr.obj \ $(SLO)$/ww8graf.obj \ $(SLO)$/ww8graf2.obj \ diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 70d0d043710c..e654330aab57 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -696,7 +696,6 @@ bool wwFont::Write(SvStream *pTableStrm) const return true; } -#ifdef DOCX void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const { // no font embedding, panose id, subsetting, ... implemented @@ -711,7 +710,6 @@ void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const rAttrOutput->EndFont(); } -#endif bool operator<(const wwFont &r1, const wwFont &r2) { @@ -829,7 +827,6 @@ void wwFontHelper::WriteFontTable(SvStream *pTableStream, WW8Fib& rFib) } } -#ifdef DOCX void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput ) { ::std::vector aFontList( AsVector() ); @@ -837,7 +834,6 @@ void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput ) ::std::for_each( aFontList.begin(), aFontList.end(), ::std::bind2nd( ::std::mem_fun( &wwFont::WriteDocx ), &rAttrOutput ) ); } -#endif /* */ diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 3c2f0d4d6d13..95deb926619d 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -293,9 +293,7 @@ public: wwFont( const String &rFamilyName, FontPitch ePitch, FontFamily eFamily, rtl_TextEncoding eChrSet, bool bWrtWW8 ); bool Write( SvStream *pTableStram ) const; -#ifdef DOCX void WriteDocx( const DocxAttributeOutput* rAttrOutput ) const; -#endif rtl::OUString GetFamilyName() const { return rtl::OUString( msFamilyNm ); } friend bool operator < (const wwFont &r1, const wwFont &r2); }; @@ -318,9 +316,7 @@ public: USHORT GetId(const SvxFontItem& rFont); USHORT GetId(const wwFont& rFont); void WriteFontTable( SvStream *pTableStream, WW8Fib& pFib ); -#ifdef DOCX void WriteFontTable( const DocxAttributeOutput& rAttrOutput ); -#endif }; class DrawObj diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk index ce1419b34065..61b4a3ed5e1d 100644 --- a/sw/util/makefile.mk +++ b/sw/util/makefile.mk @@ -315,6 +315,8 @@ DEF4NAME=$(SHL4TARGET) SHL4STDLIBS= \ $(ISWLIB) \ + $(OOXLIB) \ + $(SAXLIB) \ $(SVXCORELIB) \ $(EDITENGLIB) \ $(MSFILTERLIB) \ -- cgit From 4a5b4325d7bd690d14d90bf47ef8483bc7e697f4 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 16 Sep 2010 07:05:19 +0200 Subject: default-ms-filter-convert.diff: Improve MS Import/Export i#8276 --- .../registry/schema/org/openoffice/Office/Common.xcs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 7e02dcec7981..ec18a755edef 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -4245,25 +4245,25 @@ Specifies if convertible MathType OLE objects are converted into Math objects. - false + true Specifies if convertible WinWord OLE objects are converted into Writer objects. - false + true Specifies if convertible Excel OLE objects are converted into Calc objects. - false + true Specifies if convertible PowerPoint OLE objects are converted into Impress objects. - false + true @@ -4280,25 +4280,25 @@ Specifies if embedded Math objects are converted into MathType objects. - false + true Specifies if embedded Writer objects are converted into WinWord objects. - false + true Specifies if embedded Calc objects are converted into Excel objects. - false + true Specifies if embedded Impress objects are converted into PowerPoint objects. - false + true -- cgit From 6f80f95bf3b6d27fc12f995816d1a4b64abb19b2 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Thu, 16 Sep 2010 07:12:28 +0200 Subject: default-openssl-no-idea-alg.diff: Disable the IDEA algorithm in openssl. There is no license fee only for non-commercial use. --- openssl/makefile.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openssl/makefile.mk b/openssl/makefile.mk index 6fabd1ce6f03..9bd5d5054c20 100644 --- a/openssl/makefile.mk +++ b/openssl/makefile.mk @@ -53,7 +53,7 @@ TARFILE_MD5=63ddc5116488985e820075e65fbe6aa4 CONFIGURE_DIR=. CONFIGURE_ACTION=config -CONFIGURE_FLAGS=-I$(SYSBASE)$/usr$/include -L$(SYSBASE)$/usr$/lib shared +CONFIGURE_FLAGS=-I$(SYSBASE)$/usr$/include -L$(SYSBASE)$/usr$/lib shared no-idea BUILD_DIR=. BUILD_ACTION=make CC='$(CC)' @@ -152,7 +152,7 @@ OUT2BIN += out/libeay32.dll #CONFIGURE_ACTION=cmd /c $(PERL:s!\!/!) configure CONFIGURE_ACTION=$(PERL) configure - CONFIGURE_FLAGS=VC-WIN32 + CONFIGURE_FLAGS=VC-WIN32 no-idea BUILD_ACTION=cmd /c "ms$(EMQ)\do_ms.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak OUT2LIB = out32dll$/ssleay32.lib -- cgit From cc69943c868d62805ee3a7cc4c901d4ea7fdcac6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 07:52:45 +0200 Subject: Pushing new files --- sc/source/ui/inc/tpformula.hxx | 96 +++++++++++++ sc/source/ui/optdlg/tpformula.cxx | 288 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 384 insertions(+) create mode 100644 sc/source/ui/inc/tpformula.hxx create mode 100644 sc/source/ui/optdlg/tpformula.cxx diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx new file mode 100644 index 000000000000..623bbb5ce507 --- /dev/null +++ b/sc/source/ui/inc/tpformula.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyrigt 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tpcalc.hxx,v $ + * $Revision: 1.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPFORMULA_HXX +#define SC_TPFORMULA_HXX + +#include +#include +#include +#include +#include + +#include + +class ScDocOptions; +class SfxItemSet; +class Window; + +class ScTpFormulaOptions : public SfxTabPage +{ +public: + static SfxTabPage* Create (Window* pParent, const SfxItemSet& rCoreSet); + +// static USHORT* GetRanges(); + virtual BOOL FillItemSet(SfxItemSet& rCoreSet); + virtual void Reset( const SfxItemSet& rCoreSet ); + virtual int DeactivatePage(SfxItemSet* pSet = NULL); + +private: + explicit ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreSet); + virtual ~ScTpFormulaOptions(); + + void Init(); + void ResetSeparators(); + void OnFocusSeparatorInput(Edit* pEdit); + + bool IsValidSeparator(const ::rtl::OUString& rSep) const; + bool IsValidSeparatorSet() const; + + DECL_LINK( ButtonHdl, PushButton* ); + DECL_LINK( SepModifyHdl, Edit* ); + DECL_LINK( SepEditOnFocusHdl, Edit* ); + +private: + FixedLine maFlFormulaOpt; + FixedText maFtFormulaSyntax; + ListBox maLbFormulaSyntax; + + FixedLine maFlFormulaSeps; + FixedText maFtSepFuncArg; + Edit maEdSepFuncArg; + FixedText maFtSepArrayCol; + Edit maEdSepArrayCol; + FixedText maFtSepArrayRow; + Edit maEdSepArrayRow; + PushButton maBtnSepReset; + + ::std::auto_ptr mpOldOptions; + ::std::auto_ptr mpNewOptions; + + /** Stores old separator value of currently focused separator edit box. + This value is used to revert undesired value change. */ + ::rtl::OUString maOldSepValue; + + sal_Unicode mnDecSep; +}; + + +#endif diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx new file mode 100644 index 000000000000..b6c5722c2c66 --- /dev/null +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -0,0 +1,288 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyrigt 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tpcalc.hxx,v $ + * $Revision: 1.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sc.hxx" + +#undef SC_DLLIMPLEMENTATION + + + +//------------------------------------------------------------------ + +#include "tpformula.hxx" +#include "optdlg.hrc" +#include "scresid.hxx" +#include "formula/grammar.hxx" +#include "docoptio.hxx" +#include "global.hxx" + +#include + +#include +#include + +using ::rtl::OUString; +using ::com::sun::star::lang::Locale; +using ::com::sun::star::i18n::LocaleDataItem; + +ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreAttrs) : + SfxTabPage(pParent, ScResId(RID_SCPAGE_FORMULA), rCoreAttrs), + + maFlFormulaOpt(this, ScResId(FL_FORMULA_OPTIONS)), + maFtFormulaSyntax(this, ScResId(FT_FORMULA_SYNTAX)), + maLbFormulaSyntax(this, ScResId(LB_FORMULA_SYNTAX)), + maFlFormulaSeps(this, ScResId(FL_FORMULA_SEPS)), + maFtSepFuncArg(this, ScResId(FT_FORMULA_SEP_ARG)), + maEdSepFuncArg(this, ScResId(ED_FORMULA_SEP_ARG)), + maFtSepArrayCol(this, ScResId(FT_FORMULA_SEP_ARRAY_C)), + maEdSepArrayCol(this, ScResId(ED_FORMULA_SEP_ARRAY_C)), + maFtSepArrayRow(this, ScResId(FT_FORMULA_SEP_ARRAY_R)), + maEdSepArrayRow(this, ScResId(ED_FORMULA_SEP_ARRAY_R)), + maBtnSepReset(this, ScResId(BTN_FORMULA_SEP_RESET)), + + mpOldOptions(NULL), + mpNewOptions(NULL), + mnDecSep(0) +{ + FreeResource(); + + const ScTpCalcItem& rItem = static_cast( + rCoreAttrs.Get(GetWhich(SID_SCDOCOPTIONS))); + mpOldOptions.reset(new ScDocOptions(rItem.GetDocOptions())); + mpNewOptions.reset(new ScDocOptions(rItem.GetDocOptions())); + + Init(); +} + +ScTpFormulaOptions::~ScTpFormulaOptions() +{ +} + +void ScTpFormulaOptions::Init() +{ + Link aLink = LINK( this, ScTpFormulaOptions, ButtonHdl ); + maBtnSepReset.SetClickHdl(aLink); + + aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl ); + maEdSepFuncArg.SetModifyHdl(aLink); + maEdSepArrayCol.SetModifyHdl(aLink); + maEdSepArrayRow.SetModifyHdl(aLink); + + aLink = LINK( this, ScTpFormulaOptions, SepEditOnFocusHdl ); + maEdSepFuncArg.SetGetFocusHdl(aLink); + maEdSepArrayCol.SetGetFocusHdl(aLink); + maEdSepArrayRow.SetGetFocusHdl(aLink); + + // Get the decimal separator for current locale. + String aSep = mpOldOptions->GetLocaleDataWrapper().getNumDecimalSep(); + mnDecSep = aSep.Len() ? aSep.GetChar(0) : sal_Unicode('.'); +} + +void ScTpFormulaOptions::ResetSeparators() +{ + ScDocOptions aOpt; + maEdSepFuncArg.SetText(aOpt.GetFormulaSepArg()); + maEdSepArrayCol.SetText(aOpt.GetFormulaSepArrayCol()); + maEdSepArrayRow.SetText(aOpt.GetFormulaSepArrayRow()); +} + +void ScTpFormulaOptions::OnFocusSeparatorInput(Edit* pEdit) +{ + if (!pEdit) + return; + + // Make sure the entire text is selected. + xub_StrLen nLen = pEdit->GetText().Len(); + Selection aSel(0, nLen); + pEdit->SetSelection(aSel); + maOldSepValue = pEdit->GetText(); +} + +bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const +{ + if (rSep.getLength() != 1) + // Must be one-character long. + return false; + + if (rSep.compareToAscii("a") >= 0 && rSep.compareToAscii("z") <= 0) + return false; + + if (rSep.compareToAscii("A") >= 0 && rSep.compareToAscii("Z") <= 0) + return false; + + sal_Unicode c = rSep.getStr()[0]; + switch (c) + { + case '+': + case '-': + case '/': + case '*': + case '<': + case '>': + case '[': + case ']': + case '(': + case ')': + case '"': + case '\'': + // Disallowed characters. Anything else we want to disallow ? + return false; + } + + if (c == mnDecSep) + // decimal separator is not allowed. + return false; + + return true; +} + +bool ScTpFormulaOptions::IsValidSeparatorSet() const +{ + // Make sure the column and row separators are different. + String aColStr = maEdSepArrayCol.GetText(); + String aRowStr = maEdSepArrayRow.GetText(); + if (aColStr == aRowStr) + return false; + + return true; +} + +IMPL_LINK( ScTpFormulaOptions, ButtonHdl, PushButton*, pBtn ) +{ + if (pBtn == &maBtnSepReset) + ResetSeparators(); + + return 0; +} + +IMPL_LINK( ScTpFormulaOptions, SepModifyHdl, Edit*, pEdit ) +{ + if (!pEdit) + return 0; + + String aStr = pEdit->GetText(); + if (aStr.Len() > 1) + { + // In case the string is more than one character long, only grab the + // first character. + aStr = aStr.Copy(0, 1); + pEdit->SetText(aStr); + } + + if ((!IsValidSeparator(aStr) || !IsValidSeparatorSet()) && maOldSepValue.getLength()) + // Invalid separator. Restore the old value. + pEdit->SetText(maOldSepValue); + + OnFocusSeparatorInput(pEdit); + return 0; +} + +IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Edit*, pEdit ) +{ + OnFocusSeparatorInput(pEdit); + return 0; +} + +// static +SfxTabPage* ScTpFormulaOptions::Create(Window* pParent, const SfxItemSet& rCoreSet) +{ + return new ScTpFormulaOptions(pParent, rCoreSet); +} + +BOOL ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet) +{ + ::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT; + switch (maLbFormulaSyntax.GetSelectEntryPos()) + { + case 0: + eGram = ::formula::FormulaGrammar::GRAM_NATIVE; + break; + case 1: + eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1; + break; + case 2: + eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1; + break; + } + + mpNewOptions->SetFormulaSyntax(eGram); + + mpNewOptions->SetFormulaSepArg(maEdSepFuncArg.GetText()); + mpNewOptions->SetFormulaSepArrayCol(maEdSepArrayCol.GetText()); + mpNewOptions->SetFormulaSepArrayRow(maEdSepArrayRow.GetText()); + + if (*mpNewOptions != *mpOldOptions) + { + rCoreSet.Put(ScTpCalcItem(GetWhich(SID_SCDOCOPTIONS), *mpNewOptions)); + return true; + } + else + return false; +} + +void ScTpFormulaOptions::Reset(const SfxItemSet& /*rCoreSet*/) +{ + ::formula::FormulaGrammar::Grammar eGram = mpNewOptions->GetFormulaSyntax(); + switch (eGram) + { + case ::formula::FormulaGrammar::GRAM_NATIVE: + maLbFormulaSyntax.SelectEntryPos(0); + break; + case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1: + maLbFormulaSyntax.SelectEntryPos(1); + break; + case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1: + maLbFormulaSyntax.SelectEntryPos(2); + break; + default: + maLbFormulaSyntax.SelectEntryPos(0); + } + + OUString aSep = mpNewOptions->GetFormulaSepArg(); + OUString aSepArrayRow = mpNewOptions->GetFormulaSepArrayRow(); + OUString aSepArrayCol = mpNewOptions->GetFormulaSepArrayCol(); + + if (aSep.getLength() == 1 && aSepArrayRow.getLength() == 1 && aSepArrayCol.getLength() == 1) + { + // Each separator must be one character long. + maEdSepFuncArg.SetText(aSep); + maEdSepArrayCol.SetText(aSepArrayCol); + maEdSepArrayRow.SetText(aSepArrayRow); + } + else + ResetSeparators(); +} + +int ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/) +{ + // What's this method for ? + return KEEP_PAGE; +} -- cgit From 0906c3ead205ccb9d54fac75e1e9d315bffa8c67 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 09:01:06 +0200 Subject: calc-grammar-xls-english-offapi.diff: Support Excel English grammar Support Excel English grammar needed for VBA and (probably) for xlsx filter. --- offapi/com/sun/star/sheet/FormulaLanguage.idl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/offapi/com/sun/star/sheet/FormulaLanguage.idl b/offapi/com/sun/star/sheet/FormulaLanguage.idl index 658273c524ac..f642d87e094d 100644 --- a/offapi/com/sun/star/sheet/FormulaLanguage.idl +++ b/offapi/com/sun/star/sheet/FormulaLanguage.idl @@ -60,6 +60,10 @@ constants FormulaLanguage */ const long NATIVE = 3; + /** Function names and operators as used in the English version of + Excel. + */ + const long XL_ENGLISH = 4; }; //============================================================================= -- cgit From 6964bfe879aa12439ee2a02f4963276f4271e232 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:05:05 +0200 Subject: calc-grammar-xls-english-sc.diff: Support Excel English grammar Support Excel English grammar needed for VBA and (probably) for xlsx filter. --- formula/inc/formula/FormulaCompiler.hxx | 2 ++ formula/inc/formula/grammar.hxx | 12 ++++++++++++ formula/source/core/api/FormulaCompiler.cxx | 21 +++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx index 97b7b980678a..4da7318807a2 100644 --- a/formula/inc/formula/FormulaCompiler.hxx +++ b/formula/inc/formula/FormulaCompiler.hxx @@ -320,6 +320,7 @@ private: void InitSymbolsEnglish() const; /// only SymbolsEnglish, maybe later void InitSymbolsPODF() const; /// only SymbolsPODF, on demand void InitSymbolsODFF() const; /// only SymbolsODFF, on demand + void InitSymbolsEnglishXL() const; /// only SymbolsEnglishXL, on demand void loadSymbols(USHORT _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const; @@ -373,6 +374,7 @@ private: mutable NonConstOpCodeMapPtr mxSymbolsPODF; // ODF 1.1 symbols mutable NonConstOpCodeMapPtr mxSymbolsNative; // native symbols mutable NonConstOpCodeMapPtr mxSymbolsEnglish; // English symbols + mutable NonConstOpCodeMapPtr mxSymbolsEnglishXL; // English Excel symbols (for VBA formula parsing) }; // ============================================================================= } // formula diff --git a/formula/inc/formula/grammar.hxx b/formula/inc/formula/grammar.hxx index 5f8e6be82350..a6f542ac5054 100644 --- a/formula/inc/formula/grammar.hxx +++ b/formula/inc/formula/grammar.hxx @@ -127,6 +127,16 @@ public: GRAM_NATIVE_XL_R1C1 = ::com::sun::star::sheet::FormulaLanguage::NATIVE | ((CONV_XL_R1C1 + kConventionOffset) << kConventionShift), + /// English with Excel A1 reference style. + GRAM_ENGLISH_XL_A1 = ::com::sun::star::sheet::FormulaLanguage::XL_ENGLISH | + ((CONV_XL_A1 + + kConventionOffset) << kConventionShift) | + kEnglishBit, + /// English with Excel R1C1 reference style. + GRAM_ENGLISH_XL_R1C1 = ::com::sun::star::sheet::FormulaLanguage::XL_ENGLISH | + ((CONV_XL_R1C1 + + kConventionOffset) << kConventionShift) | + kEnglishBit, /// Central definition of the default grammar to be used. GRAM_DEFAULT = GRAM_NATIVE_UI, @@ -177,6 +187,8 @@ public: case GRAM_NATIVE_ODF : case GRAM_NATIVE_XL_A1 : case GRAM_NATIVE_XL_R1C1 : + case GRAM_ENGLISH_XL_A1 : + case GRAM_ENGLISH_XL_R1C1: return true; default: return extractFormulaLanguage( eGrammar) == GRAM_EXTERNAL; diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 607700960ca1..2a2832d59f0d 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -568,6 +568,11 @@ FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetOpCodeMap( const sal_Int32 nLa InitSymbolsNative(); xMap = mxSymbolsNative; break; + case FormulaLanguage::XL_ENGLISH: + if (!mxSymbolsEnglishXL) + InitSymbolsEnglishXL(); + xMap = mxSymbolsEnglishXL; + break; default: ; // nothing, NULL map returned } @@ -680,6 +685,22 @@ void FormulaCompiler::InitSymbolsODFF() const loadSymbols(RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF,FormulaGrammar::GRAM_ODFF,s_sSymbol); mxSymbolsODFF = s_sSymbol; } +// ----------------------------------------------------------------------------- +void FormulaCompiler::InitSymbolsEnglishXL() const +{ + static NonConstOpCodeMapPtr s_sSymbol; + if ( !s_sSymbol.get() ) + loadSymbols(RID_STRLIST_FUNCTION_NAMES_ENGLISH,FormulaGrammar::GRAM_ENGLISH,s_sSymbol); + mxSymbolsEnglishXL = s_sSymbol; + + // TODO: For now, just replace the separators to the Excel English + // variants. Later, if we want to properly map Excel functions with Calc + // functions, we'll need to do a little more work here. + mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocSep); + mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocArrayColSep); + mxSymbolsEnglishXL->putOpCode(sal_Unicode(';'), ocArrayRowSep); +} + // ----------------------------------------------------------------------------- void FormulaCompiler::loadSymbols(USHORT _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const { -- cgit From b592eb99d1eaa241fe34d4c9e8f3903ef7b775d1 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:08:52 +0200 Subject: calc-find-replace-empty-cells-sc.diff: Support find and replace empty cells i#49380, n#415352 --- sc/inc/table.hxx | 10 ++ sc/source/core/data/column.cxx | 19 ++- sc/source/core/data/table6.cxx | 269 +++++++++++++++++++++++++++++++++++++++++ sc/source/ui/view/tabvwsha.cxx | 7 +- 4 files changed, 303 insertions(+), 2 deletions(-) diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 18aa7ce82fd5..7f3b0097abbb 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -820,6 +820,16 @@ private: BOOL SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark); BOOL ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark, ScDocument* pUndoDoc); + bool SearchAndReplaceEmptyCells( + const SvxSearchItem& rSearchItem, + SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, + String& rUndoStr, ScDocument* pUndoDoc); + bool SearchRangeForEmptyCell(const ScRange& rRange, + const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + String& rUndoStr, ScDocument* pUndoDoc); + bool SearchRangeForAllEmptyCells(const ScRange& rRange, + const SvxSearchItem& rSearchItem, ScMarkData& rMark, + String& rUndoStr, ScDocument* pUndoDoc); // benutzen globalen SortParam: BOOL IsSorted(SCCOLROW nStart, SCCOLROW nEnd); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 2e2b595137ef..e1f01b75aa0b 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1354,7 +1354,24 @@ void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, USHORT nFlags, BOOL bMarke CloneCell( i, nFlags, *rColumn.pDocument, aDestPos ); if (pNew) - rColumn.Insert(pItems[i].nRow, pNew); + { + // Special case to allow removing of cell instances. A + // string cell with empty content is used to indicate an + // empty cell. + if (pNew->GetCellType() == CELLTYPE_STRING) + { + String aStr; + static_cast(pNew)->GetString(aStr); + if (aStr.Len() == 0) + // A string cell with empty string. Delete the cell itself. + rColumn.Delete(pItems[i].nRow); + else + // non-empty string cell + rColumn.Insert(pItems[i].nRow, pNew); + } + else + rColumn.Insert(pItems[i].nRow, pNew); + } } } } diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 500ac1bb3614..e020390ebf80 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -49,6 +49,8 @@ //-------------------------------------------------------------------------- +using ::com::sun::star::util::SearchOptions; + BOOL lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& rVal ) { // TRUE = more than 1 paragraph @@ -657,6 +659,12 @@ BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, com::sun::star::util::SearchOptions aSearchOptions = rSearchItem.GetSearchOptions(); aSearchOptions.Locale = *ScGlobal::GetLocale(); + if (!aSearchOptions.searchString.getLength()) + { + // Search for empty cells. + return SearchAndReplaceEmptyCells(rSearchItem, rCol, rRow, rMark, rUndoStr, pUndoDoc); + } + // #107259# reflect UseAsianOptions flag in SearchOptions // (use only ignore case and width if asian options are disabled). // This is also done in SvxSearchDialog CommandHdl, but not in API object. @@ -683,8 +691,269 @@ BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, return bFound; } +bool ScTable::SearchAndReplaceEmptyCells( + const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, + String& rUndoStr, ScDocument* pUndoDoc) +{ + SCCOL nColStart, nColEnd; + SCROW nRowStart, nRowEnd; + GetFirstDataPos(nColStart, nRowStart); + GetLastDataPos(nColEnd, nRowEnd); + + ScRangeList aRanges; + aRanges.Append(ScRange(nColStart, nRowStart, nTab, nColEnd, nRowEnd, nTab)); + + if (rSearchItem.GetSelection()) + { + // current selection only. + if (!rMark.IsMarked() && !rMark.IsMultiMarked()) + // There is no selection. Bail out. + return false; + + ScRangeList aMarkedRanges, aNewRanges; + rMark.FillRangeListWithMarks(&aMarkedRanges, true); + for (ScRangePtr p = aMarkedRanges.First(); p; p = aMarkedRanges.Next()) + { + if (p->aStart.Col() > nColEnd || p->aStart.Row() > nRowEnd) + // This range is outside the data area. Skip it. + continue; + + // Shrink the range into data area only. + if (p->aStart.Col() < nColStart) + p->aStart.SetCol(rCol); + if (p->aStart.Row() < nRowStart) + p->aStart.SetRow(rRow); + + if (p->aEnd.Col() > nColEnd) + p->aEnd.SetCol(nColEnd); + if (p->aEnd.Row() > nRowEnd) + p->aEnd.SetRow(nRowEnd); + + aNewRanges.Append(*p); + } + aRanges = aNewRanges; + } + + sal_uInt16 nCommand = rSearchItem.GetCommand(); + if (nCommand == SVX_SEARCHCMD_FIND || nCommand == SVX_SEARCHCMD_REPLACE) + { + if (rSearchItem.GetBackward()) + { + for (ScRangePtr p = aRanges.Last(); p; p = aRanges.Prev()) + { + if (SearchRangeForEmptyCell(*p, rSearchItem, rCol, rRow, rUndoStr, pUndoDoc)) + return true; + } + } + else + { + for (ScRangePtr p = aRanges.First(); p; p = aRanges.Next()) + { + if (SearchRangeForEmptyCell(*p, rSearchItem, rCol, rRow, rUndoStr, pUndoDoc)) + return true; + } + } + } + else if (nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == SVX_SEARCHCMD_REPLACE_ALL) + { + bool bFound = false; + ScMarkData aNewMark(rMark); + aNewMark.ResetMark(); + for (ScRangePtr p = aRanges.First(); p; p = aRanges.Next()) + bFound |= SearchRangeForAllEmptyCells(*p, rSearchItem, aNewMark, rUndoStr, pUndoDoc); + rMark = aNewMark; + return bFound; + } + return false; +} + +bool ScTable::SearchRangeForEmptyCell( + const ScRange& rRange, const SvxSearchItem& rSearchItem, + SCCOL& rCol, SCROW& rRow, String& rUndoStr, ScDocument* /*pUndoDoc*/) +{ + sal_uInt16 nCmd = rSearchItem.GetCommand(); + if (rSearchItem.GetBackward()) + { + // backward search + if (rSearchItem.GetRowDirection()) + { + // row direction. + SCROW nBeginRow = rRange.aEnd.Row() > rRow ? rRow : rRange.aEnd.Row(); + for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) + { + SCCOL nBeginCol = rRange.aEnd.Col(); + if (nRow == rRow && nBeginCol >= rCol) + // always start from one cell before the cursor. + nBeginCol = rCol - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); + + for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol) + { + ScBaseCell* pCell = aCol[nCol].GetCell(nRow); + if (!pCell) + { + // empty cell found. + rCol = nCol; + rRow = nRow; + if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && + rSearchItem.GetReplaceString().Len()) + { + aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); + rUndoStr = String(); + } + return true; + } + } + } + } + else + { + // column direction. + SCCOL nBeginCol = rRange.aEnd.Col() > rCol ? rCol : rRange.aEnd.Col(); + for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol) + { + SCROW nBeginRow = rRange.aEnd.Row(); + if (nCol == rCol && nBeginRow >= rRow) + // always start from one cell before the cursor. + nBeginRow = rRow - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); + for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) + { + ScBaseCell* pCell = aCol[nCol].GetCell(nRow); + if (!pCell) + { + // empty cell found. + rCol = nCol; + rRow = nRow; + if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && + rSearchItem.GetReplaceString().Len()) + { + aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); + rUndoStr = String(); + } + return true; + } + } + } + } + } + else + { + // forward search + if (rSearchItem.GetRowDirection()) + { + // row direction. + SCROW nBeginRow = rRange.aStart.Row() < rRow ? rRow : rRange.aStart.Row(); + for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) + { + SCCOL nBeginCol = rRange.aStart.Col(); + if (nRow == rRow && nBeginCol <= rCol) + // always start from one cell past the cursor. + nBeginCol = rCol + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); + for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol) + { + ScBaseCell* pCell = aCol[nCol].GetCell(nRow); + if (!pCell) + { + // empty cell found. + rCol = nCol; + rRow = nRow; + if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && + rSearchItem.GetReplaceString().Len()) + { + aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); + rUndoStr = String(); + } + return true; + } + } + } + } + else + { + // column direction. + SCCOL nBeginCol = rRange.aStart.Col() < rCol ? rCol : rRange.aStart.Col(); + for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol) + { + SCROW nBeginRow = rRange.aStart.Row(); + if (nCol == rCol && nBeginRow <= rRow) + // always start from one cell past the cursor. + nBeginRow = rRow + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); + for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) + { + ScBaseCell* pCell = aCol[nCol].GetCell(nRow); + if (!pCell) + { + // empty cell found. + rCol = nCol; + rRow = nRow; + if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && + rSearchItem.GetReplaceString().Len()) + { + aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); + rUndoStr = String(); + } + return true; + } + } + } + } + } + return false; +} +bool ScTable::SearchRangeForAllEmptyCells( + const ScRange& rRange, const SvxSearchItem& rSearchItem, ScMarkData& rMark, + String& rUndoStr, ScDocument* pUndoDoc) +{ + bool bFound = false; + bool bReplace = (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL) && + (rSearchItem.GetReplaceString().Len() > 0); + for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol) + { + if (aCol[nCol].IsEmptyData()) + { + // The entire column is empty. Add the whole column and move on. + rMark.SetMultiMarkArea( + ScRange(nCol, rRange.aStart.Row(), nTab, nCol, rRange.aEnd.Row(), nTab)); + bFound = true; + if (bReplace) + { + const String& rNewStr = rSearchItem.GetReplaceString(); + for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) + { + aCol[nCol].Insert(nRow, new ScStringCell(rNewStr)); + if (pUndoDoc) + // TODO: I'm using a string cell with empty content to + // trigger deletion of cell instance on undo. Maybe I + // should create a new cell type for this? + pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String())); + } + rUndoStr = String(); + } + continue; + } + for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) + { + ScBaseCell* pCell = aCol[nCol].GetCell(nRow); + if (!pCell) + { + // empty cell found + rMark.SetMultiMarkArea(ScRange(nCol, nRow, nTab)); + bFound = true; + if (bReplace) + { + aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); + if (pUndoDoc) + // TODO: I'm using a string cell with empty content to + // trigger deletion of cell instance on undo. Maybe I + // should create a new cell type for this? + pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String())); + } + } + } + } + return bFound; +} diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 7734f3e24ff8..465aee218fd1 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -230,8 +230,13 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) break; case SID_SEARCH_ITEM: - rSet.Put( ScGlobal::GetSearchItem() ); + { + SvxSearchItem aItem(ScGlobal::GetSearchItem()); // make a copy. + // Search on current selection if a range is marked. + aItem.SetSelection(rMark.IsMarked()); + rSet.Put(aItem); break; + } case SID_SEARCH_OPTIONS: { -- cgit From 82cf91ed03aefaff15d61692d22438ad848bd771 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:11:25 +0200 Subject: calc-find-replace-empty-cells-svx.diff: Support find and replace empty cells i#49380, n#415352 --- svx/inc/srchdlg.hxx | 2 ++ svx/source/dialog/srchdlg.cxx | 49 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/svx/inc/srchdlg.hxx b/svx/inc/srchdlg.hxx index 29aec84fae24..3a807a694db6 100644 --- a/svx/inc/srchdlg.hxx +++ b/svx/inc/srchdlg.hxx @@ -160,6 +160,8 @@ public: INT32 GetTransliterationFlags() const; + void SetSaveToModule(bool b); + private: FixedText aSearchText; ComboBox aSearchLB; diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 01dc2c0591cc..9b4c454619df 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -659,6 +659,11 @@ INT32 SvxSearchDialog::GetTransliterationFlags() const return nTransliterationFlags; } +void SvxSearchDialog::SetSaveToModule(bool b) +{ + pImpl->bSaveToModule = b; +} + // ----------------------------------------------------------------------- void SvxSearchDialog::ApplyTransliterationFlags_Impl( INT32 nSettings ) @@ -926,9 +931,36 @@ void SvxSearchDialog::CalculateDelta_Impl() // ----------------------------------------------------------------------- +namespace { + +class ToggleSaveToModule +{ +public: + ToggleSaveToModule(SvxSearchDialog& rDialog, bool bValue) : + mrDialog(rDialog), mbValue(bValue) + { + mrDialog.SetSaveToModule(mbValue); + } + + ~ToggleSaveToModule() + { + mrDialog.SetSaveToModule(!mbValue); + } +private: + SvxSearchDialog& mrDialog; + bool mbValue; +}; + +} + void SvxSearchDialog::Init_Impl( int bSearchPattern ) { DBG_ASSERT( pSearchItem, "SearchItem == 0" ); + + // We don't want to save any intermediate state to the module while the + // dialog is being initialized. + ToggleSaveToModule aNoModuleSave(*this, false); + bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER ); pImpl->bMultiLineEdit = FALSE; @@ -1078,10 +1110,8 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) aSimilarityBox.Check( pSearchItem->IsLevenshtein() ); bSet = TRUE; - pImpl->bSaveToModule = FALSE; FlagHdl_Impl( &aSimilarityBox ); FlagHdl_Impl( &aJapOptionsCB ); - pImpl->bSaveToModule = TRUE; FASTBOOL bDisableSearch = FALSE; SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -1609,16 +1639,23 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd ) else bSet = FALSE; + // Calc allows searching for empty cells. + bool bAllowEmptySearch = (pSearchItem->GetAppFlag() == SVX_SEARCHAPP_CALC); + if ( pEd == &aSearchLB || pEd == &aReplaceLB ) { - xub_StrLen nLBTxtLen = aSearchLB.GetText().Len(), nTxtLen; + xub_StrLen nSrchTxtLen = aSearchLB.GetText().Len(); + xub_StrLen nReplTxtLen = 0; + if (bAllowEmptySearch) + nReplTxtLen = aReplaceLB.GetText().Len(); + xub_StrLen nAttrTxtLen = 0; if ( !pImpl->bMultiLineEdit ) - nTxtLen = aSearchAttrText.GetText().Len(); + nAttrTxtLen = aSearchAttrText.GetText().Len(); else - nTxtLen = pImpl->aSearchFormats.GetText().Len(); + nAttrTxtLen = pImpl->aSearchFormats.GetText().Len(); - if ( nLBTxtLen || nTxtLen ) + if (nSrchTxtLen || nReplTxtLen || nAttrTxtLen) { EnableControl_Impl( &aSearchBtn ); EnableControl_Impl( &aReplaceBtn ); -- cgit From f59e350d1733125055f1144f8b3b1b0a46f6d1ca Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:13:57 +0200 Subject: calc-filter-dbf-precision.diff: import/export precision of value cells fix n#479025, i#101045 --- sc/source/core/data/column3.cxx | 14 ++++++++-- sc/source/ui/docshell/docsh8.cxx | 60 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 65e896c7f2c4..29d1da889484 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1968,8 +1968,18 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( if ( nLen ) { if ( nFormat ) - { // more decimals than standard? - sal_uInt16 nPrec = pNumFmt->GetFormatPrecision( nFormat ); + { + const SvNumberformat* pEntry = pNumFmt->GetEntry( nFormat ); + sal_uInt16 nPrec; + if (pEntry) + { + BOOL bThousand, bNegRed; + USHORT nLeading; + pEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrec, nLeading); + } + else + nPrec = pNumFmt->GetFormatPrecision( nFormat ); + if ( nPrec != SvNumberFormatter::UNLIMITED_PRECISION && nPrec > nPrecision ) nPrecision = nPrec; } diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index cb9d625da70c..2b6c6af4beca 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -78,8 +78,16 @@ #include "dbdocutl.hxx" #include "dociter.hxx" #include "globstr.hrc" +#include "svl/zformat.hxx" +#include "svl/intitem.hxx" +#include "patattr.hxx" +#include "scitems.hxx" +#include "docpool.hxx" + +#include using namespace com::sun::star; +using ::std::vector; // ----------------------------------------------------------------------- @@ -246,6 +254,53 @@ BOOL ScDocShell::IsDocument( const INetURLObject& rURL ) // ----------------------------------------------------------------------- +static void lcl_setScalesToColumns(ScDocument& rDoc, const vector& rScales) +{ + SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); + if (!pFormatter) + return; + + SCCOL nColCount = static_cast(rScales.size()); + for (SCCOL i = 0; i < nColCount; ++i) + { + if (rScales[i] < 0) + continue; + + sal_uInt32 nOldFormat; + rDoc.GetNumberFormat(static_cast(i), 0, 0, nOldFormat); + const SvNumberformat* pOldEntry = pFormatter->GetEntry(nOldFormat); + if (!pOldEntry) + continue; + + LanguageType eLang = pOldEntry->GetLanguage(); + BOOL bThousand, bNegRed; + USHORT nPrecision, nLeading; + pOldEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading); + + nPrecision = static_cast(rScales[i]); + String aNewPicture; + pFormatter->GenerateFormat(aNewPicture, nOldFormat, eLang, + bThousand, bNegRed, nPrecision, nLeading); + + sal_uInt32 nNewFormat = pFormatter->GetEntryKey(aNewPicture, eLang); + if (nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND) + { + xub_StrLen nErrPos = 0; + short nNewType = 0; + bool bOk = pFormatter->PutEntry( + aNewPicture, nErrPos, nNewType, nNewFormat, eLang); + + if (!bOk) + continue; + } + + ScPatternAttr aNewAttrs( rDoc.GetPool() ); + SfxItemSet& rSet = aNewAttrs.GetItemSet(); + rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nNewFormat) ); + rDoc.ApplyPatternAreaTab(static_cast(i), 0, static_cast(i), MAXROW, 0, aNewAttrs); + } +} + ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet, BOOL bSimpleColWidth[MAXCOLCOUNT] ) { @@ -327,6 +382,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet, // read column names //! add type descriptions + vector aScales(nColCount, -1); for (i=0; igetColumnLabel( i+1 ); @@ -356,6 +412,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet, nPrec, nScale ) ); aHeader += ','; aHeader += String::CreateFromInt32( nScale ); + aScales[i] = nScale; } break; } @@ -363,6 +420,8 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet, aDocument.SetString( static_cast(i), 0, 0, aHeader ); } + lcl_setScalesToColumns(aDocument, aScales); + SCROW nRow = 1; // 0 is column titles BOOL bEnd = FALSE; while ( !bEnd && xRowSet->next() ) @@ -486,7 +545,6 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell, break; case 'N' : nDbType = sdbc::DataType::DECIMAL; - bTypeDefined = TRUE; break; } if ( bTypeDefined && !nFieldLen && nToken > 2 ) -- cgit From d8bb8c4fb850b9de762567ed7d337972467470d6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:22:36 +0200 Subject: calc-autoinput-case-insensitive-matching.diff: no case matching on autoinput n#472395, i#101046 --- sc/source/ui/app/inputhdl.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 601eefa79c03..60b856247d8e 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2606,15 +2606,9 @@ void ScInputHandler::EnterHandler( BYTE nBlockMode ) } else if (bAutoComplete) // Gross-/Kleinschreibung anpassen { - if (pColumnData) - pColumnData->GetExactMatch( aString ); - - //! effizienter in der Liste suchen (ScUserList, nur einmal ToUpper) - - USHORT nIndex; - ScUserListData* pData = ScGlobal::GetUserList()->GetData(aString); - if ( pData && pData->GetSubIndex( aString, nIndex ) ) - aString = pData->GetSubStr( nIndex ); + // Perform case-matching only when the typed text is partial. + if (pColumnData && aAutoSearch.Len() < aString.Len()) + pColumnData->GetExactMatch(aString); } } -- cgit From fbf28ef12b3087bd1df7b79645685955d60ba911 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:35:22 +0200 Subject: calc-jump-on-formula-ref-sc.diff: Migrated n#464359, i#101018 allow ctrl-[ and ctrl-] to jump to references used in a formula expression. --- sc/inc/cell.hxx | 1 + sc/inc/detfunc.hxx | 7 ++ sc/inc/reftokenhelper.hxx | 3 + sc/inc/sc.hrc | 3 + sc/sdi/cellsh.sdi | 2 + sc/sdi/scalc.sdi | 49 ++++++++++++ sc/source/core/data/cell.cxx | 26 ++++--- sc/source/core/tool/detfunc.cxx | 52 +++++++++++++ sc/source/core/tool/makefile.mk | 1 + sc/source/core/tool/reftokenhelper.cxx | 16 ++++ sc/source/ui/docshell/docfunc.cxx | 39 ++++++++++ sc/source/ui/inc/docfunc.hxx | 6 ++ sc/source/ui/inc/viewfunc.hxx | 4 + sc/source/ui/view/cellsh1.cxx | 7 ++ sc/source/ui/view/gridwin.cxx | 11 +++ sc/source/ui/view/tabvwsh3.cxx | 4 +- sc/source/ui/view/viewfun6.cxx | 137 +++++++++++++++++++++++++++++++++ 17 files changed, 356 insertions(+), 12 deletions(-) diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index fcedbbb06335..b4c5ebb44057 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -549,6 +549,7 @@ private: public: ScDetectiveRefIter( ScFormulaCell* pCell ); BOOL GetNextRef( ScRange& rRange ); + ScToken* GetNextRefToken(); }; // ============================================================================ diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx index 5c57d32af898..fb9d0ac9569e 100644 --- a/sc/inc/detfunc.hxx +++ b/sc/inc/detfunc.hxx @@ -32,6 +32,9 @@ #include #include #include "scdllapi.h" +#include "token.hxx" + +#include class SdrObject; class SdrPage; @@ -43,6 +46,7 @@ class ScDetectiveData; class ScDocument; class ScAddress; class ScRange; +class ScRangeList; #define SC_DET_MAXCIRCLE 1000 @@ -144,6 +148,9 @@ public: BOOL MarkInvalid(BOOL& rOverflow); + void GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector& rRefTokens); + void GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector& rRefTokens); + static void UpdateAllComments( ScDocument& rDoc ); // on all tables void UpdateAllArrowColors(); // on all tables diff --git a/sc/inc/reftokenhelper.hxx b/sc/inc/reftokenhelper.hxx index 86fd36f691fa..5bf6b25d019f 100644 --- a/sc/inc/reftokenhelper.hxx +++ b/sc/inc/reftokenhelper.hxx @@ -75,6 +75,9 @@ public: static void SC_DLLPUBLIC join(::std::vector& rTokens, const ScSharedTokenRef& pToken); static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScSharedTokenRef& pToken); + + static ScSharedTokenRef createRefToken(const ScAddress& rAddr); + static ScSharedTokenRef createRefToken(const ScRange& rRange); }; #endif diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index e08c6dfbd060..be9e9721a26f 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -902,6 +902,9 @@ #define SID_DETECTIVE_REFRESH (DETECTIVE_START+14) #define SID_DETECTIVE_AUTO (DETECTIVE_START+15) +#define SID_DETECTIVE_MARK_PRED (DETECTIVE_START+16) +#define SID_DETECTIVE_MARK_SUCC (DETECTIVE_START+17) + #define DETECTIVE_END (DETECTIVE_START+20) #define SID_API_SLOTS (DETECTIVE_END) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 4c27c656d15c..714314472328 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -112,6 +112,8 @@ interface CellSelection SID_DETECTIVE_ADD_ERR [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_DETECTIVE_INVALID [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_DETECTIVE_REFRESH [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] + SID_DETECTIVE_MARK_PRED [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] + SID_DETECTIVE_MARK_SUCC [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] FID_INS_ROW [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] FID_INS_COLUMN [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] FID_INS_CELLSDOWN [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index e88d3725b8aa..3f28012166f6 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -7852,6 +7852,55 @@ SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR GroupId = GID_FORMAT; ] +//-------------------------------------------------------------------------- +SfxVoidItem MarkPrecedents SID_DETECTIVE_MARK_PRED +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_OPTIONS; +] + +//-------------------------------------------------------------------------- +SfxVoidItem MarkDependents SID_DETECTIVE_MARK_SUCC +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_OPTIONS; +] //-------------------------------------------------------------------------- SfxVoidItem SetTabBgColor FID_TAB_MENU_SET_TAB_BG_COLOR (SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR) diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index aa492630ab0e..d12439bbad4f 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -1998,7 +1998,7 @@ BOOL lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) if ( rRef1.IsColDeleted() || rRef1.IsRowDeleted() || rRef1.IsTabDeleted() || !rRef1.Valid() ) return TRUE; - if ( p->GetType() == svDoubleRef ) + if ( p->GetType() == svDoubleRef || p->GetType() == svExternalDoubleRef ) { ScSingleRefData& rRef2 = p->GetDoubleRef().Ref2; if ( rRef2.IsColDeleted() || rRef2.IsRowDeleted() || rRef2.IsTabDeleted() @@ -2011,7 +2011,20 @@ BOOL lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) BOOL ScDetectiveRefIter::GetNextRef( ScRange& rRange ) { BOOL bRet = FALSE; + ScToken* p = GetNextRefToken(); + if( p ) + { + SingleDoubleRefProvider aProv( *p ); + rRange.aStart.Set( aProv.Ref1.nCol, aProv.Ref1.nRow, aProv.Ref1.nTab ); + rRange.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab ); + bRet = TRUE; + } + return bRet; +} + +ScToken* ScDetectiveRefIter::GetNextRefToken() +{ ScToken* p = static_cast(pCode->GetNextReferenceRPN()); if (p) p->CalcAbsIfRel( aPos ); @@ -2022,16 +2035,7 @@ BOOL ScDetectiveRefIter::GetNextRef( ScRange& rRange ) if (p) p->CalcAbsIfRel( aPos ); } - - if( p ) - { - SingleDoubleRefProvider aProv( *p ); - rRange.aStart.Set( aProv.Ref1.nCol, aProv.Ref1.nRow, aProv.Ref1.nTab ); - rRange.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab ); - bRet = TRUE; - } - - return bRet; + return p; } // ============================================================================ diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index e86bb22646c8..3774cbee7d06 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -77,6 +77,12 @@ #include "attrib.hxx" #include "scmod.hxx" #include "postit.hxx" +#include "rangelst.hxx" +#include "reftokenhelper.hxx" + +#include + +using ::std::vector; //------------------------------------------------------------------------ @@ -1420,6 +1426,52 @@ BOOL ScDetectiveFunc::MarkInvalid(BOOL& rOverflow) return ( bDeleted || nInsCount != 0 ); } +void ScDetectiveFunc::GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + vector& rRefTokens) +{ + ScCellIterator aCellIter(pDoc, nCol1, nRow1, nTab, nCol2, nRow2, nTab); + for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext()) + { + if (pCell->GetCellType() != CELLTYPE_FORMULA) + continue; + + ScFormulaCell* pFCell = static_cast(pCell); + ScDetectiveRefIter aRefIter(pFCell); + for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken()) + { + ScSharedTokenRef pRef(static_cast(p->Clone())); + ScRefTokenHelper::join(rRefTokens, pRef); + } + } +} + +void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + vector& rRefTokens) +{ + vector aSrcRange; + aSrcRange.push_back( + ScRefTokenHelper::createRefToken(ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab))); + + ScCellIterator aCellIter(pDoc, 0, 0, nTab, MAXCOL, MAXROW, nTab); + for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext()) + { + if (pCell->GetCellType() != CELLTYPE_FORMULA) + continue; + + ScFormulaCell* pFCell = static_cast(pCell); + ScDetectiveRefIter aRefIter(pFCell); + for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken()) + { + ScSharedTokenRef pRef(static_cast(p->Clone())); + if (ScRefTokenHelper::intersects(aSrcRange, pRef)) + { + pRef = ScRefTokenHelper::createRefToken(aCellIter.GetPos()); + ScRefTokenHelper::join(rRefTokens, pRef); + } + } + } +} + void ScDetectiveFunc::UpdateAllComments( ScDocument& rDoc ) { // for all caption objects, update attributes and SpecialTextBoxShadow flag diff --git a/sc/source/core/tool/makefile.mk b/sc/source/core/tool/makefile.mk index c0258e6f0575..9c4cac26dd25 100644 --- a/sc/source/core/tool/makefile.mk +++ b/sc/source/core/tool/makefile.mk @@ -121,6 +121,7 @@ EXCEPTIONSFILES= \ $(SLO)$/chartlock.obj \ $(SLO)$/chgtrack.obj \ $(SLO)$/compiler.obj \ + $(SLO)$/detfunc.obj \ $(SLO)$/doubleref.obj \ $(SLO)$/formulaparserpool.obj \ $(SLO)$/interpr1.obj \ diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx index f4976a914c39..660bdffc2cec 100644 --- a/sc/source/core/tool/reftokenhelper.cxx +++ b/sc/source/core/tool/reftokenhelper.cxx @@ -477,3 +477,19 @@ bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const } return true; } + +ScSharedTokenRef ScRefTokenHelper::createRefToken(const ScAddress& rAddr) +{ + ScSingleRefData aRefData; + aRefData.InitAddress(rAddr); + ScSharedTokenRef pRef(new ScSingleRefToken(aRefData)); + return pRef; +} + +ScSharedTokenRef ScRefTokenHelper::createRefToken(const ScRange& rRange) +{ + ScComplexRefData aRefData; + aRefData.InitRange(rRange); + ScSharedTokenRef pRef(new ScDoubleRefToken(aRefData)); + return pRef; +} diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 36b6641d94a6..b6bb1483adfe 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -106,6 +106,7 @@ using namespace com::sun::star; using ::com::sun::star::uno::Sequence; +using ::std::vector; // STATIC DATA ----------------------------------------------------------- @@ -536,6 +537,44 @@ BOOL ScDocFunc::DetectiveRefresh( BOOL bAutomatic ) return bDone; } +static void lcl_collectAllPredOrSuccRanges( + const ScRangeList& rSrcRanges, vector& rRefTokens, ScDocShell& rDocShell, + bool bPred) +{ + ScDocument* pDoc = rDocShell.GetDocument(); + vector aRefTokens; + ScRangeList aSrcRanges(rSrcRanges); + ScRange* p = aSrcRanges.First(); + if (!p) + return; + ScDetectiveFunc aDetFunc(pDoc, p->aStart.Tab()); + ScRangeList aDestRanges; + for (; p; p = aSrcRanges.Next()) + { + if (bPred) + { + aDetFunc.GetAllPreds( + p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), aRefTokens); + } + else + { + aDetFunc.GetAllSuccs( + p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), aRefTokens); + } + } + rRefTokens.swap(aRefTokens); +} + +void ScDocFunc::DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, vector& rRefTokens) +{ + lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, true); +} + +void ScDocFunc::DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, vector& rRefTokens) +{ + lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, false); +} + //------------------------------------------------------------------------ BOOL ScDocFunc::DeleteContents( const ScMarkData& rMark, USHORT nFlags, diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index c92cc082986d..fc2f4b40d9a9 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -32,6 +32,9 @@ #include "global.hxx" #include "formula/grammar.hxx" #include "tabbgcolor.hxx" +#include "token.hxx" + +#include class ScEditEngineDefaulter; class SdrUndoAction; @@ -40,6 +43,7 @@ class ScDocShell; class ScMarkData; class ScPatternAttr; class ScRange; +class ScRangeList; class ScRangeName; class ScBaseCell; class ScTokenArray; @@ -74,6 +78,8 @@ public: BOOL DetectiveMarkInvalid(SCTAB nTab); BOOL DetectiveDelAll(SCTAB nTab); BOOL DetectiveRefresh(BOOL bAutomatic = FALSE); + void DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, ::std::vector& rRefTokens); + void DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, ::std::vector& rRefTokens); BOOL DeleteContents( const ScMarkData& rMark, USHORT nFlags, BOOL bRecord, BOOL bApi ); diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 59da2966cc60..b80595c09f50 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -328,6 +328,8 @@ public: void DetectiveMarkInvalid(); void DetectiveDelAll(); void DetectiveRefresh(); + void DetectiveMarkPred(); + void DetectiveMarkSucc(); void ShowNote( bool bShow = true ); inline void HideNote() { ShowNote( false ); } @@ -361,6 +363,8 @@ private: BOOL TestFormatArea( SCCOL nCol, SCROW nRow, SCTAB nTab, BOOL bAttrChanged ); void DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab, BOOL bAttrChanged, BOOL bAddUndo ); + + void MarkAndJumpToRanges(const ScRangeList& rRanges); }; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 95d86032ef56..84b09b348d0c 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1541,6 +1541,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) rReq.Done(); break; + case SID_DETECTIVE_MARK_PRED: + pTabViewShell->DetectiveMarkPred(); + break; + case SID_DETECTIVE_MARK_SUCC: + pTabViewShell->DetectiveMarkSucc(); + break; + case SID_SPELL_DIALOG: // pTabViewShell->DoSpellingChecker(); { diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 59fbffc43a1e..4e17c7f872ec 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3117,6 +3117,17 @@ void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt) ShowNoteMarker( pViewData->GetCurX(), pViewData->GetCurY(), TRUE ); return; } + if (aCode.GetCode() == KEY_BRACKETLEFT && aCode.GetModifier() == KEY_MOD1) + { + pViewSh->DetectiveMarkPred(); + return; + } + if (aCode.GetCode() == KEY_BRACKETRIGHT && aCode.GetModifier() == KEY_MOD1) + { + pViewSh->DetectiveMarkSucc(); + return; + } + } Window::KeyInput(rKEvt); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index c291d01d71c2..c902f6b3e587 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -403,13 +403,15 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { pViewData->ResetOldCursor(); SetCursor( nCol, nRow ); - AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); rBindings.Invalidate( SID_CURRENTCELL ); rBindings.Update( nSlot ); if (!rReq.IsAPI()) rReq.Done(); } + // align to cursor even if the cursor position hasn't changed, + // because the cursor may be set outside the visible area. + AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); rReq.SetReturnValue( SfxStringItem( SID_CURRENTCELL, aAddress ) ); } diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 6f25af2a0826..f00c0bcde688 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -47,6 +47,13 @@ #include "globstr.hrc" #include "sc.hrc" #include "fusel.hxx" +#include "reftokenhelper.hxx" +#include "externalrefmgr.hxx" + +#include + +using ::rtl::OUStringBuffer; +using ::std::vector; //================================================================== @@ -137,6 +144,136 @@ void ScViewFunc::DetectiveRefresh() RecalcPPT(); } +static void lcl_jumpToRange(const ScRange& rRange, ScViewData* pView, ScDocument* pDoc) +{ + String aAddrText; + rRange.Format(aAddrText, SCR_ABS_3D, pDoc); + SfxStringItem aPosItem(SID_CURRENTCELL, aAddrText); + SfxBoolItem aUnmarkItem(FN_PARAM_1, TRUE); // remove existing selection + pView->GetDispatcher().Execute( + SID_CURRENTCELL, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, + &aPosItem, &aUnmarkItem, 0L); +} + +void ScViewFunc::MarkAndJumpToRanges(const ScRangeList& rRanges) +{ + ScViewData* pView = GetViewData(); + ScDocShell* pDocSh = pView->GetDocShell(); + + ScRangeList aRanges(rRanges); + ScRange* p = aRanges.First(); + ScRangeList aRangesToMark; + ScAddress aCurPos = pView->GetCurPos(); + for (; p; p = aRanges.Next()) + { + // Collect only those ranges that are on the same sheet as the current + // cursor. + + if (p->aStart.Tab() == aCurPos.Tab()) + aRangesToMark.Append(*p); + } + + if (!aRangesToMark.Count()) + return; + + // Jump to the first range of all precedent ranges. + p = aRangesToMark.First(); + lcl_jumpToRange(*p, pView, pDocSh->GetDocument()); + + for (; p; p = aRangesToMark.Next()) + MarkRange(*p, false, true); +} + +void ScViewFunc::DetectiveMarkPred() +{ + ScViewData* pView = GetViewData(); + ScDocShell* pDocSh = pView->GetDocShell(); + ScDocument* pDoc = pDocSh->GetDocument(); + ScMarkData& rMarkData = pView->GetMarkData(); + ScAddress aCurPos = pView->GetCurPos(); + ScRangeList aRanges; + if (rMarkData.IsMarked() || rMarkData.IsMultiMarked()) + rMarkData.FillRangeListWithMarks(&aRanges, false); + else + aRanges.Append(aCurPos); + + vector aRefTokens; + pDocSh->GetDocFunc().DetectiveCollectAllPreds(aRanges, aRefTokens); + + if (aRefTokens.empty()) + // No precedents found. Nothing to do. + return; + + ScSharedTokenRef p = aRefTokens.front(); + if (ScRefTokenHelper::isExternalRef(p)) + { + // This is external. Open the external document if available, and + // jump to the destination. + + sal_uInt16 nFileId = p->GetIndex(); + ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager(); + const String* pPath = pRefMgr->getExternalFileName(nFileId); + + ScRange aRange; + if (pPath && ScRefTokenHelper::getRangeFromToken(aRange, p, true)) + { + const String& rTabName = p->GetString(); + OUStringBuffer aBuf; + aBuf.append(*pPath); + aBuf.append(sal_Unicode('#')); + aBuf.append(rTabName); + aBuf.append(sal_Unicode('.')); + + String aRangeStr; + aRange.Format(aRangeStr, SCA_VALID); + aBuf.append(aRangeStr); + + ScGlobal::OpenURL(aBuf.makeStringAndClear(), String()); + } + return; + } + else + { + ScRange aRange; + ScRefTokenHelper::getRangeFromToken(aRange, p, false); + if (aRange.aStart.Tab() != aCurPos.Tab()) + { + // The first precedent range is on a different sheet. Jump to it + // immediately and forget the rest. + lcl_jumpToRange(aRange, pView, pDoc); + return; + } + } + + ScRangeList aDestRanges; + ScRefTokenHelper::getRangeListFromTokens(aDestRanges, aRefTokens); + MarkAndJumpToRanges(aDestRanges); +} + +void ScViewFunc::DetectiveMarkSucc() +{ + ScViewData* pView = GetViewData(); + ScDocShell* pDocSh = pView->GetDocShell(); + ScMarkData& rMarkData = pView->GetMarkData(); + ScAddress aCurPos = pView->GetCurPos(); + ScRangeList aRanges; + if (rMarkData.IsMarked() || rMarkData.IsMultiMarked()) + rMarkData.FillRangeListWithMarks(&aRanges, false); + else + aRanges.Append(aCurPos); + + vector aRefTokens; + pDocSh->GetDocFunc().DetectiveCollectAllSuccs(aRanges, aRefTokens); + + if (aRefTokens.empty()) + // No dependants found. Nothing to do. + return; + + ScRangeList aDestRanges; + ScRefTokenHelper::getRangeListFromTokens(aDestRanges, aRefTokens); + MarkAndJumpToRanges(aDestRanges); +} + //--------------------------------------------------------------------------- void ScViewFunc::ShowNote( bool bShow ) -- cgit From 4de186f43456baf1de162aefa5f76d76e0817e5e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:37:52 +0200 Subject: calc-jump-on-formula-ref-sfx2.diff: Migrated n#464359, i#101018 allow ctrl-[ and ctrl-] to jump to references used in a formula expression. --- .../data/org/openoffice/Office/UI/CalcCommands.xcu | 10 +++++++++ sfx2/source/appl/appopen.cxx | 25 +++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 073a2bbc5435..0eb50461b97f 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -1608,6 +1608,16 @@ Assign Macro... + + + Mark Precedents + + + + + Mark Dependents + + diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 89bb5f23f1de..f2e441976bd0 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -652,6 +652,29 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) //--------------------------------------------------------------------------- +namespace { + +/** + * Check if a given filter type should open the hyperlinked document + * natively. + * + * @param rFilter filter object + */ +bool lcl_isFilterNativelySupported(const SfxFilter& rFilter) +{ + if (rFilter.IsOwnFormat()) + return true; + + ::rtl::OUString aName = rFilter.GetFilterName(); + if (aName.indexOf(::rtl::OUString::createFromAscii("MS Excel")) == 0) + // We can handle all Excel variants natively. + return true; + + return false; +} + +} + void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { DBG_MEMTEST(); @@ -961,7 +984,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) aTypeName = xTypeDetection->queryTypeByURL( aURL.Main ); SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher(); const SfxFilter* pFilter = rMatcher.GetFilter4EA( aTypeName ); - if ( !pFilter || !( pFilter->IsOwnFormat() )) + if (!pFilter || !lcl_isFilterNativelySupported(*pFilter)) { // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS Reference< XSystemShellExecute > xSystemShellExecute( ::comphelper::getProcessServiceFactory()->createInstance( -- cgit From 5eb37164d91628c0e8ccc56e014fa8b56f5dd946 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:38:08 +0200 Subject: calc-jump-on-formula-ref-vcl.diff: Migrated n#464359, i#101018 allow ctrl-[ and ctrl-] to jump to references used in a formula expression. --- vcl/inc/vcl/keycodes.hxx | 2 ++ vcl/unx/gtk/window/gtkframe.cxx | 2 ++ vcl/unx/source/app/saldisp.cxx | 14 ++++++++++++++ vcl/win/source/app/salinst.cxx | 2 ++ 4 files changed, 20 insertions(+) diff --git a/vcl/inc/vcl/keycodes.hxx b/vcl/inc/vcl/keycodes.hxx index cfd4d11c9a7c..4b306ac4b4ce 100644 --- a/vcl/inc/vcl/keycodes.hxx +++ b/vcl/inc/vcl/keycodes.hxx @@ -155,6 +155,8 @@ #define KEY_DECIMAL ((USHORT)::com::sun::star::awt::Key::DECIMAL) #define KEY_TILDE ((USHORT)::com::sun::star::awt::Key::TILDE) #define KEY_QUOTELEFT ((USHORT)::com::sun::star::awt::Key::QUOTELEFT) +#define KEY_BRACKETLEFT ((USHORT)::com::sun::star::awt::Key::BRACKETLEFT) +#define KEY_BRACKETRIGHT ((USHORT)::com::sun::star::awt::Key::BRACKETRIGHT) #define KEY_CODE ((USHORT)0x0FFF) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index e8b55ebfa895..99ac8748af8a 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -211,6 +211,8 @@ static USHORT GetKeyCode( guint keyval ) case GDK_asciitilde: nCode = KEY_TILDE; break; case GDK_leftsinglequotemark: case GDK_quoteleft: nCode = KEY_QUOTELEFT; break; + case GDK_bracketleft: nCode = KEY_BRACKETLEFT; break; + case GDK_bracketright: nCode = KEY_BRACKETRIGHT; break; // some special cases, also see saldisp.cxx // - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000 case 0x1000FF02: // apXK_Copy diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 13a0d1093c8e..f3220c106797 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -1259,6 +1259,12 @@ XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const case KEY_QUOTELEFT: nKeySym = XK_grave; break; + case KEY_BRACKETLEFT: + nKeySym = XK_bracketleft; + break; + case KEY_BRACKETRIGHT: + nKeySym = XK_bracketright; + break; default: nKeySym = 0; @@ -1589,6 +1595,14 @@ USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const nKey = KEY_QUOTELEFT; *pcPrintable = '`'; break; + case XK_bracketleft: + nKey = KEY_BRACKETLEFT; + *pcPrintable = '['; + break; + case XK_bracketright: + nKey = KEY_BRACKETRIGHT; + *pcPrintable = ']'; + break; // case XK_Linefeed: // *pcPrintable = '\n'; // break; diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 97dbb5285cca..ffe55917239b 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -376,6 +376,8 @@ void SalData::initKeyCodeMap() initKey( '=', KEY_EQUAL ); initKey( '~', KEY_TILDE ); initKey( '`', KEY_QUOTELEFT ); + initKey( '[', KEY_BRACKETLEFT ); + initKey( ']', KEY_BRACKETRIGHT ); } // ======================================================================= -- cgit From accdbd10ca669f41cb0812bf702b6430bffb6319 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:38:21 +0200 Subject: calc-jump-on-formula-ref-offapi.diff: Migrated n#464359, i#101018 allow ctrl-[ and ctrl-] to jump to references used in a formula expression. --- offapi/com/sun/star/awt/Key.idl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/offapi/com/sun/star/awt/Key.idl b/offapi/com/sun/star/awt/Key.idl index 5987bc3fbbed..8e1312d543aa 100644 --- a/offapi/com/sun/star/awt/Key.idl +++ b/offapi/com/sun/star/awt/Key.idl @@ -460,6 +460,14 @@ published constants Key //------------------------------------------------------------------------- + const short BRACKETLEFT = 1315; + + //------------------------------------------------------------------------- + + const short BRACKETRIGHT = 1316; + + //------------------------------------------------------------------------- + const short DELETE_TO_END_OF_PARAGRAPH = 1539; //------------------------------------------------------------------------- -- cgit From 24e77af99f74983060de7cb16abe50fb712cb4ad Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:49:55 +0200 Subject: svtools-uninitialized-member-fix.diff: initialize data members for sure --- svl/source/numbers/zforfind.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index bdf150f515d4..72a9d39745b4 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -84,7 +84,9 @@ ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP ) pUpperMonthText( NULL ), pUpperAbbrevMonthText( NULL ), pUpperDayText( NULL ), - pUpperAbbrevDayText( NULL ) + pUpperAbbrevDayText( NULL ), + eScannedType( NUMBERFORMAT_UNDEFINED ), + eSetType( NUMBERFORMAT_UNDEFINED ) { pFormatter = pFormatterP; pNullDate = new Date(30,12,1899); -- cgit From 35c5fca7f6a4584989ecec3972dc7c0a12abeec0 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 10:51:53 +0200 Subject: sc-uninitialized-var-fix.diff: initialize data members for sure --- sc/source/ui/view/gridwin.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4e17c7f872ec..b2fefa1d411a 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -429,6 +429,10 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic bPagebreakDrawn( FALSE ), nPageScript( 0 ), bDragRect( FALSE ), + nDragStartX( -1 ), + nDragStartY( -1 ), + nDragEndX( -1 ), + nDragEndY( -1 ), meDragInsertMode( INS_NONE ), nCurrentPointer( 0 ), bIsInScroll( FALSE ), -- cgit From e8adf8fc4d3d7d519d72d8476817ef89d1c25c08 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:03:28 +0200 Subject: chart-highlight-selection-fix.diff: Migrated n#568016, correctly highlight disjoint ranges in chart mode --- sc/source/ui/view/tabview3.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 5d48f3e60b1f..f24cb4aec913 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -77,6 +77,7 @@ #include "rangeutl.hxx" #include "client.hxx" #include "tabprotection.hxx" +#include "formula/FormulaCompiler.hxx" #include @@ -2188,6 +2189,7 @@ void ScTabView::DoChartSelection( const uno::Sequence< chart2::data::HighlightedRange > & rHilightRanges ) { ClearHighlightRanges(); + const sal_Unicode sep = ::formula::FormulaCompiler::GetNativeSymbol(ocSep).GetChar(0); for( sal_Int32 i=0; iGetDocument(); if( ScRangeStringConverter::GetRangeListFromString( - aRangeList, rHilightRanges[i].RangeRepresentation, pDoc, pDoc->GetAddressConvention(), ';' )) + aRangeList, rHilightRanges[i].RangeRepresentation, pDoc, pDoc->GetAddressConvention(), sep )) { for ( ScRangePtr p = aRangeList.First(); p; p = aRangeList.Next()) { -- cgit From ac3b66057ba677903b6de354317417b267be0fa0 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:09:29 +0200 Subject: calc-selection-fixed-cursor.diff: Migrated n#502717, i#21869, i#97093, when making selection, don't move the cursor position --- sc/inc/document.hxx | 1 + sc/source/core/data/document.cxx | 7 + sc/source/ui/inc/cellsh.hxx | 1 + sc/source/ui/inc/tabview.hxx | 14 +- sc/source/ui/view/cellsh4.cxx | 128 ++++++++++++---- sc/source/ui/view/gridwin.cxx | 15 +- sc/source/ui/view/select.cxx | 5 +- sc/source/ui/view/tabview.cxx | 3 +- sc/source/ui/view/tabview2.cxx | 307 ++++++++++++++++++++++++++++++++++++++- sc/source/ui/view/tabview3.cxx | 107 ++++---------- sc/source/ui/view/tabvwsh3.cxx | 19 ++- sc/source/ui/view/viewdata.cxx | 11 +- 12 files changed, 479 insertions(+), 139 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index cecf424501cf..b643023d3840 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -866,6 +866,7 @@ public: ScRange* pLastRange = NULL, Rectangle* pLastMM = NULL ) const; + void SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const; BOOL IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; BOOL IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index aa1672aecd75..f4e45f738356 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4766,6 +4766,13 @@ BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow, return bChange; } +void ScDocument::SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const +{ + while (IsHorOverlapped(rCol, rRow, nTab)) + --rCol; + while (IsVerOverlapped(rCol, rRow, nTab)) + --rRow; +} BOOL ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx index 563e18d96656..e24f30284ece 100644 --- a/sc/source/ui/inc/cellsh.hxx +++ b/sc/source/ui/inc/cellsh.hxx @@ -34,6 +34,7 @@ #include #include #include "formatsh.hxx" +#include "address.hxx" class SvxClipboardFmtItem; class TransferableDataHelper; diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index a6e99613f2ea..80fb979d539c 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -176,7 +176,6 @@ private: BOOL bInActivatePart; BOOL bInZoomUpdate; BOOL bMoveIsShift; - BOOL bNewStartIfMarking; void Init(); @@ -197,6 +196,10 @@ private: static void SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, BOOL bLayoutRTL ); static long GetScrollBarPos( ScrollBar& rScroll, BOOL bLayoutRTL ); + void GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY); + void GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode); + protected: void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL, const SCROW* pPosY = NULL ); @@ -385,12 +388,7 @@ public: void FindNextUnprot( BOOL bShift, BOOL bInSelection = TRUE ); - void SetNewStartIfMarking(); - - //Added by PengYunQuan for Validity Cell Range Picker void SelectNextTab( short nDir, BOOL bExtendSelection = FALSE ); void ActivateView( BOOL bActivate, BOOL bFirst ); @@ -481,6 +479,10 @@ public: BOOL IsBlockMode() const { return bIsBlockMode; } + void ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode); + void ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY); + void ExpandBlockArea(SCsCOL nMovX, SCsROW nMovY); + void MarkColumns(); void MarkRows(); void MarkDataArea( BOOL bIncludeCursor = TRUE ); diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx index e8419a24c80f..bd4708805a7d 100644 --- a/sc/source/ui/view/cellsh4.cxx +++ b/sc/source/ui/view/cellsh4.cxx @@ -49,6 +49,7 @@ #include "document.hxx" #include "sc.hrc" +#include "vcl/svapp.hxx" //------------------------------------------------------------------ @@ -85,10 +86,56 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq ) { // ADD mode: keep the selection, start a new block when marking with shift again bKeep = TRUE; - pTabViewShell->SetNewStartIfMarking(); } } + if (bSel) + { + switch (nSlotId) + { + case SID_CURSORDOWN: + rReq.SetSlot(SID_CURSORDOWN_SEL); + break; + case SID_CURSORUP: + rReq.SetSlot(SID_CURSORUP_SEL); + break; + case SID_CURSORRIGHT: + rReq.SetSlot(SID_CURSORRIGHT_SEL); + break; + case SID_CURSORLEFT: + rReq.SetSlot(SID_CURSORLEFT_SEL); + break; + case SID_CURSORPAGEDOWN: + rReq.SetSlot(SID_CURSORPAGEDOWN_SEL); + break; + case SID_CURSORPAGEUP: + rReq.SetSlot(SID_CURSORPAGEUP_SEL); + break; + case SID_CURSORPAGERIGHT: + rReq.SetSlot(SID_CURSORPAGERIGHT_SEL); + break; + case SID_CURSORPAGELEFT: + rReq.SetSlot(SID_CURSORPAGELEFT_SEL); + break; + case SID_CURSORBLKDOWN: + rReq.SetSlot(SID_CURSORBLKDOWN_SEL); + break; + case SID_CURSORBLKUP: + rReq.SetSlot(SID_CURSORBLKUP_SEL); + break; + case SID_CURSORBLKRIGHT: + rReq.SetSlot(SID_CURSORBLKRIGHT_SEL); + break; + case SID_CURSORBLKLEFT: + rReq.SetSlot(SID_CURSORBLKLEFT_SEL); + break; + default: + ; + } + ExecuteCursorSel(rReq); + return; + } + SCsCOLROW nRTLSign = 1; if ( pData->GetDocument()->IsLayoutRTL( pData->GetTabNo() ) ) { @@ -169,38 +216,64 @@ void ScCellShell::GetStateCursor( SfxItemSet& /* rSet */ ) void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) { - const SfxItemSet* pReqArgs = rReq.GetArgs(); - USHORT nSlotId = rReq.GetSlot(); - short nRepeat = 1; - - if ( pReqArgs != NULL ) + sal_uInt16 nSlotId = rReq.GetSlot(); + ScTabViewShell* pViewShell = GetViewData()->GetViewShell(); + ScInputHandler* pInputHdl = pViewShell->GetInputHandler(); + pViewShell->HideAllCursors(); + if (pInputHdl && pInputHdl->IsInputMode()) { - const SfxPoolItem* pItem; - if( IS_AVAILABLE( FN_PARAM_1, &pItem ) ) - nRepeat = ((const SfxInt16Item*)pItem)->GetValue(); + // the current cell is in edit mode. Commit the text before moving on. + pViewShell->ExecuteInputDirect(); } - switch ( nSlotId ) + // Horizontal direction depends on whether or not the UI language is RTL. + SCsCOL nMovX = 1; + if (GetViewData()->GetDocument()->IsLayoutRTL(GetViewData()->GetTabNo())) + // mirror horizontal movement for right-to-left mode. + nMovX = -1; + + switch (nSlotId) { - case SID_CURSORDOWN_SEL: rReq.SetSlot( SID_CURSORDOWN ); break; - case SID_CURSORBLKDOWN_SEL: rReq.SetSlot( SID_CURSORBLKDOWN ); break; - case SID_CURSORUP_SEL: rReq.SetSlot( SID_CURSORUP ); break; - case SID_CURSORBLKUP_SEL: rReq.SetSlot( SID_CURSORBLKUP ); break; - case SID_CURSORLEFT_SEL: rReq.SetSlot( SID_CURSORLEFT ); break; - case SID_CURSORBLKLEFT_SEL: rReq.SetSlot( SID_CURSORBLKLEFT ); break; - case SID_CURSORRIGHT_SEL: rReq.SetSlot( SID_CURSORRIGHT ); break; - case SID_CURSORBLKRIGHT_SEL: rReq.SetSlot( SID_CURSORBLKRIGHT ); break; - case SID_CURSORPAGEDOWN_SEL: rReq.SetSlot( SID_CURSORPAGEDOWN ); break; - case SID_CURSORPAGEUP_SEL: rReq.SetSlot( SID_CURSORPAGEUP ); break; - case SID_CURSORPAGERIGHT_SEL: rReq.SetSlot( SID_CURSORPAGERIGHT_ ); break; - case SID_CURSORPAGELEFT_SEL: rReq.SetSlot( SID_CURSORPAGELEFT_ ); break; + case SID_CURSORDOWN_SEL: + pViewShell->ExpandBlock(0, 1, SC_FOLLOW_LINE); + break; + case SID_CURSORUP_SEL: + pViewShell->ExpandBlock(0, -1, SC_FOLLOW_LINE); + break; + case SID_CURSORRIGHT_SEL: + pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE); + break; + case SID_CURSORLEFT_SEL: + pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE); + break; + case SID_CURSORPAGEUP_SEL: + pViewShell->ExpandBlockPage(0, -1); + break; + case SID_CURSORPAGEDOWN_SEL: + pViewShell->ExpandBlockPage(0, 1); + break; + case SID_CURSORPAGERIGHT_SEL: + pViewShell->ExpandBlockPage(nMovX, 0); + break; + case SID_CURSORPAGELEFT_SEL: + pViewShell->ExpandBlockPage(-nMovX, 0); + break; + case SID_CURSORBLKDOWN_SEL: + pViewShell->ExpandBlockArea(0, 1); + break; + case SID_CURSORBLKUP_SEL: + pViewShell->ExpandBlockArea(0, -1); + break; + case SID_CURSORBLKRIGHT_SEL: + pViewShell->ExpandBlockArea(nMovX, 0); + break; + case SID_CURSORBLKLEFT_SEL: + pViewShell->ExpandBlockArea(-nMovX, 0); + break; default: - DBG_ERROR("Unbekannte Message bei ViewShell (CursorSel)"); - return; + ; } - rReq.AppendItem( SfxInt16Item(FN_PARAM_1, nRepeat ) ); - rReq.AppendItem( SfxBoolItem(FN_PARAM_2, TRUE) ); - ExecuteSlot( rReq, GetInterface() ); + pViewShell->ShowAllCursors(); } void ScCellShell::ExecuteMove( SfxRequest& rReq ) @@ -345,7 +418,6 @@ void ScCellShell::ExecutePage( SfxRequest& rReq ) { // ADD mode: keep the selection, start a new block when marking with shift again bKeep = TRUE; - pTabViewShell->SetNewStartIfMarking(); } } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index b2fefa1d411a..03d1a6b9c158 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2228,8 +2228,12 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) } SfxStringItem aPosItem( SID_CURRENTCELL, aAddr ); + // We don't want to align to the cursor position because if the + // cell cursor isn't visible after making selection, it would jump + // back to the origin of the selection where the cell cursor is. + SfxBoolItem aAlignCursorItem( FN_PARAM_2, false ); pDisp->Execute( SID_CURRENTCELL, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, - &aPosItem, (void*)0L ); + &aPosItem, &aAlignCursorItem, (void*)0L ); pViewData->GetView()->InvalidateAttribs(); } @@ -3981,7 +3985,10 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos if ( bDone ) { pView->MarkRange( aDest, FALSE, FALSE ); - pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() ); + + SCCOL nDCol = pViewData->GetCurX() - aSource.aStart.Col(); + SCROW nDRow = pViewData->GetCurY() - aSource.aStart.Row(); + pView->SetCursor( aDest.aStart.Col() + nDCol, aDest.aStart.Row() + nDRow ); } pDocSh->GetUndoManager()->LeaveListAction(); @@ -4089,7 +4096,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos pView->EnterMatrix( aFormula ); pView->MarkRange( aDest, FALSE, FALSE ); - pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() ); + pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() ); } pDocSh->GetUndoManager()->LeaveListAction(); @@ -4123,7 +4130,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos if ( bDone ) { pView->MarkRange( aDest, FALSE, FALSE ); - pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() ); + pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() ); } } diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index b2c9ffdc1395..96b06ec7dfef 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -583,7 +583,10 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol } } if (bStarted) + // If the selection is already started, don't set the cursor. pView->MarkCursor( (SCCOL) nPosX, (SCROW) nPosY, nTab, FALSE, FALSE, TRUE ); + else + pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY ); } else { @@ -619,9 +622,9 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol bStarted = TRUE; } + pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY ); } - pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY ); pViewData->SetRefStart( nPosX, nPosY, nTab ); if (bHideCur) pView->ShowAllCursors(); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 0bc4617a9af4..f6c1e9c9d1b5 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -384,8 +384,7 @@ BOOL lcl_HasRowOutline( const ScViewData& rViewData ) bInUpdateHeader( FALSE ), \ bInActivatePart( FALSE ), \ bInZoomUpdate( FALSE ), \ - bMoveIsShift( FALSE ), \ - bNewStartIfMarking( FALSE ) + bMoveIsShift( FALSE ) ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) : diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 674f6f8ae0ff..3801139462fb 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -59,6 +59,7 @@ #include "waitoff.hxx" #include "globstr.hrc" #include "scmod.hxx" +#include "tabprotection.hxx" #define SC_BLOCKMODE_NONE 0 #define SC_BLOCKMODE_NORMAL 1 @@ -175,16 +176,9 @@ void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, InvertBlockMark( nBlockStartX,nBlockStartY,nBlockEndX,nBlockEndY ); #endif UpdateSelectionOverlay(); - - bNewStartIfMarking = FALSE; // use only once } } -void ScTabView::SetNewStartIfMarking() -{ - bNewStartIfMarking = TRUE; -} - void ScTabView::DoneBlockMode( BOOL bContinue ) // Default FALSE { // Wenn zwischen Tabellen- und Header SelectionEngine gewechselt wird, @@ -411,6 +405,305 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, aHdrFunc.SetAnchorFlag( FALSE ); } +void ScTabView::GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY) +{ + SCCOL nCurX; + SCROW nCurY; + aViewData.GetMoveCursor( nCurX,nCurY ); + + ScSplitPos eWhich = aViewData.GetActivePart(); + ScHSplitPos eWhichX = WhichH( eWhich ); + ScVSplitPos eWhichY = WhichV( eWhich ); + + SCsCOL nPageX; + SCsROW nPageY; + if (nMovX >= 0) + nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, 1, eWhichX )) * nMovX; + else + nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, -1, eWhichX )) * nMovX; + + if (nMovY >= 0) + nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY )) * nMovY; + else + nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY )) * nMovY; + + if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1; + if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1; + + rPageX = nPageX; + rPageY = nPageY; +} + +void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode) +{ + SCCOL nNewX = -1; + SCROW nNewY = -1; + SCCOL nCurX = -1; + SCROW nCurY = -1; + + if (aViewData.IsRefMode()) + { + nNewX = aViewData.GetRefEndX(); + nNewY = aViewData.GetRefEndY(); + } + else if (IsBlockMode()) + { + nNewX = nBlockEndX; + nNewY = nBlockEndY; + } + else + { + nNewX = nCurX = aViewData.GetCurX(); + nNewY = nCurY = aViewData.GetCurY(); + } + + ScDocument* pDoc = aViewData.GetDocument(); + SCTAB nTab = aViewData.GetTabNo(); + + // FindAreaPos kennt nur -1 oder 1 als Richtung + + SCsCOLROW i; + if ( nMovX > 0 ) + for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 1, 0 ); + if ( nMovX < 0 ) + for ( i=0; i<-nMovX; i++ ) + pDoc->FindAreaPos( nNewX, nNewY, nTab, -1, 0 ); + if ( nMovY > 0 ) + for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 0, 1 ); + if ( nMovY < 0 ) + for ( i=0; i<-nMovY; i++ ) + pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, -1 ); + + if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen + { + if (nMovX != 0 && nNewX == MAXCOL) + eMode = SC_FOLLOW_LINE; + if (nMovY != 0 && nNewY == MAXROW) + eMode = SC_FOLLOW_LINE; + } + + if (aViewData.IsRefMode()) + { + rAreaX = nNewX - aViewData.GetRefEndX(); + rAreaY = nNewY - aViewData.GetRefEndY(); + } + else if (IsBlockMode()) + { + rAreaX = nNewX - nBlockEndX; + rAreaY = nNewY - nBlockEndY; + } + else + { + rAreaX = nNewX - nCurX; + rAreaY = nNewY - nCurY; + } + rMode = eMode; +} + +namespace { + +bool lcl_isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked) +{ + bool bCellProtected = pDoc->HasAttrib( + nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_PROTECTED); + + if (bCellProtected && !bSelectLocked) + return false; + + if (!bCellProtected && !bSelectUnlocked) + return false; + + return true; +} + +void lcl_moveCursorByProtRule( + SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCTAB nTab, ScDocument* pDoc) +{ + bool bSelectLocked = true; + bool bSelectUnlocked = true; + ScTableProtection* pTabProtection = pDoc->GetTabProtection(nTab); + if (pTabProtection && pTabProtection->isProtected()) + { + bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); + bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); + } + + if (nMovX > 0) + { + if (rCol < MAXCOL) + { + for (SCCOL i = 0; i < nMovX; ++i) + { + if (!lcl_isCellQualified(pDoc, rCol+1, rRow, nTab, bSelectLocked, bSelectUnlocked)) + break; + ++rCol; + } + } + } + else if (nMovX < 0) + { + if (rCol > 0) + { + nMovX = -nMovX; + for (SCCOL i = 0; i < nMovX; ++i) + { + if (!lcl_isCellQualified(pDoc, rCol-1, rRow, nTab, bSelectLocked, bSelectUnlocked)) + break; + --rCol; + } + } + } + + if (nMovY > 0) + { + if (rRow < MAXROW) + { + for (SCROW i = 0; i < nMovY; ++i) + { + if (!lcl_isCellQualified(pDoc, rCol, rRow+1, nTab, bSelectLocked, bSelectUnlocked)) + break; + ++rRow; + } + } + } + else if (nMovY < 0) + { + if (rRow > 0) + { + nMovY = -nMovY; + for (SCROW i = 0; i < nMovY; ++i) + { + if (!lcl_isCellQualified(pDoc, rCol, rRow-1, nTab, bSelectLocked, bSelectUnlocked)) + break; + --rRow; + } + } + } +} + +} + +void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode) +{ + if (!nMovX && !nMovY) + // Nothing to do. Bail out. + return; + + ScTabViewShell* pViewShell = aViewData.GetViewShell(); + bool bRefInputMode = pViewShell && pViewShell->IsRefInputMode(); + if (bRefInputMode && !aViewData.IsRefMode()) + // initialize formula reference mode if it hasn't already. + InitRefMode(aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo(), SC_REFTYPE_REF); + + ScDocument* pDoc = aViewData.GetDocument(); + + if (aViewData.IsRefMode()) + { + // formula reference mode + + SCCOL nNewX = aViewData.GetRefEndX(); + SCROW nNewY = aViewData.GetRefEndY(); + SCTAB nRefTab = aViewData.GetRefEndZ(); + + bool bSelectLocked = true; + bool bSelectUnlocked = true; + ScTableProtection* pTabProtection = pDoc->GetTabProtection(nRefTab); + if (pTabProtection && pTabProtection->isProtected()) + { + bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); + bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); + } + + lcl_moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, pDoc); + + if (nMovX) + { + SCCOL nTempX = nNewX; + while (pDoc->IsHorOverlapped(nTempX, nNewY, nRefTab)) + { + if (nMovX > 0) + ++nTempX; + else + --nTempX; + } + if (lcl_isCellQualified(pDoc, nTempX, nNewY, nRefTab, bSelectLocked, bSelectUnlocked)) + nNewX = nTempX; + } + + if (nMovY) + { + SCROW nTempY = nNewY; + while (pDoc->IsVerOverlapped(nNewX, nTempY, nRefTab)) + { + if (nMovY > 0) + ++nTempY; + else + --nTempY; + } + if (lcl_isCellQualified(pDoc, nNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked)) + nNewY = nTempY; + } + + pDoc->SkipOverlapped(nNewX, nNewY, nRefTab); + UpdateRef(nNewX, nNewY, nRefTab); + AlignToCursor(nNewX, nNewY, eMode); + } + else + { + // normal selection mode + + SCTAB nTab = aViewData.GetTabNo(); + + if (!IsBlockMode()) + InitBlockMode(aViewData.GetCurX(), aViewData.GetCurY(), nTab, true); + + lcl_moveCursorByProtRule(nBlockEndX, nBlockEndY, nMovX, nMovY, nTab, pDoc); + + if (nBlockEndX < 0) + nBlockEndX = 0; + else if (nBlockEndX > MAXCOL) + nBlockEndX = MAXCOL; + + if (nBlockEndY < 0) + nBlockEndY = 0; + else if (nBlockEndY > MAXROW) + nBlockEndY = MAXROW; + + pDoc->SkipOverlapped(nBlockEndX, nBlockEndY, nTab); + MarkCursor(nBlockEndX, nBlockEndY, nTab, false, false, true); + + // Check if the entire row(s) or column(s) are selected. + ScSplitPos eActive = aViewData.GetActivePart(); + bool bRowSelected = (nBlockStartX == 0 && nBlockEndX == MAXCOL); + bool bColSelected = (nBlockStartY == 0 && nBlockEndY == MAXROW); + SCsCOL nAlignX = bRowSelected ? aViewData.GetPosX(WhichH(eActive)) : nBlockEndX; + SCsROW nAlignY = bColSelected ? aViewData.GetPosY(WhichV(eActive)) : nBlockEndY; + AlignToCursor(nAlignX, nAlignY, eMode); + + SelectionChanged(); + } +} + +void ScTabView::ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY) +{ + SCsCOL nPageX; + SCsROW nPageY; + GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY); + ExpandBlock(nPageX, nPageY, SC_FOLLOW_FIX); +} + +void ScTabView::ExpandBlockArea(SCsCOL nMovX, SCsROW nMovY) +{ + SCsCOL nAreaX; + SCsROW nAreaY; + ScFollowMode eMode; + GetAreaMoveEndPosition(nMovX, nMovY, SC_FOLLOW_JUMP, nAreaX, nAreaY, eMode); + ExpandBlock(nAreaX, nAreaY, eMode); +} + void ScTabView::UpdateSelectionOverlay() { for (USHORT i=0; i<4; i++) diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index f24cb4aec913..33587027c659 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -119,10 +119,7 @@ void ScTabView::ClickCursor( SCCOL nPosX, SCROW nPosY, BOOL bControl ) { ScDocument* pDoc = aViewData.GetDocument(); SCTAB nTab = aViewData.GetTabNo(); - while (pDoc->IsHorOverlapped( nPosX, nPosY, nTab )) //! ViewData !!! - --nPosX; - while (pDoc->IsVerOverlapped( nPosX, nPosY, nTab )) - --nPosY; + pDoc->SkipOverlapped(nPosX, nPosY, nTab); BOOL bRefMode = SC_MOD()->IsFormulaMode(); @@ -901,22 +898,36 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, HideAllCursors(); - if ( bShift && bNewStartIfMarking && IsBlockMode() ) - { - // used for ADD selection mode: start a new block from the cursor position - DoneBlockMode( TRUE ); - InitBlockMode( aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo(), TRUE ); - } - // aktiven Teil umschalten jetzt in AlignToCursor AlignToCursor( nCurX, nCurY, eMode ); //! auf OS/2: SC_FOLLOW_JUMP statt SC_FOLLOW_LINE, um Nachlaufen zu verhindern ??? if (bKeepSel) + { SetCursor( nCurX, nCurY ); // Markierung stehenlassen + + // If the cursor is in existing selection, it's a cursor movement by + // ENTER or TAB. If not, then it's a new selection during ADD + // selection mode. + + const ScMarkData& rMark = aViewData.GetMarkData(); + ScRangeList aSelList; + rMark.FillRangeListWithMarks(&aSelList, false); + if (!aSelList.In(ScRange(nCurX, nCurY, aViewData.GetTabNo()))) + // Cursor not in existing selection. Start a new selection. + DoneBlockMode(true); + } else { + if (!bShift) + { + // Remove all marked data on cursor movement unless the Shift is locked. + ScMarkData aData(aViewData.GetMarkData()); + aData.ResetMark(); + SetMarkData(aData); + } + BOOL bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() ); bMoveIsShift = bShift; pSelEngine->CursorPosChanging( bShift, bControl ); @@ -1060,68 +1071,18 @@ void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, void ScTabView::MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, BOOL bShift, BOOL bKeepSel ) { - SCCOL nCurX; - SCROW nCurY; - aViewData.GetMoveCursor( nCurX,nCurY ); - - ScSplitPos eWhich = aViewData.GetActivePart(); - ScHSplitPos eWhichX = WhichH( eWhich ); - ScVSplitPos eWhichY = WhichV( eWhich ); - SCsCOL nPageX; SCsROW nPageY; - if (nMovX >= 0) - nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, 1, eWhichX )) * nMovX; - else - nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, -1, eWhichX )) * nMovX; - - if (nMovY >= 0) - nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY )) * nMovY; - else - nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY )) * nMovY; - - if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1; - if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1; - + GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY); MoveCursorRel( nPageX, nPageY, eMode, bShift, bKeepSel ); } void ScTabView::MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, BOOL bShift, BOOL bKeepSel ) { - SCCOL nCurX; - SCROW nCurY; - aViewData.GetMoveCursor( nCurX,nCurY ); - SCCOL nNewX = nCurX; - SCROW nNewY = nCurY; - - ScDocument* pDoc = aViewData.GetDocument(); - SCTAB nTab = aViewData.GetTabNo(); - - // FindAreaPos kennt nur -1 oder 1 als Richtung - - SCsCOLROW i; - if ( nMovX > 0 ) - for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 1, 0 ); - if ( nMovX < 0 ) - for ( i=0; i<-nMovX; i++ ) - pDoc->FindAreaPos( nNewX, nNewY, nTab, -1, 0 ); - if ( nMovY > 0 ) - for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 0, 1 ); - if ( nMovY < 0 ) - for ( i=0; i<-nMovY; i++ ) - pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, -1 ); - - if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen - { - if (nMovX != 0 && nNewX == MAXCOL) - eMode = SC_FOLLOW_LINE; - if (nMovY != 0 && nNewY == MAXROW) - eMode = SC_FOLLOW_LINE; - } - - MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY, eMode, bShift, bKeepSel ); + SCsCOL nNewX; + SCsROW nNewY; + GetAreaMoveEndPosition(nMovX, nMovY, eMode, nNewX, nNewY, eMode); + MoveCursorRel(nNewX, nNewY, eMode, bShift, bKeepSel); } void ScTabView::MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, BOOL bShift, BOOL bKeepSel ) @@ -1186,14 +1147,8 @@ void ScTabView::MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode else if (nMovY>0) nNewY=nPosY+nAddY; -// aViewData.ResetOldCursor(); aViewData.SetOldCursor( nNewX,nNewY ); - - while (pDoc->IsHorOverlapped( nNewX, nNewY, nTab )) - --nNewX; - while (pDoc->IsVerOverlapped( nNewX, nNewY, nTab )) - --nNewY; - + pDoc->SkipOverlapped(nNewX, nNewY, nTab); MoveCursorAbs( nNewX, nNewY, eMode, bShift, FALSE, TRUE ); } @@ -1477,11 +1432,7 @@ void ScTabView::MarkRange( const ScRange& rRange, BOOL bSetCursor, BOOL bContinu SCCOL nPosX = rRange.aStart.Col(); SCROW nPosY = rRange.aStart.Row(); ScDocument* pDoc = aViewData.GetDocument(); - - while (pDoc->IsHorOverlapped( nPosX, nPosY, nTab )) //! ViewData !!! - --nPosX; - while (pDoc->IsVerOverlapped( nPosX, nPosY, nTab )) - --nPosY; + pDoc->SkipOverlapped(nPosX, nPosY, nTab); aViewData.ResetOldCursor(); SetCursor( nPosX, nPosY ); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index c902f6b3e587..07284535d63b 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -265,6 +265,10 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) if ( pReqArgs->GetItemState( FN_PARAM_1, TRUE, &pItem ) == SFX_ITEM_SET ) bUnmark = ((const SfxBoolItem*)pItem)->GetValue(); + bool bAlignToCursor = true; + if (pReqArgs->GetItemState(FN_PARAM_2, true, &pItem) == SFX_ITEM_SET) + bAlignToCursor = static_cast(pItem)->GetValue(); + if ( nSlot == SID_JUMPTOMARK ) { // #106586# URL has to be decoded for escaped characters (%20) @@ -385,10 +389,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) // und Cursor setzen // zusammengefasste Zellen beruecksichtigen: - while ( pDoc->IsHorOverlapped( nCol, nRow, nTab ) ) //! ViewData !!! - --nCol; - while ( pDoc->IsVerOverlapped( nCol, nRow, nTab ) ) - --nRow; + pDoc->SkipOverlapped(nCol, nRow, nTab); // Navigator-Aufrufe sind nicht API!!! @@ -409,9 +410,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) if (!rReq.IsAPI()) rReq.Done(); } - // align to cursor even if the cursor position hasn't changed, - // because the cursor may be set outside the visible area. - AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); + + if (bAlignToCursor) + { + // align to cursor even if the cursor position hasn't changed, + // because the cursor may be set outside the visible area. + AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); + } rReq.SetReturnValue( SfxStringItem( SID_CURRENTCELL, aAddress ) ); } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index d662c2e6d018..679838e8138d 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1905,12 +1905,11 @@ BOOL ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich, { //! public Methode um Position anzupassen - BOOL bHOver = FALSE; - while (pDoc->IsHorOverlapped( rPosX, rPosY, nTabNo )) - { --rPosX; bHOver=TRUE; } - BOOL bVOver = FALSE; - while (pDoc->IsVerOverlapped( rPosX, rPosY, nTabNo )) - { --rPosY; bVOver=TRUE; } + SCCOL nOrigX = rPosX; + SCROW nOrigY = rPosY; + pDoc->SkipOverlapped(rPosX, rPosY, nTabNo); + bool bHOver = (nOrigX != rPosX); + bool bVOver = (nOrigY != rPosY); if ( bRepair && ( bHOver || bVOver ) ) { -- cgit From 6d0be7e8be764ab6e88e345d165e0670a72d8f2d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:12:39 +0200 Subject: calc-selection-fixed-cursor-fix.diff: Migrated n#595822, when making selection, don't move the cursor position. --- sc/source/ui/view/gridwin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 03d1a6b9c158..37da53d732d6 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2189,7 +2189,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) if ( rMEvt.IsLeft() && pViewData->GetView()->GetSelEngine()->SelMouseButtonUp( rMEvt ) ) { // rMark.MarkToSimple(); - pViewData->GetView()->UpdateAutoFillMark(); + pViewData->GetView()->SelectionChanged(); SfxDispatcher* pDisp = pViewData->GetViewShell()->GetDispatcher(); BOOL bFormulaMode = pScMod->IsFormulaMode(); -- cgit From 97bea8c3e25d99d499a532290d3bdd006504e1b5 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:21:13 +0200 Subject: calc-cursor-split-view.diff: show cursor in non-active panes n#433834 --- sc/source/ui/view/gridwin.cxx | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 37da53d732d6..e3ab2f453db1 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5264,24 +5264,16 @@ void ScGridWindow::UpdateCursorOverlay() if ( bLayoutRTL ) aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring - BOOL bFix = ( pViewData->GetHSplitMode() == SC_SPLIT_FIX || - pViewData->GetVSplitMode() == SC_SPLIT_FIX ); - if ( pViewData->GetActivePart()==eWhich || bFix ) - { - aScrPos.X() -= 2; - aScrPos.Y() -= 2; - Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) ); - - aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() )); - aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() )); - aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 )); - aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() )); - } - else - { - Rectangle aRect( aScrPos, Size( nSizeXPix - 1, nSizeYPix - 1 ) ); - aPixelRects.push_back( aRect ); - } + // Now, draw the cursor. + + aScrPos.X() -= 2; + aScrPos.Y() -= 2; + Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) ); + + aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() )); + aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() )); + aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 )); + aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() )); } } @@ -5292,7 +5284,10 @@ void ScGridWindow::UpdateCursorOverlay() if(pOverlayManager) { - const Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); + Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); + if (pViewData->GetActivePart() != eWhich) + // non-active pane uses a different color. + aCursorColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor; std::vector< basegfx::B2DRange > aRanges; const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation()); @@ -5441,7 +5436,10 @@ void ScGridWindow::UpdateAutoFillOverlay() if(pOverlayManager) { - const Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); + Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); + if (pViewData->GetActivePart() != eWhich) + // non-active pane uses a different color. + aHandleColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor; std::vector< basegfx::B2DRange > aRanges; const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation()); basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1); -- cgit From b2051877f9059fa428e259bdd474cee99992821e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:27:59 +0200 Subject: calc-autofilter-shrink-selection.diff: Migrated n#514164, shrink selection to data area before setting autofilter. --- sc/source/ui/view/dbfunc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index 3696066a8c5f..041d4b759dab 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -344,7 +344,7 @@ void ScDBFunc::ToggleAutoFilter() ScQueryParam aParam; ScDocument* pDoc = GetViewData()->GetDocument(); - ScDBData* pDBData = GetDBData( FALSE, SC_DB_MAKE, SC_DBSEL_ROW_DOWN ); + ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, false, true); pDBData->SetByRow( TRUE ); //! Undo, vorher abfragen ?? pDBData->GetQueryParam( aParam ); -- cgit From e278e19136f252ef8c0dfe451b7d31417bd65b09 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:32:16 +0200 Subject: calc-html-csv-import-force-text-cell.diff: Migrated n#523414 set cell format to Text when a string format is requested, and don't prepend ' in front of the value. --- sc/inc/column.hxx | 4 +-- sc/inc/document.hxx | 3 ++- sc/inc/stringutil.hxx | 35 ++++++++++++++++++++++++ sc/inc/table.hxx | 4 +-- sc/source/core/data/column3.cxx | 55 +++++++++++++++++++++----------------- sc/source/core/data/document.cxx | 4 +-- sc/source/core/data/table2.cxx | 4 +-- sc/source/core/tool/stringutil.cxx | 9 +++++++ sc/source/filter/rtf/eeimpars.cxx | 13 +++++++-- sc/source/ui/docshell/impex.cxx | 23 +++++++++++++++- 10 files changed, 118 insertions(+), 36 deletions(-) diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 2fa63eb91d74..668d64bb4289 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -66,6 +66,7 @@ struct ScFunctionData; struct ScLineFlags; struct ScMergePatternState; class ScFlatBoolRowSegments; +struct ScSetStringParam; #define COLUMN_DELTA 4 @@ -236,8 +237,7 @@ public: // TRUE = Zahlformat gesetzt BOOL SetString( SCROW nRow, SCTAB nTab, const String& rString, formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO, - SvNumberFormatter* pFormatter = NULL, - bool bDetectNumberFormat = true ); + ScSetStringParam* pParam = NULL ); void SetValue( SCROW nRow, const double& rVal); void SetError( SCROW nRow, const USHORT nError); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index b643023d3840..42928b56160a 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -146,6 +146,7 @@ class ScFormulaParserPool; struct ScClipParam; struct ScClipRangeNameData; class ScRowBreakIterator; +struct ScSetStringParam; namespace com { namespace sun { namespace star { namespace lang { @@ -773,7 +774,7 @@ public: // return TRUE = Zahlformat gesetzt SC_DLLPUBLIC BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, - SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); + ScSetStringParam* pParam = NULL ); SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal ); void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError); diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx index c50c0d8cf156..c6433ebb1d04 100644 --- a/sc/inc/stringutil.hxx +++ b/sc/inc/stringutil.hxx @@ -32,6 +32,41 @@ #define SC_STRINGUTIL_HXX #include "rtl/ustring.hxx" +#include "scdllapi.h" + +class SvNumberFormatter; + +/** + * Store parameters used in the ScDocument::SetString() method. Various + * options for string-setting operation are specified herein. + */ +struct SC_DLLPUBLIC ScSetStringParam +{ + /** + * Stores the pointer to the number formatter instance to be used during + * number format detection. The caller must manage the life cycle of the + * instance. + */ + SvNumberFormatter* mpNumFormatter; + + /** + * When true, we try to detect special number format (dates etc) from the + * input string, when false, we only try to detect a basic decimal number + * format. + */ + bool mbDetectNumberFormat; + + /** + * When true, set the format of the cell to Text when a string cell is + * requested for a number input. We may want to do this during text file + * import (csv, html etc). + */ + bool mbSetTextCellFormat; + + ScSetStringParam(); +}; + +// ============================================================================ class ScStringUtil { diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 7f3b0097abbb..0ddce1f139f4 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -85,7 +85,7 @@ class CollatorWrapper; class ScFlatUInt16RowSegments; class ScFlatBoolRowSegments; class ScFlatBoolColSegments; - +struct ScSetStringParam; class ScTable { @@ -301,7 +301,7 @@ public: void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell); // TRUE = Zahlformat gesetzt BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, - SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); + ScSetStringParam* pParam = NULL ); void SetValue( SCCOL nCol, SCROW nRow, const double& rVal ); void SetError( SCCOL nCol, SCROW nRow, USHORT nError); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 29d1da889484..bf437cf62ccd 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -52,6 +52,7 @@ #include "detfunc.hxx" // fuer Notizen bei DeleteRange #include "postit.hxx" #include "stringutil.hxx" +#include "docpool.hxx" #include @@ -1249,7 +1250,7 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 ) // TRUE = Zahlformat gesetzt BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, formula::FormulaGrammar::AddressConvention eConv, - SvNumberFormatter* pLangFormatter, bool bDetectNumberFormat ) + ScSetStringParam* pParam ) { BOOL bNumFmtSet = FALSE; if (VALIDROW(nRow)) @@ -1258,14 +1259,15 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, BOOL bIsLoading = FALSE; if (rString.Len() > 0) { + ScSetStringParam aParam; + if (pParam) + aParam = *pParam; + double nVal; sal_uInt32 nIndex, nOldIndex = 0; sal_Unicode cFirstChar; - // #i110979# If a different NumberFormatter is passed in (pLangFormatter), - // its formats aren't valid in the document. - // Only use the language / LocaleDataWrapper from pLangFormatter, - // always the document's number formatter for IsNumberFormat. - SvNumberFormatter* pFormatter = pDocument->GetFormatTable(); + if (!aParam.mpNumFormatter) + aParam.mpNumFormatter = pDocument->GetFormatTable(); SfxObjectShell* pDocSh = pDocument->GetDocumentShell(); if ( pDocSh ) bIsLoading = pDocSh->IsLoading(); @@ -1274,7 +1276,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, { nIndex = nOldIndex = GetNumberFormat( nRow ); if ( rString.Len() > 1 - && pFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT ) + && aParam.mpNumFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT ) cFirstChar = rString.GetChar(0); else cFirstChar = 0; // Text @@ -1330,7 +1332,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, } // nIndex fuer IsNumberFormat vorbelegen if ( !bIsText ) - nIndex = nOldIndex = pFormatter->GetStandardIndex(); + nIndex = nOldIndex = aParam.mpNumFormatter->GetStandardIndex(); } do @@ -1338,23 +1340,17 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, if (bIsText) break; - if (bDetectNumberFormat) + if (aParam.mbDetectNumberFormat) { - if ( pLangFormatter ) - { - // for number detection: valid format index for selected language - nIndex = pFormatter->GetStandardIndex( pLangFormatter->GetLanguage() ); - } - - if (!pFormatter->IsNumberFormat(rString, nIndex, nVal)) + if (!aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal)) break; - if ( pLangFormatter ) + if ( aParam.mpNumFormatter ) { // convert back to the original language if a built-in format was detected - const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex ); + const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex ); if ( pOldFormat ) - nIndex = pFormatter->GetFormatForLanguageIfBuiltIn( nIndex, pOldFormat->GetLanguage() ); + nIndex = aParam.mpNumFormatter->GetFormatForLanguageIfBuiltIn( nIndex, pOldFormat->GetLanguage() ); } pNewCell = new ScValueCell( nVal ); @@ -1365,21 +1361,21 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, // Exception: If the new format is boolean, always apply it. BOOL bOverwrite = FALSE; - const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex ); + const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex ); if ( pOldFormat ) { short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED; if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE || nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL ) { - if ( nOldIndex == pFormatter->GetStandardFormat( + if ( nOldIndex == aParam.mpNumFormatter->GetStandardFormat( nOldType, pOldFormat->GetLanguage() ) ) { bOverwrite = TRUE; // default of these types can be overwritten } } } - if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL ) + if ( !bOverwrite && aParam.mpNumFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL ) { bOverwrite = TRUE; // overwrite anything if boolean was detected } @@ -1395,8 +1391,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, else { // Only check if the string is a regular number. - SvNumberFormatter* pLocaleSource = pLangFormatter ? pLangFormatter : pFormatter; - const LocaleDataWrapper* pLocale = pLocaleSource->GetLocaleData(); + const LocaleDataWrapper* pLocale = aParam.mpNumFormatter->GetLocaleData(); if (!pLocale) break; @@ -1418,7 +1413,19 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, while (false); if (!pNewCell) + { + if (aParam.mbSetTextCellFormat && aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal)) + { + // Set the cell format type to Text. + sal_uInt32 nFormat = aParam.mpNumFormatter->GetStandardFormat(NUMBERFORMAT_TEXT); + ScPatternAttr aNewAttrs(pDocument->GetPool()); + SfxItemSet& rSet = aNewAttrs.GetItemSet(); + rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) ); + ApplyPattern(nRow, aNewAttrs); + } + pNewCell = new ScStringCell(rString); + } } } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index f4e45f738356..f9e033ef164c 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2658,10 +2658,10 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, - SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) + ScSetStringParam* pParam ) { if ( ValidTab(nTab) && pTab[nTab] ) - return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter, bDetectNumberFormat ); + return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pParam ); else return FALSE; } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index eee6e6e72bb8..db3298ba374a 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1015,11 +1015,11 @@ void ScTable::PutCell( const ScAddress& rPos, ScBaseCell* pCell ) BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, - SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) + ScSetStringParam* pParam ) { if (ValidColRow(nCol,nRow)) return aCol[nCol].SetString( - nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat ); + nRow, nTabP, rString, pDocument->GetAddressConvention(), pParam ); else return FALSE; } diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx index 28a4bc6755c2..f8be97e22449 100644 --- a/sc/source/core/tool/stringutil.cxx +++ b/sc/source/core/tool/stringutil.cxx @@ -40,6 +40,15 @@ using ::rtl::OUString; using ::rtl::OUStringBuffer; +ScSetStringParam::ScSetStringParam() : + mpNumFormatter(NULL), + mbDetectNumberFormat(true), + mbSetTextCellFormat(false) +{ +} + +// ============================================================================- + bool ScStringUtil::parseSimpleNumber( const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal) { diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 7fb3d16c6c8d..05fdc294fc37 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -66,6 +66,7 @@ #include "drwlayer.hxx" #include "rangenam.hxx" #include "progress.hxx" +#include "stringutil.hxx" #include "globstr.hrc" @@ -329,12 +330,17 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu // Daten eintragen if (bSimple) { + ScSetStringParam aParam; + aParam.mpNumFormatter = pFormatter; + aParam.mbDetectNumberFormat = true; + aParam.mbSetTextCellFormat = true; + if ( aValStr.Len() ) mpDoc->SetValue( nCol, nRow, nTab, fVal ); else if ( !pE->aSel.HasRange() ) { // maybe ALT text of IMG or similar - mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, pFormatter ); + mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, &aParam ); // wenn SelRange komplett leer kann nachfolgender Text im gleichen Absatz liegen! } else @@ -379,7 +385,10 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu if (bNumbersEnglishUS && !bEnUsRecognized) mpDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aStr)); else - mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter, bConvertDate ); + { + aParam.mbDetectNumberFormat = bConvertDate; + mpDoc->SetString( nCol, nRow, nTab, aStr, &aParam ); + } } } else diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index a17279f409a9..981cfa7afc5e 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -82,6 +82,9 @@ class StarBASIC; // ause #include "editutil.hxx" +#include "patattr.hxx" +#include "docpool.hxx" +#include "stringutil.hxx" #include "globstr.hrc" #include @@ -914,6 +917,18 @@ static bool lcl_PutString( if ( nColFormat == SC_COL_TEXT ) { + double fDummy; + sal_uInt32 nIndex; + if (pFormatter->IsNumberFormat(rStr, nIndex, fDummy)) + { + // Set the format of this cell to Text. + sal_uInt32 nFormat = pFormatter->GetStandardFormat(NUMBERFORMAT_TEXT); + ScPatternAttr aNewAttrs(pDoc->GetPool()); + SfxItemSet& rSet = aNewAttrs.GetItemSet(); + rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) ); + pDoc->ApplyPattern(nCol, nRow, nTab, aNewAttrs); + + } pDoc->PutCell( nCol, nRow, nTab, ScBaseCell::CreateTextCell( rStr, pDoc ) ); return bMultiLine; } @@ -1126,7 +1141,13 @@ static bool lcl_PutString( // Standard or date not determined -> SetString / EditCell if( rStr.Search( _LF ) == STRING_NOTFOUND ) - pDoc->SetString( nCol, nRow, nTab, rStr, pFormatter, bDetectNumFormat ); + { + ScSetStringParam aParam; + aParam.mpNumFormatter = pFormatter; + aParam.mbDetectNumberFormat = bDetectNumFormat; + aParam.mbSetTextCellFormat = true; + pDoc->SetString( nCol, nRow, nTab, rStr, &aParam ); + } else { bMultiLine = true; -- cgit From ca1582d4eb83c8b9ab732fc7ea7d7e69400a3cf7 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:43:15 +0200 Subject: calc-enhanced-merge-cells-sc.diff n#213205, i#67243, i#101042 Merging/unmerging of cells on multiple sheets & merge center icon. --- sc/source/ui/docshell/docfunc.cxx | 224 ++++++++++++++++++++++------------ sc/source/ui/inc/cellmergeoption.hxx | 60 +++++++++ sc/source/ui/inc/docfunc.hxx | 12 +- sc/source/ui/inc/undoblk.hxx | 14 ++- sc/source/ui/inc/viewfunc.hxx | 2 +- sc/source/ui/undo/undoblk.cxx | 103 +++++++++------- sc/source/ui/undo/undoblk3.cxx | 107 +++++++++------- sc/source/ui/unoobj/cellsuno.cxx | 9 +- sc/source/ui/view/cellmergeoption.cxx | 74 +++++++++++ sc/source/ui/view/cellsh3.cxx | 4 +- sc/source/ui/view/makefile.mk | 1 + sc/source/ui/view/viewfun2.cxx | 82 ++++++++++++- sc/uiconfig/scalc/menubar/menubar.xml | 8 +- 13 files changed, 518 insertions(+), 182 deletions(-) create mode 100644 sc/source/ui/inc/cellmergeoption.hxx create mode 100644 sc/source/ui/view/cellmergeoption.cxx diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index b6bb1483adfe..425372556678 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -65,6 +65,7 @@ #include "dociter.hxx" #include "autoform.hxx" #include "cell.hxx" +#include "cellmergeoption.hxx" #include "detdata.hxx" #include "detfunc.hxx" #include "docpool.hxx" @@ -103,6 +104,7 @@ #include #include #include +#include using namespace com::sun::star; using ::com::sun::star::uno::Sequence; @@ -1714,7 +1716,11 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, default: break; } - MergeCells(aRange, FALSE, TRUE, TRUE); + ScCellMergeOption aMergeOption( + aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col(), aRange.aEnd.Row() ); + aMergeOption.maTabs.insert(aRange.aStart.Tab()); + MergeCells(aMergeOption, FALSE, TRUE, TRUE); } qIncreaseRange.pop_back(); } @@ -1763,7 +1769,10 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, while( !qIncreaseRange.empty() ) { ScRange aRange = qIncreaseRange.back(); - MergeCells(aRange, FALSE, TRUE, TRUE); + ScCellMergeOption aMergeOption( + aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col(), aRange.aEnd.Row() ); + MergeCells(aMergeOption, FALSE, TRUE, TRUE); qIncreaseRange.pop_back(); } @@ -2201,7 +2210,10 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) ) { - MergeCells( aRange, FALSE, TRUE, TRUE ); + ScCellMergeOption aMergeOption( + aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col(), aRange.aEnd.Row() ); + MergeCells( aMergeOption, FALSE, TRUE, TRUE ); } qDecreaseRange.pop_back(); } @@ -4338,86 +4350,110 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, //------------------------------------------------------------------------ -BOOL ScDocFunc::MergeCells( const ScRange& rRange, BOOL bContents, BOOL bRecord, BOOL bApi ) +BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BOOL bRecord, BOOL bApi ) { + using ::std::set; + ScDocShellModificator aModificator( rDocShell ); + SCCOL nStartCol = rOption.mnStartCol; + SCROW nStartRow = rOption.mnStartRow; + SCCOL nEndCol = rOption.mnEndCol; + SCROW nEndRow = rOption.mnEndRow; + if ((nStartCol == nEndCol && nStartRow == nEndRow) || rOption.maTabs.empty()) + { + // Nothing to do. Bail out quick. + return TRUE; + } + ScDocument* pDoc = rDocShell.GetDocument(); - SCCOL nStartCol = rRange.aStart.Col(); - SCROW nStartRow = rRange.aStart.Row(); - SCCOL nEndCol = rRange.aEnd.Col(); - SCROW nEndRow = rRange.aEnd.Row(); - SCTAB nTab = rRange.aStart.Tab(); + set::const_iterator itrBeg = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end(); + SCTAB nTab1 = *itrBeg, nTab2 = *rOption.maTabs.rbegin(); if (bRecord && !pDoc->IsUndoEnabled()) bRecord = FALSE; - ScEditableTester aTester( pDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow ); - if (!aTester.IsEditable()) + for (set::const_iterator itr = itrBeg; itr != itrEnd; ++itr) { - if (!bApi) - rDocShell.ErrorMessage(aTester.GetMessageId()); - return FALSE; - } + ScEditableTester aTester( pDoc, *itr, nStartCol, nStartRow, nEndCol, nEndRow ); + if (!aTester.IsEditable()) + { + if (!bApi) + rDocShell.ErrorMessage(aTester.GetMessageId()); + return FALSE; + } - if ( nStartCol == nEndCol && nStartRow == nEndRow ) - { - // nichts zu tun - return TRUE; + if ( pDoc->HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr, + HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + { + // "Zusammenfassen nicht verschachteln !" + if (!bApi) + rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0); + return FALSE; + } } - if ( pDoc->HasAttrib( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, - HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + ScDocument* pUndoDoc = NULL; + bool bNeedContentsUndo = false; + for (set::const_iterator itr = itrBeg; itr != itrEnd; ++itr) { - // "Zusammenfassen nicht verschachteln !" - if (!bApi) - rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0); - return FALSE; - } + SCTAB nTab = *itr; + bool bNeedContents = bContents && + ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) || + !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) ); - BOOL bNeedContents = bContents && - ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) || - !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) ); + if (bRecord) + { + // test if the range contains other notes which also implies that we need an undo document + bool bHasNotes = false; + for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() ) + for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() ) + bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0); - ScDocument* pUndoDoc = 0; - if (bRecord) - { - // test if the range contains other notes which also implies that we need an undo document - bool bHasNotes = false; - for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() ) - for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() ) - bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0); + if (bNeedContents || bHasNotes || rOption.mbCenter) + { + if (!pUndoDoc) + { + pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc->InitUndo(pDoc, nTab1, nTab2); + } + // note captions are collected by drawing undo + pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, + IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc ); + } + if( bHasNotes ) + pDoc->BeginDrawUndo(); + } + + if (bNeedContents) + pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); + pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); - if (bNeedContents || bHasNotes) + if (rOption.mbCenter) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); - pUndoDoc->InitUndo( pDoc, nTab, nTab ); - // note captions are collected by drawing undo - pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, - IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc ); + pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) ); + pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) ); } - if( bHasNotes ) - pDoc->BeginDrawUndo(); - } - if (bNeedContents) - pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); - pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); + if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) ) + rDocShell.PostPaint( nStartCol, nStartRow, nTab, + nEndCol, nEndRow, nTab, PAINT_GRID ); + if (bNeedContents || rOption.mbCenter) + { + ScRange aRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab); + pDoc->SetDirty(aRange); + } - if( bRecord ) + bNeedContentsUndo |= bNeedContents; + } + + if (pUndoDoc) { - SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : 0; + SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : NULL; rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoMerge( &rDocShell, - nStartCol, nStartRow, nTab, - nEndCol, nEndRow, nTab, bNeedContents, pUndoDoc, pDrawUndo ) ); + new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, pUndoDoc, pDrawUndo) ); } - if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) ) - rDocShell.PostPaint( nStartCol, nStartRow, nTab, - nEndCol, nEndRow, nTab, PAINT_GRID ); - if (bNeedContents) - pDoc->SetDirty( rRange ); aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -4433,49 +4469,81 @@ BOOL ScDocFunc::MergeCells( const ScRange& rRange, BOOL bContents, BOOL bRecord, BOOL ScDocFunc::UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi ) { - ScDocShellModificator aModificator( rDocShell ); + ScCellMergeOption aOption(rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row()); + SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab(); + for (SCTAB i = nTab1; i <= nTab2; ++i) + aOption.maTabs.insert(i); + + return UnmergeCells(aOption, bRecord, bApi); +} + +bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BOOL bApi ) +{ + using ::std::set; + + if (rOption.maTabs.empty()) + // Nothing to unmerge. + return true; + ScDocShellModificator aModificator( rDocShell ); ScDocument* pDoc = rDocShell.GetDocument(); - SCTAB nTab = rRange.aStart.Tab(); if (bRecord && !pDoc->IsUndoEnabled()) bRecord = FALSE; - if ( pDoc->HasAttrib( rRange, HASATTR_MERGED ) ) + ScDocument* pUndoDoc = NULL; + bool bBeep = false; + for (set::const_iterator itr = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end(); + itr != itrEnd; ++itr) { - ScRange aExtended = rRange; - pDoc->ExtendMerge( aExtended ); + SCTAB nTab = *itr; + ScRange aRange = rOption.getSingleRange(nTab); + if ( !pDoc->HasAttrib(aRange, HASATTR_MERGED) ) + { + bBeep = true; + continue; + } + + ScRange aExtended = aRange; + pDoc->ExtendMerge(aExtended); ScRange aRefresh = aExtended; - pDoc->ExtendOverlapped( aRefresh ); + pDoc->ExtendOverlapped(aRefresh); if (bRecord) { - ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); - pUndoDoc->InitUndo( pDoc, nTab, nTab ); - pDoc->CopyToDocument( aExtended, IDF_ATTRIB, FALSE, pUndoDoc ); - rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoRemoveMerge( &rDocShell, rRange, pUndoDoc ) ); + if (!pUndoDoc) + { + pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc->InitUndo(pDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin()); + } + pDoc->CopyToDocument(aExtended, IDF_ATTRIB, FALSE, pUndoDoc); } const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE ); ScPatternAttr aPattern( pDoc->GetPool() ); aPattern.GetItemSet().Put( rDefAttr ); - pDoc->ApplyPatternAreaTab( rRange.aStart.Col(), rRange.aStart.Row(), - rRange.aEnd.Col(), rRange.aEnd.Row(), nTab, - aPattern ); + pDoc->ApplyPatternAreaTab( aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col(), aRange.aEnd.Row(), nTab, + aPattern ); pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(), - aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab, - SC_MF_HOR | SC_MF_VER ); + aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab, + SC_MF_HOR | SC_MF_VER ); pDoc->ExtendMerge( aRefresh, TRUE, FALSE ); if ( !AdjustRowHeight( aExtended ) ) rDocShell.PostPaint( aExtended, PAINT_GRID ); - aModificator.SetDocumentModified(); } - else if (!bApi) - Sound::Beep(); //! FALSE zurueck??? + if (bBeep && !bApi) + Sound::Beep(); + + if (bRecord) + { + rDocShell.GetUndoManager()->AddUndoAction( + new ScUndoRemoveMerge( &rDocShell, rOption, pUndoDoc ) ); + } + aModificator.SetDocumentModified(); return TRUE; } diff --git a/sc/source/ui/inc/cellmergeoption.hxx b/sc/source/ui/inc/cellmergeoption.hxx new file mode 100644 index 000000000000..37b5b0b3e697 --- /dev/null +++ b/sc/source/ui/inc/cellmergeoption.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 by Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: docfunc.hxx,v $ + * $Revision: 1.18.30.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CELLMERGEOPTION_HXX +#define SC_CELLMERGEOPTION_HXX + +#include "address.hxx" + +#include + +class ScRange; + +struct ScCellMergeOption +{ + ::std::set maTabs; + SCCOL mnStartCol; + SCROW mnStartRow; + SCCOL mnEndCol; + SCROW mnEndRow; + bool mbCenter; + + explicit ScCellMergeOption(); + explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, + bool bCenter = false); + explicit ScCellMergeOption(const ScCellMergeOption& r); + + ScRange getSingleRange(SCTAB nTab) const; + ScRange getFirstSingleRange() const; +}; + + +#endif diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index fc2f4b40d9a9..85fe9ec264ed 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -49,13 +49,14 @@ class ScBaseCell; class ScTokenArray; struct ScTabOpParam; class ScTableProtection; +struct ScCellMergeOption; // --------------------------------------------------------------------------- class ScDocFunc { private: - ScDocShell& rDocShell; + ScDocShell& rDocShell; BOOL AdjustRowHeight( const ScRange& rRange, BOOL bPaint = TRUE ); void CreateOneName( ScRangeName& rList, @@ -131,9 +132,9 @@ public: BOOL SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi ); -//UNUSED2009-05 BOOL SetGrammar( formula::FormulaGrammar::Grammar eGrammar ); +//UNUSED2009-05 BOOL SetGrammar( formula::FormulaGrammar::Grammar eGrammar ); - SC_DLLPUBLIC BOOL SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, + SC_DLLPUBLIC BOOL SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, SCTAB nTab, ScSizeMode eMode, USHORT nSizeTwips, BOOL bRecord, BOOL bApi ); @@ -164,7 +165,7 @@ public: BOOL FillSimple( const ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, BOOL bRecord, BOOL bApi ); BOOL FillSeries( const ScRange& rRange, const ScMarkData* pTabMark, - FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, + FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, double fStart, double fStep, double fMax, BOOL bRecord, BOOL bApi ); // FillAuto: rRange wird von Source-Range auf Dest-Range angepasst @@ -173,9 +174,10 @@ public: BOOL ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, BOOL bApi ); - BOOL MergeCells( const ScRange& rRange, BOOL bContents, + BOOL MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BOOL bRecord, BOOL bApi ); BOOL UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi ); + bool UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BOOL bApi ); BOOL SetNewRangeNames( ScRangeName* pNewRanges, BOOL bApi ); // takes ownership of pNewRanges BOOL ModifyRangeNames( const ScRangeName& rNewRanges, BOOL bApi ); diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index b910baccc766..6b8ed3c3b539 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -31,6 +31,7 @@ #include "markdata.hxx" #include "viewutil.hxx" #include "spellparam.hxx" +#include "cellmergeoption.hxx" #include "cell.hxx" @@ -452,10 +453,8 @@ class ScUndoMerge: public ScSimpleUndo { public: TYPEINFO(); - ScUndoMerge( ScDocShell* pNewDocShell, - SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, - SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, - bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo ); + ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption, + bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo); virtual ~ScUndoMerge(); virtual void Undo(); @@ -466,7 +465,7 @@ public: virtual String GetComment() const; private: - ScRange maRange; + ScCellMergeOption maOption; bool mbMergeContents; // Merge contents in Redo(). ScDocument* mpUndoDoc; // wenn Daten zusammengefasst SdrUndoAction* mpDrawUndo; @@ -947,7 +946,7 @@ class ScUndoRemoveMerge: public ScBlockUndo public: TYPEINFO(); ScUndoRemoveMerge( ScDocShell* pNewDocShell, - const ScRange& rArea, + const ScCellMergeOption& rOption, ScDocument* pNewUndoDoc ); virtual ~ScUndoRemoveMerge(); @@ -959,6 +958,9 @@ public: virtual String GetComment() const; private: + void SetCurTab(); + + ScCellMergeOption maOption; ScDocument* pUndoDoc; }; diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index b80595c09f50..7c594506e521 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -239,7 +239,7 @@ public: BOOL TestMergeCells(); BOOL TestRemoveMerge(); - BOOL MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord = TRUE ); + BOOL MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord = TRUE, BOOL bCenter = FALSE ); BOOL RemoveMerge( BOOL bRecord = TRUE ); void FillSimple( FillDir eDir, BOOL bRecord = TRUE ); diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 3fb2c74a9954..1435dbff6077 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -64,6 +64,7 @@ #include "clipparam.hxx" #include "sc.hrc" +#include // STATIC DATA ----------------------------------------------------------- @@ -2051,8 +2052,9 @@ BOOL __EXPORT ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const // ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell, - const ScRange& rArea, ScDocument* pNewUndoDoc ) : - ScBlockUndo( pNewDocShell, rArea, SC_UNDO_SIMPLE ), + const ScCellMergeOption& rOption, ScDocument* pNewUndoDoc ) : + ScBlockUndo( pNewDocShell, rOption.getFirstSingleRange(), SC_UNDO_SIMPLE ), + maOption(rOption), pUndoDoc( pNewUndoDoc ) { } @@ -2069,66 +2071,78 @@ String __EXPORT ScUndoRemoveMerge::GetComment() const void __EXPORT ScUndoRemoveMerge::Undo() { - BeginUndo(); - - ScDocument* pDoc = pDocShell->GetDocument(); - - ScRange aExtended = aBlockRange; - pUndoDoc->ExtendMerge( aExtended ); + using ::std::set; - pDoc->DeleteAreaTab( aExtended, IDF_ATTRIB ); - pUndoDoc->CopyToDocument( aExtended, IDF_ATTRIB, FALSE, pDoc ); + SetCurTab(); + BeginUndo(); - BOOL bDidPaint = FALSE; ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - if ( pViewShell ) + + ScDocument* pDoc = pDocShell->GetDocument(); + for (set::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end(); + itr != itrEnd; ++itr) { - pViewShell->SetTabNo( aExtended.aStart.Tab() ); - bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() ); + // There is no need to extend merge area because it's already been extended. + ScRange aRange = maOption.getSingleRange(*itr); + pDoc->DeleteAreaTab(aRange, IDF_ATTRIB); + pUndoDoc->CopyToDocument(aRange, IDF_ATTRIB, FALSE, pDoc); + + bool bDidPaint = false; + if ( pViewShell ) + { + pViewShell->SetTabNo(*itr); + bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow); + } + if (!bDidPaint) + ScUndoUtil::PaintMore(pDocShell, aRange); } - if (!bDidPaint) - ScUndoUtil::PaintMore( pDocShell, aExtended ); EndUndo(); } void __EXPORT ScUndoRemoveMerge::Redo() { + using ::std::set; + + SetCurTab(); BeginRedo(); - SCTAB nTab = aBlockRange.aStart.Tab(); ScDocument* pDoc = pDocShell->GetDocument(); - ScRange aExtended = aBlockRange; - pDoc->ExtendMerge( aExtended ); - ScRange aRefresh = aExtended; - pDoc->ExtendOverlapped( aRefresh ); + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + + for (set::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end(); + itr != itrEnd; ++itr) + { + SCTAB nTab = *itr; + // There is no need to extend merge area because it's already been extended. + ScRange aRange = maOption.getSingleRange(nTab); - // ausfuehren + // ausfuehren - const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE ); - ScPatternAttr aPattern( pDoc->GetPool() ); - aPattern.GetItemSet().Put( rDefAttr ); - pDoc->ApplyPatternAreaTab( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(), - aBlockRange.aEnd.Col(), aBlockRange.aEnd.Row(), nTab, - aPattern ); + const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE ); + ScPatternAttr aPattern( pDoc->GetPool() ); + aPattern.GetItemSet().Put( rDefAttr ); + pDoc->ApplyPatternAreaTab( maOption.mnStartCol, maOption.mnStartRow, + maOption.mnEndCol, maOption.mnEndRow, nTab, + aPattern ); - pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(), - aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab, - SC_MF_HOR | SC_MF_VER ); + pDoc->RemoveFlagsTab( maOption.mnStartCol, maOption.mnStartRow, + maOption.mnEndCol, maOption.mnEndRow, nTab, + SC_MF_HOR | SC_MF_VER ); - pDoc->ExtendMerge( aRefresh, TRUE, FALSE ); + pDoc->ExtendMerge(aRange, TRUE, FALSE); - // Paint + // Paint - BOOL bDidPaint = FALSE; - ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - if ( pViewShell ) - { - pViewShell->SetTabNo( aExtended.aStart.Tab() ); - bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() ); + BOOL bDidPaint = FALSE; + if ( pViewShell ) + { + pViewShell->SetTabNo(nTab); + bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow); + } + if (!bDidPaint) + ScUndoUtil::PaintMore(pDocShell, aRange); } - if (!bDidPaint) - ScUndoUtil::PaintMore( pDocShell, aExtended ); EndRedo(); } @@ -2144,6 +2158,13 @@ BOOL __EXPORT ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const return (rTarget.ISA(ScTabViewTarget)); } +void ScUndoRemoveMerge::SetCurTab() +{ + SCTAB nCurTab = pDocShell->GetCurTab(); + aBlockRange.aStart.SetTab(nCurTab); + aBlockRange.aEnd.SetTab(nCurTab); +} + // ----------------------------------------------------------------------- // // nur Umrandung setzen, per ScRangeList (StarOne) diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 4140d85f5051..1579b9ceb5db 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -31,6 +31,7 @@ // INCLUDE ------------------------------------------------------------------- #include "scitems.hxx" +#include #include #include #include @@ -798,14 +799,12 @@ BOOL __EXPORT ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const //---------------------------------------------------------------------------- -ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, - SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, - SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, - bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo ) +ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption, + bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo ) // : ScSimpleUndo( pNewDocShell ), // - maRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), + maOption(rOption), mbMergeContents( bMergeContents ), mpUndoDoc( pUndoDoc ), mpDrawUndo( pDrawUndo ) @@ -834,51 +833,77 @@ String ScUndoMerge::GetComment() const void ScUndoMerge::DoChange( bool bUndo ) const { - ScDocument* pDoc = pDocShell->GetDocument(); + using ::std::set; - ScUndoUtil::MarkSimpleBlock( pDocShell, maRange ); + if (maOption.maTabs.empty()) + // Nothing to do. + return; - if (bUndo) - // remove merge (contents are copied back below from undo document) - pDoc->RemoveMerge( maRange.aStart.Col(), maRange.aStart.Row(), maRange.aStart.Tab() ); - else - // repeat merge, but do not remove note captions (will be done by drawing redo below) -/*!*/ pDoc->DoMerge( maRange.aStart.Tab(), - maRange.aStart.Col(), maRange.aStart.Row(), - maRange.aEnd.Col(), maRange.aEnd.Row(), false ); + ScDocument* pDoc = pDocShell->GetDocument(); + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - // undo -> copy back deleted contents - if (bUndo && mpUndoDoc) - { - pDoc->DeleteAreaTab( maRange, IDF_CONTENTS|IDF_NOCAPTIONS ); - mpUndoDoc->CopyToDocument( maRange, IDF_ALL|IDF_NOCAPTIONS, FALSE, pDoc ); - } + ScRange aCurRange = maOption.getSingleRange(pDocShell->GetCurTab()); + ScUndoUtil::MarkSimpleBlock(pDocShell, aCurRange); - // redo -> merge contents again - else if (!bUndo && mbMergeContents) + for (set::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end(); + itr != itrEnd; ++itr) { -/*!*/ pDoc->DoMergeContents( maRange.aStart.Tab(), - maRange.aStart.Col(), maRange.aStart.Row(), - maRange.aEnd.Col(), maRange.aEnd.Row() ); - } + SCTAB nTab = *itr; + ScRange aRange = maOption.getSingleRange(nTab); - if (bUndo) - DoSdrUndoAction( mpDrawUndo, pDoc ); - else - RedoSdrUndoAction( mpDrawUndo ); + if (bUndo) + // remove merge (contents are copied back below from undo document) + pDoc->RemoveMerge( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() ); + else + { + // repeat merge, but do not remove note captions (will be done by drawing redo below) + pDoc->DoMerge( aRange.aStart.Tab(), + aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col(), aRange.aEnd.Row(), false ); - BOOL bDidPaint = FALSE; - ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - if ( pViewShell ) - { - pViewShell->SetTabNo( maRange.aStart.Tab() ); - bDidPaint = pViewShell->AdjustRowHeight( maRange.aStart.Row(), maRange.aEnd.Row() ); - } + if (maOption.mbCenter) + { + pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aStart.Tab(), + SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) ); + pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aStart.Tab(), + SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) ); + } + } + + // undo -> copy back deleted contents + if (bUndo && mpUndoDoc) + { + pDoc->DeleteAreaTab( aRange, IDF_CONTENTS|IDF_NOCAPTIONS ); + mpUndoDoc->CopyToDocument( aRange, IDF_ALL|IDF_NOCAPTIONS, FALSE, pDoc ); + } + + // redo -> merge contents again + else if (!bUndo && mbMergeContents) + { + pDoc->DoMergeContents( aRange.aStart.Tab(), + aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col(), aRange.aEnd.Row() ); + } - if (!bDidPaint) - ScUndoUtil::PaintMore( pDocShell, maRange ); + if (bUndo) + DoSdrUndoAction( mpDrawUndo, pDoc ); + else + RedoSdrUndoAction( mpDrawUndo ); + + bool bDidPaint = false; + if ( pViewShell ) + { + pViewShell->SetTabNo(nTab); + bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow); + } + + if (!bDidPaint) + ScUndoUtil::PaintMore(pDocShell, aRange); + } - ShowTable( maRange ); + ShowTable(aCurRange); } diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index dea7cc056756..764c3b6c671d 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -68,6 +68,7 @@ #include #include "autoform.hxx" +#include "cellmergeoption.hxx" #include "cellsuno.hxx" #include "cursuno.hxx" #include "textuno.hxx" @@ -5342,10 +5343,14 @@ void SAL_CALL ScCellRangeObj::merge( sal_Bool bMerge ) throw(uno::RuntimeExcepti if ( pDocSh ) { ScDocFunc aFunc(*pDocSh); + ScCellMergeOption aMergeOption( + aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col(), aRange.aEnd.Row(), false); + aMergeOption.maTabs.insert(aRange.aStart.Tab()); if ( bMerge ) - aFunc.MergeCells( aRange, FALSE, TRUE, TRUE ); + aFunc.MergeCells( aMergeOption, FALSE, TRUE, TRUE ); else - aFunc.UnmergeCells( aRange, TRUE, TRUE ); + aFunc.UnmergeCells( aMergeOption, TRUE, TRUE ); //! Fehler abfangen? } diff --git a/sc/source/ui/view/cellmergeoption.cxx b/sc/source/ui/view/cellmergeoption.cxx new file mode 100644 index 000000000000..da531966cb19 --- /dev/null +++ b/sc/source/ui/view/cellmergeoption.cxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 by Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: docfunc.hxx,v $ + * $Revision: 1.18.30.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "cellmergeoption.hxx" +#include "address.hxx" + +ScCellMergeOption::ScCellMergeOption() : + mnStartCol(0), + mnStartRow(0), + mnEndCol(0), + mnEndRow(0), + mbCenter(false) +{ +} + +ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) : + mnStartCol(nStartCol), + mnStartRow(nStartRow), + mnEndCol(nEndCol), + mnEndRow(nEndRow), + mbCenter(bCenter) +{ +} + +ScCellMergeOption::ScCellMergeOption(const ScCellMergeOption& r) : + maTabs(r.maTabs), + mnStartCol(r.mnStartCol), + mnStartRow(r.mnStartRow), + mnEndCol(r.mnEndCol), + mnEndRow(r.mnEndRow), + mbCenter(r.mbCenter) +{ +} + +ScRange ScCellMergeOption::getSingleRange(SCTAB nTab) const +{ + return ScRange(mnStartCol, mnStartRow, nTab, mnEndCol, mnEndRow, nTab); +} + +ScRange ScCellMergeOption::getFirstSingleRange() const +{ + SCTAB nTab = 0; + if (!maTabs.empty()) + nTab = *maTabs.begin(); + + return getSingleRange(nTab); +} diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index ed391f154892..f8985748302c 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -769,6 +769,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) { // test whether to merge or to split bool bMerge = false; + BOOL bCenter = FALSE; switch( nSlot ) { case FID_MERGE_ON: @@ -779,6 +780,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) break; case FID_MERGE_TOGGLE: { + bCenter = TRUE; SfxPoolItem* pItem = 0; if( rBindings.QueryState( nSlot, pItem ) >= SFX_ITEM_DEFAULT ) bMerge = !static_cast< SfxBoolItem* >( pItem )->GetValue(); @@ -799,7 +801,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) bMoveContents = ((const SfxBoolItem*)pItem)->GetValue(); } - if (pTabViewShell->MergeCells( bApi, bMoveContents )) + if (pTabViewShell->MergeCells( bApi, bMoveContents, TRUE, bCenter )) { if (!bApi && bMoveContents) // "ja" im Dialog geklickt rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) ); diff --git a/sc/source/ui/view/makefile.mk b/sc/source/ui/view/makefile.mk index 1b2fef913fc2..521c5bda91fc 100644 --- a/sc/source/ui/view/makefile.mk +++ b/sc/source/ui/view/makefile.mk @@ -96,6 +96,7 @@ SLOFILES = \ $(SLO)$/output3.obj \ $(SLO)$/gridmerg.obj \ $(SLO)$/invmerge.obj \ + $(SLO)$/cellmergeoption.obj \ $(SLO)$/select.obj \ $(SLO)$/olinewin.obj \ $(SLO)$/hintwin.obj \ diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index a125cbea6f50..d3a83ad6bde5 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -60,6 +60,7 @@ #include "attrib.hxx" #include "autoform.hxx" #include "cell.hxx" // EnterAutoSum +#include "cellmergeoption.hxx" #include "compiler.hxx" #include "docfunc.hxx" #include "docpool.hxx" @@ -1085,7 +1086,7 @@ BOOL ScViewFunc::TestMergeCells() // Vorab-Test (fuer Menue) //---------------------------------------------------------------------------- -BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord ) +BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord, BOOL bCenter ) { // Editable- und Verschachtelungs-Abfrage muss vorneweg sein (auch in DocFunc), // damit dann nicht die Inhalte-QueryBox kommt @@ -1128,10 +1129,26 @@ BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord ) return FALSE; } + // Check for the contents of all selected tables. + bool bAskDialog = false; + SCTAB nTabCount = pDoc->GetTableCount(); + ScCellMergeOption aMergeOption(nStartCol, nStartRow, nEndCol, nEndRow, bCenter); + for (SCTAB i = 0; i < nTabCount; ++i) + { + if (!rMark.GetTableSelect(i)) + // this table is not selected. + continue; + + aMergeOption.maTabs.insert(i); + + if (!pDoc->IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, nEndRow) || + !pDoc->IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, nEndRow)) + bAskDialog = true; + } + BOOL bOk = TRUE; - if ( !pDoc->IsBlockEmpty( nStartTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) || - !pDoc->IsBlockEmpty( nStartTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) ) + if (bAskDialog) { if (!bApi) { @@ -1151,7 +1168,7 @@ BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord ) if (bOk) { HideCursor(); - bOk = pDocSh->GetDocFunc().MergeCells( aMarkRange, rDoContents, bRecord, bApi ); + bOk = pDocSh->GetDocFunc().MergeCells( aMergeOption, rDoContents, bRecord, bApi ); ShowCursor(); if (bOk) @@ -1187,6 +1204,32 @@ BOOL ScViewFunc::TestRemoveMerge() //---------------------------------------------------------------------------- +static bool lcl_extendMergeRange(ScCellMergeOption& rOption, const ScRange& rRange) +{ + bool bExtended = false; + if (rOption.mnStartCol > rRange.aStart.Col()) + { + rOption.mnStartCol = rRange.aStart.Col(); + bExtended = true; + } + if (rOption.mnStartRow > rRange.aStart.Row()) + { + rOption.mnStartRow = rRange.aStart.Row(); + bExtended = true; + } + if (rOption.mnEndCol < rRange.aEnd.Col()) + { + rOption.mnEndCol = rRange.aEnd.Col(); + bExtended = true; + } + if (rOption.mnEndRow < rRange.aEnd.Row()) + { + rOption.mnEndRow = rRange.aEnd.Row(); + bExtended = true; + } + return bExtended; +} + BOOL ScViewFunc::RemoveMerge( BOOL bRecord ) { ScRange aRange; @@ -1198,12 +1241,39 @@ BOOL ScViewFunc::RemoveMerge( BOOL bRecord ) } else if (GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE) { + ScDocument* pDoc = GetViewData()->GetDocument(); ScRange aExtended( aRange ); - GetViewData()->GetDocument()->ExtendMerge( aExtended ); + pDoc->ExtendMerge( aExtended ); ScDocShell* pDocSh = GetViewData()->GetDocShell(); + const ScMarkData& rMark = GetViewData()->GetMarkData(); + SCTAB nTabCount = pDoc->GetTableCount(); + ScCellMergeOption aOption(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row()); + bool bExtended = false; + do + { + bExtended = false; + for (SCTAB i = 0; i < nTabCount; ++i) + { + if (!rMark.GetTableSelect(i)) + // This table is not selected. + continue; + + aOption.maTabs.insert(i); + aExtended.aStart.SetTab(i); + aExtended.aEnd.SetTab(i); + pDoc->ExtendMerge(aExtended); + pDoc->ExtendOverlapped(aExtended); + + // Expand the current range to be inclusive of all merged + // areas on all sheets. + bExtended = lcl_extendMergeRange(aOption, aExtended); + } + } + while (bExtended); HideCursor(); - BOOL bOk = pDocSh->GetDocFunc().UnmergeCells( aRange, bRecord, FALSE ); + BOOL bOk = pDocSh->GetDocFunc().UnmergeCells(aOption, bRecord, FALSE ); + aExtended = aOption.getFirstSingleRange(); MarkRange( aExtended ); ShowCursor(); diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 9132cc2d647f..959e5384ac75 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -220,7 +220,13 @@ - + + + + + + + -- cgit From 7dca6594d617fa2db3a943729cfa12b45e2f7457 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 11:46:12 +0200 Subject: calc-enhanced-merge-cells-officecfg.diff: Merged n#213205, i#67243, i#101042 Merging/unmerging of cells on multiple sheets & merge center icon. --- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 0eb50461b97f..5629a4fe34ed 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -1058,7 +1058,7 @@ - M~erge Cells + M~erge and Center Cells 1 -- cgit From 3f95b6220512ef492b23966cc0f41bd23bfa28fa Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 12:34:09 +0200 Subject: ooo-build-resources-svx-dialogs-hrc.diff: Migrated --- svx/inc/svx/dialogs.hrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index 80957c5c46f6..cc488f81cf0f 100755 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -1054,6 +1054,11 @@ #define OFA_TP_TABPROPERTIES_TEXT (RID_OFA_START + 245) #define OFA_TP_HELPERPROG (RID_OFA_START + 249) -#endif +// ---------------------------------------------------------------------------- +// ooo-build specific resources + +#define SVX_OOO_BUILD_START (RID_SVX_START + 1200) #define SID_SC_TP_FORMULA (SVX_OOO_BUILD_START + 1) + +#endif -- cgit From c629d87b5c1bcd2e822880aa7edaa0741472dfda Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 16 Sep 2010 12:42:02 +0200 Subject: ooo-build-resources-sc-sc-hrc.diff: Migrated --- sc/inc/sc.hrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index be9e9721a26f..d7cb3513713a 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1657,6 +1657,11 @@ #define MID_3 3 #define MID_4 4 +// ---------------------------------------------------------------------------- +// ooo-build specific resources + +#define SC_OOO_BUILD_START (SC_DIALOGS_END) + // Autoformat for DataPilot #define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 1) -- cgit From 78e3c945434a999bb8ef11c67b8e0ec855ca6fdf Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:17:37 +0200 Subject: patches/gstreamer/gstreamer-avmedia.diff: gstreamer integration, avmedia part --- avmedia/prj/build.lst | 3 +- avmedia/source/inc/mediamisc.hxx | 4 +++ avmedia/source/viewer/mediawindow_impl.cxx | 48 +++++++++++++++++++++++++++++- avmedia/source/viewer/mediawindow_impl.hxx | 8 +++++ 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/avmedia/prj/build.lst b/avmedia/prj/build.lst index 1ef04ca0f7d5..9e3f9ea098dd 100644 --- a/avmedia/prj/build.lst +++ b/avmedia/prj/build.lst @@ -8,4 +8,5 @@ av avmedia\source\win nmake - all av_win NULL av avmedia\source\java nmake - all av_java NULL av avmedia\source\xine nmake - all av_xine NULL av avmedia\source\quicktime nmake - all av_quicktime NULL -av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_xine NULL +av avmedia\source\gstreamer nmake - all av_gstreamer NULL +av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_xine av_gstreamer NULL diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx index fd89e9d4abde..30db0a142977 100644 --- a/avmedia/source/inc/mediamisc.hxx +++ b/avmedia/source/inc/mediamisc.hxx @@ -29,6 +29,9 @@ class ResMgr; #define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() ) +#ifdef GSTREAMER +#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_GStreamer" +#else #ifdef WNT #define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_DirectX" #else @@ -38,6 +41,7 @@ class ResMgr; #define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_Java" #endif #endif +#endif namespace avmedia { diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 553eea6196c1..1148e3bc8809 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -36,6 +36,11 @@ #include #include #include +#ifdef UNX +#ifndef _SV_SYSDATA_HXX +#include +#endif +#endif #ifndef _COM_SUN_STAR_AWT_SYSTEMPOINTER_HDL_ #include @@ -94,7 +99,11 @@ void MediaWindowControl::execute( const MediaItem& rItem ) // -------------------- MediaChildWindow::MediaChildWindow( Window* pParent ) : +#ifdef GSTREAMER + SystemChildWindow( pParent, WB_CLIPCHILDREN ) +#else JavaChildWindow( pParent, WB_CLIPCHILDREN ) +#endif { } @@ -111,7 +120,11 @@ void MediaChildWindow::MouseMove( const MouseEvent& rMEvt ) const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); +#ifdef GSTREAMER + SystemChildWindow::MouseMove( rMEvt ); +#else JavaChildWindow::MouseMove( rMEvt ); +#endif GetParent()->MouseMove( aTransformedEvent ); } @@ -122,7 +135,11 @@ void MediaChildWindow::MouseButtonDown( const MouseEvent& rMEvt ) const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); +#ifdef GSTREAMER + SystemChildWindow::MouseButtonDown( rMEvt ); +#else JavaChildWindow::MouseButtonDown( rMEvt ); +#endif GetParent()->MouseButtonDown( aTransformedEvent ); } @@ -133,7 +150,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt ) const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); +#ifdef GSTREAMER + SystemChildWindow::MouseButtonUp( rMEvt ); +#else JavaChildWindow::MouseButtonUp( rMEvt ); +#endif GetParent()->MouseButtonUp( aTransformedEvent ); } @@ -141,7 +162,11 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt ) void MediaChildWindow::KeyInput( const KeyEvent& rKEvt ) { +#ifdef GSTREAMER + SystemChildWindow::KeyInput( rKEvt ); +#else JavaChildWindow::KeyInput( rKEvt ); +#endif GetParent()->KeyInput( rKEvt ); } @@ -149,7 +174,11 @@ void MediaChildWindow::KeyInput( const KeyEvent& rKEvt ) void MediaChildWindow::KeyUp( const KeyEvent& rKEvt ) { +#ifdef GSTREAMER + SystemChildWindow::KeyUp( rKEvt ); +#else JavaChildWindow::KeyUp( rKEvt ); +#endif GetParent()->KeyUp( rKEvt ); } @@ -160,7 +189,11 @@ void MediaChildWindow::Command( const CommandEvent& rCEvt ) const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ), rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() ); +#ifdef GSTREAMER + SystemChildWindow::Command( rCEvt ); +#else JavaChildWindow::Command( rCEvt ); +#endif GetParent()->Command( aTransformedEvent ); } @@ -229,18 +262,31 @@ void MediaWindowImpl::onURLChanged() { if( getPlayer().is() ) { - uno::Sequence< uno::Any > aArgs( 2 ); + uno::Sequence< uno::Any > aArgs( 3 ); uno::Reference< media::XPlayerWindow > xPlayerWindow; const Point aPoint; const Size aSize( maChildWindow.GetSizePixel() ); +#ifndef GSTREAMER const sal_IntPtr nWndHandle = static_cast< sal_IntPtr >( maChildWindow.getParentWindowHandleForJava() ); +#else + const sal_Int32 nWndHandle = 0; +#endif aArgs[ 0 ] = uno::makeAny( nWndHandle ); aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) ); +#ifdef GSTREAMER + const SystemEnvData *pSystemData = maChildWindow.GetSystemData(); + OSL_TRACE( "MediaWindowImpl::onURLChanged xwindow id: %ld", pSystemData->aWindow ); + aArgs[ 2 ] = uno::makeAny( pSystemData->aWindow ); +#endif try { +#ifdef GSTREAMER + if( pSystemData->aWindow != 0 ) +#else if( nWndHandle != 0 ) +#endif xPlayerWindow = getPlayer()->createPlayerWindow( aArgs ); } catch( uno::RuntimeException ) diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx index 679b864af6b7..50042f1cc138 100644 --- a/avmedia/source/viewer/mediawindow_impl.hxx +++ b/avmedia/source/viewer/mediawindow_impl.hxx @@ -29,7 +29,11 @@ #define _AVMEDIA_MEDIAWINDOW_IMPL_HXX #include +#ifdef GSTREAMER +#include +#else #include +#endif #include "mediawindowbase_impl.hxx" #include "mediacontrol.hxx" @@ -61,7 +65,11 @@ namespace avmedia // - MediaChildWindow - // -------------------- +#ifdef GSTREAMER + class MediaChildWindow : public SystemChildWindow +#else class MediaChildWindow : public JavaChildWindow +#endif { public: -- cgit From 4a9f1952a88d3f66590e14daffb49d4be3fa8c05 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:19:46 +0200 Subject: patches/gstreamer/gstreamer-scp2.diff: gstreamer, component installation --- scp2/source/ooo/file_library_ooo.scp | 4 ++++ scp2/source/ooo/module_hidden_ooo.scp | 1 + 2 files changed, 5 insertions(+) diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp index 0a57ae5ec6f4..dfc3fd49903d 100644 --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -1626,6 +1626,9 @@ STD_UNO_LIB_FILE( gid_File_Lib_Unoxml, unoxml ) // AVMedia STD_UNO_LIB_FILE( gid_File_Lib_AVMedia, avmedia ) +#ifdef GSTREAMER +SPECIAL_UNO_LIB_FILE_PATCH( gid_File_Lib_AVMediaGStreamer, avmediagst ) +#else #if defined UNX #ifdef SOLAR_JAVA UNO_JAR_FILE( gid_File_Jar_AVmedia, avmedia ) @@ -1635,6 +1638,7 @@ UNO_JAR_FILE( gid_File_Jar_AVmedia, avmedia ) SPECIAL_UNO_LIB_FILE( gid_File_Lib_AVMediaWin, avmediawin ) #endif #endif +#endif #ifndef WITHOUT_MOZILLA File gid_File_Lib_XSec_Framework diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp index d23786a65a24..a2ca40c2779a 100644 --- a/scp2/source/ooo/module_hidden_ooo.scp +++ b/scp2/source/ooo/module_hidden_ooo.scp @@ -214,6 +214,7 @@ Module gid_Module_Root_Files_4 gid_File_Lib_Svx, gid_File_Lib_AVMedia, gid_File_Lib_AVMediaWin, + gid_File_Lib_AVMediaGStreamer, gid_File_Lib_BaseGfx, gid_File_Lib_Sysdtrans, gid_File_Lib_Sw, -- cgit From 102b1646788c96311bdf45b3cf7368be8ccb40d6 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:27:23 +0200 Subject: patches/gstreamer/gstreamer-config-office.diff: gstreamer - enable/disable at build time --- configure.in | 27 +++++++++++++++++++++++++++ set_soenv.in | 1 + 2 files changed, 28 insertions(+) diff --git a/configure.in b/configure.in index 8cef295221d5..c3a35c5fa792 100644 --- a/configure.in +++ b/configure.in @@ -297,6 +297,9 @@ AC_ARG_ENABLE(randr-link, [ --disable-randr-link disable linking with libXrandr, instead dynamically open it at runtime ],,enable_randr_link=yes) +AC_ARG_ENABLE(gstreamer, +[ --disable-gstreamer disable building the gstreamer avmedia backend +],,enable_gstreamer=yes) AC_ARG_WITH(myspell-dicts, [ --without-myspell-dicts Removes myspell dictionaries from openoffice.org installation set, for people building for specific @@ -1004,6 +1007,7 @@ case "$build_os" in solaris*) test_gtk=yes test_cairo=yes + build_gstreamer=yes test_kde=yes test_cups=yes test_randr=yes @@ -1037,6 +1041,7 @@ case "$build_os" in linux-gnu*|k*bsd*-gnu*) test_gtk=yes test_cairo=yes + build_gstreamer=yes test_kde=yes test_kde4=yes test_cups=yes @@ -1078,6 +1083,7 @@ case "$build_os" in freebsd*) test_gtk=yes test_cairo=yes + build_gstreamer=yes test_kde=yes test_kde4=yes test_cups=yes @@ -1112,6 +1118,7 @@ case "$build_os" in netbsd) test_gtk=yes test_cairo=yes + build_gstreamer=yes test_kde=yes test_kde4=yes test_cups=no @@ -5945,6 +5952,26 @@ AC_SUBST(SYSTEM_CAIRO) AC_SUBST(CAIRO_CFLAGS) AC_SUBST(CAIRO_LIBS) +dnl =================================================================== +dnl Check whether the GStreamer libraries are available. +dnl =================================================================== + +ENABLE_GSTREAMER="" + +if test "$build_gstreamer" = "yes"; then + + AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend]) + if test "x$enable_gstreamer" != "xno" ; then + ENABLE_GSTREAMER="TRUE" + AC_MSG_RESULT([yes]) + PKG_CHECK_MODULES( GSTREAMER, gstreamer-0.10 gstreamer-plugins-base-0.10 ) + else + AC_MSG_RESULT([no]) + fi +fi + +AC_SUBST(ENABLE_GSTREAMER) + dnl =================================================================== dnl Check whether the OpenGL libraries are available dnl =================================================================== diff --git a/set_soenv.in b/set_soenv.in index dea0948d3dea..502ab5e67b99 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -1650,6 +1650,7 @@ ToFile( "SERVLETAPI_JAR", "@SERVLETAPI_JAR@", "e" ); ToFile( "ENABLE_DBUS", "@ENABLE_DBUS@", "e" ); ToFile( "ENABLE_GCONF", "@ENABLE_GCONF@", "e" ); ToFile( "ENABLE_GNOMEVFS", "@ENABLE_GNOMEVFS@", "e" ); +ToFile( "ENABLE_GSTREAMER", "@ENABLE_GSTREAMER@", "e" ); ToFile( "ENABLE_GIO", "@ENABLE_GIO@", "e" ); ToFile( "ENABLE_KDE", "@ENABLE_KDE@", "e" ); ToFile( "KDE_CFLAGS", "@KDE_CFLAGS@", "e" ); -- cgit From b6e85cc31ba89d242037505468d1ca94cf10ed03 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:28:20 +0200 Subject: patches/gstreamer/gstreamer-solenv.diff: gstreamer - enable/disable at build time, part 2 --- solenv/inc/settings.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk index 68bbc797d8af..dbf2ad59d91b 100644 --- a/solenv/inc/settings.mk +++ b/solenv/inc/settings.mk @@ -1167,6 +1167,10 @@ CDEFS+=-DENABLE_LAYOUT_EXPERIMENTAL=1 CFLAGS+=-DENABLE_LAYOUT_EXPERIMENTAL=0 .ENDIF # ENABLE_LAYOUT_EXPERIMENTAL != TRUE +.IF "$(ENABLE_GSTREAMER)" == "TRUE" +CDEFS+=-DGSTREAMER +.ENDIF + # compose flags and defines for GUI .IF "$(TARGETTYPE)"=="GUI" CDEFS+= $(CDEFSGUI) -- cgit From 6bee4baf37f7758e088156f893f181a00cbcab7d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:30:14 +0200 Subject: patches/gstreamer/gstreamer-slideshow.diff: gstreamer - use SystemChildWindow instead of JavaChildWindow when building with gstreamer --- slideshow/source/engine/shapes/viewmediashape.cxx | 33 ++++++++++++++++++++--- slideshow/source/engine/shapes/viewmediashape.hxx | 5 ++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index 1c0b6f9b71a1..dc282a19c365 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -41,6 +41,9 @@ #include #include #include +#ifdef GSTREAMER +#include +#endif #include #include @@ -153,7 +156,11 @@ namespace slideshow mxPlayerWindow.clear(); } +#ifdef GSTREAMER + mpMediaWindow = ::std::auto_ptr< SystemChildWindow >(); +#else mpMediaWindow = ::std::auto_ptr< JavaChildWindow >(); +#endif // shutdown player if( mxPlayer.is() ) @@ -304,7 +311,8 @@ namespace slideshow aDeviceParams[ 0 ] >>= aImplName; if( aImplName.endsWithIgnoreAsciiCaseAsciiL( - RTL_CONSTASCII_STRINGPARAM("VCL") )) + RTL_CONSTASCII_STRINGPARAM("VCL") ) || aImplName.endsWithIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("Cairo") ) ) { implInitializeVCLBasedPlayerWindow( rBounds, aDeviceParams ); } @@ -410,6 +418,7 @@ namespace slideshow bool ViewMediaShape::implInitializeVCLBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds, const uno::Sequence< uno::Any >& rVCLDeviceParams) { + OSL_TRACE( "ViewMediaShape::implInitializeVCLBasedPlayerWindow" ); if( !mpMediaWindow.get() && !rBounds.isEmpty() ) { try @@ -431,28 +440,46 @@ namespace slideshow if( !rRangePix.isEmpty() ) { - uno::Sequence< uno::Any > aArgs( 2 ); + uno::Sequence< uno::Any > aArgs( 3 ); awt::Rectangle aAWTRect( rRangePix.getMinX(), rRangePix.getMinY(), rRangePix.getMaxX() - rRangePix.getMinX(), rRangePix.getMaxY() - rRangePix.getMinY() ); +#ifdef GSTREAMER + OSL_TRACE( "created sys child window for viewmediashape" ); + mpMediaWindow = ::std::auto_ptr< SystemChildWindow >( new SystemChildWindow( pWindow, WB_CLIPCHILDREN ) ); +#else mpMediaWindow = ::std::auto_ptr< JavaChildWindow >( new JavaChildWindow( pWindow, WB_CLIPCHILDREN ) ); +#endif mpMediaWindow->SetBackground( Color( COL_BLACK ) ); mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X, aAWTRect.Y ), Size( aAWTRect.Width, aAWTRect.Height )); + mpMediaWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP ); + mpMediaWindow->EnableEraseBackground( FALSE ); + mpMediaWindow->EnablePaint( FALSE ); + mpMediaWindow->SetForwardKey( TRUE ); + mpMediaWindow->SetMouseTransparent( TRUE ); mpMediaWindow->Show(); if( mxPlayer.is() ) { +#ifndef GSTREAMER aArgs[ 0 ] = uno::makeAny( sal::static_int_cast( mpMediaWindow->getParentWindowHandleForJava()) ); - +#else + aArgs[ 0 ] = uno::makeAny ( (sal_Int32) 0 ); +#endif aAWTRect.X = aAWTRect.Y = 0; aArgs[ 1 ] = uno::makeAny( aAWTRect ); +#ifdef GSTREAMER + const SystemEnvData *pSystemData = mpMediaWindow->GetSystemData(); + OSL_TRACE( "xwindow id: %ld", pSystemData->aWindow ); + aArgs[ 2 ] = uno::makeAny( pSystemData->aWindow ); +#endif mxPlayerWindow.set( mxPlayer->createPlayerWindow( aArgs ) ); diff --git a/slideshow/source/engine/shapes/viewmediashape.hxx b/slideshow/source/engine/shapes/viewmediashape.hxx index 5e2568bbd98e..a16fa33573a6 100644 --- a/slideshow/source/engine/shapes/viewmediashape.hxx +++ b/slideshow/source/engine/shapes/viewmediashape.hxx @@ -37,6 +37,7 @@ #include "viewlayer.hxx" class JavaChildWindow; +class SystemChildWindow; namespace com { namespace sun { namespace star { namespace drawing { class XShape; @@ -155,7 +156,11 @@ namespace slideshow const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rDXDeviceParams ); ViewLayerSharedPtr mpViewLayer; +#ifdef GSTREAMER + ::std::auto_ptr< SystemChildWindow > mpMediaWindow; +#else ::std::auto_ptr< JavaChildWindow > mpMediaWindow; +#endif mutable ::com::sun::star::awt::Point maWindowOffset; mutable ::basegfx::B2DRectangle maBounds; -- cgit From 0ef4991ae907cdb25c1ffcb96e842fa2629dc3e0 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:31:43 +0200 Subject: patches/gstreamer/gstreamer-svtools-content-types.diff: gstreamer - let OOo know about ogg mime types --- svl/inc/svl/inettype.hxx | 4 + svl/inc/svl/svl.hrc | 206 ++++++++++++++++++++++--------------------- svl/source/misc/inettype.cxx | 5 ++ svl/source/misc/mediatyp.src | 162 ++++++++++++++++++++++++++++++++++ 4 files changed, 275 insertions(+), 102 deletions(-) diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx index 24318af8fa57..969e08359171 100644 --- a/svl/inc/svl/inettype.hxx +++ b/svl/inc/svl/inettype.hxx @@ -90,6 +90,7 @@ #define CONTENT_TYPE_STR_AUDIO_AIFF "audio/aiff" #define CONTENT_TYPE_STR_AUDIO_BASIC "audio/basic" #define CONTENT_TYPE_STR_AUDIO_MIDI "audio/midi" +#define CONTENT_TYPE_STR_AUDIO_VORBIS "audio/vorbis" #define CONTENT_TYPE_STR_AUDIO_WAV "audio/wav" #define CONTENT_TYPE_STR_X_CNT_DOCUMENT ".chaos/document" #define CONTENT_TYPE_STR_X_CNT_FSYSBOX ".chaos/fsys-box" @@ -155,6 +156,7 @@ #define CONTENT_TYPE_STR_TEXT_URL "text/x-url" #define CONTENT_TYPE_STR_TEXT_VCALENDAR "text/x-vCalendar" #define CONTENT_TYPE_STR_TEXT_VCARD "text/x-vCard" +#define CONTENT_TYPE_STR_VIDEO_THEORA "video/theora" #define CONTENT_TYPE_STR_VIDEO_VDO "video/vdo" #define CONTENT_TYPE_STR_VIDEO_MSVIDEO "video/x-msvideo" #define CONTENT_TYPE_STR_X_STARMAIL "x-starmail" @@ -228,6 +230,7 @@ enum INetContentType CONTENT_TYPE_AUDIO_AIFF, CONTENT_TYPE_AUDIO_BASIC, CONTENT_TYPE_AUDIO_MIDI, + CONTENT_TYPE_AUDIO_VORBIS, CONTENT_TYPE_AUDIO_WAV, CONTENT_TYPE_IMAGE_GIF, CONTENT_TYPE_IMAGE_JPEG, @@ -239,6 +242,7 @@ enum INetContentType CONTENT_TYPE_TEXT_PLAIN, CONTENT_TYPE_TEXT_URL, CONTENT_TYPE_TEXT_VCARD, + CONTENT_TYPE_VIDEO_THEORA, CONTENT_TYPE_VIDEO_VDO, CONTENT_TYPE_VIDEO_MSVIDEO, CONTENT_TYPE_X_CNT_MESSAGE, diff --git a/svl/inc/svl/svl.hrc b/svl/inc/svl/svl.hrc index d63e84f2b91f..4dc74a7f83b7 100644 --- a/svl/inc/svl/svl.hrc +++ b/svl/inc/svl/svl.hrc @@ -46,110 +46,112 @@ #define STR_SVT_MIMETYPE_APP_ZIP (STR_SVT_MIMETYPE_START+10) #define STR_SVT_MIMETYPE_AUDIO_AIFF (STR_SVT_MIMETYPE_START+11) #define STR_SVT_MIMETYPE_AUDIO_BASIC (STR_SVT_MIMETYPE_START+12) -#define STR_SVT_MIMETYPE_AUDIO_MIDI (STR_SVT_MIMETYPE_START+13) -#define STR_SVT_MIMETYPE_AUDIO_WAV (STR_SVT_MIMETYPE_START+14) -#define STR_SVT_MIMETYPE_IMAGE_GIF (STR_SVT_MIMETYPE_START+15) -#define STR_SVT_MIMETYPE_IMAGE_JPEG (STR_SVT_MIMETYPE_START+16) -#define STR_SVT_MIMETYPE_IMAGE_PCX (STR_SVT_MIMETYPE_START+17) -#define STR_SVT_MIMETYPE_IMAGE_BMP (STR_SVT_MIMETYPE_START+18) -#define STR_SVT_MIMETYPE_TEXT_HTML (STR_SVT_MIMETYPE_START+19) -#define STR_SVT_MIMETYPE_TEXT_PLAIN (STR_SVT_MIMETYPE_START+20) -#define STR_SVT_MIMETYPE_TEXT_URL (STR_SVT_MIMETYPE_START+21) -#define STR_SVT_MIMETYPE_TEXT_VCARD (STR_SVT_MIMETYPE_START+22) -#define STR_SVT_MIMETYPE_VIDEO_VDO (STR_SVT_MIMETYPE_START+23) -#define STR_SVT_MIMETYPE_VIDEO_MSVIDEO (STR_SVT_MIMETYPE_START+24) -#define STR_SVT_MIMETYPE_X_STARMAIL (STR_SVT_MIMETYPE_START+25) -#define STR_SVT_MIMETYPE_X_VRML (STR_SVT_MIMETYPE_START+26) -#define STR_SVT_MIMETYPE_APP_STARHELP (STR_SVT_MIMETYPE_START+27) -#define STR_SVT_MIMETYPE_APP_STARIMPRESS (STR_SVT_MIMETYPE_START+28) -#define STR_SVT_MIMETYPE_APP_SCHED_CMB (STR_SVT_MIMETYPE_START+29) -#define STR_SVT_MIMETYPE_APP_SCHED_EVT (STR_SVT_MIMETYPE_START+30) -#define STR_SVT_MIMETYPE_APP_SCHED_TASK (STR_SVT_MIMETYPE_START+31) -#define STR_SVT_MIMETYPE_APP_SCHED_TVIEW (STR_SVT_MIMETYPE_START+32) +#define STR_SVT_MIMETYPE_AUDIO_VORBIS (STR_SVT_MIMETYPE_START+13) +#define STR_SVT_MIMETYPE_AUDIO_MIDI (STR_SVT_MIMETYPE_START+14) +#define STR_SVT_MIMETYPE_AUDIO_WAV (STR_SVT_MIMETYPE_START+15) +#define STR_SVT_MIMETYPE_IMAGE_GIF (STR_SVT_MIMETYPE_START+16) +#define STR_SVT_MIMETYPE_IMAGE_JPEG (STR_SVT_MIMETYPE_START+17) +#define STR_SVT_MIMETYPE_IMAGE_PCX (STR_SVT_MIMETYPE_START+18) +#define STR_SVT_MIMETYPE_IMAGE_BMP (STR_SVT_MIMETYPE_START+19) +#define STR_SVT_MIMETYPE_TEXT_HTML (STR_SVT_MIMETYPE_START+20) +#define STR_SVT_MIMETYPE_TEXT_PLAIN (STR_SVT_MIMETYPE_START+21) +#define STR_SVT_MIMETYPE_TEXT_URL (STR_SVT_MIMETYPE_START+22) +#define STR_SVT_MIMETYPE_TEXT_VCARD (STR_SVT_MIMETYPE_START+23) +#define STR_SVT_MIMETYPE_VIDEO_THEORA (STR_SVT_MIMETYPE_START+24) +#define STR_SVT_MIMETYPE_VIDEO_VDO (STR_SVT_MIMETYPE_START+25) +#define STR_SVT_MIMETYPE_VIDEO_MSVIDEO (STR_SVT_MIMETYPE_START+26) +#define STR_SVT_MIMETYPE_X_STARMAIL (STR_SVT_MIMETYPE_START+27) +#define STR_SVT_MIMETYPE_X_VRML (STR_SVT_MIMETYPE_START+28) +#define STR_SVT_MIMETYPE_APP_STARHELP (STR_SVT_MIMETYPE_START+29) +#define STR_SVT_MIMETYPE_APP_STARIMPRESS (STR_SVT_MIMETYPE_START+30) +#define STR_SVT_MIMETYPE_APP_SCHED_CMB (STR_SVT_MIMETYPE_START+31) +#define STR_SVT_MIMETYPE_APP_SCHED_EVT (STR_SVT_MIMETYPE_START+32) +#define STR_SVT_MIMETYPE_APP_SCHED_TASK (STR_SVT_MIMETYPE_START+33) +#define STR_SVT_MIMETYPE_APP_SCHED_TVIEW (STR_SVT_MIMETYPE_START+34) -#define STR_SVT_MIMETYPE_CNT_MSG (STR_SVT_MIMETYPE_START+33) -#define STR_SVT_MIMETYPE_CNT_DOCUMENT (STR_SVT_MIMETYPE_START+34) -#define STR_SVT_MIMETYPE_CNT_POP3BOX (STR_SVT_MIMETYPE_START+35) -#define STR_SVT_MIMETYPE_CNT_IMAPBOX (STR_SVT_MIMETYPE_START+36) -#define STR_SVT_MIMETYPE_CNT_IMAPFLD (STR_SVT_MIMETYPE_START+37) -#define STR_SVT_MIMETYPE_CNT_VIMBOX (STR_SVT_MIMETYPE_START+38) -#define STR_SVT_MIMETYPE_CNT_VIMINBOX (STR_SVT_MIMETYPE_START+39) -#define STR_SVT_MIMETYPE_CNT_BBBOX (STR_SVT_MIMETYPE_START+40) -#define STR_SVT_MIMETYPE_CNT_VIM_BB (STR_SVT_MIMETYPE_START+41) -#define STR_SVT_MIMETYPE_CNT_NEWSBOX (STR_SVT_MIMETYPE_START+42) -#define STR_SVT_MIMETYPE_CNT_NEWSGRP (STR_SVT_MIMETYPE_START+43) -#define STR_SVT_MIMETYPE_CNT_OUTBOX (STR_SVT_MIMETYPE_START+44) -#define STR_SVT_MIMETYPE_CNT_FTPBOX (STR_SVT_MIMETYPE_START+45) -#define STR_SVT_MIMETYPE_CNT_FTPFLD (STR_SVT_MIMETYPE_START+46) -#define STR_SVT_MIMETYPE_CNT_FTPFILE (STR_SVT_MIMETYPE_START+47) -#define STR_SVT_MIMETYPE_CNT_FTPLINK (STR_SVT_MIMETYPE_START+48) -#define STR_SVT_MIMETYPE_CNT_HTTPBOX (STR_SVT_MIMETYPE_START+49) -#define STR_SVT_MIMETYPE_CNT_FSYSBOX (STR_SVT_MIMETYPE_START+50) -#define STR_SVT_MIMETYPE_CNT_FSYSFLD (STR_SVT_MIMETYPE_START+51) -#define STR_SVT_MIMETYPE_CNT_FSYSFILE (STR_SVT_MIMETYPE_START+52) -#define STR_SVT_MIMETYPE_CNT_FSYSURLFILE (STR_SVT_MIMETYPE_START+53) -#define STR_SVT_MIMETYPE_CNT_PUBLBOX (STR_SVT_MIMETYPE_START+54) -#define STR_SVT_MIMETYPE_CNT_SRCHBOX (STR_SVT_MIMETYPE_START+55) -#define STR_SVT_MIMETYPE_CNT_SUBSCRBOX (STR_SVT_MIMETYPE_START+56) -#define STR_SVT_MIMETYPE_CNT_BOOKMARK (STR_SVT_MIMETYPE_START+57) -#define STR_SVT_MIMETYPE_CNT_CDF (STR_SVT_MIMETYPE_START+58) -#define STR_SVT_MIMETYPE_CNT_CDFSUB (STR_SVT_MIMETYPE_START+59) -#define STR_SVT_MIMETYPE_CNT_CDFITEM (STR_SVT_MIMETYPE_START+60) -#define STR_SVT_MIMETYPE_CNT_STARCHANNEL (STR_SVT_MIMETYPE_START+61) -#define STR_SVT_MIMETYPE_CNT_TRASHBOX (STR_SVT_MIMETYPE_START+62) -#define STR_SVT_MIMETYPE_CNT_TRASH (STR_SVT_MIMETYPE_START+63) -#define STR_SVT_MIMETYPE_CNT_REMOV_VOL (STR_SVT_MIMETYPE_START+64) -#define STR_SVT_MIMETYPE_CNT_FIX_VOL (STR_SVT_MIMETYPE_START+65) -#define STR_SVT_MIMETYPE_CNT_REM_VOL (STR_SVT_MIMETYPE_START+66) -#define STR_SVT_MIMETYPE_CNT_RAM_VOL (STR_SVT_MIMETYPE_START+67) -#define STR_SVT_MIMETYPE_CNT_CDROM (STR_SVT_MIMETYPE_START+68) -#define STR_SVT_MIMETYPE_CNT_DISK_35 (STR_SVT_MIMETYPE_START+69) -#define STR_SVT_MIMETYPE_CNT_DISK_525 (STR_SVT_MIMETYPE_START+70) -#define STR_SVT_MIMETYPE_CNT_TAPEDRIVE (STR_SVT_MIMETYPE_START+71) -#define STR_SVT_MIMETYPE_APP_GAL (STR_SVT_MIMETYPE_START+72) -#define STR_SVT_MIMETYPE_APP_GAL_THEME (STR_SVT_MIMETYPE_START+73) -#define STR_SVT_MIMETYPE_CNT_SEPARATOR (STR_SVT_MIMETYPE_START+74) -#define STR_SVT_MIMETYPE_APP_STARW_GLOB (STR_SVT_MIMETYPE_START+75) -#define STR_SVT_MIMETYPE_APP_SDM (STR_SVT_MIMETYPE_START+76) -#define STR_SVT_MIMETYPE_APP_SMD (STR_SVT_MIMETYPE_START+77) -#define STR_SVT_MIMETYPE_APP_STARW_WEB (STR_SVT_MIMETYPE_START+78) -#define STR_SVT_MIMETYPE_SCHEDULE (STR_SVT_MIMETYPE_START+79) -#define STR_SVT_MIMETYPE_SCHEDULE_EVT (STR_SVT_MIMETYPE_START+80) -#define STR_SVT_MIMETYPE_SCHEDULE_TASK (STR_SVT_MIMETYPE_START+81) -#define STR_SVT_MIMETYPE_SCHEDULE_FEVT (STR_SVT_MIMETYPE_START+82) -#define STR_SVT_MIMETYPE_SCHEDULE_FTASK (STR_SVT_MIMETYPE_START+83) -#define STR_SVT_MIMETYPE_FRAMESET (STR_SVT_MIMETYPE_START+84) -#define STR_SVT_MIMETYPE_MACRO (STR_SVT_MIMETYPE_START+85) -#define STR_SVT_MIMETYPE_CNT_SFSYSFOLDER (STR_SVT_MIMETYPE_START+86) -#define STR_SVT_MIMETYPE_CNT_SFSYSFILE (STR_SVT_MIMETYPE_START+87) -#define STR_SVT_MIMETYPE_APP_TEMPLATE (STR_SVT_MIMETYPE_START+88) -#define STR_SVT_MIMETYPE_IMAGE_GENERIC (STR_SVT_MIMETYPE_START+89) -#define STR_SVT_MIMETYPE_APP_MSEXCEL (STR_SVT_MIMETYPE_START+90) -#define STR_SVT_MIMETYPE_APP_MSEXCEL_TEMPL (STR_SVT_MIMETYPE_START+91) -#define STR_SVT_MIMETYPE_APP_MSPPOINT (STR_SVT_MIMETYPE_START+92) -#define STR_SVT_MIMETYPE_TEXT_VCALENDAR (STR_SVT_MIMETYPE_START+93) -#define STR_SVT_MIMETYPE_TEXT_ICALENDAR (STR_SVT_MIMETYPE_START+94) -#define STR_SVT_MIMETYPE_TEXT_XMLICALENDAR (STR_SVT_MIMETYPE_START+95) -#define STR_SVT_MIMETYPE_TEXT_CDE_CALENDAR_APP (STR_SVT_MIMETYPE_START+96) -#define STR_SVT_MIMETYPE_INET_MSG_RFC822 (STR_SVT_MIMETYPE_START+97) -#define STR_SVT_MIMETYPE_INET_MULTI_ALTERNATIVE (STR_SVT_MIMETYPE_START+98) -#define STR_SVT_MIMETYPE_INET_MULTI_DIGEST (STR_SVT_MIMETYPE_START+99) -#define STR_SVT_MIMETYPE_INET_MULTI_PARALLEL (STR_SVT_MIMETYPE_START+100) -#define STR_SVT_MIMETYPE_INET_MULTI_RELATED (STR_SVT_MIMETYPE_START+101) -#define STR_SVT_MIMETYPE_INET_MULTI_MIXED (STR_SVT_MIMETYPE_START+102) -#define STR_SVT_MIMETYPE_APP_IMPRESSPACKED (STR_SVT_MIMETYPE_START+103) -#define STR_SVT_MIMETYPE_APP_JAR (STR_SVT_MIMETYPE_START+104) -#define STR_SVT_MIMETYPE_IMAGE_PNG (STR_SVT_MIMETYPE_START+105) -#define STR_SVT_MIMETYPE_IMAGE_TIFF (STR_SVT_MIMETYPE_START+106) +#define STR_SVT_MIMETYPE_CNT_MSG (STR_SVT_MIMETYPE_START+35) +#define STR_SVT_MIMETYPE_CNT_DOCUMENT (STR_SVT_MIMETYPE_START+36) +#define STR_SVT_MIMETYPE_CNT_POP3BOX (STR_SVT_MIMETYPE_START+37) +#define STR_SVT_MIMETYPE_CNT_IMAPBOX (STR_SVT_MIMETYPE_START+38) +#define STR_SVT_MIMETYPE_CNT_IMAPFLD (STR_SVT_MIMETYPE_START+39) +#define STR_SVT_MIMETYPE_CNT_VIMBOX (STR_SVT_MIMETYPE_START+40) +#define STR_SVT_MIMETYPE_CNT_VIMINBOX (STR_SVT_MIMETYPE_START+41) +#define STR_SVT_MIMETYPE_CNT_BBBOX (STR_SVT_MIMETYPE_START+42) +#define STR_SVT_MIMETYPE_CNT_VIM_BB (STR_SVT_MIMETYPE_START+43) +#define STR_SVT_MIMETYPE_CNT_NEWSBOX (STR_SVT_MIMETYPE_START+44) +#define STR_SVT_MIMETYPE_CNT_NEWSGRP (STR_SVT_MIMETYPE_START+45) +#define STR_SVT_MIMETYPE_CNT_OUTBOX (STR_SVT_MIMETYPE_START+46) +#define STR_SVT_MIMETYPE_CNT_FTPBOX (STR_SVT_MIMETYPE_START+47) +#define STR_SVT_MIMETYPE_CNT_FTPFLD (STR_SVT_MIMETYPE_START+48) +#define STR_SVT_MIMETYPE_CNT_FTPFILE (STR_SVT_MIMETYPE_START+49) +#define STR_SVT_MIMETYPE_CNT_FTPLINK (STR_SVT_MIMETYPE_START+50) +#define STR_SVT_MIMETYPE_CNT_HTTPBOX (STR_SVT_MIMETYPE_START+51) +#define STR_SVT_MIMETYPE_CNT_FSYSBOX (STR_SVT_MIMETYPE_START+52) +#define STR_SVT_MIMETYPE_CNT_FSYSFLD (STR_SVT_MIMETYPE_START+53) +#define STR_SVT_MIMETYPE_CNT_FSYSFILE (STR_SVT_MIMETYPE_START+54) +#define STR_SVT_MIMETYPE_CNT_FSYSURLFILE (STR_SVT_MIMETYPE_START+55) +#define STR_SVT_MIMETYPE_CNT_PUBLBOX (STR_SVT_MIMETYPE_START+56) +#define STR_SVT_MIMETYPE_CNT_SRCHBOX (STR_SVT_MIMETYPE_START+57) +#define STR_SVT_MIMETYPE_CNT_SUBSCRBOX (STR_SVT_MIMETYPE_START+58) +#define STR_SVT_MIMETYPE_CNT_BOOKMARK (STR_SVT_MIMETYPE_START+59) +#define STR_SVT_MIMETYPE_CNT_CDF (STR_SVT_MIMETYPE_START+60) +#define STR_SVT_MIMETYPE_CNT_CDFSUB (STR_SVT_MIMETYPE_START+61) +#define STR_SVT_MIMETYPE_CNT_CDFITEM (STR_SVT_MIMETYPE_START+62) +#define STR_SVT_MIMETYPE_CNT_STARCHANNEL (STR_SVT_MIMETYPE_START+63) +#define STR_SVT_MIMETYPE_CNT_TRASHBOX (STR_SVT_MIMETYPE_START+64) +#define STR_SVT_MIMETYPE_CNT_TRASH (STR_SVT_MIMETYPE_START+65) +#define STR_SVT_MIMETYPE_CNT_REMOV_VOL (STR_SVT_MIMETYPE_START+66) +#define STR_SVT_MIMETYPE_CNT_FIX_VOL (STR_SVT_MIMETYPE_START+67) +#define STR_SVT_MIMETYPE_CNT_REM_VOL (STR_SVT_MIMETYPE_START+68) +#define STR_SVT_MIMETYPE_CNT_RAM_VOL (STR_SVT_MIMETYPE_START+69) +#define STR_SVT_MIMETYPE_CNT_CDROM (STR_SVT_MIMETYPE_START+70) +#define STR_SVT_MIMETYPE_CNT_DISK_35 (STR_SVT_MIMETYPE_START+71) +#define STR_SVT_MIMETYPE_CNT_DISK_525 (STR_SVT_MIMETYPE_START+72) +#define STR_SVT_MIMETYPE_CNT_TAPEDRIVE (STR_SVT_MIMETYPE_START+73) +#define STR_SVT_MIMETYPE_APP_GAL (STR_SVT_MIMETYPE_START+74) +#define STR_SVT_MIMETYPE_APP_GAL_THEME (STR_SVT_MIMETYPE_START+75) +#define STR_SVT_MIMETYPE_CNT_SEPARATOR (STR_SVT_MIMETYPE_START+76) +#define STR_SVT_MIMETYPE_APP_STARW_GLOB (STR_SVT_MIMETYPE_START+77) +#define STR_SVT_MIMETYPE_APP_SDM (STR_SVT_MIMETYPE_START+78) +#define STR_SVT_MIMETYPE_APP_SMD (STR_SVT_MIMETYPE_START+79) +#define STR_SVT_MIMETYPE_APP_STARW_WEB (STR_SVT_MIMETYPE_START+80) +#define STR_SVT_MIMETYPE_SCHEDULE (STR_SVT_MIMETYPE_START+81) +#define STR_SVT_MIMETYPE_SCHEDULE_EVT (STR_SVT_MIMETYPE_START+82) +#define STR_SVT_MIMETYPE_SCHEDULE_TASK (STR_SVT_MIMETYPE_START+83) +#define STR_SVT_MIMETYPE_SCHEDULE_FEVT (STR_SVT_MIMETYPE_START+84) +#define STR_SVT_MIMETYPE_SCHEDULE_FTASK (STR_SVT_MIMETYPE_START+85) +#define STR_SVT_MIMETYPE_FRAMESET (STR_SVT_MIMETYPE_START+86) +#define STR_SVT_MIMETYPE_MACRO (STR_SVT_MIMETYPE_START+87) +#define STR_SVT_MIMETYPE_CNT_SFSYSFOLDER (STR_SVT_MIMETYPE_START+88) +#define STR_SVT_MIMETYPE_CNT_SFSYSFILE (STR_SVT_MIMETYPE_START+89) +#define STR_SVT_MIMETYPE_APP_TEMPLATE (STR_SVT_MIMETYPE_START+90) +#define STR_SVT_MIMETYPE_IMAGE_GENERIC (STR_SVT_MIMETYPE_START+91) +#define STR_SVT_MIMETYPE_APP_MSEXCEL (STR_SVT_MIMETYPE_START+92) +#define STR_SVT_MIMETYPE_APP_MSEXCEL_TEMPL (STR_SVT_MIMETYPE_START+93) +#define STR_SVT_MIMETYPE_APP_MSPPOINT (STR_SVT_MIMETYPE_START+94) +#define STR_SVT_MIMETYPE_TEXT_VCALENDAR (STR_SVT_MIMETYPE_START+95) +#define STR_SVT_MIMETYPE_TEXT_ICALENDAR (STR_SVT_MIMETYPE_START+96) +#define STR_SVT_MIMETYPE_TEXT_XMLICALENDAR (STR_SVT_MIMETYPE_START+97) +#define STR_SVT_MIMETYPE_TEXT_CDE_CALENDAR_APP (STR_SVT_MIMETYPE_START+98) +#define STR_SVT_MIMETYPE_INET_MSG_RFC822 (STR_SVT_MIMETYPE_START+99) +#define STR_SVT_MIMETYPE_INET_MULTI_ALTERNATIVE (STR_SVT_MIMETYPE_START+100) +#define STR_SVT_MIMETYPE_INET_MULTI_DIGEST (STR_SVT_MIMETYPE_START+101) +#define STR_SVT_MIMETYPE_INET_MULTI_PARALLEL (STR_SVT_MIMETYPE_START+102) +#define STR_SVT_MIMETYPE_INET_MULTI_RELATED (STR_SVT_MIMETYPE_START+103) +#define STR_SVT_MIMETYPE_INET_MULTI_MIXED (STR_SVT_MIMETYPE_START+104) +#define STR_SVT_MIMETYPE_APP_IMPRESSPACKED (STR_SVT_MIMETYPE_START+105) +#define STR_SVT_MIMETYPE_APP_JAR (STR_SVT_MIMETYPE_START+106) +#define STR_SVT_MIMETYPE_IMAGE_PNG (STR_SVT_MIMETYPE_START+107) +#define STR_SVT_MIMETYPE_IMAGE_TIFF (STR_SVT_MIMETYPE_START+108) -#define STR_SVT_MIMETYPE_APP_SXCALC (STR_SVT_MIMETYPE_START+107) -#define STR_SVT_MIMETYPE_APP_SXCHART (STR_SVT_MIMETYPE_START+108) -#define STR_SVT_MIMETYPE_APP_SXDRAW (STR_SVT_MIMETYPE_START+109) -#define STR_SVT_MIMETYPE_APP_SXMATH (STR_SVT_MIMETYPE_START+110) -#define STR_SVT_MIMETYPE_APP_SXWRITER (STR_SVT_MIMETYPE_START+111) -#define STR_SVT_MIMETYPE_APP_SXIMPRESS (STR_SVT_MIMETYPE_START+112) -#define STR_SVT_MIMETYPE_APP_SXGLOBAL (STR_SVT_MIMETYPE_START+113) -#define STR_SVT_MIMETYPE_APP_SXIPACKED (STR_SVT_MIMETYPE_START+114) +#define STR_SVT_MIMETYPE_APP_SXCALC (STR_SVT_MIMETYPE_START+109) +#define STR_SVT_MIMETYPE_APP_SXCHART (STR_SVT_MIMETYPE_START+110) +#define STR_SVT_MIMETYPE_APP_SXDRAW (STR_SVT_MIMETYPE_START+111) +#define STR_SVT_MIMETYPE_APP_SXMATH (STR_SVT_MIMETYPE_START+112) +#define STR_SVT_MIMETYPE_APP_SXWRITER (STR_SVT_MIMETYPE_START+113) +#define STR_SVT_MIMETYPE_APP_SXIMPRESS (STR_SVT_MIMETYPE_START+114) +#define STR_SVT_MIMETYPE_APP_SXGLOBAL (STR_SVT_MIMETYPE_START+115) +#define STR_SVT_MIMETYPE_APP_SXIPACKED (STR_SVT_MIMETYPE_START+116) #define STR_SVT_MIMETYPE_END (STR_SVT_MIMETYPE_APP_SXIPACKED) #define STR_COLUM_DT_AUTO (STR_SVT_MIMETYPE_END+1) diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 0b9efdf22afd..81d24f7a4a8e 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -298,6 +298,7 @@ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1] { CONTENT_TYPE_STR_AUDIO_AIFF, CONTENT_TYPE_AUDIO_AIFF, "aif" }, { CONTENT_TYPE_STR_AUDIO_BASIC, CONTENT_TYPE_AUDIO_BASIC, "au" }, { CONTENT_TYPE_STR_AUDIO_MIDI, CONTENT_TYPE_AUDIO_MIDI, "mid" }, + { CONTENT_TYPE_STR_AUDIO_VORBIS, CONTENT_TYPE_AUDIO_VORBIS, "ogg" }, { CONTENT_TYPE_STR_AUDIO_WAV, CONTENT_TYPE_AUDIO_WAV, "wav" }, { CONTENT_TYPE_STR_IMAGE_GENERIC, CONTENT_TYPE_IMAGE_GENERIC, "tmp" }, { CONTENT_TYPE_STR_IMAGE_GIF, CONTENT_TYPE_IMAGE_GIF, "gif" }, @@ -328,6 +329,7 @@ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1] { CONTENT_TYPE_STR_TEXT_VCALENDAR, CONTENT_TYPE_TEXT_VCALENDAR, "vcs" }, { CONTENT_TYPE_STR_TEXT_VCARD, CONTENT_TYPE_TEXT_VCARD, "vcf" }, + { CONTENT_TYPE_STR_VIDEO_THEORA, CONTENT_TYPE_VIDEO_THEORA, "ogg" }, { CONTENT_TYPE_STR_VIDEO_VDO, CONTENT_TYPE_VIDEO_VDO, "vdo" }, { CONTENT_TYPE_STR_VIDEO_MSVIDEO, CONTENT_TYPE_VIDEO_MSVIDEO, "avi" }, { CONTENT_TYPE_STR_X_STARMAIL, CONTENT_TYPE_X_STARMAIL, "smd" }, @@ -356,6 +358,7 @@ USHORT const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1] STR_SVT_MIMETYPE_AUDIO_AIFF, // CONTENT_TYPE_AUDIO_AIFF STR_SVT_MIMETYPE_AUDIO_BASIC, // CONTENT_TYPE_AUDIO_BASIC STR_SVT_MIMETYPE_AUDIO_MIDI, // CONTENT_TYPE_AUDIO_MIDI + STR_SVT_MIMETYPE_AUDIO_VORBIS, // CONTENT_TYPE_AUDIO_VORBIS STR_SVT_MIMETYPE_AUDIO_WAV, // CONTENT_TYPE_AUDIO_WAV STR_SVT_MIMETYPE_IMAGE_GIF, // CONTENT_TYPE_IMAGE_GIF STR_SVT_MIMETYPE_IMAGE_JPEG, // CONTENT_TYPE_IMAGE_JPEG @@ -367,6 +370,7 @@ USHORT const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1] STR_SVT_MIMETYPE_TEXT_PLAIN, // CONTENT_TYPE_TEXT_PLAIN STR_SVT_MIMETYPE_TEXT_URL, // CONTENT_TYPE_TEXT_URL STR_SVT_MIMETYPE_TEXT_VCARD, // CONTENT_TYPE_TEXT_VCARD + STR_SVT_MIMETYPE_VIDEO_THEORA, // CONTENT_TYPE_VIDEO_THEORA STR_SVT_MIMETYPE_VIDEO_VDO, // CONTENT_TYPE_VIDEO_VDO STR_SVT_MIMETYPE_VIDEO_MSVIDEO, // CONTENT_TYPE_VIDEO_MSVIDEO STR_SVT_MIMETYPE_CNT_MSG, // CONTENT_TYPE_X_CNT_MESSAGE @@ -502,6 +506,7 @@ MediaTypeEntry const aStaticExtensionMap[] { "met", CONTENT_TYPE_IMAGE_GENERIC, "" }, { "mid", CONTENT_TYPE_AUDIO_MIDI, "" }, { "midi", CONTENT_TYPE_AUDIO_MIDI, "" }, + { "ogg", CONTENT_TYPE_AUDIO_VORBIS, "" }, { "pbm", CONTENT_TYPE_IMAGE_GENERIC, "" }, { "pcd", CONTENT_TYPE_IMAGE_GENERIC, "" }, { "pct", CONTENT_TYPE_IMAGE_GENERIC, "" }, diff --git a/svl/source/misc/mediatyp.src b/svl/source/misc/mediatyp.src index 333963c1d2d9..6085155fb0f7 100644 --- a/svl/source/misc/mediatyp.src +++ b/svl/source/misc/mediatyp.src @@ -110,6 +110,87 @@ String STR_SVT_MIMETYPE_AUDIO_MIDI Text [ en-US ] = "Audio file" ; }; +String STR_SVT_MIMETYPE_AUDIO_VORBIS +{ + Text [ de ] = "Audio-Datei" ; + Text [ en-US ] = "Audio file" ; + Text [ af ] = "Oudiolêer" ; + Text [ ar ] = "ملف صوتي" ; + Text [ as-IN ] = "অডিঅ' ফাইল" ; + Text [ be-BY ] = "Гукавы файл" ; + Text [ bg ] = "Аудиофайл" ; + Text [ br ] = "Restr klev" ; + Text [ bs ] = "Audio datoteka" ; + Text [ ca ] = "Fitxer d'àudio" ; + Text [ cs ] = "Zvukový soubor" ; + Text [ cy ] = "Ffeil sain" ; + Text [ da ] = "Lydfil" ; + Text [ el ] = "Αρχείο ήχου" ; + Text [ en-GB ] = "Audio file" ; + Text [ en-ZA ] = "Audio file" ; + Text [ eo ] = "Audio file" ; + Text [ es ] = "Archivo audio" ; + Text [ et ] = "Audiofail" ; + Text [ fa ] = "پرونده‌ی صوتی" ; + Text [ fi ] = "Äänitiedosto" ; + Text [ fr ] = "Fichier audio" ; + Text [ ga ] = "Comhad fuaime" ; + Text [ gu ] = "ઓડિયો ફાઈલ" ; + Text [ gu-IN ] = "ઓડિયો ફાઈલ" ; + Text [ he ] = "קובץ שמע" ; + Text [ hi-IN ] = "Audio file" ; + Text [ hr ] = "Zvučna datoteka" ; + Text [ hu ] = "Hangfájl" ; + Text [ it ] = "File audio" ; + Text [ ja ] = "オーディオ ファイル" ; + Text [ ka ] = "ხმოვანი ფაილი" ; + Text [ km ] = "ឯកសារ​សម្លេង" ; + Text [ ko ] = "오디오 파일" ; + Text [ ku ] = "Pelgeha deng" ; + Text [ lt ] = "Garso failas" ; + Text [ mk ] = "Аудиодатотека" ; + Text [ ml-IN ] = "ഓഡിയോ ഫയല്" ; + Text [ mr-IN ] = "श्राव्य धारिका" ; + Text [ nb ] = "Lydfil" ; + Text [ ne ] = "अडियो फाइल" ; + Text [ nl ] = "Audiobestand" ; + Text [ nn ] = "Lydfil" ; + Text [ nr ] = "Ifayili elilalelwako" ; + Text [ ns ] = "Faele ya odiyo" ; + Text [ or-IN ] = "ଅଡିଓ ଫାଇଲ" ; + Text [ pa-IN ] = "ਆਡੀਓ ਫਾਇਲ" ; + Text [ pl ] = "Plik dźwiękowy" ; + Text [ pt ] = "Ficheiro áudio" ; + Text [ pt-BR ] = "Arquivo de áudio" ; + Text [ ru ] = "Аудио файл" ; + Text [ rw ] = "Audio file" ; + Text [ sh-YU ] = "Zvučna datoteka" ; + Text [ sk ] = "Zvukový súbor" ; + Text [ sl ] = "Zvočna datoteka" ; + Text [ sr-CS ] = "Звучна датотека" ; + Text [ ss ] = "I-Odiyofayela" ; + Text [ st ] = "Audiyo faele" ; + Text [ sv ] = "Audio-fil" ; + Text [ sw-TZ ] = "Faili la kusikia" ; + Text [ ta ] = "Audio file" ; + Text [ ta-IN ] = "Audio file" ; + Text [ te-IN ] = "శ్రవణ దస్త్రం" ; + Text [ tg ] = "Аудио-дафтар" ; + Text [ th ] = "Audio file" ; + Text [ ti-ER ] = "ናይ ድምጺ ፋይል" ; + Text [ tr ] = "Ses dosyası" ; + Text [ ts ] = "Fayili ya Xitlanga-mpfumawulo" ; + Text [ uk ] = "Audio file" ; + Text [ ur-IN ] = "آڈیوفائل" ; + Text [ ve ] = "Faela ya odio" ; + Text [ vi ] = "Tập tin âm thanh" ; + Text [ xh ] = "Ifayili Yokumanyelwayo" ; + Text [ zh-CN ] = "声频文件" ; + Text [ zh-TW ] = "聲頻檔案" ; + Text [ zu ] = "Ifayela eliveza umsindo" ; + Text [ x-comment ] = " "; +}; + String STR_SVT_MIMETYPE_AUDIO_WAV { Text [ en-US ] = "Audio file" ; @@ -155,6 +236,87 @@ String STR_SVT_MIMETYPE_TEXT_VCARD Text [ en-US ] = "vCard file" ; }; +String STR_SVT_MIMETYPE_VIDEO_THEORA +{ + Text [ de ] = "Video-Datei" ; + Text [ en-US ] = "Video file" ; + Text [ af ] = "Videolêer" ; + Text [ ar ] = "ملف فيديو" ; + Text [ as-IN ] = "ভিডিঅ' ফাইল" ; + Text [ be-BY ] = "Файл відэа" ; + Text [ bg ] = "Видеофайл" ; + Text [ br ] = "Restr video" ; + Text [ bs ] = "Video datoteka" ; + Text [ ca ] = "Fitxer de vídeo" ; + Text [ cs ] = "Video soubor" ; + Text [ cy ] = "Ffeil fideo" ; + Text [ da ] = "Video-fil" ; + Text [ el ] = "Αρχείο Video" ; + Text [ en-GB ] = "Video file" ; + Text [ en-ZA ] = "Video file" ; + Text [ eo ] = "Video file" ; + Text [ es ] = "Archivo vídeo" ; + Text [ et ] = "Videofail" ; + Text [ fa ] = "پرونده‌ی ویدئویی" ; + Text [ fi ] = "Videotiedosto" ; + Text [ fr ] = "Fichier vidéo" ; + Text [ ga ] = "Físchomhad" ; + Text [ gu ] = "વીડિયો ફાઈલ" ; + Text [ gu-IN ] = "વીડિયો ફાઈલ" ; + Text [ he ] = "קובץ וידיאו" ; + Text [ hi-IN ] = "Video file" ; + Text [ hr ] = "Video datoteka" ; + Text [ hu ] = "Videofájl" ; + Text [ it ] = "File video" ; + Text [ ja ] = "ビデオ ファイル" ; + Text [ ka ] = "ვიდეო ფაილი" ; + Text [ km ] = "ឯកសារ​វីដេអូ" ; + Text [ ko ] = "비디오 파일" ; + Text [ ku ] = "Pelgeha vîdeo" ; + Text [ lt ] = "Vaizdo failas" ; + Text [ mk ] = "Видеодатотека" ; + Text [ ml-IN ] = "വീഡിയോ ഫയല്" ; + Text [ mr-IN ] = "चित्रमुद्रक धारिका" ; + Text [ nb ] = "Videofil" ; + Text [ ne ] = "भिडियो फाइल" ; + Text [ nl ] = "Videobestand" ; + Text [ nn ] = "Videofil" ; + Text [ nr ] = "Ifayili levidiyo" ; + Text [ ns ] = "Faele ya bidio" ; + Text [ or-IN ] = "ଭିଡିଓ ଫାଇଲ" ; + Text [ pa-IN ] = "ਵੀਡਿਓ ਫਾਇਲ" ; + Text [ pl ] = "Plik filmowy" ; + Text [ pt ] = "Ficheiro de vídeo" ; + Text [ pt-BR ] = "Arquivo de vídeo" ; + Text [ ru ] = "Файл видео" ; + Text [ rw ] = "Video file" ; + Text [ sh-YU ] = "Video datoteka" ; + Text [ sk ] = "Video súbor" ; + Text [ sl ] = "Video-datoteka" ; + Text [ sr-CS ] = "Видео датотека" ; + Text [ ss ] = "Ividiyofayela" ; + Text [ st ] = "Bideo faele" ; + Text [ sv ] = "Video-fil" ; + Text [ sw-TZ ] = "Faili la video" ; + Text [ ta ] = "Video file" ; + Text [ ta-IN ] = "Video file" ; + Text [ te-IN ] = "దృశ్య దస్త్రము" ; + Text [ tg ] = "Видео-дафтар" ; + Text [ th ] = "Video file" ; + Text [ ti-ER ] = "ናይ ቪድዮ ፋይል" ; + Text [ tr ] = "Görüntü dosyası" ; + Text [ ts ] = "Fayili ya Vhidiyo" ; + Text [ uk ] = "Video file" ; + Text [ ur-IN ] = "وڈیوفائل" ; + Text [ ve ] = "Faela ya vidio" ; + Text [ vi ] = "Tập tin ảnh động" ; + Text [ xh ] = "Ifayili yevidiyo" ; + Text [ zh-CN ] = "影视文件" ; + Text [ zh-TW ] = "視頻檔案" ; + Text [ zu ] = "Ifayela levidiyo" ; + Text [ x-comment ] = " "; +}; + String STR_SVT_MIMETYPE_VIDEO_VDO { Text [ en-US ] = "Video file" ; -- cgit From 6305b54dcc57e64fc37082c7d571435f3ce0b7a4 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:33:13 +0200 Subject: patches/gstreamer/gstreamer-avmedia-file-types.diff: gstreamer - add flac to media filters list --- avmedia/source/viewer/mediawindow.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index b2d1e5162cb5..2cac3c19ebb3 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -368,6 +368,7 @@ void MediaWindow::getMediaFilters( FilterNameVector& rFilterNameVector ) "AU Audio", "au", "AVI", "avi", "CD Audio", "cda", + "FLAC Audio", "flac", "MIDI Audio", "mid;midi", "MPEG Audio", "mp2;mp3;mpa", "MPEG Video", "mpg;mpeg;mpv;mp4", -- cgit From ac78f4a9b199ea0f6f4afe58034fb82c9af11672 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:34:55 +0200 Subject: patches/gstreamer/gstreamer-vcl.diff: gstreamer - make it possible to forward key events to child window so that gstreamer receives them --- vcl/inc/vcl/salobj.hxx | 2 ++ vcl/inc/vcl/syschild.hxx | 1 + vcl/source/window/syschild.cxx | 6 ++++++ vcl/unx/gtk/window/gtkobject.cxx | 9 +++++++++ vcl/unx/inc/plugins/gtk/gtkobject.hxx | 2 ++ 5 files changed, 20 insertions(+) diff --git a/vcl/inc/vcl/salobj.hxx b/vcl/inc/vcl/salobj.hxx index e453bf5c6f87..2b22cfe3eb7b 100644 --- a/vcl/inc/vcl/salobj.hxx +++ b/vcl/inc/vcl/salobj.hxx @@ -71,6 +71,8 @@ public: virtual void SetBackground() = 0; virtual void SetBackground( SalColor nSalColor ) = 0; + virtual void SetForwardKey( BOOL bEnable ) {} + virtual const SystemEnvData* GetSystemData() const = 0; void SetCallback( void* pInst, SALOBJECTPROC pProc ) diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx index da4ffcd51a22..d3678b318745 100644 --- a/vcl/inc/vcl/syschild.hxx +++ b/vcl/inc/vcl/syschild.hxx @@ -62,6 +62,7 @@ public: // however, this might not always be required void EnableEraseBackground( BOOL bEnable = TRUE ); BOOL IsEraseBackgroundEnabled(); + void SetForwardKey( BOOL bEnable ); }; #endif // _SV_SYSCHILD_HXX diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index ef71f83df1ee..0ff9189f4fdb 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -190,3 +190,9 @@ BOOL SystemChildWindow::IsEraseBackgroundEnabled() else return FALSE; } + +void SystemChildWindow::SetForwardKey( BOOL bEnable ) +{ + if ( mpWindowImpl->mpSysObj ) + mpWindowImpl->mpSysObj->SetForwardKey( bEnable ); +} diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index 2a2bbe78078a..aefb60f5606b 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -209,3 +209,12 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object ) pThis->m_pSocket = NULL; } } + +void GtkSalObject::SetForwardKey( BOOL bEnable ) +{ + printf ("GtkSalObject::SetForwardKey\n"); + if( bEnable ) + gtk_widget_add_events( GTK_WIDGET( m_pSocket ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE ); + else + gtk_widget_set_events( GTK_WIDGET( m_pSocket ), ~(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE) & gtk_widget_get_events( GTK_WIDGET( m_pSocket ) ) ); +} diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx index ea740249f1c6..f77d4949c801 100644 --- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx @@ -62,6 +62,8 @@ public: virtual void SetBackground(); virtual void SetBackground( SalColor nSalColor ); + virtual void SetForwardKey( BOOL bEnable ); + virtual const SystemEnvData* GetSystemData() const; }; -- cgit From 2eea82e0b3bc518c3bbb79dbd45c87eb171a8542 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 16 Sep 2010 15:55:47 +0200 Subject: avmedia-source-gstreamer-*.diff: gstreamer - implementation --- avmedia/source/gstreamer/ChangeLog | 112 +++++ avmedia/source/gstreamer/exports.dxp | 3 + avmedia/source/gstreamer/gstcommon.hxx | 75 ++++ avmedia/source/gstreamer/gstframegrabber.cxx | 236 ++++++++++ avmedia/source/gstreamer/gstframegrabber.hxx | 70 +++ avmedia/source/gstreamer/gstmanager.cxx | 106 +++++ avmedia/source/gstreamer/gstmanager.hxx | 66 +++ avmedia/source/gstreamer/gstplayer.cxx | 620 +++++++++++++++++++++++++++ avmedia/source/gstreamer/gstplayer.hxx | 112 +++++ avmedia/source/gstreamer/gstuno.cxx | 103 +++++ avmedia/source/gstreamer/gstwindow.cxx | 357 +++++++++++++++ avmedia/source/gstreamer/gstwindow.hxx | 111 +++++ avmedia/source/gstreamer/makefile.mk | 77 ++++ 13 files changed, 2048 insertions(+) create mode 100644 avmedia/source/gstreamer/ChangeLog create mode 100644 avmedia/source/gstreamer/exports.dxp create mode 100644 avmedia/source/gstreamer/gstcommon.hxx create mode 100644 avmedia/source/gstreamer/gstframegrabber.cxx create mode 100644 avmedia/source/gstreamer/gstframegrabber.hxx create mode 100644 avmedia/source/gstreamer/gstmanager.cxx create mode 100644 avmedia/source/gstreamer/gstmanager.hxx create mode 100644 avmedia/source/gstreamer/gstplayer.cxx create mode 100644 avmedia/source/gstreamer/gstplayer.hxx create mode 100644 avmedia/source/gstreamer/gstuno.cxx create mode 100644 avmedia/source/gstreamer/gstwindow.cxx create mode 100644 avmedia/source/gstreamer/gstwindow.hxx create mode 100644 avmedia/source/gstreamer/makefile.mk diff --git a/avmedia/source/gstreamer/ChangeLog b/avmedia/source/gstreamer/ChangeLog new file mode 100644 index 000000000000..8671b11a9720 --- /dev/null +++ b/avmedia/source/gstreamer/ChangeLog @@ -0,0 +1,112 @@ +2006-09-22 Radek Doulik + + * gstplayer.cxx (processSyncMessage): remember GstXOverlay + (processMessage): explicit expose when we reach paused state - + this mean that now once stream is loaded/video inserted, the 1st + frame is rendered + (setMediaTime): if not playing set PAUSED state again, seems like + seek is changing state to PLAYING. this fixes problem when stop + seeked to begin and started playing again + +2006-09-21 Radek Doulik + + * gstplayer.cxx (processSyncMessage): when error occurs, set the + condition so that OOo does'n waste time waiting for us to finish + reaching PAUSED state + +2006-09-19 Radek Doulik + + * gstplayer.cxx (processSyncMessage): set condition even if we + weren't able to get video size - might be audio only stream + (getPreferredPlayerWindowSize): init size to 0, 0 - in case we + don't have video size, it will fallback to system media window + content (some icon) + +2006-08-31 Radek Doulik + + * gstplayer.cxx (processSyncMessage): when we get to paused state, + get stream-info from playbin and look for video size. set + condition when done + (Player): added width, height, size condition + (preparePlaybin): new helper method, extracted from create + method. use fake video sink in the beggining so that we don't get + xwindow-id message too early + (getPreferredPlayerWindowSize): wait for size condition to be sure + we know video size (if possible). reset video sink to default one + (NULL) and set state to READY and immediatelly to PAUSE so that + the default sink is relinked + +2006-08-16 Radek Doulik + + * gstplayer.cxx (create): set state to PAUSED so that we can query + duration ASAP + (processMessage): watch for state changed and query duration when + going to PAUSED state + +2006-08-15 Radek Doulik + + * makefile.mk: require gstreamer-plugins-base-0.10 and link with + gst interfaces library + + * gstwindow.cxx: make it build + + * gstplayer.cxx: removed WINNT ifdefs (relict from time when I + thought Cedric develops on win architecture) + (gst_pipeline_bus_callback): added sync handler for setting + xwindow id to to video sink + (processSyncMessage): new metrhod, process message from sync + handler + (create): set playbin state to READY so that playback start is + faster + (createPlayerWindow): implemented, we pass xwindow id in 3rd + argument + +2006-08-04 Radek Doulik + + * gstplayer.cxx (create): add bus watch, watch for EOS in + processMessage method (called from watch callback) + +2006-08-02 Radek Doulik + + * gstplayer.cxx: test for mpPlaybin != NULL before using it, + initialize it in constructor to NULL and also reset it to NULL + after unrefing + (getDuration): check for sucessful query and the right format + (getMediaTime): ditto, + (setMediaTime): implemented + +2006-08-01 Radek Doulik + + * gstwindow.hxx: removed mpWndClass for now, so that the rest + compiles + + * gstuno.cxx (component_getFactory): s/DirectX/GStreamer so that + component is loaded + + * gstplayer.cxx (Player::Player): do not create gerror object, it + is noit needed, free the error object only if created during + initialization of gstremer + (Player::create, start, stop): use g_main_loop only on windows + (create): fixed ascURL declaration, added rtl namespace prefix + (setMute): set mbMuted + (setVolumeDB): convert avmedia volume to gstreamer volume, added + missing NULL to the end of g_object_set call + (getVolumeDB): convert gstreamer volume back to avmedia volume + + * gstplayer.hxx: keep g_main_loop only on win platform. make + mnUnmutedVolume double, moved mbInitialized to the end to quiet + compiler warning + + * gstcommon.hxx: removed wrong #include + + * renamed source files, prefixed the names with gst so that obj + file names do not clash with xine object files + + * makefile.mk: changed PRJNAME and TARGET to reflect + gstreamer. enabled build on unix as well. removed win library + references. removed source files which are not yet ported from + SLOFILES list. + +2006-08-31 Radek Doulik + + * imported initial sources from Cedric Bosdonnat \ No newline at end of file diff --git a/avmedia/source/gstreamer/exports.dxp b/avmedia/source/gstreamer/exports.dxp new file mode 100644 index 000000000000..9630d7e06768 --- /dev/null +++ b/avmedia/source/gstreamer/exports.dxp @@ -0,0 +1,3 @@ +component_getImplementationEnvironment +component_writeInfo +component_getFactory diff --git a/avmedia/source/gstreamer/gstcommon.hxx b/avmedia/source/gstreamer/gstcommon.hxx new file mode 100644 index 000000000000..d3e1f2419b53 --- /dev/null +++ b/avmedia/source/gstreamer/gstcommon.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GSTCOMMON_HXX +#define _GSTCOMMON_HXX + +#include + +#ifndef _OSL_MUTEX_HXX_ +#include +#endif +#ifndef _DEBUG_HXX +#include +#endif +#ifndef _STREAM_HXX +#include +#endif +#ifndef _STRING_HXX +#include +#endif +#ifndef _URLOBJ_HXX +#include +#endif +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include +#endif +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include +#endif +#ifndef _CPPUHELPER_WEAK_HXX_ +#include +#endif +#ifndef _CPPUHELPER_FACTORY_HXX_ +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define WM_GRAPHNOTIFY (WM_USER + 567) + +#endif // _GSTCOMMOM_HXX diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx new file mode 100644 index 000000000000..513a2c2a2d18 --- /dev/null +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -0,0 +1,236 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "framegrabber.hxx" +#include "player.hxx" + +#include +#include +#include + +#define AVMEDIA_GST_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_GStreamer" +#define AVMEDIA_GST_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_GStreamer" + +using namespace ::com::sun::star; + +namespace avmedia { namespace gstreamer { + +// ---------------- +// - FrameGrabber - +// ---------------- + +FrameGrabber::FrameGrabber( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : + mxMgr( rxMgr ) +{ + ::CoInitialize( NULL ); +} + +// ------------------------------------------------------------------------------ + +FrameGrabber::~FrameGrabber() +{ + ::CoUninitialize(); +} + +// ------------------------------------------------------------------------------ + +IMediaDet* FrameGrabber::implCreateMediaDet( const ::rtl::OUString& rURL ) const +{ + IMediaDet* pDet = NULL; + + if( SUCCEEDED( CoCreateInstance( CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER, IID_IMediaDet, (void**) &pDet ) ) ) + { + String aLocalStr; + + if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( rURL, aLocalStr ) && aLocalStr.Len() ) + { + if( !SUCCEEDED( pDet->put_Filename( ::SysAllocString( aLocalStr.GetBuffer() ) ) ) ) + { + pDet->Release(); + pDet = NULL; + } + } + } + + return pDet; +} + +// ------------------------------------------------------------------------------ + +bool FrameGrabber::create( const ::rtl::OUString& rURL ) +{ + // just check if a MediaDet interface can be created with the given URL + IMediaDet* pDet = implCreateMediaDet( rURL ); + + if( pDet ) + { + maURL = rURL; + pDet->Release(); + pDet = NULL; + } + else + maURL = ::rtl::OUString(); + + return( maURL.getLength() > 0 ); +} + +// ------------------------------------------------------------------------------ + +uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMediaTime ) + throw (uno::RuntimeException) +{ + uno::Reference< graphic::XGraphic > xRet; + IMediaDet* pDet = implCreateMediaDet( maURL ); + + if( pDet ) + { + double fLength; + long nStreamCount; + bool bFound = false; + + if( SUCCEEDED( pDet->get_OutputStreams( &nStreamCount ) ) ) + { + for( long n = 0; ( n < nStreamCount ) && !bFound; ++n ) + { + GUID aMajorType; + + if( SUCCEEDED( pDet->put_CurrentStream( n ) ) && + SUCCEEDED( pDet->get_StreamType( &aMajorType ) ) && + ( aMajorType == MEDIATYPE_Video ) ) + { + bFound = true; + } + } + } + + if( bFound && + ( S_OK == pDet->get_StreamLength( &fLength ) ) && + ( fLength > 0.0 ) && ( fMediaTime >= 0.0 ) && ( fMediaTime <= fLength ) ) + { + AM_MEDIA_TYPE aMediaType; + long nWidth = 0, nHeight = 0, nSize = 0; + + if( SUCCEEDED( pDet->get_StreamMediaType( &aMediaType ) ) ) + { + if( ( aMediaType.formattype == FORMAT_VideoInfo ) && + ( aMediaType.cbFormat >= sizeof( VIDEOINFOHEADER ) ) ) + { + VIDEOINFOHEADER* pVih = reinterpret_cast< VIDEOINFOHEADER* >( aMediaType.pbFormat ); + + nWidth = pVih->bmiHeader.biWidth; + nHeight = pVih->bmiHeader.biHeight; + + if( nHeight < 0 ) + nHeight *= -1; + } + + if( aMediaType.cbFormat != 0 ) + { + ::CoTaskMemFree( (PVOID) aMediaType.pbFormat ); + aMediaType.cbFormat = 0; + aMediaType.pbFormat = NULL; + } + + if( aMediaType.pUnk != NULL ) + { + aMediaType.pUnk->Release(); + aMediaType.pUnk = NULL; + } + } + + if( ( nWidth > 0 ) && ( nHeight > 0 ) && + SUCCEEDED( pDet->GetBitmapBits( 0, &nSize, NULL, nWidth, nHeight ) ) && + ( nSize > 0 ) ) + { + char* pBuffer = new char[ nSize ]; + + try + { + if( SUCCEEDED( pDet->GetBitmapBits( fMediaTime, NULL, pBuffer, nWidth, nHeight ) ) ) + { + SvMemoryStream aMemStm( pBuffer, nSize, STREAM_READ | STREAM_WRITE ); + Bitmap aBmp; + + if( aBmp.Read( aMemStm, false ) && !aBmp.IsEmpty() ) + { + const Graphic aGraphic( aBmp ); + xRet = aGraphic.GetXGraphic(); + } + } + } + catch( ... ) + { + } + + delete [] pBuffer; + } + } + + pDet->Release(); + } + + return xRet; +} + +// ------------------------------------------------------------------------------ + +::rtl::OUString SAL_CALL FrameGrabber::getImplementationName( ) + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GST_FRAMEGRABBER_IMPLEMENTATIONNAME ) ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL FrameGrabber::supportsService( const ::rtl::OUString& ServiceName ) + throw (uno::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_GST_FRAMEGRABBER_SERVICENAME ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Sequence< ::rtl::OUString > SAL_CALL FrameGrabber::getSupportedServiceNames( ) + throw (uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString > aRet(1); + aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_GST_FRAMEGRABBER_SERVICENAME ) ); + + return aRet; +} + +} // namespace gstreamer +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx b/avmedia/source/gstreamer/gstframegrabber.hxx new file mode 100644 index 000000000000..11f6b6f8b217 --- /dev/null +++ b/avmedia/source/gstreamer/gstframegrabber.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRAMEGRABBER_HXX +#define _FRAMEGRABBER_HXX + +#include "gstcommon.hxx" + +#ifndef _COM_SUN_STAR_MEDIA_XFRAMEGRABBER_HDL_ +#include "com/sun/star/media/XFrameGrabber.hdl" +#endif + +namespace avmedia { namespace gstreamer { + +// ---------------- +// - FrameGrabber - +// ---------------- + +class FrameGrabber : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XFrameGrabber, + ::com::sun::star::lang::XServiceInfo > +{ +public: + + FrameGrabber( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr ); + ~FrameGrabber(); + + bool create( const ::rtl::OUString& rURL ); + + // XFrameGrabber + virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; + ::rtl::OUString maURL; +}; + +} // namespace gstreamer +} // namespace avmedia + +#endif // _FRAMEGRABBER_HXX diff --git a/avmedia/source/gstreamer/gstmanager.cxx b/avmedia/source/gstreamer/gstmanager.cxx new file mode 100644 index 000000000000..bfb077b25372 --- /dev/null +++ b/avmedia/source/gstreamer/gstmanager.cxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "gstmanager.hxx" +#include "gstplayer.hxx" + +#include + +#define AVMEDIA_GST_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_GStreamer" +#define AVMEDIA_GST_MANAGER_SERVICENAME "com.sun.star.media.Manager" + +#if DEBUG +#define DBG OSL_TRACE +#else +#define DBG(...) +#endif + +using namespace ::com::sun::star; + +namespace avmedia { namespace gstreamer { +// ---------------- +// - Manager - +// ---------------- + +Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : + mxMgr( rxMgr ) +{ + DBG( "avmediagst: Manager::Manager" ); +} + +// ------------------------------------------------------------------------------ + +Manager::~Manager() +{ +} + +// ------------------------------------------------------------------------------ + +uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OUString& rURL ) + throw (uno::RuntimeException) +{ + Player* pPlayer( new Player( mxMgr ) ); + uno::Reference< media::XPlayer > xRet( pPlayer ); + const INetURLObject aURL( rURL ); + + DBG( "avmediagst: Manager::createPlayer" ); + + if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) ) + xRet = uno::Reference< media::XPlayer >(); + + return xRet; +} + +// ------------------------------------------------------------------------------ + +::rtl::OUString SAL_CALL Manager::getImplementationName( ) + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GST_MANAGER_IMPLEMENTATIONNAME ) ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Manager::supportsService( const ::rtl::OUString& ServiceName ) + throw (uno::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_GST_MANAGER_SERVICENAME ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames( ) + throw (uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString > aRet(1); + aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_GST_MANAGER_SERVICENAME ) ); + + return aRet; +} + +} // namespace gstreamer +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstmanager.hxx b/avmedia/source/gstreamer/gstmanager.hxx new file mode 100644 index 000000000000..eebf4edd73fa --- /dev/null +++ b/avmedia/source/gstreamer/gstmanager.hxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _MANAGER_HXX +#define _MANAGER_HXX + +#include "gstcommon.hxx" + +#ifndef _COM_SUN_STAR_MEDIA_XMANAGER_HDL_ +#include "com/sun/star/media/XManager.hdl" +#endif + +// ----------- +// - Manager - +// ----------- + +namespace avmedia { namespace gstreamer { + +class Manager : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XManager, + ::com::sun::star::lang::XServiceInfo > +{ +public: + + Manager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr ); + ~Manager(); + + // XManager + virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > SAL_CALL createPlayer( const ::rtl::OUString& aURL ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; +}; + +} // namespace gstreamer +} // namespace avmedia + +#endif // _MANAGER_HXX diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx new file mode 100644 index 000000000000..1bb8246cc430 --- /dev/null +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -0,0 +1,620 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#ifndef __RTL_USTRING_ +#include +#endif + +#include "gstplayer.hxx" +#include "gstframegrabber.hxx" +#include "gstwindow.hxx" + +#include + +#define AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer" +#define AVMEDIA_GST_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer" + +#if DEBUG +#define DBG OSL_TRACE +#else +#define DBG(...) +#endif + +using namespace ::com::sun::star; + +namespace avmedia { namespace gstreamer { + +// ---------------- +// - Player - +// ---------------- + +Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : + mxMgr( rxMgr ), + mpPlaybin( NULL ), + mbFakeVideo (sal_False ), + mnUnmutedVolume( 0 ), + mbMuted( false ), + mbLooping( false ), + mbInitialized( false ), + mnWindowID( 0 ), + mpXOverlay( NULL ), + mnDuration( 0 ), + mnWidth( 0 ), + mnHeight( 0 ), + maSizeCondition( osl_createCondition() ) +{ + // Initialize GStreamer library + int argc = 1; + char *arguments[] = { "openoffice.org" }; + char** argv = arguments; + GError* pError = NULL; + + mbInitialized = gst_init_check( &argc, &argv, &pError ); + + if (pError != NULL) + // TODO: thow an exception? + g_error_free (pError); +} + +// ------------------------------------------------------------------------------ + +Player::~Player() +{ + // Release the elements and pipeline + if( mbInitialized ) + { + if( mpPlaybin ) + { + gst_element_set_state( mpPlaybin, GST_STATE_NULL ); + gst_object_unref( GST_OBJECT( mpPlaybin ) ); + + mpPlaybin = NULL; + } + + if( mpXOverlay ) { + g_object_unref( G_OBJECT ( mpXOverlay ) ); + mpXOverlay = NULL; + } + } +} + +// ------------------------------------------------------------------------------ + +static gboolean gst_pipeline_bus_callback( GstBus *, GstMessage *message, gpointer data ) +{ + Player* pPlayer = (Player *) data; + + pPlayer->processMessage( message ); + + return TRUE; +} + +static GstBusSyncReply gst_pipeline_bus_sync_handler( GstBus *, GstMessage * message, gpointer data ) +{ + Player* pPlayer = (Player *) data; + + return pPlayer->processSyncMessage( message ); +} + +void Player::processMessage( GstMessage *message ) +{ + //DBG ( "gst message received: src name: %s structure type: %s", + // gst_object_get_name (message->src), + // message->structure ? gst_structure_get_name (message->structure) : ""); + + switch( GST_MESSAGE_TYPE( message ) ) { + case GST_MESSAGE_EOS: + //DBG( "EOS, reset state to NULL" ); + gst_element_set_state( mpPlaybin, GST_STATE_READY ); + break; + case GST_MESSAGE_STATE_CHANGED: + if( message->src == GST_OBJECT( mpPlaybin ) ) { + GstState newstate, pendingstate; + + gst_message_parse_state_changed (message, NULL, &newstate, &pendingstate); + + if( newstate == GST_STATE_PAUSED && + pendingstate == GST_STATE_VOID_PENDING && + mpXOverlay ) + gst_x_overlay_expose( mpXOverlay ); + } + default: + break; + } +} + +GstBusSyncReply Player::processSyncMessage( GstMessage *message ) +{ + DBG( "%p processSyncMessage", this ); + //DBG ( "gst message received: src name: %s structure type: %s", + // gst_object_get_name (message->src), + // message->structure ? gst_structure_get_name (message->structure) : ""); + + if (message->structure) { + if( !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) && mnWindowID != 0 ) { + if( mpXOverlay ) + g_object_unref( G_OBJECT ( mpXOverlay ) ); + mpXOverlay = GST_X_OVERLAY( GST_MESSAGE_SRC( message ) ); + g_object_ref( G_OBJECT ( mpXOverlay ) ); + gst_x_overlay_set_xwindow_id( mpXOverlay, mnWindowID ); + return GST_BUS_DROP; + } + } + + if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_STATE_CHANGED ) { + if( message->src == GST_OBJECT( mpPlaybin ) ) { + GstState newstate, pendingstate; + + gst_message_parse_state_changed (message, NULL, &newstate, &pendingstate); + + DBG( "%p state change received, new state %d", this, newstate ); + if( newstate == GST_STATE_PAUSED && + pendingstate == GST_STATE_VOID_PENDING ) { + + DBG( "%p change to paused received", this ); + + if( mnDuration == 0) { + GstFormat format = GST_FORMAT_TIME; + gint64 gst_duration = 0L; + + if( gst_element_query_duration( mpPlaybin, &format, &gst_duration) && format == GST_FORMAT_TIME && gst_duration > 0L ) + mnDuration = gst_duration; + } + + if( mnWidth == 0 ) { + GList *pStreamInfo = NULL; + + g_object_get( G_OBJECT( mpPlaybin ), "stream-info", &pStreamInfo, NULL ); + + for ( ; pStreamInfo != NULL; pStreamInfo = pStreamInfo->next) { + GObject *pInfo = G_OBJECT( pStreamInfo->data ); + + if( !pInfo ) + continue; + + int nType; + g_object_get( pInfo, "type", &nType, NULL ); + GEnumValue *pValue = g_enum_get_value( G_PARAM_SPEC_ENUM( g_object_class_find_property( G_OBJECT_GET_CLASS( pInfo ), "type" ) )->enum_class, + nType ); + + if( !g_strcasecmp( pValue->value_nick, "video" ) ) { + GstStructure *pStructure; + GstPad *pPad; + + g_object_get( pInfo, "object", &pPad, NULL ); + pStructure = gst_caps_get_structure( GST_PAD_CAPS( pPad ), 0 ); + if( pStructure ) { + gst_structure_get_int( pStructure, "width", &mnWidth ); + gst_structure_get_int( pStructure, "height", &mnHeight ); + DBG( "queried size: %d x %d", mnWidth, mnHeight ); + } + } + } + + sal_Bool aSuccess = osl_setCondition( maSizeCondition ); + DBG( "%p set condition result: %d", this, aSuccess ); + } + } + } + } else if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR ) { + if( mnWidth == 0 ) { + // an error occured, set condition so that OOo thread doesn't wait for us + sal_Bool aSuccess = osl_setCondition( maSizeCondition ); + DBG( "%p set condition result: %d", this, aSuccess ); + } + } + + return GST_BUS_PASS; +} + +void Player::preparePlaybin( const ::rtl::OUString& rURL, bool bFakeVideo ) +{ + GstBus *pBus; + + //sal_Bool aSuccess = osl_setCondition( maSizeCondition ); + //DBG( "%p set condition result: %d", this, aSuccess ); + + if( mpPlaybin != NULL ) { + gst_element_set_state( mpPlaybin, GST_STATE_NULL ); + g_object_unref( mpPlaybin ); + } + + mpPlaybin = gst_element_factory_make( "playbin", NULL ); + + if( bFakeVideo ) + g_object_set( G_OBJECT( mpPlaybin ), "video-sink", gst_element_factory_make( "fakesink", NULL ), NULL ); + + mbFakeVideo = bFakeVideo; + + rtl::OString ascURL = OUStringToOString( rURL, RTL_TEXTENCODING_ASCII_US ); + g_object_set( G_OBJECT( mpPlaybin ), "uri", ascURL.getStr() , NULL ); + + pBus = gst_element_get_bus( mpPlaybin ); + gst_bus_add_watch( pBus, gst_pipeline_bus_callback, this ); + DBG( "%p set sync handler", this ); + gst_bus_set_sync_handler( pBus, gst_pipeline_bus_sync_handler, this ); + g_object_unref( pBus ); +} + +bool Player::create( const ::rtl::OUString& rURL ) +{ + bool bRet = false; + + // create all the elements and link them + + if( mbInitialized ) + { + preparePlaybin( rURL, true ); + + gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); + + bRet = true; + } + + + if( bRet ) + maURL = rURL; + else + maURL = ::rtl::OUString(); + + return bRet; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::start( ) + throw (uno::RuntimeException) +{ + //DBG ("Player::start"); + + // set the pipeline state to READY and run the loop + if( mbInitialized && NULL != mpPlaybin ) + { + gst_element_set_state( mpPlaybin, GST_STATE_PLAYING ); + } +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::stop( ) + throw (uno::RuntimeException) +{ + // set the pipeline in PAUSED STATE + if( mpPlaybin ) + gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); + + DBG( "stop %p", mpPlaybin ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Player::isPlaying() + throw (uno::RuntimeException) +{ + bool bRet = false; + + // return whether the pipeline is in PLAYING STATE or not + if( mbInitialized && mpPlaybin ) + { + bRet = GST_STATE_PLAYING == GST_STATE( mpPlaybin ); + } + + DBG( "isPlaying %d", bRet ); + + return bRet; +} + +// ------------------------------------------------------------------------------ + +double SAL_CALL Player::getDuration( ) + throw (uno::RuntimeException) +{ + // slideshow checks for non-zero duration, so cheat here + double duration = 0.01; + + if( mpPlaybin && mnDuration > 0 ) { + duration = mnDuration / 1E9; + + //DBG( "gst duration: %lld ns duration: %lf s", gst_duration, duration ); + } + + return duration; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::setMediaTime( double fTime ) + throw (uno::RuntimeException) +{ + if( mpPlaybin ) { + gint64 gst_position = llround (fTime * 1E9); + + gst_element_seek( mpPlaybin, 1.0, + GST_FORMAT_TIME, + GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, gst_position, + GST_SEEK_TYPE_NONE, 0 ); + if( !isPlaying() ) + gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); + + DBG( "seek to: %lld ns original: %lf s", gst_position, fTime ); + } +} + +// ------------------------------------------------------------------------------ + +double SAL_CALL Player::getMediaTime( ) + throw (uno::RuntimeException) +{ + double position = 0.0; + + if( mpPlaybin ) { + // get current position in the stream + GstFormat format = GST_FORMAT_TIME; + gint64 gst_position; + if( gst_element_query_position( mpPlaybin, &format, &gst_position ) && format == GST_FORMAT_TIME && gst_position > 0L ) + position = gst_position / 1E9; + } + + return position; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::setStopTime( double fTime ) + throw (uno::RuntimeException) +{ + // TODO implement +} + +// ------------------------------------------------------------------------------ + +double SAL_CALL Player::getStopTime( ) + throw (uno::RuntimeException) +{ + // Get the time at which to stop + + return 0; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::setRate( double fRate ) + throw (uno::RuntimeException) +{ + // TODO set the window rate +} + +// ------------------------------------------------------------------------------ + +double SAL_CALL Player::getRate( ) + throw (uno::RuntimeException) +{ + double rate = 0.0; + + // TODO get the window rate + if( mbInitialized ) + { + + } + + return rate; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) + throw (uno::RuntimeException) +{ + // TODO check how to do with GST + mbLooping = bSet; +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Player::isPlaybackLoop( ) + throw (uno::RuntimeException) +{ + // TODO check how to do with GST + return mbLooping; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::setMute( sal_Bool bSet ) + throw (uno::RuntimeException) +{ + DBG( "set mute: %d muted: %d unmuted volume: %lf", bSet, mbMuted, mnUnmutedVolume ); + + // change the volume to 0 or the unmuted volume + if( mpPlaybin && mbMuted != bSet ) + { + double nVolume = mnUnmutedVolume; + if( bSet ) + { + nVolume = 0.0; + } + + g_object_set( G_OBJECT( mpPlaybin ), "volume", nVolume, NULL ); + + mbMuted = bSet; + } +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Player::isMute( ) + throw (uno::RuntimeException) +{ + return mbMuted; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) + throw (uno::RuntimeException) +{ + mnUnmutedVolume = pow( 10.0, nVolumeDB / 20.0 ); + + DBG( "set volume: %d gst volume: %lf", nVolumeDB, mnUnmutedVolume ); + + // change volume + if( !mbMuted && mpPlaybin ) + { + g_object_set( G_OBJECT( mpPlaybin ), "volume", (gdouble) mnUnmutedVolume, NULL ); + } +} + +// ------------------------------------------------------------------------------ + +sal_Int16 SAL_CALL Player::getVolumeDB( ) + throw (uno::RuntimeException) +{ + sal_Int16 nVolumeDB; + + if( mpPlaybin ) { + double nGstVolume = 0.0; + + g_object_get( G_OBJECT( mpPlaybin ), "volume", &nGstVolume, NULL ); + + nVolumeDB = (sal_Int16) ( 20.0*log10 ( nGstVolume ) ); + + //DBG( "get volume: %d gst volume: %lf", nVolumeDB, nGstVolume ); + } + + return nVolumeDB; +} + +// ------------------------------------------------------------------------------ + +awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( ) + throw (uno::RuntimeException) +{ + awt::Size aSize( 0, 0 ); + + DBG( "%p Player::getPreferredPlayerWindowSize, member %d x %d", this, mnWidth, mnHeight ); + + TimeValue aTimeout = { 10, 0 }; + oslConditionResult aResult = osl_waitCondition( maSizeCondition, &aTimeout ); + + if( mbFakeVideo ) { + mbFakeVideo = sal_False; + + g_object_set( G_OBJECT( mpPlaybin ), "video-sink", NULL, NULL ); + gst_element_set_state( mpPlaybin, GST_STATE_READY ); + gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); + } + + DBG( "%p Player::getPreferredPlayerWindowSize after waitCondition %d, member %d x %d", this, aResult, mnWidth, mnHeight ); + + if( mnWidth != 0 && mnHeight != 0 ) { + aSize.Width = mnWidth; + aSize.Height = mnHeight; + } + + return aSize; +} + +// ------------------------------------------------------------------------------ + +uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& rArguments ) + throw (uno::RuntimeException) +{ + uno::Reference< ::media::XPlayerWindow > xRet; + awt::Size aSize( getPreferredPlayerWindowSize() ); + + DBG( "Player::createPlayerWindow %d %d length: %d", aSize.Width, aSize.Height, rArguments.getLength() ); + + if( aSize.Width > 0 && aSize.Height > 0 ) + { + ::avmedia::gstreamer::Window* pWindow = new ::avmedia::gstreamer::Window( mxMgr, *this ); + + xRet = pWindow; + + if( rArguments.getLength() > 2 ) { + rArguments[ 2 ] >>= mnWindowID; + DBG( "window ID: %ld", mnWindowID ); + } + + //if( !pWindow->create( aArguments ) ) + //xRet = uno::Reference< ::media::XPlayerWindow >(); + } + + return xRet; +} + +// ------------------------------------------------------------------------------ + +uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( ) + throw (uno::RuntimeException) +{ + uno::Reference< media::XFrameGrabber > xRet; + + /*if( maURL.getLength() > 0 ) + { + FrameGrabber* pGrabber = new FrameGrabber( mxMgr ); + + xRet = pGrabber; + + if( !pGrabber->create( maURL ) ) + xRet.clear(); + }*/ + + return xRet; +} + +// ------------------------------------------------------------------------------ + +::rtl::OUString SAL_CALL Player::getImplementationName( ) + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME ) ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName ) + throw (uno::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_GST_PLAYER_SERVICENAME ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames( ) + throw (uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString > aRet(1); + aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_GST_PLAYER_SERVICENAME ) ); + + return aRet; +} + +} // namespace gstreamer +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx new file mode 100644 index 000000000000..62ba473f9e53 --- /dev/null +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _PLAYER_HXX +#define _PLAYER_HXX + +#include +#include "gstcommon.hxx" + +#ifndef _COM_SUN_STAR_MEDIA_XPLAYER_HDL_ +#include "com/sun/star/media/XPlayer.hdl" +#endif + +typedef struct _GstXOverlay GstXOverlay; + +namespace avmedia { namespace gstreamer { + +// ---------- +// - Player - +// ---------- + +class Player : public ::cppu::WeakImplHelper2< ::com::sun::star::media::XPlayer, + ::com::sun::star::lang::XServiceInfo > +{ +public: + + Player( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr ); + ~Player(); + + void preparePlaybin( const ::rtl::OUString& rURL, bool bFakeVideo ); + bool create( const ::rtl::OUString& rURL ); + void processMessage( GstMessage *message ); + GstBusSyncReply processSyncMessage( GstMessage *message ); + + // XPlayer + virtual void SAL_CALL start( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL stop( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isPlaying( ) throw (::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getDuration( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMediaTime( double fTime ) throw (::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getMediaTime( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setStopTime( double fTime ) throw (::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getStopTime( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRate( double fRate ) throw (::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getRate( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isPlaybackLoop( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMute( sal_Bool bSet ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isMute( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getVolumeDB( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Size SAL_CALL getPreferredPlayerWindowSize( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayerWindow > SAL_CALL createPlayerWindow( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XFrameGrabber > SAL_CALL createFrameGrabber( ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; + + ::rtl::OUString maURL; + + // Add elements and pipeline here + GstElement* mpPlaybin; // the playbin is also a pipeline + sal_Bool mbFakeVideo; + + gdouble mnUnmutedVolume; + sal_Bool mbMuted; + sal_Bool mbLooping; + sal_Bool mbInitialized; + + long mnWindowID; + GstXOverlay* mpXOverlay; + gint64 mnDuration; + int mnWidth; + int mnHeight; + + oslCondition maSizeCondition; +}; + +} // namespace gstreamer +} // namespace avmedia + +#endif // _PLAYER_HXX diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx new file mode 100644 index 000000000000..db55e611ed57 --- /dev/null +++ b/avmedia/source/gstreamer/gstuno.cxx @@ -0,0 +1,103 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "gstmanager.hxx" + +using namespace ::com::sun::star; + +// ------------------- +// - factory methods - +// ------------------- + +static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact ) +{ + return uno::Reference< uno::XInterface >( *new ::avmedia::gstreamer::Manager( rxFact ) ); +} + +// ------------------------------------------ +// - component_getImplementationEnvironment - +// ------------------------------------------ + +extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +// ----------------------- +// - component_writeInfo - +// ----------------------- + +extern "C" sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) +{ + sal_Bool bRet = sal_False; + + if( pRegistryKey ) + { + try + { + uno::Reference< registry::XRegistryKey > xNewKey1( + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( + ::rtl::OUString::createFromAscii( "/com.sun.star.comp.media.Manager_GStreamer/UNO/SERVICES/com.sun.star.media.Manager_GStreamer" ) ) ); + + bRet = sal_True; + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); + } + } + + return bRet; +} + +// ------------------------ +// - component_getFactory - +// ------------------------ + +extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey ) +{ + uno::Reference< lang::XSingleServiceFactory > xFactory; + void* pRet = 0; + + if( rtl_str_compare( pImplName, "com.sun.star.comp.media.Manager_GStreamer" ) == 0 ) + { + const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( "com.sun.star.media.Manager_GStreamer" ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + ::rtl::OUString::createFromAscii( "com.sun.star.comp.media.Manager_GStreamer" ), + create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) ); + } + + if( xFactory.is() ) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + + return pRet; +} diff --git a/avmedia/source/gstreamer/gstwindow.cxx b/avmedia/source/gstreamer/gstwindow.cxx new file mode 100644 index 000000000000..1eca6b459011 --- /dev/null +++ b/avmedia/source/gstreamer/gstwindow.cxx @@ -0,0 +1,357 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "gstwindow.hxx" +#include "gstplayer.hxx" + +#define AVMEDIA_GST_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_GStreamer" +#define AVMEDIA_GST_WINDOW_SERVICENAME "com.sun.star.media.Window_GStreamer" + +using namespace ::com::sun::star; + +namespace avmedia { namespace gstreamer { + +// ----------- +// - statics - +// ----------- + +static ::osl::Mutex& ImplGetOwnStaticMutex() +{ + static ::osl::Mutex* pMutex = NULL; + + if( pMutex == NULL ) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + + if( pMutex == NULL ) + { + static ::osl::Mutex aMutex; + pMutex = &aMutex; + } + } + + return *pMutex; +} + +// --------------- +// - Window - +// --------------- + +// ------------------------------------------------------------------------------ + +Window::Window( const uno::Reference< lang::XMultiServiceFactory >& rxMgr, Player& rPlayer ) : + mxMgr( rxMgr ), + maListeners( maMutex ), + meZoomLevel( media::ZoomLevel_NOT_AVAILABLE ), + mrPlayer( rPlayer ), + mnPointerType( awt::SystemPointer::ARROW ) +{ + ::osl::MutexGuard aGuard( ImplGetOwnStaticMutex() ); + +} + +// ------------------------------------------------------------------------------ + +Window::~Window() +{ +} + +// XPlayerWindow +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::update( ) + throw (uno::RuntimeException) +{ + //::RedrawWindow( (HWND) mnFrameWnd, NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Window::setZoomLevel( media::ZoomLevel eZoomLevel ) + throw (uno::RuntimeException) +{ + sal_Bool bRet = false; + + if( media::ZoomLevel_NOT_AVAILABLE != meZoomLevel && + media::ZoomLevel_NOT_AVAILABLE != eZoomLevel ) + { + if( eZoomLevel != meZoomLevel ) + { + meZoomLevel = eZoomLevel; + //ImplLayoutVideoWindow(); + } + + bRet = true; + } + + return bRet; +} + +// ------------------------------------------------------------------------------ + +media::ZoomLevel SAL_CALL Window::getZoomLevel( ) + throw (uno::RuntimeException) +{ + return meZoomLevel; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setPointerType( sal_Int32 nPointerType ) + throw (uno::RuntimeException) +{ + mnPointerType = nPointerType; +} + +// XWindow +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) + throw (uno::RuntimeException) +{ +// if( mnFrameWnd ) +// { +// ::SetWindowPos( (HWND) mnFrameWnd, HWND_TOP, X, Y, Width, Height, 0 ); +// ImplLayoutVideoWindow(); +// } +} + +// ------------------------------------------------------------------------------ + +awt::Rectangle SAL_CALL Window::getPosSize() + throw (uno::RuntimeException) +{ + awt::Rectangle aRet; + + aRet.X = aRet.Y = 0; + aRet.Width = 320; + aRet.Height = 240; + +// if( mnFrameWnd ) +// { +// ::RECT aWndRect; +// long nX = 0, nY = 0, nWidth = 0, nHeight = 0; + +// if( ::GetClientRect( (HWND) mnFrameWnd, &aWndRect ) ) +// { +// aRet.X = aWndRect.left; +// aRet.Y = aWndRect.top; +// aRet.Width = aWndRect.right - aWndRect.left + 1; +// aRet.Height = aWndRect.bottom - aWndRect.top + 1; +// } +// } + + return aRet; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setVisible( sal_Bool bVisible ) + throw (uno::RuntimeException) +{ +// if( mnFrameWnd ) +// { +// IVideoWindow* pVideoWindow = const_cast< IVideoWindow* >( mrPlayer.getVideoWindow() ); + +// if( pVideoWindow ) +// pVideoWindow->put_Visible( bVisible ? OATRUE : OAFALSE ); + +// ::ShowWindow( (HWND) mnFrameWnd, bVisible ? SW_SHOW : SW_HIDE ); +// } +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setEnable( sal_Bool bEnable ) + throw (uno::RuntimeException) +{ +// if( mnFrameWnd ) +// ::EnableWindow( (HWND) mnFrameWnd, bEnable ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setFocus( ) + throw (uno::RuntimeException) +{ +// if( mnFrameWnd ) +// ::SetFocus( (HWND) mnFrameWnd ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addPaintListener( const uno::Reference< awt::XPaintListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removePaintListener( const uno::Reference< awt::XPaintListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + + +// XComponent +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::dispose( ) + throw (uno::RuntimeException) +{ +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw (uno::RuntimeException) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// XServiceInfo +// ------------------------------------------------------------------------------ + +::rtl::OUString SAL_CALL Window::getImplementationName( ) + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GST_WINDOW_IMPLEMENTATIONNAME ) ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Window::supportsService( const ::rtl::OUString& ServiceName ) + throw (uno::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_GST_WINDOW_SERVICENAME ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Sequence< ::rtl::OUString > SAL_CALL Window::getSupportedServiceNames( ) + throw (uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString > aRet(1); + aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_GST_WINDOW_SERVICENAME ) ); + + return aRet; +} + +} // namespace gstreamer +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstwindow.hxx b/avmedia/source/gstreamer/gstwindow.hxx new file mode 100644 index 000000000000..4a7b84e4bb59 --- /dev/null +++ b/avmedia/source/gstreamer/gstwindow.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _WINDOW_HXX +#define _WINDOW_HXX + +#include "gstcommon.hxx" +#include + +#ifndef _COM_SUN_STAR_MEDIA_XPLAYERWINDOW_HDL_ +#include "com/sun/star/media/XPlayerWindow.hdl" +#endif + +namespace avmedia { namespace gstreamer { + +// --------------- +// - Window - +// --------------- + +class Player; + +class Window : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XPlayerWindow, + ::com::sun::star::lang::XServiceInfo > +{ +public: + + Window( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr, + Player& rPlayer ); + ~Window(); + + bool create( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ); + void processGraphEvent(); + void updatePointer(); + + // XPlayerWindow + virtual void SAL_CALL update( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setZoomLevel( ::com::sun::star::media::ZoomLevel ZoomLevel ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::media::ZoomLevel SAL_CALL getZoomLevel( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) throw (::com::sun::star::uno::RuntimeException); + + // XWindow + virtual void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setVisible( sal_Bool Visible ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setEnable( sal_Bool Enable ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; + + ::osl::Mutex maMutex; + ::cppu::OMultiTypeInterfaceContainerHelper maListeners; + ::com::sun::star::media::ZoomLevel meZoomLevel; + Player& mrPlayer; + int mnPointerType; + + void ImplLayoutVideoWindow(); +}; + +} // namespace gstreamer +} // namespace avmedia + +#endif // _WINDOW_HXX diff --git a/avmedia/source/gstreamer/makefile.mk b/avmedia/source/gstreamer/makefile.mk new file mode 100644 index 000000000000..2f52b9cc4732 --- /dev/null +++ b/avmedia/source/gstreamer/makefile.mk @@ -0,0 +1,77 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2010 Novell, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. +PRJNAME=avmedia +TARGET=avmediagst + +# --- Settings ---------------------------------- + +.INCLUDE : settings.mk + +.IF "$(ENABLE_GSTREAMER)" == "TRUE" + +.IF "$(verbose)"!="" || "$(VERBOSE)"!="" +CDEFS+= -DVERBOSE +.ENDIF + +PKGCONFIG_MODULES=gstreamer-0.10, gstreamer-plugins-base-0.10 +.INCLUDE: pkg_config.mk +PKGCONFIG_LIBS+=-lgstinterfaces-0.10 + +# --- Files ---------------------------------- + +.IF "$(GUI)" == "UNX" || "$(GUI)" == "WNT" + +.IF "$(GUI)" == "WNT" +CDEFS+= -DWINNT +.ENDIF + +SLOFILES= \ + $(SLO)$/gstuno.obj \ + $(SLO)$/gstmanager.obj \ + $(SLO)$/gstplayer.obj \ + $(SLO)$/gstwindow.obj + + +EXCEPTIONSFILES= \ + $(SLO)$/gstuno.obj \ + +SHL1TARGET=$(TARGET) +SHL1STDLIBS= $(CPPULIB) $(SALLIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(PKGCONFIG_LIBS) $(TOOLSLIB) +SHL1IMPLIB=i$(TARGET) +SHL1LIBS=$(SLB)$/$(TARGET).lib +SHL1DEF=$(MISC)$/$(SHL1TARGET).def + +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=exports.dxp + +.ENDIF + +.ENDIF + +.INCLUDE : target.mk -- cgit From e748d379d1907ca149ac0f0daf47a15f64f5c045 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Sep 2010 16:00:27 +0200 Subject: avmedia-source-gstreamer-*.diff: gstreamer - Loop the A/V when the loop flag is set; from Caolan. --- avmedia/source/gstreamer/gstplayer.cxx | 15 +++++++++++++-- avmedia/source/gstreamer/gstplayer.hxx | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 1bb8246cc430..5519912988aa 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -59,6 +59,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : mpPlaybin( NULL ), mbFakeVideo (sal_False ), mnUnmutedVolume( 0 ), + mbPlayPending ( false ), mbMuted( false ), mbLooping( false ), mbInitialized( false ), @@ -132,6 +133,9 @@ void Player::processMessage( GstMessage *message ) case GST_MESSAGE_EOS: //DBG( "EOS, reset state to NULL" ); gst_element_set_state( mpPlaybin, GST_STATE_READY ); + mbPlayPending = false; + if (mbLooping) + start(); break; case GST_MESSAGE_STATE_CHANGED: if( message->src == GST_OBJECT( mpPlaybin ) ) { @@ -143,6 +147,9 @@ void Player::processMessage( GstMessage *message ) pendingstate == GST_STATE_VOID_PENDING && mpXOverlay ) gst_x_overlay_expose( mpXOverlay ); + + if (mbPlayPending) + mbPlayPending = ((newstate == GST_STATE_READY) || (newstate == GST_STATE_PAUSED)); } default: break; @@ -242,6 +249,7 @@ void Player::preparePlaybin( const ::rtl::OUString& rURL, bool bFakeVideo ) if( mpPlaybin != NULL ) { gst_element_set_state( mpPlaybin, GST_STATE_NULL ); + mbPlayPending = false; g_object_unref( mpPlaybin ); } @@ -273,6 +281,7 @@ bool Player::create( const ::rtl::OUString& rURL ) preparePlaybin( rURL, true ); gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); + mbPlayPending = false; bRet = true; } @@ -297,6 +306,7 @@ void SAL_CALL Player::start( ) if( mbInitialized && NULL != mpPlaybin ) { gst_element_set_state( mpPlaybin, GST_STATE_PLAYING ); + mbPlayPending = true; } } @@ -309,6 +319,7 @@ void SAL_CALL Player::stop( ) if( mpPlaybin ) gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); + mbPlayPending = false; DBG( "stop %p", mpPlaybin ); } @@ -317,10 +328,10 @@ void SAL_CALL Player::stop( ) sal_Bool SAL_CALL Player::isPlaying() throw (uno::RuntimeException) { - bool bRet = false; + bool bRet = mbPlayPending; // return whether the pipeline is in PLAYING STATE or not - if( mbInitialized && mpPlaybin ) + if( !mbPlayPending && mbInitialized && mpPlaybin ) { bRet = GST_STATE_PLAYING == GST_STATE( mpPlaybin ); } diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index 62ba473f9e53..778c877edf46 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -93,6 +93,7 @@ private: sal_Bool mbFakeVideo; gdouble mnUnmutedVolume; + sal_Bool mbPlayPending; sal_Bool mbMuted; sal_Bool mbLooping; sal_Bool mbInitialized; -- cgit -- cgit -- cgit From d1b83c6ec6dde87f10f0ce9e44b233f9a37ecb3b Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Thu, 16 Sep 2010 18:28:16 +0200 Subject: redirect-extensions-reportbuilder.diff: Migrated --- reportbuilder/registry/schema/org/openoffice/Office/ReportDesign.xcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reportbuilder/registry/schema/org/openoffice/Office/ReportDesign.xcs b/reportbuilder/registry/schema/org/openoffice/Office/ReportDesign.xcs index c290e002e24f..f1adabefe7a8 100644 --- a/reportbuilder/registry/schema/org/openoffice/Office/ReportDesign.xcs +++ b/reportbuilder/registry/schema/org/openoffice/Office/ReportDesign.xcs @@ -52,7 +52,7 @@ LLA Direct download URL to the Oracle(tm) Report Builder extension. - http://extensions.services.openoffice.org + http://extensions.go-oo.org -- cgit From a6b81f761f832977fbfbcecafb72f15cf8429366 Mon Sep 17 00:00:00 2001 From: Kalman Szalai - KAMI Date: Thu, 16 Sep 2010 18:30:58 +0200 Subject: apache-commons-build-fix-invalid-chars.diff: Fix build Fixing build breakage in apache-common module when you use UTF-8 based locale in the build system --- apache-commons/java/httpclient/makefile.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apache-commons/java/httpclient/makefile.mk b/apache-commons/java/httpclient/makefile.mk index 6e05150c7c20..8e4f2cab549e 100644 --- a/apache-commons/java/httpclient/makefile.mk +++ b/apache-commons/java/httpclient/makefile.mk @@ -58,6 +58,9 @@ OUT2CLASS=dist$/commons-httpclient.jar COMMONS_LOGGING_JAR=..$/..$/..$/..$/$(INPATH)$/class$/commons-logging-1.1.1-SNAPSHOT.jar COMMONS_CODEC_JAR=..$/..$/..$/..$/$/$(INPATH)$/class$/commons-codec-1.3.jar +ANT_OPTS+="-Dfile.encoding=ISO-8859-1" +.EXPORT : ANT_OPTS + .IF "$(JAVACISGCJ)"=="yes" JAVA_HOME= .EXPORT : JAVA_HOME -- cgit From 0abe2eea123b69b8eefabb9da8a1695f0b75f248 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Thu, 16 Sep 2010 18:33:30 +0200 Subject: build-java-target-extensions.diff: Allow specifying java target version. i#93115 --- apache-commons/java/codec/makefile.mk | 2 +- apache-commons/java/httpclient/makefile.mk | 2 +- jfreereport/java/flute/makefile.mk | 2 +- jfreereport/java/jfreereport/makefile.mk | 2 +- jfreereport/java/libbase/makefile.mk | 2 +- jfreereport/java/libfonts/makefile.mk | 2 +- jfreereport/java/libformula/makefile.mk | 2 +- jfreereport/java/liblayout/makefile.mk | 2 +- jfreereport/java/libloader/makefile.mk | 2 +- jfreereport/java/librepository/makefile.mk | 2 +- jfreereport/java/libserializer/makefile.mk | 2 +- jfreereport/java/libxml/makefile.mk | 2 +- jfreereport/java/sac/makefile.mk | 2 +- tomcat/makefile.mk | 5 +++++ 14 files changed, 18 insertions(+), 13 deletions(-) diff --git a/apache-commons/java/codec/makefile.mk b/apache-commons/java/codec/makefile.mk index 6976731477de..be96f87f363f 100644 --- a/apache-commons/java/codec/makefile.mk +++ b/apache-commons/java/codec/makefile.mk @@ -58,7 +58,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/apache-commons/java/httpclient/makefile.mk b/apache-commons/java/httpclient/makefile.mk index 8e4f2cab549e..900fb0832cac 100644 --- a/apache-commons/java/httpclient/makefile.mk +++ b/apache-commons/java/httpclient/makefile.mk @@ -66,7 +66,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -Dcommons-logging.jar=$(COMMONS_LOGGING_JAR) -Dcommons-codec.jar=$(COMMONS_CODEC_JAR) -f $(ANT_BUILDFILE) dist .ELSE -BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dcommons-logging.jar=$(COMMONS_LOGGING_JAR) -Dcommons-codec.jar=$(COMMONS_CODEC_JAR) -f $(ANT_BUILDFILE) dist +BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dcommons-logging.jar=$(COMMONS_LOGGING_JAR) -Dcommons-codec.jar=$(COMMONS_CODEC_JAR) -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) dist .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/flute/makefile.mk b/jfreereport/java/flute/makefile.mk index 9444d75fb692..ffe668c54329 100644 --- a/jfreereport/java/flute/makefile.mk +++ b/jfreereport/java/flute/makefile.mk @@ -51,7 +51,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/jfreereport/makefile.mk b/jfreereport/java/jfreereport/makefile.mk index b527d28973e9..cd815d290827 100644 --- a/jfreereport/java/jfreereport/makefile.mk +++ b/jfreereport/java/jfreereport/makefile.mk @@ -51,7 +51,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/libbase/makefile.mk b/jfreereport/java/libbase/makefile.mk index 1cbfc11de0da..15197e0c1bbb 100644 --- a/jfreereport/java/libbase/makefile.mk +++ b/jfreereport/java/libbase/makefile.mk @@ -50,7 +50,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/libfonts/makefile.mk b/jfreereport/java/libfonts/makefile.mk index f59b3cc0963f..cd2ff34e2438 100644 --- a/jfreereport/java/libfonts/makefile.mk +++ b/jfreereport/java/libfonts/makefile.mk @@ -50,7 +50,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/libformula/makefile.mk b/jfreereport/java/libformula/makefile.mk index 4372ce2b764d..28fcf99d12bd 100644 --- a/jfreereport/java/libformula/makefile.mk +++ b/jfreereport/java/libformula/makefile.mk @@ -52,7 +52,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF diff --git a/jfreereport/java/liblayout/makefile.mk b/jfreereport/java/liblayout/makefile.mk index 0340e43ccbd7..ba70d7945a87 100644 --- a/jfreereport/java/liblayout/makefile.mk +++ b/jfreereport/java/liblayout/makefile.mk @@ -50,7 +50,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/libloader/makefile.mk b/jfreereport/java/libloader/makefile.mk index ce97b402d1dd..cfb5955a2dba 100644 --- a/jfreereport/java/libloader/makefile.mk +++ b/jfreereport/java/libloader/makefile.mk @@ -50,7 +50,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/librepository/makefile.mk b/jfreereport/java/librepository/makefile.mk index e11639c7ae62..d39daa16c9e6 100644 --- a/jfreereport/java/librepository/makefile.mk +++ b/jfreereport/java/librepository/makefile.mk @@ -50,7 +50,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/libserializer/makefile.mk b/jfreereport/java/libserializer/makefile.mk index 12a301edc9e6..05cf8507d9bd 100644 --- a/jfreereport/java/libserializer/makefile.mk +++ b/jfreereport/java/libserializer/makefile.mk @@ -50,7 +50,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/libxml/makefile.mk b/jfreereport/java/libxml/makefile.mk index d0c8bb427103..17109ee8b21d 100644 --- a/jfreereport/java/libxml/makefile.mk +++ b/jfreereport/java/libxml/makefile.mk @@ -50,7 +50,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dlib="../../../class" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/jfreereport/java/sac/makefile.mk b/jfreereport/java/sac/makefile.mk index 44cb28435142..a0dafe9c3179 100644 --- a/jfreereport/java/sac/makefile.mk +++ b/jfreereport/java/sac/makefile.mk @@ -60,7 +60,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) all .ELSE -BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) all +BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) all .ENDIF .ENDIF # $(SOLAR_JAVA)!= "" diff --git a/tomcat/makefile.mk b/tomcat/makefile.mk index a4d8236b267f..b440e8465feb 100755 --- a/tomcat/makefile.mk +++ b/tomcat/makefile.mk @@ -49,7 +49,12 @@ ADDITIONAL_FILES = jakarta-servletapi-5/build.xml PATCH_FILES=tomcat.patch BUILD_DIR=jakarta-servletapi-5 + +.IF "$(JAVACISGCJ)"=="yes" BUILD_ACTION=$(ANT) +.ELSE +BUILD_ACTION=$(ANT) -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) +.ENDIF # --- Targets ------------------------------------------------------ -- cgit From 8ed3c9196c538fb05f5261bff72af3a1281ff675 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 16 Sep 2010 18:36:06 +0200 Subject: slideshow-effect-rewind-sdext.diff: allows to step back one animation effect i#48179 --- sdext/source/presenter/PresenterController.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 42208f670f56..82cac6270c00 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -998,7 +998,6 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent) } break; - case awt::Key::LEFT: case awt::Key::PAGEUP: if (mxSlideShowController.is()) { @@ -1009,6 +1008,7 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent) } break; + case awt::Key::LEFT: case awt::Key::UP: case awt::Key::P: case awt::Key::BACKSPACE: -- cgit -- cgit -- cgit From 8eb955342f7a6df849e71e6da709dc4384653e7d Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 16 Sep 2010 18:46:15 +0200 Subject: pdfimport-lax-restrictions.diff: Lax restrictions on pdf import filter. i#90468 --- sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx index 6011b6989576..c22973ca0bb4 100644 --- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx @@ -159,11 +159,7 @@ int main(int argc, char **argv) // Check various permissions. - if ( !aDoc.isOk()|| - !aDoc.okToPrint() || - !aDoc.okToChange()|| - !aDoc.okToCopy()|| - !aDoc.okToAddNotes() ) + if ( !aDoc.isOk() ) { pdfi::PDFOutDev* pOutDev( new pdfi::PDFOutDev(&aErrDoc) ); -- cgit From 29f8e484cb666417b65209d4b848a929deef2007 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 16 Sep 2010 18:48:35 +0200 Subject: framework-extra-job-config-sdext.diff: Migrated i#107568 --- sdext/source/presenter/registry/data/org/openoffice/Office/Jobs.xcu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdext/source/presenter/registry/data/org/openoffice/Office/Jobs.xcu b/sdext/source/presenter/registry/data/org/openoffice/Office/Jobs.xcu index ba743328e811..1241a72a0243 100644 --- a/sdext/source/presenter/registry/data/org/openoffice/Office/Jobs.xcu +++ b/sdext/source/presenter/registry/data/org/openoffice/Office/Jobs.xcu @@ -5,6 +5,9 @@ com.sun.star.comp.Draw.framework.PresenterScreenJob + + com.sun.star.presentation.PresentationDocument + -- cgit From 12a436efffcd06193c68b76eafeb4e118bbce3a4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 19:55:06 +0300 Subject: Drop requirements needed only for Win9x support Don't require and distribute unicows.dll and instmsia.exe (Windows Installer 2.0 installer for Win9x). Drop the Win9x-specific code in setup.exe. Do still require and distribute gdiplus.dll for Win2k support (bnc#522833). --- external/prj/d.lst | 1 - 1 file changed, 1 deletion(-) diff --git a/external/prj/d.lst b/external/prj/d.lst index ff1b19a0e94f..a93b4b8de557 100644 --- a/external/prj/d.lst +++ b/external/prj/d.lst @@ -50,7 +50,6 @@ mkdir: %_DEST%\inc%_EXT%\external\mingw\include\sys ..\unowinreg\unowinreg.dll %_DEST%\bin%_EXT%\unowinreg.dll -..\msi\instmsia.exe %_DEST%\bin%_EXT%\instmsia.exe ..\msi\instmsiw.exe %_DEST%\bin%_EXT%\instmsiw.exe ..\%__SRC%\bin\mingwm10.dll %_DEST%\bin%_EXT%\mingwm10.dll -- cgit From 6a00b6be88937e73b0a166e1ee0767ed29ed4403 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 19:51:04 +0300 Subject: Drop requirements needed only for Win9x support Don't require and distribute unicows.dll and instmsia.exe (Windows Installer 2.0 installer for Win9x). Drop the Win9x-specific code in setup.exe. Do still require and distribute gdiplus.dll for Win2k support (bnc#522833). --- configure.in | 32 +++++++------------------------- scp2/source/ooo/ure.scp | 10 ---------- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/configure.in b/configure.in index c3a35c5fa792..13ceb60a049a 100644 --- a/configure.in +++ b/configure.in @@ -5412,7 +5412,7 @@ problem can be found in issue 49856.]) else HAVE_PSDK_H="no" fi - if test -f "$PSDK_HOME/lib/unicows.lib"; then + if test -f "$PSDK_HOME/lib/user32.lib"; then HAVE_PSDK_LIB="yes" else HAVE_PSDK_LIB="no" @@ -5692,22 +5692,6 @@ AC_MSG_ERROR([$ZIP found in the path is not the required cygwin version of Info- fi AC_SUBST(ZIP_HOME) -dnl =================================================================== -dnl Windows builds need unicows.dll in external/unicows/ -dnl =================================================================== -if test "$_os" = "WINNT"; then - AC_MSG_CHECKING([for unicows.dll]) - if test -x ./external/unicows/unicows.dll; then - AC_MSG_RESULT([found]) - else - AC_MSG_ERROR([The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. -Get it from the Microsoft site and put it into external/unicows. -(Note: Microsoft seems to enjoy changing the exact location of this file. You -may have to search Microsoft's website.) Last time it was seen at: -.]) - fi -fi - dnl =================================================================== dnl Windows builds need dbghelp.dll in external/dbghelp/ dnl =================================================================== @@ -5758,22 +5742,20 @@ if test "$_os" = "WINNT"; then fi dnl =================================================================== -dnl Windows builds with VS 2003/2005/2008 need instmsia.exe and instmsiw.exe in external/msi +dnl Windows builds with VS 2003/2005/2008 need instmsiw.exe in external/msi dnl =================================================================== if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then - AC_MSG_CHECKING([for instmsia.exe/instmsiw.exe]) - if test -x ./external/msi/instmsia.exe -a -x ./external/msi/instmsiw.exe; then + AC_MSG_CHECKING([for instmsiw.exe]) + if test -x ./external/msi/instmsiw.exe; then AC_MSG_RESULT([found]) else - MSIAPATH=`/bin/find "$COMPATH/.." -iname instmsia.exe | head -n 1` MSIWPATH=`/bin/find "$COMPATH/.." -iname instmsiw.exe | head -n 1` - if test -n "$MSIAPATH" -a -n "$MSIWPATH"; then - cp "$MSIAPATH" ./external/msi/ && chmod +x ./external/msi/instmsia.exe && MSIACOPY="OK" + if test -n "$MSIWPATH"; then cp "$MSIWPATH" ./external/msi/ && chmod +x ./external/msi/instmsiw.exe && MSIWCOPY="OK" fi - if test -z "$MSIACOPY" -o -z "$MSIWCOPY"; then - AC_MSG_ERROR([instmsia.exe and/or instmsiw.exe are/is missing in the default location. + if test -z "$MSIWCOPY"; then + AC_MSG_ERROR([instmsiw.exe is missing in the default location. These programs are part of the Visual Studio installation and should be found in a directory similar to: "c:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools\\Deployment\\MsiRedist\\" diff --git a/scp2/source/ooo/ure.scp b/scp2/source/ooo/ure.scp index 9aeaf32c5bcb..008df5d15453 100755 --- a/scp2/source/ooo/ure.scp +++ b/scp2/source/ooo/ure.scp @@ -981,16 +981,6 @@ End #endif #endif -#if defined WNT -File gid_File_Dl_Unicows - TXT_FILE_BODY; - Dir = SCP2_URE_DL_DIR; - Name = SCP2_URE_DL_NORMAL("unicows"); - Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID); - // CompID = "F05005FA-5B2C-43B1-83EF-988EFFF1D7BD"; -End -#endif - #if defined WNT File gid_File_Dl_Uwinapi TXT_FILE_BODY; -- cgit From 14db8b2b01c6280995be896a03fe84f6e942ba14 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 19:57:47 +0300 Subject: Remove aclocal.m4 and mention it in .gitignore --- .gitignore | 1 + aclocal.m4 | 278 ------------------------------------------------------------- 2 files changed, 1 insertion(+), 278 deletions(-) delete mode 100644 aclocal.m4 diff --git a/.gitignore b/.gitignore index def767e59215..c53af32be897 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ # autoconf generated stuff /ChangeLog /configure +/aclocal.m4 diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index 680f52ac3929..000000000000 --- a/aclocal.m4 +++ /dev/null @@ -1,278 +0,0 @@ -# generated automatically by aclocal 1.9.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN(PKG_CHECK_MODULES, [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program 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 General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) - -# Adds support for distributing Python modules and packages. To -# install modules, copy them to $(pythondir), using the python_PYTHON -# automake variable. To install a package with the same name as the -# automake package, install to $(pkgpythondir), or use the -# pkgpython_PYTHON automake variable. - -# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as -# locations to install python extension modules (shared libraries). -# Another macro is required to find the appropriate flags to compile -# extension modules. - -# If your package is configured with a different prefix to python, -# users will have to add the install directory to the PYTHONPATH -# environment variable, or create a .pth file (see the python -# documentation for details). - -# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will -# cause an error if the version of python installed on the system -# doesn't meet the requirement. MINIMUM-VERSION should consist of -# numbers and dots only. - -AC_DEFUN([AM_PATH_PYTHON], - [ - dnl Find a Python interpreter. Python versions prior to 1.5 are not - dnl supported because the default installation locations changed from - dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages - dnl in 1.5. - m4_define([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python2.6 python2.5 python2.4 python2.3 python2.2 dnl -python2.1 python2.0 python1.6 python1.5]) - - m4_if([$1],[],[ - dnl No version check is needed. - # Find any Python interpreter. - if test -z "$PYTHON"; then - PYTHON=: - AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST) - fi - am_display_PYTHON=python - ], [ - dnl A version check is needed. - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - AC_MSG_CHECKING([whether $PYTHON version >= $1]) - AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR(too old)]) - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - AC_CACHE_CHECK([for a Python interpreter with version >= $1], - [am_cv_pathless_PYTHON],[ - for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do - test "$am_cv_pathless_PYTHON" = none && break - AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) - done]) - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - ]) - - if test "$PYTHON" = :; then - dnl Run any user-specified action, or abort. - m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) - else - - dnl Query Python for its version number. Getting [:3] seems to be - dnl the best way to do this; it's what "site.py" does in the standard - dnl library. - - AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) - AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) - - dnl Use the values of $prefix and $exec_prefix for the corresponding - dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made - dnl distinct variables so they can be overridden if need be. However, - dnl general consensus is that you shouldn't need this ability. - - AC_SUBST([PYTHON_PREFIX], ['${prefix}']) - AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) - - dnl At times (like when building shared libraries) you may want - dnl to know which OS platform Python thinks this is. - - AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) - AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) - - - dnl Set up 4 directories: - - dnl pythondir -- where to install python scripts. This is the - dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior - dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON script directory], - [am_cv_python_pythondir], - [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) - AC_SUBST([pythondir], [$am_cv_python_pythondir]) - - dnl pkgpythondir -- $PACKAGE directory under pythondir. Was - dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is - dnl more consistent with the rest of automake. - - AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) - - dnl pyexecdir -- directory for installing python extension modules - dnl (shared libraries) - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], - [am_cv_python_pyexecdir], - [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || - echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) - AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) - - dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) - - AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) - - dnl Run any user-specified action. - $2 - fi - -]) - - -# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# --------------------------------------------------------------------------- -# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. -# Run ACTION-IF-FALSE otherwise. -# This test uses sys.hexversion instead of the string equivalent (first -# word of sys.version), in order to cope with versions such as 2.2c1. -# hexversion has been introduced in Python 1.5.2; it's probably not -# worth to support older versions (1.5.1 was released on October 31, 1998). -AC_DEFUN([AM_PYTHON_CHECK_VERSION], - [prog="import sys, string -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] -minverhex = 0 -for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] -sys.exit(sys.hexversion < minverhex)" - AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. -*- Autoconf -*- - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program 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 General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -m4_include([acinclude.m4]) -- cgit From 91291b26d7d00bc16dba678ded366b5a7206b3d3 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 16 Sep 2010 18:04:13 +0100 Subject: fix bool string compare, fixes problem in testtool ( has wider impact too ) --- basic/source/sbx/sbxbool.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx index 3216e401b707..c3ed0d09b134 100644 --- a/basic/source/sbx/sbxbool.cxx +++ b/basic/source/sbx/sbxbool.cxx @@ -91,7 +91,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) { if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_TRUE ) ) ) nRes = SbxTRUE; - else if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) ) + else if( !p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) ) { // Jetzt kann es noch in eine Zahl konvertierbar sein BOOL bError = TRUE; -- cgit From 4042d9e0e354e4512ac2858ae1c900aa1b482816 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 19:54:46 +0300 Subject: Drop requirements needed only for Win9x support Don't require and distribute unicows.dll and instmsia.exe (Windows Installer 2.0 installer for Win9x). Drop the Win9x-specific code in setup.exe. Do still require and distribute gdiplus.dll for Win2k support (bnc#522833). --- desktop/win32/source/setup/makefile.mk | 1 - desktop/win32/source/setup/setup.cpp | 10 ++-------- desktop/win32/source/setup/setup_main.cxx | 8 +------- desktop/win32/source/setup/setup_main.hxx | 3 --- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/desktop/win32/source/setup/makefile.mk b/desktop/win32/source/setup/makefile.mk index d9105724035c..15b7b1937e78 100644 --- a/desktop/win32/source/setup/makefile.mk +++ b/desktop/win32/source/setup/makefile.mk @@ -58,7 +58,6 @@ ULFDIR:=. .ENDIF # "$(WITH_LANG)"!="" OBJFILES= $(OBJ)$/setup_main.obj \ - $(OBJ)$/setup_a.obj \ $(OBJ)$/setup_w.obj # --- Targets ------------------------------------------------------ diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp index 7bfd544b2494..e37ebb311144 100755 --- a/desktop/win32/source/setup/setup.cpp +++ b/desktop/win32/source/setup/setup.cpp @@ -1321,9 +1321,7 @@ boolean SetupAppX::AlreadyRunning() const const TCHAR sGUniqueName[] = TEXT( "Global\\_MSISETUP_{EA8130C1-8D3D-4338-9309-1A52D530D846}" ); const TCHAR sUniqueName[] = TEXT( "_MSISETUP_{EA8130C1-8D3D-4338-9309-1A52D530D846}" ); - if ( IsWin9x() ) - sMutexName = sUniqueName; - else if ( ( GetOSVersion() < 5 ) && ! IsTerminalServerInstalled() ) + if ( ( GetOSVersion() < 5 ) && ! IsTerminalServerInstalled() ) sMutexName = sUniqueName; else sMutexName = sGUniqueName; @@ -1394,8 +1392,7 @@ void SetupAppX::Log( LPCTSTR pMessage, LPCTSTR pText ) const if ( !bInit ) { bInit = true; - if ( ! IsWin9x() ) - _ftprintf( m_pLogFile, TEXT("%c"), 0xfeff ); + _ftprintf( m_pLogFile, TEXT("%c"), 0xfeff ); _tsetlocale( LC_ALL, TEXT("") ); _ftprintf( m_pLogFile, TEXT("\nCodepage=%s\nMultiByte Codepage=[%d]\n"), @@ -1653,9 +1650,6 @@ boolean SetupAppX::GetCmdLineParameters( LPTSTR *pCmdLine ) //-------------------------------------------------------------------------- boolean SetupAppX::IsAdmin() { - if ( IsWin9x() ) - return true; - PSID aPsidAdmin; SID_IDENTIFIER_AUTHORITY aAuthority = SECURITY_NT_AUTHORITY; diff --git a/desktop/win32/source/setup/setup_main.cxx b/desktop/win32/source/setup/setup_main.cxx index 2750c87ae08a..28cb52da3e6f 100644 --- a/desktop/win32/source/setup/setup_main.cxx +++ b/desktop/win32/source/setup/setup_main.cxx @@ -63,7 +63,6 @@ SetupApp::SetupApp() m_nOSVersion = sInfoOS.dwMajorVersion; m_nMinorVersion = sInfoOS.dwMinorVersion; - m_bIsWin9x = ( VER_PLATFORM_WIN32_NT != sInfoOS.dwPlatformId ); m_bNeedReboot = false; m_bAdministrative = false; } @@ -88,14 +87,9 @@ extern "C" int __stdcall WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, int ) GetVersionEx( &sInfoOS ); - boolean bIsWin9x = ( VER_PLATFORM_WIN32_NT != sInfoOS.dwPlatformId ); - SetupApp *pSetup; - if ( bIsWin9x ) - pSetup = Create_SetupAppA(); - else - pSetup = Create_SetupAppW(); + pSetup = Create_SetupAppW(); try { diff --git a/desktop/win32/source/setup/setup_main.hxx b/desktop/win32/source/setup/setup_main.hxx index 525d5579a256..8f1fee239dd4 100644 --- a/desktop/win32/source/setup/setup_main.hxx +++ b/desktop/win32/source/setup/setup_main.hxx @@ -33,7 +33,6 @@ class SetupApp { DWORD m_nOSVersion; DWORD m_nMinorVersion; - boolean m_bIsWin9x : 1; boolean m_bNeedReboot : 1; boolean m_bAdministrative : 1; @@ -57,7 +56,6 @@ public: virtual void DisplayError( UINT nErr ) const = 0; void SetError( UINT nErr ) { m_uiRet = nErr; } - boolean IsWin9x() const { return m_bIsWin9x; } DWORD GetOSVersion() const { return m_nOSVersion; } DWORD GetMinorVersion() const { return m_nMinorVersion; } @@ -68,7 +66,6 @@ public: boolean NeedReboot() const { return m_bNeedReboot; } }; -SetupApp* Create_SetupAppA(); SetupApp* Create_SetupAppW(); #endif -- cgit From e23e6e18909ff404c65d068de8a0a9017de36cfc Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:15:54 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 40df55194f91b7d30376df163c252b11e68e7270 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:16:14 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 38b57fa5d245ab736b3f165764413985b3d79a52 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:16:21 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 261276ba3243b25f632db0f2fd2127c97604b935 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:16:30 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 54c3e5ad8eab1a4433f6af972b88db4c3a6287ee Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:16:40 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 68a1031261b846e0b69b12162e9acc3332a118ae Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:16:48 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 9b82d7ba0764041817a8f11bc11cbe58abc63079 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:16:55 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From b91ad8c6132e870ef6b7a88d024a4ff8e6a8cf29 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:17:08 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 1ea6792208820a5d1920b59ee895336beb994085 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:17:16 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From cdc9ec5b0f537f52a4672bb6bd7d54b5f7fca096 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:19 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..cad277c0e1fc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,9 @@ # the build directories /*/unxlng?? /*/unxlng??.pro +/*/wntmsci?? +/*/wntmsci??.pro -# autoconf generated stuff -/ChangeLog -/configure +/external/*/*.dll +/external/msi/*.exe +/external/msv*/*.manifest -- cgit From 2a5ea30d1f2566d684ce4542c616ff8b7e96fc60 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:22 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 .gitignore diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index def767e59215..bcb73e55aa01 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ # the build directories /*/unxlng?? /*/unxlng??.pro +/*/wntmsci?? +/*/wntmsci??.pro -# autoconf generated stuff -/ChangeLog -/configure +/moz/zipped/*.zip -- cgit From 5d9b4942a01cc2cf9fa1a5fcc13e015f0256efd3 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:28 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 69d264527c21034766a0a42d2aee1c1a815489e7 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:31 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From a65b32cccd6ac91b1ad7678cd44eb6b03150e7f1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:34 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 10aaa49c50f8470600e70733e10ba5dd576e0d9c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:40 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 647d21748c7fb5bfd45d10fdba167c4222a1f81e Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:47 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From e36bb7e0a2412495c4a36458e3f2bd6af6d923b1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:18:51 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index def767e59215..50784a43df04 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ # the build directories /*/unxlng?? /*/unxlng??.pro - -# autoconf generated stuff -/ChangeLog -/configure +/*/wntmsci?? +/*/wntmsci??.pro -- cgit From 3552325bacedba89e5165ac4f0e7b805ad162e97 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:29:27 +0300 Subject: Update .gitignore for Windows builds --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index c53af32be897..24a006bb3790 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ /ChangeLog /configure /aclocal.m4 + +/*/*.exe +/solenv/wntmsci?? +/solenv/wntmsci??.pro -- cgit From 3f49965d5726edd895e159a7217f0ad93ab18547 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Sep 2010 21:40:40 +0300 Subject: Match winenv.set.sh with lower-case e and s on Windows --- Makefile.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 313f1e6d63a5..978e19301cba 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,20 +3,20 @@ SHELL=/bin/sh all: - . ./*Env.Set.sh && \ + . ./*[Ee]nv.[Ss]et.sh && \ ./bootstrap && \ cd instsetoo_native && ../solenv/bin/build.pl -P@BUILD_NCPUS@ --all -P@BUILD_MAX_JOBS@ distclean: - . ./*Env.Set.sh && \ + . ./*[Ee]nv.[Ss]et.sh && \ dmake distclean clean: - . ./*Env.Set.sh && \ + . ./*[Ee]nv.[Ss]et.sh && \ dmake clean - + dev-install: - . ./*Env.Set.sh && \ + . ./*[Ee]nv.[Ss]et.sh && \ cd $$SRC_ROOT/instsetoo_native/util && \ LOCALINSTALLDIR=$$SRC_ROOT/install dmake openoffice_en-US PKGFORMAT=installed && \ $$SOLARENV/bin/linkoo $$SRC_ROOT/install/OpenOffice/installed/install/en-US $$SRC_ROOT && \ -- cgit From ac4fb24b15313d1419e696f2eaeaa939c66f9615 Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Thu, 16 Sep 2010 21:50:01 +0200 Subject: Revert "Remove aclocal.m4 and mention it in .gitignore" This reverts commit 6421b94c1df96ef0b4b10733b1e580111350fb25. Conflicts: .gitignore --- aclocal.m4 | 278 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 aclocal.m4 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000000..680f52ac3929 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,278 @@ +# generated automatically by aclocal 1.9.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page +dnl also defines GSTUFF_PKG_ERRORS on error +AC_DEFUN(PKG_CHECK_MODULES, [ + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for $2) + + if $PKG_CONFIG --exists "$2" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "$2"` + AC_MSG_RESULT($$1_LIBS) + else + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) + else + ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) + fi +]) + + + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + +AC_DEFUN([AM_PATH_PYTHON], + [ + dnl Find a Python interpreter. Python versions prior to 1.5 are not + dnl supported because the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5. + m4_define([_AM_PYTHON_INTERPRETER_LIST], + [python python2 python2.6 python2.5 python2.4 python2.3 python2.2 dnl +python2.1 python2.0 python1.6 python1.5]) + + m4_if([$1],[],[ + dnl No version check is needed. + # Find any Python interpreter. + if test -z "$PYTHON"; then + PYTHON=: + AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST) + fi + am_display_PYTHON=python + ], [ + dnl A version check is needed. + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + AC_MSG_CHECKING([whether $PYTHON version >= $1]) + AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR(too old)]) + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + AC_CACHE_CHECK([for a Python interpreter with version >= $1], + [am_cv_pathless_PYTHON],[ + for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do + test "$am_cv_pathless_PYTHON" = none && break + AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) + done]) + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + ]) + + if test "$PYTHON" = :; then + dnl Run any user-specified action, or abort. + m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) + else + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. + + AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], + [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) + AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST([PYTHON_PREFIX], ['${prefix}']) + AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], + [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) + AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behavior + dnl is more consistent with lispdir.m4 for example. + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON script directory], + [am_cv_python_pythondir], + [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) + AC_SUBST([pythondir], [$am_cv_python_pythondir]) + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + + AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], + [am_cv_python_pyexecdir], + [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) + AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + + AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) + + dnl Run any user-specified action. + $2 + fi + +]) + + +# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. +# This test uses sys.hexversion instead of the string equivalent (first +# word of sys.version), in order to cope with versions such as 2.2c1. +# hexversion has been introduced in Python 1.5.2; it's probably not +# worth to support older versions (1.5.1 was released on October 31, 1998). +AC_DEFUN([AM_PYTHON_CHECK_VERSION], + [prog="import sys, string +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] +minverhex = 0 +for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] +sys.exit(sys.hexversion < minverhex)" + AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. -*- Autoconf -*- + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +m4_include([acinclude.m4]) -- cgit From 31b5763489f7473c7993c90318093f0ac9ef9651 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 17 Sep 2010 00:05:22 +0300 Subject: Avoid symlinks in solenv path on Cygwin --- set_soenv.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/set_soenv.in b/set_soenv.in index 502ab5e67b99..d050c4bd1141 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -994,7 +994,7 @@ $DEVROOT = '$SRC_ROOT'; # Set solenv and solver to given or default values. # Location of the solenv tree. if ('@LOCAL_SOLENV@' eq "DEFAULT") -{ $SOLARENV = $SRC_ROOT.$SOLENV; +{ $SOLARENV = PathFormat($SRC_ROOT.$SOLENV); } else { $SOLARENV = PathFormat('@LOCAL_SOLENV@'); @@ -2321,6 +2321,7 @@ sub PathFormat # Replace absolute paths or DOS paths with ... if ( ( $variable =~ m/^\// ) or ( $variable =~ m/:/ ) ) { # mixed mode paths + chomp( $variable = qx{realpath "$variable"} ); chomp( $variable = qx{cygpath -m "$variable"} ); } } -- cgit From 81ad68f45c1aa3fb08dd01f1509d25e6d7b4d5ca Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 17 Sep 2010 00:07:20 +0300 Subject: Ignore all Windows build dirs --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 24a006bb3790..4c33097d6950 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ # the build directories /*/unxlng?? /*/unxlng??.pro +/*/wntmsci?? +/*/wntmsci??.pro # autoconf generated stuff /ChangeLog @@ -12,5 +14,3 @@ /aclocal.m4 /*/*.exe -/solenv/wntmsci?? -/solenv/wntmsci??.pro -- cgit From 1dd0f61440d4f2b95072db03b217d27ed0ff074f Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 17 Sep 2010 00:09:18 +0300 Subject: Remove aclocal.m4 as _rene_ wants --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4c33097d6950..dddafc360d17 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,5 @@ # autoconf generated stuff /ChangeLog /configure -/aclocal.m4 /*/*.exe -- cgit From 9f9047e88704fb75926d5677a9047e173319e71a Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Fri, 17 Sep 2010 00:09:55 +0200 Subject: add explicit call to PKG_PROG_PKG_CONFIG. autogen (regen aclocal.m4) --- aclocal.m4 | 348 +++++++++++++++++++++++++++++++++++++++-------------------- configure.in | 10 ++ 2 files changed, 242 insertions(+), 116 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 680f52ac3929..02ddbe9f8959 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,122 +11,206 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. - -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN(PKG_CHECK_MODULES, [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. - +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program 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 General Public License for more details. - +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 +# General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) - +# --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. - +# # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. - +# # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). - +# # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. - AC_DEFUN([AM_PATH_PYTHON], [ - dnl Find a Python interpreter. Python versions prior to 1.5 are not - dnl supported because the default installation locations changed from - dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages - dnl in 1.5. - m4_define([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python2.6 python2.5 python2.4 python2.3 python2.2 dnl -python2.1 python2.0 python1.6 python1.5]) + dnl Find a Python interpreter. Python versions prior to 2.0 are not + dnl supported. (2.0 was released on October 16, 2000). + m4_define_default([_AM_PYTHON_INTERPRETER_LIST], + [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl +python2.1 python2.0]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then - PYTHON=: - AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST) + AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ @@ -167,7 +251,7 @@ python2.1 python2.0 python1.6 python1.5]) dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) + [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding @@ -182,7 +266,7 @@ python2.1 python2.0 python1.6 python1.5]) dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) + [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) @@ -197,8 +281,29 @@ python2.1 python2.0 python1.6 python1.5]) dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], - [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) + [if test "x$prefix" = xNONE + then + am_py_prefix=$ac_default_prefix + else + am_py_prefix=$prefix + fi + am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) + am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was @@ -214,8 +319,29 @@ python2.1 python2.0 python1.6 python1.5]) dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], - [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || - echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) + [if test "x$exec_prefix" = xNONE + then + am_py_exec_prefix=$am_py_prefix + else + am_py_exec_prefix=$exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || + echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) + am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) @@ -235,34 +361,24 @@ python2.1 python2.0 python1.6 python1.5]) # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. -# hexversion has been introduced in Python 1.5.2; it's probably not -# worth to support older versions (1.5.1 was released on October 31, 1998). +# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], - [prog="import sys, string + [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. -minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 -for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. -*- Autoconf -*- - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program 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 General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- diff --git a/configure.in b/configure.in index 13ceb60a049a..06b8262f2da0 100644 --- a/configure.in +++ b/configure.in @@ -3530,6 +3530,16 @@ else AC_MSG_ERROR([too old, you need at least 3.0.0]) fi +dnl =================================================================== +dnl Check for pkg-config +dnl # Note that if there is a possibility the first call to +dnl # PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +dnl =================================================================== +if test "$_os" != "WNT"; then + PKG_PROG_PKG_CONFIG +fi + dnl =================================================================== dnl Check for building stax dnl =================================================================== -- cgit From 17478d34be5304a87f0563939573411fa7dbcb6a Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 17 Sep 2010 00:27:28 +0200 Subject: Kill aclocal.m4 for good this time :-) --- .gitignore | 1 + aclocal.m4 | 394 ------------------------------------------------------------- 2 files changed, 1 insertion(+), 394 deletions(-) delete mode 100644 aclocal.m4 diff --git a/.gitignore b/.gitignore index dddafc360d17..4c33097d6950 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,6 @@ # autoconf generated stuff /ChangeLog /configure +/aclocal.m4 /*/*.exe diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index 02ddbe9f8959..000000000000 --- a/aclocal.m4 +++ /dev/null @@ -1,394 +0,0 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])# PKG_CHECK_MODULES - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# --------------------------------------------------------------------------- -# Adds support for distributing Python modules and packages. To -# install modules, copy them to $(pythondir), using the python_PYTHON -# automake variable. To install a package with the same name as the -# automake package, install to $(pkgpythondir), or use the -# pkgpython_PYTHON automake variable. -# -# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as -# locations to install python extension modules (shared libraries). -# Another macro is required to find the appropriate flags to compile -# extension modules. -# -# If your package is configured with a different prefix to python, -# users will have to add the install directory to the PYTHONPATH -# environment variable, or create a .pth file (see the python -# documentation for details). -# -# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will -# cause an error if the version of python installed on the system -# doesn't meet the requirement. MINIMUM-VERSION should consist of -# numbers and dots only. -AC_DEFUN([AM_PATH_PYTHON], - [ - dnl Find a Python interpreter. Python versions prior to 2.0 are not - dnl supported. (2.0 was released on October 16, 2000). - m4_define_default([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl -python2.1 python2.0]) - - m4_if([$1],[],[ - dnl No version check is needed. - # Find any Python interpreter. - if test -z "$PYTHON"; then - AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) - fi - am_display_PYTHON=python - ], [ - dnl A version check is needed. - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. - AC_MSG_CHECKING([whether $PYTHON version >= $1]) - AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR(too old)]) - am_display_PYTHON=$PYTHON - else - # Otherwise, try each interpreter until we find one that satisfies - # VERSION. - AC_CACHE_CHECK([for a Python interpreter with version >= $1], - [am_cv_pathless_PYTHON],[ - for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do - test "$am_cv_pathless_PYTHON" = none && break - AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) - done]) - # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. - if test "$am_cv_pathless_PYTHON" = none; then - PYTHON=: - else - AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) - fi - am_display_PYTHON=$am_cv_pathless_PYTHON - fi - ]) - - if test "$PYTHON" = :; then - dnl Run any user-specified action, or abort. - m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) - else - - dnl Query Python for its version number. Getting [:3] seems to be - dnl the best way to do this; it's what "site.py" does in the standard - dnl library. - - AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], - [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) - AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) - - dnl Use the values of $prefix and $exec_prefix for the corresponding - dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made - dnl distinct variables so they can be overridden if need be. However, - dnl general consensus is that you shouldn't need this ability. - - AC_SUBST([PYTHON_PREFIX], ['${prefix}']) - AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) - - dnl At times (like when building shared libraries) you may want - dnl to know which OS platform Python thinks this is. - - AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], - [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) - AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) - - - dnl Set up 4 directories: - - dnl pythondir -- where to install python scripts. This is the - dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior - dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON script directory], - [am_cv_python_pythondir], - [if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; - esac - ]) - AC_SUBST([pythondir], [$am_cv_python_pythondir]) - - dnl pkgpythondir -- $PACKAGE directory under pythondir. Was - dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is - dnl more consistent with the rest of automake. - - AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) - - dnl pyexecdir -- directory for installing python extension modules - dnl (shared libraries) - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. - AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], - [am_cv_python_pyexecdir], - [if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || - echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; - esac - ]) - AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) - - dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) - - AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) - - dnl Run any user-specified action. - $2 - fi - -]) - - -# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# --------------------------------------------------------------------------- -# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. -# Run ACTION-IF-FALSE otherwise. -# This test uses sys.hexversion instead of the string equivalent (first -# word of sys.version), in order to cope with versions such as 2.2c1. -# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). -AC_DEFUN([AM_PYTHON_CHECK_VERSION], - [prog="import sys -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -# map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] -minverhex = 0 -# xrange is not present in Python 3.0 and range returns an iterator -for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] -sys.exit(sys.hexversion < minverhex)" - AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -m4_include([acinclude.m4]) -- cgit From e0066cd371f11a5aa2626575f6836b697c6cac7a Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 17 Sep 2010 09:59:57 +0200 Subject: The 'Industrial' theme is dead. --- vcl/source/app/settings.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index f3dc3259d264..098a78113fad 100755 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -858,6 +858,9 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const { + if ( nStyle == STYLE_SYMBOLS_INDUSTRIAL ) + return false; // industrial is dead + static ImplImageTreeSingletonRef aImageTree; return aImageTree->checkStyle( ImplSymbolsStyleToName( nStyle ) ); } -- cgit From e16922d1017bd62dba4571e710812d877e603933 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Fri, 17 Sep 2010 10:09:32 +0200 Subject: Move to the right directory Fix an arror that happened when changing the place from libs-extern to extensions --- languagetool/JLanguageTool-1.0.0.patch | 137 +++++++++++++++++++++ .../languagetool/JLanguageTool-1.0.0.patch | 137 --------------------- languagetool/languagetool/makefile.mk | 67 ---------- languagetool/languagetool/prj/build.lst | 3 - languagetool/languagetool/prj/d.lst | 1 - languagetool/makefile.mk | 67 ++++++++++ languagetool/prj/build.lst | 3 + languagetool/prj/d.lst | 1 + 8 files changed, 208 insertions(+), 208 deletions(-) create mode 100644 languagetool/JLanguageTool-1.0.0.patch delete mode 100644 languagetool/languagetool/JLanguageTool-1.0.0.patch delete mode 100644 languagetool/languagetool/makefile.mk delete mode 100644 languagetool/languagetool/prj/build.lst delete mode 100644 languagetool/languagetool/prj/d.lst create mode 100644 languagetool/makefile.mk create mode 100644 languagetool/prj/build.lst create mode 100644 languagetool/prj/d.lst diff --git a/languagetool/JLanguageTool-1.0.0.patch b/languagetool/JLanguageTool-1.0.0.patch new file mode 100644 index 000000000000..2b025c904394 --- /dev/null +++ b/languagetool/JLanguageTool-1.0.0.patch @@ -0,0 +1,137 @@ +--- misc/JLanguageTool-1.0.0/build.properties 2009-11-01 17:02:22.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/build.properties 2010-03-10 15:33:21.000000000 +0100 +@@ -54,10 +54,10 @@ + ext.log4j.lib = ${ext.dir}/build/cobertura/log4j-1.2.9.jar + ext.jakarta-oro.lib = ${ext.dir}/build/cobertura/jakarta-oro-2.0.8.jar + +-ext.ooo.juh.lib = ${ext.ooo.dir}/juh.jar +-ext.ooo.unoil.lib = ${ext.ooo.dir}/unoil.jar +-ext.ooo.ridl.lib = ${ext.ooo.dir}/ridl.jar +-ext.ooo.jurt.lib = ${ext.ooo.dir}/jurt.jar ++ext.ooo.juh.lib = ${solver.ooo.dir}/juh.jar ++ext.ooo.unoil.lib = ${solver.ooo.dir}/unoil.jar ++ext.ooo.ridl.lib = ${solver.ooo.dir}/ridl.jar ++ext.ooo.jurt.lib = ${solver.ooo.dir}/jurt.jar + + build.meta-inf = ${build.dir}/META-INF + final.name = LanguageTool +--- misc/JLanguageTool-1.0.0/build.xml 2009-10-26 14:28:30.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/build.xml 2010-03-10 15:33:21.000000000 +0100 +@@ -20,6 +20,8 @@ + + + ++ ++ + + + +@@ -367,11 +369,11 @@ + + + +- ++ + + + +- ++ + + + +@@ -402,11 +404,6 @@ + + + +- +- +- +- +- + + + +@@ -472,7 +472,6 @@ + + + +- + + + +@@ -494,7 +493,6 @@ + + + +- + + + +--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2009-01-01 23:39:30.000000000 +0100 ++++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2010-03-10 15:33:21.000000000 +0100 +@@ -23,6 +23,7 @@ + import java.io.FileNotFoundException; + import java.io.FileOutputStream; + import java.io.IOException; ++import java.lang.ClassLoader; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Properties; +@@ -154,8 +155,19 @@ + final String motherTongueStr = (String) props + .get(MOTHER_TONGUE_CONFIG_KEY); + if (motherTongueStr != null) { ++ // FIXME: hack to disable the functionality for JRE 1.5 ++ // javax.xml.bind.JAXBException is part of JRE 1.6 ++ boolean isJRE15 = false; ++ try { ++ ClassLoader cl = ClassLoader.getSystemClassLoader(); ++ cl.loadClass("javax.xml.bind.JAXBException"); ++ } catch (ClassNotFoundException e) { ++ isJRE15 = true; ++ } ++ if (!isJRE15) { + motherTongue = Language.getLanguageForShortName(motherTongueStr); + } ++ } + final String runServerString = (String) props.get(SERVER_RUN_CONFIG_KEY); + if (runServerString != null) { + runServer = runServerString.equals("true"); +--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2009-10-24 16:52:03.000000000 +0200 ++++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2010-03-10 15:33:21.000000000 +0100 +@@ -24,6 +24,7 @@ + * @author Marcin Miłkowski + */ + import java.io.File; ++import java.lang.ClassLoader; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Comparator; +@@ -455,6 +456,14 @@ + * @return An array of Locales supported by LT. + */ + public final Locale[] getLocales() { ++ // FIXME: hack to disable the functionality for JRE 1.5 ++ // javax.xml.bind.JAXBException is part of JRE 1.6 ++ try { ++ ClassLoader cl = ClassLoader.getSystemClassLoader(); ++ cl.loadClass("javax.xml.bind.JAXBException"); ++ } catch (ClassNotFoundException e) { ++ return new Locale[0]; ++ } + try { + int dims = 0; + for (final Language element : Language.LANGUAGES) { +@@ -609,9 +618,9 @@ + if (version != null + && (version.startsWith("1.0") || version.startsWith("1.1") + || version.startsWith("1.2") || version.startsWith("1.3") || version +- .startsWith("1.4"))) { ++ .startsWith("1.4") || version.startsWith("1.5"))) { + final DialogThread dt = new DialogThread( +- "Error: LanguageTool requires Java 1.5 or later. Current version: " ++ "Error: LanguageTool requires Java 1.6 or later. Current version: " + + version); + dt.start(); + return false; diff --git a/languagetool/languagetool/JLanguageTool-1.0.0.patch b/languagetool/languagetool/JLanguageTool-1.0.0.patch deleted file mode 100644 index 2b025c904394..000000000000 --- a/languagetool/languagetool/JLanguageTool-1.0.0.patch +++ /dev/null @@ -1,137 +0,0 @@ ---- misc/JLanguageTool-1.0.0/build.properties 2009-11-01 17:02:22.000000000 +0100 -+++ misc/build/JLanguageTool-1.0.0/build.properties 2010-03-10 15:33:21.000000000 +0100 -@@ -54,10 +54,10 @@ - ext.log4j.lib = ${ext.dir}/build/cobertura/log4j-1.2.9.jar - ext.jakarta-oro.lib = ${ext.dir}/build/cobertura/jakarta-oro-2.0.8.jar - --ext.ooo.juh.lib = ${ext.ooo.dir}/juh.jar --ext.ooo.unoil.lib = ${ext.ooo.dir}/unoil.jar --ext.ooo.ridl.lib = ${ext.ooo.dir}/ridl.jar --ext.ooo.jurt.lib = ${ext.ooo.dir}/jurt.jar -+ext.ooo.juh.lib = ${solver.ooo.dir}/juh.jar -+ext.ooo.unoil.lib = ${solver.ooo.dir}/unoil.jar -+ext.ooo.ridl.lib = ${solver.ooo.dir}/ridl.jar -+ext.ooo.jurt.lib = ${solver.ooo.dir}/jurt.jar - - build.meta-inf = ${build.dir}/META-INF - final.name = LanguageTool ---- misc/JLanguageTool-1.0.0/build.xml 2009-10-26 14:28:30.000000000 +0100 -+++ misc/build/JLanguageTool-1.0.0/build.xml 2010-03-10 15:33:21.000000000 +0100 -@@ -20,6 +20,8 @@ - - - -+ -+ - - - -@@ -367,11 +369,11 @@ - - - -- -+ - - - -- -+ - - - -@@ -402,11 +404,6 @@ - - - -- -- -- -- -- - - - -@@ -472,7 +472,6 @@ - - - -- - - - -@@ -494,7 +493,6 @@ - - - -- - - - ---- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2009-01-01 23:39:30.000000000 +0100 -+++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java 2010-03-10 15:33:21.000000000 +0100 -@@ -23,6 +23,7 @@ - import java.io.FileNotFoundException; - import java.io.FileOutputStream; - import java.io.IOException; -+import java.lang.ClassLoader; - import java.util.HashSet; - import java.util.Iterator; - import java.util.Properties; -@@ -154,8 +155,19 @@ - final String motherTongueStr = (String) props - .get(MOTHER_TONGUE_CONFIG_KEY); - if (motherTongueStr != null) { -+ // FIXME: hack to disable the functionality for JRE 1.5 -+ // javax.xml.bind.JAXBException is part of JRE 1.6 -+ boolean isJRE15 = false; -+ try { -+ ClassLoader cl = ClassLoader.getSystemClassLoader(); -+ cl.loadClass("javax.xml.bind.JAXBException"); -+ } catch (ClassNotFoundException e) { -+ isJRE15 = true; -+ } -+ if (!isJRE15) { - motherTongue = Language.getLanguageForShortName(motherTongueStr); - } -+ } - final String runServerString = (String) props.get(SERVER_RUN_CONFIG_KEY); - if (runServerString != null) { - runServer = runServerString.equals("true"); ---- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2009-10-24 16:52:03.000000000 +0200 -+++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java 2010-03-10 15:33:21.000000000 +0100 -@@ -24,6 +24,7 @@ - * @author Marcin Miłkowski - */ - import java.io.File; -+import java.lang.ClassLoader; - import java.util.ArrayList; - import java.util.Arrays; - import java.util.Comparator; -@@ -455,6 +456,14 @@ - * @return An array of Locales supported by LT. - */ - public final Locale[] getLocales() { -+ // FIXME: hack to disable the functionality for JRE 1.5 -+ // javax.xml.bind.JAXBException is part of JRE 1.6 -+ try { -+ ClassLoader cl = ClassLoader.getSystemClassLoader(); -+ cl.loadClass("javax.xml.bind.JAXBException"); -+ } catch (ClassNotFoundException e) { -+ return new Locale[0]; -+ } - try { - int dims = 0; - for (final Language element : Language.LANGUAGES) { -@@ -609,9 +618,9 @@ - if (version != null - && (version.startsWith("1.0") || version.startsWith("1.1") - || version.startsWith("1.2") || version.startsWith("1.3") || version -- .startsWith("1.4"))) { -+ .startsWith("1.4") || version.startsWith("1.5"))) { - final DialogThread dt = new DialogThread( -- "Error: LanguageTool requires Java 1.5 or later. Current version: " -+ "Error: LanguageTool requires Java 1.6 or later. Current version: " - + version); - dt.start(); - return false; diff --git a/languagetool/languagetool/makefile.mk b/languagetool/languagetool/makefile.mk deleted file mode 100644 index d96d702030ce..000000000000 --- a/languagetool/languagetool/makefile.mk +++ /dev/null @@ -1,67 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.10 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=. - -PRJNAME=languagetool -TARGET=languagetool - -.IF "$(SOLAR_JAVA)"!="" -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : antsettings.mk - -# --- Files -------------------------------------------------------- - -TARFILE_NAME=JLanguageTool-1.0.0 -TARFILE_MD5=47e1edaa44269bc537ae8cabebb0f638 -TARFILE_ROOTDIR=JLanguageTool-1.0.0 -PATCH_FILES=JLanguageTool-1.0.0.patch - -.IF "$(JAVACISGCJ)"=="yes" -JAVA_HOME= -.EXPORT : JAVA_HOME -BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dbuild.compiler=gcj dist -.ELSE -BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) dist -.ENDIF - -# --- Targets ------------------------------------------------------ - -.INCLUDE : set_ext.mk -.INCLUDE : target.mk -.INCLUDE : tg_ext.mk - -.ELSE -all: - @echo java disabled -.ENDIF diff --git a/languagetool/languagetool/prj/build.lst b/languagetool/languagetool/prj/build.lst deleted file mode 100644 index 98e25c36b3fc..000000000000 --- a/languagetool/languagetool/prj/build.lst +++ /dev/null @@ -1,3 +0,0 @@ -lt languagetool : javaunohelper jurt ridljar unoil NULL -lt languagetool usr1 - all lt_mkout NULL -lt languagatool nmake - all lt_languagetool NULL diff --git a/languagetool/languagetool/prj/d.lst b/languagetool/languagetool/prj/d.lst deleted file mode 100644 index b3c00b321cc9..000000000000 --- a/languagetool/languagetool/prj/d.lst +++ /dev/null @@ -1 +0,0 @@ -..\%__SRC%\misc\build\JLanguageTool*\dist\LanguageTool.oxt %_DEST%\bin%_EXT%\ diff --git a/languagetool/makefile.mk b/languagetool/makefile.mk new file mode 100644 index 000000000000..d96d702030ce --- /dev/null +++ b/languagetool/makefile.mk @@ -0,0 +1,67 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.10 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=. + +PRJNAME=languagetool +TARGET=languagetool + +.IF "$(SOLAR_JAVA)"!="" +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : antsettings.mk + +# --- Files -------------------------------------------------------- + +TARFILE_NAME=JLanguageTool-1.0.0 +TARFILE_MD5=47e1edaa44269bc537ae8cabebb0f638 +TARFILE_ROOTDIR=JLanguageTool-1.0.0 +PATCH_FILES=JLanguageTool-1.0.0.patch + +.IF "$(JAVACISGCJ)"=="yes" +JAVA_HOME= +.EXPORT : JAVA_HOME +BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dbuild.compiler=gcj dist +.ELSE +BUILD_ACTION=$(ANT) -v -Dsolver.ooo.dir=$(SOLARVER)$/$(INPATH)$/bin -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) dist +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk + +.ELSE +all: + @echo java disabled +.ENDIF diff --git a/languagetool/prj/build.lst b/languagetool/prj/build.lst new file mode 100644 index 000000000000..98e25c36b3fc --- /dev/null +++ b/languagetool/prj/build.lst @@ -0,0 +1,3 @@ +lt languagetool : javaunohelper jurt ridljar unoil NULL +lt languagetool usr1 - all lt_mkout NULL +lt languagatool nmake - all lt_languagetool NULL diff --git a/languagetool/prj/d.lst b/languagetool/prj/d.lst new file mode 100644 index 000000000000..b3c00b321cc9 --- /dev/null +++ b/languagetool/prj/d.lst @@ -0,0 +1 @@ +..\%__SRC%\misc\build\JLanguageTool*\dist\LanguageTool.oxt %_DEST%\bin%_EXT%\ -- cgit From b7628798ec1a966c97a64d7cf0aa9f3859b78bef Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 10:11:28 +0200 Subject: fit-list-to-size.diff: Shrink font automatically when text overflows. i#94086 Scale-font-down if typing text in Impress and the text box becomes too small. --- cui/source/options/dbregisterednamesconfig.cxx | 2 +- cui/source/tabpages/textattr.cxx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cui/source/options/dbregisterednamesconfig.cxx b/cui/source/options/dbregisterednamesconfig.cxx index 38b9897ad4e9..333cc016ff9a 100644 --- a/cui/source/options/dbregisterednamesconfig.cxx +++ b/cui/source/options/dbregisterednamesconfig.cxx @@ -133,7 +133,7 @@ namespace svx } catch( const Exception& ) { - DBG_UNHANDLED_EXCEPTION(); + //DBG_UNHANDLED_EXCEPTION(); } } diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx index 93330fbeb4dd..d275cbb00ba1 100644 --- a/cui/source/tabpages/textattr.cxx +++ b/cui/source/tabpages/textattr.cxx @@ -451,8 +451,7 @@ BOOL SvxTextAttrPage::FillItemSet( SfxItemSet& rAttrs) default: ; //prevent warning DBG_ERROR( "svx::SvxTextAttrPage::FillItemSet(), unhandled state!" ); case STATE_NOCHECK: eFTS = SDRTEXTFIT_NONE; break; - //case STATE_CHECK: eFTS = SDRTEXTFIT_RESIZEATTR; break; - case STATE_CHECK: eFTS = SDRTEXTFIT_PROPORTIONAL; break; + case STATE_CHECK: eFTS = SDRTEXTFIT_AUTOFIT; break; } rAttrs.Put( SdrTextFitToSizeTypeItem( eFTS ) ); } -- cgit From 3550256daa5451c1d51d220d5489c1b20150c374 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 10:11:28 +0200 Subject: fit-list-to-size.diff: Shrink font automatically when text overflows. i#94086 Scale-font-down if typing text in Impress and the text box becomes too small. --- filter/source/msfilter/svdfppt.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index f65a65b30986..d88409d20c95 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1115,6 +1115,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi } aTextObj.SetDestinationInstance( (sal_uInt16)nDestinationInstance ); + bool bAutoFit = false; // auto-scale text into shape box switch ( aTextObj.GetInstance() ) { case TSS_TYPE_PAGETITLE : @@ -1122,7 +1123,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi case TSS_TYPE_SUBTITLE : eTextKind = OBJ_TEXT; break; case TSS_TYPE_BODY : case TSS_TYPE_HALFBODY : - case TSS_TYPE_QUARTERBODY : eTextKind = OBJ_OUTLINETEXT; break; + case TSS_TYPE_QUARTERBODY : eTextKind = OBJ_OUTLINETEXT; bAutoFit = true; break; } if ( aTextObj.GetDestinationInstance() != TSS_TYPE_TEXT_IN_SHAPE ) { @@ -1177,6 +1178,15 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi } pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); + if (bAutoFit) + { + // disable both, defeats purpose of autofit + // otherwise + bAutoGrowHeight = sal_False; + bAutoGrowWidth = sal_False; + pTObj->SetMergedItem( SdrTextFitToSizeTypeItem(SDRTEXTFIT_AUTOFIT) ); + } + if ( !pTObj->ISA( SdrObjCustomShape ) ) { pTObj->SetMergedItem( SdrTextAutoGrowWidthItem( bAutoGrowWidth ) ); -- cgit From aa9af08b389a106fcfb53842ac7669b208a27205 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 10:11:29 +0200 Subject: fit-list-to-size.diff: Shrink font automatically when text overflows. i#94086 Scale-font-down if typing text in Impress and the text box becomes too small. --- sd/inc/app.hrc | 7 ++++--- sd/sdi/_drvwsh.sdi | 17 +++++----------- sd/sdi/sdraw.sdi | 27 ++++++++++++++++++++++++ sd/source/core/stlpool.cxx | 2 ++ sd/source/ui/app/menuids_tmpl.src | 8 ++++++++ sd/source/ui/app/popup2_tmpl.src | 43 +++++++++++++++++++++++++++++++++++++++ sd/source/ui/inc/res_bmp.hrc | 3 +++ sd/source/ui/view/drviews2.cxx | 25 +++++++++++++++++++++++ sd/source/ui/view/drviews4.cxx | 6 +++++- sd/source/ui/view/drviewsj.cxx | 19 ++++++++++------- 10 files changed, 134 insertions(+), 23 deletions(-) diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index 65aec562f084..3f64873255ef 100755 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -456,11 +456,12 @@ #define SID_DISPLAY_MASTER_OBJECTS (SID_SD_START+437) #define SID_INSERTPAGE_LAYOUT_MENU (SID_SD_START+438) #define SID_TP_EDIT_MASTER (SID_SD_START+439) +#define SID_OUTLINE_TEXT_AUTOFIT (SID_SD_START+440) // Add companion for the SID_HIDE_SLIDE (that is defined in svx) -#define SID_SHOW_SLIDE (SID_SD_START+440) +#define SID_SHOW_SLIDE (SID_SD_START+441) -#define SID_ADD_MOTION_PATH (SID_SD_START+441) -#define SID_TABLE_TOOLBOX (SID_SD_START+442) +#define SID_ADD_MOTION_PATH (SID_SD_START+442) +#define SID_TABLE_TOOLBOX (SID_SD_START+443) #endif diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index 6d0d3ef33ce9..bfb2570782b9 100755 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -25,18 +25,6 @@ * ************************************************************************/ -enum SdrFitToSizeType -{ - SDRTEXTFIT_NONE , - SDRTEXTFIT_PROPORTIONAL , - SDRTEXTFIT_ALLLINES , - SDRTEXTFIT_RESIZEATTR -} -item UINT32 SvxObjectItem ; -item BOOL SdrShadowItem ; -item SdrFitToSizeType SdrTextFitToSizeTypeItem ; - - interface DrawView { SID_JUMPTOMARK // ole : no, status : ? @@ -674,6 +662,11 @@ interface DrawView ExecMethod = FuPermanent ; StateMethod = GetMenuState ; ] + SID_OUTLINE_TEXT_AUTOFIT // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] SID_TEXT_FITTOSIZE_VERTICAL // ole : no, status : ? [ ExecMethod = FuPermanent ; diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index 0e91fb2c9134..dab765600f18 100755 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -6350,6 +6350,33 @@ SfxBoolItem TextFitToSizeTool SID_TEXT_FITTOSIZE GroupId = GID_FORMAT; ] +//-------------------------------------------------------------------------- +SfxBoolItem TextAutoFitToSize SID_OUTLINE_TEXT_AUTOFIT + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + //-------------------------------------------------------------------------- TbxImageItem TextToolbox SID_DRAWTBX_TEXT diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 138863cc313a..e89520d493f5 100755 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -254,6 +254,8 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo rSet.Put( SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR) ); rSet.Put( XLineStyleItem(XLINE_NONE) ); rSet.Put( XFillStyleItem(XFILL_NONE) ); + rSet.Put( SdrTextFitToSizeTypeItem(SDRTEXTFIT_AUTOFIT) ); + rSet.Put( SdrTextAutoGrowHeightItem(FALSE) ); // #i16874# enable kerning by default but only for new documents rSet.Put( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) ); diff --git a/sd/source/ui/app/menuids_tmpl.src b/sd/source/ui/app/menuids_tmpl.src index e21caafaa739..4f05a49ad2b4 100644 --- a/sd/source/ui/app/menuids_tmpl.src +++ b/sd/source/ui/app/menuids_tmpl.src @@ -304,6 +304,14 @@ Text [ en-US ] = "~Text..." ; \ }; +#define MN_OUTLINE_TEXT_AUTOFIT \ + MenuItem\ + {\ + Identifier = SID_OUTLINE_TEXT_AUTOFIT ; \ + HelpID = SID_OUTLINE_TEXT_AUTOFIT ; \ + Text [ en-US ] = "~Autofit Text" ; \ + }; + #define MN_CONNECTION \ MenuItem\ {\ diff --git a/sd/source/ui/app/popup2_tmpl.src b/sd/source/ui/app/popup2_tmpl.src index 5ee8fb5e4d6a..46efadeb031d 100644 --- a/sd/source/ui/app/popup2_tmpl.src +++ b/sd/source/ui/app/popup2_tmpl.src @@ -78,6 +78,49 @@ }; }; +// +// OUTLINETEXTOBJ_POPUP +// +#if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP + Menu RID_DRAW_OUTLINETEXTOBJ_POPUP +#elif SD_POPUP == RID_GRAPHIC_TEXTOBJ_POPUP + Menu RID_GRAPHIC_OUTLINETEXTOBJ_POPUP +#endif +{ + ItemList = + { + MN_SET_DEFAULT + SEPARATOR + MN_LINE + MN_AREA + MN_TEXTATTR + MN_OUTLINE_TEXT_AUTOFIT + MN_TRANSFORM + MN_FONTWORK + SEPARATOR + MN_CHAR_PARAGRAPH + SEPARATOR + MN_POSITION + MN_OBJECT_ALIGN + MN_DISTRIBUTE + MNSUB_CONVERT + + //-#i68101#---------------------- + SEPARATOR + MN_OBJECT_TITLE_DESCRIPTION + MN_NAME_GROUP + //-#i68101#---------------------- + +#if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP + SEPARATOR + MN_EFFECT + MN_ACTION +#endif + SEPARATOR + MN_STYLEDT + }; +}; + // // GEOMOBJ_POPUP // diff --git a/sd/source/ui/inc/res_bmp.hrc b/sd/source/ui/inc/res_bmp.hrc index 1602dc698f3f..fb788cb83614 100755 --- a/sd/source/ui/inc/res_bmp.hrc +++ b/sd/source/ui/inc/res_bmp.hrc @@ -298,6 +298,9 @@ #define RID_DRAW_TABLEOBJ_INSIDE_POPUP RID_APP_START+94 +#define RID_DRAW_OUTLINETEXTOBJ_POPUP RID_APP_START+95 +#define RID_GRAPHIC_OUTLINETEXTOBJ_POPUP RID_APP_START+96 + /* * Pointer (Mauszeiger) */ diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 3102dc726a61..9be01df4fe7a 100755 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -130,6 +130,31 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) switch ( nSId ) { + case SID_OUTLINE_TEXT_AUTOFIT: + { + SfxUndoManager* pUndoManager = GetDocSh()->GetUndoManager(); + SdrObject* pObj = NULL; + const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); + if( rMarkList.GetMarkCount() == 1 ) + { + pUndoManager->EnterListAction( String(), String() ); + mpDrawView->BegUndo(); + + pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); + bool bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE; + + mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj)); + + pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? SDRTEXTFIT_NONE : SDRTEXTFIT_AUTOFIT)); + + mpDrawView->EndUndo(); + pUndoManager->LeaveListAction(); + } + Cancel(); + rReq.Done(); + } + break; + // Flaechen und Linien-Attribute: // Sollten (wie StateMethode) eine eigene // Execute-Methode besitzen diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 88027d360806..cc4aa5131fdc 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -679,9 +679,13 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) { switch ( nId ) { + case OBJ_OUTLINETEXT: + nSdResId = bGraphicShell ? RID_GRAPHIC_OUTLINETEXTOBJ_POPUP : + RID_DRAW_OUTLINETEXTOBJ_POPUP; + break; + case OBJ_CAPTION: case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: case OBJ_TEXT: nSdResId = bGraphicShell ? RID_GRAPHIC_TEXTOBJ_POPUP : RID_DRAW_TEXTOBJ_POPUP; diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index ca69aeac0e59..382ac90b094b 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -208,9 +208,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem( SID_CHANGEPOLYGON ); } - if(nInv == SdrInventor && (nId == OBJ_TITLETEXT || nId == OBJ_OUTLINETEXT)) - rSet.DisableItem( SID_TEXTATTR_DLG ); - if(nInv == SdrInventor && nId == OBJ_TABLE ) { rSet.DisableItem( SID_TEXTATTR_DLG ); @@ -303,6 +300,17 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) else rSet.DisableItem( SID_MODIFY_FIELD ); } + if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) ) + { + bool bSet = false; + const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); + if( rMarkList.GetMarkCount() == 1 ) + { + SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); + bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE; + } + rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet)); + } rSet.DisableItem( SID_GROUP ); rSet.DisableItem( SID_COMBINE ); @@ -352,7 +360,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) BOOL bGraf = FALSE; BOOL bDrawObj = FALSE; BOOL b3dObj = FALSE; - BOOL bTitOutText = FALSE; bool bTable = false; BOOL bMeasureObj = FALSE; BOOL bEdgeObj = FALSE; // Connector @@ -392,8 +399,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) case OBJ_GRAF: bGraf = TRUE; break; - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: bTitOutText = TRUE; break; case OBJ_TABLE: bTable = true; break; } } @@ -441,7 +446,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) { rSet.DisableItem( SID_UNGROUP ); } - if( bTitOutText || bTable ) + if( bTable ) rSet.DisableItem( SID_TEXTATTR_DLG ); if( !bMeasureObj ) -- cgit From e479f47f7d48dbd0d701bf347b6a2d5121ba3d34 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 10:11:31 +0200 Subject: fit-list-to-size.diff: Shrink font automatically when text overflows. i#94086 Scale-font-down if typing text in Impress and the text box becomes too small. --- editeng/source/editeng/editobj2.hxx | 10 +- editeng/source/editeng/impedit3.cxx | 67 ++++++----- editeng/source/editeng/impedit4.cxx | 6 +- editeng/source/outliner/outliner.cxx | 11 +- svx/inc/svx/sdr/attribute/sdrtextattribute.hxx | 2 + svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx | 41 +++++++ .../svx/sdr/primitive2d/svx_primitivetypes2d.hxx | 1 + svx/inc/svx/sdtfsitm.hxx | 26 ++-- svx/inc/svx/svdotext.hxx | 16 ++- svx/source/sdr/attribute/sdrtextattribute.cxx | 14 ++- svx/source/sdr/primitive2d/sdrattributecreator.cxx | 3 +- .../sdr/primitive2d/sdrdecompositiontools.cxx | 5 + svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx | 49 ++++++++ svx/source/svdraw/svdedxv.cxx | 10 +- svx/source/svdraw/svdotext.cxx | 117 +++++++++++++++--- svx/source/svdraw/svdotextdecomposition.cxx | 134 +++++++++++++++++++++ svx/source/svdraw/svdotxat.cxx | 3 +- svx/source/svdraw/svdotxed.cxx | 17 ++- svx/source/svdraw/svdotxtr.cxx | 9 -- svx/source/svdraw/svdview.cxx | 3 +- xmloff/source/draw/sdpropls.cxx | 4 +- 21 files changed, 456 insertions(+), 92 deletions(-) diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 6ef3ce359d49..6b777081f371 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -112,12 +112,16 @@ class XParaPortionList : public XBaseParaPortionList ULONG nRefDevPtr; OutDevType eRefDevType; MapMode aRefMapMode; + sal_uInt16 nStretchX; + sal_uInt16 nStretchY; ULONG nPaperWidth; public: - XParaPortionList( OutputDevice* pRefDev, ULONG nPW ) : - aRefMapMode( pRefDev->GetMapMode() ) + XParaPortionList( OutputDevice* pRefDev, ULONG nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY ) : + aRefMapMode( pRefDev->GetMapMode() ), + nStretchX(_nStretchX), + nStretchY(_nStretchY) { nRefDevPtr = (ULONG)pRefDev; nPaperWidth = nPW; eRefDevType = pRefDev->GetOutDevType(); @@ -127,6 +131,8 @@ public: ULONG GetPaperWidth() const { return nPaperWidth; } OutDevType GetRefDevType() const { return eRefDevType; } const MapMode& GetRefMapMode() const { return aRefMapMode; } + sal_uInt16 GetStretchX() const { return nStretchX; } + sal_uInt16 GetStretchY() const { return nStretchY; } }; /* cl removed because not needed anymore since binfilter diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 524d69592298..c74b0250917f 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2657,36 +2657,44 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF } if ( nStretchX != 100 ) { - aRealSz.Width() *= nStretchX; - aRealSz.Width() /= 100; - - // Auch das Kerning: (long wegen Zwischenergebnis) - long nKerning = rFont.GetFixKerning(); -/* - Die Ueberlegung war: Wenn neg. Kerning, aber StretchX = 200 - => Nicht das Kerning verdoppelt, also die Buchstaben weiter - zusammenziehen - --------------------------- - Kern StretchX =>Kern - --------------------------- - >0 <100 < (Proportional) - <0 <100 < (Proportional) - >0 >100 > (Proportional) - <0 >100 < (Der Betrag, also Antiprop) -*/ - if ( ( nKerning < 0 ) && ( nStretchX > 100 ) ) + if ( nStretchX == nStretchY && + nRelWidth == 100 ) { - // Antiproportional - nKerning *= 100; - nKerning /= nStretchX; + aRealSz.Width() = 0; } - else if ( nKerning ) + else { - // Proportional - nKerning *= nStretchX; - nKerning /= 100; + aRealSz.Width() *= nStretchX; + aRealSz.Width() /= 100; + + // Auch das Kerning: (long wegen Zwischenergebnis) + long nKerning = rFont.GetFixKerning(); +/* + Die Ueberlegung war: Wenn neg. Kerning, aber StretchX = 200 + => Nicht das Kerning verdoppelt, also die Buchstaben weiter + zusammenziehen + --------------------------- + Kern StretchX =>Kern + --------------------------- + >0 <100 < (Proportional) + <0 <100 < (Proportional) + >0 >100 > (Proportional) + <0 >100 < (Der Betrag, also Antiprop) +*/ + if ( ( nKerning < 0 ) && ( nStretchX > 100 ) ) + { + // Antiproportional + nKerning *= 100; + nKerning /= nStretchX; + } + else if ( nKerning ) + { + // Proportional + nKerning *= nStretchX; + nKerning /= 100; + } + rFont.SetFixKerning( (short)nKerning ); } - rFont.SetFixKerning( (short)nKerning ); } } if ( nRelWidth != 100 ) @@ -4095,20 +4103,25 @@ void ImpEditEngine::SetFlatMode( sal_Bool bFlat ) void ImpEditEngine::SetCharStretching( sal_uInt16 nX, sal_uInt16 nY ) { + bool bChanged(false); if ( !IsVertical() ) { + bChanged = nStretchX!=nX || nStretchY!=nY; nStretchX = nX; nStretchY = nY; } else { + bChanged = nStretchX!=nY || nStretchY!=nX; nStretchX = nY; nStretchY = nX; } - if ( aStatus.DoStretch() ) + if (bChanged && aStatus.DoStretch()) { FormatFullDoc(); + // (potentially) need everything redrawn + aInvalidRec=Rectangle(0,0,1000000,1000000); UpdateViews( GetActiveView() ); } } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 46a0668394f2..f3f54c78def1 100755 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1159,7 +1159,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP // Schwelle rauf setzen, wenn Olli die Absaetze nicht mehr zerhackt! if ( bAllowBigObjects && bOnlyFullParagraphs && IsFormatted() && GetUpdateMode() && ( nTextPortions >= nBigObjectStart ) ) { - XParaPortionList* pXList = new XParaPortionList( GetRefDevice(), aPaperSize.Width() ); + XParaPortionList* pXList = new XParaPortionList( GetRefDevice(), aPaperSize.Width(), nStretchX, nStretchY ); pTxtObj->SetPortionInfo( pXList ); for ( nNode = nStartNode; nNode <= nEndNode; nNode++ ) { @@ -1250,7 +1250,9 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed XParaPortionList* pPortionInfo = rTextObject.GetPortionInfo(); if ( pPortionInfo && ( (long)pPortionInfo->GetPaperWidth() == aPaperSize.Width() ) - && ( pPortionInfo->GetRefMapMode() == GetRefDevice()->GetMapMode() ) ) + && ( pPortionInfo->GetRefMapMode() == GetRefDevice()->GetMapMode() ) + && ( pPortionInfo->GetStretchX() == nStretchX ) + && ( pPortionInfo->GetStretchY() == nStretchY ) ) { if ( ( pPortionInfo->GetRefDevPtr() == (sal_uIntPtr)GetRefDevice() ) || ( ( pPortionInfo->GetRefDevType() == OUTDEV_VIRDEV ) && diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 9e9b5dcc0e70..a1d1f5935196 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -925,7 +925,10 @@ Font Outliner::ImpCalcBulletFont( USHORT nPara ) const } // #107508# Use original scale... - USHORT nScale = /* pEditEngine->IsFlatMode() ? DEFAULT_SCALE : */ pFmt->GetBulletRelSize(); + USHORT nStretchX, nStretchY; + const_cast(this)->GetGlobalCharStretching(nStretchX, nStretchY); + + USHORT nScale = pFmt->GetBulletRelSize() * nStretchY / 100; ULONG nScaledLineHeight = aStdFont.GetSize().Height(); nScaledLineHeight *= nScale*10; nScaledLineHeight /= 1000; @@ -968,6 +971,12 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, BOOL bRightToLeftPara = pEditEngine->IsRightToLeft( nPara ); Rectangle aBulletArea( ImpCalcBulletArea( nPara, TRUE, FALSE ) ); + USHORT nStretchX, nStretchY; + GetGlobalCharStretching(nStretchX, nStretchY); + aBulletArea = Rectangle( Point(aBulletArea.Left()*nStretchX/100, + aBulletArea.Top()), + Size(aBulletArea.GetWidth()*nStretchX/100, + aBulletArea.GetHeight()) ); Paragraph* pPara = pParaList->GetParagraph( nPara ); const SvxNumberFormat* pFmt = GetNumberFormat( nPara ); diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx index f202eabbfbff..719bb39ee751 100644 --- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx +++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx @@ -75,6 +75,7 @@ namespace drawinglayer SdrTextVertAdjust aSdrTextVertAdjust, bool bContour, bool bFitToSize, + bool bAutoFit, bool bHideContour, bool bBlink, bool bScroll, @@ -97,6 +98,7 @@ namespace drawinglayer const OutlinerParaObject& getOutlinerParaObject() const; bool isContour() const; bool isFitToSize() const; + bool isAutoFit() const; bool isHideContour() const; bool isBlink() const; bool isScroll() const; diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx index a6e963c7ef13..903481d81431 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -300,6 +300,47 @@ namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// +namespace drawinglayer +{ + namespace primitive2d + { + class SdrAutoFitTextPrimitive2D : public SdrTextPrimitive2D + { + private: + ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range + + // bitfield + unsigned mbWordWrap : 1; // for CustomShapes text layout + + protected: + // local decomposition. + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const; + + public: + SdrAutoFitTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rOutlinerParaObjectPtr, + const ::basegfx::B2DHomMatrix& rTextRangeTransform, + bool bWordWrap); + + // get data + const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } + bool getWordWrap() const { return mbWordWrap; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // transformed clone operator + virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + #endif //INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX // eof diff --git a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx index 53707f18fa4b..9785a25a8d12 100644 --- a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx @@ -55,6 +55,7 @@ #define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20) #define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21) #define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22) +#define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 23) ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/inc/svx/sdtfsitm.hxx b/svx/inc/svx/sdtfsitm.hxx index 324b8f8d0143..f438aee8d85a 100644 --- a/svx/inc/svx/sdtfsitm.hxx +++ b/svx/inc/svx/sdtfsitm.hxx @@ -31,19 +31,21 @@ #include #include "svx/svxdllapi.h" -enum SdrFitToSizeType {SDRTEXTFIT_NONE, // - kein FitToSize - SDRTEXTFIT_PROPORTIONAL, // - Alle Buchstaben proportional umgroessern - SDRTEXTFIT_ALLLINES, // - Zus. jede Zeile separat in der Breite stretchen - SDRTEXTFIT_RESIZEATTR}; // - Bei Rahmenumgroesserung (ausser Autogrow) wird - // die Schriftgroesse umattributiert (hart) +enum SdrFitToSizeType { + SDRTEXTFIT_NONE, // - no fit-to-size + SDRTEXTFIT_PROPORTIONAL, // - resize all glyhs proportionally + // (might scale anisotrophically) + SDRTEXTFIT_ALLLINES, // - like SDRTEXTFIT_PROPORTIONAL, but + // scales each line separately + SDRTEXTFIT_AUTOFIT}; // - mimics PPT's automatic adaption of + // font size to text rect - comparable + // to SDRTEXTFIT_PROPORTIONAL, but + // scales isotrophically -// Bei SDRTEXTFIT_PROPORTIONAL und SDRTEXTFIT_ALLLINES gibt es kein AutoGrow und -// keine automatischen Umbrueche. -// Ist SDRTEXTFIT_RESIZEATTR gesetzt, so wird beim umgroessern des Textrahmens -// (ausser bei AutoGrow) die Schrift durch harte Attributierung ebenfalls -// umgegroessert. -// Bei AutoGrowingWidth gibt es ebenfalls keine automatischen Umbrueche (erst bei -// TextMaxFrameWidth). +// No AutoGrow and no automatic line breaks for +// SDRTEXTFIT_PROPORTIONAL and SDRTEXTFIT_ALLLINES. +// No automatic line breaks for AutoGrowingWidth as well (only if +// TextMaxFrameWidth is reached). //-------------------------------- // class SdrTextFitToSizeTypeItem diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx index 3a15d33f2cdd..620d70af168a 100644 --- a/svx/inc/svx/svdotext.hxx +++ b/svx/inc/svx/svdotext.hxx @@ -59,6 +59,7 @@ namespace drawinglayer { namespace primitive2d { class SdrContourTextPrimitive2D; class SdrPathTextPrimitive2D; class SdrBlockTextPrimitive2D; + class SdrAutoFitTextPrimitive2D; class SdrStretchTextPrimitive2D; }} @@ -254,6 +255,9 @@ protected: // Flag for allowing text animation. Default is sal_true. BOOL mbTextAnimationAllowed : 1; + // flag for preventing recursive onEditOutlinerStatusEvent calls + BOOL mbInDownScale : 1; + SdrOutliner& ImpGetDrawOutliner() const; private: @@ -267,6 +271,8 @@ private: Rectangle& rAnchorRect, Rectangle& rPaintRect, Fraction& aFitXKorreg ) const; + void ImpAutoFitText( SdrOutliner& rOutliner ) const; + static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ); SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const; SVX_DLLPRIVATE void ImpLinkAnmeldung(); SVX_DLLPRIVATE void ImpLinkAbmeldung(); @@ -278,7 +284,7 @@ protected: SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr = sal_False) const; SdrObject* ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) const; void ImpSetTextStyleSheetListeners(); - void ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& rTextRect, const Rectangle& rAnchorRect, Fraction& rFitXKorreg) const; + void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg) const; void ImpJustifyRect(Rectangle& rRect) const; void ImpCheckShear(); Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const; @@ -340,6 +346,10 @@ public: void NbcResizeTextAttributes(const Fraction& xFact, const Fraction& yFact); FASTBOOL IsTextFrame() const { return bTextFrame; } FASTBOOL IsOutlText() const { return bTextFrame && (eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT); } + /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false! + FASTBOOL IsAutoFit() const; + /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false! + FASTBOOL IsFitToSize() const; SdrObjKind GetTextKind() const { return eTextKind; } virtual bool HasText() const; @@ -582,6 +592,10 @@ public: drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impDecomposeAutoFitTextPrimitive( + drawinglayer::primitive2d::Primitive2DSequence& rTarget, + const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; void impDecomposeStretchTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive, diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index a28430f127c1..1a7da6c24cdf 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -71,6 +71,7 @@ namespace drawinglayer // bitfield unsigned mbContour : 1; unsigned mbFitToSize : 1; + unsigned mbAutoFit : 1; unsigned mbHideContour : 1; unsigned mbBlink : 1; unsigned mbScroll : 1; @@ -91,6 +92,7 @@ namespace drawinglayer SdrTextVertAdjust aSdrTextVertAdjust, bool bContour, bool bFitToSize, + bool bAutoFit, bool bHideContour, bool bBlink, bool bScroll, @@ -110,6 +112,7 @@ namespace drawinglayer maSdrTextVertAdjust(aSdrTextVertAdjust), mbContour(bContour), mbFitToSize(bFitToSize), + mbAutoFit(bAutoFit), mbHideContour(bHideContour), mbBlink(bBlink), mbScroll(bScroll), @@ -147,6 +150,7 @@ namespace drawinglayer maSdrTextVertAdjust(SDRTEXTVERTADJUST_TOP), mbContour(false), mbFitToSize(false), + mbAutoFit(false), mbHideContour(false), mbBlink(false), mbScroll(false), @@ -177,6 +181,7 @@ namespace drawinglayer } bool isContour() const { return mbContour; } bool isFitToSize() const { return mbFitToSize; } + bool isAutoFit() const { return mbAutoFit; } bool isHideContour() const { return mbHideContour; } bool isBlink() const { return mbBlink; } bool isScroll() const { return mbScroll; } @@ -235,6 +240,7 @@ namespace drawinglayer && isContour() == rCandidate.isContour() && isFitToSize() == rCandidate.isFitToSize() + && isAutoFit() == rCandidate.isAutoFit() && isHideContour() == rCandidate.isHideContour() && isBlink() == rCandidate.isBlink() && isScroll() == rCandidate.isScroll() @@ -272,6 +278,7 @@ namespace drawinglayer SdrTextVertAdjust aSdrTextVertAdjust, bool bContour, bool bFitToSize, + bool bAutoFit, bool bHideContour, bool bBlink, bool bScroll, @@ -281,7 +288,7 @@ namespace drawinglayer : mpSdrTextAttribute(new ImpSdrTextAttribute( &rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance, aTextUpperDistance, aTextRightDistance, aTextLowerDistance, aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour, - bFitToSize, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell)) + bFitToSize, bAutoFit, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell)) { } @@ -369,6 +376,11 @@ namespace drawinglayer return mpSdrTextAttribute->isFitToSize(); } + bool SdrTextAttribute::isAutoFit() const + { + return mpSdrTextAttribute->isAutoFit(); + } + bool SdrTextAttribute::isHideContour() const { return mpSdrTextAttribute->isHideContour(); diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 4ff335a04125..7e008ded3a61 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -544,7 +544,8 @@ namespace drawinglayer rTextObj.GetTextHorizontalAdjust(rSet), rTextObj.GetTextVerticalAdjust(rSet), ((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(), - (SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit), + rTextObj.IsFitToSize(), + rTextObj.IsAutoFit(), ((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(), SDRTEXTANI_BLINK == eAniKind, SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind, diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 76e6d81bb252..50bfd3e8b1d7 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -281,6 +281,11 @@ namespace drawinglayer aAnchorTransform, rText.isFixedCellHeight()); } + else if(rText.isAutoFit()) + { + // isotrophically scaled text in range + pNew = new SdrAutoFitTextPrimitive2D(&rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, bWordWrap); + } else // text in range { // build new primitive diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 089f75aa8ade..ac1573f68b8d 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -446,6 +446,55 @@ namespace drawinglayer { namespace primitive2d { + Primitive2DSequence SdrAutoFitTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const + { + Primitive2DSequence aRetval; + getSdrText()->GetObject().impDecomposeAutoFitTextPrimitive(aRetval, *this, aViewInformation); + + return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval); + } + + SdrAutoFitTextPrimitive2D::SdrAutoFitTextPrimitive2D( + const SdrText* pSdrText, + const OutlinerParaObject& rParaObj, + const ::basegfx::B2DHomMatrix& rTextRangeTransform, + bool bWordWrap) + : SdrTextPrimitive2D(pSdrText, rParaObj), + maTextRangeTransform(rTextRangeTransform), + mbWordWrap(bWordWrap) + { + } + + bool SdrAutoFitTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(SdrTextPrimitive2D::operator==(rPrimitive)) + { + const SdrBlockTextPrimitive2D& rCompare = (SdrBlockTextPrimitive2D&)rPrimitive; + + return (getTextRangeTransform() == rCompare.getTextRangeTransform() + && getWordWrap() == rCompare.getWordWrap()); + } + + return false; + } + + SdrTextPrimitive2D* SdrAutoFitTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const + { + return new SdrAutoFitTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getWordWrap()); + } + + // provide unique ID + ImplPrimitrive2DIDBlock(SdrAutoFitTextPrimitive2D, PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D) + + } // end of namespace primitive2d + } // end of namespace drawinglayer + + ////////////////////////////////////////////////////////////////////////////// + + namespace drawinglayer + { + namespace primitive2d + { Primitive2DSequence SdrStretchTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const { Primitive2DSequence aRetval; diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 7235310def0b..fba6007f36fb 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -316,7 +316,7 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectang { const SdrTextObj* pText = PTR_CAST(SdrTextObj,GetTextEditObject()); bool bTextFrame(pText && pText->IsTextFrame()); - bool bFitToSize(0 != (pTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING)); + bool bFitToSize(pText && pText->IsFitToSize()); bool bModifyMerk(pTextEditOutliner->IsModified()); // #43095# Rectangle aBlankRect(rOutlView.GetOutputArea()); aBlankRect.Union(aMinTextEditArea); @@ -385,7 +385,7 @@ void SdrObjEditView::ImpInvalidateOutlinerView(OutlinerView& rOutlView) const { const SdrTextObj* pText = PTR_CAST(SdrTextObj,GetTextEditObject()); bool bTextFrame(pText && pText->IsTextFrame()); - bool bFitToSize(0 != (pTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING)); + bool bFitToSize(pText && pText->IsFitToSize()); if(bTextFrame && !bFitToSize) { @@ -650,8 +650,7 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit( if ( !pTextObj->IsContourTextFrame() ) { // FitToSize erstmal nicht mit ContourFrame - SdrFitToSizeType eFit = pTextObj->GetFitToSize(); - if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES) + if (pTextObj->IsFitToSize()) aTextRect = aAnchorRect; } @@ -719,8 +718,7 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit( // #71519# if(!bExtraInvalidate) { - SdrFitToSizeType eFit = pTextObj->GetFitToSize(); - if(eFit == SDRTEXTFIT_PROPORTIONAL || eFit == SDRTEXTFIT_ALLLINES) + if(pTextObj->IsFitToSize()) bExtraInvalidate = sal_True; } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 6a79359e1a00..c784859c731a 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -137,6 +137,7 @@ SdrTextObj::SdrTextObj() // #i25616# mbSupportTextIndentingOnLineWidthChange = sal_True; + mbInDownScale = sal_False; } SdrTextObj::SdrTextObj(const Rectangle& rNewRect) @@ -162,6 +163,7 @@ SdrTextObj::SdrTextObj(const Rectangle& rNewRect) // #111096# mbTextAnimationAllowed = sal_True; + mbInDownScale = sal_False; // #108784# maTextEditOffset = Point(0, 0); @@ -192,6 +194,7 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind) // #111096# mbTextAnimationAllowed = sal_True; + mbInDownScale = sal_False; // #108784# maTextEditOffset = Point(0, 0); @@ -224,6 +227,7 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect) // #111096# mbTextAnimationAllowed = sal_True; + mbInDownScale = sal_False; // #108784# maTextEditOffset = Point(0, 0); @@ -258,6 +262,7 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStr // #111096# mbTextAnimationAllowed = sal_True; + mbInDownScale = sal_False; // #108784# maTextEditOffset = Point(0, 0); @@ -834,8 +839,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FAS SdrTextAniKind eAniKind=GetTextAniKind(); SdrTextAniDirection eAniDirection=GetTextAniDirection(); - SdrFitToSizeType eFit=GetFitToSize(); - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); + FASTBOOL bFitToSize(IsFitToSize()); FASTBOOL bContourFrame=IsContourTextFrame(); FASTBOOL bFrame=IsTextFrame(); @@ -996,7 +1000,7 @@ OutlinerParaObject* SdrTextObj::GetEditOutlinerParaObject() const return pPara; } -void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& rTextRect, const Rectangle& rAnchorRect, Fraction& rFitXKorreg) const +void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg) const { OutputDevice* pOut = rOutliner.GetRefDevice(); BOOL bNoStretching(FALSE); @@ -1041,12 +1045,12 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& r unsigned nLoopCount=0; FASTBOOL bNoMoreLoop=FALSE; long nXDiff0=0x7FFFFFFF; - long nWantWdt=rAnchorRect.Right()-rAnchorRect.Left(); - long nIsWdt=rTextRect.Right()-rTextRect.Left(); + long nWantWdt=rShapeSize.Width(); + long nIsWdt=rTextSize.Width(); if (nIsWdt==0) nIsWdt=1; - long nWantHgt=rAnchorRect.Bottom()-rAnchorRect.Top(); - long nIsHgt=rTextRect.Bottom()-rTextRect.Top(); + long nWantHgt=rShapeSize.Height(); + long nIsHgt=rTextSize.Height(); if (nIsHgt==0) nIsHgt=1; long nXTolPl=nWantWdt/100; // Toleranz +1% @@ -1274,8 +1278,7 @@ basegfx::B2DPolyPolygon SdrTextObj::TakeContour() const Rectangle aR; TakeTextRect(rOutliner,aR,FALSE,&aAnchor2); rOutliner.Clear(); - SdrFitToSizeType eFit=GetFitToSize(); - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); + FASTBOOL bFitToSize(IsFitToSize()); if (bFitToSize) aR=aAnchor2; Polygon aPol(aR); if (aGeo.nDrehWink!=0) RotatePoly(aPol,aR.TopLeft(),aGeo.nSin,aGeo.nCos); @@ -1392,8 +1395,7 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( FASTBOOL bContourFrame, if (!bContourFrame) { // FitToSize erstmal nicht mit ContourFrame - SdrFitToSizeType eFit=GetFitToSize(); - if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES) + if (IsFitToSize() || IsAutoFit()) { ULONG nStat=rOutliner.GetControlWord(); nStat|=EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE; @@ -1407,13 +1409,73 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( FASTBOOL bContourFrame, if (!bContourFrame) { // FitToSize erstmal nicht mit ContourFrame - SdrFitToSizeType eFit=GetFitToSize(); - if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES) + if (IsFitToSize()) { - ImpSetCharStretching(rOutliner,rTextRect,rAnchorRect,rFitXKorreg); + ImpSetCharStretching(rOutliner,rTextRect.GetSize(),rAnchorRect.GetSize(),rFitXKorreg); rPaintRect=rAnchorRect; } + else if (IsAutoFit()) + { + ImpAutoFitText(rOutliner); + } + } +} + +void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner ) const +{ + const Size aShapeSize=GetSnapRect().GetSize(); + ImpAutoFitText( rOutliner, + Size(aShapeSize.Width()-GetTextLeftDistance()-GetTextRightDistance(), + aShapeSize.Height()-GetTextUpperDistance()-GetTextLowerDistance()), + IsVerticalWriting() ); +} + +void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner, const Size& rTextSize, bool bIsVerticalWriting ) +{ + // EditEngine formatting is unstable enough for + // line-breaking text that we need some more samples + + // loop early-exits if we detect an already attained value + USHORT nMinStretchX=0, nMinStretchY=0; + USHORT aOldStretchXVals[]={0,0,0,0,0,0,0,0,0,0}; + const size_t aStretchArySize=sizeof(aOldStretchXVals)/sizeof(*aOldStretchXVals); + for(int i=0; i= 1.0 ) + { + // resulting text area fits into available shape rect - + // err on the larger streching, to optimally fill area + nMinStretchX = std::max(nMinStretchX,nCurrStretchX); + nMinStretchY = std::max(nMinStretchY,nCurrStretchY); + } + + aOldStretchXVals[i] = nCurrStretchX; + if( std::find(aOldStretchXVals, aOldStretchXVals+i, nCurrStretchX) != aOldStretchXVals+i ) + break; // same value already attained once; algo is looping, exit + + if (fFactor < 1.0 || (fFactor >= 1.0 && nCurrStretchX != 100)) + { + nCurrStretchX = sal::static_int_cast(nCurrStretchX*fFactor); + nCurrStretchY = sal::static_int_cast(nCurrStretchY*fFactor); + rOutliner.SetGlobalCharStretching(std::min(USHORT(100),nCurrStretchX), + std::min(USHORT(100),nCurrStretchY)); + OSL_TRACE("SdrTextObj::onEditOutlinerStatusEvent(): zoom is %d", nCurrStretchX); + } } + + OSL_TRACE("---- SdrTextObj::onEditOutlinerStatusEvent(): final zoom is %d ----", nMinStretchX); + rOutliner.SetGlobalCharStretching(std::min(USHORT(100),nMinStretchX), + std::min(USHORT(100),nMinStretchY)); } void SdrTextObj::SetupOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const @@ -1992,6 +2054,17 @@ bool SdrTextObj::IsTextAnimationAllowed() const return mbTextAnimationAllowed; } +FASTBOOL SdrTextObj::IsAutoFit() const +{ + return GetFitToSize()==SDRTEXTFIT_AUTOFIT; +} + +FASTBOOL SdrTextObj::IsFitToSize() const +{ + const SdrFitToSizeType eFit=GetFitToSize(); + return (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); +} + void SdrTextObj::SetTextAnimationAllowed(sal_Bool bNew) { if(mbTextAnimationAllowed != bNew) @@ -2009,13 +2082,21 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) const bool bGrowY=(nStat & EE_STAT_TEXTHEIGHTCHANGED) !=0; if(bTextFrame && (bGrowX || bGrowY)) { - const bool bAutoGrowHgt= bTextFrame && IsAutoGrowHeight(); - const bool bAutoGrowWdt= bTextFrame && IsAutoGrowWidth(); - - if ((bGrowX && bAutoGrowWdt) || (bGrowY && bAutoGrowHgt)) + if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight())) { AdjustTextFrameWidthAndHeight(); } + else if (IsAutoFit() && !mbInDownScale) + { + OSL_ASSERT(pEdtOutl); + mbInDownScale = sal_True; + + // sucks that we cannot disable paints via + // pEdtOutl->SetUpdateMode(FALSE) - but EditEngine skips + // formatting as well, then. + ImpAutoFitText(*pEdtOutl); + mbInDownScale = sal_False; + } } } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index d67b18c0805b..a68f43cf6246 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -729,6 +729,140 @@ void SdrTextObj::impDecomposeContourTextPrimitive( rTarget = aConverter.getPrimitive2DSequence(); } +void SdrTextObj::impDecomposeAutoFitTextPrimitive( + drawinglayer::primitive2d::Primitive2DSequence& rTarget, + const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const +{ + // decompose matrix to have position and size of text + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + rSdrAutofitTextPrimitive.getTextRangeTransform().decompose(aScale, aTranslate, fRotate, fShearX); + + // use B2DRange aAnchorTextRange for calculations + basegfx::B2DRange aAnchorTextRange(aTranslate); + aAnchorTextRange.expand(aTranslate + aScale); + + // prepare outliner + const SfxItemSet& rTextItemSet = rSdrAutofitTextPrimitive.getSdrText()->GetItemSet(); + SdrOutliner& rOutliner = ImpGetDrawOutliner(); + SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet); + SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet); + const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); + const Size aNullSize; + + // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition + rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); + + rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_AUTOPAGESIZE|EE_CNTRL_STRETCHING); + rOutliner.SetMinAutoPaperSize(aNullSize); + rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); + + // add one to rage sizes to get back to the old Rectangle and outliner measurements + const sal_uInt32 nAnchorTextWidth(FRound(aAnchorTextRange.getWidth() + 1L)); + const sal_uInt32 nAnchorTextHeight(FRound(aAnchorTextRange.getHeight() + 1L)); + const OutlinerParaObject* pOutlinerParaObject = rSdrAutofitTextPrimitive.getSdrText()->GetOutlinerParaObject(); + OSL_ENSURE(pOutlinerParaObject, "impDecomposeBlockTextPrimitive used with no OutlinerParaObject (!)"); + const bool bVerticalWritintg(pOutlinerParaObject->IsVertical()); + const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight)); + + if((rSdrAutofitTextPrimitive.getWordWrap() || IsTextFrame())) + { + rOutliner.SetMaxAutoPaperSize(aAnchorTextSize); + } + + if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg) + { + rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0)); + } + + if(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg) + { + rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight)); + } + + rOutliner.SetPaperSize(aNullSize); + rOutliner.SetUpdateMode(true); + rOutliner.SetText(*pOutlinerParaObject); + ImpAutoFitText(rOutliner,aAnchorTextSize,bVerticalWritintg); + + // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition + rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); + + // now get back the layouted text size from outliner + const Size aOutlinerTextSiz(rOutliner.GetPaperSize()); + const basegfx::B2DVector aOutlinerScale(aOutlinerTextSiz.Width(), aOutlinerTextSiz.Height()); + basegfx::B2DVector aAdjustTranslate(0.0, 0.0); + + // correct horizontal translation using the now known text size + if(SDRTEXTHORZADJUST_CENTER == eHAdj || SDRTEXTHORZADJUST_RIGHT == eHAdj) + { + const double fFree(aAnchorTextRange.getWidth() - aOutlinerScale.getX()); + + if(SDRTEXTHORZADJUST_CENTER == eHAdj) + { + aAdjustTranslate.setX(fFree / 2.0); + } + + if(SDRTEXTHORZADJUST_RIGHT == eHAdj) + { + aAdjustTranslate.setX(fFree); + } + } + + // correct vertical translation using the now known text size + if(SDRTEXTVERTADJUST_CENTER == eVAdj || SDRTEXTVERTADJUST_BOTTOM == eVAdj) + { + const double fFree(aAnchorTextRange.getHeight() - aOutlinerScale.getY()); + + if(SDRTEXTVERTADJUST_CENTER == eVAdj) + { + aAdjustTranslate.setY(fFree / 2.0); + } + + if(SDRTEXTVERTADJUST_BOTTOM == eVAdj) + { + aAdjustTranslate.setY(fFree); + } + } + + // prepare matrices to apply to newly created primitives. aNewTransformA + // will get coordinates in aOutlinerScale size and positive in X, Y. + basegfx::B2DHomMatrix aNewTransformA; + basegfx::B2DHomMatrix aNewTransformB; + + // translate relative to given primitive to get same rotation and shear + // as the master shape we are working on. For vertical, use the top-right + // corner + const double fStartInX(bVerticalWritintg ? aAdjustTranslate.getX() + aOutlinerScale.getX() : aAdjustTranslate.getX()); + aNewTransformA.translate(fStartInX, aAdjustTranslate.getY()); + + // mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y, + // move the null point which was top left to bottom right. + const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0)); + const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0)); + aNewTransformB.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); + + // in-between the translations of the single primitives will take place. Afterwards, + // the object's transformations need to be applied + aNewTransformB.shearX(fShearX); + aNewTransformB.rotate(fRotate); + aNewTransformB.translate(aTranslate.getX(), aTranslate.getY()); + + basegfx::B2DRange aClipRange; + + // now break up text primitives. + impTextBreakupHandler aConverter(rOutliner); + aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB, aClipRange); + + // cleanup outliner + rOutliner.Clear(); + rOutliner.setVisualizedPage(0); + rOutliner.SetControlWord(nOriginalControlWord); + + rTarget = aConverter.getPrimitive2DSequence(); +} + void SdrTextObj::impDecomposeBlockTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index 13064e890313..ddbd670a7ebc 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -79,8 +79,7 @@ FASTBOOL SdrTextObj::AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt, { if (bTextFrame && pModel!=NULL && !rR.IsEmpty()) { - SdrFitToSizeType eFit=GetFitToSize(); - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); + FASTBOOL bFitToSize(IsFitToSize()); FASTBOOL bWdtGrow=bWdt && IsAutoGrowWidth(); FASTBOOL bHgtGrow=bHgt && IsAutoGrowHeight(); SdrTextAniKind eAniKind=GetTextAniKind(); diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index c7715f37764c..d3d2d7e189e9 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -73,15 +73,17 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) rOutl.Init( nOutlinerMode ); rOutl.SetRefDevice( pModel->GetRefDevice() ); - SdrFitToSizeType eFit=GetFitToSize(); - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); + FASTBOOL bFitToSize(IsFitToSize()); FASTBOOL bContourFrame=IsContourTextFrame(); ImpSetTextEditParams(); if (!bContourFrame) { ULONG nStat=rOutl.GetControlWord(); nStat|=EE_CNTRL_AUTOPAGESIZE; - if (bFitToSize) nStat|=EE_CNTRL_STRETCHING; else nStat&=~EE_CNTRL_STRETCHING; + if (bFitToSize || IsAutoFit()) + nStat|=EE_CNTRL_STRETCHING; + else + nStat&=~EE_CNTRL_STRETCHING; rOutl.SetControlWord(nStat); } @@ -119,7 +121,11 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) TakeTextRect(rOutl, aTextRect, FALSE, &aAnchorRect/* #97097# give TRUE here, not FALSE */); Fraction aFitXKorreg(1,1); - ImpSetCharStretching(rOutl,aTextRect,aAnchorRect,aFitXKorreg); + ImpSetCharStretching(rOutl,aTextRect.GetSize(),aAnchorRect.GetSize(),aFitXKorreg); + } + else if (IsAutoFit()) + { + ImpAutoFitText(rOutl); } if(pOutlinerParaObject) @@ -146,8 +152,7 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const { - SdrFitToSizeType eFit=GetFitToSize(); - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); + FASTBOOL bFitToSize(IsFitToSize()); Size aPaperMin,aPaperMax; Rectangle aViewInit; TakeTextAnchorRect(aViewInit); diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index bd1564ab3f4e..96878f6926b6 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -84,9 +84,6 @@ void SdrTextObj::NbcSetSnapRect(const Rectangle& rRect) if (bTextFrame && (pModel==NULL || !pModel->IsPasteResize())) { // #51139# if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1); if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1); - if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) { - NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0)); - } NbcAdjustTextFrameWidthAndHeight(); } ImpCheckShear(); @@ -112,9 +109,6 @@ void SdrTextObj::NbcSetLogicRect(const Rectangle& rRect) if (bTextFrame) { if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1); if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1); - if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) { - NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0)); - } NbcAdjustTextFrameWidthAndHeight(); } SetRectsDirty(); @@ -228,9 +222,6 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract if (bTextFrame && (pModel==NULL || !pModel->IsPasteResize())) { // #51139# if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1); if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1); - if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) { - NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0)); - } NbcAdjustTextFrameWidthAndHeight(); } ImpCheckShear(); diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 7a4305b9581f..1a2cab97a6c0 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -502,8 +502,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co Point aTemporaryTextRelativePosition(aLocalLogicPosition - aTextRect.TopLeft()); // FitToSize berueksichtigen - SdrFitToSizeType eFit=pTextObj->GetFitToSize(); - BOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); + BOOL bFitToSize(pTextObj->IsFitToSize()); if (bFitToSize) { Fraction aX(aTextRect.GetWidth()-1,aAnchor.GetWidth()-1); Fraction aY(aTextRect.GetHeight()-1,aAnchor.GetHeight()-1); diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 9dac5b4cd469..596bfff3a4a9 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -625,8 +625,8 @@ SvXMLEnumMapEntry __READONLY_DATA pXML_FitToSize_Enum[] = { { XML_FALSE, drawing::TextFitToSizeType_NONE }, { XML_TRUE, drawing::TextFitToSizeType_PROPORTIONAL }, - { XML_TRUE, drawing::TextFitToSizeType_ALLLINES }, - { XML_TRUE, drawing::TextFitToSizeType_RESIZEATTR }, + { XML_ALL, drawing::TextFitToSizeType_ALLLINES }, + { XML_SHRINK_TO_FIT,drawing::TextFitToSizeType_AUTOFIT }, { XML_TOKEN_INVALID, 0 } }; -- cgit From f97dda9ca50e4dfad58ee619d5dd35cd0e6efab7 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 10:11:32 +0200 Subject: fit-list-to-size.diff: Shrink font automatically when text overflows. i#94086 Scale-font-down if typing text in Impress and the text box becomes too small. --- qadevOOo/runner/util/ValueChanger.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java index d63202d54e33..8388b4c2222f 100644 --- a/qadevOOo/runner/util/ValueChanger.java +++ b/qadevOOo/runner/util/ValueChanger.java @@ -383,7 +383,7 @@ public class ValueChanger { com.sun.star.drawing.TextFitToSizeType TF1 = com.sun.star.drawing.TextFitToSizeType.ALLLINES; com.sun.star.drawing.TextFitToSizeType TF2 = com.sun.star.drawing.TextFitToSizeType.NONE; com.sun.star.drawing.TextFitToSizeType TF3 = com.sun.star.drawing.TextFitToSizeType.PROPORTIONAL; - com.sun.star.drawing.TextFitToSizeType TF4 = com.sun.star.drawing.TextFitToSizeType.RESIZEATTR; + com.sun.star.drawing.TextFitToSizeType TF4 = com.sun.star.drawing.TextFitToSizeType.AUTOFIT; if (oldValue.equals(TF1)) newValue = TF2; if (oldValue.equals(TF2)) newValue = TF3; if (oldValue.equals(TF3)) newValue = TF4; -- cgit From 942fdab7b5feff505440fe8550c420d7453373df Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 11:32:50 +0200 Subject: odk-configure-honour-ure-link.diff: fix configure.pl --- odk/configure.pl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/odk/configure.pl b/odk/configure.pl index 789cfac7cd76..11f5987cb94a 100755 --- a/odk/configure.pl +++ b/odk/configure.pl @@ -31,12 +31,7 @@ $main::OFFICE_HOME = ""; $main::OFFICE_BASE_HOME = substr($main::sdkpath, 0, rindex($main::sdkpath, "/sdk")); -if ( $main::operatingSystem =~ m/darwin/ ) -{ -# $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../ure-link && pwd`; -} else { - $main::OO_SDK_URE_HOME = `cd $main::sdkpath/../../ure && pwd`; -} +$main::OO_SDK_URE_HOME = `cd $main::sdkpath/../ure-link && pwd`; chomp($main::OO_SDK_URE_HOME); $main::OO_SDK_MAKE_HOME = ""; -- cgit From 6635abfeb11e957218029052b2faa947c78d3c67 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 17 Sep 2010 12:18:37 +0200 Subject: cppu-lbnames-enable-gcc-4.5.diff: enable build with gcc-4.5 i#109853 --- cppu/inc/uno/lbnames.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cppu/inc/uno/lbnames.h b/cppu/inc/uno/lbnames.h index da12caa1e276..2cf671e599f2 100644 --- a/cppu/inc/uno/lbnames.h +++ b/cppu/inc/uno/lbnames.h @@ -59,12 +59,12 @@ provoking error here, because PP ignores #error #error "Tested gcc 2 versions are 2.91 and 2.95. Patch uno/lbnames.h to try your gcc 2 version." #elif (__GNUC__ == 3 && __GNUC_MINOR__ <= 4) #define __CPPU_ENV gcc3 -#elif (__GNUC__ == 4 && __GNUC_MINOR__ <= 4) +#elif (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) #define __CPPU_ENV gcc3 #elif (__GNUC__ == 3) #error "Tested gcc 3 version is <= 3.4. Patch uno/lbnames.h to try your gcc 3 version." #else -#error "Supported gcc majors are 2 , 3 and 4 <= 4.4. Unsupported gcc major version." +#error "Supported gcc majors are 2 , 3 and 4 <= 4.5. Unsupported gcc major version." #endif /* defined (__GNUC__) */ #endif /* defined (_MSC_VER) */ -- cgit From 5ddafab02576df4c15c120b383161befb6fca148 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 17 Sep 2010 12:28:17 +0200 Subject: oox-build-fix-dev300-m77.diff: Partial fix of the oox build. --- oox/inc/oox/export/drawingml.hxx | 2 +- oox/inc/oox/export/vmlexport.hxx | 2 +- oox/source/export/preset-definitions-to-shape-types.pl | 2 +- oox/source/export/vmlexport.cxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/oox/inc/oox/export/drawingml.hxx b/oox/inc/oox/export/drawingml.hxx index 0859b15136d9..dbedb1b519c6 100644 --- a/oox/inc/oox/export/drawingml.hxx +++ b/oox/inc/oox/export/drawingml.hxx @@ -7,7 +7,7 @@ #include #include #include -#include +#include class Graphic; class String; diff --git a/oox/inc/oox/export/vmlexport.hxx b/oox/inc/oox/export/vmlexport.hxx index 544074b7b18a..92e6e22d672b 100644 --- a/oox/inc/oox/export/vmlexport.hxx +++ b/oox/inc/oox/export/vmlexport.hxx @@ -27,7 +27,7 @@ #include #include -#include +#include namespace rtl { class OString; diff --git a/oox/source/export/preset-definitions-to-shape-types.pl b/oox/source/export/preset-definitions-to-shape-types.pl index 5ecb82f814de..a2cda8483dd6 100644 --- a/oox/source/export/preset-definitions-to-shape-types.pl +++ b/oox/source/export/preset-definitions-to-shape-types.pl @@ -1204,7 +1204,7 @@ print < +#include const char* pShapeTypes[ ESCHER_ShpInst_COUNT ] = { diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index a629d89639fa..9c2faf932b8c 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -64,7 +64,7 @@ public: }; VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr pSerializer ) - : EscherEx( *( new SvNullStream ), 0 ), + : EscherEx( EscherExGlobalRef(new EscherExGlobal(0)), *( new SvNullStream ) ), m_pSerializer( pSerializer ), m_pShapeAttrList( NULL ), m_nShapeType( ESCHER_ShpInst_Nil ), -- cgit From 33059d29f9417f65c1e480a725990d2eea3f5217 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 17 Sep 2010 12:29:59 +0200 Subject: Fix the build of oox. --- oox/source/export/drawingml.cxx | 7 ++++--- oox/source/export/shapes.cxx | 4 ++-- oox/source/export/vmlexport.cxx | 2 +- oox/util/makefile.mk | 4 +++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index c3fce8e269fc..ab3646b2c959 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -60,13 +60,14 @@ #include #include #include +#include #include #include #include #include #include -#include -#include +#include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -473,7 +474,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic ) } aData = aStream.GetData(); - nDataSize = aStream.GetSize(); + nDataSize = aStream.GetEndOfData(); break; } } diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index d33572230f1d..0fe0eeb51f89 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -66,9 +66,9 @@ #include #include #include -#include +#include #include -#include +#include #include using namespace ::com::sun::star; diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 9c2faf932b8c..891e0937ca4d 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -128,7 +128,7 @@ void VMLExport::CloseContainer() UINT32 VMLExport::EnterGroup( const String& rShapeName, const Rectangle* pRect ) { - UINT32 nShapeId = GetShapeID(); + sal_uInt32 nShapeId = GenerateShapeId(); OStringBuffer aStyle( 200 ); FastAttributeList *pAttrList = m_pSerializer->createAttrList(); diff --git a/oox/util/makefile.mk b/oox/util/makefile.mk index deb8dbb6a0e7..a8ba80c480e5 100644 --- a/oox/util/makefile.mk +++ b/oox/util/makefile.mk @@ -75,7 +75,9 @@ SHL1STDLIBS= \ $(GOODIESLIB) \ $(SVTOOLLIB) \ $(SVXCORELIB) \ - $(SVXMSFILTERLIB) \ + $(SVLLIB) \ + $(MSFILTERLIB) \ + $(UNOTOOLSLIB) \ $(TOOLSLIB) # link openssl, copied this bit from ucb/source/ucp/webdav/makefile.mk -- cgit From af2342e4c7de34b0e698b12b226e5195552be35c Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 10:11:33 +0200 Subject: fit-list-to-size.diff: Shrink font automatically when text overflows. i#94086 Scale-font-down if typing text in Impress and the text box becomes too small. --- offapi/com/sun/star/drawing/TextFitToSizeType.idl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/offapi/com/sun/star/drawing/TextFitToSizeType.idl b/offapi/com/sun/star/drawing/TextFitToSizeType.idl index 39b92eeb9bbb..fb37d107b084 100644 --- a/offapi/com/sun/star/drawing/TextFitToSizeType.idl +++ b/offapi/com/sun/star/drawing/TextFitToSizeType.idl @@ -60,9 +60,10 @@ published enum TextFitToSizeType //------------------------------------------------------------------------- - /** if the shape is scaled, the font attributes are scaled and hard set - on the text */ - RESIZEATTR + /** if the shape is scaled, the font is scaled isotrophically to + fit the avaiable space. Auto line-breaks will keep working + */ + AUTOFIT }; -- cgit From 2d2ef785745a258659ccb3c262265ae2cd1990a9 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 17 Sep 2010 10:26:53 +0200 Subject: offapi-typecheck-whitelist.diff: Removed blunt instrument from offapi types. Added whitelist file that contains the typenames which are permitted to change. --- offapi/util/makefile.mk | 9 ++++++--- offapi/util/types-whitelist | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 offapi/util/types-whitelist diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk index 016180d7765c..2518876ca4d1 100644 --- a/offapi/util/makefile.mk +++ b/offapi/util/makefile.mk @@ -176,13 +176,16 @@ $(OUT)$/ucrdoc$/types_doc.db : $(OUT)$/ucrdoc$/offapi_doc.db $(SOLARBINDIR)$/udk # #JSC: i have removed the doc rdb because all type information is already in the # types.rdb, even the service and singleton type info. IDL docu isn't checked. -$(REGISTRYCHECKFLAG) : $(UCR)$/types.db $(OUT)$/ucrdoc$/types_doc.db - $(COMMAND_ECHO)$(REGCOMPARE) -f -t -r1 $(REFERENCE_RDB) -r2 $(UCR)$/types.db \ +# +#Use the types-whitelist to exclude published API from signalling incompatibility. +#Handle with care. +$(REGISTRYCHECKFLAG) : $(UCR)$/types.db $(OUT)$/ucrdoc$/types_doc.db types-whitelist + $(COMMAND_ECHO)$(REGCOMPARE) -f -t -r1 $(REFERENCE_RDB) -r2 $(UCR)$/types.db @types-whitelist \ && echo > $(REGISTRYCHECKFLAG) #JSC: new target to prepare some UNO type statistics, the ouput will be later used # for versioning of UNO cli type libraries -$(UNOTYPE_STATISTICS) : $(REGISTRYCHECKFLAG) +$(UNOTYPE_STATISTICS) : $(UCR)$/types.db $(OUT)$/ucrdoc$/types_doc.db $(COMMAND_ECHO)$(AUGMENT_LIBRARY_PATH) $(PERL) checknewapi.pl $(UCR)$/types.db $(REFERENCE_RDB) "$(RSCREVISION)" "$(REGVIEWTOOL)" > $@ .INCLUDE : target.mk diff --git a/offapi/util/types-whitelist b/offapi/util/types-whitelist new file mode 100644 index 000000000000..343bede08724 --- /dev/null +++ b/offapi/util/types-whitelist @@ -0,0 +1 @@ +-x /UCR/com/sun/star/drawing/TextFitToSizeType -- cgit From 200077d78514c321a35a897b8df148950dea491f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 17 Sep 2010 12:10:55 +0200 Subject: cws-vmiklos01.diff: Better RTF export filter --- scp2/source/ooo/file_library_ooo.scp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp index dfc3fd49903d..08c2756d1501 100644 --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -1432,7 +1432,7 @@ STD_LIB_FILE( gid_File_Lib_Msfilter, msfilter) STD_UNO_LIB_FILE( gid_File_Lib_Sw , sw) STD_LIB_FILE( gid_File_Lib_Swui, swui) -STD_LIB_FILE( gid_File_Lib_Msword, msword ) +STD_UNO_LIB_FILE( gid_File_Lib_Msword, msword ) #if ! defined UNX File gid_File_Lib_Sysdtrans -- cgit From e9aa29080e00f84daa389c4f086a5aaabf17a1ed Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 17 Sep 2010 12:12:53 +0200 Subject: cws-vmiklos01.diff: Better RTF export filter --- .../config/fragments/filters/Rich_Text_Format.xcu | 4 +- writerfilter/source/filter/RtfFilter.cxx | 145 +++++++++++++++++++++ writerfilter/source/filter/RtfFilter.hxx | 100 ++++++++++++++ writerfilter/source/filter/WriterFilter.cxx | 2 + writerfilter/source/filter/makefile.mk | 3 +- 5 files changed, 251 insertions(+), 3 deletions(-) create mode 100644 writerfilter/source/filter/RtfFilter.cxx create mode 100644 writerfilter/source/filter/RtfFilter.hxx diff --git a/filter/source/config/fragments/filters/Rich_Text_Format.xcu b/filter/source/config/fragments/filters/Rich_Text_Format.xcu index dc8b07e45536..d8fb18c96d06 100644 --- a/filter/source/config/fragments/filters/Rich_Text_Format.xcu +++ b/filter/source/config/fragments/filters/Rich_Text_Format.xcu @@ -1,7 +1,7 @@ - IMPORT EXPORT ALIEN PREFERRED + IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED - + com.sun.star.comp.Writer.RtfFilter RTF Rich Text Format diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx new file mode 100644 index 000000000000..b9445bb7d507 --- /dev/null +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_ +#include +#endif +#include +#include +#include + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star; + +RtfFilter::RtfFilter( const uno::Reference< uno::XComponentContext >& rxContext) : + m_xContext( rxContext ) +{ +} + +RtfFilter::~RtfFilter() +{ +} + +sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) + throw (uno::RuntimeException) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + if( m_xSrcDoc.is() ) + { + uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); + uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfExport" ))), uno::UNO_QUERY_THROW); + if (!xIfc.is()) + return sal_False; + uno::Reference< document::XExporter > xExprtr(xIfc, uno::UNO_QUERY_THROW); + uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW); + if (!xExprtr.is() || !xFltr.is()) + return sal_False; + xExprtr->setSourceDocument(m_xSrcDoc); + return xFltr->filter(aDescriptor); + } + else if ( m_xDstDoc.is() ) + { + uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); + uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfImport" ))), uno::UNO_QUERY_THROW); + if (!xIfc.is()) + return sal_False; + uno::Reference< document::XImporter > xImprtr(xIfc, uno::UNO_QUERY_THROW); + uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW); + if (!xImprtr.is() || !xFltr.is()) + return sal_False; + xImprtr->setTargetDocument(m_xDstDoc); + return xFltr->filter(aDescriptor); + } + return sal_False; +} + +void RtfFilter::cancel( ) throw (uno::RuntimeException) +{ +} + +void RtfFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xSrcDoc = xDoc; +} + +void RtfFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xDstDoc = xDoc; +} + +void RtfFilter::initialize( const uno::Sequence< uno::Any >& /*aArguments*/ ) throw (uno::Exception, uno::RuntimeException) +{ + // The DOCX exporter here extracts 'type' of the filter, ie 'Word' or + // 'Word Template' but we don't need it for RTF. +} + +OUString RtfFilter::getImplementationName( ) throw (uno::RuntimeException) +{ + return RtfFilter_getImplementationName(); +} + +#define SERVICE_NAME1 "com.sun.star.document.ImportFilter" +#define SERVICE_NAME2 "com.sun.star.document.ExportFilter" +sal_Bool RtfFilter::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) +{ + return (rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) ) || + rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME2 ) )); +} + +uno::Sequence< OUString > RtfFilter::getSupportedServiceNames( ) throw (uno::RuntimeException) +{ + return RtfFilter_getSupportedServiceNames(); +} + +/* Helpers, used by shared lib exports. */ + +OUString RtfFilter_getImplementationName () throw (uno::RuntimeException) +{ + return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfFilter" ) ); +} + +uno::Sequence< OUString > RtfFilter_getSupportedServiceNames( ) throw (uno::RuntimeException) +{ + uno::Sequence < OUString > aRet(2); + OUString* pArray = aRet.getArray(); + pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME1 ) ); + pArray[1] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME2 ) ); + return aRet; +} +#undef SERVICE_NAME1 +#undef SERVICE_NAME2 + +uno::Reference< uno::XInterface > RtfFilter_createInstance( const uno::Reference< uno::XComponentContext >& xContext) + throw( uno::Exception ) +{ + return (cppu::OWeakObject*) new RtfFilter( xContext ); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/writerfilter/source/filter/RtfFilter.hxx b/writerfilter/source/filter/RtfFilter.hxx new file mode 100644 index 000000000000..7a00b3b84ed7 --- /dev/null +++ b/writerfilter/source/filter/RtfFilter.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFFILTER_HXX +#define _RTFFILTER_HXX + +#include +#include +#include +#include +#include +#include +#include +#include + +class WRITERFILTER_DLLPUBLIC RtfFilter : public cppu::WeakImplHelper5 +< + com::sun::star::document::XFilter, + com::sun::star::document::XImporter, + com::sun::star::document::XExporter, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +{ + +protected: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xSrcDoc, m_xDstDoc; + ::rtl::OUString m_sFilterName; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler; + + +public: + RtfFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext); + virtual ~RtfFilter(); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XImporter + virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + // XExporter + virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + +}; + + +::rtl::OUString RtfFilter_getImplementationName() + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfFilter_getSupportedServiceNames( ) + throw ( ::com::sun::star::uno::RuntimeException ); + +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfFilter_createInstance( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > &xContext) + throw( ::com::sun::star::uno::Exception ); +#endif diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 71a97d72f391..cd744238f314 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -30,6 +30,7 @@ #endif #include #include +#include using namespace ::rtl; using namespace ::cppu; @@ -56,6 +57,7 @@ static struct ::cppu::ImplementationEntry s_component_entries [] = { { WriterFilter_createInstance, WriterFilter_getImplementationName, WriterFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, { WriterFilterDetection_createInstance, WriterFilterDetection_getImplementationName, WriterFilterDetection_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0} , + { RtfFilter_createInstance, RtfFilter_getImplementationName, RtfFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, { 0, 0, 0, 0, 0, 0 } // terminate with NULL }; diff --git a/writerfilter/source/filter/makefile.mk b/writerfilter/source/filter/makefile.mk index f578e2853243..6b11fd4ff1f3 100644 --- a/writerfilter/source/filter/makefile.mk +++ b/writerfilter/source/filter/makefile.mk @@ -40,7 +40,8 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES= $(SLO)$/WriterFilter.obj \ $(SLO)$/WriterFilterDetection.obj \ - $(SLO)$/ImportFilter.obj + $(SLO)$/ImportFilter.obj \ + $(SLO)$/RtfFilter.obj # --- Targets ---------------------------------- -- cgit From c148ab4b535a6e85bdaaabd487983999c4a023d7 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 17 Sep 2010 12:12:53 +0200 Subject: cws-vmiklos01.diff: Better RTF export filter --- sax/source/tools/fastserializer.cxx | 45 +++++++++++++++++++++++++++++++++++++ sax/source/tools/fastserializer.hxx | 7 ++++++ svtools/inc/rtfkeywd.hxx | 12 ++++++++++ 3 files changed, 64 insertions(+) diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index b0318516b72c..d88e3140f956 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -34,6 +34,10 @@ #include +#if DEBUG +#include +#endif + using ::rtl::OString; using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -321,6 +325,28 @@ namespace sax_fastparser { maMarkStack.push( ForMerge() ); } +#if DEBUG + void FastSaxSerializer::printMarkStack( ) + { + ::std::stack< ForMerge > aCopy( maMarkStack ); + int nSize = aCopy.size(); + int i = 0; + while ( !aCopy.empty() ) + { + fprintf( stderr, "%d\n", nSize - i ); + + ForMerge aMarks = aCopy.top( ); + aMarks.print(); + + + fprintf( stderr, "\n" ); + + aCopy.pop( ); + i++; + } + } +#endif + void FastSaxSerializer::mergeTopMarks( sax_fastparser::MergeMarksEnum eMergeType ) { if ( maMarkStack.empty() ) @@ -360,6 +386,25 @@ namespace sax_fastparser { return maData; } +#if DEBUG + void FastSaxSerializer::ForMerge::print( ) + { + fprintf( stderr, "Data: " ); + for ( sal_Int32 i=0, len=maData.getLength(); i < len; i++ ) + { + fprintf( stderr, "%c", maData[i] ); + } + + fprintf( stderr, "\nPostponed: " ); + for ( sal_Int32 i=0, len=maPostponed.getLength(); i < len; i++ ) + { + fprintf( stderr, "%c", maPostponed[i] ); + } + + fprintf( stderr, "\n" ); + } +#endif + void FastSaxSerializer::ForMerge::prepend( const Int8Sequence &rWhat ) { merge( maData, rWhat, false ); diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx index a98a0ff7a67d..39f471fd7009 100644 --- a/sax/source/tools/fastserializer.hxx +++ b/sax/source/tools/fastserializer.hxx @@ -134,6 +134,9 @@ private: ForMerge() : maData(), maPostponed() {} Int8Sequence& getData(); +#if DEBUG + void print(); +#endif void prepend( const Int8Sequence &rWhat ); void append( const Int8Sequence &rWhat ); @@ -143,6 +146,10 @@ private: static void merge( Int8Sequence &rTop, const Int8Sequence &rMerge, bool bAppend ); }; +#if DEBUG + void printMarkStack( ); +#endif + ::std::stack< ForMerge > maMarkStack; void writeFastAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ); diff --git a/svtools/inc/rtfkeywd.hxx b/svtools/inc/rtfkeywd.hxx index 5ccd9149bd68..60963c58abbc 100644 --- a/svtools/inc/rtfkeywd.hxx +++ b/svtools/inc/rtfkeywd.hxx @@ -39,6 +39,7 @@ #define OOO_STRING_SVTOOLS_RTF_ALT "\\alt" #define OOO_STRING_SVTOOLS_RTF_ANNOTATION "\\annotation" #define OOO_STRING_SVTOOLS_RTF_ANSI "\\ansi" +#define OOO_STRING_SVTOOLS_RTF_ATNDATE "\\atndate" #define OOO_STRING_SVTOOLS_RTF_ATNID "\\atnid" #define OOO_STRING_SVTOOLS_RTF_AUTHOR "\\author" #define OOO_STRING_SVTOOLS_RTF_B "\\b" @@ -976,12 +977,15 @@ #define OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN "\\shpbxcolumn" #define OOO_STRING_SVTOOLS_RTF_SHPBXMARGIN "\\shpbxmargin" #define OOO_STRING_SVTOOLS_RTF_SHPBXPAGE "\\shpbxpage" +#define OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE "\\shpbxignore" #define OOO_STRING_SVTOOLS_RTF_SHPBYMARGIN "\\shpbymargin" #define OOO_STRING_SVTOOLS_RTF_SHPBYPAGE "\\shpbypage" #define OOO_STRING_SVTOOLS_RTF_SHPBYPARA "\\shpbypara" +#define OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE "\\shpbyignore" #define OOO_STRING_SVTOOLS_RTF_SHPFBLWTXT "\\shpfblwtxt" #define OOO_STRING_SVTOOLS_RTF_SHPFHDR "\\shpfhdr" #define OOO_STRING_SVTOOLS_RTF_SHPGRP "\\shpgrp" +#define OOO_STRING_SVTOOLS_RTF_SHPINST "\\shpinst" #define OOO_STRING_SVTOOLS_RTF_SHPLEFT "\\shpleft" #define OOO_STRING_SVTOOLS_RTF_SHPLID "\\shplid" #define OOO_STRING_SVTOOLS_RTF_SHPLOCKANCHOR "\\shplockanchor" @@ -993,6 +997,7 @@ #define OOO_STRING_SVTOOLS_RTF_SHPWRK "\\shpwrk" #define OOO_STRING_SVTOOLS_RTF_SHPWR "\\shpwr" #define OOO_STRING_SVTOOLS_RTF_SHPZ "\\shpz" +#define OOO_STRING_SVTOOLS_RTF_SP "\\sp" #define OOO_STRING_SVTOOLS_RTF_SPRSBSP "\\sprsbsp" #define OOO_STRING_SVTOOLS_RTF_SPRSLNSP "\\sprslnsp" #define OOO_STRING_SVTOOLS_RTF_SPRSTSM "\\sprstsm" @@ -1138,4 +1143,11 @@ #define OOO_STRING_SVTOOLS_RTF_OLHWAVE "\\olhwave" #define OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE "\\ololdbwave" +// Support for nested tables +#define OOO_STRING_SVTOOLS_RTF_ITAP "\\itap" +#define OOO_STRING_SVTOOLS_RTF_NESTCELL "\\nestcell" +#define OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS "\\nesttableprops" +#define OOO_STRING_SVTOOLS_RTF_NESTROW "\\nestrow" +#define OOO_STRING_SVTOOLS_RTF_NONESTTABLES "\\nonesttables" + #endif // _RTFKEYWD_HXX -- cgit From d02318df60b8ab8abe0006bacc5ea15b896be553 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 17 Sep 2010 13:13:04 +0200 Subject: sal-strintern-speed.diff: sal-strintern - speedup i#78496 --- sal/rtl/source/hash.cxx | 202 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 165 insertions(+), 37 deletions(-) diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx index 7caa2341ca11..86454545ccd5 100644 --- a/sal/rtl/source/hash.cxx +++ b/sal/rtl/source/hash.cxx @@ -27,67 +27,164 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sal.hxx" -#include "rtl/allocator.hxx" #include "hash.h" #include "strimp.h" +#include +struct StringHashTableImpl { + sal_uInt32 nEntries; + sal_uInt32 nSize; + rtl_uString **pData; +}; + +typedef StringHashTableImpl StringHashTable; -#include +// Only for use in the implementation +static StringHashTable *rtl_str_hash_new (sal_uInt32 nSize); +static void rtl_str_hash_free (StringHashTable *pHash); -namespace { +} -struct UStringHash +StringHashTable * +getHashTable () { - size_t operator()(rtl_uString * const &rString) const - { return (size_t)rtl_ustr_hashCode_WithLength( rString->buffer, rString->length ); } -}; + static StringHashTable *pInternPool = NULL; + if (pInternPool == NULL) { + static StringHashTable* pHash = rtl_str_hash_new(1024); + pInternPool = pHash; + } + return pInternPool; +} + +// Better / smaller / faster hash set .... + +// TODO: add bottom bit-set list terminator to string list -struct UStringEqual +static sal_uInt32 +getNextSize (sal_uInt32 nSize) { - sal_Bool operator() ( rtl_uString * const &pStringA, - rtl_uString * const &pStringB) const + // Sedgewick - Algorithms in C P577. + static const sal_uInt32 nPrimes[] = { 1021, 2039, 4093, 8191, 16381, 32749, + 65521, 131071,262139, 524287, 1048573, + 2097143, 4194301, 8388593, 16777213, + 33554393, 67108859, 134217689 }; + #define NUM_PRIMES (sizeof (nPrimes)/ sizeof (nPrimes[0])) + for (sal_uInt32 i = 0; i < NUM_PRIMES; i++) { - if (pStringA == pStringB) - return true; - if (pStringA->length != pStringB->length) - return false; - return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length, - pStringB->buffer, pStringB->length); + if (nPrimes[i] > nSize) + return nPrimes[i]; } -}; + return nSize * 2; +} -typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual, - rtl::Allocator > StringHashTable; +static sal_uInt32 +hashString (rtl_uString *pString) +{ + return (sal_uInt32) rtl_ustr_hashCode_WithLength (pString->buffer, + pString->length); +} -StringHashTable * -getHashTable () +static StringHashTable * +rtl_str_hash_new (sal_uInt32 nSize) { - static StringHashTable *pInternPool = NULL; - if (pInternPool == NULL) { - static StringHashTable aImpl(1024); - pInternPool = &aImpl; + StringHashTable *pHash = (StringHashTable *)malloc (sizeof (StringHashTable)); + + pHash->nEntries = 0; + pHash->nSize = getNextSize (nSize); + pHash->pData = (rtl_uString **) calloc (sizeof (rtl_uString *), pHash->nSize); + + return pHash; +} + +static void +rtl_str_hash_free (StringHashTable *pHash) +{ + if (!pHash) + return; + if (pHash->pData) + free (pHash->pData); + free (pHash); +} + +static void +rtl_str_hash_insert_nonequal (StringHashTable *pHash, + rtl_uString *pString) +{ + sal_uInt32 nHash = hashString (pString); + sal_uInt32 n; + rtl_uString *pHashStr; + + n = nHash % pHash->nSize; + while ((pHashStr = pHash->pData[n]) != NULL) { + n++; + if (n >= pHash->nSize) + n = 0; } - return pInternPool; + pHash->pData[n] = pString; +} + +static void +rtl_str_hash_resize (sal_uInt32 nNewSize) +{ + sal_uInt32 i; + StringHashTable *pNewHash; + StringHashTable *pHash = getHashTable(); + + OSL_ASSERT (nNewSize > pHash->nEntries); + + pNewHash = rtl_str_hash_new (nNewSize); + + for (i = 0; i < pHash->nSize; i++) + { + if (pHash->pData[i] != NULL) + rtl_str_hash_insert_nonequal (pNewHash, pHash->pData[i]); + } + pNewHash->nEntries = pHash->nEntries; + free (pHash->pData); + *pHash = *pNewHash; + pNewHash->pData = NULL; + rtl_str_hash_free (pNewHash); } +static int +compareEqual (rtl_uString *pStringA, rtl_uString *pStringB) +{ + if (pStringA == pStringB) + return 1; + if (pStringA->length != pStringB->length) + return 0; + return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length, + pStringB->buffer, pStringB->length); } -extern "C" { rtl_uString * rtl_str_hash_intern (rtl_uString *pString, int can_return) { + sal_uInt32 nHash = hashString (pString); + sal_uInt32 n; + rtl_uString *pHashStr; + StringHashTable *pHash = getHashTable(); - StringHashTable::iterator aIter; - aIter = pHash->find(pString); - if (aIter != pHash->end()) - { - rtl_uString *pHashStr = *aIter; - rtl_uString_acquire (pHashStr); - return pHashStr; + + // Should we resize ? + if (pHash->nEntries >= pHash->nSize/2) + rtl_str_hash_resize (getNextSize(pHash->nSize)); + + n = nHash % pHash->nSize; + while ((pHashStr = pHash->pData[n]) != NULL) { + if (compareEqual (pHashStr, pString)) + { + rtl_uString_acquire (pHashStr); + return pHashStr; + } + n++; + if (n >= pHash->nSize) + n = 0; } + if (!can_return) { rtl_uString *pCopy = NULL; @@ -99,7 +196,8 @@ rtl_str_hash_intern (rtl_uString *pString, if (!SAL_STRING_IS_STATIC (pString)) pString->refCount |= SAL_STRING_INTERN_FLAG; - pHash->insert(pString); + pHash->pData[n] = pString; + pHash->nEntries++; return pString; } @@ -107,7 +205,37 @@ rtl_str_hash_intern (rtl_uString *pString, void rtl_str_hash_remove (rtl_uString *pString) { - getHashTable()->erase(pString); -} + sal_uInt32 n; + sal_uInt32 nHash = hashString (pString); + rtl_uString *pHashStr; + + StringHashTable *pHash = getHashTable(); + n = nHash % pHash->nSize; + while ((pHashStr = pHash->pData[n]) != NULL) { + if (compareEqual (pHashStr, pString)) + break; + n++; + if (n >= pHash->nSize) + n = 0; + } + OSL_ASSERT (pHash->pData[n] != 0); + if (pHash->pData[n] == NULL) + return; + + pHash->pData[n++] = NULL; + pHash->nEntries--; + + if (n >= pHash->nSize) + n = 0; + + while ((pHashStr = pHash->pData[n]) != NULL) { + pHash->pData[n] = NULL; + // FIXME: rather unsophisticated and N^2 in chain-length, but robust. + rtl_str_hash_insert_nonequal (pHash, pHashStr); + n++; + if (n >= pHash->nSize) + n = 0; + } + // FIXME: Should we down-size ? } -- cgit From 5bbc027d5dae3472223538b13933ff821e027737 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 17 Sep 2010 12:22:16 +0200 Subject: cws-vmiklos01.diff: Better RTF export filter --- sw/source/filter/rtf/makefile.mk | 9 +- sw/source/filter/rtf/rtfnum.cxx | 3 +- sw/source/filter/rtf/swparrtf.cxx | 6 + sw/source/filter/rtf/swparrtf.hxx | 2 + sw/source/filter/ww8/README-rtf.txt | 226 ++ sw/source/filter/ww8/docxexport.cxx | 125 - sw/source/filter/ww8/docxexport.hxx | 22 - sw/source/filter/ww8/docxexportfilter.cxx | 49 +- sw/source/filter/ww8/makefile.mk | 14 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 3356 +++++++++++++++++++++++++++ sw/source/filter/ww8/rtfattributeoutput.hxx | 573 +++++ sw/source/filter/ww8/rtfexport.cxx | 1240 ++++++++++ sw/source/filter/ww8/rtfexport.hxx | 211 ++ sw/source/filter/ww8/rtfexportfilter.cxx | 136 ++ sw/source/filter/ww8/rtfexportfilter.hxx | 84 + sw/source/filter/ww8/rtfimportfilter.cxx | 134 ++ sw/source/filter/ww8/rtfimportfilter.hxx | 74 + sw/source/filter/ww8/rtfsdrexport.cxx | 577 +++++ sw/source/filter/ww8/rtfsdrexport.hxx | 111 + sw/source/filter/ww8/wrtw8esh.cxx | 66 +- sw/source/filter/ww8/wrtw8nds.cxx | 121 +- sw/source/filter/ww8/wrtw8num.cxx | 3 + sw/source/filter/ww8/wrtw8sty.cxx | 36 + sw/source/filter/ww8/wrtww8.cxx | 2 +- sw/source/filter/ww8/wrtww8.hxx | 67 +- sw/source/filter/ww8/ww8atr.cxx | 2 +- sw/util/msword.map | 3 + 27 files changed, 7034 insertions(+), 218 deletions(-) create mode 100644 sw/source/filter/ww8/README-rtf.txt create mode 100644 sw/source/filter/ww8/rtfattributeoutput.cxx create mode 100644 sw/source/filter/ww8/rtfattributeoutput.hxx create mode 100644 sw/source/filter/ww8/rtfexport.cxx create mode 100644 sw/source/filter/ww8/rtfexport.hxx create mode 100644 sw/source/filter/ww8/rtfexportfilter.cxx create mode 100644 sw/source/filter/ww8/rtfexportfilter.hxx create mode 100644 sw/source/filter/ww8/rtfimportfilter.cxx create mode 100644 sw/source/filter/ww8/rtfimportfilter.hxx create mode 100644 sw/source/filter/ww8/rtfsdrexport.cxx create mode 100644 sw/source/filter/ww8/rtfsdrexport.hxx diff --git a/sw/source/filter/rtf/makefile.mk b/sw/source/filter/rtf/makefile.mk index 2ff764d730a1..e7310f2d0f0e 100644 --- a/sw/source/filter/rtf/makefile.mk +++ b/sw/source/filter/rtf/makefile.mk @@ -46,18 +46,15 @@ CDEFS=$(CDEFS) -Dmydebug EXCEPTIONSFILES= \ $(SLO)$/rtffly.obj \ $(SLO)$/rtfnum.obj \ - $(SLO)$/swparrtf.obj \ - $(SLO)$/wrtrtf.obj + $(SLO)$/swparrtf.obj -SLOFILES = \ - $(SLO)$/rtfatr.obj \ +SLOFILES = \ $(SLO)$/rtffld.obj \ $(SLO)$/rtffly.obj \ $(SLO)$/rtfnum.obj \ $(SLO)$/rtftbl.obj \ - $(SLO)$/swparrtf.obj \ - $(SLO)$/wrtrtf.obj + $(SLO)$/swparrtf.obj # --- Tagets ------------------------------------------------------- diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx index b930d25b86c8..ed8faf60229f 100644 --- a/sw/source/filter/rtf/rtfnum.cxx +++ b/sw/source/filter/rtf/rtfnum.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -1102,6 +1101,7 @@ BOOL lcl_IsExportNumRule( const SwNumRule& rRule, BYTE* pEnd = 0 ) return nLvl != nEnd; } +#if 0 void SwRTFWriter::OutRTFListTab() { ByteString sOverrideList; @@ -1430,3 +1430,4 @@ BOOL SwRTFWriter::OutListNum( const SwTxtNode& rNd ) } return bRet; } +#endif diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 352ecd008589..97ef35c95f87 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -179,6 +179,12 @@ ULONG RtfReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, const S return nRet; } +ULONG RtfReader::Read(SvStream* pStream, SwDoc& rDoc, const String& rBaseURL, SwPaM& rPam) +{ + pStrm = pStream; + return Read(rDoc, rBaseURL, rPam, rBaseURL); +} + SwRTFParser::SwRTFParser(SwDoc* pD, uno::Reference i_xDocProps, const SwPaM& rCrsr, SvStream& rIn, const String& rBaseURL, diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx index c1694ef852a8..18e335a5f15b 100644 --- a/sw/source/filter/rtf/swparrtf.hxx +++ b/sw/source/filter/rtf/swparrtf.hxx @@ -81,6 +81,8 @@ struct SvxRTFPictureType; class RtfReader: public Reader { virtual ULONG Read( SwDoc &, const String& rBaseURL, SwPaM &,const String &); +public: + virtual ULONG Read( SvStream* pStrm, SwDoc &, const String& rBaseURL, SwPaM &); }; class SwNodeIdx : public SvxNodeIdx diff --git a/sw/source/filter/ww8/README-rtf.txt b/sw/source/filter/ww8/README-rtf.txt new file mode 100644 index 000000000000..661813abc95a --- /dev/null +++ b/sw/source/filter/ww8/README-rtf.txt @@ -0,0 +1,226 @@ + +--------------------------------------------------------------------- + +Summary of new features in RtfExport + +--------------------------------------------------------------------- + +Miklos Vajna + + +--------------------------------------------------------------------- + +Table of Contents + +1. Introduction + + 1.1. Terminology + 1.2. General + +2. List if fixed bugs +3. List of new features + + 3.1. Nested tables + 3.2. Character properties + 3.3. Sections + 3.4. Graphics + 3.5. Bookmarks + 3.6. Fields + 3.7. Drawing + 3.8. Form fields + 3.9. OLE objects + +4. Changes in the source code outside RTF + + +--------------------------------------------------------------------- + +1.Introduction + +--------------------------------------------------------------------- + +The biggest difference is that the new exporter is an UNO component, +and it?s based on the MSWord base classes, the vision here is that +this way much less code can achieve the same set of features, +reducing the amount of duplicated code. + + +1.1.Terminology + +-------------- + + * The "MSO OK, OOo KO" and similar abbreviations describe if the + given new feature is supported by the OOo RTF importer or it can + be tested using Microsoft Office. + * RtfExport refers to the new UNO-based exporter, RtfWriter refers + to the old built-in one. + + +1.2.General + +-------------- + +RtfWriter sometimes created documents where the first { is closed in +the middle of the document. MSO ignores this problem, but OOo stops +parsing the rest of the document if this happens, in other words +everything after such a bug is ignored. This can be reproduced by for +example parprops.odt, but it?s triggered in several other cases as +well. RtfExport has no automatic prevention for this, either - but +during development I primarily test the output with OOo, so hopefully +the bug will pop up less frequently. + + +--------------------------------------------------------------------- + +2.List if fixed bugs + +--------------------------------------------------------------------- + + * http://www.openoffice.org/issues/show_bug.cgi?id=51469 postit + fields + * http://www.openoffice.org/issues/show_bug.cgi?id=66619 page + margins + * http://www.openoffice.org/issues/show_bug.cgi?id=69856 page + numbers + * http://www.openoffice.org/issues/show_bug.cgi?id=81569 { and } in + document title + * http://www.openoffice.org/issues/show_bug.cgi?id=84703 redlines + * http://www.openoffice.org/issues/show_bug.cgi?id=91166 russian + chars + * http://www.openoffice.org/issues/show_bug.cgi?id=92673 bookmarks + across tables + * http://www.openoffice.org/issues/show_bug.cgi?id=100507 ole + object export + * http://www.openoffice.org/issues/show_bug.cgi?id=103993 same as # + 81569 just for doc comments + * http://www.openoffice.org/issues/show_bug.cgi?id=106677 + listoverride index starts at zero + * http://www.openoffice.org/issues/show_bug.cgi?id=38344 enhanced + character space + + +--------------------------------------------------------------------- + +3.List of new features + +--------------------------------------------------------------------- + + +3.1.Nested tables + +-------------- + +This was new in Word2000 and it?s now supported by RtfExport (MSO OK, +OOo KO) + + +3.2.Character properties + +-------------- + +The followings are now supported: + + * blinking (MSO OK, OOo KO) + * expanded spacing (MSO OK, OOo OK) + * pair kerning (MSO OK, OOo OK) + + +3.3.Sections + +-------------- + +RtfExport writes: + + * column breaks (MSO OK, OOo OK) + * special breaks (when the next page should be an odd or an even + page; MSO OK, OOo KO) + * the write-protected property of sections is experted properly + (MSO OK, OOo KO) + * better page numbers (inherited type from page styles, restarts; + MSO OK, OOo KO) + * line numbering (MSO OK, OOo KO) + + +3.4.Graphics + +-------------- + +PNG graphics are exported in WMF format as well, so that not only MSO +and OOo can display graphics from the output document, but Wordpad as +well. + + +3.5.Bookmarks + +-------------- + +Implicit bookmarks like reference to a footnote did not work in OOo +(one got an Error: Reference source not found message when opening +the result), this now works as expected. (MSO OK - the importer +previously autocorrected this as well, OO OK) + + +3.6.Fields + +-------------- + + * Table of contents is now written as a field, so it?s properly + read-only (MSO OK, OOo KO) + * Postit comments are now exported. (MSO OK, OOo KO) + + +3.7.Drawing + +-------------- + +Drawing objects for Word 97 through Word 2007 (shapes) are now +implemented: + + * basic shapes (rectangle, ellipse, etc.) + * lines, including free-form ones + * texts, including vertical ones and their (paragraph and + character) formatting + +(MSO OK, OOo KO) + + +3.8.Form fields + +-------------- + +All types supported by the RTF format are exported, namely: + + * text boxes + * check boxes + * list boxes + +(MSO OK, OOo KO) + + +3.9.OLE objects + +-------------- + +Their result is exported as a picture - RtfWriter did not export +anything. (MSO OK, OOo OK) + +For math, the native data is written as well, so you can edit the +object, too. (MSO OK, OOo KO) + + +--------------------------------------------------------------------- + +4.Changes in the source code outside RTF + +--------------------------------------------------------------------- + +These are refactorings I needed for RTF. To my best knowledge they do +not change the output of other filters from a user?s point of view. + + * The code that splits runs according to bookmarks is moved from + DocxExport to MSWordExportBase + * WW8_SdrAttrIter has been refactored to MSWord_SdrAttrIter + * MSWordExportBase::SubstituteBullet can avoid replacing bullets + * wwFontHelper::InitFontTable can really load all fonts + * An obvious typo in WW8AttributeOutput::CharTwoLines has been + fixed diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 41190ac4c034..2aab7aa797f2 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -116,131 +116,6 @@ bool DocxExport::CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich ) return true; } -bool DocxExport::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, - xub_StrLen nEnd, IMarkVector& rArr ) -{ - IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); - ULONG nNd = rNd.GetIndex( ); - - const sal_Int32 nMarks = pMarkAccess->getMarksCount(); - for ( sal_Int32 i = 0; i < nMarks; i++ ) - { - IMark* pMark = ( pMarkAccess->getMarksBegin() + i )->get(); - - // Only keep the bookmarks starting or ending in this node - if ( pMark->GetMarkStart().nNode == nNd || - pMark->GetMarkEnd().nNode == nNd ) - { - xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex(); - xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex(); - - // Keep only the bookmars starting or ending in the snippet - bool bIsStartOk = ( nBStart >= nStt ) && ( nBStart <= nEnd ); - bool bIsEndOk = ( nBEnd >= nStt ) && ( nBEnd <= nEnd ); - - if ( bIsStartOk || bIsEndOk ) - rArr.push_back( pMark ); - } - } - return ( rArr.size() > 0 ); -} - -class CompareMarksEnd : public std::binary_function < const IMark *, const IMark *, bool > -{ -public: - inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const - { - xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex(); - xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex(); - - return nOEnd < nTEnd; - } -}; - -bool DocxExport::NearestBookmark( xub_StrLen& rNearest ) -{ - bool bHasBookmark = false; - - if ( m_rSortedMarksStart.size( ) > 0 ) - { - IMark* pMarkStart = m_rSortedMarksStart.front(); - rNearest = pMarkStart->GetMarkStart().nContent.GetIndex(); - bHasBookmark = true; - } - - if ( m_rSortedMarksEnd.size( ) > 0 ) - { - IMark* pMarkEnd = m_rSortedMarksEnd[0]; - if ( !bHasBookmark ) - rNearest = pMarkEnd->GetMarkEnd().nContent.GetIndex(); - else - rNearest = std::min( rNearest, pMarkEnd->GetMarkEnd().nContent.GetIndex() ); - bHasBookmark = true; - } - - return bHasBookmark; -} - -xub_StrLen DocxExport::GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ) -{ - // Get the bookmarks for the normal run - xub_StrLen nNextPos = MSWordExportBase::GetNextPos( pAttrIter, rNode, nAktPos ); - - GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos ); - - xub_StrLen nNextBookmark = nNextPos; - NearestBookmark( nNextPos ); - - return std::min( nNextPos, nNextBookmark ); -} - -void DocxExport::UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd ) -{ - xub_StrLen nNextPos; - - // either no bookmark, or it is not at the current position - if ( !NearestBookmark( nNextPos ) || nNextPos > nAktPos ) - { - MSWordExportBase::UpdatePosition( pAttrIter, nAktPos, nEnd ); - } -} - -void DocxExport::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) -{ - IMarkVector aMarksStart; - if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) ) - { - IMarkVector aSortedEnd; - IMarkVector aSortedStart; - for ( IMarkVector::const_iterator it = aMarksStart.begin(), end = aMarksStart.end(); - it < end; ++it ) - { - IMark* pMark = (*it); - - // Remove the positions egals to the current pos - xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); - xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); - - if ( nStart > nAktPos ) - aSortedStart.push_back( pMark ); - - if ( nEnd > nAktPos ) - aSortedEnd.push_back( pMark ); - } - - // Sort the bookmarks by end position - std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() ); - - m_rSortedMarksStart.swap( aSortedStart ); - m_rSortedMarksEnd.swap( aSortedEnd ); - } - else - { - m_rSortedMarksStart.clear( ); - m_rSortedMarksEnd.clear( ); - } -} - void DocxExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) { std::vector< OUString > aStarts; diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 4566485fd428..6c52f6472aee 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -76,11 +76,6 @@ class DocxExport : public MSWordExportBase /// Footer counter. sal_Int32 m_nFooters; - /// Used to split the runs according to the bookmarks start and ends - typedef std::vector< ::sw::mark::IMark* > IMarkVector; - IMarkVector m_rSortedMarksStart; - IMarkVector m_rSortedMarksEnd; - /// Exporter of the VML shapes. oox::vml::VMLExport *m_pVMLExport; @@ -163,24 +158,7 @@ protected: const SwFmtPageDesc* pNewPgDescFmt = 0, const SwPageDesc* pNewPgDesc = 0 ); - /// Get the next position in the text node to output - virtual xub_StrLen GetNextPos( SwAttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ); - - /// Update the information for GetNextPos(). - virtual void UpdatePosition( SwAttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd ); - private: - /// Find the nearest bookmark from the current position. - /// - /// Returns false when there is no bookmark. - bool NearestBookmark( xub_StrLen& rNearest ); - - void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, - xub_StrLen nLen ); - - bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd, - IMarkVector& rArr ); - /// Setup pStyles and write styles.xml void InitStyles(); diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index c2b329db583e..bdf6616a0b97 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -26,6 +26,8 @@ ************************************************************************/ #include "docxexportfilter.hxx" +#include "rtfexportfilter.hxx" +#include "rtfimportfilter.hxx" #include "docxexport.hxx" #include @@ -144,7 +146,35 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceMan } catch( registry::InvalidRegistryException& ) { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); + OSL_ENSURE( sal_False, "### InvalidRegistryException (docx)!" ); + } + + try + { + uno::Reference< registry::XRegistryKey > xNewKey1( + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( + OUString::createFromAscii( IMPL_NAME_RTFEXPORT "/UNO/SERVICES/" ) ) ); + xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] ); + + bRet = sal_True; + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfexport)!" ); + } + + try + { + uno::Reference< registry::XRegistryKey > xNewKey1( + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( + OUString::createFromAscii( IMPL_NAME_RTFIMPORT "/UNO/SERVICES/" ) ) ); + xNewKey1->createKey( RtfExport_getSupportedServiceNames().getConstArray()[0] ); + + bRet = sal_True; + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException (rtfimport)!" ); } } @@ -157,6 +187,7 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceMan SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ ) { + OSL_TRACE("%s, pImplName is '%s'", OSL_THIS_FUNC, pImplName); uno::Reference< lang::XSingleServiceFactory > xFactory; void* pRet = 0; @@ -169,6 +200,22 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplN DocxExport_getImplementationName(), DocxExport_createInstance, DocxExport_getSupportedServiceNames() ) ); + } else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFEXPORT ) == 0 ) { + const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFEXPORT ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + RtfExport_getImplementationName(), + RtfExport_createInstance, + RtfExport_getSupportedServiceNames() ) ); + } else if ( rtl_str_compare( pImplName, IMPL_NAME_RTFIMPORT ) == 0 ) { + const OUString aServiceName( OUString::createFromAscii( IMPL_NAME_RTFIMPORT ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + RtfImport_getImplementationName(), + RtfImport_createInstance, + RtfImport_getSupportedServiceNames() ) ); } if ( xFactory.is() ) diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk index 653c36fbef9a..f3638e28a9f2 100644 --- a/sw/source/filter/ww8/makefile.mk +++ b/sw/source/filter/ww8/makefile.mk @@ -68,7 +68,12 @@ EXCEPTIONSFILES = \ $(SLO)$/WW8TableInfo.obj \ $(SLO)$/WW8FFData.obj \ $(SLO)$/WW8Sttbf.obj \ - $(SLO)$/WW8FibData.obj + $(SLO)$/WW8FibData.obj \ + $(SLO)$/rtfexportfilter.obj \ + $(SLO)$/rtfimportfilter.obj \ + $(SLO)$/rtfattributeoutput.obj \ + $(SLO)$/rtfsdrexport.obj \ + $(SLO)$/rtfexport.obj SLOFILES = \ @@ -100,7 +105,12 @@ SLOFILES = \ $(SLO)$/WW8TableInfo.obj \ $(SLO)$/WW8FFData.obj \ $(SLO)$/WW8Sttbf.obj \ - $(SLO)$/WW8FibData.obj + $(SLO)$/WW8FibData.obj \ + $(SLO)$/rtfexportfilter.obj \ + $(SLO)$/rtfimportfilter.obj \ + $(SLO)$/rtfattributeoutput.obj \ + $(SLO)$/rtfsdrexport.obj \ + $(SLO)$/rtfexport.obj # --- Tagets ------------------------------------------------------- diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx new file mode 100644 index 000000000000..c5ac3b15f055 --- /dev/null +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -0,0 +1,3356 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfattributeoutput.hxx" +#include "rtfexport.hxx" +#include "rtfsdrexport.hxx" +#include "writerwordglue.hxx" +#include "wrtww8.hxx" +#include "ww8par.hxx" +#include "fmtcntnt.hxx" +#include "fmtsrnd.hxx" +#include "fchrfmt.hxx" +#include "tgrditem.hxx" +#include "fmtruby.hxx" +#include "charfmt.hxx" +#include "breakit.hxx" + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +using rtl::OString; +using rtl::OStringBuffer; +using rtl::OUString; +using rtl::OUStringBuffer; +using rtl::OUStringToOString; + +using namespace nsSwDocInfoSubType; +using namespace nsFieldFlags; +using namespace sw::util; +using namespace ::com::sun::star; + +static OString OutTBLBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, const sal_Char* pStr) +{ + OStringBuffer aRet; + aRet.append(pStr); + if( pLine->GetInWidth() ) + { + // double line + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRDB); + switch( pLine->GetInWidth() ) + { + case DEF_LINE_WIDTH_0: + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "15"); + break; + case DEF_LINE_WIDTH_1: + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "30"); + break; + case DEF_LINE_WIDTH_2: + case DEF_LINE_WIDTH_3: + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRW "45"); + break; + } + } + else + { + // single line + if( DEF_LINE_WIDTH_1 >= pLine->GetOutWidth() ) + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth()); + else + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRTH OOO_STRING_SVTOOLS_RTF_BRDRW).append((sal_Int32)pLine->GetOutWidth() / 2); + } + + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRCF); + aRet.append((sal_Int32)rExport.GetColor(pLine->GetColor())); + return aRet.makeStringAndClear(); +} + +static OString OutBorderLine(RtfExport &rExport, const SvxBorderLine* pLine, + const sal_Char* pStr, USHORT nDist) +{ + OStringBuffer aRet; + aRet.append(OutTBLBorderLine(rExport, pLine, pStr)); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRSP); + aRet.append((sal_Int32)nDist); + return aRet.makeStringAndClear(); +} + +static OString OutBorderLine( RtfExport &rExport, const SvxBorderLine* pLine, + const char* pStr ) +{ + OStringBuffer aRet; + aRet.append(pStr); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNCOL); + aRet.append((sal_Int32)rExport.GetColor( pLine->GetColor() ) ); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNIN); + aRet.append((sal_Int32)pLine->GetInWidth()); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNOUT); + aRet.append((sal_Int32)pLine->GetOutWidth()); + aRet.append(OOO_STRING_SVTOOLS_RTF_BRDLNDIST); + aRet.append((sal_Int32)pLine->GetDistance()); + return aRet.makeStringAndClear(); +} + +void RtfAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + /* + You would have thought that + m_rExport.Strm() << (bIsRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficent here , + but looks like word needs to see the other directional token to be + satisified that all is kosher, otherwise it seems in ver 2003 to go and + semi-randomlyly stick strike through about the place. Perhaps + strikethrough is some ms developers "something is wrong signal" debugging + code that we're triggering ? + */ + if (bIsRTL) { + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH); + m_aStylesEnd.append(' '); + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH); + } else { + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_RTLCH); + m_aStylesEnd.append(' '); + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LTRCH); + } + + switch (nScript) { + case i18n::ScriptType::LATIN: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH); + break; + case i18n::ScriptType::ASIAN: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_DBCH); + break; + case i18n::ScriptType::COMPLEX: + /* noop */ + break; + default: + /* should not happen? */ + break; + } +} + +void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // Output table/table row/table cell starts if needed + if ( pTextNodeInfo.get() ) + { + sal_uInt32 nRow = pTextNodeInfo->getRow(); + sal_uInt32 nCell = pTextNodeInfo->getCell(); + + // New cell/row? + if ( m_nTableDepth > 0 && !m_bTableCellOpen ) + { + ww8::WW8TableNodeInfoInner::Pointer_t pDeepInner( pTextNodeInfo->getInnerForDepth( m_nTableDepth ) ); + if ( pDeepInner->getCell() == 0 ) + StartTableRow( pDeepInner ); + + StartTableCell( pDeepInner ); + } + + if ( nRow == 0 && nCell == 0 ) + { + // Do we have to start the table? + // [If we are at the rigth depth already, it means that we + // continue the table cell] + sal_uInt32 nCurrentDepth = pTextNodeInfo->getDepth(); + + if ( nCurrentDepth > m_nTableDepth ) + { + // Start all the tables that begin here + for ( sal_uInt32 nDepth = m_nTableDepth + 1; nDepth <= pTextNodeInfo->getDepth(); ++nDepth ) + { + ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) ); + + StartTable( pInner ); + StartTableRow( pInner ); + StartTableCell( pInner ); + } + + m_nTableDepth = nCurrentDepth; + } + } + } + + OSL_ENSURE(m_aRun.getLength() == 0, "m_aRun is not empty"); +} + +void RtfAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + FinishTableRowCell( pTextNodeInfoInner ); + + OStringBuffer aParagraph; + + aParagraph.append(m_aRun.makeStringAndClear()); + aParagraph.append(m_aAfterRuns.makeStringAndClear()); + if (m_bTblAfterCell) + m_bTblAfterCell = false; + else + { + aParagraph.append(m_rExport.sNewLine); + aParagraph.append(OOO_STRING_SVTOOLS_RTF_PAR); + aParagraph.append(' '); + } + if (m_nColBreakNeeded) + { + aParagraph.append(OOO_STRING_SVTOOLS_RTF_COLUMN); + m_nColBreakNeeded = false; + } + + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << aParagraph.makeStringAndClear(); + else + m_aSectionHeaders.append(aParagraph.makeStringAndClear()); +} + +void RtfAttributeOutput::EmptyParagraph() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << m_rExport.sNewLine << OOO_STRING_SVTOOLS_RTF_PAR << ' '; +} + +void RtfAttributeOutput::StartParagraphProperties( const SwTxtNode& rNode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty"); + + // output page/section breaks + SwNodeIndex aNextIndex( rNode, 1 ); + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + m_bBufferSectionBreaks = true; + + // output section headers / footers + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << m_aSectionHeaders.makeStringAndClear(); + + if ( aNextIndex.GetNode().IsTxtNode() ) + { + const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( &aNextIndex.GetNode() ); + m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode ); + } + else if ( aNextIndex.GetNode().IsTableNode() ) + { + const SwTableNode* pTableNode = static_cast< SwTableNode* >( &aNextIndex.GetNode() ); + const SwFrmFmt *pFmt = pTableNode->GetTable().GetFrmFmt(); + m_rExport.OutputSectionBreaks( &(pFmt->GetAttrSet()), *pTableNode ); + } + m_bBufferSectionBreaks = false; + + OStringBuffer aPar; + if (!m_rExport.bRTFFlySyntax) + { + aPar.append(OOO_STRING_SVTOOLS_RTF_PARD); + aPar.append(OOO_STRING_SVTOOLS_RTF_PLAIN); + aPar.append(' '); + } + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << aPar.makeStringAndClear(); + else + m_aSectionHeaders.append(aPar.makeStringAndClear()); +} + +void RtfAttributeOutput::EndParagraphProperties() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aStyles.append(m_aStylesEnd.makeStringAndClear()); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); +} + +void RtfAttributeOutput::StartRun( const SwRedlineData* pRedlineData ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aRun.append('{'); + + // if there is some redlining in the document, output it + Redline( pRedlineData ); + + OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty"); +} + +void RtfAttributeOutput::EndRun() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aRun.append(m_rExport.sNewLine); + m_aRun.append(m_aRunText.makeStringAndClear()); + m_aRun.append('}'); +} + +void RtfAttributeOutput::StartRunProperties() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + OSL_ENSURE(m_aStyles.getLength() == 0, "m_aStyles is not empty"); +} + +void RtfAttributeOutput::EndRunProperties( const SwRedlineData* /*pRedlineData*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aStyles.append(m_aStylesEnd.makeStringAndClear()); + m_aRun.append(m_aStyles.makeStringAndClear()); +} + +void RtfAttributeOutput::RunText( const String& rText, rtl_TextEncoding eCharSet ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + RawText( rText, 0, eCharSet ); +} + +OStringBuffer& RtfAttributeOutput::RunText() +{ + return m_aRunText; +} + +OStringBuffer& RtfAttributeOutput::Styles() +{ + return m_aStyles; +} + +void RtfAttributeOutput::RawText( const String& rText, bool /*bForceUnicode*/, rtl_TextEncoding eCharSet ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aRunText.append(m_rExport.OutString(rText, eCharSet)); +} + +void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, const SwFmtRuby& /*rRuby*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::EndRuby() +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +bool RtfAttributeOutput::StartURL( const String& rUrl, const String& rTarget ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FIELD); + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FLDINST); + m_aStyles.append(" HYPERLINK "); + + String sURL( rUrl ); + if( sURL.Len() ) + { + m_aStyles.append("\""); + m_aStyles.append(m_rExport.OutString( sURL, m_rExport.eCurrentEncoding)); + m_aStyles.append("\" "); + } + + if( rTarget.Len() ) + { + m_aStyles.append("\\\\t \""); + m_aStyles.append(m_rExport.OutString( rTarget, m_rExport.eCurrentEncoding)); + m_aStyles.append("\" "); + } + + m_aStyles.append("}"); + return true; +} + +bool RtfAttributeOutput::EndURL() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // close the fldrslt group + m_aRunText.append('}'); + // close the field group + m_aRunText.append('}'); + return true; +} + +void RtfAttributeOutput::FieldVanish( const String& /*rTxt*/, ww::eField /*eType*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::Redline( const SwRedlineData* pRedline ) +{ + if (!pRedline) + return; + + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (pRedline->GetType() == nsRedlineType_t::REDLINE_INSERT) + { + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVISED); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVAUTH); + m_aRun.append((sal_Int32)m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()))); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVDTTM); + } + else if(pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) + { + m_aRun.append(OOO_STRING_SVTOOLS_RTF_DELETED); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVAUTHDEL); + m_aRun.append((sal_Int32)m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()))); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_REVDTTMDEL); + } + m_aRun.append((sal_Int32)sw::ms::DateTime2DTTM(pRedline->GetTimeStamp())); + m_aRun.append(' '); +} + +void RtfAttributeOutput::FormatDrop( const SwTxtNode& /*rNode*/, const SwFmtDrop& /*rSwFmtDrop*/, USHORT /*nStyle*/, ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, ww8::WW8TableNodeInfoInner::Pointer_t /*pTextNodeInfoInner*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::ParagraphStyle( USHORT nStyle ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + OString *pStyle = m_rExport.GetStyle(nStyle); + OStringBuffer aStyle; + aStyle.append(OOO_STRING_SVTOOLS_RTF_S); + aStyle.append((sal_Int32)nStyle); + if (pStyle) + aStyle.append(pStyle->getStr()); + if (!m_bBufferSectionHeaders) + m_rExport.Strm() << aStyle.makeStringAndClear(); + else + m_aSectionHeaders.append(aStyle.makeStringAndClear()); +} + +void RtfAttributeOutput::TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_INTBL); + if ( m_nTableDepth > 1 ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ITAP); + m_aStyles.append((sal_Int32)m_nTableDepth); + } +} + +void RtfAttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfo*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_pTableWrt ) + InitTableHelper( pTableTextNodeInfoInner ); + + const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( ); + SwFrmFmt *pFmt = pTblBox->GetFrmFmt( ); + + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TROWD); + TableOrientation( pTableTextNodeInfoInner ); + TableBidi( pTableTextNodeInfoInner ); + TableHeight( pTableTextNodeInfoInner ); + TableCanSplit( pTableTextNodeInfoInner ); + + // Cell margins + const SvxBoxItem& rBox = pFmt->GetBox( ); + static const USHORT aBorders[] = + { + BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT + }; + + static const char* aRowPadNames[] = + { + OOO_STRING_SVTOOLS_RTF_TRPADDT, OOO_STRING_SVTOOLS_RTF_TRPADDL, OOO_STRING_SVTOOLS_RTF_TRPADDB, OOO_STRING_SVTOOLS_RTF_TRPADDR + }; + + static const char* aRowPadUnits[] = + { + OOO_STRING_SVTOOLS_RTF_TRPADDFT, OOO_STRING_SVTOOLS_RTF_TRPADDFL, OOO_STRING_SVTOOLS_RTF_TRPADDFB, OOO_STRING_SVTOOLS_RTF_TRPADDFR + }; + + for (int i = 0; i < 4; ++i) + { + m_aRowDefs.append(aRowPadUnits[i]); + m_aRowDefs.append((sal_Int32)3); + m_aRowDefs.append(aRowPadNames[i]); + m_aRowDefs.append((sal_Int32)rBox.GetDistance(aBorders[i])); + } + + // The cell-dependent properties + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwTwips nSz = 0; + Point aPt; + SwRect aRect( pFmt->FindLayoutRect( false, &aPt )); + SwTwips nPageSize = aRect.Width(); + SwTwips nTblSz = pFmt->GetFrmSize().GetWidth(); + for( USHORT i = 0; i < pRow->GetCells().Count(); i++ ) + { + SwWriteTableCell *pCell = pRow->GetCells( )[ i ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + + pTableTextNodeInfoInner->setCell( i ); + TableCellProperties(pTableTextNodeInfoInner); + + // Right boundary: this can't be in TableCellProperties as the old + // value of nSz is needed. + nSz += pCellFmt->GetFrmSize().GetWidth(); + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CELLX); + SwTwips nCalc = nSz; + nCalc *= nPageSize; + nCalc /= nTblSz; + m_aRowDefs.append( (sal_Int32)(pFmt->GetLRSpace().GetLeft() + nCalc) ); + } +} + +void RtfAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* + * The function name is a bit misleading: given that we write borders + * before each row, we just have borders, not default ones. Additionally, + * this function actually writes borders for a specific cell only and is + * called for each cell. + */ + + const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( ); + SwFrmFmt *pFmt = pTblBox->GetFrmFmt( ); + const SvxBoxItem& rDefault = pFmt->GetBox( ); + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + const SfxPoolItem* pItem; + if (SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState(RES_BOX, TRUE, &pItem)) + { + const SvxBoxItem& rBox = (SvxBoxItem&)*pItem; + static const USHORT aBorders[] = + { + BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT + }; + static const char* aBorderNames[] = + { + OOO_STRING_SVTOOLS_RTF_CLBRDRT, OOO_STRING_SVTOOLS_RTF_CLBRDRL, OOO_STRING_SVTOOLS_RTF_CLBRDRB, OOO_STRING_SVTOOLS_RTF_CLBRDRR + }; + //Yes left and top are swapped with eachother for cell padding! Because + //that's what the thunderingly annoying rtf export/import word xp does. + static const char* aCellPadNames[] = + { + OOO_STRING_SVTOOLS_RTF_CLPADL, OOO_STRING_SVTOOLS_RTF_CLPADT, OOO_STRING_SVTOOLS_RTF_CLPADB, OOO_STRING_SVTOOLS_RTF_CLPADR + }; + static const char* aCellPadUnits[] = + { + OOO_STRING_SVTOOLS_RTF_CLPADFL, OOO_STRING_SVTOOLS_RTF_CLPADFT, OOO_STRING_SVTOOLS_RTF_CLPADFB, OOO_STRING_SVTOOLS_RTF_CLPADFR + }; + for (int i = 0; i < 4; ++i) + { + if (const SvxBorderLine* pLn = rBox.GetLine(aBorders[i])) + m_aRowDefs.append(OutTBLBorderLine(m_rExport, pLn, aBorderNames[i])); + if (rDefault.GetDistance(aBorders[i]) != + rBox.GetDistance(aBorders[i])) + { + m_aRowDefs.append(aCellPadUnits[i]); + m_aRowDefs.append((sal_Int32)3); + m_aRowDefs.append(aCellPadNames[i]); + m_aRowDefs.append((sal_Int32)rBox.GetDistance(aBorders[i])); + } + } + } +} + +void RtfAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + const SfxPoolItem* pItem; + if( SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState( + RES_BACKGROUND, TRUE, &pItem )) + { + const SvxBrushItem& rBack = (SvxBrushItem&)*pItem; + if( !rBack.GetColor().GetTransparency() ) + { + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT); + m_aRowDefs.append((sal_Int32)m_rExport.GetColor(rBack.GetColor())); + } + } +} + +void RtfAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); + const SwTableLine * pTabLine = pTabBox->GetUpper(); + const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt(); + const SwFmtFrmSize& rLSz = pLineFmt->GetFrmSize(); + + if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) + { + sal_Int32 nHeight = 0; + + switch ( rLSz.GetHeightSizeType() ) + { + case ATT_FIX_SIZE: nHeight = -rLSz.GetHeight(); break; + case ATT_MIN_SIZE: nHeight = rLSz.GetHeight(); break; + default: break; + } + + if ( nHeight ) + { + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRRH); + m_aRowDefs.append(nHeight); + } + } +} + +void RtfAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); + const SwTableLine * pTabLine = pTabBox->GetUpper(); + const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt(); + const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit( ); + + // The rtf default is to allow a row to break + if (rSplittable.GetValue() == 0) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TRKEEP); +} + +void RtfAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTable * pTable = pTableTextNodeInfoInner->getTable(); + const SwFrmFmt * pFrmFmt = pTable->GetFrmFmt(); + + if ( m_rExport.TrueFrameDirection( *pFrmFmt ) != FRMDIR_HORI_RIGHT_TOP ) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_LTRROW); + else + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_RTLROW); +} + +void RtfAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwWriteTableRows& aRows = m_pTableWrt->GetRows( ); + SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ]; + SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ]; + const SwFrmFmt *pCellFmt = pCell->GetBox()->GetFrmFmt(); + const SfxPoolItem* pItem; + + // vertical merges + if (pCell->GetRowSpan() > 1) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVMGF); + else if (pCell->GetRowSpan() == 0) + m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVMRG); + + // vertical alignment + if( SFX_ITEM_SET == pCellFmt->GetAttrSet().GetItemState( + RES_VERT_ORIENT, TRUE, &pItem ) ) + switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() ) + { + case text::VertOrientation::CENTER: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC); break; + case text::VertOrientation::BOTTOM: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALB); break; + default: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALT); break; + } +} + +void RtfAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t /*pNodeInfo*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +void RtfAttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // This is called when the nested table ends in a cell, and there's no + // paragraph benhind that; so we must check for the ends of cell, rows, + // and tables + // ['true' to write an empty paragraph, MS Word insists on that] + FinishTableRowCell( pNodeInfoInner, true ); +} + +void RtfAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwTable *pTable = pTableTextNodeInfoInner->getTable(); + SwFrmFmt *pFmt = pTable->GetFrmFmt( ); + + OStringBuffer aTblAdjust( OOO_STRING_SVTOOLS_RTF_TRQL ); + switch (pFmt->GetHoriOrient().GetHoriOrient()) + { + case text::HoriOrientation::CENTER: + aTblAdjust.setLength(0); + aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQC); + break; + case text::HoriOrientation::RIGHT: + aTblAdjust.setLength(0); + aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRQR); + break; + case text::HoriOrientation::NONE: + case text::HoriOrientation::LEFT_AND_WIDTH: + aTblAdjust.append(OOO_STRING_SVTOOLS_RTF_TRLEFT); + aTblAdjust.append((sal_Int32)pFmt->GetLRSpace().GetLeft()); + break; + default: + break; + } + + m_aRowDefs.append(aTblAdjust.makeStringAndClear()); +} + +void RtfAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, see EndTableRow() */ +} + +/* + * Our private table methods. + */ + +void RtfAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + sal_uInt32 nPageSize = 0; + bool bRelBoxSize = false; + + // Create the SwWriteTable instance to use col spans + GetTablePageSize( pTableTextNodeInfoInner.get(), nPageSize, bRelBoxSize ); + + const SwTable* pTable = pTableTextNodeInfoInner->getTable( ); + const SwFrmFmt *pFmt = pTable->GetFrmFmt( ); + SwTwips nTblSz = pFmt->GetFrmSize( ).GetWidth( ); + + const SwHTMLTableLayout *pLayout = pTable->GetHTMLTableLayout(); + if( pLayout && pLayout->IsExportable() ) + m_pTableWrt = new SwWriteTable( pLayout ); + else + m_pTableWrt = new SwWriteTable( pTable->GetTabLines(), (USHORT)nPageSize, + (USHORT)nTblSz, false); +} + +void RtfAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth(); + OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)nCurrentDepth); + + TableDefinition(pTableTextNodeInfoInner); + + // We'll write the table definition for nested tables later + if ( nCurrentDepth > 1 ) + return; + m_rExport.Strm() << m_aRowDefs.makeStringAndClear(); +} + +void RtfAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_bTableCellOpen = true; +} + +void RtfAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + TableDefaultBorders(pTableTextNodeInfoInner); + TableBackgrounds(pTableTextNodeInfoInner); + TableVerticalCell(pTableTextNodeInfoInner); +} + +void RtfAttributeOutput::EndTableCell( ) +{ + OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)m_nTableDepth); + + if ( m_nTableDepth > 1 ) + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_NESTCELL); + else + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_CELL); + + m_bTableCellOpen = false; + m_bTblAfterCell = true; +} + +void RtfAttributeOutput::EndTableRow( ) +{ + OSL_TRACE("%s, (depth is %d)", OSL_THIS_FUNC, (int)m_nTableDepth); + + if ( m_nTableDepth > 1 ) + { + m_aAfterRuns.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS); + m_aAfterRuns.append(m_aRowDefs.makeStringAndClear()); + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_NESTROW "}" "{" OOO_STRING_SVTOOLS_RTF_NONESTTABLES OOO_STRING_SVTOOLS_RTF_PAR "}"); + } + else + m_aAfterRuns.append(OOO_STRING_SVTOOLS_RTF_ROW); +} + +void RtfAttributeOutput::EndTable() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_nTableDepth > 0 ) + m_nTableDepth--; + + // We closed the table; if it is a nested table, the cell that contains it + // still continues + m_bTableCellOpen = true; + + // Cleans the table helper + delete m_pTableWrt, m_pTableWrt = NULL; +} + +void RtfAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool /*bForceEmptyParagraph*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( pInner.get() ) + { + // Where are we in the table + sal_uInt32 nRow = pInner->getRow( ); + + const SwTable *pTable = pInner->getTable( ); + const SwTableLines& rLines = pTable->GetTabLines( ); + USHORT nLinesCount = rLines.Count( ); + + if ( pInner->isEndOfCell() ) + EndTableCell(); + + // This is a line end + if ( pInner->isEndOfLine() ) + EndTableRow(); + + // This is the end of the table + if ( pInner->isEndOfLine( ) && ( nRow + 1 ) == nLinesCount ) + EndTable(); + } +} + +void RtfAttributeOutput::StartStyles() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_rExport.Strm() << m_rExport.sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_COLORTBL; + m_rExport.OutColorTable(); + OSL_ENSURE(m_aStylesheet.getLength() == 0, "m_aStylesheet is not empty"); + m_aStylesheet.append(m_rExport.sNewLine); + m_aStylesheet.append('{'); + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_STYLESHEET); +} + +void RtfAttributeOutput::EndStyles( USHORT /*nNumberOfStyles*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_rExport.Strm() << '}'; + m_rExport.Strm() << m_aStylesheet.makeStringAndClear(); + m_rExport.Strm() << '}'; +} + +void RtfAttributeOutput::DefaultStyle( USHORT /*nStyle*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, the default style is always 0 in RTF */ +} + +void RtfAttributeOutput::StartStyle( const String& rName, bool bPapFmt, + USHORT nBase, USHORT nNext, USHORT /*nWwId*/, USHORT nId ) +{ + OSL_TRACE("%s, rName = '%s'", OSL_THIS_FUNC, + OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ).getStr()); + + m_aStylesheet.append('{'); + if (bPapFmt) + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_S); + else + m_aStylesheet.append( OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS); + m_aStylesheet.append( (sal_Int32)nId ); + + if ( nBase != 0x0FFF ) + { + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SBASEDON); + m_aStylesheet.append((sal_Int32)nBase); + } + + m_aStylesheet.append(OOO_STRING_SVTOOLS_RTF_SNEXT); + m_aStylesheet.append((sal_Int32)nNext); + + m_rStyleName = rName; + m_nStyleId = nId; +} + +void RtfAttributeOutput::EndStyle() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + m_aStyles.append(m_aStylesEnd.makeStringAndClear()); + OString aStyles = m_aStyles.makeStringAndClear(); + m_rExport.InsStyle(m_nStyleId, aStyles); + m_aStylesheet.append(aStyles); + m_aStylesheet.append(' '); + m_aStylesheet.append(OUStringToOString( OUString( m_rStyleName ), m_rExport.eCurrentEncoding )); + m_aStylesheet.append(";}"); + m_aStylesheet.append(m_rExport.sNewLine); +} + +void RtfAttributeOutput::StartStyleProperties( bool /*bParProp*/, USHORT /*nStyle*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + /* noop */ +} + +void RtfAttributeOutput::EndStyleProperties( bool /*bParProp*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + /* noop */ +} + +void RtfAttributeOutput::OutlineNumbering( BYTE nLvl, const SwNumFmt& /*rNFmt*/, const SwFmt& /*rFmt*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( nLvl >= WW8ListManager::nMaxLevel ) + nLvl = WW8ListManager::nMaxLevel - 1; + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ILVL); + m_aStyles.append((sal_Int32)nLvl); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL); + m_aStyles.append((sal_Int32)nLvl); +} + +void RtfAttributeOutput::PageBreakBefore( bool bBreak ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (bBreak) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PAGEBB; + } +} + +void RtfAttributeOutput::SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch (nC) + { + case msword::ColumnBreak: + m_nColBreakNeeded = true; + break; + case msword::PageBreak: + if ( pSectionInfo ) + m_rExport.SectionProperties( *pSectionInfo ); + break; + } +} + +void RtfAttributeOutput::StartSection() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECT OOO_STRING_SVTOOLS_RTF_SECTD); + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); +} + +void RtfAttributeOutput::EndSection() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* + * noop, \sect must go to StartSection or Word won't notice multiple + * columns... + */ +} + +void RtfAttributeOutput::SectionFormProtection( bool bProtected ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED); + m_aSectionBreaks.append((sal_Int32)!bProtected); +} + +void RtfAttributeOutput::SectionLineNumbering( ULONG /*nRestartNo*/, const SwLineNumberInfo& rLnNumInfo ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEMOD; + m_rExport.OutLong(rLnNumInfo.GetCountBy()); + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINEX; + m_rExport.OutLong(rLnNumInfo.GetPosFromLeft()); + if (!rLnNumInfo.IsRestartEachPage()) + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LINECONT; +} + +void RtfAttributeOutput::SectionTitlePage() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* + * noop, handled in RtfExport::WriteHeaderFooter() + */ +} + +void RtfAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* /*pFirstPageFmt*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SvxBoxItem& rBox = pFmt->GetBox(); + const SvxBorderLine *pLine = rBox.GetTop(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRT, + rBox.GetDistance(BOX_LINE_TOP) )); + pLine = rBox.GetBottom(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRB, + rBox.GetDistance(BOX_LINE_BOTTOM) )); + pLine = rBox.GetLeft(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRL, + rBox.GetDistance(BOX_LINE_LEFT) )); + pLine = rBox.GetRight(); + if(pLine) + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLine, + OOO_STRING_SVTOOLS_RTF_PGBRDRR, + rBox.GetDistance(BOX_LINE_RIGHT) )); +} + +void RtfAttributeOutput::SectionBiDi( bool bBiDi ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << (bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT); +} + +void RtfAttributeOutput::SectionPageNumbering( USHORT nNumType, USHORT nPageRestartNumber ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (nPageRestartNumber > 0) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNSTARTS); + m_aSectionBreaks.append((sal_Int32)nPageRestartNumber); + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGNRESTART); + } + + const char* pStr = 0; + switch ( nNumType ) + { + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCLTR; break; + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCLTR; break; + case SVX_NUM_ROMAN_UPPER: pStr = OOO_STRING_SVTOOLS_RTF_PGNUCRM; break; + case SVX_NUM_ROMAN_LOWER: pStr = OOO_STRING_SVTOOLS_RTF_PGNLCRM; break; + + case SVX_NUM_ARABIC: pStr = OOO_STRING_SVTOOLS_RTF_PGNDEC; break; + } + if (pStr) + m_aSectionBreaks.append(pStr); +} + +void RtfAttributeOutput::SectionType( BYTE nBreakCode ) +{ + OSL_TRACE("%s, nBreakCode = %d", OSL_THIS_FUNC, nBreakCode); + + /* + * break code: 0 No break, 1 New column + * 2 New page, 3 Even page, 4 Odd page + */ + const char* sType = NULL; + switch ( nBreakCode ) + { + case 1: sType = OOO_STRING_SVTOOLS_RTF_SBKCOL; break; + case 2: sType = OOO_STRING_SVTOOLS_RTF_SBKPAGE; break; + case 3: sType = OOO_STRING_SVTOOLS_RTF_SBKEVEN; break; + case 4: sType = OOO_STRING_SVTOOLS_RTF_SBKODD; break; + default: sType = OOO_STRING_SVTOOLS_RTF_SBKNONE; break; + } + m_aSectionBreaks.append(sType); + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); +} + +void RtfAttributeOutput::NumberingDefinition( USHORT nId, const SwNumRule &/*rRule*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE; + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID; + m_rExport.OutULong(nId); + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT << '0'; + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LS; + m_rExport.OutULong(nId) << '}'; +} + +void RtfAttributeOutput::StartAbstractNumbering( USHORT nId ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LIST << OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID; + m_rExport.OutULong( nId ); + m_nListId = nId; +} + +void RtfAttributeOutput::EndAbstractNumbering() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LISTID; + m_rExport.OutULong( m_nListId ) << '}' << m_rExport.sNewLine; +} + +void RtfAttributeOutput::NumberingLevel( BYTE nLevel, + USHORT nStart, + USHORT nNumberingType, + SvxAdjust eAdjust, + const BYTE * pNumLvlPos, + BYTE /*nFollow*/, + const wwFont * pFont, + const SfxItemSet * pOutSet, + sal_Int16 nIndentAt, + sal_Int16 nFirstLineIndex, + sal_Int16 /*nListTabPos*/, + const String &rNumberingString ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << m_rExport.sNewLine; + if( nLevel > 8 ) // RTF knows only 9 levels + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_SOUTLVL; + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTLEVEL; + + USHORT nVal = 0; + switch( nNumberingType ) + { + case SVX_NUM_ROMAN_UPPER: nVal = 1; break; + case SVX_NUM_ROMAN_LOWER: nVal = 2; break; + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: nVal = 3; break; + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: nVal = 4; break; + + case SVX_NUM_BITMAP: + case SVX_NUM_CHAR_SPECIAL: nVal = 23; break; + } + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELNFC; + m_rExport.OutULong( nVal ); + + switch( eAdjust ) + { + case SVX_ADJUST_CENTER: nVal = 1; break; + case SVX_ADJUST_RIGHT: nVal = 2; break; + default: nVal = 0; break; + } + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELJC; + m_rExport.OutULong( nVal ); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT; + m_rExport.OutULong( nStart ); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW << "0"; + + // leveltext group + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LEVELTEXT << ' '; + + if( SVX_NUM_CHAR_SPECIAL == nNumberingType || + SVX_NUM_BITMAP == nNumberingType ) + { + m_rExport.Strm() << "\\'01"; + sal_Unicode cChar = rNumberingString.GetChar(0); + m_rExport.Strm() << "\\u"; + m_rExport.OutULong(cChar); + m_rExport.Strm() << " ?"; + } + else + { + m_rExport.Strm() << "\\'" << m_rExport.OutHex( rNumberingString.Len(), 2 ); + m_rExport.Strm() << m_rExport.OutString( rNumberingString, m_rExport.eDefaultEncoding ); + } + + m_rExport.Strm() << ";}"; + + // write the levelnumbers + m_rExport.Strm() << "{" << OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS; + for( BYTE i = 0; i <= nLevel && pNumLvlPos[ i ]; ++i ) + { + m_rExport.Strm() << "\\'" << m_rExport.OutHex(pNumLvlPos[ i ], 2).getStr(); + } + m_rExport.Strm() << ";}"; + + if( pOutSet ) + { + if (pFont) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_F; + m_rExport.OutULong(m_rExport.maFontHelper.GetId(*pFont)); + } + m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN ); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); + } + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FI; + m_rExport.OutLong( nFirstLineIndex ) << OOO_STRING_SVTOOLS_RTF_LI; + m_rExport.OutLong( nIndentAt ); + + m_rExport.Strm() << '}'; + if( nLevel > 8 ) + m_rExport.Strm() << '}'; +} + +void RtfAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField /*eType*/, const String& rFldCmd, BYTE /*nMode*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // NEEDSWORK this has beeen tested only with page numbers + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST " "); + m_aRunText.append(m_rExport.OutString(rFldCmd, m_rExport.eCurrentEncoding)); + m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + if (pFld) + m_aRunText.append(m_rExport.OutString(pFld->GetCntnt(), m_rExport.eDefaultEncoding)); + m_aRunText.append("}}"); +} + +void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds ) +{ + for ( std::vector< OUString >::const_iterator it = rStarts.begin(), end = rStarts.end(); it < end; ++it ) + { + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKSTART " "); + m_aRun.append(m_rExport.OutString(*it, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + rStarts.clear(); + + for ( std::vector< OUString >::const_iterator it = rEnds.begin(), end = rEnds.end(); it < end; ++it ) + { + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BKMKEND " "); + m_aRun.append(m_rExport.OutString(*it, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + rEnds.clear(); +} + +void RtfAttributeOutput::WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr ) +{ + OStringBuffer aSectionBreaks = m_aSectionBreaks; + m_aSectionBreaks.setLength(0); + OStringBuffer aRun = m_aRun; + m_aRun.setLength(0); + + m_aSectionHeaders.append(bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERY : OOO_STRING_SVTOOLS_RTF_FOOTERY); + m_aSectionHeaders.append((sal_Int32)m_rExport.pAktPageDesc->GetMaster().GetULSpace().GetUpper()); + m_aSectionHeaders.append('{'); + m_aSectionHeaders.append(pStr); + m_bBufferSectionHeaders = true; + m_rExport.WriteHeaderFooterText(rFmt, bHeader); + m_bBufferSectionHeaders = false; + m_aSectionHeaders.append('}'); + + m_aSectionBreaks = aSectionBreaks; + m_aRun = aRun; +} + +void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Point& /*rNdTopLeft*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwNode *pNode = rFrame.GetContent(); + const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0; + + switch ( rFrame.GetWriterType() ) + { + case sw::Frame::eTxtBox: + OSL_ENSURE(m_aRunText.getLength() == 0, "m_aRunText is not empty"); + m_rExport.mpParentFrame = &rFrame; + m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = true; + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_rExport.Strm() << m_aRunText.makeStringAndClear(); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); + m_rExport.bOutFlyFrmAttrs = m_rExport.bRTFFlySyntax = false; + m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE; + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_rExport.Strm() << m_aRunText.makeStringAndClear(); + m_rExport.Strm() << m_aStyles.makeStringAndClear(); + m_rExport.Strm() << '}'; + + { + /* + * Save m_aRun as we should not loose the opening brace. + * OTOH, just drop the contents of m_aRunText in case something + * would be there, causing a problem later. + */ + OString aSave = m_aRun.makeStringAndClear(); + m_rExport.bRTFFlySyntax = true; + m_rExport.OutContent(*rFrame.GetContent()); + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PARD; + m_rExport.bRTFFlySyntax = false; + m_aRun.append(aSave); + m_aRunText.setLength(0); + } + + m_rExport.mpParentFrame = NULL; + m_rExport.Strm() << RtfExport::sNewLine; + break; + case sw::Frame::eGraphic: + if (!rFrame.IsInline()) + { + m_rExport.mpParentFrame = &rFrame; + m_rExport.bRTFFlySyntax = true; + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_rExport.bRTFFlySyntax = false; + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE); + m_rExport.OutputFormat( rFrame.GetFrmFmt(), false, false, true ); + m_aRunText.append('}'); + m_rExport.mpParentFrame = NULL; + } + + if ( pGrfNode ) + FlyFrameGraphic( *pGrfNode, rFrame.GetLayoutSize() ); + break; + case sw::Frame::eDrawing: + { + const SdrObject* pSdrObj = rFrame.GetFrmFmt().FindRealSdrObject(); + if ( pSdrObj ) + { + bool bSwapInPage = false; + if ( !pSdrObj->GetPage() ) + { + if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() ) + { + if ( SdrPage *pPage = pModel->GetPage( 0 ) ) + { + bSwapInPage = true; + const_cast< SdrObject* >( pSdrObj )->SetPage( pPage ); + } + } + } + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{"); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLDINST); + m_aRunText.append(" SHAPE "); + m_aRunText.append("}" "{" OOO_STRING_SVTOOLS_RTF_FLDRSLT); + + m_rExport.SdrExporter().AddSdrObject( *pSdrObj ); + + m_aRunText.append('}'); + m_aRunText.append('}'); + + if ( bSwapInPage ) + const_cast< SdrObject* >( pSdrObj )->SetPage( 0 ); + } + } + break; + case sw::Frame::eFormControl: + { + const SwFrmFmt &rFrmFmt = rFrame.GetFrmFmt(); + const SdrObject *pObject = rFrmFmt.FindRealSdrObject(); + + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_FIELD); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST); + + if (pObject && pObject->GetObjInventor() == FmFormInventor) + { + if (SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObject)) + { + uno::Reference< awt::XControlModel > xControlModel = + pFormObj->GetUnoControlModel(); + uno::Reference< lang::XServiceInfo > xInfo(xControlModel, uno::UNO_QUERY); + uno::Reference xPropSet(xControlModel, uno::UNO_QUERY); + uno::Reference xPropSetInfo = xPropSet->getPropertySetInfo(); + OUString sName; + if (xInfo->supportsService(C2U("com.sun.star.form.component.CheckBox"))) + { + + m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMCHECKBOX)), m_rExport.eCurrentEncoding)); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{"); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFTYPE "1"); // 1 = checkbox + // checkbox size in half points, this seems to be always 20, see WW8Export::DoCheckBox() + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHPS "20"); + + OUString aStr; + sName = C2U("Name"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpText"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpF1Text"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sal_Int16 nTemp = 0; + xPropSet->getPropertyValue(C2U("DefaultState")) >>= nTemp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES); + m_aRun.append((sal_Int32)nTemp); + xPropSet->getPropertyValue(C2U("State")) >>= nTemp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES); + m_aRun.append((sal_Int32)nTemp); + + m_aRun.append("}}"); + + // field result is empty, ffres already contains the form result + m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + } + else if (xInfo->supportsService(C2U("com.sun.star.form.component.TextField"))) + { + OStringBuffer aBuf; + OString aStr; + OUString aTmp; + const sal_Char* pStr; + + m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMTEXT)), m_rExport.eCurrentEncoding)); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_DATAFIELD " "); + for (int i = 0; i < 8; i++) aBuf.append((sal_Char)0x00); + xPropSet->getPropertyValue(C2U("Name")) >>= aTmp; + aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding); + aBuf.append((sal_Char)aStr.getLength()); + aBuf.append(aStr); + aBuf.append((sal_Char)0x00); + xPropSet->getPropertyValue(C2U("DefaultText")) >>= aTmp; + aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding); + aBuf.append((sal_Char)aStr.getLength()); + aBuf.append(aStr); + for (int i = 0; i < 11; i++) aBuf.append((sal_Char)0x00); + aStr = aBuf.makeStringAndClear(); + pStr = aStr.getStr(); + for (int i = 0; i < aStr.getLength(); i++, pStr++) + m_aRun.append(m_rExport.OutHex(*pStr, 2)); + m_aRun.append('}'); + m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + xPropSet->getPropertyValue(C2U("Text")) >>= aTmp; + m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{"); + sName = C2U("HelpText"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aTmp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " "); + m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpF1Text"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aTmp; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " "); + m_aRun.append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + m_aRun.append("}"); + } + else if (xInfo->supportsService(C2U("com.sun.star.form.component.ListBox"))) + { + OUString aStr; + uno::Sequence aIntSeq; + uno::Sequence aStrSeq; + + m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMDROPDOWN)), m_rExport.eCurrentEncoding)); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{"); + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFTYPE "2"); // 2 = list + + xPropSet->getPropertyValue(C2U("DefaultSelection")) >>= aIntSeq; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES); + // a dropdown list can have only one 'selected item by default' + m_aRun.append((sal_Int32)aIntSeq[0]); + + xPropSet->getPropertyValue(C2U("SelectedItems")) >>= aIntSeq; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES); + // a dropdown list can have only one 'currently selected item' + m_aRun.append((sal_Int32)aIntSeq[0]); + + sName = C2U("Name"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpText"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + sName = C2U("HelpF1Text"); + if (xPropSetInfo->hasPropertyByName(sName)) + { + xPropSet->getPropertyValue(sName) >>= aStr; + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " "); + m_aRun.append(OUStringToOString(aStr, m_rExport.eCurrentEncoding)); + m_aRun.append('}'); + } + + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX); + + xPropSet->getPropertyValue(C2U("StringItemList")) >>= aStrSeq; + sal_uInt32 nListItems = aStrSeq.getLength(); + for (sal_uInt32 i = 0; i < nListItems; i++) + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFL " ") + .append(OUStringToOString(aStrSeq[i], m_rExport.eCurrentEncoding)).append('}'); + + m_aRun.append("}}"); + + // field result is empty, ffres already contains the form result + m_aRun.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + } + else + OSL_TRACE("%s unhandled form control: '%s'", OSL_THIS_FUNC, + OUStringToOString(xInfo->getImplementationName(), m_rExport.eCurrentEncoding).getStr()); + m_aRun.append('}'); + } + } + + m_aRun.append('}'); + } + break; + case sw::Frame::eOle: + { + const SwFrmFmt &rFrmFmt = rFrame.GetFrmFmt(); + const SdrObject *pSdrObj = rFrmFmt.FindRealSdrObject(); + if ( pSdrObj ) + { + SwNodeIndex aIdx(*rFrmFmt.GetCntnt().GetCntntIdx(), 1); + SwOLENode& rOLENd = *aIdx.GetNode().GetOLENode(); + FlyFrameOLE(rOLENd, rFrame.GetLayoutSize()); + } + } + break; + default: + OSL_TRACE("%s: unknown type (%d)", OSL_THIS_FUNC, rFrame.GetWriterType()); + break; + } +} + +void RtfAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rCaseMap.GetValue() ) + { + case SVX_CASEMAP_KAPITAELCHEN: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SCAPS); + break; + case SVX_CASEMAP_VERSALIEN: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CAPS); + break; + default: // Something that rtf does not support + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SCAPS); + m_aStyles.append((sal_Int32)0); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CAPS); + m_aStyles.append((sal_Int32)0); + break; + } +} + +void RtfAttributeOutput::CharColor( const SvxColorItem& rColor ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const Color aColor( rColor.GetValue() ); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CF); + m_aStyles.append( (sal_Int32)m_rExport.GetColor( aColor )); +} + +void RtfAttributeOutput::CharContour( const SvxContourItem& rContour ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_OUTL); + if ( !rContour.GetValue() ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rCrossedOut.GetStrikeout() ) + { + case STRIKEOUT_NONE: + if (!m_bStrikeDouble) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKE); + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKED); + m_aStyles.append((sal_Int32)0); + break; + case STRIKEOUT_DOUBLE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKED); + m_aStyles.append((sal_Int32)1); + break; + default: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_STRIKE); + break; + } +} + +void RtfAttributeOutput::CharEscapement( const SvxEscapementItem& rEsc ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const char * pUpDn; + + SwTwips nH = ((SvxFontHeightItem&)m_rExport.GetItem( RES_CHRATR_FONTSIZE )).GetHeight(); + + if( 0 < rEsc.GetEsc() ) + pUpDn = OOO_STRING_SVTOOLS_RTF_UP; + else if( 0 > rEsc.GetEsc() ) + { + pUpDn = OOO_STRING_SVTOOLS_RTF_DN; + nH = -nH; + } + else + return; + + short nEsc = rEsc.GetEsc(); + short nProp = rEsc.GetProp() * 100; + if( DFLT_ESC_AUTO_SUPER == nEsc ) + { + nEsc = 100 - rEsc.GetProp(); + ++nProp; + } + else if( DFLT_ESC_AUTO_SUB == nEsc ) + { + nEsc = - 100 + rEsc.GetProp(); + ++nProp; + } + + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_UPDNPROP); + m_aStyles.append( (sal_Int32)nProp ); + m_aStyles.append('}'); + m_aStyles.append(pUpDn); + + /* + * Calculate the act. FontSize and the percentage of the displacement; + * RTF file expects half points, while internally it's in twips. + * Formally : (FontSize * 1/20 ) pts x * 2 + * ----------------------- = ------------ + * 100% Escapement + */ + + m_aStyles.append( (sal_Int32) ( (long( nEsc ) * nH) + 500L ) / 1000L ); + // 500L to round !! +} + +void RtfAttributeOutput::CharFont( const SvxFontItem& rFont) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LOCH); + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_F); + m_aStylesEnd.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont)); + m_rExport.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(rFont.GetCharSet())); +} + +void RtfAttributeOutput::CharFontSize( const SvxFontHeightItem& rFontSize) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rFontSize.Which() ) + { + case RES_CHRATR_FONTSIZE: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_FS); + m_aStylesEnd.append((sal_Int32)(rFontSize.GetHeight() / 10 )); + break; + case RES_CHRATR_CJK_FONTSIZE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FS); + m_aStyles.append((sal_Int32)(rFontSize.GetHeight() / 10 )); + break; + case RES_CHRATR_CTL_FONTSIZE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AFS); + m_aStyles.append((sal_Int32)(rFontSize.GetHeight() / 10 )); + break; + } +} + +void RtfAttributeOutput::CharKerning( const SvxKerningItem& rKerning ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // in quater points then in twips + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_EXPND); + m_aStyles.append((sal_Int32)(rKerning.GetValue() / 5)); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_EXPNDTW); + m_aStyles.append((sal_Int32)(rKerning.GetValue())); +} + +void RtfAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch (rLanguage.Which()) + { + case RES_CHRATR_LANGUAGE: + m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LANG); + m_aStylesEnd.append((sal_Int32)rLanguage.GetLanguage()); + break; + case RES_CHRATR_CJK_LANGUAGE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LANGFE); + m_aStyles.append((sal_Int32)rLanguage.GetLanguage()); + break; + case RES_CHRATR_CTL_LANGUAGE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LANG); + m_aStyles.append((sal_Int32)rLanguage.GetLanguage()); + break; + } +} + +void RtfAttributeOutput::CharPosture( const SvxPostureItem& rPosture ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_I); + if ( rPosture.GetPosture() == ITALIC_NONE ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharShadow( const SvxShadowedItem& rShadow ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SHAD); + if ( !rShadow.GetValue() ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const char* pStr = 0; + const SfxPoolItem* pItem = m_rExport.HasItem( RES_CHRATR_WORDLINEMODE ); + bool bWord = false; + if (pItem) + bWord = ((const SvxWordLineModeItem*)pItem)->GetValue() ? true : false; + switch(rUnderline.GetLineStyle() ) + { + case UNDERLINE_SINGLE: + pStr = bWord ? OOO_STRING_SVTOOLS_RTF_ULW : OOO_STRING_SVTOOLS_RTF_UL; + break; + case UNDERLINE_DOUBLE: + pStr = OOO_STRING_SVTOOLS_RTF_ULDB; + break; + case UNDERLINE_NONE: + pStr = OOO_STRING_SVTOOLS_RTF_ULNONE; + break; + case UNDERLINE_DOTTED: + pStr = OOO_STRING_SVTOOLS_RTF_ULD; + break; + case UNDERLINE_DASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULDASH; + break; + case UNDERLINE_DASHDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULDASHD; + break; + case UNDERLINE_DASHDOTDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULDASHDD; + break; + case UNDERLINE_BOLD: + pStr = OOO_STRING_SVTOOLS_RTF_ULTH; + break; + case UNDERLINE_WAVE: + pStr = OOO_STRING_SVTOOLS_RTF_ULWAVE; + break; + case UNDERLINE_BOLDDOTTED: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHD; + break; + case UNDERLINE_BOLDDASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASH; + break; + case UNDERLINE_LONGDASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULLDASH; + break; + case UNDERLINE_BOLDLONGDASH: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHLDASH; + break; + case UNDERLINE_BOLDDASHDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHD; + break; + case UNDERLINE_BOLDDASHDOTDOT: + pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHDD; + break; + case UNDERLINE_BOLDWAVE: + pStr = OOO_STRING_SVTOOLS_RTF_ULHWAVE; + break; + case UNDERLINE_DOUBLEWAVE: + pStr = OOO_STRING_SVTOOLS_RTF_ULULDBWAVE; + break; + default: + break; + } + + if( pStr ) + { + m_aStyles.append(pStr); + // NEEDSWORK looks like here rUnderline.GetColor() is always black, + // even if the color in the odt is for example green... + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ULC); + m_aStyles.append( (sal_Int32)m_rExport.GetColor(rUnderline.GetColor()) ); + } +} + +void RtfAttributeOutput::CharWeight( const SvxWeightItem& rWeight ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_B); + if ( rWeight.GetWeight() != WEIGHT_BOLD ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharAutoKern( const SvxAutoKernItem& rAutoKern) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KERNING); + m_aStyles.append((sal_Int32) (rAutoKern.GetValue() ? 1 : 0)); +} + +void RtfAttributeOutput::CharAnimatedText( const SvxBlinkItem& rBlink ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ANIMTEXT); + m_aStyles.append((sal_Int32) (rBlink.GetValue() ? 2 : 0)); +} + +void RtfAttributeOutput::CharBackground( const SvxBrushItem& rBrush ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( !rBrush.GetColor().GetTransparency() ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHCBPAT); + m_aStyles.append((sal_Int32)m_rExport.GetColor(rBrush.GetColor())); + } +} + +void RtfAttributeOutput::CharFontCJK( const SvxFontItem& rFont ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HICH); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AF); + m_aStyles.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont)); +} + +void RtfAttributeOutput::CharFontSizeCJK( const SvxFontHeightItem& rFontSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharFontSize( rFontSize ); +} + +void RtfAttributeOutput::CharLanguageCJK( const SvxLanguageItem& rLanguageItem ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharLanguage( rLanguageItem ); +} + +void RtfAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_I); + if ( rPosture.GetPosture() == ITALIC_NONE ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_B); + if ( rWeight.GetWeight() != WEIGHT_BOLD ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharFontCTL( const SvxFontItem& rFont ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_DBCH); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AF); + m_aStyles.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont)); +} + +void RtfAttributeOutput::CharFontSizeCTL( const SvxFontHeightItem& rFontSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharFontSize( rFontSize ); +} + +void RtfAttributeOutput::CharLanguageCTL( const SvxLanguageItem& rLanguageItem ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + CharLanguage( rLanguageItem ); +} + +void RtfAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AI); + if ( rPosture.GetPosture() == ITALIC_NONE ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AB); + if ( rWeight.GetWeight() != WEIGHT_BOLD ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HORZVERT); + m_aStyles.append((sal_Int32)(rRotate.IsFitToLine() ? 1 : 0)); +} + +void RtfAttributeOutput::CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const sal_Char* pStr; + switch( rEmphasisMark.GetEmphasisMark()) + { + case EMPHASISMARK_NONE: pStr = OOO_STRING_SVTOOLS_RTF_ACCNONE; break; + case EMPHASISMARK_SIDE_DOTS: pStr = OOO_STRING_SVTOOLS_RTF_ACCCOMMA; break; + default: pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT; break; + } + m_aStyles.append(pStr); +} + +void RtfAttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( rTwoLines.GetValue() ) + { + sal_Unicode cStart = rTwoLines.GetStartBracket(); + sal_Unicode cEnd = rTwoLines.GetEndBracket(); + + USHORT nType; + if( !cStart && !cEnd ) + nType = 0; + else if( '{' == cStart || '}' == cEnd ) + nType = 4; + else if( '<' == cStart || '>' == cEnd ) + nType = 3; + else if( '[' == cStart || ']' == cEnd ) + nType = 2; + else // all other kind of brackets + nType = 1; + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TWOINONE); + m_aStyles.append((sal_Int32)nType); + } +} + +void RtfAttributeOutput::CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHARSCALEX); + m_aStyles.append((sal_Int32)rScaleWidth.GetValue()); +} + +void RtfAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const sal_Char* pStr; + switch (rRelief.GetValue()) + { + case RELIEF_EMBOSSED: + pStr = OOO_STRING_SVTOOLS_RTF_EMBO; + break; + case RELIEF_ENGRAVED: + pStr = OOO_STRING_SVTOOLS_RTF_IMPR; + break; + default: + pStr = 0; + break; + } + + if (pStr) + m_aStyles.append(pStr); +} + +void RtfAttributeOutput::CharHidden( const SvxCharHiddenItem& rHidden ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_V); + if ( !rHidden.GetValue() ) + m_aStyles.append((sal_Int32)0); +} + +void RtfAttributeOutput::TextINetFormat( const SwFmtINetFmt& rURL ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( rURL.GetValue().Len() ) + { + const SwCharFmt* pFmt; + const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt(); + + m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); + if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() )) + { + USHORT nStyle = m_rExport.GetId( *pFmt ); + OString* pString = m_rExport.GetStyle(nStyle); + if (pString) + m_aStyles.append(*pString); + } + } +} + +void RtfAttributeOutput::TextCharFormat( const SwFmtCharFmt& rCharFmt ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + USHORT nStyle = m_rExport.GetId( *rCharFmt.GetCharFmt() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_CS); + m_aStyles.append((sal_Int32)nStyle); + OString* pString = m_rExport.GetStyle(nStyle); + if (pString) + m_aStyles.append(*pString); +} + +void RtfAttributeOutput::WriteTextFootnoteNumStr(const SwFmtFtn& rFootnote) +{ + if (!rFootnote.GetNumStr().Len()) + m_aRun.append(OOO_STRING_SVTOOLS_RTF_CHFTN); + else + m_aRun.append(m_rExport.OutString(rFootnote.GetNumStr(), m_rExport.eCurrentEncoding)); +} + +void RtfAttributeOutput::TextFootnote_Impl( const SwFmtFtn& rFootnote ) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_SUPER " "); + WriteTextFootnoteNumStr(rFootnote); + m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FOOTNOTE); + if( rFootnote.IsEndNote() ) + m_aRun.append(OOO_STRING_SVTOOLS_RTF_FTNALT); + m_aRun.append(' '); + WriteTextFootnoteNumStr(rFootnote); + + /* + * The footnote contains a whole paragraph, so we have to: + * 1) Reset, then later restore the contents of our run buffer. + * 2) Buffer the output of the whole paragraph, as we do so for section headers already. + */ + const SwNodeIndex* pIndex = rFootnote.GetTxtFtn()->GetStartNode(); + OStringBuffer aRun = m_aRun; + m_aRun.setLength(0); + m_bBufferSectionHeaders = true; + m_rExport.WriteSpecialText( pIndex->GetIndex() + 1, + pIndex->GetNode().EndOfSectionIndex(), + !rFootnote.IsEndNote() ? TXT_FTN : TXT_EDN); + m_bBufferSectionHeaders = false; + m_aRun = aRun; + m_aRun.append(m_aSectionHeaders.makeStringAndClear()); + + m_aRun.append("}"); + m_aRun.append("}"); + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::ParaLineSpacing_Impl( short nSpace, short nMulti ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SL); + m_aStyles.append((sal_Int32)nSpace); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SLMULT); + m_aStyles.append((sal_Int32)nMulti); + +} + +void RtfAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + switch ( rAdjust.GetAdjust() ) + { + case SVX_ADJUST_LEFT: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QL); + break; + case SVX_ADJUST_RIGHT: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QR); + break; + case SVX_ADJUST_BLOCKLINE: + case SVX_ADJUST_BLOCK: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QJ); + break; + case SVX_ADJUST_CENTER: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QC); + break; + default: + break; + } +} + +void RtfAttributeOutput::ParaSplit( const SvxFmtSplitItem& rSplit ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( !rSplit.GetValue() ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KEEP); +} + +void RtfAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (rWidows.GetValue()) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_WIDCTLPAR); + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOWIDCTLPAR); +} + +void RtfAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + long nOffset = ((SvxLRSpaceItem&)m_rExport.GetItem( RES_LR_SPACE )).GetTxtLeft(); + for( USHORT n = 0; n < rTabStop.Count(); n++ ) + { + const SvxTabStop & rTS = rTabStop[ n ]; + if( SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment() ) + { + const char* pFill = 0; + switch( rTS.GetFill() ) + { + case cDfltFillChar: + break; + + case '.': pFill = OOO_STRING_SVTOOLS_RTF_TLDOT; break; + case '_': pFill = OOO_STRING_SVTOOLS_RTF_TLUL; break; + case '-': pFill = OOO_STRING_SVTOOLS_RTF_TLTH; break; + case '=': pFill = OOO_STRING_SVTOOLS_RTF_TLEQ; break; + default: + break; + } + if( pFill ) + m_aStyles.append(pFill); + + const sal_Char* pAdjStr = 0; + switch (rTS.GetAdjustment()) + { + case SVX_TAB_ADJUST_RIGHT: + pAdjStr = OOO_STRING_SVTOOLS_RTF_TQR; + break; + case SVX_TAB_ADJUST_DECIMAL: + pAdjStr = OOO_STRING_SVTOOLS_RTF_TQDEC; + break; + case SVX_TAB_ADJUST_CENTER: + pAdjStr = OOO_STRING_SVTOOLS_RTF_TQC; + break; + default: + break; + } + if (pAdjStr) + m_aStyles.append(pAdjStr); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TX); + m_aStyles.append((sal_Int32)(rTS.GetTabPos() + nOffset)); + } + else + { + m_aTabStop.append( OOO_STRING_SVTOOLS_RTF_DEFTAB ); + m_aTabStop.append( (sal_Int32)rTabStop[0].GetTabPos() ); + } + } +} + +void RtfAttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + sal_Int32 nFlags = rHyphenZone.IsHyphen() ? 1 : 0; + if( rHyphenZone.IsPageEnd() ) + nFlags += 2; + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHEN); + m_aStyles.append((sal_Int32)nFlags); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHLEAD); + m_aStyles.append((sal_Int32)rHyphenZone.GetMinLead()); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHTRAIL); + m_aStyles.append((sal_Int32)rHyphenZone.GetMinTrail()); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHMAX); + m_aStyles.append((sal_Int32)rHyphenZone.GetMaxHyphens()); + m_aStyles.append('}'); +} + +void RtfAttributeOutput::ParaNumRule_Impl( const SwTxtNode* pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( USHRT_MAX == nNumId || 0 == nNumId || 0 == pTxtNd) + return; + + const SwNumRule* pRule = pTxtNd->GetNumRule(); + + // --> OD 2008-03-18 #refactorlists# + // if( pRule && MAXLEVEL > pTxtNd->GetActualListLevel() ) + if( pRule && pTxtNd->IsInList() ) + // <-- + { + // --> OD 2008-03-18 #refactorlists# + ASSERT( pTxtNd->GetActualListLevel() >= 0 && pTxtNd->GetActualListLevel() < MAXLEVEL, + " - text node does not have valid list level. Serious defect -> please inform OD" ); + // <-- + + const bool bExportNumRule = USHRT_MAX != nNumId; + const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl ); + if( !pFmt ) + pFmt = &pRule->Get( nLvl ); + + const SfxItemSet& rNdSet = pTxtNd->GetSwAttrSet(); + + if ( bExportNumRule ) { + m_aStyles.append('{'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LISTTEXT); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PARD); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PLAIN); + m_aStyles.append(' '); + } + + SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) ); + aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() ); + aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() ); + + USHORT nStyle = m_rExport.GetId( *pFmt->GetCharFmt() ); + OString* pString = m_rExport.GetStyle(nStyle); + if (pString) + m_aStyles.append(*pString); + + { + String sTxt; + if( SVX_NUM_CHAR_SPECIAL == pFmt->GetNumberingType() || SVX_NUM_BITMAP == pFmt->GetNumberingType() ) + sTxt = pFmt->GetBulletChar(); + else + sTxt = pTxtNd->GetNumString(); + + m_aStyles.append(' '); + + if (sTxt.Len()) + { + m_aStyles.append(m_rExport.OutString(sTxt, m_rExport.eDefaultEncoding)); + } + + if( bExportNumRule ) + { + if( OUTLINE_RULE != pRule->GetRuleType() ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB); + m_aStyles.append('}'); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ILVL); + if( nLvl > 8 ) // RTF knows only 9 levels + { + m_aStyles.append((sal_Int32)8); + m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SOUTLVL); + m_aStyles.append((sal_Int32)nLvl); + m_aStyles.append('}'); + } + else + m_aStyles.append((sal_Int32)nLvl); + } + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB "}"); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LS); + m_aStyles.append((sal_Int32)m_rExport.GetId(*pRule)+1); + m_aStyles.append(' '); + } + else if( sTxt.Len() ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_TAB); + } + FormatLRSpace(aLR); + } +} + +void RtfAttributeOutput::ParaScriptSpace( const SfxBoolItem& rScriptSpace ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (!rScriptSpace.GetValue( )) + return; + switch ( rScriptSpace.Which( ) ) + { + case RES_PARATR_SCRIPTSPACE: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ASPALPHA); + break; + /* Is this needed? + case RES_PARATR_HANGINGPUNCTUATION: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOOVERFLOW); + break; + case RES_PARATR_FORBIDDEN_RULES: + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOCWRAP); + break;*/ + default: + break; + } +} + +void RtfAttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const char* pStr; + switch ( rAlign.GetValue() ) + { + case SvxParaVertAlignItem::TOP: pStr = OOO_STRING_SVTOOLS_RTF_FAHANG; break; + case SvxParaVertAlignItem::BOTTOM: pStr = OOO_STRING_SVTOOLS_RTF_FAVAR; break; + case SvxParaVertAlignItem::CENTER: pStr = OOO_STRING_SVTOOLS_RTF_FACENTER; break; + case SvxParaVertAlignItem::BASELINE: pStr = OOO_STRING_SVTOOLS_RTF_FAROMAN; break; + // default == SvxParaVertAlignItem::AUTOMATIC + default: pStr = OOO_STRING_SVTOOLS_RTF_FAAUTO; break; + } + m_aStyles.append(pStr); +} + +void RtfAttributeOutput::ParaSnapToGrid( const SvxParaGridItem& /*rGrid*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax ) + { + if( rSize.GetWidth() ) + { + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_ABSW); + m_aRunText.append((sal_Int32)rSize.GetWidth()); + } + + if( rSize.GetHeight() ) + { + long nH = rSize.GetHeight(); + if( ATT_FIX_SIZE == rSize.GetHeightSizeType() ) + nH = -nH; + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_ABSH); + m_aRunText.append((sal_Int32)nH); + } + } + else if (m_rExport.bOutPageDescs) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGWSXN); + m_aSectionBreaks.append((sal_Int32)rSize.GetWidth()); + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_PGHSXN); + m_aSectionBreaks.append((sal_Int32)rSize.GetHeight()); + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + } +} + +void RtfAttributeOutput::FormatPaperBin( const SvxPaperBinItem& ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_rExport.bOutFlyFrmAttrs ) + { + if( m_rExport.bOutPageDescs ) + { + if( rLRSpace.GetLeft() ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGLSXN); + m_aSectionBreaks.append((sal_Int32)rLRSpace.GetLeft()); + } + if( rLRSpace.GetRight() ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGRSXN); + m_aSectionBreaks.append((sal_Int32)rLRSpace.GetRight()); + } + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + } + else + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LI); + m_aStyles.append( (sal_Int32) rLRSpace.GetTxtLeft() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RI); + m_aStyles.append( (sal_Int32) rLRSpace.GetRight() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LIN); + m_aStyles.append( (sal_Int32) rLRSpace.GetTxtLeft() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RIN); + m_aStyles.append( (sal_Int32) rLRSpace.GetRight() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FI); + m_aStyles.append( (sal_Int32) rLRSpace.GetTxtFirstLineOfst() ); + } + } + else if (rLRSpace.GetLeft() == rLRSpace.GetRight() && m_rExport.bRTFFlySyntax) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTX; + m_rExport.OutLong( rLRSpace.GetLeft() ); + } +} + +void RtfAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_rExport.bOutFlyFrmAttrs ) + { + if( m_rExport.bOutPageDescs ) + { + if( rULSpace.GetUpper() ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN); + m_aSectionBreaks.append((sal_Int32)rULSpace.GetUpper()); + } + if( rULSpace.GetLower() ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN); + m_aSectionBreaks.append((sal_Int32)rULSpace.GetLower()); + } + if (!m_bBufferSectionBreaks) + m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear(); + } + else + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SB); + m_aStyles.append( (sal_Int32) rULSpace.GetUpper() ); + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SA); + m_aStyles.append( (sal_Int32) rULSpace.GetLower() ); + } + } + else if (rULSpace.GetUpper() == rULSpace.GetLower() && m_rExport.bRTFFlySyntax) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_DFRMTXTY; + m_rExport.OutLong( rULSpace.GetLower() ); + } +} + +void RtfAttributeOutput::FormatSurround( const SwFmtSurround& rSurround ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && !m_rExport.bRTFFlySyntax ) + { + SwSurround eSurround = rSurround.GetSurround(); + BOOL bGold = SURROUND_IDEAL == eSurround; + if( bGold ) + eSurround = SURROUND_PARALLEL; + RTFSurround aMC( bGold, static_cast< BYTE >(eSurround) ); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYMAINCNT); + m_aRunText.append( (sal_Int32) aMC.GetValue() ); + } +} + +void RtfAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax ) + { + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_PVPARA); + + switch (rFlyVert.GetVertOrient()) + { + case text::VertOrientation::TOP: + case text::VertOrientation::LINE_TOP: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYT); + break; + case text::VertOrientation::BOTTOM: + case text::VertOrientation::LINE_BOTTOM: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYB); + break; + case text::VertOrientation::CENTER: + case text::VertOrientation::LINE_CENTER: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSYC); + break; + case text::VertOrientation::NONE: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSY); + m_aRunText.append((sal_Int32)rFlyVert.GetPos()); + break; + default: + break; + } + } + else if ( !m_rExport.bRTFFlySyntax ) + { + RTFVertOrient aVO( static_cast< USHORT >(rFlyVert.GetVertOrient()), static_cast< USHORT >(rFlyVert.GetRelationOrient()) ); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYVERT); + m_aRunText.append((sal_Int32)aVO.GetValue()); + } +} + +void RtfAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHori ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_rExport.bOutFlyFrmAttrs && m_rExport.bRTFFlySyntax ) + { + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_PHCOL); + + const char* pS = 0; + switch(rFlyHori.GetHoriOrient()) + { + case text::HoriOrientation::RIGHT: + pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXO : OOO_STRING_SVTOOLS_RTF_POSXR; + break; + case text::HoriOrientation::LEFT: + pS = rFlyHori.IsPosToggle() ? OOO_STRING_SVTOOLS_RTF_POSXI : OOO_STRING_SVTOOLS_RTF_POSXL; + break; + case text::HoriOrientation::CENTER: + pS = OOO_STRING_SVTOOLS_RTF_POSXC; + break; + case text::HoriOrientation::NONE: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_POSX); + m_aRunText.append((sal_Int32)rFlyHori.GetPos()); + break; + default: + break; + } + if (pS) + m_aRunText.append(pS); + } else if ( !m_rExport.bRTFFlySyntax ) + { + RTFHoriOrient aHO( static_cast< USHORT >(rFlyHori.GetHoriOrient()), + static_cast< USHORT >(rFlyHori.GetRelationOrient()) ); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYHORZ); + m_aRunText.append((sal_Int32)aHO.GetValue()); + } +} + +void RtfAttributeOutput::FormatAnchor( const SwFmtAnchor& rAnchor ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !m_rExport.bRTFFlySyntax ) + { + USHORT nId = static_cast< USHORT >(rAnchor.GetAnchorId()); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYANCHOR); + m_aRunText.append((sal_Int32)nId); + switch( nId ) + { + case FLY_AT_PAGE: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYPAGE); + m_aRunText.append((sal_Int32)rAnchor.GetPageNum()); + break; + case FLY_AT_PARA: + case FLY_AS_CHAR: + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_FLYCNTNT); + break; + } + } +} + +void RtfAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( !rBrush.GetColor().GetTransparency() ) + { + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHCBPAT); + m_aStyles.append((sal_Int32)m_rExport.GetColor(rBrush.GetColor())); + } +} + +void RtfAttributeOutput::FormatBox( const SvxBoxItem& rBox ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + static USHORT __READONLY_DATA aBorders[] = { + BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT }; + static const sal_Char* aBorderNames[] = { + OOO_STRING_SVTOOLS_RTF_BRDRT, OOO_STRING_SVTOOLS_RTF_BRDRL, OOO_STRING_SVTOOLS_RTF_BRDRB, OOO_STRING_SVTOOLS_RTF_BRDRR }; + + USHORT nDist = rBox.GetDistance(); + + if ( m_rExport.bRTFFlySyntax ) + return; + + if( rBox.GetTop() && rBox.GetBottom() && + rBox.GetLeft() && rBox.GetRight() && + *rBox.GetTop() == *rBox.GetBottom() && + *rBox.GetTop() == *rBox.GetLeft() && + *rBox.GetTop() == *rBox.GetRight() && + nDist == rBox.GetDistance( BOX_LINE_TOP ) && + nDist == rBox.GetDistance( BOX_LINE_LEFT ) && + nDist == rBox.GetDistance( BOX_LINE_BOTTOM ) && + nDist == rBox.GetDistance( BOX_LINE_RIGHT )) + m_aSectionBreaks.append(OutBorderLine( m_rExport, rBox.GetTop(), OOO_STRING_SVTOOLS_RTF_BOX, nDist )); + else + { + const USHORT* pBrd = aBorders; + const sal_Char** pBrdNms = (const sal_Char**)aBorderNames; + for(int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms) + { + if (const SvxBorderLine* pLn = rBox.GetLine(*pBrd)) + { + m_aSectionBreaks.append(OutBorderLine(m_rExport, pLn, *pBrdNms, + rBox.GetDistance(*pBrd))); + } + } + } + + const USHORT* pBrd = aBorders; + const sal_Char** pBrdNms = (const sal_Char**)aBorderNames; + for( int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms ) + { + const SvxBorderLine* pLn = rBox.GetLine( *pBrd ); + if( pLn ) + { + m_aSectionBreaks.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE); + m_aSectionBreaks.append(OutBorderLine( m_rExport, pLn, *pBrdNms )); + m_aSectionBreaks.append("}" OOO_STRING_SVTOOLS_RTF_BRSP); + m_aSectionBreaks.append((sal_Int32)rBox.GetDistance( *pBrd )); + } + } + + if (!m_bBufferSectionBreaks) + m_aStyles.append(m_aSectionBreaks.makeStringAndClear()); +} + +void RtfAttributeOutput::FormatColumns_Impl( USHORT nCols, const SwFmtCol& rCol, bool bEven, SwTwips nPageSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLS; + m_rExport.OutLong( nCols ); + + if( bEven ) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSX; + m_rExport.OutLong( rCol.GetGutterWidth( TRUE ) ); + } + else + { + const SwColumns & rColumns = rCol.GetColumns( ); + for( USHORT n = 0; n < nCols; ) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLNO; + m_rExport.OutLong( n+1 ); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLW; + m_rExport.OutLong( rCol.CalcPrtColWidth( n, nPageSize ) ); + + if( ++n != nCols ) + { + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_COLSR; + m_rExport.OutLong( rColumns[ n-1 ]->GetRight() + + rColumns[ n ]->GetLeft() ); + } + } + } +} + +void RtfAttributeOutput::FormatKeep( const SvxFmtKeepItem& rItem ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if( rItem.GetValue() ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_KEEPN); +} + +void RtfAttributeOutput::FormatTextGrid( const SwTextGridItem& /*rGrid*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::FormatLineNumbering( const SwFmtLineNumber& rNumbering ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( !rNumbering.IsCount( ) ) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_NOLINE); +} + +void RtfAttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDirection ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (!m_rExport.bOutPageDescs) + { + if (rDirection.GetValue() == FRMDIR_HORI_RIGHT_TOP) + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RTLPAR); + else + m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LTRPAR); + } +} + +void RtfAttributeOutput::WriteExpand( const SwField* /*pFld*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::RefField( const SwField& /*rFld*/, const String& /*rRef*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::HiddenField( const SwField& /*rFld*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::SetField( const SwField& /*rFld*/, ww::eField /*eType*/, const String& /*rCmd*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfAttributeOutput::PostitField( const SwField* pFld ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + const SwPostItField& rPFld = *(SwPostItField*)pFld; + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNID " "); + m_aRunText.append(OUStringToOString(OUString(rPFld.GetPar1()), m_rExport.eCurrentEncoding)); + m_aRunText.append("}"); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNAUTHOR " "); + m_aRunText.append(OUStringToOString(OUString(rPFld.GetPar1()), m_rExport.eCurrentEncoding)); + m_aRunText.append("}"); + m_aRunText.append(OOO_STRING_SVTOOLS_RTF_CHATN); + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ANNOTATION); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_ATNDATE " "); + m_aRunText.append((sal_Int32)sw::ms::DateTime2DTTM(rPFld.GetDate())); + m_aRunText.append('}'); + m_aRunText.append(OUStringToOString(OUString(rPFld.GetTxt()), m_rExport.eCurrentEncoding)); + m_aRunText.append('}'); +} + +bool RtfAttributeOutput::DropdownField( const SwField* /*pFld*/ ) +{ + // this is handled in OutputFlyFrame_Impl() + return true; +} + +RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport ) + : m_rExport( rExport ), + m_pTableWrt( NULL ), + m_bTableCellOpen( false ), + m_nTableDepth( 0 ), + m_bTblAfterCell( false ), + m_nColBreakNeeded( false ), + m_bBufferSectionBreaks( false ), + m_bBufferSectionHeaders( false ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); +} + +RtfAttributeOutput::~RtfAttributeOutput() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); +} + +MSWordExportBase& RtfAttributeOutput::GetExport() +{ + return m_rExport; +} + +// These are used by wwFont::WriteRtf() + +/// Start the font. +void RtfAttributeOutput::StartFont( const String& rFamilyName ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OUStringToOString( OUString( rFamilyName ), m_rExport.eCurrentEncoding ).getStr(); +} + +/// End the font. +void RtfAttributeOutput::EndFont() const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << ";}"; +} + +/// Alternate name for the font. +void RtfAttributeOutput::FontAlternateName( const String& rName ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FALT << ' '; + m_rExport.Strm() << OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ) << '}'; +} + +/// Font charset. +void RtfAttributeOutput::FontCharset( sal_uInt8 nCharSet ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FCHARSET; + m_rExport.OutULong( nCharSet ); + m_rExport.Strm() << ' '; +} + +/// Font family. +void RtfAttributeOutput::FontFamilyType( FontFamily eFamily, const wwFont &rFont ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_F; + + const char* pStr = OOO_STRING_SVTOOLS_RTF_FNIL; + switch (eFamily) + { + case FAMILY_ROMAN: + pStr = OOO_STRING_SVTOOLS_RTF_FROMAN; + break; + case FAMILY_SWISS: + pStr = OOO_STRING_SVTOOLS_RTF_FSWISS; + break; + case FAMILY_MODERN: + pStr = OOO_STRING_SVTOOLS_RTF_FMODERN; + break; + case FAMILY_SCRIPT: + pStr = OOO_STRING_SVTOOLS_RTF_FSCRIPT; + break; + case FAMILY_DECORATIVE: + pStr = OOO_STRING_SVTOOLS_RTF_FDECOR; + break; + default: + break; + } + m_rExport.OutULong(m_rExport.maFontHelper.GetId(rFont)) << pStr; +} + +/// Font pitch. +void RtfAttributeOutput::FontPitchType( FontPitch ePitch ) const +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_FPRQ; + + USHORT nVal = 0; + switch (ePitch) + { + case PITCH_FIXED: + nVal = 1; + break; + case PITCH_VARIABLE: + nVal = 2; + break; + default: + break; + } + m_rExport.OutULong(nVal); +} + +static bool IsEMF(const sal_uInt8 *pGraphicAry, unsigned long nSize) +{ + if (pGraphicAry && (nSize > 0x2c )) + { + // check the magic number + if ( + (pGraphicAry[0x28] == 0x20 ) && (pGraphicAry[0x29] == 0x45) && + (pGraphicAry[0x2a] == 0x4d ) && (pGraphicAry[0x2b] == 0x46) + ) + { + //emf detected + return true; + } + } + return false; +} + +static bool StripMetafileHeader(const sal_uInt8 *&rpGraphicAry, unsigned long &rSize) +{ + if (rpGraphicAry && (rSize > 0x22)) + { + if ( + (rpGraphicAry[0] == 0xd7) && (rpGraphicAry[1] == 0xcd) && + (rpGraphicAry[2] == 0xc6) && (rpGraphicAry[3] == 0x9a) + ) + { // we have to get rid of the metafileheader + rpGraphicAry += 22; + rSize -= 22; + return true; + } + } + return false; +} + +static OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, sal_uInt32 nLimit = 64) +{ + OStringBuffer aRet; + + sal_uInt32 nBreak = 0; + for (sal_uInt32 i = 0; i < nSize; i++) + { + OString sNo = OString::valueOf(sal_Int32(pData[i]), 16); + if (sNo.getLength() < 2) + aRet.append('0'); + aRet.append(sNo); + if (++nBreak == nLimit) + { + aRet.append(RtfExport::sNewLine); + nBreak = 0; + } + } + + return aRet.makeStringAndClear(); +} + +static OString WriteHex(sal_Int32 nNum) +{ + return WriteHex((sal_uInt8*)&nNum, sizeof(sal_Int32)); +} + +static OString WriteHex(OString sString) +{ + OStringBuffer aRet; + + aRet.append(WriteHex(sString.getLength()+1)); + aRet.append(WriteHex((sal_uInt8*)sString.getStr(), sString.getLength()+1)); + + return aRet.makeStringAndClear(); +} + +static OString ExportPICT(const Size &rOrig, const Size &rRendered, const Size &rMapped, + const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry, + unsigned long nSize) +{ + OStringBuffer aRet; + bool bIsWMF = (const char *)pBLIPType == (const char *)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false; + if (pBLIPType && nSize && pGraphicAry) + { + aRet.append("{" OOO_STRING_SVTOOLS_RTF_PICT); + + long nXCroppedSize = rOrig.Width()-(rCr.GetLeft() + rCr.GetRight()); + long nYCroppedSize = rOrig.Height()-(rCr.GetTop() + rCr.GetBottom()); + /* #127543#: Graphic with a zero height or width, typically copied from webpages, caused + crashes. */ + if( !nXCroppedSize ) + nXCroppedSize = 100; + if( !nYCroppedSize ) + nYCroppedSize = 100; + + //Given the original size and taking cropping into account + //first, how much has the original been scaled to get the + //final rendered size + aRet.append(OOO_STRING_SVTOOLS_RTF_PICSCALEX); + aRet.append((sal_Int32)((100 * rRendered.Width()) / nXCroppedSize)); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICSCALEY); + aRet.append((sal_Int32)((100 * rRendered.Height()) / nYCroppedSize)); + + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPL); + aRet.append((sal_Int32)rCr.GetLeft()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPR); + aRet.append((sal_Int32)rCr.GetRight()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPT); + aRet.append((sal_Int32)rCr.GetTop()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICCROPB); + aRet.append((sal_Int32)rCr.GetBottom()); + + aRet.append(OOO_STRING_SVTOOLS_RTF_PICW); + aRet.append((sal_Int32)rMapped.Width()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICH); + aRet.append((sal_Int32)rMapped.Height()); + + aRet.append(OOO_STRING_SVTOOLS_RTF_PICWGOAL); + aRet.append((sal_Int32)rOrig.Width()); + aRet.append(OOO_STRING_SVTOOLS_RTF_PICHGOAL); + aRet.append((sal_Int32)rOrig.Height()); + + aRet.append(pBLIPType); + if (bIsWMF) + { + aRet.append((sal_Int32)8); + StripMetafileHeader(pGraphicAry, nSize); + } + aRet.append(RtfExport::sNewLine); + aRet.append(WriteHex(pGraphicAry, nSize)); + aRet.append('}'); + } + return aRet.makeStringAndClear(); +} + +void RtfAttributeOutput::FlyFrameOLEData( SwOLENode& rOLENode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + uno::Reference < embed::XEmbeddedObject > xObj(const_cast(rOLENode).GetOLEObj().GetOleRef()); + sal_Int64 nAspect = rOLENode.GetAspect(); + svt::EmbeddedObjectRef aObjRef( xObj, nAspect ); + SvGlobalName aObjName(aObjRef->getClassID()); + + if (SotExchange::IsMath(aObjName)) + { + // ObjectHeader + m_aRunText.append(WriteHex(0x00000501)); // OLEVersion + m_aRunText.append(WriteHex(0x00000002)); // FormatID + m_aRunText.append(WriteHex(OString("Equation.3"))); // ClassName + m_aRunText.append(WriteHex(0x00000000)); // TopicName + m_aRunText.append(WriteHex(0x00000000)); // ItemName + + // NativeData + SvMemoryStream *pStream = new SvMemoryStream; + SvStorage* pStorage = new SvStorage(*pStream); + m_rExport.pOLEExp->ExportOLEObject( aObjRef, *pStorage ); + pStream->Seek(STREAM_SEEK_TO_END); + sal_uInt32 nNativeDataSize = pStream->Tell(); + const sal_uInt8* pNativeData = (sal_uInt8*)pStream->GetData(); + m_aRunText.append(WriteHex(nNativeDataSize)); + m_aRunText.append(RtfExport::sNewLine); + m_aRunText.append(WriteHex(pNativeData, nNativeDataSize, 126)); + m_aRunText.append(RtfExport::sNewLine); + delete pStream; + + // MetaFilePresentationObject + pStream = new SvMemoryStream; + Graphic* pGraphic = rOLENode.GetGraphic(); + if (GraphicConverter::Export(*pStream, *pGraphic, CVT_WMF) != ERRCODE_NONE) + OSL_ENSURE(false, "failed to export the presentation data"); + pStream->Seek(STREAM_SEEK_TO_END); + sal_uInt32 nPresentationDataSize = pStream->Tell(); + const sal_uInt8* pPresentationData = (sal_uInt8*)pStream->GetData(); + m_aRunText.append(WriteHex(pPresentationData, nPresentationDataSize, 126)); + } +} + +void RtfAttributeOutput::FlyFrameOLE( SwOLENode& rOLENode, const Size& rSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + SvMemoryStream aStream; + const sal_uInt8* pGraphicAry = 0; + sal_uInt32 nSize = 0; + Graphic* pGraphic = rOLENode.GetGraphic(); + + Size aSize(sw::util::GetSwappedInSize(rOLENode)); + Size aRendered(aSize); + aRendered.Width() = rSize.Width(); + aRendered.Height() = rSize.Height(); + Size aMapped(pGraphic->GetPrefSize()); + const SwCropGrf &rCr = (const SwCropGrf &)rOLENode.GetAttr(RES_GRFATR_CROPGRF); + const sal_Char* pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; + + if (GraphicConverter::Export(aStream, *pGraphic, CVT_WMF) != ERRCODE_NONE) + OSL_ENSURE(false, "failed to export the graphic"); + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_OBJECT OOO_STRING_SVTOOLS_RTF_OBJEMB); + + // export the object data in the appropriate format; RTF requires the usage of the OLE 1.0 format + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_OBJDATA " "); + FlyFrameOLEData(rOLENode); + m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_RESULT); + + SwTwips nHeight = aSize.Height(); + nHeight/=20; //nHeight was in twips, want it in half points, but then half of total height. + long nFontHeight = ((const SvxFontHeightItem&)m_rExport.GetItem(RES_CHRATR_FONTSIZE)).GetHeight(); + nHeight-=nFontHeight/20; + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_DN).append(nHeight); + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); + m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize)); + m_aRunText.append("}}}}"); +} + +void RtfAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + SvMemoryStream aStream; + const sal_uInt8* pGraphicAry = 0; + sal_uInt32 nSize = 0; + + Graphic aGraphic(rGrfNode.GetGrf()); + + // If there is no graphic there is not much point in parsing it + if(aGraphic.GetType()==GRAPHIC_NONE) + return; + + GfxLink aGraphicLink; + const sal_Char* pBLIPType = 0; + if (aGraphic.IsLink()) + { + aGraphicLink = aGraphic.GetLink(); + nSize = aGraphicLink.GetDataSize(); + pGraphicAry = aGraphicLink.GetData(); + switch (aGraphicLink.GetType()) + { + case GFX_LINK_TYPE_NATIVE_JPG: + pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP; + break; + case GFX_LINK_TYPE_NATIVE_PNG: + pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP; + break; + case GFX_LINK_TYPE_NATIVE_WMF: + pBLIPType = + IsEMF(pGraphicAry, nSize) ? OOO_STRING_SVTOOLS_RTF_EMFBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE; + break; + default: + break; + } + } + + GraphicType eGraphicType = aGraphic.GetType(); + if (!pGraphicAry) + { + if (ERRCODE_NONE == GraphicConverter::Export(aStream, aGraphic, + (eGraphicType == GRAPHIC_BITMAP) ? CVT_PNG : CVT_WMF)) + { + pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ? + OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE; + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + } + } + + Size aMapped(eGraphicType == GRAPHIC_BITMAP ? aGraphic.GetSizePixel() : aGraphic.GetPrefSize()); + + const SwCropGrf &rCr = (const SwCropGrf &)rGrfNode.GetAttr(RES_GRFATR_CROPGRF); + + //Get original size in twips + Size aSize(sw::util::GetSwappedInSize(rGrfNode)); + Size aRendered(aSize); + aRendered.Width() = rSize.Width(); + aRendered.Height() = rSize.Height(); + + /* + If the graphic is not of type WMF then we will have to store two + graphics, one in the native format wrapped in shppict, and the other in + the wmf format wrapped in nonshppict, so as to keep wordpad happy. If its + a wmf already then we don't need any such wrapping + */ + bool bIsWMF = (const sal_Char*)pBLIPType == (const sal_Char*)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false; + if (!bIsWMF) + m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); + + if (pBLIPType) + m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize)); + else + { + aStream.Seek(0); + GraphicConverter::Export(aStream, aGraphic, CVT_WMF); + pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + + m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize)); + } + + if (!bIsWMF) + { + m_aRunText.append("}" "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT); + + aStream.Seek(0); + GraphicConverter::Export(aStream, aGraphic, CVT_WMF); + pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; + aStream.Seek(STREAM_SEEK_TO_END); + nSize = aStream.Tell(); + pGraphicAry = (sal_uInt8*)aStream.GetData(); + + m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize)); + + m_aRunText.append('}'); + } + + m_aRunText.append(m_rExport.sNewLine); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx new file mode 100644 index 000000000000..8a4d0e766509 --- /dev/null +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -0,0 +1,573 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFATTRIBUTEOUTPUT_HXX_ +#define _RTFATTRIBUTEOUTPUT_HXX_ + +#include +#include "attributeoutputbase.hxx" +#include "fields.hxx" + +#include + +#include +#include + +#include + +class RtfExport; + +class SwGrfNode; +class SwOLENode; +class SdrObject; + +class RtfAttributeOutput : public AttributeOutputBase +{ +public: + /// Export the state of RTL/CJK. + virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ); + + /// Start of the paragraph. + virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ); + + /// End of the paragraph. + virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ); + + /// Empty paragraph. + virtual void EmptyParagraph(); + + /// Called before we start outputting the attributes. + virtual void StartParagraphProperties( const SwTxtNode& rNode ); + + /// Called after we end outputting the attributes. + virtual void EndParagraphProperties(); + + /// Start of the text run. + virtual void StartRun( const SwRedlineData* pRedlineData ); + + /// End of the text run. + virtual void EndRun(); + + /// Called before we start outputting the attributes. + virtual void StartRunProperties(); + + /// Called after we end outputting the attributes. + virtual void EndRunProperties( const SwRedlineData* pRedlineData ); + + /// Output text (inside a run). + virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 ); + + // Access to (anyway) private buffers, used by the sdr exporter + rtl::OStringBuffer& RunText(); + rtl::OStringBuffer& Styles(); + + /// Output text (without markup). + virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); + + /// Output ruby start. + virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby ); + + /// Output ruby end. + virtual void EndRuby(); + + /// Output URL start. + virtual bool StartURL( const String& rUrl, const String& rTarget ); + + /// Output URL end. + virtual bool EndURL(); + + virtual void FieldVanish( const String& rTxt, ww::eField eType ); + + /// Output redlining. + /// + /// The common attribute that can be among the run properties. + virtual void Redline( const SwRedlineData* pRedline ); + + virtual void FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, USHORT nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ); + + /// Output style. + virtual void ParagraphStyle( USHORT nStyle ); + + virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo ); + + virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ); + + virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + virtual void TableRowEnd( sal_uInt32 nDepth ); + + /// Start of the styles table. + virtual void StartStyles(); + + /// End of the styles table. + virtual void EndStyles( USHORT nNumberOfStyles ); + + /// Write default style. + virtual void DefaultStyle( USHORT nStyle ); + + /// Start of a style in the styles table. + virtual void StartStyle( const String& rName, bool bPapFmt, + USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId ); + + /// End of a style in the styles table. + virtual void EndStyle(); + + /// Start of (paragraph or run) properties of a style. + virtual void StartStyleProperties( bool bParProp, USHORT nStyle ); + + /// End of (paragraph or run) properties of a style. + virtual void EndStyleProperties( bool bParProp ); + + /// Numbering rule and Id. + virtual void OutlineNumbering( BYTE nLvl, const SwNumFmt &rNFmt, const SwFmt &rFmt ); + + /// Page break + /// As a paragraph property - the paragraph should be on the next page. + virtual void PageBreakBefore( bool bBreak ); + + /// Write a section break + /// msword::ColumnBreak or msword::PageBreak + virtual void SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo = NULL ); + + /// Start of the section properties. + virtual void StartSection(); + + /// End of the section properties. + virtual void EndSection(); + + /// Protection of forms. + virtual void SectionFormProtection( bool bProtected ); + + /// Numbering of the lines in the document. + virtual void SectionLineNumbering( ULONG nRestartNo, const SwLineNumberInfo& rLnNumInfo ); + + /// Has different headers/footers for the title page. + virtual void SectionTitlePage(); + + /// Description of the page borders. + virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt ); + + /// Columns populated from right/numbers on the right side? + virtual void SectionBiDi( bool bBiDi ); + + /// The style of the page numbers. + /// + /// nPageRestartNumberr being 0 means no restart. + virtual void SectionPageNumbering( USHORT nNumType, USHORT nPageRestartNumber ); + + /// The type of breaking. + virtual void SectionType( BYTE nBreakCode ); + + /// Definition of a numbering instance. + virtual void NumberingDefinition( USHORT nId, const SwNumRule &rRule ); + + /// Start of the abstract numbering definition instance. + virtual void StartAbstractNumbering( USHORT nId ); + + /// End of the abstract numbering definition instance. + virtual void EndAbstractNumbering(); + + /// All the numbering level information. + virtual void NumberingLevel( BYTE nLevel, + USHORT nStart, + USHORT nNumberingType, + SvxAdjust eAdjust, + const BYTE *pNumLvlPos, + BYTE nFollow, + const wwFont *pFont, + const SfxItemSet *pOutSet, + sal_Int16 nIndentAt, + sal_Int16 nFirstLineIndex, + sal_Int16 nListTabPos, + const String &rNumberingString ); + + void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, BYTE nMode ); + void WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds ); + void WriteHeaderFooter_Impl( const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr ); + +protected: + /// Output frames - the implementation. + virtual void OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft ); + + /// Sfx item Sfx item RES_CHRATR_CASEMAP + virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap ); + + /// Sfx item Sfx item RES_CHRATR_COLOR + virtual void CharColor( const SvxColorItem& rColor); + + /// Sfx item Sfx item RES_CHRATR_CONTOUR + virtual void CharContour( const SvxContourItem& rContour ); + + /// Sfx item RES_CHRATR_CROSSEDOUT + virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ); + + /// Sfx item RES_CHRATR_ESCAPEMENT + virtual void CharEscapement( const SvxEscapementItem& rEscapement ); + + /// Sfx item RES_CHRATR_FONT + virtual void CharFont( const SvxFontItem& rFont ); + + /// Sfx item RES_CHRATR_FONTSIZE + virtual void CharFontSize( const SvxFontHeightItem& rFontSize ); + + /// Sfx item RES_CHRATR_KERNING + virtual void CharKerning( const SvxKerningItem& rKerning ); + + /// Sfx item RES_CHRATR_LANGUAGE + virtual void CharLanguage( const SvxLanguageItem& rLanguage ); + + /// Sfx item RES_CHRATR_POSTURE + virtual void CharPosture( const SvxPostureItem& rPosture ); + + /// Sfx item RES_CHRATR_SHADOWED + virtual void CharShadow( const SvxShadowedItem& rShadow ); + + /// Sfx item RES_CHRATR_UNDERLINE + virtual void CharUnderline( const SvxUnderlineItem& rUnderline ); + + /// Sfx item RES_CHRATR_WEIGHT + virtual void CharWeight( const SvxWeightItem& rWeight ); + + /// Sfx item RES_CHRATR_AUTOKERN + virtual void CharAutoKern( const SvxAutoKernItem& ); + + /// Sfx item RES_CHRATR_BLINK + virtual void CharAnimatedText( const SvxBlinkItem& rBlink ); + + /// Sfx item RES_CHRATR_BACKGROUND + virtual void CharBackground( const SvxBrushItem& rBrush ); + + /// Sfx item RES_CHRATR_CJK_FONT + virtual void CharFontCJK( const SvxFontItem& rFont ); + + /// Sfx item RES_CHRATR_CJK_FONTSIZE + virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize ); + + /// Sfx item RES_CHRATR_CJK_LANGUAGE + virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem ); + + /// Sfx item RES_CHRATR_CJK_POSTURE + virtual void CharPostureCJK( const SvxPostureItem& rPosture ); + + /// Sfx item RES_CHRATR_CJK_WEIGHT + virtual void CharWeightCJK( const SvxWeightItem& rWeight ); + + /// Sfx item RES_CHRATR_CTL_FONT + virtual void CharFontCTL( const SvxFontItem& rFont ); + + /// Sfx item RES_CHRATR_CTL_FONTSIZE + virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize ); + + /// Sfx item RES_CHRATR_CTL_LANGUAGE + virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem ); + + /// Sfx item RES_CHRATR_CTL_POSTURE + virtual void CharPostureCTL( const SvxPostureItem& rWeight ); + + /// Sfx item RES_CHRATR_CTL_WEIGHT + virtual void CharWeightCTL( const SvxWeightItem& rWeight ); + + /// Sfx item RES_CHRATR_ROTATE + virtual void CharRotate( const SvxCharRotateItem& rRotate ); + + /// Sfx item RES_CHRATR_EMPHASIS_MARK + virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark ); + + /// Sfx item RES_CHRATR_TWO_LINES + virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines ); + + /// Sfx item RES_CHRATR_SCALEW + virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth ); + + /// Sfx item RES_CHRATR_RELIEF + virtual void CharRelief( const SvxCharReliefItem& rRelief); + + /// Sfx item RES_CHRATR_HIDDEN + virtual void CharHidden( const SvxCharHiddenItem& rHidden ); + + /// Sfx item RES_TXTATR_INETFMT + virtual void TextINetFormat( const SwFmtINetFmt& ); + + /// Sfx item RES_TXTATR_CHARFMT + virtual void TextCharFormat( const SwFmtCharFmt& ); + + /// Sfx item RES_TXTATR_FTN + virtual void TextFootnote_Impl( const SwFmtFtn& ); + + /// Sfx item RES_PARATR_LINESPACING + virtual void ParaLineSpacing_Impl( short nSpace, short nMulti ); + + /// Sfx item RES_PARATR_ADJUST + virtual void ParaAdjust( const SvxAdjustItem& rAdjust ); + + /// Sfx item RES_PARATR_SPLIT + virtual void ParaSplit( const SvxFmtSplitItem& rSplit ); + + /// Sfx item RES_PARATR_WIDOWS + virtual void ParaWidows( const SvxWidowsItem& rWidows ); + + /// Sfx item RES_PARATR_TABSTOP + virtual void ParaTabStop( const SvxTabStopItem& rTabStop ); + + /// Sfx item RES_PARATR_HYPHENZONE + virtual void ParaHyphenZone( const SvxHyphenZoneItem& ); + + /// Sfx item RES_PARATR_NUMRULE + virtual void ParaNumRule_Impl( const SwTxtNode *pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId ); + + /// Sfx item RES_PARATR_SCRIPTSPACE + virtual void ParaScriptSpace( const SfxBoolItem& ); + + /// Sfx item RES_PARATR_VERTALIGN + virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ); + + /// Sfx item RES_PARATR_SNAPTOGRID + virtual void ParaSnapToGrid( const SvxParaGridItem& ); + + /// Sfx item RES_FRM_SIZE + virtual void FormatFrameSize( const SwFmtFrmSize& ); + + /// Sfx item RES_PAPER_BIN + virtual void FormatPaperBin( const SvxPaperBinItem& ); + + /// Sfx item RES_LR_SPACE + virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace ); + + /// Sfx item RES_UL_SPACE + virtual void FormatULSpace( const SvxULSpaceItem& rULSpace ); + + /// Sfx item RES_SURROUND + virtual void FormatSurround( const SwFmtSurround& ); + + /// Sfx item RES_VERT_ORIENT + virtual void FormatVertOrientation( const SwFmtVertOrient& ); + + /// Sfx item RES_HORI_ORIENT + virtual void FormatHorizOrientation( const SwFmtHoriOrient& ); + + /// Sfx item RES_ANCHOR + virtual void FormatAnchor( const SwFmtAnchor& ); + + /// Sfx item RES_BACKGROUND + virtual void FormatBackground( const SvxBrushItem& ); + + /// Sfx item RES_BOX + virtual void FormatBox( const SvxBoxItem& ); + + /// Sfx item RES_COL + virtual void FormatColumns_Impl( USHORT nCols, const SwFmtCol & rCol, bool bEven, SwTwips nPageSize ); + + /// Sfx item RES_KEEP + virtual void FormatKeep( const SvxFmtKeepItem& ); + + /// Sfx item RES_TEXTGRID + virtual void FormatTextGrid( const SwTextGridItem& ); + + /// Sfx item RES_LINENUMBER + virtual void FormatLineNumbering( const SwFmtLineNumber& ); + + /// Sfx item RES_FRAMEDIR + virtual void FormatFrameDirection( const SvxFrameDirectionItem& ); + + /// Write the expanded field + virtual void WriteExpand( const SwField* pFld ); + + virtual void RefField( const SwField& rFld, const String& rRef ); + virtual void HiddenField( const SwField& rFld ); + virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); + virtual void PostitField( const SwField* pFld ); + virtual bool DropdownField( const SwField* pFld ); + + /// Reference to the export, where to get the data from + RtfExport &m_rExport; + +private: + + /// Output graphic fly frames. + void FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize ); + void FlyFrameOLE( SwOLENode& rOLENode, const Size& rSize ); + void FlyFrameOLEData( SwOLENode& rOLENode ); + + /* + * Table methods. + */ + + void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ); + + void EndTableCell( ); + + void EndTableRow( ); + + void EndTable(); + + /// End cell, row, and even the entire table if necessary. + void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false ); + + void WriteTextFootnoteNumStr(const SwFmtFtn& rFootnote); + + /* + * Current style name and its ID. + */ + String m_rStyleName; + USHORT m_nStyleId; + /* + * Current list ID. + */ + USHORT m_nListId; + /* + * This is needed because the call order is: run text, run properties, paragraph properties. + * What we need is the opposite. + */ + rtl::OStringBuffer m_aRun; + rtl::OStringBuffer m_aRunText; + /* + * This is written after runs. + */ + rtl::OStringBuffer m_aAfterRuns; + /* + * Same for colors and stylesheets: first we just want to output colors, + * need to buffer the stylesheet table to output it after the color one. + */ + rtl::OStringBuffer m_aStylesheet; + /* + * This one just holds the style commands in the current style. + */ + rtl::OStringBuffer m_aStyles; + /* + * This is the same as m_aStyles but the conents of it is written last. + */ + rtl::OStringBuffer m_aStylesEnd; + + /* + * We just get a "end of strike" mark at the end of strike, store here what to finish: single or double strike. + */ + bool m_bStrikeDouble; + + /* + * The current table helper. + */ + SwWriteTable *m_pTableWrt; + + /* + * Remember if we are in an open cell, or not. + */ + bool m_bTableCellOpen; + + /* + * Remember the current table depth. + */ + sal_uInt32 m_nTableDepth; + + /* + * Remember if we wrote a \cell or not. + */ + bool m_bTblAfterCell; + + /* + * For late output of row definitions. + */ + rtl::OStringBuffer m_aRowDefs; + + /* + * Is a column break needed after the next \par? + */ + bool m_nColBreakNeeded; + + /* + * If section breaks should be buffered to m_aSectionBreaks + */ + bool m_bBufferSectionBreaks; + rtl::OStringBuffer m_aSectionBreaks; + + /* + * If section headers (and footers) should be buffered to + * m_aSectionHeaders. + */ + bool m_bBufferSectionHeaders; + rtl::OStringBuffer m_aSectionHeaders; + +public: + RtfAttributeOutput( RtfExport &rExport ); + + virtual ~RtfAttributeOutput(); + + /// Return the right export class. + virtual MSWordExportBase& GetExport(); + + rtl::OStringBuffer m_aTabStop; + + // These are used by wwFont::WriteRtf() + /// Start the font. + void StartFont( const String& rFamilyName ) const; + + /// End the font. + void EndFont() const; + + /// Alternate name for the font. + void FontAlternateName( const String& rName ) const; + + /// Font charset. + void FontCharset( sal_uInt8 nCharSet ) const; + + /// Font family. + void FontFamilyType( FontFamily eFamily, const wwFont &rFont ) const; + + /// Font pitch. + void FontPitchType( FontPitch ePitch ) const; +}; + +#endif // _RTFATTRIBUTEOUTPUT_HXX_ + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx new file mode 100644 index 000000000000..7563b2981ba5 --- /dev/null +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -0,0 +1,1240 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfexport.hxx" +#include "rtfexportfilter.hxx" +#include "rtfsdrexport.hxx" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "ww8par.hxx" +#include "ww8scan.hxx" + +#include +#include +#include +#include +#include + +using namespace ::comphelper; +using namespace ::com::sun::star; + +using rtl::OString; +using rtl::OUString; +using rtl::OStringBuffer; +using rtl::OUStringBuffer; + +using sw::mark::IMark; + +#if defined(UNX) +const sal_Char RtfExport::sNewLine = '\012'; +#else +const sal_Char __FAR_DATA RtfExport::sNewLine[] = "\015\012"; +#endif + +// the default text encoding for the export, if it doesn't fit unicode will +// be used +#define DEF_ENCODING RTL_TEXTENCODING_ASCII_US + +AttributeOutputBase& RtfExport::AttrOutput() const +{ + return *m_pAttrOutput; +} + +MSWordSections& RtfExport::Sections() const +{ + return *m_pSections; +} + +RtfSdrExport& RtfExport::SdrExporter() const +{ + return *m_pSdrExport; +} + +bool RtfExport::CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich ) +{ + // FIXME is this actually true for rtf? - this is copied from DOCX + if ( nScript == i18n::ScriptType::ASIAN ) + { + // for asian in ww8, there is only one fontsize + // and one fontstyle (posture/weight) + switch ( nWhich ) + { + case RES_CHRATR_FONTSIZE: + case RES_CHRATR_POSTURE: + case RES_CHRATR_WEIGHT: + return false; + default: + break; + } + } + else if ( nScript != i18n::ScriptType::COMPLEX ) + { + // for western in ww8, there is only one fontsize + // and one fontstyle (posture/weight) + switch ( nWhich ) + { + case RES_CHRATR_CJK_FONTSIZE: + case RES_CHRATR_CJK_POSTURE: + case RES_CHRATR_CJK_WEIGHT: + return false; + default: + break; + } + } + return true; +} + +void RtfExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + std::vector< OUString > aStarts; + std::vector< OUString > aEnds; + + IMarkVector aMarks; + if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarks ) ) + { + for ( IMarkVector::const_iterator it = aMarks.begin(), end = aMarks.end(); + it < end; ++it ) + { + IMark* pMark = (*it); + xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); + xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + + if ( nStart == nAktPos ) + aStarts.push_back( pMark->GetName() ); + + if ( nEnd == nAktPos ) + aEnds.push_back( pMark->GetName() ); + } + } + + m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds ); +} + +void RtfExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + std::vector aStarts; + std::vector aEnds; + + aStarts.push_back(rName); + aEnds.push_back(rName); + + m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds); +} + +void RtfExport::WriteChar( sal_Unicode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* WriteChar() has nothing to do for rtf. */ +} + +static bool IsExportNumRule( const SwNumRule& rRule, BYTE* pEnd = 0 ) +{ + BYTE nEnd = MAXLEVEL; + while( nEnd-- && !rRule.GetNumFmt( nEnd )) + ; + ++nEnd; + + const SwNumFmt* pNFmt; + BYTE nLvl; + + for( nLvl = 0; nLvl < nEnd; ++nLvl ) + if( SVX_NUM_NUMBER_NONE != ( pNFmt = &rRule.Get( nLvl )) + ->GetNumberingType() || pNFmt->GetPrefix().Len() || + (pNFmt->GetSuffix().Len() && pNFmt->GetSuffix() != aDotStr )) + break; + + if( pEnd ) + *pEnd = nEnd; + return nLvl != nEnd; +} + +void RtfExport::BuildNumbering() +{ + const SwNumRuleTbl& rListTbl = pDoc->GetNumRuleTbl(); + + for( USHORT n = rListTbl.Count()+1; n; ) + { + SwNumRule* pRule; + --n; + if( n == rListTbl.Count() ) + pRule = (SwNumRule*)pDoc->GetOutlineNumRule(); + else + { + pRule = rListTbl[ n ]; + if( !pDoc->IsUsed( *pRule )) + continue; + } + + if( IsExportNumRule( *pRule )) + GetId( *pRule ); + } +} + +void RtfExport::WriteNumbering() +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + if ( !pUsedNumTbl ) + return; // no numbering is used + + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_LISTTABLE; + AbstractNumberingDefinitions(); + Strm() << '}'; + + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE; + NumberingDefinitions(); + Strm() << '}'; + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteRevTab() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + int nRevAuthors = pDoc->GetRedlineTbl().Count(); + + if (nRevAuthors < 1) + return; + + // RTF always seems to use Unknown as the default first entry + String sUnknown(RTL_CONSTASCII_USTRINGPARAM("Unknown")); + GetRedline(sUnknown); + + for( USHORT i = 0; i < pDoc->GetRedlineTbl().Count(); ++i ) + { + const SwRedline* pRedl = pDoc->GetRedlineTbl()[ i ]; + + GetRedline(SW_MOD()->GetRedlineAuthor(pRedl->GetAuthor())); + } + + // Now write the table + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_REVTBL << ' '; + for(std::map::iterator aIter = m_aRedlineTbl.begin(); aIter != m_aRedlineTbl.end(); ++aIter) + Strm() << '{' << OutString((*aIter).first, eDefaultEncoding) << ";}"; + Strm() << '}' << sNewLine; +} + +void RtfExport::WriteHeadersFooters( BYTE nHeadFootFlags, + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE /*nBreakCode*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // headers + if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN ) + WriteHeaderFooter( rLeftFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERL ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_ODD ) + WriteHeaderFooter( rFmt, true, OOO_STRING_SVTOOLS_RTF_HEADER ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_HEADER_FIRST ) + WriteHeaderFooter( rFirstPageFmt, true, OOO_STRING_SVTOOLS_RTF_HEADERF ); + + // footers + if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_EVEN ) + WriteHeaderFooter( rLeftFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERL ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_ODD ) + WriteHeaderFooter( rFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTER ); + + if ( nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST ) + WriteHeaderFooter( rFirstPageFmt, false, OOO_STRING_SVTOOLS_RTF_FOOTERF ); +} + +void RtfExport::OutputField( const SwField* pFld, ww::eField eFldType, const String& rFldCmd, BYTE nMode ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_pAttrOutput->WriteField_Impl( pFld, eFldType, rFldCmd, nMode ); +} + +void RtfExport::WriteFormData( const ::sw::mark::IFieldmark& /*rFieldmark*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfExport::WriteHyperlinkData( const ::sw::mark::IFieldmark& /*rFieldmark*/ ) +{ + OSL_TRACE("TODO: %s", OSL_THIS_FUNC); +} + +void RtfExport::DoComboBox(const rtl::OUString& /*rName*/, + const rtl::OUString& /*rHelp*/, + const rtl::OUString& /*rToolTip*/, + const rtl::OUString& /*rSelected*/, + uno::Sequence& /*rListItems*/) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // this is handled in RtfAttributeOutput::OutputFlyFrame_Impl +} + +void RtfExport::DoFormText(const SwInputField* /*pFld*/) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // this is hanled in RtfAttributeOutput::OutputFlyFrame_Impl +} + +ULONG RtfExport::ReplaceCr( BYTE ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // Completely unused for Rtf export... only here for code sharing + // purpose with binary export + + return 0; +} + +void RtfExport::WriteFonts() +{ + Strm() << sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_FONTTBL; + maFontHelper.WriteFontTable( *m_pAttrOutput ); + Strm() << '}'; +} + +void RtfExport::WriteStyles() +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + pStyles->OutputStylesTable(); + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteMainText() +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + pCurPam->GetPoint()->nNode = pDoc->GetNodes().GetEndOfContent().StartOfSectionNode()->GetIndex(); + WriteText(); + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteInfo() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_INFO; + + SwDocShell *pDocShell(pDoc->GetDocShell()); + uno::Reference xDocProps; + if (pDocShell) { + uno::Reference xDPS( + pDocShell->GetModel(), uno::UNO_QUERY); + xDocProps.set(xDPS->getDocumentProperties()); + } + + if (xDocProps.is()) { + OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle()); + OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject()); + + OutUnicode(OOO_STRING_SVTOOLS_RTF_KEYWORDS, + ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords())); + OutUnicode(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription()); + + OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor()); + OutDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate()); + + OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR,xDocProps->getModifiedBy()); + OutDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate()); + + OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate()); + } + + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " "; + OUString sProduct; + utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct; + Strm() << OUStringToOString( sProduct, eCurrentEncoding) << "}{" << OOO_STRING_SVTOOLS_RTF_VERN; + OutULong( SUPD*10 ) << '}'; + Strm() << '}'; +} + +void RtfExport::WritePageDescTable() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // Write page descriptions (page styles) + USHORT nSize = pDoc->GetPageDescCnt(); + if( !nSize ) + return; + + Strm() << sNewLine; // a separator + bOutPageDescs = TRUE; + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCTBL; + for( USHORT n = 0; n < nSize; ++n ) + { + const SwPageDesc& rPageDesc = + const_cast(pDoc)->GetPageDesc( n ); + + Strm() << sNewLine << '{' << OOO_STRING_SVTOOLS_RTF_PGDSC; + OutULong( n ) << OOO_STRING_SVTOOLS_RTF_PGDSCUSE; + OutULong( rPageDesc.ReadUseOn() ); + + OutPageDescription( rPageDesc, FALSE, FALSE ); + + // search for the next page description + USHORT i = nSize; + while( i ) + if( rPageDesc.GetFollow() == + &const_cast(pDoc)->GetPageDesc( --i ) ) + break; + Strm() << OOO_STRING_SVTOOLS_RTF_PGDSCNXT; + OutULong( i ) << ' '; + Strm() << OutString( rPageDesc.GetName(), eDefaultEncoding) << ";}"; + } + Strm() << '}' << sNewLine; + bOutPageDescs = FALSE; +} + +void RtfExport::ExportDocument_Impl() +{ +#ifdef DEBUG + // MSWordExportBase::WriteText and others write debug messages to std::clog + // which is not interesting while debugging RtfExport + std::ostringstream aOss; + std::streambuf *pOldBuf = std::clog.rdbuf(aOss.rdbuf()); +#endif + + // Make the header + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1' + << OOO_STRING_SVTOOLS_RTF_ANSI; + Strm() << OOO_STRING_SVTOOLS_RTF_DEFF; + OutULong( maFontHelper.GetId( (SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem( + RES_CHRATR_FONT ) )); + // If this not exist, MS don't understand our ansi characters (0x80-0xff). + Strm() << "\\adeflang1025"; + + // Font table + WriteFonts(); + + pStyles = new MSWordStyles( *this ); + // Color and stylesheet table + WriteStyles(); + + // List table + BuildNumbering(); + WriteNumbering(); + + WriteRevTab(); + + WriteInfo(); + // Default TabSize + Strm() << m_pAttrOutput->m_aTabStop.makeStringAndClear() << sNewLine; + // Page description + WritePageDescTable(); + + // Enable form protection by default if needed, as there is no switch to + // enable it on a per-section basis. OTOH don't always enable it as it + // breaks moving of drawings - so write it only in case there is really a + // protected section in the document. + { + const SfxItemPool& rPool = pDoc->GetAttrPool(); + USHORT nMaxItem = rPool.GetItemCount(RES_PROTECT); + for( USHORT n = 0; n < nMaxItem; ++n ) + { + const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem(RES_PROTECT, n); + if (pProtect && pProtect->IsCntntProtected()) + { + Strm() << OOO_STRING_SVTOOLS_RTF_FORMPROT; + break; + } + } + } + + // enable form field shading + Strm() << OOO_STRING_SVTOOLS_RTF_FORMSHADE; + + // size and empty margins of the page + if( pDoc->GetPageDescCnt() ) + { + //JP 06.04.99: Bug 64361 - Seeking the first SwFmtPageDesc. If + // no set, the default is valid + const SwFmtPageDesc* pSttPgDsc = 0; + { + const SwNode& rSttNd = *pDoc->GetNodes()[ + pDoc->GetNodes().GetEndOfExtras().GetIndex() + 2 ]; + const SfxItemSet* pSet = 0; + + if( rSttNd.IsCntntNode() ) + pSet = &rSttNd.GetCntntNode()->GetSwAttrSet(); + else if( rSttNd.IsTableNode() ) + pSet = &rSttNd.GetTableNode()->GetTable(). + GetFrmFmt()->GetAttrSet(); + else if( rSttNd.IsSectionNode() ) + pSet = &rSttNd.GetSectionNode()->GetSection(). + GetFmt()->GetAttrSet(); + + if( pSet ) + { + USHORT nPosInDoc; + pSttPgDsc = (SwFmtPageDesc*)&pSet->Get( RES_PAGEDESC ); + if( !pSttPgDsc->GetPageDesc() ) + pSttPgDsc = 0; + else if( pDoc->FindPageDescByName( pSttPgDsc-> + GetPageDesc()->GetName(), &nPosInDoc )) + { + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_PGDSCNO; + OutULong( nPosInDoc ) << '}'; + } + } + } + const SwPageDesc& rPageDesc = pSttPgDsc ? *pSttPgDsc->GetPageDesc() + : const_cast(pDoc)->GetPageDesc( 0 ); + const SwFrmFmt &rFmtPage = rPageDesc.GetMaster(); + + { + if( rPageDesc.GetLandscape() ) + Strm() << OOO_STRING_SVTOOLS_RTF_LANDSCAPE; + + const SwFmtFrmSize& rSz = rFmtPage.GetFrmSize(); + // Clipboard document is always created without a printer, then + // the size will be always LONG_MAX! Solution then is to use A4 + if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() ) + { + Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; + Size a4 = SvxPaperInfo::GetPaperSize(PAPER_A4); + OutULong( a4.Height() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; + OutULong( a4.Width() ); + } + else + { + Strm() << OOO_STRING_SVTOOLS_RTF_PAPERH; + OutULong( rSz.GetHeight() ) << OOO_STRING_SVTOOLS_RTF_PAPERW; + OutULong( rSz.GetWidth() ); + } + } + + { + const SvxLRSpaceItem& rLR = rFmtPage.GetLRSpace(); + Strm() << OOO_STRING_SVTOOLS_RTF_MARGL; + OutLong( rLR.GetLeft() ) << OOO_STRING_SVTOOLS_RTF_MARGR; + OutLong( rLR.GetRight() ); + } + + { + const SvxULSpaceItem& rUL = rFmtPage.GetULSpace(); + Strm() << OOO_STRING_SVTOOLS_RTF_MARGT; + OutLong( rUL.GetUpper() ) << OOO_STRING_SVTOOLS_RTF_MARGB; + OutLong( rUL.GetLower() ); + } + + Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; + // All sections are unlocked by default + Strm() << OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED; + OutLong(1); + OutPageDescription( rPageDesc, FALSE, TRUE ); // Changed bCheckForFirstPage to TRUE so headers + // following title page are correctly added - i13107 + if( pSttPgDsc ) + { + pAktPageDesc = &rPageDesc; + } + } + + // line numbering + const SwLineNumberInfo& rLnNumInfo = pDoc->GetLineNumberInfo(); + if ( rLnNumInfo.IsPaintLineNumbers() ) + AttrOutput().SectionLineNumbering( 0, rLnNumInfo ); + + { + // write the footnotes and endnotes-out Info + const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo(); + + const char* pOut = FTNPOS_CHAPTER == rFtnInfo.ePos + ? OOO_STRING_SVTOOLS_RTF_ENDDOC + : OOO_STRING_SVTOOLS_RTF_FTNBJ; + Strm() << pOut << OOO_STRING_SVTOOLS_RTF_FTNSTART; + OutLong( rFtnInfo.nFtnOffset + 1 ); + + switch( rFtnInfo.eNum ) + { + case FTNNUM_PAGE: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTPG; break; + case FTNNUM_DOC: pOut = OOO_STRING_SVTOOLS_RTF_FTNRSTCONT; break; + // case FTNNUM_CHAPTER: + default: pOut = OOO_STRING_SVTOOLS_RTF_FTNRESTART; break; + } + Strm() << pOut; + + switch( rFtnInfo.aFmt.GetNumberingType() ) + { + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNALC; break; + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAUC; break; + case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRLC; break; + case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_FTNNRUC; break; + case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_FTNNCHI; break; + // case SVX_NUM_ARABIC: + default: pOut = OOO_STRING_SVTOOLS_RTF_FTNNAR; break; + } + Strm() << pOut; + + + const SwEndNoteInfo& rEndNoteInfo = pDoc->GetEndNoteInfo(); + + Strm() << OOO_STRING_SVTOOLS_RTF_AENDDOC << OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT + << OOO_STRING_SVTOOLS_RTF_AFTNSTART; + OutLong( rEndNoteInfo.nFtnOffset + 1 ); + + switch( rEndNoteInfo.aFmt.GetNumberingType() ) + { + case SVX_NUM_CHARS_LOWER_LETTER: + case SVX_NUM_CHARS_LOWER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNALC; break; + case SVX_NUM_CHARS_UPPER_LETTER: + case SVX_NUM_CHARS_UPPER_LETTER_N: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAUC; break; + case SVX_NUM_ROMAN_LOWER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRLC; break; + case SVX_NUM_ROMAN_UPPER: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNRUC; break; + case SVX_NUM_CHAR_SPECIAL: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNCHI; break; + // case SVX_NUM_ARABIC: + default: pOut = OOO_STRING_SVTOOLS_RTF_AFTNNAR; break; + } + Strm() << pOut; + } + + Strm() << sNewLine; + + // Init sections + m_pSections = new MSWordSections( *this ); + + WriteMainText(); + + Strm() << '}'; + +#ifdef DEBUG + std::clog.rdbuf(pOldBuf); +#endif +} + +void RtfExport::PrepareNewPageDesc( const SfxItemSet* pSet, + const SwNode& rNd, const SwFmtPageDesc* pNewPgDescFmt, + const SwPageDesc* pNewPgDesc ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + const SwSectionFmt* pFmt = GetSectionFormat( rNd ); + const ULONG nLnNm = GetSectionLineNo( pSet, rNd ); + + OSL_ENSURE( pNewPgDescFmt || pNewPgDesc, "Neither page desc format nor page desc provided." ); + + if ( pNewPgDescFmt ) + m_pSections->AppendSection( *pNewPgDescFmt, rNd, pFmt, nLnNm ); + else if ( pNewPgDesc ) + m_pSections->AppendSection( pNewPgDesc, rNd, pFmt, nLnNm ); + + AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() ); +} + +bool RtfExport::DisallowInheritingOutlineNumbering( const SwFmt& rFmt ) +{ + bool bRet( false ); + + OSL_TRACE("%s", OSL_THIS_FUNC); + + if (SFX_ITEM_SET != rFmt.GetItemState(RES_PARATR_NUMRULE, false)) + { + if (const SwFmt *pParent = rFmt.DerivedFrom()) + { + if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle()) + { + // Level 9 disables the outline + Strm() << OOO_STRING_SVTOOLS_RTF_LEVEL << 9; + + bRet = true; + } + } + } + + return bRet; +} + +void RtfExport::OutputGrfNode( const SwGrfNode& ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, see RtfAttributeOutput::FlyFrameGraphic */ +} + +void RtfExport::OutputOLENode( const SwOLENode& ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop, see RtfAttributeOutput::FlyFrameOLE */ +} + +void RtfExport::AppendSection( const SwPageDesc* pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_pSections->AppendSection( pPageDesc, pFmt, nLnNum ); + AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() ); +} + +RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter ) + : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ), + m_pFilter( pFilter ), + m_pWriter( pWriter ), + m_pAttrOutput( NULL ), + m_pSections( NULL ), + m_pSdrExport( NULL ), + eDefaultEncoding( + rtl_getTextEncodingFromWindowsCharset( + sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))), + eCurrentEncoding(eDefaultEncoding), + bRTFFlySyntax(false) +{ + // the attribute output for the document + m_pAttrOutput = new RtfAttributeOutput( *this ); + // that just causes problems for RTF + bSubstituteBullets = false; + // needed to have a complete font table + maFontHelper.bLoadAllFonts = true; + // the related SdrExport + m_pSdrExport = new RtfSdrExport( *this ); + + if (!m_pWriter) + m_pWriter = &m_pFilter->m_aWriter; +} + +RtfExport::~RtfExport() +{ + delete m_pAttrOutput, m_pAttrOutput = NULL; + delete m_pSdrExport, m_pSdrExport = NULL; +} + +SvStream& RtfExport::Strm() +{ + return m_pWriter->Strm(); +} + +SvStream& RtfExport::OutULong( ULONG nVal ) +{ + return m_pWriter->OutULong( Strm(), nVal ); +} + +SvStream& RtfExport::OutLong( long nVal ) +{ + return m_pWriter->OutLong( Strm(), nVal ); +} + +void RtfExport::OutUnicode(const sal_Char *pToken, const String &rContent) +{ + if (rContent.Len()) + { + Strm() << '{' << pToken << ' '; + Strm() << OutString( rContent, eCurrentEncoding ).getStr(); + Strm() << '}'; + } +} + +OString RtfExport::OutHex(ULONG nHex, BYTE nLen) +{ + sal_Char aNToABuf[] = "0000000000000000"; + + OSL_ENSURE( nLen < sizeof(aNToABuf), "nLen is too big" ); + if( nLen >= sizeof(aNToABuf) ) + nLen = (sizeof(aNToABuf)-1); + + // Set pointer to the buffer end + sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1); + for( BYTE n = 0; n < nLen; ++n ) + { + *(--pStr) = (sal_Char)(nHex & 0xf ) + 48; + if( *pStr > '9' ) + *pStr += 39; + nHex >>= 4; + } + return OString(pStr); +} + +OString RtfExport::OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc) +{ + OStringBuffer aBuf; + const sal_Char* pStr = 0; + // 0x0b instead of \n, etc because of the replacements in SwAttrIter::GetSnippet() + switch (c) + { + case 0x0b: + // hard line break + pStr = OOO_STRING_SVTOOLS_RTF_LINE; + break; + case '\t': + pStr = OOO_STRING_SVTOOLS_RTF_TAB; + break; + case '\\': + case '}': + case '{': + aBuf.append('\\'); + aBuf.append((sal_Char)c); + break; + case 0xa0: + // non-breaking space + pStr = "\\~"; + break; + case 0x1e: + // non-breaking hyphen + pStr = "\\_"; + break; + case 0x1f: + // optional hyphen + pStr = "\\-"; + break; + default: + if (c >= ' ' && c <= '~') + aBuf.append((sal_Char)c); + else { + //If we can't convert to the dest encoding, or if + //its an uncommon multibyte sequence which most + //readers won't be able to handle correctly, then + //If we can't convert to the dest encoding, then + //export as unicode + OUString sBuf(&c, 1); + OString sConverted; + sal_uInt32 nFlags = + RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR; + bool bWriteAsUnicode = !(sBuf.convertToString(&sConverted, + eDestEnc, nFlags)) + || (RTL_TEXTENCODING_UTF8==eDestEnc); // #i43933# do not export UTF-8 chars in RTF; + if (bWriteAsUnicode) + sBuf.convertToString(&sConverted, + eDestEnc, OUSTRING_TO_OSTRING_CVTFLAGS); + const sal_Int32 nLen = sConverted.getLength(); + + if (bWriteAsUnicode && pUCMode) + { + // then write as unicode - character + if (*pUCMode != nLen) + { + aBuf.append("\\uc"); + aBuf.append((sal_Int32)nLen); + // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored. + aBuf.append(' '); + *pUCMode = nLen; + } + aBuf.append("\\u"); + aBuf.append((sal_Int32)c); + } + + for (sal_Int32 nI = 0; nI < nLen; ++nI) + { + aBuf.append("\\'"); + aBuf.append(OutHex(sConverted.getStr()[nI], 2)); + } + } + } + if (pStr) { + aBuf.append(pStr); + aBuf.append(' '); + } + return aBuf.makeStringAndClear(); +} + +OString RtfExport::OutString(const String &rStr, rtl_TextEncoding eDestEnc) +{ + OSL_TRACE("%s, rStr = '%s'", OSL_THIS_FUNC, + OUStringToOString( OUString( rStr ), eCurrentEncoding ).getStr()); + OStringBuffer aBuf; + int nUCMode = 1; + for (xub_StrLen n = 0; n < rStr.Len(); ++n) + aBuf.append(OutChar(rStr.GetChar(n), &nUCMode, eDestEnc)); + if (nUCMode != 1) { + aBuf.append(OOO_STRING_SVTOOLS_RTF_UC); + aBuf.append((sal_Int32)1); + aBuf.append(" "); // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored.; + } + return aBuf.makeStringAndClear(); +} + +void RtfExport::OutDateTime(const sal_Char* pStr, const util::DateTime& rDT ) +{ + Strm() << '{' << pStr << OOO_STRING_SVTOOLS_RTF_YR; + OutULong( rDT.Year ) << OOO_STRING_SVTOOLS_RTF_MO; + OutULong( rDT.Month ) << OOO_STRING_SVTOOLS_RTF_DY; + OutULong( rDT.Day ) << OOO_STRING_SVTOOLS_RTF_HR; + OutULong( rDT.Hours ) << OOO_STRING_SVTOOLS_RTF_MIN; + OutULong( rDT.Minutes ) << '}'; +} + +USHORT RtfExport::GetColor( const Color& rColor ) const +{ + for (RtfColorTbl::const_iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ ) + if ((*it).second == rColor) { + OSL_TRACE("%s returning %d (%d,%d,%d)", OSL_THIS_FUNC, (*it).first, rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue()); + return (*it).first; + } + OSL_ENSURE( FALSE, "No such Color in m_aColTbl!" ); + return 0; +} + +void RtfExport::InsColor( const Color& rCol ) +{ + USHORT n; + for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ ) + if ((*it).second == rCol) + return; // Already in the table + if (rCol.GetColor() == COL_AUTO) + n = 0; + else + { + n = m_aColTbl.size(); + // Fix for the case when first a !COL_AUTO gets inserted as #0, then + // gets overwritten by COL_AUTO + if (!n) + n++; + } + m_aColTbl.insert(std::pair( n, rCol )); +} + +void RtfExport::InsColorLine( const SvxBoxItem& rBox ) +{ + const SvxBorderLine* pLine = 0; + + if( rBox.GetTop() ) + InsColor( (pLine = rBox.GetTop())->GetColor() ); + if( rBox.GetBottom() && pLine != rBox.GetBottom() ) + InsColor( (pLine = rBox.GetBottom())->GetColor() ); + if( rBox.GetLeft() && pLine != rBox.GetLeft() ) + InsColor( (pLine = rBox.GetLeft())->GetColor() ); + if( rBox.GetRight() && pLine != rBox.GetRight() ) + InsColor( rBox.GetRight()->GetColor() ); +} +void RtfExport::OutColorTable() +{ + // Build the table from rPool since the colors provided to + // RtfAttributeOutput callbacks are too late. + USHORT n, nMaxItem; + const SfxItemPool& rPool = pDoc->GetAttrPool(); + + // char color + { + const SvxColorItem* pCol = (const SvxColorItem*)GetDfltAttr( + RES_CHRATR_COLOR ); + InsColor( pCol->GetValue() ); + if( 0 != ( pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem( + RES_CHRATR_COLOR ) )) + InsColor( pCol->GetValue() ); + nMaxItem = rPool.GetItemCount(RES_CHRATR_COLOR); + for( n = 0; n < nMaxItem; ++n ) + { + if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem( + RES_CHRATR_COLOR, n ) ) ) + InsColor( pCol->GetValue() ); + } + + const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE ); + InsColor( pUnder->GetColor() ); + nMaxItem = rPool.GetItemCount(RES_CHRATR_UNDERLINE); + for( n = 0; n < nMaxItem;n++) + { + if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem( RES_CHRATR_UNDERLINE, n ) ) ) + InsColor( pUnder->GetColor() ); + + } + + const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE ); + InsColor( pOver->GetColor() ); + nMaxItem = rPool.GetItemCount(RES_CHRATR_OVERLINE); + for( n = 0; n < nMaxItem;n++) + { + if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem( RES_CHRATR_OVERLINE, n ) ) ) + InsColor( pOver->GetColor() ); + + } + + } + + // background color + static const USHORT aBrushIds[] = { + RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 }; + + for( const USHORT* pIds = aBrushIds; *pIds; ++pIds ) + { + const SvxBrushItem* pBkgrd = (const SvxBrushItem*)GetDfltAttr( *pIds ); + InsColor( pBkgrd->GetColor() ); + if( 0 != ( pBkgrd = (const SvxBrushItem*)rPool.GetPoolDefaultItem( + *pIds ) )) + { + InsColor( pBkgrd->GetColor() ); + } + nMaxItem = rPool.GetItemCount( *pIds ); + for( n = 0; n < nMaxItem; ++n ) + if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem( + *pIds , n ) )) + { + InsColor( pBkgrd->GetColor() ); + } + } + + // shadow color + { + const SvxShadowItem* pShadow = (const SvxShadowItem*)GetDfltAttr( + RES_SHADOW ); + InsColor( pShadow->GetColor() ); + if( 0 != ( pShadow = (const SvxShadowItem*)rPool.GetPoolDefaultItem( + RES_SHADOW ) )) + { + InsColor( pShadow->GetColor() ); + } + nMaxItem = rPool.GetItemCount(RES_SHADOW); + for( n = 0; n < nMaxItem; ++n ) + if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem( + RES_SHADOW, n ) ) ) + { + InsColor( pShadow->GetColor() ); + } + } + + // frame border color + { + const SvxBoxItem* pBox; + if( 0 != ( pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem( + RES_BOX ) )) + InsColorLine( *pBox ); + nMaxItem = rPool.GetItemCount(RES_BOX); + for( n = 0; n < nMaxItem; ++n ) + if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem( RES_BOX, n ) )) + InsColorLine( *pBox ); + } + + for( n = 0; n < m_aColTbl.size(); n++ ) + { + const Color& rCol = m_aColTbl[ n ]; + if( n || COL_AUTO != rCol.GetColor() ) + { + Strm() << OOO_STRING_SVTOOLS_RTF_RED; + OutULong( rCol.GetRed() ) << OOO_STRING_SVTOOLS_RTF_GREEN; + OutULong( rCol.GetGreen() ) << OOO_STRING_SVTOOLS_RTF_BLUE; + OutULong( rCol.GetBlue() ); + } + Strm() << ';'; + } +} + +void RtfExport::InsStyle( USHORT nId, const OString& rStyle ) +{ + m_aStyTbl.insert(std::pair(nId, rStyle) ); +} + +OString* RtfExport::GetStyle( USHORT nId ) +{ + std::map::iterator i = m_aStyTbl.find(nId); + if (i != m_aStyTbl.end()) + return &i->second; + return NULL; +} + +USHORT RtfExport::GetRedline( const String& rAuthor ) +{ + std::map::iterator i = m_aRedlineTbl.find(rAuthor); + if (i != m_aRedlineTbl.end()) + return i->second; + else + { + int nId = m_aRedlineTbl.size(); + m_aRedlineTbl.insert(std::pair(rAuthor,nId)); + return nId; + } +} + +void RtfExport::OutContent( const SwNode& rNode ) +{ + OutputContentNode(*rNode.GetCntntNode()); +} + +void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage ) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + const SwPageDesc *pSave = pAktPageDesc; + + pAktPageDesc = &rPgDsc; + if( bCheckForFirstPage && pAktPageDesc->GetFollow() && + pAktPageDesc->GetFollow() != pAktPageDesc ) + pAktPageDesc = pAktPageDesc->GetFollow(); + + if( bWriteReset ) + { + if( pCurPam->GetPoint()->nNode == pOrigPam->Start()->nNode ) + Strm() << OOO_STRING_SVTOOLS_RTF_SECTD << OOO_STRING_SVTOOLS_RTF_SBKNONE; + else + Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SECTD; + } + + if( pAktPageDesc->GetLandscape() ) + Strm() << OOO_STRING_SVTOOLS_RTF_LNDSCPSXN; + + const SwFmt *pFmt = &pAktPageDesc->GetMaster(); //GetLeft(); + bOutPageDescs = true; + OutputFormat(*pFmt, true, false); + bOutPageDescs = false; + + // normal header / footer (without a style) + const SfxPoolItem* pItem; + if( pAktPageDesc->GetLeft().GetAttrSet().GetItemState( RES_HEADER, FALSE, + &pItem ) == SFX_ITEM_SET) + WriteHeaderFooter(*pItem, true); + if( pAktPageDesc->GetLeft().GetAttrSet().GetItemState( RES_FOOTER, FALSE, + &pItem ) == SFX_ITEM_SET) + WriteHeaderFooter(*pItem, false); + + // title page + if( pAktPageDesc != &rPgDsc ) + { + pAktPageDesc = &rPgDsc; + if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_HEADER, + FALSE, &pItem ) == SFX_ITEM_SET ) + WriteHeaderFooter(*pItem, true); + if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_FOOTER, + FALSE, &pItem ) == SFX_ITEM_SET ) + WriteHeaderFooter(*pItem, false); + } + + // numbering type + AttrOutput().SectionPageNumbering(pAktPageDesc->GetNumType().GetNumberingType(), 0); + + pAktPageDesc = pSave; + //bOutPageDesc = bOldOut; + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader) +{ + if (bHeader) + { + const SwFmtHeader& rHeader = (const SwFmtHeader&)rItem; + if (!rHeader.IsActive()) + return; + } + else + { + const SwFmtFooter& rFooter = (const SwFmtFooter&)rItem; + if (!rFooter.IsActive()) + return; + } + + OSL_TRACE("%s start", OSL_THIS_FUNC); + + Strm() << (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERY : OOO_STRING_SVTOOLS_RTF_FOOTERY); + OutLong( pAktPageDesc->GetMaster(). + GetULSpace().GetUpper() ); + const sal_Char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER); + /* is this a title page? */ + if( pAktPageDesc->GetFollow() && pAktPageDesc->GetFollow() != pAktPageDesc ) + { + Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG; + pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERF : OOO_STRING_SVTOOLS_RTF_FOOTERF); + } + Strm() << '{' << pStr; + WriteHeaderFooterText(pAktPageDesc->GetMaster(), bHeader); + Strm() << '}'; + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + m_pAttrOutput->WriteHeaderFooter_Impl( rFmt, bHeader, pStr ); + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +class SwRTFWriter : public Writer +{ + public: + SwRTFWriter( const String& rFilterName, const String& rBaseURL ); + virtual ~SwRTFWriter(); + virtual ULONG WriteStream(); +}; + +SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + SetBaseURL( rBaseURL ); +} + +SwRTFWriter::~SwRTFWriter() +{} + +ULONG SwRTFWriter::WriteStream() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this ); + aExport.ExportDocument( true ); + return 0; +} + +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportRTF( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + xRet = new SwRTFWriter( rFltName, rBaseURL ); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx new file mode 100644 index 000000000000..0a2f3f4d0b91 --- /dev/null +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFEXPORT_HXX_ +#define _RTFEXPORT_HXX_ + +#include +#include "rtfattributeoutput.hxx" +#include "wrtww8.hxx" + +#include + +#include +#include + +class RtfExportFilter; +class RtfSdrExport; +typedef std::map RtfColorTbl; +typedef std::map RtfStyleTbl; +typedef std::map RtfRedlineTbl; +class SwNode; +class SwEndNode; +class SwTableNode; +class SwTxtNode; +class SwGrfNode; +class SwOLENode; +class SwSectionNode; +class SwNumRuleTbl; + +namespace com { namespace sun { namespace star { + namespace frame { class XModel; } +} } } + +/// The class that does all the actual RTF export-related work. +class RtfExport : public MSWordExportBase +{ + /// Pointer to the filter that owns us. + RtfExportFilter *m_pFilter; + Writer* m_pWriter; + + /// Attribute output for document. + RtfAttributeOutput *m_pAttrOutput; + + /// Sections/headers/footers + MSWordSections *m_pSections; + + RtfSdrExport *m_pSdrExport; + +public: + /// Access to the attribute output class. + virtual AttributeOutputBase& AttrOutput() const; + + /// Access to the sections/headers/footres. + virtual MSWordSections& Sections() const; + + /// Access to the Rtf Sdr exporter. + virtual RtfSdrExport& SdrExporter() const; + + /// Hack, unfortunately necessary at some places for now. + virtual bool HackIsWW8OrHigher() const { return true; } + + /// Guess the script (asian/western). + virtual bool CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich ); + + virtual void AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ); + + virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false ); + + virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) { /* no-op for rtf, most probably should not even be in MSWordExportBase */ } + virtual void WriteChar( sal_Unicode ); + + /// Write the numbering table. + virtual void WriteNumbering(); + + /// Write the revision table. + virtual void WriteRevTab(); + + /// Output the actual headers and footers. + virtual void WriteHeadersFooters( BYTE nHeadFootFlags, + const SwFrmFmt& rFmt, const SwFrmFmt& rLeftFmt, const SwFrmFmt& rFirstPageFmt, BYTE nBreakCode ); + + /// Write the field + virtual void OutputField( const SwField* pFld, ww::eField eFldType, + const String& rFldCmd, BYTE nMode = nsFieldFlags::WRITEFIELD_ALL ); + + /// Write the data of the form field + virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ); + virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark ); + + virtual void DoComboBox(const rtl::OUString &rName, + const rtl::OUString &rHelp, + const rtl::OUString &ToolTip, + const rtl::OUString &rSelected, + com::sun::star::uno::Sequence &rListItems); + + virtual void DoFormText(const SwInputField * pFld); + + virtual ULONG ReplaceCr( BYTE nChar ); + +protected: + /// Format-dependant part of the actual export. + virtual void ExportDocument_Impl(); + + virtual void SectionBreaksAndFrames( const SwTxtNode& /*rNode*/ ) {} + + /// Get ready for a new section. + virtual void PrepareNewPageDesc( const SfxItemSet* pSet, + const SwNode& rNd, + const SwFmtPageDesc* pNewPgDescFmt = 0, + const SwPageDesc* pNewPgDesc = 0 ); + + /// Return value indicates if an inherited outline numbering is suppressed. + virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt); + + /// Output SwGrfNode + virtual void OutputGrfNode( const SwGrfNode& ); + + /// Output SwOLENode + virtual void OutputOLENode( const SwOLENode& ); + + virtual void AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum ); + +public: + /// Pass the pDocument, pCurrentPam and pOriginalPam to the base class. + RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, + SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter ); + + /// Destructor. + virtual ~RtfExport(); + +#if defined(UNX) + static const sal_Char sNewLine; // \012 or \015 +#else + static const sal_Char __FAR_DATA sNewLine[]; // \015\012 +#endif + + rtl_TextEncoding eDefaultEncoding; + rtl_TextEncoding eCurrentEncoding; + /// This is used by OutputFlyFrame_Impl() to control the written syntax + bool bRTFFlySyntax; + + BOOL m_bOutStyleTab : 1; + SvStream& Strm(); + SvStream& OutULong( ULONG nVal ); + SvStream& OutLong( long nVal ); + void OutUnicode(const sal_Char *pToken, const String &rContent); + void OutDateTime(const sal_Char* pStr, const util::DateTime& rDT ); + rtl::OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc); + rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc); + rtl::OString OutHex(ULONG nHex, BYTE nLen); + void OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage ); + void OutContent( const SwNode& rNode ); + + USHORT GetColor( const Color& rColor ) const; + void InsColor( const Color& rCol ); + void InsColorLine( const SvxBoxItem& rBox ); + void OutColorTable(); + USHORT GetRedline( const String& rAuthor ); + + void InsStyle( USHORT nId, const rtl::OString& rStyle ); + rtl::OString* GetStyle( USHORT nId ); + +private: + /// No copying. + RtfExport( const RtfExport& ); + + /// No copying. + RtfExport& operator=( const RtfExport& ); + + void WriteFonts(); + void WriteStyles(); + void WriteMainText(); + void WriteInfo(); + /// Writes the writer-specific \pgdsctbl group. + void WritePageDescTable(); + /// This is necessary to have the numbering table ready before the main text is being processed. + void BuildNumbering(); + void WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader); + void WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_Char* pStr); + + RtfColorTbl m_aColTbl; + RtfStyleTbl m_aStyTbl; + RtfRedlineTbl m_aRedlineTbl; +}; + +#endif // _RTFEXPORT_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx new file mode 100644 index 000000000000..df680e4264c8 --- /dev/null +++ b/sw/source/filter/ww8/rtfexportfilter.cxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +using namespace ::comphelper; +using namespace ::com::sun::star; +using ::rtl::OUString; + +RtfExportFilter::RtfExportFilter( const uno::Reference< lang::XMultiServiceFactory >& xMSF) : + m_xMSF( xMSF ) +{ +} + +RtfExportFilter::~RtfExportFilter() +{ +} + +sal_Bool RtfExportFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) + throw (uno::RuntimeException) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + MediaDescriptor aMediaDesc = aDescriptor; + ::uno::Reference< io::XStream > xStream = + aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_STREAMFOROUTPUT(), uno::Reference< io::XStream >() ); + m_pStream = utl::UcbStreamHelper::CreateStream( xStream, sal_True ); + m_aWriter.SetStream(m_pStream); + + // get SwDoc* + uno::Reference< uno::XInterface > xIfc( m_xSrcDoc, uno::UNO_QUERY ); + SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() ); + if ( !pTxtDoc ) { + return sal_False; + } + + SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc(); + if ( !pDoc ) { + return sal_False; + } + + // get SwPaM* + // we get SwPaM for the entire document; copy&paste is handled internally, not via UNO + SwPaM aPam( pDoc->GetNodes().GetEndOfContent() ); + aPam.SetMark(); + aPam.Move( fnMoveBackward, fnGoDoc ); + + SwPaM *pCurPam = new SwPaM( *aPam.End(), *aPam.Start() ); + + // export the document + // (in a separate block so that it's destructed before the commit) + { + RtfExport aExport( this, pDoc, pCurPam, &aPam, NULL ); + aExport.ExportDocument( true ); + } + + // delete the pCurPam + if ( pCurPam ) + { + while ( pCurPam->GetNext() != pCurPam ) + delete pCurPam->GetNext(); + delete pCurPam; + } + delete m_pStream; + + return sal_True; +} + + +void RtfExportFilter::cancel( ) throw (uno::RuntimeException) +{ +} + +void RtfExportFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xSrcDoc = xDoc; +} + +////////////////////////////////////////////////////////////////////////// +// UNO helpers +////////////////////////////////////////////////////////////////////////// + +OUString RtfExport_getImplementationName() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFEXPORT ) ); +} + +uno::Sequence< OUString > SAL_CALL RtfExport_getSupportedServiceNames() throw() +{ + const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL RtfExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +{ + return (cppu::OWeakObject*) new RtfExportFilter( rSMgr ); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexportfilter.hxx b/sw/source/filter/ww8/rtfexportfilter.hxx new file mode 100644 index 000000000000..98f102217d58 --- /dev/null +++ b/sw/source/filter/ww8/rtfexportfilter.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFEXPORTFILTER_HXX_ +#define _RTFEXPORTFILTER_HXX_ + +#include +#include +#include +#include +#include +#include + +// This is just here so that we don't have to copy&paste its string format methods +class RtfWriter : public Writer +{ +protected: + ULONG WriteStream() { return 0; } +}; + +/// The physical access to the RTF document (for writing). +class RtfExportFilter : public cppu::WeakImplHelper2 +< + com::sun::star::document::XFilter, + com::sun::star::document::XExporter +> +{ +protected: + ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xSrcDoc; + SvStream* m_pStream; +public: + RtfExportFilter( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); + virtual ~RtfExportFilter(); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XExporter + virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + RtfWriter m_aWriter; +}; + +::rtl::OUString RtfExport_getImplementationName(); +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfExport_getSupportedServiceNames() + throw(); +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfExport_createInstance( + const ::com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > &xMSF) + throw( ::com::sun::star::uno::Exception ); + +#define IMPL_NAME_RTFEXPORT "com.sun.star.comp.Writer.RtfExport" + +#endif // _RTFEXPORTFILTER_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfimportfilter.cxx b/sw/source/filter/ww8/rtfimportfilter.cxx new file mode 100644 index 000000000000..7261e5734bd0 --- /dev/null +++ b/sw/source/filter/ww8/rtfimportfilter.cxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfimportfilter.hxx" +#include "../rtf/swparrtf.hxx" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +using namespace ::comphelper; +using namespace ::com::sun::star; +using ::rtl::OUString; +using rtl::OUStringToOString; + +RtfImportFilter::RtfImportFilter( const uno::Reference< lang::XMultiServiceFactory >& xMSF) : + m_xMSF( xMSF ) +{ +} + +RtfImportFilter::~RtfImportFilter() +{ +} + +sal_Bool RtfImportFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) + throw (uno::RuntimeException) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + MediaDescriptor aMediaDesc = aDescriptor; + ::uno::Reference< io::XInputStream > xInputStream = + aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_INPUTSTREAM(), uno::Reference< io::XInputStream >() ); + SvStream* pStream = utl::UcbStreamHelper::CreateStream( xInputStream, sal_True ); + if (!pStream) + return sal_False; + + // get SwDoc* + uno::Reference< uno::XInterface > xIfc( m_xDstDoc, uno::UNO_QUERY ); + SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() ); + if (!pTxtDoc) + return sal_False; + SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc(); + if (!pDoc) + return sal_False; + + // get SwPaM* + // NEEDSWORK should we care about partial imports? For now we just import + // the whole document + SwPaM aPam( pDoc->GetNodes().GetEndOfContent() ); + aPam.SetMark(); + aPam.Move( fnMoveBackward, fnGoDoc ); + SwPaM *pCurPam = new SwPaM( *aPam.End(), *aPam.Start() ); + + String aURL; + OUString sTemp; + for ( sal_Int32 i = 0; i < aDescriptor.getLength(); i++ ) + { + if( aDescriptor[i].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ) + { + aDescriptor[i].Value >>= sTemp; + aURL = sTemp; + } + } + + RtfReader aReader; + return aReader.Read(pStream, *pDoc, aURL, *pCurPam) == 0; +} + + +void RtfImportFilter::cancel( ) throw (uno::RuntimeException) +{ +} + +void RtfImportFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + m_xDstDoc = xDoc; +} + +////////////////////////////////////////////////////////////////////////// +// UNO helpers +////////////////////////////////////////////////////////////////////////// + +OUString RtfImport_getImplementationName() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFIMPORT ) ); +} + +uno::Sequence< OUString > SAL_CALL RtfImport_getSupportedServiceNames() throw() +{ + const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ImportFilter" ) ); + const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL RtfImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +{ + return (cppu::OWeakObject*) new RtfImportFilter( rSMgr ); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfimportfilter.hxx b/sw/source/filter/ww8/rtfimportfilter.hxx new file mode 100644 index 000000000000..6f6d84d1bf1d --- /dev/null +++ b/sw/source/filter/ww8/rtfimportfilter.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFIMPORTFILTER_HXX_ +#define _RTFIMPORTFILTER_HXX_ + +#include +#include +#include +#include +#include +#include + +/// The physical access to the RTF document (for reading). +class RtfImportFilter : public cppu::WeakImplHelper2 +< + com::sun::star::document::XFilter, + com::sun::star::document::XImporter +> +{ +protected: + ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xDstDoc; +public: + RtfImportFilter( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); + virtual ~RtfImportFilter(); + + // XFilter + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ) + throw (::com::sun::star::uno::RuntimeException); + + // XImporter + virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); +}; + +::rtl::OUString RtfImport_getImplementationName(); +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfImport_getSupportedServiceNames() + throw(); +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfImport_createInstance( + const ::com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > &xMSF) + throw( ::com::sun::star::uno::Exception ); + +#define IMPL_NAME_RTFIMPORT "com.sun.star.comp.Writer.RtfImport" + +#endif // _RTFIMPORTFILTER_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx new file mode 100644 index 000000000000..a2def60f4859 --- /dev/null +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -0,0 +1,577 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "rtfsdrexport.hxx" +#include "rtfexport.hxx" +#include "writerhelper.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using rtl::OString; +using rtl::OStringBuffer; +using rtl::OUString; +using rtl::OUStringBuffer; +using namespace sw::util; + +/// Implementation of an empty stream that silently succeeds, but does nothing. +/// +/// In fact, this is a hack. The right solution is to abstract EscherEx to be +/// able to work without SvStream; but at the moment it is better to live with +/// this I guess. +class SvNullStream : public SvStream +{ +protected: + virtual sal_Size GetData( void* pData, sal_Size nSize ) { memset( pData, 0, nSize ); return nSize; } + virtual sal_Size PutData( const void*, sal_Size nSize ) { return nSize; } + virtual sal_Size SeekPos( sal_Size nPos ) { return nPos; } + virtual void SetSize( sal_Size ) {} + virtual void FlushData() {} + +public: + SvNullStream() : SvStream() {} + virtual ~SvNullStream() {} +}; + +RtfSdrExport::RtfSdrExport( RtfExport &rExport ) + : EscherEx( EscherExGlobalRef( new EscherExGlobal ), *( new SvNullStream )), + m_rExport( rExport ), + m_rAttrOutput( (RtfAttributeOutput&)m_rExport.AttrOutput() ), + m_nShapeType( ESCHER_ShpInst_Nil ), + m_pShapeStyle( new OStringBuffer( 200 ) ), + m_pShapeTypeWritten( new bool[ ESCHER_ShpInst_COUNT ] ) +{ + mnGroupLevel = 1; + memset( m_pShapeTypeWritten, 0, ESCHER_ShpInst_COUNT * sizeof( bool ) ); +} + +RtfSdrExport::~RtfSdrExport() +{ + delete mpOutStrm, mpOutStrm = NULL; + delete m_pShapeStyle, m_pShapeStyle = NULL; + delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL; +} + +void RtfSdrExport::OpenContainer( UINT16 nEscherContainer, int nRecInstance ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + EscherEx::OpenContainer( nEscherContainer, nRecInstance ); + + if ( nEscherContainer == ESCHER_SpContainer ) + { + m_nShapeType = ESCHER_ShpInst_Nil; + if ( m_pShapeStyle->getLength() ) + m_pShapeStyle->makeStringAndClear(); + m_pShapeStyle->ensureCapacity( 200 ); + m_aShapeProps.clear(); + } +} + +void RtfSdrExport::CloseContainer() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( mRecTypes.back() == ESCHER_SpContainer ) + { + // write the shape now when we have all the info + sal_Int32 nShapeElement = StartShape(); + EndShape( nShapeElement ); + + // cleanup + m_nShapeType = ESCHER_ShpInst_Nil; + } + + EscherEx::CloseContainer(); +} + +UINT32 RtfSdrExport::EnterGroup( const String& /*rShapeName*/, const Rectangle* /*pRect*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + return GenerateShapeId(); +} + +void RtfSdrExport::LeaveGroup() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +void RtfSdrExport::AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 /*nShapeId*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + m_nShapeType = nShapeType; + m_nShapeFlags = nShapeFlags; +} + +inline sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal ) +{ + sal_uInt16 nRet = *pVal++; + nRet += ( *pVal++ ) << 8; + return nRet; +} + +inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPointSize ) +{ + sal_Int32 nRet = 0; + if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) ) + { + sal_uInt16 nUnsigned = *pVal++; + nUnsigned += ( *pVal++ ) << 8; + + nRet = sal_Int16( nUnsigned ); + } + else if ( nPointSize == 8 ) + { + sal_uInt32 nUnsigned = *pVal++; + nUnsigned += ( *pVal++ ) << 8; + nUnsigned += ( *pVal++ ) << 16; + nUnsigned += ( *pVal++ ) << 24; + + nRet = nUnsigned; + } + + return nRet; +} + +void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_nShapeType == ESCHER_ShpInst_Nil ) + return; + + if ( m_nShapeType == ESCHER_ShpInst_Line ) + AddLineDimensions( rRect ); + else + AddRectangleDimensions( *m_pShapeStyle, rRect ); + + // properties + const EscherProperties &rOpts = rProps.GetOpts(); + for ( EscherProperties::const_iterator it = rOpts.begin(); it != rOpts.end(); ++it ) + { + sal_uInt16 nId = ( it->nPropId & 0x0FFF ); + + switch ( nId ) + { + case ESCHER_Prop_WrapText: + { + int nWrapType = 0; + switch ( it->nPropValue ) + { + case ESCHER_WrapSquare: nWrapType = 2; break; + case ESCHER_WrapByPoints: nWrapType = 4; break; + case ESCHER_WrapNone: nWrapType = 3; break; + case ESCHER_WrapTopBottom: nWrapType = 1; break; + case ESCHER_WrapThrough: nWrapType = 5; break; + } + if ( nWrapType ) + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPWR).append((sal_Int32)nWrapType); + } + break; + case ESCHER_Prop_fillColor: + m_aShapeProps.insert(std::pair(OString("fillColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_fillBackColor: + m_aShapeProps.insert(std::pair(OString("fillBackColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_AnchorText: + m_aShapeProps.insert(std::pair(OString("anchorText"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_fNoFillHitTest: + if (it->nPropValue) + m_aShapeProps.insert(std::pair(OString("fNoFillHitTest"), OString::valueOf(sal_Int32(1)))); + break; + case ESCHER_Prop_fNoLineDrawDash: + if (it->nPropValue) + m_aShapeProps.insert(std::pair(OString("fNoLineDrawDash"), OString::valueOf(sal_Int32(1)))); + break; + case ESCHER_Prop_lineColor: + m_aShapeProps.insert(std::pair(OString("lineColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_lineBackColor: + m_aShapeProps.insert(std::pair(OString("lineBackColor"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_lineJoinStyle: + m_aShapeProps.insert(std::pair(OString("lineJoinStyle"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_fshadowObscured: + if (it->nPropValue) + m_aShapeProps.insert(std::pair(OString("fshadowObscured"), OString::valueOf(sal_Int32(1)))); + break; + case ESCHER_Prop_geoLeft: + case ESCHER_Prop_geoTop: + { + sal_uInt32 nLeft = 0, nTop = 0; + + if ( nId == ESCHER_Prop_geoLeft ) + { + nLeft = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoTop, nTop ); + } + else + { + nTop = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft ); + } + + m_aShapeProps.insert(std::pair(OString("geoLeft"), + OString::valueOf(sal_Int32(sal_Int32( nLeft ))))); + m_aShapeProps.insert(std::pair(OString("geoTop"), + OString::valueOf(sal_Int32(sal_Int32( nTop ))))); + } + break; + + case ESCHER_Prop_geoRight: + case ESCHER_Prop_geoBottom: + { + sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0; + rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft ); + rProps.GetOpt( ESCHER_Prop_geoTop, nTop ); + + if ( nId == ESCHER_Prop_geoRight ) + { + nRight = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoBottom, nBottom ); + } + else + { + nBottom = it->nPropValue; + rProps.GetOpt( ESCHER_Prop_geoRight, nRight ); + } + + m_aShapeProps.insert(std::pair(OString("geoRight"), + OString::valueOf(sal_Int32(sal_Int32( nRight ) - sal_Int32( nLeft ))))); + m_aShapeProps.insert(std::pair(OString("geoBottom"), + OString::valueOf(sal_Int32(sal_Int32( nBottom ) - sal_Int32( nTop ))))); + } + break; + case ESCHER_Prop_pVertices: + case ESCHER_Prop_pSegmentInfo: + { + EscherPropSortStruct aVertices; + EscherPropSortStruct aSegments; + + if ( rProps.GetOpt( ESCHER_Prop_pVertices, aVertices ) && + rProps.GetOpt( ESCHER_Prop_pSegmentInfo, aSegments ) ) + { + const sal_uInt8 *pVerticesIt = aVertices.pBuf + 6; + const sal_uInt8 *pSegmentIt = aSegments.pBuf; + + OStringBuffer aSegmentInfo( 512 ); + OStringBuffer aVerticies( 512 ); + + sal_uInt16 nPointSize = aVertices.pBuf[4] + ( aVertices.pBuf[5] << 8 ); + + // number of segments + sal_uInt16 nSegments = impl_GetUInt16( pSegmentIt ); + sal_Int32 nVertices = 0; + aSegmentInfo.append("2;").append((sal_Int32)nSegments); + pSegmentIt += 4; + + for ( ; nSegments; --nSegments ) + { + sal_uInt16 nSeg = impl_GetUInt16( pSegmentIt ); + aSegmentInfo.append(';').append((sal_Int32)nSeg); + switch ( nSeg ) + { + case 0x0001: // lineto + case 0x4000: // moveto + { + sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize ); + aVerticies.append( ";(" ).append( nX ).append( "," ).append( nY ).append( ")" ); + nVertices ++; + } + break; + case 0x2001: // curveto + { + for (int i = 0; i < 3; i++) + { + sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize ); + aVerticies.append( ";(" ).append( nX ).append( "," ).append( nY ).append( ")" ); + nVertices ++; + } + } + break; + case 0xb300: + case 0xac00: + case 0xaa00: // nofill + case 0xab00: // nostroke + case 0x6001: // close + case 0x8000: // end + break; + default: + OSL_TRACE("%s: unhandled segment '%x' in the path", OSL_THIS_FUNC, nSeg); + break; + } + } + + if (aVerticies.getLength() ) + { + // We know the number of vertices at the end only, so we have to prepend them here. + OStringBuffer aBuf; + aBuf.append("8;").append((sal_Int32)nVertices); + aBuf.append(aVerticies.makeStringAndClear()); + m_aShapeProps.insert(std::pair(OString("pVerticies"), aBuf.makeStringAndClear())); + } + if ( aSegmentInfo.getLength() ) + m_aShapeProps.insert(std::pair(OString("pSegmentInfo"), aSegmentInfo.makeStringAndClear())); + } + else + OSL_TRACE("%s: unhandled shape path, missing either pVertices or pSegmentInfo", OSL_THIS_FUNC); + } + break; + case ESCHER_Prop_shapePath: + // noop, we use pSegmentInfo instead + break; + case ESCHER_Prop_fFillOK: + if (!it->nPropValue) + m_aShapeProps.insert(std::pair(OString("fFillOK"), OString::valueOf(sal_Int32(0)))); + break; + case ESCHER_Prop_dxTextLeft: + m_aShapeProps.insert(std::pair(OString("dxTextLeft"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_dyTextTop: + m_aShapeProps.insert(std::pair(OString("dyTextTop"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_dxTextRight: + m_aShapeProps.insert(std::pair(OString("dxTextRight"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_dyTextBottom: + m_aShapeProps.insert(std::pair(OString("dyTextBottom"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_FitTextToShape: + // Size text to fit shape size: not supported by RTF + break; + case ESCHER_Prop_adjustValue: + m_aShapeProps.insert(std::pair(OString("adjustValue"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + case ESCHER_Prop_txflTextFlow: + m_aShapeProps.insert(std::pair(OString("txflTextFlow"), OString::valueOf(sal_Int32(it->nPropValue)))); + break; + default: + OSL_TRACE("%s: unhandled property: %d (value: %d)", OSL_THIS_FUNC, nId, it->nPropValue); + break; + } + } +} + +void RtfSdrExport::AddLineDimensions( const Rectangle& rRectangle ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // We get the position relative to (the current?) character + m_aShapeProps.insert(std::pair(OString("posrelh"), OString::valueOf(sal_Int32(3)))); + + switch ( m_nShapeFlags & 0xC0 ) + { + case 0x40: + m_aShapeProps.insert(std::pair(OString("fFlipV"), OString::valueOf(sal_Int32(1)))); + break; + case 0x80: + m_aShapeProps.insert(std::pair(OString("fFlipH"), OString::valueOf(sal_Int32(1)))); + break; + case 0xC0: + m_aShapeProps.insert(std::pair(OString("fFlipV"), OString::valueOf(sal_Int32(1)))); + m_aShapeProps.insert(std::pair(OString("fFlipH"), OString::valueOf(sal_Int32(1)))); + break; + } + + // the actual dimensions + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left()); + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top()); + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right()); + m_pShapeStyle->append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom()); +} + +void RtfSdrExport::AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + // We get the position relative to (the current?) character + m_aShapeProps.insert(std::pair(OString("posrelh"), OString::valueOf(sal_Int32(3)))); + + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPLEFT).append(rRectangle.Left()); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPTOP).append(rRectangle.Top()); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPRIGHT).append(rRectangle.Right()); + rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom()); +} + +void RtfSdrExport::AddShapeAttribute( sal_Int32 /*nAttribute*/, const rtl::OString& /*rValue*/ ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + /* noop */ +} + +extern const char* pShapeTypes[]; + +sal_Int32 RtfSdrExport::StartShape() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( m_nShapeType == ESCHER_ShpInst_Nil ) + return -1; + + m_aShapeProps.insert(std::pair(OString("shapeType"), OString::valueOf(sal_Int32(m_nShapeType)))); + + m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHP); + m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_IGNORE).append(OOO_STRING_SVTOOLS_RTF_SHPINST); + + m_rAttrOutput.RunText().append(m_pShapeStyle->makeStringAndClear()); + // Ignore \shpbxpage, \shpbxmargin, and \shpbxcolumn, in favor of the posrelh property. + m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE); + // Ignore \shpbypage, \shpbymargin, and \shpbycolumn, in favor of the posrelh property. + m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE); + + for(std::map::reverse_iterator i = m_aShapeProps.rbegin(); i != m_aShapeProps.rend(); i++) + m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SP) + .append('{').append(OOO_STRING_SVTOOLS_RTF_SN " ").append((*i).first).append('}') + .append('{').append(OOO_STRING_SVTOOLS_RTF_SV " ").append((*i).second).append('}') + .append('}'); + + // now check if we have some text + const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject); + if (pTxtObj) + { + const OutlinerParaObject* pParaObj = 0; + bool bOwnParaObj = false; + + /* + #i13885# + When the object is actively being edited, that text is not set into + the objects normal text object, but lives in a seperate object. + */ + if (pTxtObj->IsTextEditActive()) + { + pParaObj = pTxtObj->GetEditOutlinerParaObject(); + bOwnParaObj = true; + } + else + { + pParaObj = pTxtObj->GetOutlinerParaObject(); + } + + if( pParaObj ) + { + // this is reached only in case some text is attached to the shape + WriteOutliner(*pParaObj); + if( bOwnParaObj ) + delete pParaObj; + } + } + + return m_nShapeType; +} + +void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj) +{ + OSL_TRACE("%s start", OSL_THIS_FUNC); + + const EditTextObject& rEditObj = rParaObj.GetTextObject(); + MSWord_SdrAttrIter aAttrIter( m_rExport, rEditObj, TXT_HFTXTBOX ); + + USHORT nPara = rEditObj.GetParagraphCount(); + + m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHPTXT).append(' '); + for (USHORT n = 0; n < nPara; ++n) + { + if( n ) + aAttrIter.NextPara( n ); + + rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet(); + + String aStr( rEditObj.GetText( n )); + xub_StrLen nAktPos = 0; + xub_StrLen nEnd = aStr.Len(); + + aAttrIter.OutParaAttr(false); + m_rAttrOutput.RunText().append(m_rAttrOutput.Styles().makeStringAndClear()); + + do { + xub_StrLen nNextAttr = aAttrIter.WhereNext(); + rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet(); + + if( nNextAttr > nEnd ) + nNextAttr = nEnd; + + aAttrIter.OutAttr( nAktPos ); + m_rAttrOutput.RunText().append('{').append(m_rAttrOutput.Styles().makeStringAndClear()).append(m_rExport.sNewLine); + bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos ); + if( !bTxtAtr ) + { + String aOut( aStr.Copy( nAktPos, nNextAttr - nAktPos ) ); + m_rAttrOutput.RunText().append( m_rExport.OutString( aOut, eChrSet ) ); + } + + m_rAttrOutput.RunText().append('}'); + + nAktPos = nNextAttr; + eChrSet = eNextChrSet; + aAttrIter.NextPos(); + } + while( nAktPos < nEnd ); + } + m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_PAR).append('}'); + + OSL_TRACE("%s end", OSL_THIS_FUNC); +} + +void RtfSdrExport::EndShape( sal_Int32 nShapeElement ) +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + + if ( nShapeElement >= 0 ) + { + // end of the shape + m_rAttrOutput.RunText().append('}').append('}'); + } +} + +UINT32 RtfSdrExport::AddSdrObject( const SdrObject& rObj ) +{ + m_pSdrObject = &rObj; + return EscherEx::AddSdrObject(rObj); +} + +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx new file mode 100644 index 000000000000..46d5e58bafcc --- /dev/null +++ b/sw/source/filter/ww8/rtfsdrexport.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Miklos Vajna. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RTFSdrEXPORT_HXX_ +#define _RTFSdrEXPORT_HXX_ + +#include +#include +#include + +#include + +class RtfExport; +class RtfAttributeOutput; + +class RtfSdrExport : public EscherEx +{ + RtfExport &m_rExport; + + RtfAttributeOutput &m_rAttrOutput; + + const SdrObject* m_pSdrObject; + + /// Remember the shape type. + sal_uInt32 m_nShapeType; + + /// Remember the shape flags. + sal_uInt32 m_nShapeFlags; + + /// Remember style, the most important shape attribute ;-) + rtl::OStringBuffer *m_pShapeStyle; + + std::map m_aShapeProps; + + /// Remember which shape types we had already written. + bool *m_pShapeTypeWritten; + +public: + RtfSdrExport( RtfExport &rExport ); + virtual ~RtfSdrExport(); + + /// Export the sdr object as Sdr. + /// + /// Call this when you need to export the object as Sdr in RTF. + UINT32 AddSdrObject( const SdrObject& rObj ); + +protected: + /// Add an attribute to the generated shape element. + /// + /// This should be called from within StartShape() to ensure that the + /// added attribute is preserved. + void AddShapeAttribute( sal_Int32 nAttribute, const rtl::OString& sValue ); + + /// Start the shape for which we just collected the information. + /// + /// Returns the element's tag number, -1 means we wrote nothing. + virtual sal_Int32 StartShape(); + + /// End the shape. + /// + /// The parameter is just what we got from StartShape(). + virtual void EndShape( sal_Int32 nShapeElement ); + + virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ); + +private: + + virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 ); + virtual void CloseContainer(); + + virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 ); + virtual void LeaveGroup(); + + virtual void AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId = 0 ); + +private: + /// Add starting and ending point of a line to the m_pShapeAttrList. + void AddLineDimensions( const Rectangle& rRectangle ); + + /// Add position and size to the OStringBuffer. + void AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Rectangle& rRectangle ); + + void WriteOutliner(const OutlinerParaObject& rParaObj); +}; + +#endif // _RTFSdrEXPORT_HXX_ +/* vi:set shiftwidth=4 expandtab: */ diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 7f1b6658800e..b28f15c1e7f2 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -811,49 +811,7 @@ void WW8Export::AppendFlyInFlys(const sw::Frame& rFrmFmt, OutputField(0, ww::eSHAPE, aEmptyStr, WRITEFIELD_CLOSE); } -class WW8_SdrAttrIter : public MSWordAttrIter -{ -private: - const EditTextObject* pEditObj; - const SfxItemPool* pEditPool; - EECharAttribArray aTxtAtrArr; - SvPtrarr aChrTxtAtrArr; - SvUShorts aChrSetArr; - USHORT nPara; - xub_StrLen nAktSwPos; - xub_StrLen nTmpSwPos; // fuer HasItem() - rtl_TextEncoding eNdChrSet; - USHORT nScript; - BYTE mnTyp; - - xub_StrLen SearchNext( xub_StrLen nStartPos ); - void SetCharSet(const EECharAttrib& rTxtAttr, bool bStart); - - //No copying - WW8_SdrAttrIter(const WW8_SdrAttrIter&); - WW8_SdrAttrIter& operator=(const WW8_SdrAttrIter&); -public: - WW8_SdrAttrIter( WW8Export& rWr, const EditTextObject& rEditObj, - BYTE nType ); - void NextPara( USHORT nPar ); - void OutParaAttr(bool bCharAttr); - void OutEEField(const SfxPoolItem& rHt); - - bool IsTxtAttr(xub_StrLen nSwPos); - - void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); } - - void OutAttr( xub_StrLen nSwPos ); - virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const; - virtual const SfxPoolItem& GetItem( USHORT nWhich ) const; - bool OutAttrWithRange(xub_StrLen nPos); - xub_StrLen WhereNext() const { return nAktSwPos; } - rtl_TextEncoding GetNextCharSet() const; - rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } -}; - - -WW8_SdrAttrIter::WW8_SdrAttrIter( WW8Export& rWr, +MSWord_SdrAttrIter::MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, BYTE nTyp ) : MSWordAttrIter( rWr ), pEditObj(&rEditObj), pEditPool(0), aTxtAtrArr( 0, 4 ), aChrTxtAtrArr( 0, 4 ), aChrSetArr( 0, 4 ), @@ -862,7 +820,7 @@ WW8_SdrAttrIter::WW8_SdrAttrIter( WW8Export& rWr, NextPara( 0 ); } -void WW8_SdrAttrIter::NextPara( USHORT nPar ) +void MSWord_SdrAttrIter::NextPara( USHORT nPar ) { nPara = nPar; // Attributwechsel an Pos 0 wird ignoriert, da davon ausgegangen @@ -885,7 +843,7 @@ void WW8_SdrAttrIter::NextPara( USHORT nPar ) nAktSwPos = SearchNext( 1 ); } -rtl_TextEncoding WW8_SdrAttrIter::GetNextCharSet() const +rtl_TextEncoding MSWord_SdrAttrIter::GetNextCharSet() const { if( aChrSetArr.Count() ) return (rtl_TextEncoding)aChrSetArr[ aChrSetArr.Count() - 1 ]; @@ -893,7 +851,7 @@ rtl_TextEncoding WW8_SdrAttrIter::GetNextCharSet() const } // der erste Parameter in SearchNext() liefert zurueck, ob es ein TxtAtr ist. -xub_StrLen WW8_SdrAttrIter::SearchNext( xub_StrLen nStartPos ) +xub_StrLen MSWord_SdrAttrIter::SearchNext( xub_StrLen nStartPos ) { xub_StrLen nPos; xub_StrLen nMinPos = STRING_MAXLEN; @@ -932,7 +890,7 @@ xub_StrLen WW8_SdrAttrIter::SearchNext( xub_StrLen nStartPos ) return nMinPos; } -void WW8_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) +void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) { void* p = 0; rtl_TextEncoding eChrSet; @@ -962,7 +920,7 @@ void WW8_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) } } -void WW8_SdrAttrIter::OutEEField(const SfxPoolItem& rHt) +void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt) { const SvxFieldItem &rField = (const SvxFieldItem &)rHt; const SvxFieldData *pFld = rField.GetField(); @@ -981,7 +939,7 @@ void WW8_SdrAttrIter::OutEEField(const SfxPoolItem& rHt) } } -void WW8_SdrAttrIter::OutAttr( xub_StrLen nSwPos ) +void MSWord_SdrAttrIter::OutAttr( xub_StrLen nSwPos ) { OutParaAttr(true); @@ -1038,7 +996,7 @@ void WW8_SdrAttrIter::OutAttr( xub_StrLen nSwPos ) } } -bool WW8_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos) +bool MSWord_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos) { for (USHORT i = 0; i < aTxtAtrArr.Count(); ++i) { @@ -1063,7 +1021,7 @@ bool WW8_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos) // Attribut-Anfangposition fragen kann. // Es koennen nur Attribute mit Ende abgefragt werden. // Es wird mit bDeep gesucht -const SfxPoolItem* WW8_SdrAttrIter::HasTextItem(USHORT nWhich) const +const SfxPoolItem* MSWord_SdrAttrIter::HasTextItem(USHORT nWhich) const { const SfxPoolItem* pRet = 0; nWhich = sw::hack::TransformWhichBetweenPools(*pEditPool, @@ -1088,7 +1046,7 @@ const SfxPoolItem* WW8_SdrAttrIter::HasTextItem(USHORT nWhich) const return pRet; } -const SfxPoolItem& WW8_SdrAttrIter::GetItem( USHORT nWhich ) const +const SfxPoolItem& MSWord_SdrAttrIter::GetItem( USHORT nWhich ) const { using sw::hack::GetSetWhichFromSwDocWhich; const SfxPoolItem* pRet = HasTextItem(nWhich); @@ -1102,7 +1060,7 @@ const SfxPoolItem& WW8_SdrAttrIter::GetItem( USHORT nWhich ) const return *pRet; } -void WW8_SdrAttrIter::OutParaAttr(bool bCharAttr) +void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr) { SfxItemSet aSet( pEditObj->GetParaAttribs( nPara )); if( aSet.Count() ) @@ -1175,7 +1133,7 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, BYTE nTyp) { bool bAnyWrite = false; const EditTextObject& rEditObj = rParaObj.GetTextObject(); - WW8_SdrAttrIter aAttrIter( *this, rEditObj, nTyp ); + MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp ); USHORT nPara = rEditObj.GetParagraphCount(); BYTE bNul = 0; diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index e796b68f5efd..5d8f5e27c883 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1646,14 +1646,127 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); } -xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& /*rNode*/, xub_StrLen /*nAktPos*/ ) +xub_StrLen MSWordExportBase::GetNextPos( SwAttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos ) { - return aAttrIter->WhereNext(); + // Get the bookmarks for the normal run + xub_StrLen nNextPos = aAttrIter->WhereNext(); + + GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos ); + + xub_StrLen nNextBookmark = nNextPos; + NearestBookmark( nNextPos ); + + return std::min( nNextPos, nNextBookmark ); +} + +void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ ) +{ + xub_StrLen nNextPos; + + // either no bookmark, or it is not at the current position + if ( !NearestBookmark( nNextPos ) || nNextPos > nAktPos ) + aAttrIter->NextPos(); +} + +bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, + xub_StrLen nEnd, IMarkVector& rArr ) +{ + IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); + ULONG nNd = rNd.GetIndex( ); + + const sal_Int32 nMarks = pMarkAccess->getMarksCount(); + for ( sal_Int32 i = 0; i < nMarks; i++ ) + { + IMark* pMark = ( pMarkAccess->getMarksBegin() + i )->get(); + + // Only keep the bookmarks starting or ending in this node + if ( pMark->GetMarkStart().nNode == nNd || + pMark->GetMarkEnd().nNode == nNd ) + { + xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex(); + xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex(); + + // Keep only the bookmars starting or ending in the snippet + bool bIsStartOk = ( nBStart >= nStt ) && ( nBStart <= nEnd ); + bool bIsEndOk = ( nBEnd >= nStt ) && ( nBEnd <= nEnd ); + + if ( bIsStartOk || bIsEndOk ) + rArr.push_back( pMark ); + } + } + return ( rArr.size() > 0 ); +} + +class CompareMarksEnd : public std::binary_function < const IMark *, const IMark *, bool > +{ +public: + inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const + { + xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex(); + xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex(); + + return nOEnd < nTEnd; + } +}; + +bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest ) +{ + bool bHasBookmark = false; + + if ( m_rSortedMarksStart.size( ) > 0 ) + { + IMark* pMarkStart = m_rSortedMarksStart.front(); + rNearest = pMarkStart->GetMarkStart().nContent.GetIndex(); + bHasBookmark = true; + } + + if ( m_rSortedMarksEnd.size( ) > 0 ) + { + IMark* pMarkEnd = m_rSortedMarksEnd[0]; + if ( !bHasBookmark ) + rNearest = pMarkEnd->GetMarkEnd().nContent.GetIndex(); + else + rNearest = std::min( rNearest, pMarkEnd->GetMarkEnd().nContent.GetIndex() ); + bHasBookmark = true; + } + + return bHasBookmark; } -void MSWordExportBase::UpdatePosition( SwAttrIter* aAttrIter, xub_StrLen /*nAktPos*/, xub_StrLen /*nEnd*/ ) +void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen ) { - aAttrIter->NextPos(); + IMarkVector aMarksStart; + if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) ) + { + IMarkVector aSortedEnd; + IMarkVector aSortedStart; + for ( IMarkVector::const_iterator it = aMarksStart.begin(), end = aMarksStart.end(); + it < end; ++it ) + { + IMark* pMark = (*it); + + // Remove the positions egals to the current pos + xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); + xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + + if ( nStart > nAktPos ) + aSortedStart.push_back( pMark ); + + if ( nEnd > nAktPos ) + aSortedEnd.push_back( pMark ); + } + + // Sort the bookmarks by end position + std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() ); + + m_rSortedMarksStart.swap( aSortedStart ); + m_rSortedMarksEnd.swap( aSortedEnd ); + } + else + { + m_rSortedMarksStart.clear( ); + m_rSortedMarksEnd.clear( ); + } } void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 14fdd4e3627f..eb844f3fea07 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -721,6 +721,9 @@ void MSWordExportBase::SubstituteBullet( String& rNumStr, StarSymbolToMSMultiFont *pConvert = 0; FontFamily eFamily = FAMILY_DECORATIVE; + if (!bSubstituteBullets) + return; + if (!pConvert) { pConvert = CreateStarSymbolToMSMultiFont(); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index e654330aab57..e18df26fcdda 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -79,6 +79,7 @@ #include "ww8par.hxx" #include "ww8attributeoutput.hxx" #include "docxattributeoutput.hxx" +#include "rtfattributeoutput.hxx" using namespace sw::util; using namespace nsHdFtFlags; @@ -711,6 +712,17 @@ void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const rAttrOutput->EndFont(); } +void wwFont::WriteRtf( const RtfAttributeOutput* rAttrOutput ) const +{ + rAttrOutput->FontFamilyType( meFamily, *this ); + rAttrOutput->FontPitchType( mePitch ); + rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ) ); + rAttrOutput->StartFont( msFamilyNm ); + if ( mbAlt ) + rAttrOutput->FontAlternateName( msAltNm ); + rAttrOutput->EndFont(); +} + bool operator<(const wwFont &r1, const wwFont &r2) { int nRet = memcmp(r1.maWW8_FFN, r2.maWW8_FFN, sizeof(r1.maWW8_FFN)); @@ -763,6 +775,22 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc) GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8)); } + + if (!bLoadAllFonts) + return; + + const USHORT aTypes[] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT, 0 }; + for (const USHORT* pId = aTypes; *pId; ++pId) + { + USHORT nMaxItem = rPool.GetItemCount( *pId ); + for( USHORT nGet = 0; nGet < nMaxItem; ++nGet ) + if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem( + *pId, nGet )) ) + { + GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), + pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8)); + } + } } USHORT wwFontHelper::GetId(const Font& rFont) @@ -835,6 +863,14 @@ void wwFontHelper::WriteFontTable( const DocxAttributeOutput& rAttrOutput ) ::std::bind2nd( ::std::mem_fun( &wwFont::WriteDocx ), &rAttrOutput ) ); } +void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput ) +{ + ::std::vector aFontList( AsVector() ); + + ::std::for_each( aFontList.begin(), aFontList.end(), + ::std::bind2nd( ::std::mem_fun( &wwFont::WriteRtf ), &rAttrOutput ) ); +} + /* */ WW8_WrPlc0::WW8_WrPlc0( ULONG nOffset ) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index e22ca1c9b731..b725ac5c04f7 100755 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3371,7 +3371,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0), mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0), pStyles( NULL ), - bHasHdr(false), bHasFtr(false), + bHasHdr(false), bHasFtr(false), bSubstituteBullets(true), pDoc( pDocument ), pCurPam( pCurrentPam ), pOrigPam( pOriginalPam ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 95deb926619d..3a005a91b51e 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -35,6 +35,7 @@ #define _SVSTDARR_ULONGS #include #endif +#include #include #include @@ -55,6 +56,7 @@ class SwAttrIter; class AttributeOutputBase; class DocxAttributeOutput; +class RtfAttributeOutput; class BitmapPalette; class SwEscherEx; class DateTime; @@ -294,6 +296,7 @@ public: rtl_TextEncoding eChrSet, bool bWrtWW8 ); bool Write( SvStream *pTableStram ) const; void WriteDocx( const DocxAttributeOutput* rAttrOutput ) const; + void WriteRtf( const RtfAttributeOutput* rAttrOutput ) const; rtl::OUString GetFamilyName() const { return rtl::OUString( msFamilyNm ); } friend bool operator < (const wwFont &r1, const wwFont &r2); }; @@ -309,7 +312,7 @@ private: ::std::vector< const wwFont* > AsVector() const; public: - wwFontHelper() : mbWrtWW8(false) {} + wwFontHelper() : mbWrtWW8(false), bLoadAllFonts(false) {} /// rDoc used only to get the initial standard font(s) in use. void InitFontTable(bool bWrtWW8, const SwDoc& rDoc); USHORT GetId(const Font& rFont); @@ -317,6 +320,10 @@ public: USHORT GetId(const wwFont& rFont); void WriteFontTable( SvStream *pTableStream, WW8Fib& pFib ); void WriteFontTable( const DocxAttributeOutput& rAttrOutput ); + void WriteFontTable( const RtfAttributeOutput& rAttrOutput ); + + /// If true, all fonts are loaded before processing the document. + BYTE bLoadAllFonts: 1; }; class DrawObj @@ -535,6 +542,7 @@ public: BYTE bEndAtTxtEnd : 1; // true: all END at Textend BYTE bHasHdr : 1; BYTE bHasFtr : 1; + BYTE bSubstituteBullets : 1; // true: SubstituteBullet() gets called SwDoc *pDoc; SwPaM *pCurPam, *pOrigPam; @@ -542,6 +550,11 @@ public: /// Stack to remember the nesting (see MSWordSaveData for more) ::std::stack< MSWordSaveData > maSaveData; + /// Used to split the runs according to the bookmarks start and ends + typedef std::vector< ::sw::mark::IMark* > IMarkVector; + IMarkVector m_rSortedMarksStart; + IMarkVector m_rSortedMarksEnd; + public: /// The main function to export the document. void ExportDocument( bool bWriteAll ); @@ -781,6 +794,17 @@ protected: /// One of OutputTextNode(), OutputGrfNode(), or OutputOLENode() void OutputContentNode( const SwCntntNode& ); + /// Find the nearest bookmark from the current position. + /// + /// Returns false when there is no bookmark. + bool NearestBookmark( xub_StrLen& rNearest ); + + void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, + xub_StrLen nLen ); + + bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd, + IMarkVector& rArr ); + public: MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam ); virtual ~MSWordExportBase(); @@ -1346,6 +1370,47 @@ public: virtual const SfxPoolItem& GetItem( USHORT nWhich ) const = 0; }; +class MSWord_SdrAttrIter : public MSWordAttrIter +{ +private: + const EditTextObject* pEditObj; + const SfxItemPool* pEditPool; + EECharAttribArray aTxtAtrArr; + SvPtrarr aChrTxtAtrArr; + SvUShorts aChrSetArr; + USHORT nPara; + xub_StrLen nAktSwPos; + xub_StrLen nTmpSwPos; // for HasItem() + rtl_TextEncoding eNdChrSet; + USHORT nScript; + BYTE mnTyp; + + xub_StrLen SearchNext( xub_StrLen nStartPos ); + void SetCharSet(const EECharAttrib& rTxtAttr, bool bStart); + + //No copying + MSWord_SdrAttrIter(const MSWord_SdrAttrIter&); + MSWord_SdrAttrIter& operator=(const MSWord_SdrAttrIter&); +public: + MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, + BYTE nType ); + void NextPara( USHORT nPar ); + void OutParaAttr(bool bCharAttr); + void OutEEField(const SfxPoolItem& rHt); + + bool IsTxtAttr(xub_StrLen nSwPos); + + void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); } + + void OutAttr( xub_StrLen nSwPos ); + virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const; + virtual const SfxPoolItem& GetItem( USHORT nWhich ) const; + bool OutAttrWithRange(xub_StrLen nPos); + xub_StrLen WhereNext() const { return nAktSwPos; } + rtl_TextEncoding GetNextCharSet() const; + rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } +}; + /// Class to collect and output the styles table. class MSWordStyles { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 89aef162ec01..b39df7458df2 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3340,7 +3340,7 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines ) m_rWW8Export.pO->Insert( (BYTE)0x02, m_rWW8Export.pO->Count() ); sal_Unicode cStart = rTwoLines.GetStartBracket(); - sal_Unicode cEnd = rTwoLines.GetStartBracket(); + sal_Unicode cEnd = rTwoLines.GetEndBracket(); /* As per usual we have problems. We can have seperate left and right brackets diff --git a/sw/util/msword.map b/sw/util/msword.map index 16b9d25b0b78..d2a9d9b4f7e1 100755 --- a/sw/util/msword.map +++ b/sw/util/msword.map @@ -6,6 +6,9 @@ UDK_3_0_0 { ExportDOC; SaveOrDelMSVBAStorage_ww8; GetSaveWarningOfMSVBAStorage_ww8; + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; local: *; }; -- cgit From 575fc4816d1f91d20a72dcd8d7f3152550cad0df Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 17 Sep 2010 12:35:12 +0200 Subject: docx-fixes02.diff: Some other misc docx fixes n#581604 --- sw/source/filter/ww8/attributeoutputbase.hxx | 5 +- sw/source/filter/ww8/docxattributeoutput.cxx | 400 ++++++++++++++++++++++++--- sw/source/filter/ww8/docxattributeoutput.hxx | 8 +- sw/source/filter/ww8/makefile.mk | 1 + sw/source/filter/ww8/rtfattributeoutput.cxx | 4 +- sw/source/filter/ww8/rtfattributeoutput.hxx | 5 +- sw/source/filter/ww8/wrtw8nds.cxx | 88 +----- sw/source/filter/ww8/wrtw8sty.cxx | 15 +- sw/source/filter/ww8/wrtww8.hxx | 69 +++++ sw/source/filter/ww8/ww8atr.cxx | 21 +- sw/source/filter/ww8/ww8attributeoutput.hxx | 5 +- 11 files changed, 475 insertions(+), 146 deletions(-) diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 6f69f8e591a5..7ff2ada5aefb 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -176,7 +176,7 @@ public: virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) = 0; /// Output ruby start. - virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby ) = 0; + virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ) = 0; /// Output ruby end. virtual void EndRuby() = 0; @@ -247,7 +247,8 @@ public: /// Start of a style in the styles table. virtual void StartStyle( const String& rName, bool bPapFmt, - USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId ) = 0; + USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId, + bool bAutoUpdate ) = 0; /// End of a style in the styles table. virtual void EndStyle() = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a0d67d725087..18f8712d6d34 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -31,6 +31,13 @@ #include "writerwordglue.hxx" #include "wrtww8.hxx" #include "ww8par.hxx" +#include "fmtcntnt.hxx" +#include "fmtsrnd.hxx" +#include "fchrfmt.hxx" +#include "tgrditem.hxx" +#include "fmtruby.hxx" +#include "charfmt.hxx" +#include "breakit.hxx" #include #include @@ -207,6 +214,25 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT FinishTableRowCell( pTextNodeInfoInner ); m_bParagraphOpened = false; + + // Write the anchored frame if any + if ( m_pParentFrame ) + { + const SwFrmFmt& rFrmFmt = m_pParentFrame->GetFrmFmt( ); + const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx(); + + ULONG nStt = pNodeIndex ? pNodeIndex->GetIndex()+1 : 0; + ULONG nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0; + + m_rExport.SaveData( nStt, nEnd ); + + m_rExport.mpParentFrame = m_pParentFrame; + m_pParentFrame = NULL; + + m_rExport.WriteText( ); + + m_rExport.RestoreData(); + } } void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph ) @@ -286,6 +312,14 @@ void DocxAttributeOutput::InitCollectedParagraphProperties() void DocxAttributeOutput::WriteCollectedParagraphProperties() { + if ( m_pFlyAttrList ) + { + XFastAttributeListRef xAttrList( m_pFlyAttrList ); + m_pFlyAttrList = NULL; + + m_pSerializer->singleElementNS( XML_w, XML_framePr, xAttrList ); + } + if ( m_pSpacingAttrList ) { XFastAttributeListRef xAttrList( m_pSpacingAttrList ); @@ -745,14 +779,75 @@ void DocxAttributeOutput::RawText( const String& /*rText*/, bool /*bForceUnicode OSL_TRACE("TODO DocxAttributeOutput::RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet )\n" ); } -void DocxAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, const SwFmtRuby& /*rRuby*/ ) +void DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ) { OSL_TRACE("TODO DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby )\n" ); + m_pSerializer->startElementNS( XML_w, XML_ruby, FSEND ); + m_pSerializer->startElementNS( XML_w, XML_rubyPr, FSEND ); + // hps + // hpsBaseText + // hpsRaise + // lid + lang::Locale aLocale( SwBreakIt::Get()->GetLocale( + rNode.GetLang( nPos ) ) ); + OUString sLang( aLocale.Language ); + if ( aLocale.Country.getLength( ) > 0 ) + sLang += OUString::createFromAscii( "-" ) + OUString( aLocale.Country ); + m_pSerializer->singleElementNS( XML_w, XML_lid, + FSNS( XML_w, XML_val ), + OUStringToOString( sLang, RTL_TEXTENCODING_UTF8 ).getStr( ), FSEND ); + + + OString sAlign ( "center" ); + switch ( rRuby.GetAdjustment( ) ) + { + case 0: + sAlign = OString( "left" ); + break; + case 1: + // Defaults to center + break; + case 2: + sAlign = OString( "right" ); + break; + case 3: + sAlign = OString( "distributeLetter" ); + break; + case 4: + sAlign = OString( "distributeSpace" ); + break; + default: + break; + } + m_pSerializer->singleElementNS( XML_w, XML_rubyAlign, + FSNS( XML_w, XML_val ), sAlign.getStr(), FSEND ); + m_pSerializer->endElementNS( XML_w, XML_rubyPr ); + + m_pSerializer->startElementNS( XML_w, XML_rt, FSEND ); + StartRun( NULL ); + StartRunProperties( ); + SwAttrIter aAttrIt( m_rExport, rNode ); + aAttrIt.OutAttr( nPos, true ); + USHORT nStyle = m_rExport.GetId( *rRuby.GetTxtRuby()->GetCharFmt() ); + OString aStyleId( "style" ); + aStyleId += OString::valueOf( sal_Int32( nStyle ) ); + m_pSerializer->singleElementNS( XML_w, XML_rStyle, + FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); + EndRunProperties( NULL ); + RunText( rRuby.GetText( ) ); + EndRun( ); + m_pSerializer->endElementNS( XML_w, XML_rt ); + + m_pSerializer->startElementNS( XML_w, XML_rubyBase, FSEND ); + StartRun( NULL ); } void DocxAttributeOutput::EndRuby() { OSL_TRACE( "TODO DocxAttributeOutput::EndRuby()\n" ); + EndRun( ); + m_pSerializer->endElementNS( XML_w, XML_rubyBase ); + m_pSerializer->endElementNS( XML_w, XML_ruby ); } bool DocxAttributeOutput::AnalyzeURL( const String& rUrl, const String& rTarget, String* pLinkURL, String* pMark ) @@ -1693,6 +1788,12 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po } } break; + case sw::Frame::eTxtBox: + { + // The frame output is postponed at the end of the anchor paragraph + m_pParentFrame = &rFrame; + } + break; default: #if OSL_DEBUG_LEVEL > 0 OSL_TRACE( "TODO DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Point& rNdTopLeft ) - frame type '%s'\n", @@ -1707,7 +1808,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po } void DocxAttributeOutput::StartStyle( const String& rName, bool bPapFmt, - USHORT nBase, USHORT nNext, USHORT /*nWwId*/, USHORT nId ) + USHORT nBase, USHORT nNext, USHORT /*nWwId*/, USHORT nId, bool bAutoUpdate ) { OString aStyle( "style" ); @@ -1730,6 +1831,9 @@ void DocxAttributeOutput::StartStyle( const String& rName, bool bPapFmt, m_pSerializer->singleElementNS( XML_w, XML_next, FSNS( XML_w, XML_val ), ( aStyle + OString::valueOf( sal_Int32( nNext ) ) ).getStr(), FSEND ); + + if ( bAutoUpdate ) + m_pSerializer->singleElementNS( XML_w, XML_autoRedefine, FSEND ); } void DocxAttributeOutput::EndStyle() @@ -2247,11 +2351,43 @@ void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) } } -void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& /*rEscapement*/ ) +void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement ) { -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::CharEscapement()\n" ); -#endif + OString sIss; + short nEsc = rEscapement.GetEsc(), nProp = rEscapement.GetProp(); + if ( !nEsc ) + { + sIss = OString( "baseline" ); + nEsc = 0; + nProp = 100; + } + else if ( DFLT_ESC_PROP == nProp ) + { + if ( DFLT_ESC_SUB == nEsc || DFLT_ESC_AUTO_SUB == nEsc ) + sIss = OString( "subscript" ); + else if ( DFLT_ESC_SUPER == nEsc || DFLT_ESC_AUTO_SUPER == nEsc ) + sIss = OString( "superscript" ); + } + + if ( sIss.getLength( ) > 0 ) + m_pSerializer->singleElementNS( XML_w, XML_vertAlign, + FSNS( XML_w, XML_val ), sIss.getStr(), FSEND ); + + if ( sIss.getLength() == 0 || sIss.match( OString( "baseline" ) ) ) + { + long nHeight = ((SvxFontHeightItem&)m_rExport.GetItem( + RES_CHRATR_FONTSIZE )).GetHeight(); + OString sPos = OString::valueOf( ( nHeight * nEsc + 500 ) / 1000 ); + m_pSerializer->singleElementNS( XML_w, XML_position, + FSNS( XML_w, XML_val ), sPos.getStr( ), FSEND ); + + if( 100 != nProp || sIss.match( OString( "baseline" ) ) ) + { + OString sSize = OString::valueOf( ( nHeight * nProp + 500 ) / 1000 ); + m_pSerializer->singleElementNS( XML_w, XML_sz, + FSNS( XML_w, XML_val ), sSize.getStr( ), FSEND ); + } + } } void DocxAttributeOutput::CharFont( const SvxFontItem& rFont) @@ -2283,7 +2419,7 @@ void DocxAttributeOutput::CharFontSize( const SvxFontHeightItem& rFontSize) void DocxAttributeOutput::CharKerning( const SvxKerningItem& rKerning ) { OString aKerning = OString::valueOf( ( sal_Int32 ) rKerning.GetValue() ); - m_pSerializer->singleElementNS( XML_w, XML_kern, FSNS(XML_w, XML_val), aKerning.getStr(), FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_spacing, FSNS(XML_w, XML_val), aKerning.getStr(), FSEND ); } void DocxAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) @@ -2536,11 +2672,12 @@ void DocxAttributeOutput::TextINetFormat( const SwFmtINetFmt& rLink ) m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); } -void DocxAttributeOutput::TextCharFormat( const SwFmtCharFmt& ) +void DocxAttributeOutput::TextCharFormat( const SwFmtCharFmt& rCharFmt ) { -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::TextCharFormat()\n" ); -#endif + OString aStyleId( "style" ); + aStyleId += OString::valueOf( sal_Int32( m_rExport.GetId( *rCharFmt.GetCharFmt() ) ) ); + + m_pSerializer->singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); } void DocxAttributeOutput::RefField( const SwField& rFld, const String& rRef ) @@ -2954,9 +3091,22 @@ void DocxAttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize ) { if ( m_rExport.bOutFlyFrmAttrs ) { - #if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::FormatFrameSize() - Fly frames\n" ); - #endif + if ( !m_pFlyAttrList ) + m_pFlyAttrList = m_pSerializer->createAttrList( ); + + if ( rSize.GetWidth() && rSize.GetWidthSizeType() == ATT_FIX_SIZE ) + { + m_pFlyAttrList->add( FSNS( XML_w, XML_w ), OString::valueOf( rSize.GetWidth( ) ) ); + } + + if ( rSize.GetHeight() ) + { + OString sRule( "exact" ); + if ( rSize.GetHeightSizeType() == ATT_MIN_SIZE ) + sRule = OString( "atLeast" ); + m_pFlyAttrList->add( FSNS( XML_w, XML_hRule ), sRule ); + m_pFlyAttrList->add( FSNS( XML_w, XML_h ), OString::valueOf( rSize.GetHeight( ) ) ); + } } else if ( m_rExport.bOutPageDescs ) { @@ -2986,9 +3136,12 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) { if ( m_rExport.bOutFlyFrmAttrs ) { -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "DocxAttributeOutput::FormatLRSpace() - Fly frames\n" ); -#endif + if ( !m_pFlyAttrList ) + m_pFlyAttrList = m_pSerializer->createAttrList(); + + m_pFlyAttrList->add( FSNS( XML_w, XML_hSpace ), + OString::valueOf( + sal_Int32( ( rLRSpace.GetLeft() + rLRSpace.GetRight() ) / 2 ) ) ); } else if ( m_rExport.bOutPageDescs ) { @@ -3029,11 +3182,17 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) { - if (!m_pSpacingAttrList) + if ( !m_pSpacingAttrList && !m_rExport.bOutFlyFrmAttrs ) m_pSpacingAttrList = m_pSerializer->createAttrList(); if ( m_rExport.bOutFlyFrmAttrs ) { + if ( !m_pFlyAttrList ) + m_pFlyAttrList = m_pSerializer->createAttrList(); + + m_pFlyAttrList->add( FSNS( XML_w, XML_vSpace ), + OString::valueOf( + sal_Int32( ( rULSpace.GetLower() + rULSpace.GetUpper() ) / 2 ) ) ); } else if (m_rExport.bOutPageDescs ) { @@ -3075,32 +3234,150 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) } } -void DocxAttributeOutput::FormatSurround( const SwFmtSurround& ) +void DocxAttributeOutput::FormatSurround( const SwFmtSurround& rSurround ) { -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::FormatSurround()\n" ); -#endif + if ( m_rExport.bOutFlyFrmAttrs ) + { + if ( !m_pFlyAttrList ) + m_pFlyAttrList = m_pSerializer->createAttrList(); + + OString sWrap( "auto" ); + switch ( rSurround.GetSurround( ) ) + { + case SURROUND_NONE: + sWrap = OString( "none" ); + break; + case SURROUND_THROUGHT: + sWrap = OString( "through" ); + break; + case SURROUND_IDEAL: + case SURROUND_PARALLEL: + case SURROUND_LEFT: + case SURROUND_RIGHT: + default: + sWrap = OString( "around" ); + } + + m_pFlyAttrList->add( FSNS( XML_w, XML_wrap ), sWrap ); + } } -void DocxAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& ) +void DocxAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert ) { -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::FormatVertOrientation()\n" ); -#endif + if ( m_rExport.bOutFlyFrmAttrs ) + { + if ( !m_pFlyAttrList ) + m_pFlyAttrList = m_pSerializer->createAttrList(); + + OString sAlign; + switch( rFlyVert.GetVertOrient() ) + { + case text::VertOrientation::NONE: + break; + case text::VertOrientation::CENTER: + case text::VertOrientation::LINE_CENTER: + sAlign = OString( "center" ); + break; + case text::VertOrientation::BOTTOM: + case text::VertOrientation::LINE_BOTTOM: + sAlign = OString( "bottom" ); + break; + case text::VertOrientation::TOP: + case text::VertOrientation::LINE_TOP: + default: + sAlign = OString( "top" ); + break; + } + + if ( sAlign.getLength() > 0 ) + m_pFlyAttrList->add( FSNS( XML_w, XML_yAlign ), sAlign ); + else + m_pFlyAttrList->add( FSNS( XML_w, XML_y ), + OString::valueOf( sal_Int32( rFlyVert.GetPos() ) ) ); + + OString sVAnchor( "page" ); + switch ( rFlyVert.GetRelationOrient( ) ) + { + case text::RelOrientation::CHAR: + case text::RelOrientation::PRINT_AREA: + case text::RelOrientation::TEXT_LINE: + sVAnchor = OString( "column" ); + break; + case text::RelOrientation::FRAME: + case text::RelOrientation::PAGE_LEFT: + case text::RelOrientation::PAGE_RIGHT: + case text::RelOrientation::FRAME_LEFT: + case text::RelOrientation::FRAME_RIGHT: + sVAnchor = OString( "margin" ); + break; + case text::RelOrientation::PAGE_FRAME: + case text::RelOrientation::PAGE_PRINT_AREA: + default: + break; + } + + m_pFlyAttrList->add( FSNS( XML_w, XML_vAnchor ), sVAnchor ); + } } -void DocxAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& ) +void DocxAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& rFlyHori ) { -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::FormatHorizOrientation()\n" ); -#endif + if ( m_rExport.bOutFlyFrmAttrs ) + { + if ( !m_pFlyAttrList ) + m_pFlyAttrList = m_pSerializer->createAttrList(); + + OString sAlign; + switch( rFlyHori.GetHoriOrient() ) + { + case text::HoriOrientation::NONE: + break; + case text::HoriOrientation::LEFT: + sAlign = OString( rFlyHori.IsPosToggle( ) ? "inside" : "left" ); + break; + case text::HoriOrientation::RIGHT: + sAlign = OString( rFlyHori.IsPosToggle( ) ? "outside" : "right" ); + break; + case text::HoriOrientation::CENTER: + case text::HoriOrientation::FULL: // FULL only for tables + default: + sAlign = OString( "center" ); + break; + } + + if ( sAlign.getLength() > 0 ) + m_pFlyAttrList->add( FSNS( XML_w, XML_xAlign ), sAlign ); + else + m_pFlyAttrList->add( FSNS( XML_w, XML_x ), + OString::valueOf( sal_Int32( rFlyHori.GetPos() ) ) ); + + OString sHAnchor( "page" ); + switch ( rFlyHori.GetRelationOrient( ) ) + { + case text::RelOrientation::CHAR: + case text::RelOrientation::PRINT_AREA: + sHAnchor = OString( "text" ); + break; + case text::RelOrientation::FRAME: + case text::RelOrientation::PAGE_LEFT: + case text::RelOrientation::PAGE_RIGHT: + case text::RelOrientation::FRAME_LEFT: + case text::RelOrientation::FRAME_RIGHT: + sHAnchor = OString( "margin" ); + break; + case text::RelOrientation::PAGE_FRAME: + case text::RelOrientation::PAGE_PRINT_AREA: + default: + break; + } + + m_pFlyAttrList->add( FSNS( XML_w, XML_hAnchor ), sHAnchor ); + } } void DocxAttributeOutput::FormatAnchor( const SwFmtAnchor& ) { -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::FormatAnchor()\n" ); -#endif + // Fly frames: anchors here aren't matching the anchors in docx } void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) @@ -3112,10 +3389,6 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) FSNS( XML_w, XML_fill ), sColor.getStr( ), FSEND ); } - -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE( "TODO DocxAttributeOutput::FormatBackground()\n" ); -#endif } void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox ) @@ -3198,9 +3471,52 @@ void DocxAttributeOutput::FormatKeep( const SvxFmtKeepItem& ) m_pSerializer->singleElementNS( XML_w, XML_keepNext, FSEND ); } -void DocxAttributeOutput::FormatTextGrid( const SwTextGridItem& ) +void DocxAttributeOutput::FormatTextGrid( const SwTextGridItem& rGrid ) { - OSL_TRACE( "TODO DocxAttributeOutput::FormatTextGrid()\n" ); + FastAttributeList *pGridAttrList = m_pSerializer->createAttrList(); + + OString sGridType; + switch ( rGrid.GetGridType( ) ) + { + default: + case GRID_NONE: + sGridType = OString( "default" ); + break; + case GRID_LINES_ONLY: + sGridType = OString( "lines" ); + break; + case GRID_LINES_CHARS: + if ( rGrid.IsSnapToChars( ) ) + sGridType = OString( "snapToChars" ); + else + sGridType = OString( "linesAndChars" ); + break; + } + pGridAttrList->add( FSNS( XML_w, XML_type ), sGridType.getStr( ) ); + + UINT16 nHeight = rGrid.GetBaseHeight() + rGrid.GetRubyHeight(); + pGridAttrList->add( FSNS( XML_w, XML_linePitch ), + OString::valueOf( sal_Int32( nHeight ) ).getStr( ) ); + + MSWordStyles * pStyles = m_rExport.pStyles; + SwFmt * pSwFmt = pStyles->GetSwFmt(); + + sal_uInt32 nPageCharSize = 0; + + if (pSwFmt != NULL) + { + nPageCharSize = ItemGet + (*pSwFmt, RES_CHRATR_FONTSIZE).GetHeight(); + } + + sal_uInt16 nPitch = rGrid.IsSquaredMode() ? rGrid.GetBaseHeight() : + rGrid.GetBaseWidth( ); + INT32 nCharSpace = ( nPitch - nPageCharSize ) * 4096 / 20; + + pGridAttrList->add( FSNS( XML_w, XML_charSpace ), + OString::valueOf( sal_Int32( nCharSpace ) ).getStr( ) ); + + m_pSerializer->singleElementNS( XML_w, XML_docGrid, pGridAttrList ); } void DocxAttributeOutput::FormatLineNumbering( const SwFmtLineNumber& rNumbering ) @@ -3258,6 +3574,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_pCharLangAttrList( NULL ), m_pSpacingAttrList( NULL ), m_pHyperlinkAttrList( NULL ), + m_pFlyAttrList( NULL ), m_pFootnotesList( new ::docx::FootnotesList() ), m_pEndnotesList( new ::docx::FootnotesList() ), m_pSectionInfo( NULL ), @@ -3270,7 +3587,8 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_bTableCellOpen( false ), m_nTableDepth( 0 ), m_bParagraphOpened( false ), - m_nColBreakStatus( COLBRK_NONE ) + m_nColBreakStatus( COLBRK_NONE ), + m_pParentFrame( NULL ) { } @@ -3281,11 +3599,13 @@ DocxAttributeOutput::~DocxAttributeOutput() delete m_pCharLangAttrList, m_pCharLangAttrList = NULL; delete m_pSpacingAttrList, m_pSpacingAttrList = NULL; delete m_pHyperlinkAttrList, m_pHyperlinkAttrList = NULL; + delete m_pFlyAttrList, m_pFlyAttrList = NULL; delete m_pFootnotesList, m_pFootnotesList = NULL; delete m_pEndnotesList, m_pEndnotesList = NULL; delete m_pTableWrt, m_pTableWrt = NULL; + m_pParentFrame = NULL; } MSWordExportBase& DocxAttributeOutput::GetExport() diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 11e8055055b3..86ddc902e042 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -102,7 +102,7 @@ public: virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); /// Output ruby start. - virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby ); + virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ); /// Output ruby end. virtual void EndRuby(); @@ -175,7 +175,8 @@ public: /// Start of a style in the styles table. virtual void StartStyle( const String& rName, bool bPapFmt, - USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId ); + USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId, + bool bAutoUpdate ); /// End of a style in the styles table. virtual void EndStyle(); @@ -541,6 +542,7 @@ private: ::sax_fastparser::FastAttributeList *m_pCharLangAttrList; ::sax_fastparser::FastAttributeList *m_pSpacingAttrList; ::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList; + ::sax_fastparser::FastAttributeList *m_pFlyAttrList; ::docx::FootnotesList *m_pFootnotesList; ::docx::FootnotesList *m_pEndnotesList; @@ -583,6 +585,8 @@ private: // beginning of the next paragraph DocxColBreakStatus m_nColBreakStatus; + const sw::Frame *m_pParentFrame; + public: DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML ); diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk index f3638e28a9f2..1ca992fa023d 100644 --- a/sw/source/filter/ww8/makefile.mk +++ b/sw/source/filter/ww8/makefile.mk @@ -58,6 +58,7 @@ EXCEPTIONSFILES = \ $(SLO)$/wrtw8num.obj \ $(SLO)$/wrtw8sty.obj \ $(SLO)$/wrtww8.obj \ + $(SLO)$/docxattributeoutput.obj \ $(SLO)$/docxexportfilter.obj \ $(SLO)$/ww8atr.obj \ $(SLO)$/ww8par.obj \ diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index c5ac3b15f055..ae0275f94323 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -435,7 +435,7 @@ void RtfAttributeOutput::RawText( const String& rText, bool /*bForceUnicode*/, r m_aRunText.append(m_rExport.OutString(rText, eCharSet)); } -void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, const SwFmtRuby& /*rRuby*/ ) +void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, xub_StrLen /*nPos*/, const SwFmtRuby& /*rRuby*/ ) { OSL_TRACE("TODO: %s", OSL_THIS_FUNC); } @@ -1000,7 +1000,7 @@ void RtfAttributeOutput::DefaultStyle( USHORT /*nStyle*/ ) } void RtfAttributeOutput::StartStyle( const String& rName, bool bPapFmt, - USHORT nBase, USHORT nNext, USHORT /*nWwId*/, USHORT nId ) + USHORT nBase, USHORT nNext, USHORT /*nWwId*/, USHORT nId, bool /*bAutoUpdate*/ ) { OSL_TRACE("%s, rName = '%s'", OSL_THIS_FUNC, OUStringToOString( OUString( rName ), m_rExport.eCurrentEncoding ).getStr()); diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 8a4d0e766509..cdbc6c61fcd4 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -89,7 +89,7 @@ public: virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); /// Output ruby start. - virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby ); + virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ); /// Output ruby end. virtual void EndRuby(); @@ -151,7 +151,8 @@ public: /// Start of a style in the styles table. virtual void StartStyle( const String& rName, bool bPapFmt, - USHORT nBase, USHORT nNext, USHORT nWwId, USHORT nId ); + USHORT nBase, USHORT nNext, USHORT nWwIdi, USHORT nId, + bool bAutoUpdate ); /// End of a style in the styles table. virtual void EndStyle(); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 5d8f5e27c883..37ac58eb571c 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -168,76 +168,6 @@ MSWordAttrIter::~MSWordAttrIter() m_rExport.pChpIter = pOld; } -// Die Klasse SwAttrIter ist eine Hilfe zum Aufbauen der Fkp.chpx. -// Dabei werden nur Zeichen-Attribute beachtet; Absatz-Attribute brauchen -// diese Behandlung nicht. -// Die Absatz- und Textattribute des Writers kommen rein, und es wird -// mit Where() die naechste Position geliefert, an der sich die Attribute -// aendern. IsTxtAtr() sagt, ob sich an der mit Where() gelieferten Position -// ein Attribut ohne Ende und mit \xff im Text befindet. -// Mit OutAttr() werden die Attribute an der angegebenen SwPos -// ausgegeben. - -class SwAttrIter : public MSWordAttrIter -{ -private: - const SwTxtNode& rNd; - - CharRuns maCharRuns; - cCharRunIter maCharRunIter; - - rtl_TextEncoding meChrSet; - sal_uInt16 mnScript; - bool mbCharIsRTL; - - const SwRedline* pCurRedline; - xub_StrLen nAktSwPos; - USHORT nCurRedlinePos; - - bool mbParaIsRTL; - - const SwFmtDrop &mrSwFmtDrop; - - sw::Frames maFlyFrms; // #i2916# - sw::FrameIter maFlyIter; - - xub_StrLen SearchNext( xub_StrLen nStartPos ); - void FieldVanish( const String& rTxt ); - - void OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool bStart); - - void IterToCurrent(); - - //No copying - SwAttrIter(const SwAttrIter&); - SwAttrIter& operator=(const SwAttrIter&); -public: - SwAttrIter( MSWordExportBase& rWr, const SwTxtNode& rNd ); - - bool IsTxtAttr( xub_StrLen nSwPos ); - bool IsRedlineAtEnd( xub_StrLen nPos ) const; - bool IsDropCap( int nSwPos ); - bool RequiresImplicitBookmark(); - - void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); } - - void OutAttr( xub_StrLen nSwPos ); - virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const; - virtual const SfxPoolItem& GetItem( USHORT nWhich ) const; - int OutAttrWithRange(xub_StrLen nPos); - const SwRedlineData* GetRedline( xub_StrLen nPos ); - void OutFlys(xub_StrLen nSwPos); - - xub_StrLen WhereNext() const { return nAktSwPos; } - sal_uInt16 GetScript() const { return mnScript; } - bool IsCharRTL() const { return mbCharIsRTL; } - bool IsParaRTL() const { return mbParaIsRTL; } - rtl_TextEncoding GetCharSet() const { return meChrSet; } - String GetSnippet(const String &rStr, xub_StrLen nAktPos, - xub_StrLen nLen) const; - const SwFmtDrop& GetSwFmtDrop() const { return mrSwFmtDrop; } -}; - class sortswflys : public std::binary_function { @@ -456,7 +386,14 @@ xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos ) return nMinPos; } -void SwAttrIter::OutAttr( xub_StrLen nSwPos ) +bool lcl_isFontsizeItem( const SfxPoolItem& rItem ) +{ + return ( rItem.Which( ) == RES_CHRATR_FONTSIZE || + rItem.Which( ) == RES_CHRATR_CJK_FONTSIZE || + rItem.Which( ) == RES_CHRATR_CTL_FONTSIZE ); +} + +void SwAttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby ) { m_rExport.AttrOutput().RTLAndCJKState( IsCharRTL(), GetScript() ); @@ -544,7 +481,10 @@ void SwAttrIter::OutAttr( xub_StrLen nSwPos ) sw::cPoolItemIter aEnd = aRangeItems.end(); for ( sw::cPoolItemIter aI = aRangeItems.begin(); aI != aEnd; ++aI ) - aExportItems[aI->first] = aI->second; + { + if ( !bRuby || !lcl_isFontsizeItem( *aI->second ) ) + aExportItems[aI->first] = aI->second; + } if ( !aExportItems.empty() ) { @@ -697,7 +637,7 @@ const SfxPoolItem& SwAttrIter::GetItem(USHORT nWhich) const return pRet ? *pRet : rNd.SwCntntNode::GetAttr(nWhich); } -void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby ) +void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/, const SwFmtRuby& rRuby ) { String aStr( FieldString( ww::eEQ ) ); aStr.APPEND_CONST_ASC( "\\* jc" ); @@ -1217,7 +1157,7 @@ int SwAttrIter::OutAttrWithRange(xub_StrLen nPos) case RES_TXTATR_CJK_RUBY: if ( nPos == *pHt->GetStart() ) { - m_rExport.AttrOutput().StartRuby( rNd, *static_cast< const SwFmtRuby* >( pItem ) ); + m_rExport.AttrOutput().StartRuby( rNd, nPos, *static_cast< const SwFmtRuby* >( pItem ) ); ++nRet; } if ( 0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd ) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index e18df26fcdda..62d02c0a2dbb 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -300,7 +300,7 @@ void WW8AttributeOutput::EndStyle() } void WW8AttributeOutput::StartStyle( const String& rName, bool bPapFmt, USHORT nWwBase, - USHORT nWwNext, USHORT nWwId, USHORT /*nId*/ ) + USHORT nWwNext, USHORT nWwId, USHORT /*nId*/, bool bAutoUpdate ) { BYTE aWW8_STD[ sizeof( WW8_STD ) ]; BYTE* pData = aWW8_STD; @@ -322,12 +322,12 @@ void WW8AttributeOutput::StartStyle( const String& rName, bool bPapFmt, USHORT n if( m_rWW8Export.bWrtWW8 ) { + nBit16 = bAutoUpdate ? 1 : 0; // fAutoRedef : 1 + Set_UInt16( pData, nBit16 ); //-------- jetzt neu: // ab Ver8 gibts zwei Felder mehr: - //UINT16 fAutoRedef : 1; /* auto redefine style when appropriate */ //UINT16 fHidden : 1; /* hidden from UI? */ //UINT16 : 14; /* unused bits */ - pData += sizeof( UINT16 ); } @@ -525,8 +525,13 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, USHORT nPos ) GetStyleData( pFmt, bFmtColl, nBase, nWwNext ); - m_rExport.AttrOutput().StartStyle( pFmt->GetName(), bFmtColl, - nBase, nWwNext, GetWWId( *pFmt ), nPos ); + String aName = pFmt->GetName(); + if ( aName.EqualsAscii( "Default" ) ) + aName = String::CreateFromAscii( "Normal" ); + + m_rExport.AttrOutput().StartStyle( aName, bFmtColl, + nBase, nWwNext, GetWWId( *pFmt ), nPos, + pFmt->IsAutoUpdateFmt() ); if ( bFmtColl ) WriteProperties( pFmt, true, nPos, nBase==0xfff ); // UPX.papx diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 3a005a91b51e..94d65053f94d 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1411,6 +1411,75 @@ public: rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; } }; +// Die Klasse SwAttrIter ist eine Hilfe zum Aufbauen der Fkp.chpx. +// Dabei werden nur Zeichen-Attribute beachtet; Absatz-Attribute brauchen +// diese Behandlung nicht. +// Die Absatz- und Textattribute des Writers kommen rein, und es wird +// mit Where() die naechste Position geliefert, an der sich die Attribute +// aendern. IsTxtAtr() sagt, ob sich an der mit Where() gelieferten Position +// ein Attribut ohne Ende und mit \xff im Text befindet. +// Mit OutAttr() werden die Attribute an der angegebenen SwPos +// ausgegeben. +class SwAttrIter : public MSWordAttrIter +{ +private: + const SwTxtNode& rNd; + + sw::util::CharRuns maCharRuns; + sw::util::cCharRunIter maCharRunIter; + + rtl_TextEncoding meChrSet; + sal_uInt16 mnScript; + bool mbCharIsRTL; + + const SwRedline* pCurRedline; + xub_StrLen nAktSwPos; + USHORT nCurRedlinePos; + + bool mbParaIsRTL; + + const SwFmtDrop &mrSwFmtDrop; + + sw::Frames maFlyFrms; // #i2916# + sw::FrameIter maFlyIter; + + xub_StrLen SearchNext( xub_StrLen nStartPos ); + void FieldVanish( const String& rTxt ); + + void OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool bStart); + + void IterToCurrent(); + + //No copying + SwAttrIter(const SwAttrIter&); + SwAttrIter& operator=(const SwAttrIter&); +public: + SwAttrIter( MSWordExportBase& rWr, const SwTxtNode& rNd ); + + bool IsTxtAttr( xub_StrLen nSwPos ); + bool IsRedlineAtEnd( xub_StrLen nPos ) const; + bool IsDropCap( int nSwPos ); + bool RequiresImplicitBookmark(); + + void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); } + + void OutAttr( xub_StrLen nSwPos, bool bRuby = false ); + virtual const SfxPoolItem* HasTextItem( USHORT nWhich ) const; + virtual const SfxPoolItem& GetItem( USHORT nWhich ) const; + int OutAttrWithRange(xub_StrLen nPos); + const SwRedlineData* GetRedline( xub_StrLen nPos ); + void OutFlys(xub_StrLen nSwPos); + + xub_StrLen WhereNext() const { return nAktSwPos; } + sal_uInt16 GetScript() const { return mnScript; } + bool IsCharRTL() const { return mbCharIsRTL; } + bool IsParaRTL() const { return mbParaIsRTL; } + rtl_TextEncoding GetCharSet() const { return meChrSet; } + String GetSnippet(const String &rStr, xub_StrLen nAktPos, + xub_StrLen nLen) const; + const SwFmtDrop& GetSwFmtDrop() const { return mrSwFmtDrop; } +}; + /// Class to collect and output the styles table. class MSWordStyles { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index b39df7458df2..040ac1609c59 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3774,25 +3774,12 @@ void WW8AttributeOutput::FormatTextGrid( const SwTextGridItem& rGrid ) if (pSwFmt != NULL) { nPageCharSize = ItemGet - (*pSwFmt, RES_CHRATR_CJK_FONTSIZE).GetHeight(); + (*pSwFmt, RES_CHRATR_FONTSIZE).GetHeight(); } + sal_uInt16 nPitch = rGrid.IsSquaredMode() ? rGrid.GetBaseHeight() : + rGrid.GetBaseWidth( ); + INT32 nCharSpace = ( nPitch - nPageCharSize ) * 4096 / 20; - INT32 nCharWidth = rGrid.GetBaseWidth() - nPageCharSize; - INT32 nFraction = 0; - nFraction = nCharWidth % 20; - if ( nCharWidth < 0 ) - nFraction = 20 + nFraction; - nFraction = ( nFraction * 0xFFF ) / 20; - nFraction = ( nFraction & 0x00000FFF ); - - INT32 nMain = 0; - nMain = nCharWidth / 20; - if ( nCharWidth < 0 ) - nMain -= 1; - nMain = nMain * 0x1000; - nMain = ( nMain & 0xFFFFF000 ); - - UINT32 nCharSpace = nFraction + nMain; m_rWW8Export.InsUInt16( NS_sprm::LN_SDxtCharSpace ); m_rWW8Export.InsUInt32( nCharSpace ); } diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index b9d9ba38c246..525c140edfa8 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -74,7 +74,7 @@ public: virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ); /// Output ruby start. - virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby ); + virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ); /// Output ruby end. virtual void EndRuby(); @@ -139,7 +139,8 @@ public: /// Start of a style in the styles table. virtual void StartStyle( const String& rName, bool bPapFmt, - USHORT nBase, USHORT nNext, USHORT nWwIdi, USHORT nId ); + USHORT nBase, USHORT nNext, USHORT nWwIdi, USHORT nId, + bool bAutoUpdate ); /// End of a style in the styles table. virtual void EndStyle(); -- cgit From 5d301a50fafaac401e892d32f36d580b1298bc9e Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 17 Sep 2010 12:52:07 +0200 Subject: sw-ww8-field-fix.diff: WW8 fields import fix i#61075, i#89667, i#111684 --- sw/source/filter/ww8/ww8par5.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 3cbddde5d52b..0f7325362a30 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -985,9 +985,12 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) pStrm->Seek( nOldPos ); //#124725# field codes which contain '/' or '.' are not displayed in WinWord - if (!aStr.EqualsAscii(" ADDIN", 0, 6) && - (aStr.Search('.') != STRING_NOTFOUND || - aStr.Search('/') != STRING_NOTFOUND)) + xub_StrLen nSpacePos = aStr.Search( ' ', 1 ); + if ( STRING_NOTFOUND == nSpacePos ) + nSpacePos = aStr.Len( ); + xub_StrLen nSearchPos = STRING_NOTFOUND; + if ( ( ( nSearchPos = aStr.Search('.') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) || + ( ( nSearchPos = aStr.Search('/') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) ) return aF.nLen; else return aF.nLen - aF.nLRes - 1; // so viele ueberlesen, das Resultfeld -- cgit From be7e116c45073eeeccdb951963acb1f301ec2d6a Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 17 Sep 2010 12:54:17 +0200 Subject: sw-ww8-styles-import-fix.diff: wrong style import in french i#21939 --- sw/source/filter/ww8/writerwordglue.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 15baac0f3498..db37f69b00b8 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -162,7 +162,7 @@ namespace myImplHelpers RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_LISTS_BEGIN, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, - RES_NONE, RES_NONE, RES_POOLCOLL_DOC_TITEL, RES_NONE, + RES_NONE, RES_NONE, RES_POOLCOLL_HEADLINE_BASE, RES_NONE, RES_POOLCOLL_SIGNATURE, RES_NONE, RES_POOLCOLL_TEXT, RES_POOLCOLL_TEXT_MOVE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_DOC_SUBTITEL -- cgit From b0539229b1a31925d28a13f9bbda6fd672729bd6 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 17 Sep 2010 12:57:18 +0200 Subject: sw-ww8-ruby-export-fix.diff: Fixed wrong ruby export in WW8 i#79246 --- sw/source/filter/ww8/wrtw8nds.cxx | 9 ++++++++- sw/source/filter/ww8/ww8scan.cxx | 15 +++++++++++++++ sw/source/filter/ww8/ww8scan.hxx | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 37ac58eb571c..66222b7772aa 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -741,7 +741,14 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/, aStr += String::CreateFromInt32(nHeight); aStr += '('; aStr += rRuby.GetText(); - aStr.APPEND_CONST_ASC( ");" ); + aStr.APPEND_CONST_ASC( ")" ); + + // The parameter separator depends on the FIB.lid + if ( m_rWW8Export.pFib->getNumDecimalSep() == '.' ) + aStr.APPEND_CONST_ASC( "," ); + else + aStr.APPEND_CONST_ASC( ";" ); + m_rWW8Export.OutputField( 0, ww::eEQ, aStr, WRITEFIELD_START | WRITEFIELD_CMD_START ); } diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index d318522100cf..335a09aea705 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -47,8 +47,11 @@ #include // DELETEZ #endif // dump +#include +#include #include #include +#include #include // Application #i90932# #include @@ -58,6 +61,8 @@ if (!(aCon)) \ return aRet; +using namespace ::com::sun::star::lang; + //-begin namespace SL { @@ -5649,6 +5654,16 @@ WW8Fib::WW8Fib(BYTE nVer) break; }; // <-- #i90932# + + Locale aTempLocale; + SvxLanguageToLocale( aTempLocale, lid ); + LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale ); + nNumDecimalSep = aLocaleWrapper.getNumDecimalSep().GetChar( 0 ); +} + +sal_Unicode WW8Fib::getNumDecimalSep() const +{ + return nNumDecimalSep; } bool WW8Fib::WriteHeader(SvStream& rStrm) diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 33d40bcf4c0d..e6d8a1449683 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -988,6 +988,9 @@ public: */ class WW8Fib { +private: + sal_Unicode nNumDecimalSep; + public: /** Program-Version asked for by us: @@ -1445,6 +1448,7 @@ public: static rtl_TextEncoding GetFIBCharset(UINT16 chs); ww::WordVersion GetFIBVersion() const; WW8_CP GetBaseCp(ManTypes nType) const; + sal_Unicode getNumDecimalSep() const; }; class WW8Style -- cgit From abc28ea4caf24bd603cc701124a6afd99d4b70ef Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 17 Sep 2010 14:21:21 +0300 Subject: Workaround for default_images symlink problem on Cygwin --- set_soenv.in | 9 ++- solenv/inc/_tg_rslb.mk | 160 ++++++++++++++++++++++++------------------------- solenv/inc/tg_rslb.mk | 16 ++--- 3 files changed, 95 insertions(+), 90 deletions(-) diff --git a/set_soenv.in b/set_soenv.in index d050c4bd1141..27de8335f18b 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -70,7 +70,7 @@ my ( $BIG_SVX, $COM, $ARCH, $CPU, $CPUNAME, $CVER, $GLIBC, $GUI, $GUIBASE, #------------------------------------------- # # Help variables. -my ( $USR, $ETC, $BIN, $LIB, $LIB64, $INC, $INCLUDE, $DEV, $OPT, $LOCAL, $SOLENV, $SOLVER, $CONFIG, +my ( $USR, $ETC, $BIN, $LIB, $LIB64, $INC, $INCLUDE, $DEV, $OPT, $LOCAL, $SOLENV, $SOLVER, $CONFIG, $DEFIMGS, $USR_BIN, $USR_LIB, $USR_LOCAL, $USR_CCS, $JAVA_BIN, $JAVA_LIB, $JAVA_INCLUDE, $SOLARENVINC, $USR_DT, $USR_OPENWIN, $XLIB, $XINC, $CYGWIN_PATH, $language, $dict, $ASM_PATH, $NSIS_PATH, $ps_STLPORT_LIB, $L_STLPORT_LIB, @@ -79,7 +79,7 @@ my ( $USR, $ETC, $BIN, $LIB, $LIB64, $INC, $INCLUDE, $DEV, $OPT, $LOCAL, $SOLENV # Environment variables. my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAVA_HOME, $JDK, $JAVAFLAGS, $OOO_SHELL, $UPD, $WORK_STAMP, $SOURCE_ROOT_DIR , - $SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $SOLARENV, + $SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $SOLARENV, $SOLARDEFIMG, $STAR_INIROOT, $STAR_INIROOTOLD, $STAR_STANDLST, $STAR_SSCOMMON, $STAR_SSOLARINI, $DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH, $MSPDB_PATH, $MIDL_PATH, $CSC_PATH, @@ -907,6 +907,7 @@ $OPT = $ds."opt"; $LOCAL = $ds."local"; $SOLENV = $ds."solenv"; $SOLVER = $ds."solver"; +$DEFIMGS = $ds."default_images"; $CONFIG = $ds."config"; $USR_BIN = $USR.$BIN; $USR_LIB = $USR.$LIB64; @@ -1009,6 +1010,9 @@ else #Location of Solar version. $SOLARVERSION = '$SOLARVER'; +#Some directories that are symlinks under rawbuild, have to use realpath on Cygwin +$SOLARDEFIMG = PathFormat($SRC_ROOT.$DEFIMGS); + $SOLARENVINC = '$SOLARENV'.$INC; # Location of $LOCALINI = '$SOLARENV'.$CONFIG; @@ -1731,6 +1735,7 @@ ToFile( "WORK_STAMP", $WORK_STAMP, "e" ); ToFile( "SOLARVER", $SOLARVER, "e" ); ToFile( "SOLARVERSION", $SOLARVERSION, "e" ); ToFile( "SOLARENV", $SOLARENV, "e" ); +ToFile( "SOLARDEFIMG", $SOLARDEFIMG, "e" ); ToFile( "SOLARENVINC", $SOLARENVINC, "e" ); ToFile( "LOCALINI", $LOCALINI, "e" ); ToFile( "STAR_INIROOT", $STAR_INIROOT, "e" ); diff --git a/solenv/inc/_tg_rslb.mk b/solenv/inc/_tg_rslb.mk index 273ac8dabe1b..8248733fb6fb 100644 --- a/solenv/inc/_tg_rslb.mk +++ b/solenv/inc/_tg_rslb.mk @@ -29,11 +29,11 @@ $(RSC_MULTI1) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB1NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC1HEADER) $(RESLIB1SRSFILES) \ @@ -44,11 +44,11 @@ $(RSC_MULTI1) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB1NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC1HEADER) $(RESLIB1SRSFILES) \ @@ -106,11 +106,11 @@ $(RSC_MULTI2) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB2NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC2HEADER) $(RESLIB2SRSFILES) \ @@ -121,11 +121,11 @@ $(RSC_MULTI2) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB2NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC2HEADER) $(RESLIB2SRSFILES) \ @@ -183,11 +183,11 @@ $(RSC_MULTI3) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB3NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC3HEADER) $(RESLIB3SRSFILES) \ @@ -198,11 +198,11 @@ $(RSC_MULTI3) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB3NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC3HEADER) $(RESLIB3SRSFILES) \ @@ -260,11 +260,11 @@ $(RSC_MULTI4) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB4NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC4HEADER) $(RESLIB4SRSFILES) \ @@ -275,11 +275,11 @@ $(RSC_MULTI4) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB4NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC4HEADER) $(RESLIB4SRSFILES) \ @@ -337,11 +337,11 @@ $(RSC_MULTI5) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB5NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC5HEADER) $(RESLIB5SRSFILES) \ @@ -352,11 +352,11 @@ $(RSC_MULTI5) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB5NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC5HEADER) $(RESLIB5SRSFILES) \ @@ -414,11 +414,11 @@ $(RSC_MULTI6) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB6NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC6HEADER) $(RESLIB6SRSFILES) \ @@ -429,11 +429,11 @@ $(RSC_MULTI6) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB6NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC6HEADER) $(RESLIB6SRSFILES) \ @@ -491,11 +491,11 @@ $(RSC_MULTI7) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB7NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC7HEADER) $(RESLIB7SRSFILES) \ @@ -506,11 +506,11 @@ $(RSC_MULTI7) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB7NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC7HEADER) $(RESLIB7SRSFILES) \ @@ -568,11 +568,11 @@ $(RSC_MULTI8) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB8NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC8HEADER) $(RESLIB8SRSFILES) \ @@ -583,11 +583,11 @@ $(RSC_MULTI8) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB8NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC8HEADER) $(RESLIB8SRSFILES) \ @@ -645,11 +645,11 @@ $(RSC_MULTI9) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB9NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC9HEADER) $(RESLIB9SRSFILES) \ @@ -660,11 +660,11 @@ $(RSC_MULTI9) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB9NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC9HEADER) $(RESLIB9SRSFILES) \ @@ -722,11 +722,11 @@ $(RSC_MULTI10) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB10NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC10HEADER) $(RESLIB10SRSFILES) \ @@ -737,11 +737,11 @@ $(RSC_MULTI10) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB10NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC10HEADER) $(RESLIB10SRSFILES) \ diff --git a/solenv/inc/tg_rslb.mk b/solenv/inc/tg_rslb.mk index 40096386c436..913608e01db1 100644 --- a/solenv/inc/tg_rslb.mk +++ b/solenv/inc/tg_rslb.mk @@ -57,11 +57,11 @@ $(RSC_MULTI$(TNR)) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB$(TNR)NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \ -ft=$@ \ $(RSC$(TNR)HEADER) $(RESLIB$(TNR)SRSFILES) \ @@ -72,11 +72,11 @@ $(RSC_MULTI$(TNR)) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB$(TNR)NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \ - -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \ - -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \ + -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ + -subMODULE=$(SOLARDEFIMG) \ + -subGLOBALRES=$(SOLARDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC$(TNR)HEADER) $(RESLIB$(TNR)SRSFILES) \ -- cgit From f31e60cb3afcb918e1bad4523dd12239ea27caa5 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 17 Sep 2010 13:53:24 +0200 Subject: build-java-target.diff: allow to define java target i#93115 allow to define java target, so the build is usable with the JVM 1.5 even when it is built with JDK 1.6 --- hsqldb/makefile.mk | 2 +- rhino/makefile.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hsqldb/makefile.mk b/hsqldb/makefile.mk index 6b3166aad4c5..8b3d5b131ada 100755 --- a/hsqldb/makefile.mk +++ b/hsqldb/makefile.mk @@ -66,7 +66,7 @@ BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f .IF "$(debug)"!="" BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.debug="on" -f $(ANT_BUILDFILE) jar .ELSE -BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar +BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar .ENDIF .ENDIF diff --git a/rhino/makefile.mk b/rhino/makefile.mk index 008fb0caef2d..9f42ca2c8f83 100755 --- a/rhino/makefile.mk +++ b/rhino/makefile.mk @@ -53,7 +53,7 @@ JAVA_HOME= .EXPORT : JAVA_HOME BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj jar .ELSE -BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" jar +BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) jar .ENDIF # --- Targets ------------------------------------------------------ -- cgit From 1be9309c494323426c18b76cbdec0ec6244b2325 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 17 Sep 2010 13:54:46 +0200 Subject: build-java-target.diff: allow to define java target i#93115 allow to define java target, so the build is usable with the JVM 1.5 even when it is built with JDK 1.6 --- qadevOOo/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qadevOOo/makefile.mk b/qadevOOo/makefile.mk index 8d8b4ab725f6..612b8668a934 100755 --- a/qadevOOo/makefile.mk +++ b/qadevOOo/makefile.mk @@ -43,7 +43,7 @@ TST: .IF "$(SOLAR_JAVA)"=="TRUE" .IF "$(ANT_HOME)"!="NO_ANT_HOME" -ANT_FLAGS+=-Dbuild.source=1.5 +ANT_FLAGS+=-Dbuild.source=$(JAVA_SOURCE_VER) .IF "$(L10N_framework)"=="" ALLTAR: ANTBUILD .ENDIF -- cgit From 322d73b0df93b8e555d411f7ad9d8fc7c79248be Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 17 Sep 2010 13:51:40 +0200 Subject: build-java-target.diff: allow to define java target i#93115 allow to define java target, so the build is usable with the JVM 1.5 even when it is built with JDK 1.6 --- configure.in | 62 +++++++++++++++++++++++++++++++++++++++++++++++ set_soenv.in | 3 +++ solenv/inc/antsettings.mk | 29 ++++++++++++---------- solenv/inc/settings.mk | 3 +++ 4 files changed, 84 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 06b8262f2da0..e18c46fe68e5 100644 --- a/configure.in +++ b/configure.in @@ -611,6 +611,17 @@ AC_ARG_WITH(java, no support for Java components, applets, accessibility or XML filters. ], if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi, WITH_JAVA=java) +AC_ARG_WITH(java_target_version, +[ --with-java-target-version Generate class files that will work on JVMs with + the specified version. For example, use + --with-java-target-version=1.4 to make sure that the + application will work with JVM 1.4 even when compiled + with JDK 1.5. + + This option is ignored when you compile with gcj/gij. + + Usage: --with-java-target-version= +],,) AC_ARG_ENABLE(gcjaot, [ --enable-gcjaot Build with[[out]] using Ahead of Time java compilation support to speed up buildsi by compiling the jars also @@ -2985,6 +2996,44 @@ else JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME fi +_java_target_ver="1.5" +dnl =================================================================== +dnl Check for target java bytecode version +dnl =================================================================== +if test "$SOLAR_JAVA" != ""; then + AC_MSG_CHECKING([for target java bytecode version]) + if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then + AC_MSG_RESULT([default by $JDK]) + if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then + AC_MSG_WARN([Value defined by --with-java-target-version is ignored!]) + fi + else + if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then + _java_target_ver="$with_java_target_version" + AC_MSG_RESULT([$_java_target_ver]) + elif test $_jdk_ver -gt 10000 ; then + _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'` + AC_MSG_RESULT([$_java_target_ver]) + else + AC_MSG_ERROR([Unable to guess java bytecode version from java version!]) + fi + fi + + if ! test -z "$_java_target_ver" -o \ + "$_java_target_ver" = "1.1" -o \ + "$_java_target_ver" = "1.2" -o \ + "$_java_target_ver" = "1.3" -o \ + "$_java_target_ver" = "1.4" -o \ + "$_java_target_ver" = "1.5" -o \ + "$_java_target_ver" = "1.6" -o \ + "$_java_target_ver" = "5" ; then + AC_MSG_ERROR([$_java_target_ver is not supported java bytecode version!]) + fi + + JAVA_SOURCE_VER="$_java_target_ver" + JAVA_TARGET_VER="$_java_target_ver" +fi + dnl =================================================================== dnl Checks for javac dnl =================================================================== @@ -3045,6 +3094,17 @@ if test "$SOLAR_JAVA" != ""; then fi AC_SUBST(JAVACISGCJ) +JAVACISKAFFE="" +dnl =================================================================== +dnl Checks that javac is kaffe +dnl =================================================================== +if test "$SOLAR_JAVA" != ""; then + if test `$JAVACOMPILER -version 2>&1 | grep -c "Kaffe"` -gt 0; then + JAVACISKAFFE="yes" + fi +fi +AC_SUBST(JAVACISKAFFE) + dnl =================================================================== dnl Checks for javadoc dnl =================================================================== @@ -3259,6 +3319,8 @@ fi AC_SUBST(JAVA_HOME) AC_SUBST(JDK) AC_SUBST(JAVAFLAGS) +AC_SUBST(JAVA_SOURCE_VER) +AC_SUBST(JAVA_TARGET_VER) AC_SUBST(JAVAINTERPRETER) AC_SUBST(JAVAIFLAGS) AC_SUBST(JAVACOMPILER) diff --git a/set_soenv.in b/set_soenv.in index 27de8335f18b..5b5ab4b2022c 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -1747,6 +1747,7 @@ ToFile( "DMAKEROOT", $DMAKEROOT, "e" ); if ( $JDK ne "gcj" ) { ToFile( "CLASSPATH", $CLASSPATH, "e" ); ToFile( "XCLASSPATH", $XCLASSPATH, "e" ); + ToFile( "JAVACISKAFFE", '@JAVACISKAFFE@', "e" ); } else { ToFile( "JAVACISGCJ", '@JAVACISGCJ@', "e" ); @@ -1758,6 +1759,8 @@ if ( '@JDK@' ne '' ) { ToFile( "JDK", "@JDK@", "e" ); ToFile( "JAVAFLAGS", "@JAVAFLAGS@", "e" ); + ToFile( "JAVA_SOURCE_VER", "@JAVA_SOURCE_VER@","e" ); + ToFile( "JAVA_TARGET_VER", "@JAVA_TARGET_VER@","e" ); ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" ); ToFile( "JAVAIFLAGS", "@JAVAIFLAGS@", "e" ); ToFile( "JAVACOMPILER", PathFormat("@JAVACOMPILER@"), "e" ); diff --git a/solenv/inc/antsettings.mk b/solenv/inc/antsettings.mk index 5a28b242967d..a06d7c90d6eb 100644 --- a/solenv/inc/antsettings.mk +++ b/solenv/inc/antsettings.mk @@ -40,6 +40,18 @@ PATH!:=$(ANT_HOME)/bin:$(PATH) ANT*:=$(ANT_HOME)/bin/ant ANT_BUILDFILE*=build.xml +.IF "$(ANT_COMPILER_FLAGS)"=="" +.IF "$(JAVACISGCJ)" == "yes" +ANT_COMPILER_FLAGS=-Dbuild.compiler=gcj +.ENDIF +.ENDIF + +.IF "$(ANT_JAVA_VER_FLAGS)"=="" +.IF "$(JDK)" != "gcj" && $(JAVACISKAFFE) != "yes" +ANT_JAVA_VER_FLAGS=-Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) +.ENDIF +.ENDIF + .IF "$(ANT_DEBUG)"=="" .IF "$(debug)"=="" ANT_DEBUG=off @@ -61,21 +73,12 @@ JAVA_HOME= .EXPORT : JAVA_HOME .ENDIF -.IF "$(JAVACISGCJ)" == "yes" -ANT_FLAGS!:=-Dbuild.compiler=gcj -Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) \ - -Doptimize=$(ANT_OPT) -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) \ - -Dproext="$(PROEXT)" -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) \ - -Dsolar.doc=$(SOLARDOCDIR) -Dcommon.jar=$(SOLARCOMMONBINDIR) \ +ANT_FLAGS!:=$(ANT_COMPILER_FLAGS) -Dprj=$(PRJ) -Dprjname=$(PRJNAME) $(ANT_JAVA_VER_FLAGS) \ + -Ddebug=$(ANT_DEBUG) -Doptimize=$(ANT_OPT) -Dtarget=$(TARGET) -Dsolar.update=on \ + -Dout=$(OUT) -Dinpath=$(INPATH) -Dproext="$(PROEXT)" -Dsolar.bin=$(SOLARBINDIR) \ + -Dsolar.jar=$(SOLARBINDIR) -Dsolar.doc=$(SOLARDOCDIR) -Dcommon.jar=$(SOLARCOMMONBINDIR) \ -Dcommon.doc=$(SOLARCOMMONDOCDIR) -Dsolar.sourceversion=$(SOURCEVERSION) \ -Dsolar.lastminor=$(LAST_MINOR) -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs -.ELSE -ANT_FLAGS!:=-Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) -Doptimize=$(ANT_OPT) \ - -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) -Dproext="$(PROEXT)" \ - -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) -Dsolar.doc=$(SOLARDOCDIR) \ - -Dcommon.jar=$(SOLARCOMMONBINDIR) -Dcommon.doc=$(SOLARCOMMONDOCDIR) \ - -Dsolar.sourceversion=$(SOURCEVERSION) -Dsolar.lastminor=$(LAST_MINOR) \ - -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs -.ENDIF .ELSE # No java ANT= ANT_FLAGS= diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk index dbf2ad59d91b..e2cf99050ca4 100644 --- a/solenv/inc/settings.mk +++ b/solenv/inc/settings.mk @@ -147,6 +147,9 @@ JAVAI:=$(JAVAINTERPRETER) .IF "$(JAVACISGCJ)" == "yes" JAVAC+=--encoding=UTF-8 -O2 -fno-assert -Wno-deprecated -C .ENDIF +.IF "$(JDK)" != "gcj" && $(JAVACISKAFFE) != "yes" +JAVAC+=-source $(JAVA_SOURCE_VER) -target $(JAVA_TARGET_VER) +.ENDIF #classpath and response .IF "$(JDK)" == "J++" -- cgit From a335271014d8a0d48ce5d0c826193f5d7963eef4 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 17 Sep 2010 14:28:05 +0200 Subject: Fixed problem when backporting sal-strintern-speed.diff --- sal/rtl/source/hash.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx index 86454545ccd5..aee80cb07ac7 100644 --- a/sal/rtl/source/hash.cxx +++ b/sal/rtl/source/hash.cxx @@ -44,8 +44,6 @@ typedef StringHashTableImpl StringHashTable; static StringHashTable *rtl_str_hash_new (sal_uInt32 nSize); static void rtl_str_hash_free (StringHashTable *pHash); -} - StringHashTable * getHashTable () { -- cgit From e60de95c7a04ab2608cd7f40247c24b87ac74e04 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 17 Sep 2010 16:30:03 +0300 Subject: Workaround for default_images symlink problem on Cygwin --- connectivity/source/drivers/hsqldb/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/hsqldb/makefile.mk b/connectivity/source/drivers/hsqldb/makefile.mk index e1a953055c04..21274e8d4257 100644 --- a/connectivity/source/drivers/hsqldb/makefile.mk +++ b/connectivity/source/drivers/hsqldb/makefile.mk @@ -56,7 +56,7 @@ RES1FILELIST=\ $(SRS)$/$(TARGET).srs RESLIB1NAME=$(TARGET) -RESLIB1IMAGES=$(SOLARSRC)$/$(RSCDEFIMG)$/database +RESLIB1IMAGES=$(SOLARDEFIMG)$/database RESLIB1SRSFILES=$(RES1FILELIST) # Note that the resource file built here is currently *not* included -- cgit From 9fdc831a2a743de3d0e2af443a01fcc1e385fa07 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 17 Sep 2010 16:21:41 +0200 Subject: Kill an empty and unneeded #ifdef. --- sal/inc/sal/config.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h index 7b2bd5154bc8..1e8656a3ec14 100644 --- a/sal/inc/sal/config.h +++ b/sal/inc/sal/config.h @@ -28,14 +28,6 @@ #ifndef _SAL_CONFIG_H_ #define _SAL_CONFIG_H_ -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - #ifndef INCLUDED_STDLIB_H #include #define INCLUDED_STDLIB_H -- cgit From a00b455f9b601b8a296e70b2471c2fd1b520c968 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 18 Sep 2010 10:06:58 +0300 Subject: Workaround for default_images symlink problem on Cygwin --- cui/util/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cui/util/makefile.mk b/cui/util/makefile.mk index cf2a6fcc3dc5..a5a2fc28da87 100644 --- a/cui/util/makefile.mk +++ b/cui/util/makefile.mk @@ -97,7 +97,7 @@ SRSFILELIST=\ RESLIB1NAME=cui -RESLIB1IMAGES=$(SOLARSRC)/$(RSCDEFIMG)/svx/res +RESLIB1IMAGES=$(SOLARDEFIMG)/svx/res RESLIB1SRSFILES= $(SRSFILELIST) # --- Targets ------------------------------------------------------- -- cgit From edd991b20a18642e22b97808fc0ceec6a553b37f Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Mon, 20 Sep 2010 09:36:53 +0200 Subject: Download relevant tarballs from download.go-oo.org --- ooo.lst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ooo.lst b/ooo.lst index 9f51cf668a73..8e047fcee0b9 100755 --- a/ooo.lst +++ b/ooo.lst @@ -42,14 +42,12 @@ a06a496d7a43cbdc35e69dbe678efadb-libloader.zip a169ab152209200a7bad29a275cb0333-seamonkey-1.1.14.source.tar.gz a4d9b30810a434a3ed39fc0003bbd637-LICENSE_stax-api-1.0-2-sources.html a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip -abc405d0bdd3ee22782d7aa20e440f08-zlib-1.1.4.tar.gz ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz ba1015b59c112d44d7797b62fe7bee51-neon-0.29.3.tar.gz bc702168a2af16869201dbe91e46ae48-LICENSE_Python-2.6.1 c441926f3a552ed3e5b274b62e86af16-STLport-4.0.tar.gz ca66e26082cab8bb817185a116db809b-redland-1.0.8.tar.gz -cd5997284f4ba1e8dde5d1e5869fc342-libwpd-0.8.8.tar.gz d0b5af6e408b8d2958f3d83b5244f5e8-hyphen-2.4.tar.gz d1a3205871c3c52e8a50c9f18510ae12-libformula.zip d35724900f6a4105550293686688bbb3-silgraphite-2.3.1.tar.gz @@ -73,3 +71,12 @@ fe5b3e2b7c4577f30dc001054365653e-dejavu-fonts-ttf-2.30.zip 831126a1ee5af269923cfab6050769fe-mysql-connector-cpp.zip 067201ea8b126597670b5eff72e1f66c-mythes-1.2.0.tar.gz cf8a6967f7de535ae257fa411c98eb88-mdds_0.3.0.tar.bz2 +http://download.go-oo.org/src +47e1edaa44269bc537ae8cabebb0f638-JLanguageTool-1.0.0.tar.bz2 +90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2 +debc62758716a169df9f62e6ab2bc634-zlib-1.2.3.tar.gz +http://download.go-oo.org/SRC680 +799fc3b835a79adce8c88a3fee0150c1-libwps-0.1.2.tar.gz +db556b750bf3eac8481a4cc5e29e5af1-libwpg-0.1.3.tar.gz +http://download.go-oo.org/libwpd +64d66018897d759358f454010b6e75d2-libwpd-0.8.14.tar.gz -- cgit From b8481c68dddb099ef52803523250a403f4d2ccbb Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 21 Sep 2010 12:16:04 +0200 Subject: piece-postprocess.diff: Ignore checkdeliver for the while --- postprocess/checkdeliver/makefile.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/postprocess/checkdeliver/makefile.mk b/postprocess/checkdeliver/makefile.mk index dfbd5c317de1..ad6f5c0db524 100644 --- a/postprocess/checkdeliver/makefile.mk +++ b/postprocess/checkdeliver/makefile.mk @@ -38,6 +38,7 @@ TARGET=checkdeliver ALLTAR : $(MISC)$/checkdeliver.done $(MISC)$/checkdeliver.done .PHONY: - @-$(RM) $(MISC)$/checkdeliver_log.txt - $(PERL) checkdeliver.pl -l $(MISC)$/checkdeliver_log.txt && $(TOUCH) $@ + # FIXME: the output was always ignored until ooo320-m15; it would be nice to check it though + # $(PERL) checkdeliver.pl && $(TOUCH) $@ + $(TOUCH) $@ -- cgit From 149d18600b6619a97b04f026afa84fb8a6d7a1e2 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 21 Sep 2010 12:53:14 +0100 Subject: fix smoketest --- solenv/inc/installationtest.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk index 6806e15c69e7..322ba4d9ac3b 100644 --- a/solenv/inc/installationtest.mk +++ b/solenv/inc/installationtest.mk @@ -56,7 +56,7 @@ my_sofficepath = \ $(installationtest_instpath)'/opt/OpenOffice.org 3/program/soffice.exe' .ELSE my_sofficepath = \ - $(installationtest_instpath)/opt/openoffice.org3/program/soffice + $(installationtest_instpath)/opt/program/soffice .END .IF "$(OOO_TEST_SOFFICE)" == "" -- cgit From a5f00c67dc374896ff6bfcd0cdc771ec6758cfaf Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 21 Sep 2010 15:42:27 +0200 Subject: Use the fetched 185d60944ea767075d27247c3162b3bc-unowinreg.dll --- odk/source/unowinreg/win/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odk/source/unowinreg/win/makefile.mk b/odk/source/unowinreg/win/makefile.mk index 077d8aa60aac..605848b3f7b7 100644 --- a/odk/source/unowinreg/win/makefile.mk +++ b/odk/source/unowinreg/win/makefile.mk @@ -69,7 +69,7 @@ $(BIN)$/unowinreg.dll : unowinreg.cxx .ELSE -$(BIN)$/unowinreg.dll : $(SOLARVERSION)$/$(INPATH)$/bin$(UPDMINOREXT)$/unowinreg.dll +$(BIN)$/unowinreg.dll : $(TARFILE_LOCATION)/185d60944ea767075d27247c3162b3bc-unowinreg.dll @@-rm -f $@ $(GNUCOPY) $< $@ -- cgit From 37cf85e2feaef2ddc9d1e7db66f5aca0d1d3fb84 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 21 Sep 2010 15:08:03 +0200 Subject: better unowinreg.dll configure check There was dead-lock; configure did not pass without unowinreg.dll; fetch_tarballs.sh did not work without configure => always fetch unowinreg.dll; do not require it in configure; add --enable-build-unowinreg if you want to force rebuild --- configure.in | 25 +++++++++++++------------ ooo.lst | 2 ++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index e18c46fe68e5..6dfa4dd6aea4 100644 --- a/configure.in +++ b/configure.in @@ -819,6 +819,12 @@ AC_ARG_WITH(zip-home, Usage: --with-zip-home= ],,) +AC_ARG_ENABLE(build-unowinreg, +[ --enable-build-unowinreg Do not use the prebuilt unowinreg.dll. Build it instead. + The MinGW C++ compiler is needed on Linux. + + Usage: --enable-build-unowinreg +],,) AC_ARG_WITH(mingwin, [ --with-mingwin For Windows users, use the mingwin32 compiler within cygwin environment @@ -3622,21 +3628,16 @@ AC_MSG_CHECKING([whether to build the ODK]) if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then AC_MSG_RESULT([yes]) if test "$WITH_JAVA" != "no"; then - AC_MSG_CHECKING([for external/unowinreg/unowinreg.dll]) - if ! test -f "./external/unowinreg/unowinreg.dll"; then - HAVE_UNOWINREG_DLL=no - else - HAVE_UNOWINREG_DLL=yes + AC_MSG_CHECKING([whether to build unowinreg.dll]) + if test "$_os" = "WINNT" -a "z$enable_build_unowinreg" = "z" ; then + # build on Win by default + enable_build_unowinreg=yes fi - if test "$HAVE_UNOWINREG_DLL" = "yes"; then - AC_MSG_RESULT([found]) + if test "z$enable_build_unowinreg" = "z" -o "$enable_build_unowinreg" = "no"; then + AC_MSG_RESULT([no]) BUILD_UNOWINREG=NO else - if test "$_os" = "WINNT"; then - AC_MSG_RESULT([not found, will be built]) - else - AC_MSG_WARN([not found, will be cross-built using mingw32]) - fi + AC_MSG_RESULT([yes]) BUILD_UNOWINREG=YES fi if test "$_os" != "WINNT" && test "$BUILD_UNOWINREG" = "YES"; then diff --git a/ooo.lst b/ooo.lst index 8e047fcee0b9..3e379fa33937 100755 --- a/ooo.lst +++ b/ooo.lst @@ -80,3 +80,5 @@ http://download.go-oo.org/SRC680 db556b750bf3eac8481a4cc5e29e5af1-libwpg-0.1.3.tar.gz http://download.go-oo.org/libwpd 64d66018897d759358f454010b6e75d2-libwpd-0.8.14.tar.gz +http://download.go-oo.org/extern +185d60944ea767075d27247c3162b3bc-unowinreg.dll -- cgit From 7ea508e89e22cd48c8868f6e132aa79c0a36bc04 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 21 Sep 2010 16:33:40 +0200 Subject: Call fetch_tarballs.sh from make --- Makefile.in | 1 + set_soenv.in | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 978e19301cba..2b201b3876eb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,6 +4,7 @@ SHELL=/bin/sh all: . ./*[Ee]nv.[Ss]et.sh && \ + ./fetch_tarballs.sh ooo.lst && \ ./bootstrap && \ cd instsetoo_native && ../solenv/bin/build.pl -P@BUILD_NCPUS@ --all -P@BUILD_MAX_JOBS@ diff --git a/set_soenv.in b/set_soenv.in index 5b5ab4b2022c..068389dcb973 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -2118,9 +2118,6 @@ print "*********************************************************". "******************* $newline"; print "\nTo build, do:\n"; -print " \$ source $outfile.sh\n"; -print " \$ ./bootstrap\n"; -print " \$ ./fetch_tarballs.sh\n"; print " \$ make\n\n"; print "Developer installation (after you have built):\n"; print " \$ make dev-install\n\n"; -- cgit From d8128261e661247d435c8b0cb49bcf25f127101e Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 21 Sep 2010 17:40:45 +0200 Subject: Properly catch unknown cpu number situation --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 6dfa4dd6aea4..69b5529fb1b4 100644 --- a/configure.in +++ b/configure.in @@ -7387,7 +7387,7 @@ BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l` if test "z$with_num_cpus" != "z"; then BUILD_NCPUS=$with_num_cpus fi -if test "$BUILD_NCPUS" = "0" ; then +if echo "$BUILD_NCPUS" | $EGREP -q '^[[[:space:]]]*0[[[:space:]]]*$' ; then BUILD_NCPUS=1 fi AC_MSG_RESULT([$BUILD_NCPUS]) -- cgit From b12337c8ae206a5ed7fcf14727b0c2627a9a1731 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 21 Sep 2010 20:16:16 +0200 Subject: Revert "idlc-error-offset.diff: Add character offset for idlc errors" Breaks bison on OSX. This reverts commit 55c5db853fc0d96179874b4c01dba2774ecf5cd1. --- idlc/inc/idlc/idlc.hxx | 8 -------- idlc/source/errorhandler.cxx | 15 +++------------ idlc/source/idlc.cxx | 2 -- idlc/source/parser.y | 7 +------ idlc/source/scanner.ll | 33 ++++++++++----------------------- 5 files changed, 14 insertions(+), 51 deletions(-) diff --git a/idlc/inc/idlc/idlc.hxx b/idlc/inc/idlc/idlc.hxx index 663698143f7e..cec8e58900fb 100644 --- a/idlc/inc/idlc/idlc.hxx +++ b/idlc/inc/idlc/idlc.hxx @@ -102,12 +102,6 @@ public: { m_warningCount++; } sal_uInt32 getLineNumber() { return m_lineNumber; } - sal_uInt32 getOffsetStart() - { return m_offsetStart; } - sal_uInt32 getOffsetEnd() - { return m_offsetEnd; } - void setOffset( sal_uInt32 start, sal_uInt32 end) - { m_offsetStart = start; m_offsetEnd = end; } void setLineNumber(sal_uInt32 lineNumber) { m_lineNumber = lineNumber; } void incLineNumber() @@ -142,8 +136,6 @@ private: sal_uInt32 m_errorCount; sal_uInt32 m_warningCount; sal_uInt32 m_lineNumber; - sal_uInt32 m_offsetStart; - sal_uInt32 m_offsetEnd; ParseState m_parseState; StringSet m_includes; }; diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx index 2bc8a6699403..4ab4844eeca7 100644 --- a/idlc/source/errorhandler.cxx +++ b/idlc/source/errorhandler.cxx @@ -488,7 +488,7 @@ static OString flagToString(sal_uInt32 flag) return flagStr; } -static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber, sal_uInt32 start, sal_uInt32 end) +static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber) { OString file; if ( idlc()->getFileName() == idlc()->getRealFileName() ) @@ -496,23 +496,14 @@ static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber, sal_uInt32 start, else file = idlc()->getFileName(); - fprintf(stderr, "%s:%lu [%lu:%lu] : %s", file.getStr(), + fprintf(stderr, "%s(%lu) : %s", file.getStr(), sal::static_int_cast< unsigned long >(lineNumber), - sal::static_int_cast< unsigned long >(start), - sal::static_int_cast< unsigned long >(end), errorCodeToMessage(eCode)); } -static void errorHeader(ErrorCode eCode, sal_uInt32 lineNumber) -{ - errorHeader(eCode, lineNumber, - idlc()->getOffsetStart(), idlc()->getOffsetEnd()); -} - static void errorHeader(ErrorCode eCode) { - errorHeader(eCode, idlc()->getLineNumber(), - idlc()->getOffsetStart(), idlc()->getOffsetEnd()); + errorHeader(eCode, idlc()->getLineNumber()); } static void warningHeader(WarningCode wCode) diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx index f8317f3b55c0..1477739cd531 100644 --- a/idlc/source/idlc.cxx +++ b/idlc/source/idlc.cxx @@ -219,8 +219,6 @@ Idlc::Idlc(Options* pOptions) , m_errorCount(0) , m_warningCount(0) , m_lineNumber(0) - , m_offsetStart(0) - , m_offsetEnd(0) , m_parseState(PS_NoState) { m_pScopes = new AstStack(); diff --git a/idlc/source/parser.y b/idlc/source/parser.y index b6c56c60faaf..8da9c7ad63b5 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -103,16 +103,13 @@ #include #include - -#include using namespace ::rtl; #define YYDEBUG 1 #define YYERROR_VERBOSE 1 -#define YYLEX_PARAM &yylval, &yylloc -extern int yylex (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ); +extern int yylex(void); void yyerror(char const *); void checkIdentifier(::rtl::OString* id) @@ -265,7 +262,6 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) { #pragma warning(disable: 4273 4701 4706) #endif %} -%locations /* * Declare the type of values in the grammar */ @@ -976,7 +972,6 @@ attribute_get_raises: rtl::OStringToOUString( idlc()->getDocumentation(), RTL_TEXTENCODING_UTF8)); $$.exceptions = $2; - int line = @2.first_line; } ; diff --git a/idlc/source/scanner.ll b/idlc/source/scanner.ll index 9955a8c808db..bbcc08fae37b 100644 --- a/idlc/source/scanner.ll +++ b/idlc/source/scanner.ll @@ -48,21 +48,12 @@ #include "attributeexceptions.hxx" - class AstExpression; class AstArray; class AstMember; #include -/* handle locations */ -int yycolumn = 1; - -#define YY_USER_ACTION yylloc->first_line = yylloc->last_line = yylineno; \ - yylloc->first_column = yycolumn; yylloc->last_column = yycolumn+yyleng-1; \ - idlc()->setOffset(yylloc->first_column, yylloc->last_column); \ - yycolumn += yyleng; - sal_Int32 beginLine = 0; ::rtl::OString docu; @@ -236,7 +227,6 @@ static void parseLineAndFile(sal_Char* pBuf) for (; *r != '\0' && *r != ' ' && *r != '\t'; r++) ; *r++ = 0; idlc()->setLineNumber((sal_uInt32)atol(h)); - yylineno = atol(h); /* Find file name, if present */ for (; *r != '"'; r++) @@ -272,7 +262,6 @@ static void parseLineAndFile(sal_Char* pBuf) #endif %} -%option bison-bridge bison-locations %option noyywrap %option never-interactive @@ -294,10 +283,8 @@ IDENTIFIER ("_"?({ALPHA}|{DIGIT})+)* %% [ \t\r]+ ; /* eat up whitespace */ -[\n] { - idlc()->incLineNumber(); - yycolumn = 1; - yylineno++; +[\n] { + idlc()->incLineNumber(); } attribute return IDL_ATTRIBUTE; @@ -362,39 +349,39 @@ published return IDL_PUBLISHED; "..." return IDL_ELLIPSIS; ("-")?{INT_LITERAL}+(l|L|u|U)? { - return asciiToInteger(yytext, &yylval->ival, &yylval->uval); + return asciiToInteger(yytext, &yylval.ival, &yylval.uval); } ("-")?{OCT_LITERAL}+(l|L|u|U)? { - return asciiToInteger(yytext, &yylval->ival, &yylval->uval); + return asciiToInteger(yytext, &yylval.ival, &yylval.uval); } ("-")?{HEX_LITERAL}+(l|L|u|U)? { - return asciiToInteger(yytext, &yylval->ival, &yylval->uval); + return asciiToInteger(yytext, &yylval.ival, &yylval.uval); } ("-")?{DIGIT}+(e|E){1}(("+"|"-")?{DIGIT}+)+(f|F)? | ("-")?"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? | ("-")?{DIGIT}*"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? { - yylval->dval = asciiToFloat( yytext ); + yylval.dval = asciiToFloat( yytext ); return IDL_FLOATING_PT_LITERAL; } {IDENTIFIER} { - yylval->sval = new ::rtl::OString(yytext); + yylval.sval = new ::rtl::OString(yytext); return IDL_IDENTIFIER; } \<\< { - yylval->strval = yytext; + yylval.strval = yytext; return IDL_LEFTSHIFT; } \>\> { - yylval->strval = yytext; + yylval.strval = yytext; return IDL_RIGHTSHIFT; } \:\: { - yylval->strval = yytext; + yylval.strval = yytext; return IDL_SCOPESEPARATOR; } -- cgit From 97058c043c7dab60f87d6c2e8a86de7d611f75c0 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 21 Sep 2010 20:55:32 +0200 Subject: Add dependency for generated vmlexport-shape-types --- oox/source/export/makefile.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oox/source/export/makefile.mk b/oox/source/export/makefile.mk index 08fa7a09dff8..ad1527ec6cc4 100644 --- a/oox/source/export/makefile.mk +++ b/oox/source/export/makefile.mk @@ -25,3 +25,6 @@ SLOFILES = \ $(MISC)$/vmlexport-shape-types.cxx : preset-definitions-to-shape-types.pl presetShapeDefinitions.xml presetTextWarpDefinitions.xml $(PERL) $< > $@.in_progress 2> $(MISC)$/vmlexport-shape-types.log && mv $@.in_progress $@ + +$(SLO)$/vmlexport-shape-types.obj : $(MISC)$/vmlexport-shape-types.cxx + -- cgit From c415b4932aba6ec76e65f7c5c37a40c5ac5b4c4a Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 21 Sep 2010 22:28:08 +0200 Subject: Added mac version of num_cpu detection --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 69b5529fb1b4..30f667ae069e 100644 --- a/configure.in +++ b/configure.in @@ -7383,7 +7383,11 @@ dnl =================================================================== dnl Number of CPUs to use during the build dnl =================================================================== AC_MSG_CHECKING([for number of processors to use]) -BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l` +if test "z`uname -s`" = "zDarwin"; then + BUILD_NCPUS=`sysctl -n hw.ncpu` +else + BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l` +fi if test "z$with_num_cpus" != "z"; then BUILD_NCPUS=$with_num_cpus fi -- cgit From ce2ac8ba72700e8b79bdbd120338144ad1bea552 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Wed, 22 Sep 2010 09:20:14 +0200 Subject: Build languagetool when requested to do so --- postprocess/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postprocess/prj/build.lst b/postprocess/prj/build.lst index c40d98458025..9679f56c012f 100644 --- a/postprocess/prj/build.lst +++ b/postprocess/prj/build.lst @@ -1,4 +1,4 @@ -po postprocess :: accessibility automation basctl bean BINFILTER:binfilter chart2 configmgr CRASHREP:crashrep cui dbaccess desktop dtrans embeddedobj embedserv EPM:epm eventattacher extensions extras fileaccess filter forms fpicker helpcontent2 hwpfilter io JAVAINSTALLER2:javainstaller2 lingucomponent MATHMLDTD:MathMLDTD ODK:odk officecfg package padmin psprint_config remotebridges sc scaddins sccomp scp2 scripting sd setup_native slideshow starmath sw sysui testtools ucb UnoControls unoxml ure wizards xmerge xmlsecurity MORE_FONTS:more_fonts DICTIONARIES:dictionaries OOo:pyuno OOo:readlicense_oo SO:top unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder reportdesign SDEXT:sdext SWEXT:swext uui writerfilter oox MYSQLC:mysqlc NULL +po postprocess :: accessibility automation basctl bean BINFILTER:binfilter chart2 configmgr CRASHREP:crashrep cui dbaccess desktop dtrans embeddedobj embedserv EPM:epm eventattacher extensions extras fileaccess filter forms fpicker helpcontent2 hwpfilter io JAVAINSTALLER2:javainstaller2 lingucomponent MATHMLDTD:MathMLDTD ODK:odk officecfg package padmin psprint_config remotebridges sc scaddins sccomp scp2 scripting sd setup_native slideshow starmath sw sysui testtools ucb UnoControls unoxml ure wizards xmerge xmlsecurity MORE_FONTS:more_fonts DICTIONARIES:dictionaries OOo:pyuno OOo:readlicense_oo SO:top unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder reportdesign LANGUAGETOOL:languagetool SDEXT:sdext SWEXT:swext uui writerfilter oox MYSQLC:mysqlc NULL po postprocess usr1 - all po_mkout NULL po postprocess\checkxml nmake - all po_checkxml NULL po postprocess\checkdeliver nmake - all po_checkdlv NULL -- cgit From 0c265830c2fc51bbe4bbef55e72d3c102331ca74 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Wed, 22 Sep 2010 12:57:01 +0200 Subject: Install file into /opt/{UNIXBASISROOTNAME}{BRANDPACKAGEVERSION} by default We modified scp2 to install everything into single directory => packagerootpath must be set to // instead of / Without this fix, it puts everything directly under /opt in the credated rpms. --- solenv/bin/make_installer.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl index 335ecf961253..dd093f1c1e45 100644 --- a/solenv/bin/make_installer.pl +++ b/solenv/bin/make_installer.pl @@ -1421,6 +1421,8 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) { $packagerootpath = $onepackage->{'destpath'}; installer::packagelist::resolve_packagevariables(\$packagerootpath, $allvariableshashref, 1); + # we put branding and common stuff into the same prefix on unixes => $packagerootpath must be the whole prefix, including product name and version + if ($installer::globals::isunix) { $packagerootpath .= "/$allvariableshashref->{'UNIXBASISROOTNAME'}$allvariableshashref->{'BRANDPACKAGEVERSION'}"; } if ( $^O =~ /darwin/i ) { $packagerootpath =~ s/\/opt\//\/Applications\//; } } else -- cgit From be104f270dc46de0c64ee897ae961a5308f51e59 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 23 Sep 2010 08:55:17 +0200 Subject: win32-no-uninstall-survey.diff: No calling back home, thank you --- scp2/source/ooo/windowscustomaction_ooo.scp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scp2/source/ooo/windowscustomaction_ooo.scp b/scp2/source/ooo/windowscustomaction_ooo.scp index 4cae60ad3836..6cae743ae27c 100755 --- a/scp2/source/ooo/windowscustomaction_ooo.scp +++ b/scp2/source/ooo/windowscustomaction_ooo.scp @@ -487,15 +487,6 @@ WindowsCustomAction gid_Customaction_RebaseLibrariesonproperties Assignment2 = ("AdminExecuteSequence", "Not REMOVE=\"ALL\"", "end"); End -WindowsCustomAction gid_Customaction_ShowSurvey - Name = "ShowSurveyAfterUninstall"; - Typ = "65"; - Source = "relnotes.dll"; - Target = "ShowSurveyAfter"; - Inbinarytable = 1; - Assignment1 = ("InstallExecuteSequence", "REMOVE=\"ALL\" and Not UPGRADINGPRODUCTCODE", "end"); -End - WindowsCustomAction gid_Customaction_LookForRegisteredExtensions Name = "LookForRegisteredExtensions"; Typ = "65"; -- cgit From fd49cf40977f4ccab6323037ff8788dff3844c0c Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 23 Sep 2010 12:05:56 +0100 Subject: tweak smoketest doc to explicitly use Bibliography --- smoketestoo_native/data/Test_DB.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml index 34ade11f75fb..ebb53cf0181c 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestoo_native/data/Test_DB.xml @@ -53,7 +53,7 @@ Const sTestString = "Automatical Test" sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext oDBContext = CreateUnoService(cUnoDatabaseContext) - sDBName=oDBContext.ElementNames(0) 'Names of Databases + sDBName="Bibliography" 'Names of Databases nCurrentAction = cDBOpen sCurrentMessage = cMessageDatabaseOpen -- cgit From 322adf80e6d82f92b55bca1ff77b28072d904ec9 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Thu, 23 Sep 2010 18:05:45 +0200 Subject: oox depends on filter liboox is linked against libmsfilter, so the module filter must be built before --- oox/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oox/prj/build.lst b/oox/prj/build.lst index 14585dfeb84a..1650e02ddfa1 100644 --- a/oox/prj/build.lst +++ b/oox/prj/build.lst @@ -1,4 +1,4 @@ -oox oox : vos cppu cppuhelper comphelper sal offapi sax basegfx svx xmlscript tools vcl BOOST:boost OPENSSL:openssl NULL +oox oox : vos cppu cppuhelper comphelper filter sal offapi sax basegfx svx xmlscript tools vcl BOOST:boost OPENSSL:openssl NULL oox oox usr1 - all oox_mkout NULL oox oox\prj get - all oox_prj NULL oox oox\source\token nmake - all oox_token NULL -- cgit From 84ab9817a6d610bd78f3a22a744cbe808fe8778b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 24 Sep 2010 09:01:46 +0200 Subject: Fix text paragraph autofit pptx import --- oox/source/drawingml/textbodypropertiescontext.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 668266f2f679..4a54386fca60 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -30,8 +30,9 @@ #include #include #include -#include +#include #include +#include #include "oox/drawingml/textbodyproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/helper/attributelist.hxx" @@ -165,7 +166,7 @@ Reference< XFastContextHandler > TextBodyPropertiesContext::createFastChildConte mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; // CT_TextNoAutofit break; case NMSP_DRAWINGML|XML_normAutofit: // CT_TextNormalAutofit - mrTextBodyProp.maPropertyMap[ PROP_TextFitToSize ] <<= true; + mrTextBodyProp.maPropertyMap[ PROP_TextFitToSize ] <<= TextFitToSizeType_AUTOFIT; mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; break; case NMSP_DRAWINGML|XML_spAutoFit: -- cgit From 1f42859596afd818a44681818fca914fa25b9911 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Fri, 24 Sep 2010 10:40:39 +0200 Subject: Fixed i#114659: non-breaking spaces corner case --- editeng/source/misc/svxacorr.cxx | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index f969a8033f08..bcb70a483abb 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -658,8 +658,8 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace( chars = OUString::createFromAscii( ":" ); sal_Unicode cChar = rTxt.GetChar( nEndPos ); - bool bHasSpace = chars.indexOf( sal_Unicode( cChar ) ) != -1; - bool bIsSpecial = allChars.indexOf( sal_Unicode( cChar ) ) != -1; + bool bHasSpace = chars.indexOf( cChar ) != -1; + bool bIsSpecial = allChars.indexOf( cChar ) != -1; if ( bIsSpecial ) { // Get the last word delimiter position @@ -673,7 +673,7 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace( { // Check the previous char sal_Unicode cPrevChar = rTxt.GetChar( nEndPos - 1 ); - if ( ( chars.indexOf( sal_Unicode( cPrevChar ) ) == -1 ) && cPrevChar != '\t' ) + if ( ( chars.indexOf( cPrevChar ) == -1 ) && cPrevChar != '\t' ) { // Remove any previous normal space xub_StrLen nPos = nEndPos - 1; @@ -684,20 +684,17 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace( cPrevChar = rTxt.GetChar( nPos ); } - if ( nPos != 0 ) - { - nPos++; - if ( nEndPos - nPos > 0 ) - rDoc.Delete( nPos, nEndPos ); - - // Add the non-breaking space at the end pos - if ( bHasSpace ) - rDoc.Insert( nPos, CHAR_HARDBLANK ); - bRunNext = true; - bRet = true; - } + nPos++; + if ( nEndPos - nPos > 0 ) + rDoc.Delete( nPos, nEndPos ); + + // Add the non-breaking space at the end pos + if ( bHasSpace ) + rDoc.Insert( nPos, CHAR_HARDBLANK ); + bRunNext = true; + bRet = true; } - else if ( chars.indexOf( sal_Unicode( cPrevChar ) ) != -1 ) + else if ( chars.indexOf( cPrevChar ) != -1 ) bRunNext = true; } } -- cgit From 9f3971de096d31346d50f47e23d6e290fbe088a1 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 24 Sep 2010 13:29:54 +0100 Subject: Remove migration setting, erroneously clobbering UseSystemFileDialog --- officecfg/registry/data/org/openoffice/Office/Common.xcu | 1 - 1 file changed, 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index b7c019f24c28..0227ec16249b 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -576,7 +576,6 @@ - false -- cgit From 32ddcb69164d01d94fd81126b690385aa62042c6 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Fri, 24 Sep 2010 15:22:59 +0200 Subject: installer-get-path-correctly.diff: allow to get path also from ./file Otherwise, it installed the license files into ugly subdirectories for example into /LICENSE.html/LICENSE.html even worse, the direcotry had the rights 444 --- solenv/bin/modules/installer/pathanalyzer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/bin/modules/installer/pathanalyzer.pm b/solenv/bin/modules/installer/pathanalyzer.pm index 1c57a0d76e02..62085dac5e14 100644 --- a/solenv/bin/modules/installer/pathanalyzer.pm +++ b/solenv/bin/modules/installer/pathanalyzer.pm @@ -39,7 +39,7 @@ sub get_path_from_fullqualifiedname if ( $$longfilenameref =~ /\Q$installer::globals::separator\E/ ) # Is there a separator in the path? Otherwise the path is empty. { - if ( $$longfilenameref =~ /^\s*(\S.*\S\Q$installer::globals::separator\E)(\S.+\S?)/ ) + if ( $$longfilenameref =~ /^\s*(.*\Q$installer::globals::separator\E)(.+)/ ) { $$longfilenameref = $1; } -- cgit