[Libreoffice-commits] .: 5 commits - svtools/inc svtools/source toolkit/inc toolkit/source unotools/inc unotools/source vcl/inc vcl/source
Noel Power
noelp at kemper.freedesktop.org
Wed Oct 13 07:23:01 PDT 2010
svtools/inc/bindablecontrolhelper.hxx | 61 ++++++
svtools/inc/filterutils.hxx | 22 ++
svtools/source/misc/bindablecontrolhelper.cxx | 161 +++++++++++++++++
svtools/source/misc/filterutils.cxx | 55 ++++++
svtools/source/misc/makefile.mk | 2
toolkit/inc/toolkit/awt/vclxmenu.hxx | 2
toolkit/inc/toolkit/awt/vclxwindows.hxx | 8
toolkit/inc/toolkit/controls/dialogcontrol.hxx | 44 +++-
toolkit/inc/toolkit/controls/unocontrols.hxx | 39 ++++
toolkit/inc/toolkit/helper/property.hxx | 3
toolkit/inc/toolkit/helper/servicenames.hxx | 2
toolkit/source/awt/vclxmenu.cxx | 13 +
toolkit/source/awt/vclxwindows.cxx | 83 ++++++---
toolkit/source/controls/dialogcontrol.cxx | 227 +++++++++++++++++--------
toolkit/source/controls/unocontrolmodel.cxx | 1
toolkit/source/controls/unocontrols.cxx | 77 ++++++++
toolkit/source/helper/property.cxx | 2
toolkit/source/helper/registerservices.cxx | 6
toolkit/source/helper/servicenames.cxx | 4
unotools/inc/unotools/fltrcfg.hxx | 2
unotools/source/config/fltrcfg.cxx | 62 ++++++
vcl/inc/vcl/bitmap.hxx | 6
vcl/inc/vcl/bitmapex.hxx | 1
vcl/inc/vcl/dialog.hxx | 4
vcl/source/control/combobox.cxx | 27 +-
vcl/source/gdi/bitmap2.cxx | 30 ++-
vcl/source/gdi/bitmapex.cxx | 56 ++++++
vcl/source/window/dialog.cxx | 27 ++
vcl/source/window/toolbox2.cxx | 2
29 files changed, 886 insertions(+), 143 deletions(-)
New commits:
commit f58bfd38df7ccc80cd6abce3b69a75e86cb5e863
Merge: 3e1bb90... faf640e...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 15:17:38 2010 +0100
Merge branch 'master' of ssh://noelp@git.freedesktop.org/git/libreoffice/libs-gui
commit 3e1bb901d307619e7d9ddd9d8ea08e0c0193db04
Merge: 3a48a38... ce8ec7e...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 13:14:57 2010 +0100
Merge commit 'origin/master'
commit 3a48a38e269185a7a114d540ecb79587cd3d58d0
Merge: 824b7fb... e7afd1f...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 10:55:27 2010 +0100
Merge branch 'vba' fix conflics, trailing ws & tab issues
Conflicts:
unotools/source/config/fltrcfg.cxx
diff --cc svtools/inc/bindablecontrolhelper.hxx
index 0000000,e9cd3e6..d154ea4
mode 000000,100644..100644
--- a/svtools/inc/bindablecontrolhelper.hxx
+++ b/svtools/inc/bindablecontrolhelper.hxx
@@@ -1,0 -1,62 +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 // DBA14_SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
-
++#endif // SVTOOLS_INC_BINDABLECONTROL_HXX
diff --cc svtools/inc/filterutils.hxx
index 0000000,a05025f..e10eb2a
mode 000000,100644..100644
--- a/svtools/inc/filterutils.hxx
+++ b/svtools/inc/filterutils.hxx
@@@ -1,0 -1,22 +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
++#endif
diff --cc svtools/source/misc/bindablecontrolhelper.cxx
index 0000000,ba842f0..4dac025
mode 000000,100644..100644
--- a/svtools/source/misc/bindablecontrolhelper.cxx
+++ b/svtools/source/misc/bindablecontrolhelper.cxx
@@@ -1,0 -1,162 +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;
++ 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 --cc svtools/source/misc/filterutils.cxx
index 0000000,91a6ca4..5a31070
mode 000000,100644..100644
--- a/svtools/source/misc/filterutils.cxx
+++ b/svtools/source/misc/filterutils.cxx
@@@ -1,0 -1,56 +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 --cc toolkit/inc/toolkit/awt/vclxmenu.hxx
index 590f7b8,88be605..7bb19e9
--- a/toolkit/inc/toolkit/awt/vclxmenu.hxx
+++ b/toolkit/inc/toolkit/awt/vclxmenu.hxx
@@@ -181,6 -182,7 +182,7 @@@ class TOOLKIT_DLLPUBLIC VCLXPopupMenu
{
public:
VCLXPopupMenu();
- VCLXPopupMenu( PopupMenu* pPopMenu );
++ VCLXPopupMenu( PopupMenu* pPopMenu );
};
#endif // _TOOLKIT_AWT_VCLXMENU_HXX_
diff --cc toolkit/inc/toolkit/awt/vclxwindows.hxx
index 657cc19,33bd033..97d55c8
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -376,6 -379,7 +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 ::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 -417,10 +415,10 @@@
// ::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);
++ //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 --cc toolkit/inc/toolkit/controls/dialogcontrol.hxx
index 7b8e025,a1725f2..7610fa7
--- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -73,7 -75,7 +75,7 @@@ private
typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList;
// for grouping control models (XTabControllerModel::getGroupXXX)
-- typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >
++ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >
ModelGroup;
typedef ::std::vector< ModelGroup > AllGroups;
@@@ -88,8 -90,10 +90,10 @@@ private
AllGroups maGroups;
sal_Bool mbGroupsUpToDate;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
- bool mbAdjustingGraphic;
-protected:
+
- protected:
++ ::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();
@@@ -99,7 -103,7 +103,7 @@@ public
UnoControlDialogModel();
UnoControlDialogModel( const UnoControlDialogModel& rModel );
~UnoControlDialogModel();
--
++
UnoControlModel* Clone() const;
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlModel::queryInterface(rType); }
@@@ -118,14 -122,14 +122,14 @@@
// ::com::sun::star::container::XElementAcces
::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
--
++
// ::com::sun::star::container::XIndexContainer, XIndexReplace, XIndexAcces
// void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
// sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException) = 0;
// ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
// void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
// void SAL_CALL removeByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
--
++
// ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess
void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
@@@ -136,12 -140,12 +140,12 @@@
// ::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::XMultiServiceFactory
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
--
++
// ::com::sun::star::io::XPersistObject
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
@@@ -175,6 -179,8 +179,8 @@@
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 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 );
@@@ -207,13 -221,13 +221,13 @@@ class ResourceListener :public ::com::
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL acquire() throw ();
virtual void SAL_CALL release() throw ();
--
++
// XModifyListener
virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
--
++
private:
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xResource;
::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xListener;
@@@ -226,14 -240,14 +240,14 @@@ class UnoDialogControl :public UnoContr
private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController;
-- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener;
++ ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener;
TopWindowListenerMultiplexer maTopWindowListeners;
bool mbWindowListener;
bool mbSizeModified;
bool mbPosModified;
protected:
--
++
void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName );
void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel );
void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
@@@ -266,12 -280,12 +280,12 @@@ public
virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
--
++
// ::com::sun::star::container::XContainerListener
void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
--
++
// ::com::sun::star::awt::XDialog2
virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException);
@@@ -295,7 -309,7 +309,7 @@@
// XModifyListener
virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
--
++
// ::com::sun::star::lang::XServiceInfo
DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog )
diff --cc toolkit/inc/toolkit/controls/unocontrols.hxx
index 8358389,fadec7d..ff33b49
--- a/toolkit/inc/toolkit/controls/unocontrols.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrols.hxx
@@@ -637,6 -636,44 +636,44 @@@ public
};
+ class UnoMultiPageModel : public UnoControlModel
+ {
+ protected:
- ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
- ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
++ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
++ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ public:
- UnoMultiPageModel();
- UnoMultiPageModel( const UnoMultiPageModel& rModel ) : UnoControlModel( rModel ) {;}
++ UnoMultiPageModel();
++ UnoMultiPageModel( const UnoMultiPageModel& rModel ) : UnoControlModel( rModel ) {;}
+
- UnoControlModel* Clone() const { return new UnoMultiPageModel( *this ); }
++ UnoControlModel* Clone() const { return new UnoMultiPageModel( *this ); }
+
- // ::com::sun::star::io::XPersistObject
++ // ::com::sun::star::io::XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
- // ::com::sun::star::beans::XMultiPropertySet
++ // ::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 )
++ // ::com::sun::star::lang::XServiceInfo
++ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageModel, UnoControlModel, szServiceName_UnoMultiPageModel )
+
+ };
+ // ----------------------------------------------------
+ // class UnoGroupBoxControl
+ // ----------------------------------------------------
+ class UnoMultiPageControl : public UnoControlBase
+ {
+ public:
- UnoMultiPageControl();
- ::rtl::OUString GetComponentServiceName();
++ 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 )
++ // ::com::sun::star::lang::XServiceInfo
++ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, UnoControlBase, szServiceName_UnoMultiPageControl )
+
+ };
+
// ----------------------------------------------------
// class UnoFixedTextControl
// ----------------------------------------------------
diff --cc toolkit/source/awt/vclxmenu.cxx
index c6294c8,eb5cb3b..004b2c8
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@@ -539,6 -539,14 +539,14 @@@ void VCLXMenu::setPopupMenu( sal_Int16
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 > ;
++ ::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;
}
diff --cc toolkit/source/awt/vclxwindows.cxx
index 9540aa7,8864d75..10af294
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -2172,7 -2175,7 +2173,7 @@@ void SAL_CALL VCLXListBox::itemListChan
uno::UNO_QUERY
);
}
--
++
Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems();
@@@ -2301,6 -2304,7 +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::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 -2312,7 +2310,7 @@@
// ::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::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 -2423,40 +2421,40 @@@ void SAL_CALL VCLXDialog::draw( sal_Int
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 )
++ 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);
- }
- }
++ 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 )
++ const ::rtl::OUString& PropertyName )
+ throw(::com::sun::star::uno::RuntimeException)
+ {
- ::vos::OGuard aGuard( GetMutex() );
++ ::vos::OGuard aGuard( GetMutex() );
+
- ::com::sun::star::uno::Any aRet;
- return aRet;
++ ::com::sun::star::uno::Any aRet;
++ return aRet;
+ }
+ //liuchen 2009-7-22
+
+
+
void SAL_CALL VCLXDialog::setProperty(
const ::rtl::OUString& PropertyName,
@@@ -3481,27 -3520,27 +3518,27 @@@ void VCLXScrollBar::ProcessWindowEvent
void VCLXEdit::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
{
PushPropertyIds( rIds,
-- BASEPROPERTY_ALIGN,
-- BASEPROPERTY_BACKGROUNDCOLOR,
-- BASEPROPERTY_BORDER,
-- BASEPROPERTY_BORDERCOLOR,
-- BASEPROPERTY_DEFAULTCONTROL,
-- BASEPROPERTY_ECHOCHAR,
-- BASEPROPERTY_ENABLED,
++ BASEPROPERTY_ALIGN,
++ BASEPROPERTY_BACKGROUNDCOLOR,
++ BASEPROPERTY_BORDER,
++ BASEPROPERTY_BORDERCOLOR,
++ BASEPROPERTY_DEFAULTCONTROL,
++ BASEPROPERTY_ECHOCHAR,
++ BASEPROPERTY_ENABLED,
BASEPROPERTY_ENABLEVISIBLE,
-- BASEPROPERTY_FONTDESCRIPTOR,
-- BASEPROPERTY_HARDLINEBREAKS,
-- BASEPROPERTY_HELPTEXT,
-- BASEPROPERTY_HELPURL,
-- BASEPROPERTY_HSCROLL,
-- BASEPROPERTY_LINE_END_FORMAT,
-- BASEPROPERTY_MAXTEXTLEN,
-- BASEPROPERTY_MULTILINE,
-- BASEPROPERTY_PRINTABLE,
-- BASEPROPERTY_READONLY,
-- BASEPROPERTY_TABSTOP,
-- BASEPROPERTY_TEXT,
-- BASEPROPERTY_VSCROLL,
++ BASEPROPERTY_FONTDESCRIPTOR,
++ BASEPROPERTY_HARDLINEBREAKS,
++ BASEPROPERTY_HELPTEXT,
++ BASEPROPERTY_HELPURL,
++ BASEPROPERTY_HSCROLL,
++ BASEPROPERTY_LINE_END_FORMAT,
++ BASEPROPERTY_MAXTEXTLEN,
++ BASEPROPERTY_MULTILINE,
++ BASEPROPERTY_PRINTABLE,
++ BASEPROPERTY_READONLY,
++ BASEPROPERTY_TABSTOP,
++ BASEPROPERTY_TEXT,
++ BASEPROPERTY_VSCROLL,
BASEPROPERTY_HIDEINACTIVESELECTION,
BASEPROPERTY_PAINTTRANSPARENT,
BASEPROPERTY_AUTOHSCROLL,
@@@ -4324,7 -4363,7 +4361,7 @@@ void SAL_CALL VCLXComboBox::itemListCha
uno::UNO_QUERY
);
}
--
++
Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems();
diff --cc toolkit/source/controls/dialogcontrol.cxx
index cf37e10,1fe21d2..ed00046
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -141,6 -146,18 +144,18 @@@ namespac
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() &&
++ if (xSet.is() && (xPSI = xSet->getPropertySetInfo()).is() &&
+ xPSI->hasPropertyByName( sProperty ) )
+ {
+ xSet->getPropertyValue( sProperty ) >>= sValue;
+ }
+ return sValue;
+ }
+
}
// ----------------------------------------------------------------------------
@@@ -252,7 -269,7 +267,7 @@@ static const ::rtl::OUString& getStepPr
UnoControlDialogModel::UnoControlDialogModel()
:maContainerListeners( *this )
,maChangeListeners ( GetMutex() )
- ,mbGroupsUpToDate( sal_False )
- ,mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
++ ,mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
// ImplRegisterProperty( BASEPROPERTY_BORDER );
@@@ -274,6 -291,8 +289,8 @@@
aBool <<= (sal_Bool) sal_True;
ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
- aBool <<= (sal_Bool) sal_False;
- ImplRegisterProperty( BASEPROPERTY_VBAFORM, aBool );
++ aBool <<= (sal_Bool) sal_False;
++ ImplRegisterProperty( BASEPROPERTY_VBAFORM, aBool );
}
UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
@@@ -281,7 -300,7 +298,7 @@@
, UnoControlDialogModel_Base( rModel )
, maContainerListeners( *this )
, maChangeListeners ( GetMutex() )
- , mbGroupsUpToDate( sal_False )
- , mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
++ , mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
{
}
@@@ -312,6 -331,40 +329,40 @@@ Sequence< Type > UnoControlDialogModel:
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 -957,63 +955,63 @@@ void UnoControlDialogModel::implNotifyT
}
}
+ // ----------------------------------------------------------------------------
-void UnoControlDialogModel::AddRadioButtonGroup (
++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 (
++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 -1038,13 +1036,13 @@@
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
++ 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
@@@ -977,7 -1084,7 +1082,7 @@@
{
if ( !bIsRadioButton )
{ // no radio button -> the group is done
- aCurrentGroup = maGroups.end();
- aCurrentGroup = NULL;
++ aCurrentGroup = NULL;
eState = eLookingForGroup;
#if OSL_DEBUG_LEVEL > 1
aCurrentGroupLabels.clear();
@@@ -1418,17 -1487,32 +1485,32 @@@ void UnoDialogControl::ImplSetPosSize(
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 );
++ // 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();
if ( pOutDev )
{
::Size aTmp( nX, nY );
- aTmp = pOutDev->LogicToPixel( aTmp, MAP_APPFONT );
- aTmp = pOutDev->LogicToPixel( aTmp, aMode );
++ 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 );
++ aTmp = pOutDev->LogicToPixel( aTmp, aMode );
nWidth = aTmp.Width();
nHeight = aTmp.Height();
}
@@@ -1650,8 -1734,7 +1732,7 @@@ void UnoDialogControl::PrepareWindowDes
if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
( aImageURL.getLength() > 0 ))
{
- ::rtl::OUString absoluteUrl =
- aImageURL =
++ aImageURL =
getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
ImplGetPropertyValue( PROPERTY_IMAGEURL ));
@@@ -2110,9 -2194,16 +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;
++ // 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 --cc toolkit/source/controls/unocontrols.cxx
index 19196ef,80c5f63..c4cc8bd
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@@ -1728,6 -1730,75 +1728,75 @@@ sal_Bool UnoGroupBoxControl::isTranspar
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 );
++ 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 );
++ 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 );
++ 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;
++ 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;
++ static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
++ return xInfo;
+ }
+
+ // ----------------------------------------------------
+ // class MultiPageControl
+ // ----------------------------------------------------
+ UnoMultiPageControl::UnoMultiPageControl()
+ {
- maComponentInfos.nWidth = 100;
- maComponentInfos.nHeight = 100;
++ maComponentInfos.nWidth = 100;
++ maComponentInfos.nHeight = 100;
+ }
+
+ ::rtl::OUString UnoMultiPageControl::GetComponentServiceName()
+ {
- return ::rtl::OUString::createFromAscii( "multipage" );
++ return ::rtl::OUString::createFromAscii( "multipage" );
+ }
+
+ sal_Bool UnoMultiPageControl::isTransparent() throw(uno::RuntimeException)
+ {
- return sal_True;
++ return sal_True;
+ }
+
// =====================================================================================================================
// = UnoControlListBoxModel_Data
// =====================================================================================================================
diff --cc unotools/source/config/fltrcfg.cxx
index e42343f,2b8b0d1..7c3e4fd
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@@ -410,7 -459,18 +459,18 @@@ sal_Bool SvtFilterOptions::IsLoadWordBa
return pImp->IsFlag( FILTERCFG_WORD_CODE );
}
-void SvtFilterOptions::SetLoadWordBasicExecutable( BOOL bFlag )
++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( BOOL bFlag )
+void SvtFilterOptions::SetLoadWordBasicStorage( sal_Bool bFlag )
{
pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag );
SetModified();
diff --cc vcl/inc/vcl/bitmapex.hxx
index a7185da,29dfe13..258cf90
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@@ -395,6 -395,7 +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);
++ static BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);
};
#endif // _SV_BITMAPEX_HXX
diff --cc vcl/inc/vcl/dialog.hxx
index 1032908,f771333..eae6c6f
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@@ -53,6 -53,7 +53,7 @@@ private
BOOL mbOldSaveBack;
BOOL mbInClose;
BOOL mbModalMode;
- sal_Int8 mnCancelClose; //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
++ 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 +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
++ 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 --cc vcl/source/control/combobox.cxx
index 5b38ce7,a4d57df..a8afec4
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -44,7 -46,7 +44,7 @@@
// =======================================================================
--
++
inline ULONG ImplCreateKey( USHORT nPos )
{
// Key = Pos+1, wegen Pos 0
@@@ -66,7 -68,7 +66,7 @@@ static void lcl_GetSelectedEntries( Tab
}
// =======================================================================
--
++
ComboBox::ComboBox( WindowType nType ) :
Edit( nType )
{
@@@ -353,7 -355,7 +353,7 @@@ IMPL_LINK( ComboBox, ImplAutocompleteHd
bForward = FALSE;
nStart = nStart ? nStart - 1 : mpImplLB->GetEntryList()->GetEntryCount()-1;
}
--
++
USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
if( ! mbMatchCase )
{
@@@ -363,7 -365,7 +363,7 @@@
// Try match case insensitive, but from start
nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, TRUE );
}
--
++
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Try match full from current position
nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, FALSE );
@@@ -466,8 -468,11 +466,11 @@@ IMPL_LINK( ComboBox, ImplSelectHdl, voi
mpSubEdit->SetModifyFlag();
mbSyntheticModify = TRUE;
Modify();
- mbSyntheticModify = FALSE;
- 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();
- }
+ 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;
@@@ -787,7 -792,7 +790,7 @@@ void ComboBox::DataChanged( const DataC
}
Resize();
mpImplLB->Resize(); // Wird nicht durch ComboBox::Resize() gerufen, wenn sich die ImplLB nicht aendert.
-- SetBackground(); // due to a hack in Window::UpdateSettings the background must be reset
++ SetBackground(); // due to a hack in Window::UpdateSettings the background must be reset
// otherwise it will overpaint NWF drawn comboboxes
}
}
@@@ -1284,9 -1289,9 +1287,9 @@@ void ComboBox::Draw( OutputDevice* pDev
if ( !nLines )
nLines = 1;
USHORT nTEntry = IsReallyVisible() ? mpImplLB->GetTopEntry() : 0;
--
++
Rectangle aTextRect( aPos, aSize );
--
++
aTextRect.Left() += 3*nOnePixel;
aTextRect.Right() -= 3*nOnePixel;
aTextRect.Top() += nEditHeight + nOnePixel;
@@@ -1302,14 -1307,14 +1305,14 @@@
}
pDev->Pop();
--
++
// Call Edit::Draw after restoring the MapMode...
if ( IsDropDownBox() )
{
mpSubEdit->Draw( pDev, rPos, rSize, nFlags );
// DD-Button ?
}
--
++
}
// -----------------------------------------------------------------------
@@@ -1566,7 -1571,7 +1569,7 @@@ long ComboBox::GetIndexForPoint( const
// point must be either in main list window
// or in impl window (dropdown case)
ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
--
++
// convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
diff --cc vcl/source/gdi/bitmap2.cxx
index eda247c,e18f13f..d4a38b2
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@@ -142,7 -146,7 +144,7 @@@ BOOL Bitmap::Read( SvStream& rIStm, BOO
bRet = ImplReadDIB( rIStm, *this, nOffset );
}
else
- bRet = ImplReadDIB( rIStm, *this, nOffset );
- bRet = ImplReadDIB( rIStm, *this, nOffset, bIsMSOFormat );
++ bRet = ImplReadDIB( rIStm, *this, nOffset, bIsMSOFormat );
if( !bRet )
{
@@@ -166,7 -170,7 +168,7 @@@ BOOL Bitmap::ImplReadDIB( SvStream& rIS
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 )
++ if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown, bIsMSOFormat ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
{
const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) );
@@@ -303,15 -307,31 +305,31 @@@ BOOL Bitmap::ImplReadDIBInfoHeader( SvS
rIStm >> rHeader.nSize;
// BITMAPCOREHEADER
- sal_Int16 nTmp16 = 0;
- sal_uInt8 nTmp8 = 0;
++ 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 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 --cc vcl/source/gdi/bitmapex.cxx
index 7b68fda,1997455..ce0804a
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@@ -37,10 -37,15 +37,11 @@@
#include <vcl/image.h>
#include <vcl/bitmapex.hxx>
#include <vcl/pngread.hxx>
-#ifndef _SV_IMPIMAGETREE_H
#include <vcl/impimagetree.hxx>
-#endif
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svapp.hxx>
#include <vcl/bmpacc.hxx>
+ #include <vcl/virdev.hxx>
// ------------
// - BitmapEx -
@@@ -753,6 -758,61 +754,61 @@@ void BitmapEx::Draw( OutputDevice* pOut
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;
++ 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();
++ 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 );
++ {
++ 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;
- }
++ }
++ 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.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 );
++ aVirDevice.DrawRect( aRect );
++ Point aPointPixel( (long)imgposX, (long)imgposY );
++ aVirDevice.DrawBitmapEx( aPointPixel, aRet );
++ aRet = aVirDevice.GetBitmapEx( aEmptyPoint, aStdSize );
+
- return aRet;
++ return aRet;
+ }
// ------------------------------------------------------------------
sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const
diff --cc vcl/source/window/dialog.cxx
index a40195c,901c934..1ed9fd0
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -557,7 -559,18 +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 );
++ //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
++ // 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 );
@@@ -636,7 -649,7 +647,7 @@@ BOOL Dialog::ImplStartExecuteModal(
"Dialog::StartExecuteModal() - Parent input disabled, use another parent to ensure modality!" );
DBG_ASSERT( ! pParent->IsInModalMode(),
"Dialog::StartExecuteModal() - Parent already modally disabled, use another parent to ensure modality!" );
--
++
}
#endif
@@@ -662,10 -675,10 +673,10 @@@
SetModalInputMode( TRUE );
mbOldSaveBack = IsSaveBackgroundEnabled();
EnableSaveBackground();
--
++
// FIXME: no layouting, workaround some clipping issues
ImplAdjustNWFSizes();
--
++
Show();
pSVData->maAppData.mnModalMode++;
@@@ -689,7 -702,7 +700,7 @@@ short Dialog::Execute(
ImplDelData aDelData;
ImplAddDel( &aDelData );
--
++
#ifdef DBG_UTIL
ImplDelData aParentDelData;
Window* pDialogParent = mpDialogParent;
@@@ -953,15 -966,15 +964,15 @@@ void Dialog::Draw( OutputDevice* pDev,
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
--
++
Wallpaper aWallpaper = GetBackground();
if ( !aWallpaper.IsBitmap() )
ImplInitSettings();
--
++
pDev->Push();
pDev->SetMapMode();
pDev->SetLineColor();
--
++
if ( aWallpaper.IsBitmap() )
pDev->DrawBitmapEx( aPos, aSize, aWallpaper.GetBitmap() );
else
commit e7afd1fc02b1800a65efa2ecb087e70c249ba5b8
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 6 10:32:27 2010 +0100
initial commit for vba blob ( not including container_control stuff )
diff --git a/svtools/inc/bindablecontrolhelper.hxx b/svtools/inc/bindablecontrolhelper.hxx
new file mode 100644
index 0000000..e9cd3e6
--- /dev/null
+++ b/svtools/inc/bindablecontrolhelper.hxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * 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 // DBA14_SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
+
diff --git a/svtools/inc/filterutils.hxx b/svtools/inc/filterutils.hxx
new file mode 100644
index 0000000..a05025f
--- /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 0000000..ba842f0
--- /dev/null
+++ b/svtools/source/misc/bindablecontrolhelper.cxx
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * 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 0000000..91a6ca4
--- /dev/null
+++ b/svtools/source/misc/filterutils.cxx
@@ -0,0 +1,56 @@
+// 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
+//........................................................................
+
commit 9a765074bb7cd5d7fbe94e84f50ebbb5ec07ccfd
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 6 10:16:39 2010 +0100
initial commit for vba blob ( not including container_control stuff )
diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk
index 32781db..cd14b3b 100755
--- a/svtools/source/misc/makefile.mk
+++ b/svtools/source/misc/makefile.mk
@@ -75,6 +75,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 9fefbe9..88be605 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 bbb4100..33bd033 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -94,6 +94,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;
@@ -378,6 +379,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:
@@ -415,6 +417,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 7b8e025..a1725f2 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
@@ -88,7 +90,9 @@ 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 8358389..fadec7d 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 2fb64b2..3c8e4a1 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 91ece3a..374373b 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 c6294c8..eb5cb3b 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 b079536..8864d75 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -1082,6 +1082,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 );
}
@@ -2303,6 +2304,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 ));
@@ -2310,6 +2312,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()
@@ -2420,6 +2423,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 7f23b49..1fe21d2 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -81,6 +81,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" ))
@@ -91,6 +92,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;
@@ -116,7 +119,7 @@ namespace
}
return s_aLanguageDependentProperties;
}
-
+
static uno::Reference< graphic::XGraphic > lcl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
{
uno::Reference< graphic::XGraphic > xGraphic;
@@ -143,6 +146,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;
+ }
+
}
// ----------------------------------------------------------------------------
@@ -254,7 +269,7 @@ static const ::rtl::OUString& getStepPropertyName( )
UnoControlDialogModel::UnoControlDialogModel()
:maContainerListeners( *this )
,maChangeListeners ( GetMutex() )
- ,mbGroupsUpToDate( sal_False )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list