1. mst
  2. ooo340

Commits

Kurt Zenker  committed e6fe88b Merge

CWS-TOOLING: integrate CWS fs33a

  • Participants
  • Parent commits 8fd4d7e, 33e9fb7
  • Branches default

Comments (0)

Files changed (27)

File dbaccess/source/core/api/KeySet.cxx

View file
  • Ignore whitespace
                                                    ,const Reference<XDatabaseMetaData>& i_xMeta
                                                    ,const Reference<XNameAccess>& i_xQueryColumns)
 {
-    ::rtl::OUString sCatalog,sSchema,sTable;
-	Reference<XPropertySet> xTableProp(i_aTable,UNO_QUERY);
-    Any aCatalog = xTableProp->getPropertyValue(PROPERTY_CATALOGNAME);
-	aCatalog >>= sCatalog;
-	xTableProp->getPropertyValue(PROPERTY_SCHEMANAME)	>>= sSchema;
-	xTableProp->getPropertyValue(PROPERTY_NAME)			>>= sTable;
-
     // first ask the database itself for the best columns which can be used
     Sequence< ::rtl::OUString> aBestColumnNames;
     Reference<XNameAccess> xKeyColumns	= getPrimaryKeyColumns_throw(i_aTable);
 
     const Reference<XColumnsSupplier> xTblColSup(i_aTable,UNO_QUERY_THROW);
     const Reference<XNameAccess> xTblColumns = xTblColSup->getColumns();
-    const ::rtl::OUString sComposedUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation );
-    ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sComposedUpdateTableName,(*m_pKeyColumnNames),true);
-    ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sComposedUpdateTableName,(*m_pColumnNames),true);
-
     // locate parameter in select columns
     Reference<XParametersSupplier> xParaSup(m_xComposer,UNO_QUERY);
     Reference<XIndexAccess> xQueryParameters = xParaSup->getParameters();
         Reference<XPropertySet> xPara(xQueryParameters->getByIndex(i),UNO_QUERY_THROW);
         xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumns[i];
     }
-    ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sComposedUpdateTableName,(*m_pParameterNames),true);
+
+    if ( m_sUpdateTableName.getLength() )
+    {
+        ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames),true);
+        ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames),true);
+        ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,m_sUpdateTableName,(*m_pParameterNames),true);
+    }
+    else
+    {
+        ::rtl::OUString sCatalog,sSchema,sTable;
+	    Reference<XPropertySet> xTableProp(i_aTable,UNO_QUERY);
+        Any aCatalog = xTableProp->getPropertyValue(PROPERTY_CATALOGNAME);
+	    aCatalog >>= sCatalog;
+	    xTableProp->getPropertyValue(PROPERTY_SCHEMANAME)	>>= sSchema;
+	    xTableProp->getPropertyValue(PROPERTY_NAME)			>>= sTable;
+        const ::rtl::OUString sComposedUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation );
+        ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sComposedUpdateTableName,(*m_pKeyColumnNames),true);
+        ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sComposedUpdateTableName,(*m_pColumnNames),true);
+        ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sComposedUpdateTableName,(*m_pParameterNames),true);
+    }
 
     SelectColumnsMetaData::const_iterator aPosIter = m_pKeyColumnNames->begin();
     SelectColumnsMetaData::const_iterator aPosEnd = m_pKeyColumnNames->end();
 			::rtl::OUString sStmt = ::rtl::OUString::createFromAscii("SELECT ");
 			sStmt += sMaxStmt;
 			sStmt += ::rtl::OUString::createFromAscii("FROM ");
-			sStmt += m_aSelectComposedTableName;
+			::rtl::OUString sCatalog,sSchema,sTable;
+			::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
+			sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable );
+			//sStmt += m_aSelectComposedTableName;
 			try
 			{
 				// now fetch the autoincrement values
                 sal_Int32 nIndex = sValue.indexOf('.');
                 if ( nIndex != -1 )
                 {
-                    aValue = sValue.copy(0,nIndex + (i_aMetaData.nScale > 0 ? i_aMetaData.nScale + 1 : 0));
+					aValue = sValue.copy(0,::std::min(sValue.getLength(),nIndex + (i_aMetaData.nScale > 0 ? i_aMetaData.nScale + 1 : 0)));
                 }
             }
             break;

File dbaccess/source/core/api/KeySet.hxx

View file
  • Ignore whitespace
 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>					m_xRow;
 		::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >	m_xComposer;
 		::rtl::OUString																	m_sUpdateTableName;
-		::rtl::OUString																	m_aSelectComposedTableName;
         ::std::vector< ::rtl::OUString >						m_aFilterColumns;
 		
 		sal_Bool m_bRowCountFinal;

File dbaccess/source/core/dataaccess/documentdefinition.cxx

View file
  • Ignore whitespace
 				Reference<XNameContainer> xNC(pDocuSave->getContent(),UNO_QUERY);
 				if ( xNC.is() )
 				{
-                    if ( m_pImpl->m_aProps.aTitle == pDocuSave->getName() )
-                    {
-                        Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
-		                if ( xPersist.is() )
-		                {
-			                xPersist->storeOwn();
-			                notifyDataSourceModified();
-		                }
-                    }
-                    else
+                    if ( m_pImpl->m_aProps.aTitle != pDocuSave->getName() )
                     {
                         try
                         {
                             DBG_UNHANDLED_EXCEPTION();
 		                }
                     }
+                    Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
+	                if ( xPersist.is() )
+	                {
+		                xPersist->storeOwn();
+		                notifyDataSourceModified();
+	                }
 				}
 			}
 		}

File dbaccess/source/core/inc/DatabaseDataProvider.hxx

View file
  • Ignore whitespace
 #include "com/sun/star/lang/XServiceInfo.hpp"
 #include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp"
 #include "com/sun/star/chart2/XInternalDataProvider.hpp"
+#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
 #include <com/sun/star/sdbc/XRowSet.hpp>
 #include <com/sun/star/sdbc/XParameters.hpp>
 #include <com/sun/star/container/XChild.hpp>
 
