summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svtools/inc/bindablecontrolhelper.hxx61
-rw-r--r--svtools/inc/filterutils.hxx22
-rw-r--r--svtools/source/misc/bindablecontrolhelper.cxx161
-rw-r--r--svtools/source/misc/filterutils.cxx55
-rwxr-xr-xsvtools/source/misc/makefile.mk2
-rw-r--r--toolkit/inc/toolkit/awt/vclxmenu.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindows.hxx6
-rw-r--r--toolkit/inc/toolkit/controls/dialogcontrol.hxx14
-rw-r--r--toolkit/inc/toolkit/controls/unocontrols.hxx39
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx3
-rw-r--r--toolkit/inc/toolkit/helper/servicenames.hxx2
-rw-r--r--toolkit/source/awt/vclxmenu.cxx13
-rw-r--r--toolkit/source/awt/vclxwindows.cxx37
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx225
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx1
-rw-r--r--toolkit/source/controls/unocontrols.cxx77
-rw-r--r--toolkit/source/helper/property.cxx2
-rw-r--r--toolkit/source/helper/registerservices.cxx6
-rw-r--r--toolkit/source/helper/servicenames.cxx4
-rw-r--r--unotools/inc/unotools/fltrcfg.hxx2
-rw-r--r--unotools/source/config/fltrcfg.cxx62
-rw-r--r--vcl/inc/vcl/bitmap.hxx6
-rw-r--r--vcl/inc/vcl/bitmapex.hxx1
-rw-r--r--vcl/inc/vcl/dialog.hxx4
-rw-r--r--vcl/source/control/combobox.cxx9
-rw-r--r--vcl/source/gdi/bitmap2.cxx30
-rw-r--r--vcl/source/gdi/bitmapex.cxx56
-rw-r--r--vcl/source/window/dialog.cxx11
-rw-r--r--vcl/source/window/toolbox2.cxx2
29 files changed, 829 insertions, 86 deletions
diff --git a/svtools/inc/bindablecontrolhelper.hxx b/svtools/inc/bindablecontrolhelper.hxx
new file mode 100644
index 000000000000..d154ea4c404a
--- /dev/null
+++ b/svtools/inc/bindablecontrolhelper.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: imageresourceaccess.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_INC_BINDABLECONTROL_HXX
+#define SVTOOLS_INC_BINDABLECONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/frame/XModel.hpp>
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= GraphicAccess
+ //====================================================================
+ /** helper class for obtaining streams (which also can be used with the ImageProducer)
+ from a resource
+ */
+ class BindableControlHelper
+ {
+ private:
+ BindableControlHelper(); // never implemented
+
+ public:
+ SVT_DLLPUBLIC static void ApplyListSourceAndBindableData( const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& xModel, const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& rObj, const rtl::OUString& rsCtrlSource, const rtl::OUString& rsRowSource );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_INC_BINDABLECONTROL_HXX
diff --git a/svtools/inc/filterutils.hxx b/svtools/inc/filterutils.hxx
new file mode 100644
index 000000000000..e10eb2a17640
--- /dev/null
+++ b/svtools/inc/filterutils.hxx
@@ -0,0 +1,22 @@
+#ifndef SVTOOLS_INC_FILTERUTILS_HXX
+#define SVTOOLS_INC_FILTERUTILS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/RuntimeException.hpp>
+namespace svt
+{
+ class BinFilterUtils
+ {
+ private:
+ BinFilterUtils(); // never implemented
+
+ public:
+ SVT_DLLPUBLIC static rtl::OUString CreateOUStringFromUniStringArray( const char* pcCharArr, sal_uInt32 nBufSize );
+ SVT_DLLPUBLIC static rtl::OUString CreateOUStringFromStringArray( const char* pcCharArr, sal_uInt32 nBufSize );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif
diff --git a/svtools/source/misc/bindablecontrolhelper.cxx b/svtools/source/misc/bindablecontrolhelper.cxx
new file mode 100644
index 000000000000..b0726feed1eb
--- /dev/null
+++ b/svtools/source/misc/bindablecontrolhelper.cxx
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: imageresourceaccess.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+#include "bindablecontrolhelper.hxx"
+#include <com/sun/star/form/binding/XBindableValue.hpp>
+#include <com/sun/star/form/binding/XValueBinding.hpp>
+#include <com/sun/star/form/binding/XListEntrySink.hpp>
+#include <com/sun/star/form/binding/XListEntrySource.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
+#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+#ifndef C2U
+#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
+#endif
+
+ using namespace ::com::sun::star;
+
+bool lcl_isNamedRange( const rtl::OUString& sAddress, const uno::Reference< frame::XModel >& xModel, table::CellRangeAddress& aAddress )
+{
+ bool bRes = false;
+ const static rtl::OUString sNamedRanges( RTL_CONSTASCII_USTRINGPARAM("NamedRanges"));
+ uno::Reference< sheet::XCellRangeReferrer > xReferrer;
+ try
+ {
+ uno::Reference< beans::XPropertySet > xPropSet( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( sNamedRanges ), uno::UNO_QUERY_THROW );
+ xReferrer.set ( xNamed->getByName( sAddress ), uno::UNO_QUERY );
+ }
+ catch( uno::Exception& /*e*/ )
+ {
+ // do nothing
+ }
+ if ( xReferrer.is() )
+ {
+ uno::Reference< sheet::XCellRangeAddressable > xRangeAddressable( xReferrer->getReferredCells(), uno::UNO_QUERY );
+ if ( xRangeAddressable.is() )
+ {
+ aAddress = xRangeAddressable->getRangeAddress();
+ bRes = true;
+ }
+ }
+ return bRes;
+}
+
+
+void
+BindableControlHelper::ApplyListSourceAndBindableData( const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& xModel, const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& rObj, const rtl::OUString& rsCtrlSource, const rtl::OUString& rsRowSource )
+{
+// XBindable etc.
+ uno::Reference< lang::XMultiServiceFactory > xFac;
+ if ( xModel.is() )
+ xFac.set( xModel, uno::UNO_QUERY );
+ uno::Reference< form::binding::XBindableValue > xBindable( rObj, uno::UNO_QUERY );
+ if ( xFac.is() && rsCtrlSource.getLength() && xBindable.is() )
+ {
+
+ // OOo address structures
+ // RefCell - convert from XL
+ // pretend we converted the imported string address into the
+ // appropriate address structure
+ uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY );
+ table::CellAddress aAddress;
+ if ( xConvertor.is() )
+ {
+ // we need this service to properly convert XL notation also
+ // Should be easy to extend
+ xConvertor->setPropertyValue( C2U( "XL_A1_Representation" ), uno::makeAny( rsCtrlSource ) );
+ xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress;
+ }
+
+ beans::NamedValue aArg1;
+ aArg1.Name = C2U("BoundCell");
+ aArg1.Value <<= aAddress;
+
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= aArg1;
+
+ uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellValueBinding" ), aArgs ), uno::UNO_QUERY );
+ xBindable->setValueBinding( xBinding );
+ }
+ else if ( xBindable.is() ) // reset it
+ xBindable->setValueBinding( uno::Reference< form::binding::XValueBinding >() );
+ uno::Reference< form::binding::XListEntrySink > xListEntrySink( rObj, uno::UNO_QUERY );
+ if ( xFac.is() && rsRowSource.getLength() && xListEntrySink.is() )
+ {
+
+ // OOo address structures
+ // RefCell - convert from XL
+ // pretend we converted the imported string address into the
+ // appropriate address structure
+ uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY );
+ table::CellRangeAddress aAddress;
+ if ( xConvertor.is() )
+ {
+ if ( !lcl_isNamedRange( rsRowSource, xModel, aAddress ) )
+ {
+ // we need this service to properly convert XL notation also
+ // Should be easy to extend
+ xConvertor->setPropertyValue( C2U( "XL_A1_Representation" ), uno::makeAny( rsRowSource ) );
+ xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress;
+ }
+ }
+
+ beans::NamedValue aArg1;
+ aArg1.Name = C2U("CellRange");
+ aArg1.Value <<= aAddress;
+
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= aArg1;
+
+ uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellRangeListSource" ), aArgs ), uno::UNO_QUERY );
+ xListEntrySink->setListEntrySource( xSource );
+ }
+ else if ( xListEntrySink.is() ) // reset
+ xListEntrySink->setListEntrySource( uno::Reference< form::binding::XListEntrySource >() );
+
+}
+
+//........................................................................
+} // namespace svt
+//........................................................................
diff --git a/svtools/source/misc/filterutils.cxx b/svtools/source/misc/filterutils.cxx
new file mode 100644
index 000000000000..5a31070150fb
--- /dev/null
+++ b/svtools/source/misc/filterutils.cxx
@@ -0,0 +1,55 @@
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+#include "filterutils.hxx"
+#include <rtl/ustrbuf.hxx>
+
+namespace svt
+{
+//........................................................................
+
+ using namespace ::com::sun::star;
+
+ rtl::OUString lcl_createStringFromArray( const char* pcCharArr, sal_uInt32 nBufSize, bool bIsCompressed )
+ {
+ rtl::OUStringBuffer aBuffer;
+ if( bIsCompressed )
+ {
+ // buffer contains compressed Unicode, not encoded bytestring
+ sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufSize );
+ aBuffer.setLength( nStrLen );
+ const char* pcCurrChar = pcCharArr;
+ for( sal_Int32 nChar = 0; nChar < nStrLen; ++nChar, ++pcCurrChar )
+ /* *pcCurrChar may contain negative values and therefore MUST be
+ casted to unsigned char, before assigned to a sal_Unicode. */
+ aBuffer.setCharAt( nChar, static_cast< unsigned char >( *pcCurrChar ) );
+ }
+ else
+ {
+ // buffer contains Little-Endian Unicode
+ sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufSize ) / 2;
+ aBuffer.setLength( nStrLen );
+ const char* pcCurrChar = pcCharArr;
+ for( sal_Int32 nChar = 0; nChar < nStrLen; ++nChar )
+ {
+ /* *pcCurrChar may contain negative values and therefore MUST be
+ casted to unsigned char, before assigned to a sal_Unicode. */
+ sal_Unicode cChar = static_cast< unsigned char >( *pcCurrChar++ );
+ cChar |= (static_cast< unsigned char >( *pcCurrChar++ ) << 8);
+ aBuffer.setCharAt( nChar, cChar );
+ }
+ }
+ return aBuffer.makeStringAndClear();
+ }
+
+ rtl::OUString BinFilterUtils::CreateOUStringFromUniStringArray( const char* pcCharArr, sal_uInt32 nBufSize )
+ {
+ return lcl_createStringFromArray( pcCharArr, nBufSize, false );
+ }
+
+ rtl::OUString BinFilterUtils::CreateOUStringFromStringArray( const char* pcCharArr, sal_uInt32 nBufSize )
+ {
+ return lcl_createStringFromArray( pcCharArr, nBufSize, true );
+ }
+//........................................................................
+} // namespace svt
+//........................................................................
diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk
index 3f609da24752..e66bba339f4a 100755
--- a/svtools/source/misc/makefile.mk
+++ b/svtools/source/misc/makefile.mk
@@ -76,6 +76,8 @@ SLOFILES=\
$(SLO)$/transfer.obj \
$(SLO)$/transfer2.obj \
$(SLO)$/unitconv.obj \
+ $(SLO)$/bindablecontrolhelper.obj \
+ $(SLO)$/filterutils.obj \
$(SLO)$/wallitem.obj \
$(SLO)$/xwindowitem.obj
diff --git a/toolkit/inc/toolkit/awt/vclxmenu.hxx b/toolkit/inc/toolkit/awt/vclxmenu.hxx
index 26d93196bd9f..28056112bf7a 100644
--- a/toolkit/inc/toolkit/awt/vclxmenu.hxx
+++ b/toolkit/inc/toolkit/awt/vclxmenu.hxx
@@ -45,6 +45,7 @@
class Menu;
class MenuBar;
class VclSimpleEvent;
+class PopupMenu;
DECLARE_LIST( PopupMenuRefList, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >* )
@@ -181,6 +182,7 @@ class TOOLKIT_DLLPUBLIC VCLXPopupMenu : public VCLXMenu
{
public:
VCLXPopupMenu();
+ VCLXPopupMenu( PopupMenu* pPopMenu );
};
#endif // _TOOLKIT_AWT_VCLXMENU_HXX_
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx
index 49b6a9530ec6..7bfc6b2a521e 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -92,6 +92,7 @@
#include <vcl/pointr.hxx>
#include <vcl/image.hxx>
+#include <com/sun/star/document/XVbaMethodParameter.hpp> //liuchen 2009-6-22, add the support of input/output parameters to VBA Dialog_QueryClose event
class Button;
class CheckBox;
class RadioButton;
@@ -376,6 +377,7 @@ public:
// class VCLXDialog
// ----------------------------------------------------
class VCLXDialog : public ::com::sun::star::awt::XDialog2,
+ public ::com::sun::star::document::XVbaMethodParameter, //liuchen 2009-6-22, add the support of input/output parameters to VBA UserForm_QueryClose event
public VCLXTopWindow
{
public:
@@ -413,6 +415,10 @@ public:
// ::com::sun::star::awt::XVclWindowPeer
void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ //liuchen 2009-6-23, support Excel VBA UserForm_QueryClose event
+ // ::com::sun::star::document::XVBAMethodParameter
+ void SAL_CALL setVbaMethodParameter( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getVbaMethodParameter( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
};
// ----------------------------------------------------
diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
index 0c5731d3f923..4c89bcdec049 100644
--- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@ -48,6 +48,8 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/basemutex.hxx>
#include <list>
+#include <map>
+#include <com/sun/star/graphic/XGraphicObject.hpp>
// ----------------------------------------------------
// class UnoControlDialogModel
@@ -89,6 +91,8 @@ private:
AllGroups maGroups;
sal_Bool mbGroupsUpToDate;
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
+ bool mbAdjustingGraphic;
protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
@@ -175,10 +179,20 @@ public:
protected:
void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
void stopControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
+ // ::cppu::OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
void implUpdateGroupStructure();
+private:
+ void AddRadioButtonToGroup (
+ const ::com::sun::star::uno::Reference< XControlModel >& rControlModel,
+ const ::rtl::OUString& rPropertyName,
+ ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups,
+ ModelGroup*& rpCurrentGroup );
+ void AddRadioButtonGroup (
+ ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups );
};
// ----------------------------------------------------
diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx
index 01ff047ee3de..fd3dbf87b093 100644
--- a/toolkit/inc/toolkit/controls/unocontrols.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrols.hxx
@@ -223,7 +223,6 @@ private:
bool mbAdjustingGraphic;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL );
protected:
GraphicControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
@@ -637,6 +636,44 @@ public:
};
+class UnoMultiPageModel : public UnoControlModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+public:
+ UnoMultiPageModel();
+ UnoMultiPageModel( const UnoMultiPageModel& rModel ) : UnoControlModel( rModel ) {;}
+
+ UnoControlModel* Clone() const { return new UnoMultiPageModel( *this ); }
+
+ // ::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( UnoMultiPageModel, UnoControlModel, szServiceName_UnoMultiPageModel )
+
+};
+// ----------------------------------------------------
+// class UnoGroupBoxControl
+// ----------------------------------------------------
+class UnoMultiPageControl : public UnoControlBase
+{
+public:
+ UnoMultiPageControl();
+ ::rtl::OUString GetComponentServiceName();
+
+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, UnoControlBase, szServiceName_UnoMultiPageControl )
+
+};
+
// ----------------------------------------------------
// class UnoFixedTextControl
// ----------------------------------------------------
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx
index 837d283f4e8c..70f6c748942b 100644
--- a/toolkit/inc/toolkit/helper/property.hxx
+++ b/toolkit/inc/toolkit/helper/property.hxx
@@ -195,6 +195,7 @@ namespace rtl {
#define BASEPROPERTY_GRID_SELECTIONMODE 144
#define BASEPROPERTY_ENABLEVISIBLE 145 // sal_Bool
#define BASEPROPERTY_REFERENCE_DEVICE 146
+
#define BASEPROPERTY_HIGHCONTRASTMODE 147
#define BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND 148
#define BASEPROPERTY_GRID_HEADER_BACKGROUND 149
@@ -202,6 +203,8 @@ namespace rtl {
#define BASEPROPERTY_GRID_ROW_BACKGROUND 151
#define BASEPROPERTY_MULTISELECTION_SIMPLEMODE 152
#define BASEPROPERTY_ITEM_SEPARATOR_POS 153
+#define BASEPROPERTY_GROUPNAME 154 // ::rtl::OUString
+#define BASEPROPERTY_VBAFORM 155 // sal_Bool
// Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
diff --git a/toolkit/inc/toolkit/helper/servicenames.hxx b/toolkit/inc/toolkit/helper/servicenames.hxx
index 2d1df79b733b..ee31fa729d05 100644
--- a/toolkit/inc/toolkit/helper/servicenames.hxx
+++ b/toolkit/inc/toolkit/helper/servicenames.hxx
@@ -37,6 +37,8 @@ extern const sal_Char __FAR_DATA szServiceName_PopupMenu[], szServiceName2_Popup
extern const sal_Char __FAR_DATA szServiceName_MenuBar[], szServiceName2_MenuBar[];
extern const sal_Char __FAR_DATA szServiceName_Pointer[], szServiceName2_Pointer[];
extern const sal_Char __FAR_DATA szServiceName_UnoControlContainer[], szServiceName2_UnoControlContainer[];
+extern const sal_Char __FAR_DATA szServiceName_UnoMultiPageControl[], szServiceName2_UnoMultiPageControl[];
+extern const sal_Char __FAR_DATA szServiceName_UnoMultiPageModel[], szServiceName2_UnoMultiPageModel[];
extern const sal_Char __FAR_DATA szServiceName_UnoControlContainerModel[], szServiceName2_UnoControlContainerModel[];
extern const sal_Char __FAR_DATA szServiceName_TabController[], szServiceName2_TabController[];
extern const sal_Char __FAR_DATA szServiceName_TabControllerModel[], szServiceName2_TabControllerModel[];
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 5e44df58318e..838dc698c567 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -539,6 +539,14 @@ void VCLXMenu::setPopupMenu( sal_Int16 nItemId, const ::com::sun::star::uno::Ref
break;
}
}
+ // it seems the popup menu is not insert into maPopupMenueRefs
+ // if the popup men is not created by stardiv.Toolkit.VCLXPopupMenu
+ if( !aRef.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > * pNewRef = new ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > ;
+ *pNewRef = new VCLXPopupMenu( (PopupMenu*)pMenu );
+ aRef = *pNewRef;
+ }
}
return aRef;
}
@@ -1101,3 +1109,8 @@ VCLXPopupMenu::VCLXPopupMenu()
DBG_CTOR( VCLXPopupMenu, 0 );
ImplCreateMenu( TRUE );
}
+
+VCLXPopupMenu::VCLXPopupMenu( PopupMenu* pPopMenu ) : VCLXMenu( (Menu *)pPopMenu )
+{
+ DBG_CTOR( VCLXPopupMenu, 0 );
+}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index bf55bab1f749..8e89b2a61aaf 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -1080,6 +1080,7 @@ void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_REFERENCE_DEVICE,
+ BASEPROPERTY_GROUPNAME,
0);
VCLXGraphicControl::ImplGetPropertyIds( rIds );
}
@@ -2301,6 +2302,7 @@ VCLXDialog::~VCLXDialog()
::com::sun::star::uno::Any VCLXDialog::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::document::XVbaMethodParameter*, this ), //liuchen 2009-6-23
SAL_STATIC_CAST( ::com::sun::star::awt::XDialog2*, this ),
SAL_STATIC_CAST( ::com::sun::star::awt::XDialog*, this ) );
return (aRet.hasValue() ? aRet : VCLXTopWindow::queryInterface( rType ));
@@ -2308,6 +2310,7 @@ VCLXDialog::~VCLXDialog()
// ::com::sun::star::lang::XTypeProvider
IMPL_XTYPEPROVIDER_START( VCLXDialog )
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::document::XVbaMethodParameter>* ) NULL ), //liuchen 2009-6-23
getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDialog2>* ) NULL ),
getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDialog>* ) NULL ),
VCLXTopWindow::getTypes()
@@ -2418,6 +2421,40 @@ void SAL_CALL VCLXDialog::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::s
return aInfo;
}
+//liuchen 2009-7-22
+// ::com::sun::star::document::XVbaMethodParameter
+void SAL_CALL VCLXDialog::setVbaMethodParameter(
+ const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Any& Value )
+throw(::com::sun::star::uno::RuntimeException)
+{
+ if (rtl::OUString::createFromAscii( "Cancel" ) == PropertyName)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+ if ( GetWindow() )
+ {
+ sal_Int8 nCancel;
+ Value >>= nCancel;
+
+ Dialog* pDlg = (Dialog*) GetWindow();
+ pDlg->SetCloseFlag(nCancel);
+ }
+ }
+}
+
+::com::sun::star::uno::Any SAL_CALL VCLXDialog::getVbaMethodParameter(
+ const ::rtl::OUString& PropertyName )
+throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::uno::Any aRet;
+ return aRet;
+}
+//liuchen 2009-7-22
+
+
+
void SAL_CALL VCLXDialog::setProperty(
const ::rtl::OUString& PropertyName,
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 4e04608c2c99..7803f0b0f72b 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -79,6 +79,7 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::script;
using namespace toolkit;
#define PROPERTY_RESOURCERESOLVER ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ))
@@ -89,6 +90,8 @@ using namespace toolkit;
//HELPER
::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl );
+uno::Reference< graphic::XGraphic > getGraphicFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& rxGrfObj, const ::rtl::OUString& _rURL );
+
struct LanguageDependentProp
{
const char* pPropName;
@@ -141,6 +144,18 @@ namespace
return xGraphic;
}
+ static ::rtl::OUString lcl_GetStringProperty( const ::rtl::OUString& sProperty, const Reference< XPropertySet >& xSet )
+ {
+ ::rtl::OUString sValue;
+ Reference< XPropertySetInfo > xPSI;
+ if (xSet.is() && (xPSI = xSet->getPropertySetInfo()).is() &&
+ xPSI->hasPropertyByName( sProperty ) )
+ {
+ xSet->getPropertyValue( sProperty ) >>= sValue;
+ }
+ return sValue;
+ }
+
}
// ----------------------------------------------------------------------------
@@ -252,7 +267,7 @@ static const ::rtl::OUString& getStepPropertyName( )
UnoControlDialogModel::UnoControlDialogModel()
:maContainerListeners( *this )
,maChangeListeners ( GetMutex() )
- ,mbGroupsUpToDate( sal_False )
+ ,mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
// ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -274,6 +289,8 @@ UnoControlDialogModel::UnoControlDialogModel()
aBool <<= (sal_Bool) sal_True;
ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
+ aBool <<= (sal_Bool) sal_False;
+ ImplRegisterProperty( BASEPROPERTY_VBAFORM, aBool );
}
UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
@@ -281,7 +298,7 @@ UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rMode
, UnoControlDialogModel_Base( rModel )
, maContainerListeners( *this )
, maChangeListeners ( GetMutex() )
- , mbGroupsUpToDate( sal_False )
+ , mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
{
}
@@ -312,6 +329,40 @@ Sequence< Type > UnoControlDialogModel::getTypes() throw(RuntimeException)
return ::rtl::OUString::createFromAscii( szServiceName_UnoControlDialogModel );
}
+void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception)
+{
+ UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
+ try
+ {
+ switch ( nHandle )
+ {
+ case BASEPROPERTY_IMAGEURL:
+ if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_GRAPHIC ) )
+ {
+ mbAdjustingGraphic = true;
+ ::rtl::OUString sImageURL;
+ OSL_VERIFY( rValue >>= sImageURL );
+ setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( getGraphicFromURL_nothrow( mxGrfObj, sImageURL ) ) );
+ mbAdjustingGraphic = false;
+ }
+ break;
+
+ case BASEPROPERTY_GRAPHIC:
+ if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_IMAGEURL ) )
+ {
+ mbAdjustingGraphic = true;
+ setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ), uno::makeAny( ::rtl::OUString() ) );
+ mbAdjustingGraphic = false;
+ }
+ break;
+ }
+ }
+ catch( const ::com::sun::star::uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "UnoControlDialogModel::setFastPropertyValue_NoBroadcast: caught an exception while setting Graphic/ImageURL properties!" );
+ }
+}
+
Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
Any aAny;
@@ -904,6 +955,63 @@ void UnoControlDialogModel::implNotifyTabModelChange( const ::rtl::OUString& _rA
}
}
+// ----------------------------------------------------------------------------
+void UnoControlDialogModel::AddRadioButtonGroup (
+ ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups )
+{
+ if ( rNamedGroups.size() == 0 )
+ return;
+
+ size_t nGroups = maGroups.size();
+ maGroups.reserve( nGroups + rNamedGroups.size() );
+ ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = rNamedGroups.begin(), e = rNamedGroups.end();
+ for( ; i != e; ++i)
+ {
+ maGroups.push_back( i->second );
+ }
+
+ rNamedGroups.clear();
+}
+
+void UnoControlDialogModel::AddRadioButtonToGroup (
+ const Reference< XControlModel >& rControlModel,
+ const ::rtl::OUString& rPropertyName,
+ ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups,
+ ModelGroup*& rpCurrentGroup )
+{
+ Reference< XPropertySet > xCurProps( rControlModel, UNO_QUERY );
+ ::rtl::OUString sGroup = lcl_GetStringProperty( rPropertyName, xCurProps );
+ const sal_Int32 nControlModelStep = lcl_getDialogStep( rControlModel );
+
+ if ( sGroup.getLength() == 0 )
+ {
+ // Create a new group if:
+ if ( maGroups.size() == 0 || // no groups
+ rpCurrentGroup == NULL || // previous group was closed
+ (nControlModelStep != 0 && // control step matches current group
+ maGroups.back().size() > 0 && // (group 0 == display everywhere)
+ nControlModelStep != lcl_getDialogStep( maGroups.back().back() ) ) )
+ {
+ size_t nGroups = maGroups.size();
+ maGroups.resize( nGroups + 1 );
+ }
+ rpCurrentGroup = &maGroups.back();
+ }
+ else
+ {
+ // Different steps get different sets of named groups
+ if ( rNamedGroups.size() > 0 &&
+ rNamedGroups.begin()->second.size() > 0 )
+ {
+ const sal_Int32 nPrevStep = lcl_getDialogStep( rNamedGroups.begin()->second.front() );
+ if ( nControlModelStep != nPrevStep )
+ AddRadioButtonGroup( rNamedGroups );
+ }
+
+ rpCurrentGroup = &rNamedGroups[ sGroup ];
+ }
+ rpCurrentGroup->push_back( rControlModel );
+}
// ----------------------------------------------------------------------------
void UnoControlDialogModel::implUpdateGroupStructure()
@@ -928,10 +1036,13 @@ void UnoControlDialogModel::implUpdateGroupStructure()
GroupingMachineState eState = eLookingForGroup; // the current state of our machine
Reference< XServiceInfo > xModelSI; // for checking for a radion button
- AllGroups::iterator aCurrentGroup = maGroups.end(); // the group which we're currently building
- sal_Int32 nCurrentGroupStep = -1; // the step which all controls of the current group belong to
+ ModelGroup* aCurrentGroup = NULL; // the group which we're currently building
sal_Bool bIsRadioButton; // is it a radio button?
+ const ::rtl::OUString GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "GroupName" ) );
+
+ ::std::map< ::rtl::OUString, ModelGroup > aNamedGroups;
+
#if OSL_DEBUG_LEVEL > 1
::std::vector< ::rtl::OUString > aCurrentGroupLabels;
#endif
@@ -952,14 +1063,8 @@ void UnoControlDialogModel::implUpdateGroupStructure()
// the current model is a radio button
// -> we found the beginning of a new group
// create the place for this group
- size_t nGroups = maGroups.size();
- maGroups.resize( nGroups + 1 );
- aCurrentGroup = maGroups.begin() + nGroups;
- // and add the (only, til now) member
- aCurrentGroup->push_back( *pControlModels );
-
- // get the step which all controls of this group now have to belong to
- nCurrentGroupStep = lcl_getDialogStep( *pControlModels );
+ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
+
// new state: looking for further members
eState = eExpandingGroup;
@@ -977,7 +1082,7 @@ void UnoControlDialogModel::implUpdateGroupStructure()
{
if ( !bIsRadioButton )
{ // no radio button -> the group is done
- aCurrentGroup = maGroups.end();
+ aCurrentGroup = NULL;
eState = eLookingForGroup;
#if OSL_DEBUG_LEVEL > 1
aCurrentGroupLabels.clear();
@@ -985,48 +1090,9 @@ void UnoControlDialogModel::implUpdateGroupStructure()
continue;
}
- // it is a radio button - is it on the proper page?
- const sal_Int32 nThisModelStep = lcl_getDialogStep( *pControlModels );
- if ( ( nThisModelStep == nCurrentGroupStep ) // the current button is on the same dialog page
- || ( 0 == nThisModelStep ) // the current button appears on all pages
- )
- {
- // -> it belongs to the same group
- aCurrentGroup->push_back( *pControlModels );
- // state still is eExpandingGroup - we're looking for further elements
- eState = eExpandingGroup;
+ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
#if OSL_DEBUG_LEVEL > 1
- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
- ::rtl::OUString sLabel;
- if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
- xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
- aCurrentGroupLabels.push_back( sLabel );
-#endif
- continue;
- }
-
- // it's a radio button, but on a different page
- // -> we open a new group for it
-
- // close the old group
- aCurrentGroup = maGroups.end();
-#if OSL_DEBUG_LEVEL > 1
- aCurrentGroupLabels.clear();
-#endif
-
- // open a new group
- size_t nGroups = maGroups.size();
- maGroups.resize( nGroups + 1 );
- aCurrentGroup = maGroups.begin() + nGroups;
- // and add the (only, til now) member
- aCurrentGroup->push_back( *pControlModels );
-
- nCurrentGroupStep = nThisModelStep;
-
- // state is the same: we still are looking for further elements of the current group
- eState = eExpandingGroup;
-#if OSL_DEBUG_LEVEL > 1
Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
::rtl::OUString sLabel;
if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
@@ -1038,6 +1104,7 @@ void UnoControlDialogModel::implUpdateGroupStructure()
}
}
+ AddRadioButtonGroup( aNamedGroups );
mbGroupsUpToDate = sal_True;
}
@@ -1418,17 +1485,32 @@ void UnoDialogControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nWidth;
xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nHeight;
- // Currentley we are simply using MAP_APPFONT
+ // Currentley we are simply using MAP_APPFONT ( for normal Dialogs )
+ // and MAP_100TH_MM for imported Userforms
+ MapMode aMode( MAP_APPFONT );
+ sal_Bool bVBAForm = sal_False;
+ Reference< XPropertySet > xDlgModelProps( getModel(), UNO_QUERY );
+ if ( xDlgModelProps.is() )
+ {
+ try
+ {
+ xDlgModelProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAForm" ) ) ) >>= bVBAForm;
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ if ( bVBAForm )
+ aMode = MapMode( MAP_100TH_MM );
OutputDevice*pOutDev = Application::GetDefaultDevice();
- DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev )
{
::Size aTmp( nX, nY );
- aTmp = pOutDev->LogicToPixel( aTmp, MAP_APPFONT );
+ aTmp = pOutDev->LogicToPixel( aTmp, aMode );
nX = aTmp.Width();
nY = aTmp.Height();
aTmp = ::Size( nWidth, nHeight );
- aTmp = pOutDev->LogicToPixel( aTmp, MAP_APPFONT );
+ aTmp = pOutDev->LogicToPixel( aTmp, aMode );
nWidth = aTmp.Width();
nHeight = aTmp.Height();
}
@@ -1647,17 +1729,16 @@ void UnoDialogControl::PrepareWindowDescriptor( ::com::sun::star::awt::WindowDes
// can lead to overwrites we have to set the graphic property
// before the propertiesChangeEvents are sent!
::rtl::OUString aImageURL;
- Reference< graphic::XGraphic > xGraphic;
if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
( aImageURL.getLength() > 0 ))
{
- ::rtl::OUString absoluteUrl =
+ aImageURL =
getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
ImplGetPropertyValue( PROPERTY_IMAGEURL ));
- xGraphic = lcl_getGraphicFromURL_nothrow( absoluteUrl );
- ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), sal_True );
}
+ if ( aImageURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 )
+ ImplSetPropertyValue( PROPERTY_IMAGEURL, uno::makeAny( aImageURL ), sal_True );
}
void UnoDialogControl::elementInserted( const ContainerEvent& Event ) throw(RuntimeException)
@@ -1889,18 +1970,16 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang
if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ImageURL", 8 ))
{
::rtl::OUString aImageURL;
- Reference< graphic::XGraphic > xGraphic;
if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
( aImageURL.getLength() > 0 ))
{
- ::rtl::OUString absoluteUrl =
+ aImageURL =
getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
ImplGetPropertyValue( PROPERTY_IMAGEURL ));
- xGraphic = lcl_getGraphicFromURL_nothrow( absoluteUrl );
}
- ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), sal_True );
+ ImplSetPropertyValue( PROPERTY_IMAGEURL, uno::makeAny( aImageURL ), sal_True );
break;
}
}
@@ -2101,6 +2180,9 @@ throw (RuntimeException)
::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl )
{
+
+ ::rtl::OUString ret;
+
::rtl::OUString baseLocation;
::rtl::OUString url;
@@ -2110,9 +2192,16 @@ throw (RuntimeException)
::rtl::OUString absoluteURL( url );
if ( url.getLength() > 0 )
{
- INetURLObject urlObj(baseLocation);
- urlObj.removeSegment();
- baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
+ // Don't adjust GraphicObject url(s)
+ if ( url.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 )
+ {
+ INetURLObject urlObj(baseLocation);
+ urlObj.removeSegment();
+ baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
+ ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, ret );
+ }
+ else
+ ret = url;
const INetURLObject protocolCheck( url );
const INetProtocol protocol = protocolCheck.GetProtocol();
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 91d202409e86..331c91aa269c 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -349,6 +349,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
case BASEPROPERTY_ENABLEVISIBLE:
case BASEPROPERTY_DECORATION: aDefault <<= (sal_Bool) sal_True; break;
+ case BASEPROPERTY_GROUPNAME:
case BASEPROPERTY_HELPTEXT:
case BASEPROPERTY_HELPURL:
case BASEPROPERTY_IMAGEURL:
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index fd605cff8eaa..dff0ad3c28a0 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -536,7 +536,7 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return UnoControlModel::ImplGetDefaultValue( nPropId );
}
- uno::Reference< graphic::XGraphic > GraphicControlModel::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
+ uno::Reference< graphic::XGraphic > getGraphicFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& rxGrfObj, const ::rtl::OUString& _rURL )
{
uno::Reference< graphic::XGraphic > xGraphic;
@@ -546,10 +546,10 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
rtl::OUString sID = _rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
// get the DefaultContext
::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- mxGrfObj = graphic::GraphicObject::createWithId( aContext.getUNOContext(), sID );
+ rxGrfObj = graphic::GraphicObject::createWithId( aContext.getUNOContext(), sID );
}
else // linked
- mxGrfObj = NULL; // release the GraphicObject
+ rxGrfObj = NULL; // release the GraphicObject
if ( !_rURL.getLength() )
return xGraphic;
@@ -590,7 +590,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingGraphic = true;
::rtl::OUString sImageURL;
OSL_VERIFY( rValue >>= sImageURL );
- setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( getGraphicFromURL_nothrow( sImageURL ) ) );
+ setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( getGraphicFromURL_nothrow( mxGrfObj, sImageURL ) ) );
mbAdjustingGraphic = false;
}
break;
@@ -1728,6 +1728,75 @@ sal_Bool UnoGroupBoxControl::isTransparent() throw(uno::RuntimeException)
return sal_True;
}
+// MultiPage
+
+UnoMultiPageModel::UnoMultiPageModel()
+{
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLED );
+ ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_LABEL );
+ ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
+ ImplRegisterProperty( BASEPROPERTY_PROGRESSVALUE );
+ ImplRegisterProperty( BASEPROPERTY_PROGRESSVALUE_MAX );
+}
+
+::rtl::OUString UnoMultiPageModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii( szServiceName_UnoMultiPageModel );
+}
+
+uno::Any UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
+ {
+ uno::Any aAny;
+ aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlGroupBox );
+ //aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoMultiPageControl );
+ return aAny;
+ }
+ return UnoControlModel::ImplGetDefaultValue( nPropId );
+}
+
+::cppu::IPropertyArrayHelper& UnoMultiPageModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+
+// beans::XMultiPropertySet
+uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+
+// ----------------------------------------------------
+// class MultiPageControl
+// ----------------------------------------------------
+UnoMultiPageControl::UnoMultiPageControl()
+{
+ maComponentInfos.nWidth = 100;
+ maComponentInfos.nHeight = 100;
+}
+
+::rtl::OUString UnoMultiPageControl::GetComponentServiceName()
+{
+ return ::rtl::OUString::createFromAscii( "multipage" );
+}
+
+sal_Bool UnoMultiPageControl::isTransparent() throw(uno::RuntimeException)
+{
+ return sal_True;
+}
+
// =====================================================================================================================
// = UnoControlListBoxModel_Data
// =====================================================================================================================
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index 3a83465a3218..ab99b3b4624a 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -182,6 +182,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ),
+ DECL_PROP_2 ( "GroupName", GROUPNAME, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "HelpText", HELPTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "HelpURL", HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "HideInactiveSelection", HIDEINACTIVESELECTION, bool, BOUND, MAYBEDEFAULT ),
@@ -284,6 +285,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "ReferenceDevice", REFERENCE_DEVICE, Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT ),
+ DECL_PROP_2 ( "VBAForm", VBAFORM, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "EvenRowBackgroundColor", GRID_EVEN_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index aedf4024f2b9..0faf33a06cd3 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -165,6 +165,7 @@ IMPL_CREATEINSTANCE( UnoControlTimeFieldModel )
IMPL_CREATEINSTANCE( UnoControlProgressBarModel )
IMPL_CREATEINSTANCE( UnoControlScrollBarModel )
IMPL_CREATEINSTANCE( UnoSpinButtonModel )
+IMPL_CREATEINSTANCE( UnoMultiPageModel )
IMPL_CREATEINSTANCE( UnoControlFixedLineModel )
IMPL_CREATEINSTANCE( UnoCurrencyFieldControl )
IMPL_CREATEINSTANCE( UnoDateFieldControl )
@@ -184,6 +185,7 @@ IMPL_CREATEINSTANCE( UnoTimeFieldControl )
IMPL_CREATEINSTANCE( UnoProgressBarControl )
IMPL_CREATEINSTANCE( UnoScrollBarControl )
IMPL_CREATEINSTANCE( UnoSpinButtonControl )
+IMPL_CREATEINSTANCE( UnoMultiPageControl )
IMPL_CREATEINSTANCE( UnoFixedLineControl )
IMPL_CREATEINSTANCE( VCLXMenuBar )
IMPL_CREATEINSTANCE( VCLXPointer )
@@ -276,6 +278,8 @@ TOOLKIT_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* _pServiceManager,
registerServices( xRegistryKey, "UnoControlScrollBarModel", szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel );
registerServices( xRegistryKey, "UnoSpinButtonModel", szServiceName_UnoSpinButtonModel );
registerServices( xRegistryKey, "UnoSpinButtonControl", szServiceName_UnoSpinButtonControl );
+ registerServices( xRegistryKey, "UnoMultiPageModel", szServiceName_UnoMultiPageModel );
+ registerServices( xRegistryKey, "UnoMultiPageControl", szServiceName_UnoMultiPageControl );
registerServices( xRegistryKey, "UnoFixedLineControl", szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine );
registerServices( xRegistryKey, "UnoControlFixedLineModel", szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel );
registerServices( xRegistryKey, "VCLXPrinterServer", szServiceName_PrinterServer, szServiceName2_PrinterServer );
@@ -366,6 +370,8 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplemen
CHECKANDCREATEFACTORY( VCLXPrinterServer, szServiceName_PrinterServer, szServiceName2_PrinterServer )
CHECKANDCREATEFACTORY( UnoRoadmapControl, szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap )
CHECKANDCREATEFACTORY( UnoControlRoadmapModel, szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel )
+ CHECKANDCREATEFACTORY( UnoMultiPageModel, szServiceName_UnoMultiPageModel, NULL )
+ CHECKANDCREATEFACTORY( UnoMultiPageControl, szServiceName_UnoMultiPageControl, NULL )
CHECKANDCREATEFACTORY( UnoSpinButtonModel, szServiceName_UnoSpinButtonModel, NULL )
CHECKANDCREATEFACTORY( UnoSpinButtonControl, szServiceName_UnoSpinButtonControl, NULL )
CHECKANDCREATEFACTORY( TreeControl, szServiceName_TreeControl, NULL )
diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx
index f57f52f13e57..151f45226c58 100644
--- a/toolkit/source/helper/servicenames.cxx
+++ b/toolkit/source/helper/servicenames.cxx
@@ -37,6 +37,8 @@ const sal_Char __FAR_DATA szServiceName_PopupMenu[] = "stardiv.vcl.PopupMenu", s
const sal_Char __FAR_DATA szServiceName_MenuBar[] = "stardiv.vcl.MenuBar", szServiceName2_MenuBar[] = "com.sun.star.awt.MenuBar";
const sal_Char __FAR_DATA szServiceName_Pointer[] = "stardiv.vcl.Pointer", szServiceName2_Pointer[] = "com.sun.star.awt.Pointer";
const sal_Char __FAR_DATA szServiceName_UnoControlContainer[] = "stardiv.vcl.control.ControlContainer", szServiceName2_UnoControlContainer[] = "com.sun.star.awt.UnoControlContainer";
+
+
const sal_Char __FAR_DATA szServiceName_UnoControlContainerModel[] = "stardiv.vcl.controlmodel.ControlContainer", szServiceName2_UnoControlContainerModel[] = "com.sun.star.awt.UnoControlContainerModel";
const sal_Char __FAR_DATA szServiceName_TabController[] = "stardiv.vcl.control.TabController", szServiceName2_TabController[] = "com.sun.star.awt.TabController";
const sal_Char __FAR_DATA szServiceName_TabControllerModel[] = "stardiv.vcl.controlmodel.TabController", szServiceName2_TabControllerModel[] = "com.sun.star.awt.TabControllerModel";
@@ -88,6 +90,8 @@ const sal_Char __FAR_DATA szServiceName_UnoControlRoadmap[] = "stardiv.vcl.contr
const sal_Char __FAR_DATA szServiceName_UnoControlRoadmapModel[] = "stardiv.vcl.controlmodel.Roadmap", szServiceName2_UnoControlRoadmapModel[] = "com.sun.star.awt.UnoControlRoadmapModel";
const sal_Char __FAR_DATA szServiceName_UnoSpinButtonControl[] = "com.sun.star.awt.UnoControlSpinButton";
const sal_Char __FAR_DATA szServiceName_UnoSpinButtonModel[] = "com.sun.star.awt.UnoControlSpinButtonModel";
+const sal_Char __FAR_DATA szServiceName_UnoMultiPageControl[] = "com.sun.star.awt.UnoControlMultiPage";
+const sal_Char __FAR_DATA szServiceName_UnoMultiPageModel[] = "com.sun.star.awt.UnoMultiPageModel";
const sal_Char __FAR_DATA szServiceName_TreeControl[] = "com.sun.star.awt.tree.TreeControl";
const sal_Char __FAR_DATA szServiceName_TreeControlModel[] = "com.sun.star.awt.tree.TreeControlModel";
const sal_Char __FAR_DATA szServiceName_MutableTreeDataModel[] = "com.sun.star.awt.tree.MutableTreeDataModel";
diff --git a/unotools/inc/unotools/fltrcfg.hxx b/unotools/inc/unotools/fltrcfg.hxx
index 890efebde071..02bd5f6cca79 100644
--- a/unotools/inc/unotools/fltrcfg.hxx
+++ b/unotools/inc/unotools/fltrcfg.hxx
@@ -48,6 +48,8 @@ public:
void SetLoadWordBasicCode( sal_Bool bFlag );
sal_Bool IsLoadWordBasicCode() const;
+ void SetLoadWordBasicExecutable( sal_Bool bFlag );
+ sal_Bool IsLoadWordBasicExecutable() const;
void SetLoadWordBasicStorage( sal_Bool bFlag );
sal_Bool IsLoadWordBasicStorage() const;
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index ee0df67c9c07..ae04cebdc28e 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -61,6 +61,7 @@ using namespace com::sun::star::uno;
#define FILTERCFG_ENABLE_EXCEL_PREVIEW 0x40000
#define FILTERCFG_ENABLE_WORD_PREVIEW 0x80000
#define FILTERCFG_USE_ENHANCED_FIELDS 0x100000
+#define FILTERCFG_WORD_WBCTBL 0x200000
static SvtFilterOptions* pOptions=0;
@@ -150,6 +151,52 @@ void SvtAppFilterOptions_Impl::Load()
}
// -----------------------------------------------------------------------
+class SvtWriterFilterOptions_Impl : public SvtAppFilterOptions_Impl
+{
+ sal_Bool bLoadExecutable;
+public:
+ SvtWriterFilterOptions_Impl(const OUString& rRoot) :
+ SvtAppFilterOptions_Impl(rRoot),
+ bLoadExecutable(sal_False)
+ {}
+ virtual void Commit();
+ void Load();
+
+ sal_Bool IsLoadExecutable() const {return bLoadExecutable;}
+ void SetLoadExecutable(sal_Bool bSet)
+ {
+ if(bSet != bLoadExecutable)
+ SetModified();
+ bLoadExecutable = bSet;
+ }
+};
+
+void SvtWriterFilterOptions_Impl::Commit()
+{
+ SvtAppFilterOptions_Impl::Commit();
+
+ Sequence<OUString> aNames(1);
+ aNames[0] = C2U("Executable");
+ Sequence<Any> aValues(1);
+ aValues[0] <<= bLoadExecutable;
+
+ PutProperties(aNames, aValues);
+}
+
+void SvtWriterFilterOptions_Impl::Load()
+{
+ SvtAppFilterOptions_Impl::Load();
+
+ Sequence<OUString> aNames(1);
+ aNames[0] = C2U("Executable");
+
+ Sequence<Any> aValues = GetProperties(aNames);
+ const Any* pValues = aValues.getConstArray();
+ if(pValues[0].hasValue())
+ bLoadExecutable = *(sal_Bool*)pValues[0].getValue();
+}
+
+// -----------------------------------------------------------------------
class SvtCalcFilterOptions_Impl : public SvtAppFilterOptions_Impl
{
sal_Bool bLoadExecutable;
@@ -201,7 +248,7 @@ void SvtCalcFilterOptions_Impl::Load()
struct SvtFilterOptions_Impl
{
ULONG nFlags;
- SvtAppFilterOptions_Impl aWriterCfg;
+ SvtWriterFilterOptions_Impl aWriterCfg;
SvtCalcFilterOptions_Impl aCalcCfg;
SvtAppFilterOptions_Impl aImpressCfg;
@@ -246,6 +293,7 @@ void SvtFilterOptions_Impl::SetFlag( ULONG nFlag, BOOL bSet )
{
case FILTERCFG_WORD_CODE: aWriterCfg.SetLoad(bSet);break;
case FILTERCFG_WORD_STORAGE: aWriterCfg.SetSave(bSet);break;
+ case FILTERCFG_WORD_WBCTBL: aWriterCfg.SetLoadExecutable(bSet);break;
case FILTERCFG_EXCEL_CODE: aCalcCfg.SetLoad(bSet);break;
case FILTERCFG_EXCEL_STORAGE: aCalcCfg.SetSave(bSet);break;
case FILTERCFG_EXCEL_EXECTBL: aCalcCfg.SetLoadExecutable(bSet);break;
@@ -268,6 +316,7 @@ BOOL SvtFilterOptions_Impl::IsFlag( ULONG nFlag ) const
{
case FILTERCFG_WORD_CODE : bRet = aWriterCfg.IsLoad();break;
case FILTERCFG_WORD_STORAGE : bRet = aWriterCfg.IsSave();break;
+ case FILTERCFG_WORD_WBCTBL : bRet = aWriterCfg.IsLoadExecutable();break;
case FILTERCFG_EXCEL_CODE : bRet = aCalcCfg.IsLoad();break;
case FILTERCFG_EXCEL_STORAGE : bRet = aCalcCfg.IsSave();break;
case FILTERCFG_EXCEL_EXECTBL : bRet = aCalcCfg.IsLoadExecutable();break;
@@ -410,6 +459,17 @@ sal_Bool SvtFilterOptions::IsLoadWordBasicCode() const
return pImp->IsFlag( FILTERCFG_WORD_CODE );
}
+void SvtFilterOptions::SetLoadWordBasicExecutable( sal_Bool bFlag )
+{
+ pImp->SetFlag( FILTERCFG_WORD_WBCTBL, bFlag );
+ SetModified();
+}
+
+BOOL SvtFilterOptions::IsLoadWordBasicExecutable() const
+{
+ return pImp->IsFlag( FILTERCFG_WORD_WBCTBL );
+}
+
void SvtFilterOptions::SetLoadWordBasicStorage( sal_Bool bFlag )
{
pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag );
diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx
index 7483f54014a4..5c167c7af77c 100644
--- a/vcl/inc/vcl/bitmap.hxx
+++ b/vcl/inc/vcl/bitmap.hxx
@@ -267,9 +267,9 @@ public:
SAL_DLLPRIVATE void ImplSetImpBitmap( ImpBitmap* pImpBmp );
SAL_DLLPRIVATE void ImplAssignWithSize( const Bitmap& rBitmap );
- SAL_DLLPRIVATE static BOOL ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset );
+ SAL_DLLPRIVATE static BOOL ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bMSOFormat=FALSE );
SAL_DLLPRIVATE static BOOL ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset );
- SAL_DLLPRIVATE static BOOL ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown );
+ SAL_DLLPRIVATE static BOOL ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, BOOL bMSOFormat = FALSE );
SAL_DLLPRIVATE static BOOL ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL bQuad );
SAL_DLLPRIVATE static BOOL ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
SAL_DLLPRIVATE BOOL ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompressed ) const;
@@ -764,7 +764,7 @@ public:
public:
- BOOL Read( SvStream& rIStm, BOOL bFileHeader = TRUE );
+ BOOL Read( SvStream& rIStm, BOOL bFileHeader = TRUE, BOOL bMSOFormat = FALSE );
BOOL Write( SvStream& rOStm, BOOL bCompressed = TRUE, BOOL bFileHeader = TRUE ) const;
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap );
diff --git a/vcl/inc/vcl/bitmapex.hxx b/vcl/inc/vcl/bitmapex.hxx
index c19e1a9cbc39..7ecb6310a203 100644
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@ -395,6 +395,7 @@ public:
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
+ static BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);
};
#endif // _SV_BITMAPEX_HXX
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx
index 60fe97225b4b..9e7aa2f61cf9 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -53,6 +53,7 @@ private:
BOOL mbOldSaveBack;
BOOL mbInClose;
BOOL mbModalMode;
+ sal_Int8 mnCancelClose; //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
SAL_DLLPRIVATE void ImplInitDialogData();
SAL_DLLPRIVATE void ImplInitSettings();
@@ -91,6 +92,9 @@ public:
virtual short Execute();
BOOL IsInExecute() const { return mbInExecute; }
+ sal_Int8 GetCloseFlag() const { return mnCancelClose; } //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
+ void SetCloseFlag( sal_Int8 nCancel ) { mnCancelClose = nCancel; } //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
+
////////////////////////////////////////
// Dialog::Execute replacement API
public:
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index d760b0b46914..0ca12b1b4db1 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -44,7 +44,7 @@
// =======================================================================
-
+
inline ULONG ImplCreateKey( USHORT nPos )
{
// Key = Pos+1, wegen Pos 0
@@ -66,7 +66,7 @@ static void lcl_GetSelectedEntries( Table& rSelectedPos, const XubString& rText,
}
// =======================================================================
-
+
ComboBox::ComboBox( WindowType nType ) :
Edit( nType )
{
@@ -467,7 +467,10 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
mbSyntheticModify = TRUE;
Modify();
mbSyntheticModify = FALSE;
- Select();
+ if (ImplGetWindowImpl() != NULL) //liuchen 2009-7-28, resolve the problem that soffice get crashed if in ComboBox_Change event a Worksheets("SheetX").Activate sentence needs to be executed
+ {
+ Select();
+ }
}
return 0;
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index 0079073216f5..3dbb4e920717 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -44,6 +44,8 @@
#define DIBCOREHEADERSIZE ( 12UL )
#define DIBINFOHEADERSIZE ( sizeof( DIBInfoHeader ) )
+#define BITMAPINFOHEADER 0x28
+
#define SETPIXEL4( pBuf, nX, cChar )( (pBuf)[ (nX) >> 1 ] |= ( (nX) & 1 ) ? ( cChar ): (cChar) << 4 );
// ----------------------
@@ -127,7 +129,7 @@ SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap )
// ------------------------------------------------------------------
-BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader )
+BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader, BOOL bIsMSOFormat )
{
const USHORT nOldFormat = rIStm.GetNumberFormatInt();
const ULONG nOldPos = rIStm.Tell();
@@ -142,7 +144,7 @@ BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader )
bRet = ImplReadDIB( rIStm, *this, nOffset );
}
else
- bRet = ImplReadDIB( rIStm, *this, nOffset );
+ bRet = ImplReadDIB( rIStm, *this, nOffset, bIsMSOFormat );
if( !bRet )
{
@@ -159,14 +161,14 @@ BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset )
+BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIsMSOFormat )
{
DIBInfoHeader aHeader;
const ULONG nStmPos = rIStm.Tell();
BOOL bRet = FALSE;
sal_Bool bTopDown = sal_False;
- if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
+ if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown, bIsMSOFormat ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
{
const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) );
@@ -297,21 +299,37 @@ BOOL Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown )
+BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
{
// BITMAPINFOHEADER or BITMAPCOREHEADER
rIStm >> rHeader.nSize;
// BITMAPCOREHEADER
+ sal_Int16 nTmp16 = 0;
+ sal_uInt8 nTmp8 = 0;
if ( rHeader.nSize == DIBCOREHEADERSIZE )
{
- sal_Int16 nTmp16;
rIStm >> nTmp16; rHeader.nWidth = nTmp16;
rIStm >> nTmp16; rHeader.nHeight = nTmp16;
rIStm >> rHeader.nPlanes;
rIStm >> rHeader.nBitCount;
}
+ else if ( bIsMSOFormat && ( rHeader.nSize == BITMAPINFOHEADER ) )
+ {
+ rIStm >> nTmp16; rHeader.nWidth = nTmp16;
+ rIStm >> nTmp16; rHeader.nHeight = nTmp16;
+ rIStm >> nTmp8; rHeader.nPlanes = nTmp8;
+ rIStm >> nTmp8; rHeader.nBitCount = nTmp8;
+ rIStm >> nTmp16; rHeader.nSizeImage = nTmp16;
+ rIStm >> nTmp16; rHeader.nCompression = nTmp16;
+ if ( !rHeader.nSizeImage ) // uncompressed?
+ rHeader.nSizeImage = ((rHeader.nWidth * rHeader.nBitCount + 31) & ~31) / 8 * rHeader.nHeight;
+ rIStm >> rHeader.nXPelsPerMeter;
+ rIStm >> rHeader.nYPelsPerMeter;
+ rIStm >> rHeader.nColsUsed;
+ rIStm >> rHeader.nColsImportant;
+ }
else
{
// unknown Header
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index ddcf2fe05248..4eb658c1ccb0 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -41,6 +41,7 @@
#include <tools/rc.h>
#include <vcl/svapp.hxx>
#include <vcl/bmpacc.hxx>
+#include <vcl/virdev.hxx>
// ------------
// - BitmapEx -
@@ -753,6 +754,61 @@ void BitmapEx::Draw( OutputDevice* pOutDev,
pOutDev->DrawBitmapEx( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, *this );
}
+BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize)
+{
+ Point aEmptyPoint(0,0);
+ sal_Int32 imgNewWidth = 0;
+ sal_Int32 imgNewHeight = 0;
+ double imgposX = 0;
+ double imgposY = 0;
+ BitmapEx aRet = aBitmap;
+ double imgOldWidth = aRet.GetSizePixel().Width();
+ double imgOldHeight =aRet.GetSizePixel().Height();
+
+ Size aScaledSize;
+ if (imgOldWidth >= aStandardSize || imgOldHeight >= aStandardSize)
+ {
+ if (imgOldWidth >= imgOldHeight)
+ {
+ imgNewWidth = aStandardSize;
+ imgNewHeight = sal_Int32(imgOldHeight / (imgOldWidth / aStandardSize) + 0.5);
+ imgposX = 0;
+ imgposY = (aStandardSize - (imgOldHeight / (imgOldWidth / aStandardSize) + 0.5)) / 2 + 0.5;
+ }
+ else
+ {
+ imgNewHeight = aStandardSize;
+ imgNewWidth = sal_Int32(imgOldWidth / (imgOldHeight / aStandardSize) + 0.5);
+ imgposY = 0;
+ imgposX = (aStandardSize - (imgOldWidth / (imgOldHeight / aStandardSize) + 0.5)) / 2 + 0.5;
+ }
+
+ aScaledSize = Size( imgNewWidth, imgNewHeight );
+ aRet.Scale( aScaledSize, BMP_SCALE_INTERPOLATE );
+ }
+ else
+ {
+ imgposX = (aStandardSize - imgOldWidth) / 2 + 0.5;
+ imgposY = (aStandardSize - imgOldHeight) / 2 + 0.5;
+ }
+
+ Size aBmpSize = aRet.GetSizePixel();
+ Size aStdSize( aStandardSize, aStandardSize );
+ Rectangle aRect(aEmptyPoint, aStdSize );
+
+ VirtualDevice aVirDevice( *Application::GetDefaultDevice(), 0, 1 );
+ aVirDevice.SetOutputSizePixel( aStdSize );
+ aVirDevice.SetFillColor( COL_TRANSPARENT );
+ aVirDevice.SetLineColor( COL_TRANSPARENT );
+
+ //draw a rect into virDevice
+ aVirDevice.DrawRect( aRect );
+ Point aPointPixel( (long)imgposX, (long)imgposY );
+ aVirDevice.DrawBitmapEx( aPointPixel, aRet );
+ aRet = aVirDevice.GetBitmapEx( aEmptyPoint, aStdSize );
+
+ return aRet;
+}
// ------------------------------------------------------------------
sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 1f6ebd658c84..1ed9fd002289 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -557,7 +557,18 @@ BOOL Dialog::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
+ //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
+ mnCancelClose = 0;
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
+ // basic boolean ( and what the user might use in the event handler) can
+ // be ambiguous ( e.g. basic true = -1 )
+ // test agains 0 ( false ) and assume anything else is true
+ // ( Note: ) this used to work ( something changes somewhere )
+ if (mnCancelClose != 0)
+ {
+ return FALSE;
+ }
+ //liuchen 2009-7-22
if ( aDelData.IsDelete() )
return FALSE;
ImplRemoveDel( &aDelData );
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 47f4d68ef8fc..bdefc7b56802 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -54,6 +54,8 @@ using namespace rtl;
#define TB_SEP_SIZE 8
+ButtonType determineButtonType( ImplToolItem* pItem, ButtonType defaultType );
+
// -----------------------------------------------------------------------
ImplToolBoxPrivateData::ImplToolBoxPrivateData() :