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