-#include "cppuhelper/compbase3.hxx"
+#include "cppuhelper/compbase4.hxx"
 #include "cppuhelper/basemutex.hxx"
 #include "cppuhelper/propertysetmixin.hxx"
 #include <cppuhelper/implementationentry.hxx>
 {
 
 class DatabaseDataSource;
-typedef ::cppu::WeakComponentImplHelper3<   ::com::sun::star::chart2::data::XDatabaseDataProvider
+typedef ::cppu::WeakComponentImplHelper4<   ::com::sun::star::chart2::data::XDatabaseDataProvider
                                           , ::com::sun::star::container::XChild
+                                          , ::com::sun::star::chart::XComplexDescriptionAccess
                                           , ::com::sun::star::lang::XServiceInfo > TDatabaseDataProvider;
 
 class DatabaseDataProvider: private ::cppu::BaseMutex,
     // conatiner::XChild
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+    // ____ XComplexDescriptionAccess ____
+    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL        getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setComplexRowDescriptions(        const ::com::sun::star::uno::Sequence<        ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aRowDescriptions )        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL        getComplexColumnDescriptions() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setComplexColumnDescriptions(         const ::com::sun::star::uno::Sequence<        ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aColumnDescriptions )        throw (::com::sun::star::uno::RuntimeException);
+
+    // ____ XChartDataArray (base of XComplexDescriptionAccess) ____
+    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData()        throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setData(        const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData )        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions()        throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setRowDescriptions(        const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions )        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions()        throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setColumnDescriptions(        const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions )        throw (::com::sun::star::uno::RuntimeException);
+
+    // ____ XChartData (base of XChartDataArray) ____
+    virtual void SAL_CALL addChartDataChangeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL removeChartDataChangeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )throw (::com::sun::star::uno::RuntimeException);
+    virtual double SAL_CALL getNotANumber()throw (::com::sun::star::uno::RuntimeException);
+    virtual ::sal_Bool SAL_CALL isNotANumber(double nNumber )throw (::com::sun::star::uno::RuntimeException);
 private:
     DatabaseDataProvider(DatabaseDataProvider &); // not defined
     void operator =(DatabaseDataProvider &); // not defined
     ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >                 m_xActiveConnection;
     ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >                     m_xRowSet;
     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider >     m_xInternal;
+    ::com::sun::star::uno::Reference< ::com::sun::star::chart::XComplexDescriptionAccess >  m_xComplexDescriptionAccess;
     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeXMLConversion>  m_xRangeConversion;
     ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler>          m_xHandler;
     // the object doin' most of the work - an SDB-rowset

File dbaccess/source/core/misc/DatabaseDataProvider.cxx

View file
  • Ignore whitespace
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
+#include <com/sun/star/sdbc/XColumnLocate.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
 #include <com/sun/star/chart/XChartDataArray.hpp>
 {
     m_xInternal.set( m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart.InternalDataProvider")),m_xContext ), uno::UNO_QUERY );
     m_xRangeConversion.set(m_xInternal,uno::UNO_QUERY);
+    m_xComplexDescriptionAccess.set(m_xInternal,uno::UNO_QUERY);
 
     osl_incrementInterlockedCount( &m_refCount );
     {
     }
     return xData;
 }
+
+uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL DatabaseDataProvider::getComplexRowDescriptions() throw (uno::RuntimeException)
+{
+    return m_xComplexDescriptionAccess->getComplexRowDescriptions();
+}
+void SAL_CALL DatabaseDataProvider::setComplexRowDescriptions( const uno::Sequence< uno::Sequence< ::rtl::OUString > >& aRowDescriptions ) throw (uno::RuntimeException)
+{
+    m_xComplexDescriptionAccess->setComplexRowDescriptions(aRowDescriptions);
+}
+uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL DatabaseDataProvider::getComplexColumnDescriptions() throw (uno::RuntimeException)
+{
+    return m_xComplexDescriptionAccess->getComplexColumnDescriptions();
+}
+void SAL_CALL DatabaseDataProvider::setComplexColumnDescriptions( const uno::Sequence< uno::Sequence< rtl::OUString > >& aColumnDescriptions ) throw (uno::RuntimeException)
+{
+    m_xComplexDescriptionAccess->setComplexColumnDescriptions(aColumnDescriptions);
+}
+// ____ XChartDataArray ____
+uno::Sequence< uno::Sequence< double > > SAL_CALL DatabaseDataProvider::getData()    throw (uno::RuntimeException)
+{
+    return m_xComplexDescriptionAccess->getData();
+}
+
+void SAL_CALL DatabaseDataProvider::setData( const uno::Sequence< uno::Sequence< double > >& rDataInRows )    throw (uno::RuntimeException)
+{
+    m_xComplexDescriptionAccess->setData(rDataInRows);
+}
+
+void SAL_CALL DatabaseDataProvider::setRowDescriptions( const uno::Sequence< rtl::OUString >& aRowDescriptions )    throw (uno::RuntimeException)
+{
+    m_xComplexDescriptionAccess->setRowDescriptions(aRowDescriptions);
+}
+
+void SAL_CALL DatabaseDataProvider::setColumnDescriptions( const uno::Sequence< rtl::OUString >& aColumnDescriptions )    throw (uno::RuntimeException)
+{
+    m_xComplexDescriptionAccess->setColumnDescriptions(aColumnDescriptions);
+}
+
+uno::Sequence< rtl::OUString > SAL_CALL DatabaseDataProvider::getRowDescriptions()    throw (uno::RuntimeException)
+{    
+    return m_xComplexDescriptionAccess->getRowDescriptions();
+}
+
+uno::Sequence< rtl::OUString > SAL_CALL DatabaseDataProvider::getColumnDescriptions()    throw (uno::RuntimeException)
+{    
+    return m_xComplexDescriptionAccess->getColumnDescriptions();
+}
+
+// ____ XChartData (base of XChartDataArray) ____
+void SAL_CALL DatabaseDataProvider::addChartDataChangeEventListener(const uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& x)    throw (uno::RuntimeException)
+{
+    m_xComplexDescriptionAccess->addChartDataChangeEventListener(x);
+}
+
+void SAL_CALL DatabaseDataProvider::removeChartDataChangeEventListener(const uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& x)    throw (uno::RuntimeException)
+{
+    m_xComplexDescriptionAccess->removeChartDataChangeEventListener(x);
+}
+
+double SAL_CALL DatabaseDataProvider::getNotANumber()    throw (uno::RuntimeException)
+{
+    return m_xComplexDescriptionAccess->getNotANumber();
+}
+
+::sal_Bool SAL_CALL DatabaseDataProvider::isNotANumber( double nNumber )    throw (uno::RuntimeException)
+{
+    return m_xComplexDescriptionAccess->isNotANumber(nNumber);
+}
+
 // -----------------------------------------------------------------------------
 
 uno::Reference< sheet::XRangeSelection > SAL_CALL DatabaseDataProvider::getRangeSelection() throw (uno::RuntimeException)
     uno::Reference< sdbc::XResultSet> xRes(m_xRowSet,uno::UNO_QUERY_THROW);
     uno::Reference< sdbc::XRow> xRow(m_xRowSet,uno::UNO_QUERY_THROW);
     uno::Reference< sdbc::XResultSetMetaData> xResultSetMetaData = uno::Reference< sdbc::XResultSetMetaDataSupplier>(m_xRowSet,uno::UNO_QUERY)->getMetaData();
+    uno::Reference< sdbc::XColumnLocate> xColumnLocate(m_xRowSet,uno::UNO_QUERY_THROW);
 
     ::std::vector<sal_Int32> aColumnTypes;
     uno::Sequence< uno::Any > aLabelArgs(1);
     const sal_Int32 nCount = aColumns.getLength();
     if ( nCount )
         aColumnTypes.push_back(xResultSetMetaData->getColumnType(1));
-    for (sal_Int32 i = 1; i < nCount; ++i)
-    {
-        aColumnTypes.push_back(xResultSetMetaData->getColumnType(i+1));
-    } // for (sal_Int32 i = 1; i < nCount; ++i)
 
+    ::std::vector< sal_Int32 > aColumnPositions;
     const ::rtl::OUString* pIter = aColumns.getConstArray();
     const ::rtl::OUString* pEnd = pIter + aColumns.getLength();
     for(sal_Int32 k = 0;pIter != pEnd;++pIter,++k)
     {
+        aColumnPositions.push_back(xColumnLocate->findColumn(*pIter));
         uno::Reference< beans::XPropertySet> xColumn(xColumns->getByName(*pIter),uno::UNO_QUERY);
+        sal_Int32 nType = sdbc::DataType::VARCHAR;
         if ( xColumn.is() )
         {
             m_aNumberFormats.insert( ::std::map< ::rtl::OUString,uno::Any>::value_type(::rtl::OUString::valueOf(k),xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT)));
+            xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType;
         }
+        aColumnTypes.push_back(nType);
     }
 
     ::std::vector< ::rtl::OUString > aRowLabels;
         aValue.fill(1,aColumnTypes[0],xRow);
         aRowLabels.push_back(aValue.getString());
         ::std::vector< double > aRow;
-        for (sal_Int32 j = _bHasCategories ? 2 : 1,i = 0; j <= nCount; ++j,++i)
+        ::std::vector< sal_Int32 >::iterator aColumnPosIter = aColumnPositions.begin();
+        ::std::vector< sal_Int32 >::iterator aColumnPosEnd = aColumnPositions.end();
+        sal_Int32 i = 0;
+        if ( _bHasCategories )
         {
-            aValue.fill(j,aColumnTypes[j-1],xRow);
+            ++aColumnPosIter;
+            ++i;
+        }
+        for (; aColumnPosIter != aColumnPosEnd; ++aColumnPosIter,++i)
+        {
+            aValue.fill(*aColumnPosIter,aColumnTypes[i],xRow);
             if ( aValue.isNull() )
             {
                 double nValue;
             }
             else
                 aRow.push_back(aValue.getDouble());
-        } // for (sal_Int32 j = 2,i = 0; j <= nCount; ++j,++i)
+        }
         aDataValues.push_back(aRow);
     } // while( xRes->next() && (!m_RowLimit || nRowCount < m_RowLimit) )
 

File dbaccess/source/ext/macromigration/macromigration.src

  • Ignore whitespace
File contents unchanged.

File offapi/com/sun/star/awt/UnoControlComboBoxModel.idl

View file
  • Ignore whitespace
 #include <com/sun/star/util/Color.idl>
 #endif
  
+#include <com/sun/star/awt/XItemList.idl>
  
 //============================================================================= 
  
         this is possible.</p>
     */
     [optional, property] short MouseWheelBehavior;
+
+    /** allows mmanipulating the list of items in the combo box more fine-grained than the
+        <member>StringItemList</member> property.
+    */
+    [optional] interface XItemList;
 }; 
  
 //============================================================================= 

File offapi/com/sun/star/awt/UnoControlListBoxModel.idl

View file
  • Ignore whitespace
 
     /** allows mmanipulating the list of items in the list box more fine-grained than the
         <member>StringItemList</member> property.
+
+        @since OOo 3.3
     */
     [optional] interface XItemList;
+
+    /** specifies where an item separator - a horizontal line - is drawn.
+
+        <p>If this is not <NULL/>, then a horizontal line will be drawn between the item at the given position,
+        and the following item.</p>
+
+        @since OOo 3.3
+    */
+    [optional, property, maybevoid] short ItemSeparatorPos;
 }; 
  
 //============================================================================= 

File reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx

View file
  • Ignore whitespace
 #include "xmlExportDocumentHandler.hxx"
 #include <com/sun/star/sdb/CommandType.hpp>
 #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
+#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
 #include <com/sun/star/reflection/XProxyFactory.hpp>
 #include <com/sun/star/sdb/CommandType.hpp>
 #include <comphelper/sequence.hxx>
 
 	// set ourself as delegator
 	m_xProxy->setDelegator( *this );
-
     const ::rtl::OUString sCommand = m_xDatabaseDataProvider->getCommand();
     if ( sCommand.getLength() )
         m_aColumns = ::dbtools::getFieldNamesByCommandDescriptor(m_xDatabaseDataProvider->getActiveConnection()
                     ,m_xDatabaseDataProvider->getCommandType()
                     ,sCommand);
+
+    uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xDatabaseDataProvider,uno::UNO_QUERY);
+    if ( xDataProvider.is() )
+    {
+        m_aColumns.realloc(1);
+        uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions();
+        for(sal_Int32 i = 0 ; i < aColumnNames.getLength();++i)
+        {
+            if ( aColumnNames[i].getLength() )
+            {
+                sal_Int32 nCount = m_aColumns.getLength();
+                m_aColumns.realloc(nCount+1);
+                m_aColumns[nCount] = aColumnNames[i][0];
+            }
+        }
+    }
 }
 // --------------------------------------------------------------------------------
 uno::Any SAL_CALL ExportDocumentHandler::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)

File sfx2/source/dialog/taskpane.cxx

View file
  • Ignore whitespace
             return;
 
         ::rtl::OUString sFirstVisiblePanelResource;
+        ::rtl::OUString sFirstPanelResource;
 
         const Sequence< ::rtl::OUString > aUIElements( aWindowStateConfig.getNodeNames() );
         for (   const ::rtl::OUString* resource = aUIElements.getConstArray();
             if ( !impl_isToolPanelResource( *resource ) )
                 continue;
 
+            sFirstPanelResource = *resource;
+
             ::utl::OConfigurationNode aResourceNode( aWindowStateConfig.openNode( *resource ) );
             ::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) );
 
                 sFirstVisiblePanelResource = *resource;
         }
 
+        if ( sFirstVisiblePanelResource.getLength() == 0 )
+            sFirstVisiblePanelResource = sFirstPanelResource;
+
         if ( sFirstVisiblePanelResource.getLength() )
         {
             ::boost::optional< size_t > aPanelPos( GetPanelPos( sFirstVisiblePanelResource ) );

File sfx2/source/doc/objserv.cxx

View file
  • Ignore whitespace
 void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
 {
     // Check if it is stored in OASIS format...
-    if ( GetMedium() && GetMedium()->GetFilter()
-      && ( !GetMedium()->GetFilter()->IsOwnFormat() || !GetMedium()->HasStorage_Impl() ) )
+    if  (   GetMedium()
+        &&  GetMedium()->GetFilter()
+        &&  GetMedium()->GetName().Len()
+        &&  (   !GetMedium()->GetFilter()->IsOwnFormat()
+            ||  !GetMedium()->HasStorage_Impl()
+            )
+        )
     {
         // Only OASIS and OOo6.x formats will be handled further
         InfoBox( NULL, SfxResId( RID_XMLSEC_INFO_WRONGDOCFORMAT ) ).Execute();

File svtools/inc/svtools/svtreebx.hxx

View file
  • Ignore whitespace
 	virtual void	CursorMoved( SvLBoxEntry* pNewCursor );
 	virtual void	PreparePaint( SvLBoxEntry* );
 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
+    virtual void    StateChanged( StateChangedType nStateChange );
 
 	void 			InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground);
 	BOOL			IsCellFocusEnabled() const;

File svtools/source/contnr/svtreebx.cxx

View file
  • Ignore whitespace
 		Control::DataChanged( rDCEvt );
 }
 
+void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
+{
+    SvLBox::StateChanged( i_nStateChange );
+}
+
 void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
 {
 	const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();

File svtools/source/graphic/provider.cxx

View file
  • Ignore whitespace
     if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:standardimage" ) ) )
     {
 		rtl::OUString sImageName( rResourceURL.copy( nIndex ) );
-        if ( sImageName.compareToAscii( "info" ) )
+        if ( sImageName.equalsAscii( "info" ) )
 		{
 			xRet = InfoBox::GetStandardImage().GetXGraphic();
 		}
-		else if ( sImageName.compareToAscii( "warning" ) )
+		else if ( sImageName.equalsAscii( "warning" ) )
 		{
 			xRet = WarningBox::GetStandardImage().GetXGraphic();
 		}
-		else if ( sImageName.compareToAscii( "error" ) )
+		else if ( sImageName.equalsAscii( "error" ) )
 		{
 			xRet = ErrorBox::GetStandardImage().GetXGraphic();
 		}
-		else if ( sImageName.compareToAscii( "query" ) )
+		else if ( sImageName.equalsAscii( "query" ) )
 		{
 			xRet = QueryBox::GetStandardImage().GetXGraphic();
 		}

File svtools/source/uno/treecontrolpeer.cxx

View file
  • Ignore whitespace
 
 	switch( GetPropertyId( PropertyName ) )
 	{
+        case BASEPROPERTY_HIDEINACTIVESELECTION:
+        {
+            sal_Bool bEnabled = sal_False;
+            if ( aValue >>= bEnabled )
+            {
+                WinBits nStyle = rTree.GetWindowBits();
+                if ( bEnabled )
+                    nStyle |= WB_HIDESELECTION;
+                else
+                    nStyle &= ~WB_HIDESELECTION;
+                rTree.SetWindowBits( nStyle );
+            }
+        }
+        break;
+
 		case BASEPROPERTY_TREE_SELECTIONTYPE:
 		{
 			SelectionType eSelectionType;
 		UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow();
 		switch(nPropId)
 		{
+        case BASEPROPERTY_HIDEINACTIVESELECTION:
+			return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
+
 		case BASEPROPERTY_TREE_SELECTIONTYPE:
 		{
 			SelectionType eSelectionType;

File sw/source/ui/lingu/olmenu.cxx

View file
  • Ignore whitespace
     else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END)
     {
             OUString aWord( xSpellAlt->getWord() );
-            DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" );
+            //DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" );
             
             PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC);
             String aDicName ( pMenu->GetItemText(nId) );

File testautomation/dbaccess/optional/includes/frm_FormFilter.inc

View file
  • Ignore whitespace
 	Kontext "DocumentWriter"
     '/// press CTRL + F5 to get into the first textbox
     printlog "press CTRL + F5 to get into the first textbox"
-	DocumentWriter.TypeKeys "<MOD1 F5>" , true
+	DocumentWriter.TypeKeys "<MOD1 F6>" , true
+        wait(1000)
+        DocumentWriter.TypeKeys "<MOD1 F5>" , true
 	'sleep(1)
 	'DocumentWriter.TypeKeys "<MOD1 C>" , true
 	'sleep(1)
 	wait(1000)
     '/// insert 2 in the first textbox
     printlog "insert 2 in the first textbox"
+        DocumentWriter.TypeKeys "<MOD1 F6>" , true
+        wait(1000)
         DocumentWriter.TypeKeys "<MOD1 F5>" , true
         sleep(1)
 	DocumentWriter.TypeKeys "2" , true
 	FM_FF_Execute
 	wait(1000)
     printlog "workaround issue 102010"
-	DocumentWriter.TypeKeys "<MOD1 F6>" , true
+    DocumentWriter.TypeKeys "<MOD1 F6>" , true
     sleep(1)
     DocumentWriter.TypeKeys "<MOD1 F5>" , true   
     sleep(1)
 	wait(1000)
     '/// insert into the second textbox like '%2'
     printlog "insert into the second textbox like '%2'"
+        DocumentWriter.TypeKeys "<MOD1 F6>" , true
+        wait(1000)
         DocumentWriter.TypeKeys "<MOD1 F5>" , true
 	sleep(1)
         DocumentWriter.TypeKeys "<TAB>" , true

File testautomation/dbaccess/optional/includes/frm_Forms.inc

View file
  • Ignore whitespace
    	'/// insert a textfield
     printlog "insert a textfield"        
     Edit.Click
-   	call hDrawingWithSelection ( 50, 20, 60, 30 )
+   	call hDrawingWithSelection ( 50, 30, 60, 40 )
    	sleep(1)
     
     Kontext "FormControls"
    	'/// insert a textfield
     printlog "insert a textfield"        
     Edit.Click
-   	call hDrawingWithSelection ( 50, 20, 60, 30 )
+   	call hDrawingWithSelection ( 50, 30, 60, 40 )
    	sleep(1)
     
     Kontext "FormControls"
        '/// insert a textfield
        printlog "insert a textfield"
        'Edit.Click
-   	 call hDrawingWithSelection ( 50, 40, 60, 50 )
+   	 call hDrawingWithSelection ( 50, 50, 60, 60 )
    	 sleep(1)
     
     Kontext "FormControls"
     '/// set cursor into the first control
     printlog "set cursor into the first control"   
     Kontext "DocumentWriter"
+        DocumentWriter.TypeKeys "<MOD1 F6>" , true
+        wait(1000)
         DocumentWriter.TypeKeys "<MOD1 F5>" , true
         sleep(1)
            
         '/// insert a textfield
         printlog "insert a textfield"        
         Edit.Click
-        call hDrawingWithSelection ( 50, 20, 60, 30 )
+        call hDrawingWithSelection ( 50, 30, 60, 40 )
         sleep(1)
     
     Kontext "FormControls"

File testautomation/dbaccess/optional/includes/xf_Submission.inc

View file
  • Ignore whitespace
 '-------------------------------------------------------------------------
 testcase tDataNavigatorSubmission    
     
+    Dim sSubmitPath as string
+
     '/// open new XML Form
     printlog "open new XML Form"
     
     '/// add a submission
     Kontext "XFormAddSubmission"
         SubmitName.setText("submission1")
-        if ( gPlatgroup = "w95" ) then
-            SubmitAction.setText("file:///" + ConvertPath(gOfficePath,"lin") + "user/work/test.xml")
-        else
-            SubmitAction.setText("file://" + gOfficePath + "user/work/test.xml")
-        endif
+        sSubmitPath = "file:///" + gOfficePath + "user/work/test.xml"
+        SubmitAction.setText( hStringReplaceChar( sSubmitPath, "\", "/" ) )
         SubmitMethod.select 2            
             
     '/// close the add submission dialog

File testautomation/framework/optional/includes/security_certification_dialogs.inc

View file
  • Ignore whitespace
     kontext "DigitalSignature"
     if ( DigitalSignature.exists( 2 ) ) then
         printlog( CFN & "Digital signatures is open" )
-        DigitalSignature.cancel()
+        DigitalSignature.close()
     else
         if ( gApplication <> "MASTERDOCUMENT" ) then
             warnlog( CFN & "Digital Signatures Dialog is not open" )

File toolkit/inc/toolkit/awt/vclxwindows.hxx

View file
  • Ignore whitespace
 //	----------------------------------------------------
 //	class VCLXComboBox
 //	----------------------------------------------------
-class VCLXComboBox :	public ::com::sun::star::awt::XComboBox,
-						public VCLXEdit
+typedef ::cppu::ImplInheritanceHelper2  <   VCLXEdit
+                                        ,   ::com::sun::star::awt::XComboBox
+                                        ,   ::com::sun::star::awt::XItemListListener > VCLXComboBox_Base;
+class VCLXComboBox :	public VCLXComboBox_Base
 {
 private:
 	ActionListenerMultiplexer	maActionListeners;
 						VCLXComboBox();
     ~VCLXComboBox();
 
-	// ::com::sun::star::uno::XInterface
-    ::com::sun::star::uno::Any					SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
-	void										SAL_CALL acquire() throw()	{ OWeakObject::acquire(); }
-	void										SAL_CALL release() throw()	{ OWeakObject::release(); }
-
-    // ::com::sun::star::lang::XTypeProvider
-	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
-	::com::sun::star::uno::Sequence< sal_Int8 >						SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
  	// ::com::sun::star::lang::XComponent
     void SAL_CALL dispose(  ) throw(::com::sun::star::uno::RuntimeException);
 
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
 
+    // XItemListListener
+    virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+    // XEventListener
+    virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
     static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
     virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };

File toolkit/inc/toolkit/controls/unocontrols.hxx

View file
  • Ignore whitespace
                                             >   UnoControlListBoxModel_Base;
 class TOOLKIT_DLLPUBLIC UnoControlListBoxModel    :public UnoControlListBoxModel_Base
 {
+protected:
+    UnoControlListBoxModel(bool asComboBox);
 public:
 						UnoControlListBoxModel();
 						UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource );
     ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
 
     // ::com::sun::star::lang::XServiceInfo
-	DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel )
+	//DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel )
+    ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
 
     // ::com::sun::star::awt::XItemList
     virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException);
     void    impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const;
     void    impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems );
 
-private:
+protected:
     ::boost::scoped_ptr< UnoControlListBoxModel_Data >  m_pData;
     ::cppu::OInterfaceContainerHelper                   m_aItemListListeners;
 };
     virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
 
 	// ::com::sun::star::lang::XServiceInfo
-	DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox )
+	// DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox )
+    ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
 
 protected:
     void                ImplUpdateSelectedItemsProperty();
 //	----------------------------------------------------
 //	class UnoControlComboBoxModel
 //	----------------------------------------------------
-class UnoControlComboBoxModel :	public UnoControlModel
+class UnoControlComboBoxModel :	public UnoControlListBoxModel
 {
 protected:
 	::com::sun::star::uno::Any 		ImplGetDefaultValue( sal_uInt16 nPropId ) const;
-	::cppu::IPropertyArrayHelper&	SAL_CALL getInfoHelper();
+    ::cppu::IPropertyArrayHelper&	SAL_CALL getInfoHelper();
 
 public:
 						UnoControlComboBoxModel();
-						UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlModel( rModel ) {;}
+						UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;}
 
 	UnoControlModel*	Clone() const { return new UnoControlComboBoxModel( *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::beans::XMultiPropertySet
     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
+    // OPropertySetHelper
+	void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
 
 	// ::com::sun::star::lang::XServiceInfo
-	DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel )
+    ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+	// DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel )
 
 };
 
 //	----------------------------------------------------
 //	class UnoComboBoxControl
 //	----------------------------------------------------
-class UnoComboBoxControl :	public UnoEditControl,
-							public ::com::sun::star::awt::XComboBox
+class UnoComboBoxControl :	public UnoEditControl
+                        ,   public ::com::sun::star::awt::XComboBox
+		                ,   public ::com::sun::star::awt::XItemListener
+                        ,   public ::com::sun::star::awt::XItemListListener
 {
 private:
 	ActionListenerMultiplexer 	maActionListeners;
 				UnoComboBoxControl();
 	::rtl::OUString		GetComponentServiceName();
 
-	::com::sun::star::uno::Any	SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); }
+    void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoEditControl::disposing( Source ); }
+    void SAL_CALL dispose(  ) throw(::com::sun::star::uno::RuntimeException);
+
+    ::com::sun::star::uno::Any	SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); }
     ::com::sun::star::uno::Any	SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
 	void						SAL_CALL acquire() throw()	{ OWeakAggObject::acquire(); }
 	void						SAL_CALL release() throw()	{ OWeakAggObject::release(); }
-    void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
-    void SAL_CALL dispose(  ) throw(::com::sun::star::uno::RuntimeException);
+    
 
     // ::com::sun::star::lang::XTypeProvider
 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
     sal_Int16 SAL_CALL getDropDownLineCount(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException);
 
+    // XUnoControl
+    virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException );
+
+    // XItemListListener
+    virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+    // XItemListener
+    virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
 	// ::com::sun::star::lang::XServiceInfo
-	DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox )
+    ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+	//DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox )
+protected:
+    virtual void        ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
+	virtual void        updateFromModel();
+    ActionListenerMultiplexer& 	getActionListeners();
+	ItemListenerMultiplexer& 	getItemListeners();
 
 };
 

File toolkit/source/awt/vclxwindows.cxx

View file
  • Ignore whitespace
 #endif
 }
 
-// ::com::sun::star::uno::XInterface
-::com::sun::star::uno::Any VCLXComboBox::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
-{
-	::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
-										SAL_STATIC_CAST( ::com::sun::star::awt::XComboBox*, this ) );
-	return (aRet.hasValue() ? aRet : VCLXEdit::queryInterface( rType ));
-}
-
-// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( VCLXComboBox )
-	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XComboBox>* ) NULL ),
-	VCLXEdit::getTypes()
-IMPL_XTYPEPROVIDER_END
-
 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXComboBox::CreateAccessibleContext()
 {
 	::vos::OGuard aGuard( GetMutex() );
 		for ( sal_uInt16 n = 0; n < aItems.getLength(); n++ )
 		{
 			pBox->InsertEntry( aItems.getConstArray()[n], nP );
-			if ( (sal_uInt16)nPos < 0xFFFF )	// Nicht wenn 0xFFFF, weil LIST_APPEND
-				nP++;
+			if ( nP == 0xFFFF )
+            {
+                OSL_ENSURE( false, "VCLXComboBox::addItems: too many entries!" );
+                // skip remaining entries, list cannot hold them, anyway
+                break;
+            }
 		}
 	}
 }
 			break;
 			case BASEPROPERTY_STRINGITEMLIST:
 			{
-				::com::sun::star::uno::Sequence< ::rtl::OUString> aItems;
+                ::com::sun::star::uno::Sequence< ::rtl::OUString> aItems;
 				if ( Value >>= aItems )
 				{
-					sal_Bool bUpdate = pComboBox->IsUpdateMode();
-					pComboBox->SetUpdateMode( sal_False );
 					pComboBox->Clear();
-					const ::rtl::OUString* pStrings = aItems.getConstArray();
-					sal_Int32 nItems = aItems.getLength();
-					for ( sal_Int32 n = 0; n < nItems; n++ )
-						pComboBox->InsertEntry( pStrings[n], LISTBOX_APPEND );
-					pComboBox->SetUpdateMode( bUpdate );
+					addItems( aItems, 0 );
 				}
 			}
 			break;
 		nLines = nL;
 	}
 }
+void SAL_CALL VCLXComboBox::listItemInserted( const ItemListEvent& i_rEvent ) throw (RuntimeException)
+{
+	::vos::OGuard aGuard( GetMutex() );
+
+    ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() );
+
+    ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemInserted: no ComboBox?!" );
+    ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition <= sal_Int32( pComboBox->GetEntryCount() ) ),
+        "VCLXComboBox::listItemInserted: illegal (inconsistent) item position!" );
+    pComboBox->InsertEntry(
+        i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString(),
+        i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(),
+        i_rEvent.ItemPosition );
+}
+
+void SAL_CALL VCLXComboBox::listItemRemoved( const ItemListEvent& i_rEvent ) throw (RuntimeException)
+{
+	::vos::OGuard aGuard( GetMutex() );
+
+    ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() );
+
+    ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemRemoved: no ComboBox?!" );
+    ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pComboBox->GetEntryCount() ) ),
+        "VCLXComboBox::listItemRemoved: illegal (inconsistent) item position!" );
+
+    pComboBox->RemoveEntry( i_rEvent.ItemPosition );
+}
+
+void SAL_CALL VCLXComboBox::listItemModified( const ItemListEvent& i_rEvent ) throw (RuntimeException)
+{
+	::vos::OGuard aGuard( GetMutex() );
+
+    ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() );
+
+    ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" );
+    ENSURE_OR_RETURN_VOID( ( i_rEvent.ItemPosition >= 0 ) && ( i_rEvent.ItemPosition < sal_Int32( pComboBox->GetEntryCount() ) ),
+        "VCLXComboBox::listItemModified: illegal (inconsistent) item position!" );
+
+    // VCL's ComboBox does not support changing an entry's text or image, so remove and re-insert
+
+    const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString( pComboBox->GetEntry( i_rEvent.ItemPosition ) );
+    const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pComboBox->GetEntryImage( i_rEvent.ItemPosition  ) );
+
+    pComboBox->RemoveEntry( i_rEvent.ItemPosition );
+    pComboBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition );
+}
+
+void SAL_CALL VCLXComboBox::allItemsRemoved( const EventObject& i_rEvent ) throw (RuntimeException)
+{
+	::vos::OGuard aGuard( GetMutex() );
+
+    ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() );
+    ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" );
+
+    pComboBox->Clear();
+
+    (void)i_rEvent;
+}
+
+void SAL_CALL VCLXComboBox::itemListChanged( const EventObject& i_rEvent ) throw (RuntimeException)
+{
+	::vos::OGuard aGuard( GetMutex() );
+
+    ComboBox* pComboBox = dynamic_cast< ComboBox* >( GetWindow() );
+    ENSURE_OR_RETURN_VOID( pComboBox, "VCLXComboBox::listItemModified: no ComboBox?!" );
+
+    pComboBox->Clear();
+
+    uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW );
+    uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW );
+    // bool localize = xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) );
+    uno::Reference< resource::XStringResourceResolver > xStringResourceResolver;
+    if ( xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ) )
+    {
+        xStringResourceResolver.set(
+            xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ),
+            uno::UNO_QUERY
+        );
+    }
+    
+
+    Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
+    uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems();
+    for ( sal_Int32 i=0; i<aItems.getLength(); ++i )
+    {
+        ::rtl::OUString aLocalizationKey( aItems[i].First );
+        if ( xStringResourceResolver.is() && aLocalizationKey.getLength() != 0 && aLocalizationKey[0] == '&' )
+        {
+            aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 ));
+        }
+        pComboBox->InsertEntry( aLocalizationKey, lcl_getImageFromURL( aItems[i].Second ) );
+    }
+}
+void SAL_CALL VCLXComboBox::disposing( const EventObject& i_rEvent ) throw (RuntimeException)
+{
+    // just disambiguate
+    VCLXEdit::disposing( i_rEvent );
+}
 
 //	----------------------------------------------------
 //	class VCLXFormattedSpinField

File toolkit/source/controls/tree/treecontrol.cxx

View file
  • Ignore whitespace
 	ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSROOTHANDLES );
     ImplRegisterProperty( BASEPROPERTY_TREE_ROWHEIGHT );
     ImplRegisterProperty( BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING );
+    ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
 }
 
 UnoTreeModel::UnoTreeModel( const UnoTreeModel& rModel )

File toolkit/source/controls/unocontrols.cxx

View file
  • Ignore whitespace
 using ::com::sun::star::uno::Reference;
 using namespace ::toolkit;
 
+#define IMPL_SERVICEINFO_DERIVED( ImplName, BaseClass, ServiceName ) \
+    ::rtl::OUString SAL_CALL ImplName::getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException) { return ::rtl::OUString::createFromAscii( "stardiv.Toolkit." #ImplName ); } \
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL ImplName::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)	\
+							{ \
+								::com::sun::star::uno::Sequence< ::rtl::OUString > aNames = BaseClass::getSupportedServiceNames( ); \
+								aNames.realloc( aNames.getLength() + 1 ); \
+								aNames[ aNames.getLength() - 1 ] = ::rtl::OUString::createFromAscii( ServiceName ); \
+								return aNames; \
+							} \
+
+
+
 //	----------------------------------------------------
 //	class UnoControlEditModel
 //	----------------------------------------------------
 {
     UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox );
 }
+// ---------------------------------------------------------------------------------------------------------------------
+UnoControlListBoxModel::UnoControlListBoxModel(bool)
+    :UnoControlListBoxModel_Base()
+    ,m_pData( new UnoControlListBoxModel_Data( *this ) )
+    ,m_aItemListListeners( GetMutex() )
+{
+}
 
 // ---------------------------------------------------------------------------------------------------------------------
 UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource )
 UnoControlListBoxModel::~UnoControlListBoxModel()
 {
 }
+IMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel )
 // ---------------------------------------------------------------------------------------------------------------------
 ::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
 {
 	return ::rtl::OUString::createFromAscii( szServiceName_UnoControlListBoxModel );
 }
-
 // ---------------------------------------------------------------------------------------------------------------------
 uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
 {
 {
 	return ::rtl::OUString::createFromAscii( "listbox" );
 }
+IMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox )
 
 void UnoListBoxControl::dispose() throw(uno::RuntimeException)
 {
 //	----------------------------------------------------
 //	class UnoControlComboBoxModel
 //	----------------------------------------------------
-UnoControlComboBoxModel::UnoControlComboBoxModel()
+UnoControlComboBoxModel::UnoControlComboBoxModel() : UnoControlListBoxModel(true)
 {
     UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox );
 }
 
+IMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel )
+
+uno::Reference< beans::XPropertySetInfo > UnoControlComboBoxModel::getPropertySetInfo(  ) throw(uno::RuntimeException)
+{
+	static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+	return xInfo;
+}
+// ---------------------------------------------------------------------------------------------------------------------
+::cppu::IPropertyArrayHelper& UnoControlComboBoxModel::getInfoHelper()
+{
+	static UnoPropertyArrayHelper* pHelper = NULL;
+	if ( !pHelper )
+	{
+		uno::Sequence<sal_Int32>	aIDs = ImplGetPropertyIds();
+		pHelper = new UnoPropertyArrayHelper( aIDs );
+	}
+	return *pHelper;
+}
+
+
 ::rtl::OUString UnoControlComboBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
 {
 	return ::rtl::OUString::createFromAscii( szServiceName_UnoControlComboBoxModel );
 }
+void SAL_CALL UnoControlComboBoxModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue ) throw (uno::Exception)
+{
+    UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
+
+    if ( nHandle == BASEPROPERTY_STRINGITEMLIST && !m_pData->m_bSettingLegacyProperty)
+	{
+        // synchronize the legacy StringItemList property with our list items
+        Sequence< ::rtl::OUString > aStringItemList;
+        Any aPropValue;
+        getFastPropertyValue( aPropValue, BASEPROPERTY_STRINGITEMLIST );
+        OSL_VERIFY( aPropValue >>= aStringItemList );
+
+        ::std::vector< ListItem > aItems( aStringItemList.getLength() );
+        ::std::transform(
+            aStringItemList.getConstArray(),
+            aStringItemList.getConstArray() + aStringItemList.getLength(),
+            aItems.begin(),
+            CreateListItem()
+        );
+        m_pData->setAllItems( aItems );
+
+        // since an XItemListListener does not have a "all items modified" or some such method,
+        // we simulate this by notifying removal of all items, followed by insertion of all new
+        // items
+        lang::EventObject aEvent;
+        aEvent.Source = *this;
+        m_aItemListListeners.notifyEach( &XItemListListener::itemListChanged, aEvent );
+        // TODO: OPropertySetHelper calls into this method with the mutex locked ...
+        // which is wrong for the above notifications ...
+	}
+}
 
 uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
 {
 	return UnoControlModel::ImplGetDefaultValue( nPropId );
 }
 
-
-::cppu::IPropertyArrayHelper& UnoControlComboBoxModel::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 > UnoControlComboBoxModel::getPropertySetInfo(  ) throw(uno::RuntimeException)
-{
-	static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
-	return xInfo;
-}
-
-
-
 //	----------------------------------------------------
 //	class UnoComboBoxControl
 //	----------------------------------------------------
 	maComponentInfos.nWidth = 100;
 	maComponentInfos.nHeight = 12;
 }
+IMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox )
 
 ::rtl::OUString UnoComboBoxControl::GetComponentServiceName()
 {
 	return ::rtl::OUString::createFromAscii( "combobox" );
 }
 
-// uno::XInterface
-uno::Any UnoComboBoxControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException)
-{
-	uno::Any aRet = ::cppu::queryInterface( rType,
-										SAL_STATIC_CAST( awt::XComboBox*, this ) );
-	return (aRet.hasValue() ? aRet : UnoEditControl::queryAggregation( rType ));
-}
-
-// lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( UnoComboBoxControl )
-	getCppuType( ( uno::Reference< awt::XComboBox>* ) NULL ),
-	UnoEditControl::getTypes()
-IMPL_XTYPEPROVIDER_END
-
 void UnoComboBoxControl::dispose() throw(uno::RuntimeException)
 {
 	lang::EventObject aEvt;
 	maItemListeners.disposeAndClear( aEvt );
 	UnoControl::dispose();
 }
-
+uno::Any UnoComboBoxControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException)
+{
+	uno::Any aRet = ::cppu::queryInterface( rType,
+										SAL_STATIC_CAST( awt::XComboBox*, this ) );
+    if ( !aRet.hasValue() )
+    {
+        aRet = ::cppu::queryInterface( rType,
+										SAL_STATIC_CAST( awt::XItemListener*, this ) );
+        if ( !aRet.hasValue() )
+        {
+            aRet = ::cppu::queryInterface( rType,
+										    SAL_STATIC_CAST( awt::XItemListListener*, this ) );
+        }
+    }
+	return (aRet.hasValue() ? aRet : UnoEditControl::queryAggregation( rType ));
+}
+// lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( UnoComboBoxControl )
+	getCppuType( ( uno::Reference< awt::XComboBox>* ) NULL ),
+    getCppuType( ( uno::Reference< awt::XItemListener>* ) NULL ),
+    getCppuType( ( uno::Reference< awt::XItemListListener>* ) NULL ),
+	UnoEditControl::getTypes()
+IMPL_XTYPEPROVIDER_END
+
+void UnoComboBoxControl::updateFromModel()
+{
+    UnoEditControl::updateFromModel();
+
+    Reference< XItemListListener > xItemListListener( getPeer(), UNO_QUERY );
+    ENSURE_OR_RETURN_VOID( xItemListListener.is(), "UnoComboBoxControl::updateFromModel: a peer which is no ItemListListener?!" );
+
+    EventObject aEvent( getModel() );
+    xItemListListener->itemListChanged( aEvent );
+}
+void UnoComboBoxControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal )
+{
+    if ( rPropName == GetPropertyName( BASEPROPERTY_STRINGITEMLIST ) )
+        // do not forward this to our peer. We are a XItemListListener at our model, and changes in the string item
+        // list (which is a legacy property) will, later, arrive as changes in the ItemList. Those latter changes
+        // will be forwarded to the peer, which will update itself accordingly.
+        return;
+
+	UnoEditControl::ImplSetPeerProperty( rPropName, rVal );
+}
 void UnoComboBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer >  & rParentPeer ) throw(uno::RuntimeException)
 {
 	UnoEditControl::createPeer( rxToolkit, rParentPeer );
 	}
 	maItemListeners.removeInterface( l );
 }
+void UnoComboBoxControl::itemStateChanged( const awt::ItemEvent& rEvent ) throw(uno::RuntimeException)
+{
+	if ( maItemListeners.getLength() )
+    {
+        try
+        {
+		    maItemListeners.itemStateChanged( rEvent );
+        }
+        catch( const Exception& e )
+        {
+#if OSL_DEBUG_LEVEL == 0
+            (void) e; // suppress warning
+#else
+            ::rtl::OString sMessage( "UnoComboBoxControl::itemStateChanged: caught an exception:\n" );
+            sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US );
+        	OSL_ENSURE( sal_False, sMessage.getStr() );
+#endif
+        }
+    }
+}
+sal_Bool SAL_CALL UnoComboBoxControl::setModel( const uno::Reference< awt::XControlModel >& i_rModel ) throw ( uno::RuntimeException )
+{
+	::osl::MutexGuard aGuard( GetMutex() );
+
+    const Reference< XItemList > xOldItems( getModel(), UNO_QUERY );
+    OSL_ENSURE( xOldItems.is() || !getModel().is(), "UnoComboBoxControl::setModel: illegal old model!" );
+    const Reference< XItemList > xNewItems( i_rModel, UNO_QUERY );
+    OSL_ENSURE( xNewItems.is() || !i_rModel.is(), "UnoComboBoxControl::setModel: illegal new model!" );
+
+    if ( !UnoEditControl::setModel( i_rModel ) )
+        return sal_False;
+
+    if ( xOldItems.is() )
+        xOldItems->removeItemListListener( this );
+    if ( xNewItems.is() )
+        xNewItems->addItemListListener( this );
+
+    return sal_True;
+}
+
+void SAL_CALL UnoComboBoxControl::listItemInserted( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException)
+{
+    const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
+    OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemInserted: invalid peer!" );
+    if ( xPeerListener.is() )
+        xPeerListener->listItemInserted( i_rEvent );
+}
+
+void SAL_CALL UnoComboBoxControl::listItemRemoved( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException)
+{
+    const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
+    OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemRemoved: invalid peer!" );
+    if ( xPeerListener.is() )
+        xPeerListener->listItemRemoved( i_rEvent );
+}
+
+void SAL_CALL UnoComboBoxControl::listItemModified( const awt::ItemListEvent& i_rEvent ) throw (uno::RuntimeException)
+{
+    const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
+    OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::listItemModified: invalid peer!" );
+    if ( xPeerListener.is() )
+        xPeerListener->listItemModified( i_rEvent );
+}
+
+void SAL_CALL UnoComboBoxControl::allItemsRemoved( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException)
+{
+    const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
+    OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::allItemsRemoved: invalid peer!" );
+    if ( xPeerListener.is() )
+        xPeerListener->allItemsRemoved( i_rEvent );
+}
+
+void SAL_CALL UnoComboBoxControl::itemListChanged( const lang::EventObject& i_rEvent ) throw (uno::RuntimeException)
+{
+    const Reference< XItemListListener > xPeerListener( getPeer(), UNO_QUERY );
+    OSL_ENSURE( xPeerListener.is() || !getPeer().is(), "UnoComboBoxControl::itemListChanged: invalid peer!" );
+    if ( xPeerListener.is() )
+        xPeerListener->itemListChanged( i_rEvent );
+}
+ActionListenerMultiplexer& 	UnoComboBoxControl::getActionListeners()
+{
+    return maActionListeners;
+}
+ItemListenerMultiplexer& 	UnoComboBoxControl::getItemListeners()
+{
+    return maItemListeners;
+}
 
 void UnoComboBoxControl::addItem( const ::rtl::OUString& aItem, sal_Int16 nPos ) throw(uno::RuntimeException)
 {

File vcl/inc/vcl/combobox.hxx

View file
  • Ignore whitespace
 
     USHORT          GetEntryPos( const XubString& rStr ) const;
     USHORT          GetEntryPos( const void* pData ) const;
+    Image           GetEntryImage( USHORT nPos ) const;
     XubString       GetEntry( USHORT nPos ) const;
     USHORT          GetEntryCount() const;
 

File vcl/source/control/combobox.cxx

View file
  • Ignore whitespace
 	mpImplLB->Clear();
     CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(-1) );
 }
+// -----------------------------------------------------------------------
+
+Image ComboBox::GetEntryImage( USHORT nPos ) const
+{
+    if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
+        return mpImplLB->GetEntryList()->GetEntryImage( nPos );
+    return Image();
+}
 
 // -----------------------------------------------------------------------