From 7f91c62abdc52c812929bb323e6bbce80958d2b9 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 26 Nov 2010 15:08:17 +0100 Subject: dba34c: #i115779# DatabaseObjectView: don#t deliver an empty frame to the caller --- dbaccess/source/ui/app/AppController.cxx | 8 ++++---- dbaccess/source/ui/app/AppControllerGen.cxx | 1 - dbaccess/source/ui/misc/databaseobjectview.cxx | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 595d9b412851..d75272e796a4 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1304,8 +1304,8 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa ::comphelper::NamedValueCollection aCreationArgs; aCreationArgs.put( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN, ID_NEW_VIEW_DESIGN == _nId ); - Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); - Reference< XComponent > xComponent( aDesigner.createNew( xDataSource, aCreationArgs ), UNO_QUERY ); + const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); + const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource, aCreationArgs ), UNO_QUERY ); onDocumentOpened( ::rtl::OUString(), E_QUERY, E_OPEN_DESIGN, xComponent, NULL ); } } @@ -1356,8 +1356,8 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa { RelationDesigner aDesigner( getORB(), this, m_aCurrentFrame.getFrame() ); - Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); - Reference< XComponent > xComponent( aDesigner.createNew( xDataSource ), UNO_QUERY ); + const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); + const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource ), UNO_QUERY ); onDocumentOpened( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, NULL ); } } diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 9965f00dbd21..6e31a23ec997 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -670,7 +670,6 @@ void OApplicationController::askToReconnect() void OApplicationController::onDocumentOpened( const ::rtl::OUString& _rName, const sal_Int32 _nType, const ElementOpenMode _eMode, const Reference< XComponent >& _xDocument, const Reference< XComponent >& _rxDefinition ) { - OSL_PRECOND( _xDocument.is(), "OApplicationController::onDocumentOpened: illegal document!" ); if ( !_xDocument.is() ) return; diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 68f702b11d75..bcbfd019e48d 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -162,9 +162,6 @@ namespace dbaui 0, i_rDispatchArgs.getPropertyValues() ); - - if ( !xReturn.is() ) - xReturn.set( m_xFrameLoader, UNO_QUERY ); } catch( const Exception& ) { -- cgit From 048dfa981e9ab2b8b701d90020552f399affcbfe Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 26 Nov 2010 15:24:56 +0100 Subject: dba34c: #i112884# isClosed: don't crash if we're already closed ... --- dbaccess/source/core/dataaccess/SharedConnection.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbaccess/source/core/dataaccess/SharedConnection.cxx b/dbaccess/source/core/dataaccess/SharedConnection.cxx index d2b9f4d5196a..58625fe15170 100644 --- a/dbaccess/source/core/dataaccess/SharedConnection.cxx +++ b/dbaccess/source/core/dataaccess/SharedConnection.cxx @@ -129,6 +129,8 @@ void SAL_CALL OSharedConnection::rollback( ) throw(SQLException, RuntimeExcepti sal_Bool SAL_CALL OSharedConnection::isClosed( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); + if ( !m_xConnection.is() ) + return sal_True; return m_xConnection->isClosed(); } -- cgit From a2fc7d32332e20a3c16836c8362f79b76033bbfd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Dec 2010 09:10:32 +0100 Subject: dba34b: draw cell text in the table designer vertically centered, to prevent jumping of the text when the cell is activated --- dbaccess/source/ui/tabledesign/TEditControl.cxx | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 4d3cdb6652a9..7cbff13154ed 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -443,20 +443,14 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS(OTableEditorCtrl,NULL); - String aText( GetCellText( m_nCurrentPos, nColumnId )); - Point aPos(rRect.TopLeft()); - Size TxtSize(GetDataWindow().GetTextWidth(aText), GetDataWindow().GetTextHeight()); - - if (aPos.X() < rRect.Right() || aPos.X() + TxtSize.Width() > rRect.Right() || - aPos.Y() < rRect.Top() || aPos.Y() + TxtSize.Height() > rRect.Bottom()) - rDev.SetClipRegion( rRect ); - - rDev.DrawText(aPos, aText); - - if (rDev.IsClipRegion()) - rDev.SetClipRegion(); -// rDev.DrawText(rRect.TopLeft(), aText); -// rDev.SetClipRegion( ); + const String aText( GetCellText( m_nCurrentPos, nColumnId )); + const Point aPos(rRect.TopLeft()); + const Size TxtSize(GetDataWindow().GetTextWidth(aText), GetDataWindow().GetTextHeight()); + + rDev.Push( PUSH_CLIPREGION ); + rDev.SetClipRegion( rRect ); + rDev.DrawText( rRect, aText, TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER ); + rDev.Pop(); } //------------------------------------------------------------------------------ -- cgit From f9a37be30cbb23c941f519c92ed2de6f9a44f924 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Dec 2010 11:11:43 +0100 Subject: dba34c: #i77025# don't allow closign the app window when a wizard is running --- dbaccess/source/ui/app/AppController.cxx | 98 ++++++++++------- dbaccess/source/ui/app/closeveto.cxx | 180 +++++++++++++++++++++++++++++++ dbaccess/source/ui/app/closeveto.hxx | 67 ++++++++++++ dbaccess/source/ui/app/makefile.mk | 3 +- 4 files changed, 311 insertions(+), 37 deletions(-) create mode 100755 dbaccess/source/ui/app/closeveto.cxx create mode 100755 dbaccess/source/ui/app/closeveto.hxx diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index d75272e796a4..263214125f59 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -32,6 +32,7 @@ #include "dbustrings.hrc" #include "advancedsettingsdlg.hxx" #include "subcomponentmanager.hxx" +#include "closeveto.hxx" /** === begin UNO includes === **/ #include @@ -1953,6 +1954,9 @@ IMPL_LINK( OApplicationController, OnCreateWithPilot, void*, _pType ) // ----------------------------------------------------------------------------- void OApplicationController::newElementWithPilot( ElementType _eType ) { + CloseVeto aKeepDoc( getFrame() ); + // prevent the document being closed while the wizard is open + OSL_ENSURE( getContainer(), "OApplicationController::newElementWithPilot: without a view?" ); switch ( _eType ) @@ -2714,61 +2718,83 @@ void SAL_CALL OApplicationController::attachFrame( const Reference< XFrame > & i sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel > & _rxModel) throw( RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - Reference< XOfficeDatabaseDocument > xOfficeDoc( _rxModel, UNO_QUERY ); - if ( !xOfficeDoc.is() && _rxModel.is() ) + const Reference< XOfficeDatabaseDocument > xOfficeDoc( _rxModel, UNO_QUERY ); + const Reference< XModifiable > xDocModify( _rxModel, UNO_QUERY ); + if ( ( !xOfficeDoc.is() || !xDocModify.is() ) && _rxModel.is() ) { DBG_ERROR( "OApplicationController::attachModel: invalid model!" ); return sal_False; } - DBG_ASSERT( !( m_xModel.is() && ( m_xModel != _rxModel ) ), - "OApplicationController::attachModel: missing implementation: setting a new model while we have another one!" ); - // at least: remove as property change listener from the old model/data source + if ( m_xModel.is() && ( m_xModel != _rxModel ) && ( _rxModel.is() ) ) + { + OSL_ENSURE( false, "OApplicationController::attachModel: missing implementation: setting a new model while we have another one!" ); + // we'd need to completely update our view here, close sub components, and the like + return sal_False; + } + + const ::rtl::OUString aPropertyNames[] = + { + PROPERTY_URL, PROPERTY_USER + }; + + // disconnect from old model + try + { + if ( m_xDataSource.is() ) + { + for ( size_t i=0; i < sizeof( aPropertyNames ) / sizeof( aPropertyNames[0] ); ++i ) + { + m_xDataSource->removePropertyChangeListener( aPropertyNames[i], this ); + } + } + + Reference< XModifyBroadcaster > xBroadcaster( m_xModel, UNO_QUERY ); + if ( xBroadcaster.is() ) + xBroadcaster->removeModifyListener( this ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } m_xModel = _rxModel; - if ( m_xModel.is() ) + m_xDocumentModify = xDocModify; + m_xDataSource.set( xOfficeDoc.is() ? xOfficeDoc->getDataSource() : Reference< XDataSource >(), UNO_QUERY ); + + // connect to new model + try { - m_xDocumentModify.set( m_xModel, UNO_QUERY_THROW ); + if ( m_xDataSource.is() ) + { + for ( size_t i=0; i < sizeof( aPropertyNames ) / sizeof( aPropertyNames[0] ); ++i ) + { + m_xDataSource->addPropertyChangeListener( aPropertyNames[i], this ); + } + } + + Reference< XModifyBroadcaster > xBroadcaster( m_xModel, UNO_QUERY_THROW ); + xBroadcaster->addModifyListener( this ); + } - else + catch( const Exception& ) { - m_xDocumentModify.clear(); + DBG_UNHANDLED_EXCEPTION(); } - m_xDataSource.set(xOfficeDoc.is() ? xOfficeDoc->getDataSource() : Reference(),UNO_QUERY); + // initial preview mode if ( m_xDataSource.is() ) { try { - m_xDataSource->addPropertyChangeListener(PROPERTY_INFO, this); - m_xDataSource->addPropertyChangeListener(PROPERTY_URL, this); - m_xDataSource->addPropertyChangeListener(PROPERTY_ISPASSWORDREQUIRED, this); - m_xDataSource->addPropertyChangeListener(PROPERTY_LAYOUTINFORMATION, this); - m_xDataSource->addPropertyChangeListener(PROPERTY_SUPPRESSVERSIONCL, this); - m_xDataSource->addPropertyChangeListener(PROPERTY_TABLEFILTER, this); - m_xDataSource->addPropertyChangeListener(PROPERTY_TABLETYPEFILTER, this); - m_xDataSource->addPropertyChangeListener(PROPERTY_USER, this); // to get the 'modified' for the data source - Reference< XModifyBroadcaster > xBroadcaster(m_xModel, UNO_QUERY); - if ( xBroadcaster.is() ) - xBroadcaster->addModifyListener(static_cast(this)); - - Sequence aFields; - m_xDataSource->getPropertyValue(PROPERTY_LAYOUTINFORMATION) >>= aFields; - PropertyValue *pIter = aFields.getArray(); - PropertyValue *pEnd = pIter + aFields.getLength(); - for (; pIter != pEnd && pIter->Name != INFO_PREVIEW; ++pIter) - ; - - if ( pIter != pEnd ) + ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) ); + if ( aLayoutInfo.has( (rtl::OUString)INFO_PREVIEW ) ) { - sal_Int32 nValue = 0; - pIter->Value >>= nValue; - m_ePreviewMode = static_cast(nValue); + const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( (rtl::OUString)INFO_PREVIEW, (sal_Int32)0 ) ); + m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode ); if ( getView() ) - { - getContainer()->switchPreview(m_ePreviewMode); - } + getContainer()->switchPreview( m_ePreviewMode ); } } catch( const Exception& ) diff --git a/dbaccess/source/ui/app/closeveto.cxx b/dbaccess/source/ui/app/closeveto.cxx new file mode 100755 index 000000000000..558df26b643e --- /dev/null +++ b/dbaccess/source/ui/app/closeveto.cxx @@ -0,0 +1,180 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_dbaccess.hxx" + +#include "closeveto.hxx" + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include +#include +#include + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::util::XCloseable; + using ::com::sun::star::util::XCloseListener; + using ::com::sun::star::util::CloseVetoException; + using ::com::sun::star::lang::EventObject; + /** === end UNO using === **/ + + //================================================================================================================== + //= CloseListener_Impl + //================================================================================================================== + typedef ::cppu::WeakImplHelper1 < XCloseListener + > CloseListener_Base; + class DBACCESS_DLLPRIVATE CloseListener_Impl : public CloseListener_Base + { + public: + CloseListener_Impl() + :m_bHasOwnership( false ) + { + } + + // XCloseListener + virtual void SAL_CALL queryClosing( const EventObject& Source, ::sal_Bool GetsOwnership ) throw (CloseVetoException, RuntimeException); + virtual void SAL_CALL notifyClosing( const EventObject& Source ) throw (RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const EventObject& Source) throw (RuntimeException); + + bool hasOwnership() const { return m_bHasOwnership; } + + protected: + ~CloseListener_Impl() + { + } + + private: + bool m_bHasOwnership; + }; + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL CloseListener_Impl::queryClosing( const EventObject& i_source, ::sal_Bool i_deliverOwnership ) throw (CloseVetoException, RuntimeException) + { + (void)i_source; + + if ( !m_bHasOwnership ) + m_bHasOwnership = i_deliverOwnership; + + throw CloseVetoException(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL CloseListener_Impl::notifyClosing( const EventObject& i_source ) throw (RuntimeException) + { + (void)i_source; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL CloseListener_Impl::disposing( const EventObject& i_source ) throw (RuntimeException) + { + (void)i_source; + } + + //================================================================================================================== + //= CloseVeto_Data + //================================================================================================================== + struct DBACCESS_DLLPRIVATE CloseVeto_Data + { + Reference< XCloseable > xCloseable; + ::rtl::Reference< CloseListener_Impl > pListener; + }; + + //================================================================================================================== + //= operations + //================================================================================================================== + namespace + { + //-------------------------------------------------------------------------------------------------------------- + void lcl_init( CloseVeto_Data& i_data, const Reference< XInterface >& i_closeable ) + { + i_data.xCloseable.set( i_closeable, UNO_QUERY ); + ENSURE_OR_RETURN_VOID( i_data.xCloseable.is(), "CloseVeto: the component is not closeable!" ); + + i_data.pListener = new CloseListener_Impl; + i_data.xCloseable->addCloseListener( i_data.pListener.get() ); + } + + //-------------------------------------------------------------------------------------------------------------- + void lcl_deinit( CloseVeto_Data& i_data ) + { + if ( !i_data.xCloseable.is() ) + return; + + i_data.xCloseable->removeCloseListener( i_data.pListener.get() ); + if ( i_data.pListener->hasOwnership() ) + { + try + { + i_data.xCloseable->close( sal_True ); + } + catch( const CloseVetoException& ) { } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + } + } + + //================================================================================================================== + //= CloseVeto + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + CloseVeto::CloseVeto( const Reference< XInterface >& i_closeable ) + :m_pData( new CloseVeto_Data ) + { + lcl_init( *m_pData, i_closeable ); + } + + //------------------------------------------------------------------------------------------------------------------ + CloseVeto::~CloseVeto() + { + lcl_deinit( *m_pData ); + } + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... diff --git a/dbaccess/source/ui/app/closeveto.hxx b/dbaccess/source/ui/app/closeveto.hxx new file mode 100755 index 000000000000..f7e1c83644d1 --- /dev/null +++ b/dbaccess/source/ui/app/closeveto.hxx @@ -0,0 +1,67 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef DBACCESS_CLOSEVETO_HXX +#define DBACCESS_CLOSEVETO_HXX + +#include "dbaccessdllapi.h" + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + //================================================================================================================== + //= CloseVeto + //================================================================================================================== + struct CloseVeto_Data; + /** will add a XCloseListener to a given component, and veto its closing as long as the CloseVeto + instance is alive. + + If closing has been requested and vetoed while the CloseVeto instance is alive, and the ownership + went to the CloseVeto instance, then it will close the component in its dtor. + */ + class DBACCESS_DLLPRIVATE CloseVeto + { + public: + CloseVeto( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_closeable ); + ~CloseVeto(); + + private: + ::boost::scoped_ptr< CloseVeto_Data > m_pData; + }; + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... + +#endif // DBACCESS_CLOSEVETO_HXX diff --git a/dbaccess/source/ui/app/makefile.mk b/dbaccess/source/ui/app/makefile.mk index a7097b4330e1..e26927d99628 100644 --- a/dbaccess/source/ui/app/makefile.mk +++ b/dbaccess/source/ui/app/makefile.mk @@ -48,7 +48,8 @@ EXCEPTIONSFILES=\ $(SLO)$/AppSwapWindow.obj \ $(SLO)$/AppTitleWindow.obj \ $(SLO)$/AppView.obj \ - $(SLO)$/subcomponentmanager.obj + $(SLO)$/subcomponentmanager.obj \ + $(SLO)$/closeveto.obj SLOFILES =\ -- cgit From 1ae17f5b03cc14844fb600ca3573a96deb37ab3b Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Thu, 2 Dec 2010 13:16:48 +0100 Subject: dba34c: #i102625# only fetch rows when the view moves outside the scope of the rowset window --- dbaccess/source/core/api/CacheSet.cxx | 14 +++++++ dbaccess/source/core/api/CacheSet.hxx | 3 ++ dbaccess/source/core/api/KeySet.cxx | 39 ++++++++++++++++--- dbaccess/source/core/api/KeySet.hxx | 5 +++ dbaccess/source/core/api/RowSetCache.cxx | 67 ++++++++++++++++++-------------- dbaccess/source/ui/inc/dbu_qry.hrc | 4 +- dbaccess/source/ui/querydesign/query.src | 8 ---- 7 files changed, 96 insertions(+), 44 deletions(-) diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 783c93f56593..1c21ed2dbfa0 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -691,6 +691,20 @@ sal_Bool SAL_CALL OCacheSet::previous( ) throw(SQLException, RuntimeException) m_bInserted = m_bUpdated = m_bDeleted = sal_False; return m_xDriverSet->previous(); } +sal_Bool OCacheSet::last_checked( sal_Bool /*i_bFetchRow*/) +{ + return last(); +} +// ------------------------------------------------------------------------- +sal_Bool OCacheSet::previous_checked( sal_Bool /*i_bFetchRow*/ ) +{ + return previous(); +} +// ------------------------------------------------------------------------- +sal_Bool OCacheSet::absolute_checked( sal_Int32 row,sal_Bool /*i_bFetchRow*/ ) +{ + return absolute(row); +} // ------------------------------------------------------------------------- void SAL_CALL OCacheSet::refreshRow( ) throw(SQLException, RuntimeException) { diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx index 70905c444610..f4486239e540 100644 --- a/dbaccess/source/core/api/CacheSet.hxx +++ b/dbaccess/source/core/api/CacheSet.hxx @@ -174,6 +174,9 @@ namespace dbaccess virtual bool columnValuesUpdated(ORowSetValueVector::Vector& o_aCachedRow,const ORowSetValueVector::Vector& i_aRow); virtual bool updateColumnValues(const ORowSetValueVector::Vector& io_aCachedRow,ORowSetValueVector::Vector& io_aRow,const ::std::vector& i_aChangedColumns); virtual void fillMissingValues(ORowSetValueVector::Vector& io_aRow) const; + virtual sal_Bool previous_checked( sal_Bool i_bFetchRow ); + virtual sal_Bool absolute_checked( sal_Int32 row,sal_Bool i_bFetchRow ); + virtual sal_Bool last_checked( sal_Bool i_bFetchRow); }; } #endif //DBACCESS_CORE_API_CACHESET_HXX diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 8df84766575c..932314b72fbe 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -1167,6 +1167,12 @@ sal_Bool SAL_CALL OKeySet::next( ) throw(SQLException, RuntimeException) ++m_aKeyIter; // this is possible because we stand on begin() and this is the "beforefirst" row if(m_aKeyIter == m_aKeyMap.end() && !fetchRow()) m_aKeyIter = m_aKeyMap.end(); + else + { + //m_aKeyIter->second.second.second = new OPrivateRow(_rInsertRow->get()); + m_xRow.set(m_xDriverRow,UNO_QUERY_THROW); + return !isAfterLast(); + } } else if(!isAfterLast()) ++m_aKeyIter; @@ -1240,13 +1246,19 @@ sal_Bool SAL_CALL OKeySet::first( ) throw(SQLException, RuntimeException) // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OKeySet::last( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::last" ); + return last_checked(sal_True); +} + +sal_Bool OKeySet::last_checked( sal_Bool i_bFetchRow) +{ + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::last_checked" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; fillAllRows(); m_aKeyIter = m_aKeyMap.end(); --m_aKeyIter; - refreshRow(); + if ( i_bFetchRow ) + refreshRow(); return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(); } // ----------------------------------------------------------------------------- @@ -1260,6 +1272,10 @@ sal_Int32 SAL_CALL OKeySet::getRow( ) throw(SQLException, RuntimeException) } // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OKeySet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException) +{ + return absolute_checked(row,sal_True); +} +sal_Bool OKeySet::absolute_checked( sal_Int32 row,sal_Bool i_bFetchRow ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::absolute" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; @@ -1281,6 +1297,11 @@ sal_Bool SAL_CALL OKeySet::absolute( sal_Int32 row ) throw(SQLException, Runtime sal_Bool bNext = sal_True; for(sal_Int32 i=m_aKeyMap.size()-1;i < row && bNext;++i) bNext = fetchRow(); + if ( bNext ) + { + m_xRow.set(m_xDriverRow,UNO_QUERY_THROW); + return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(); + } } else m_aKeyIter = m_aKeyMap.end(); @@ -1292,7 +1313,8 @@ sal_Bool SAL_CALL OKeySet::absolute( sal_Int32 row ) throw(SQLException, Runtime ++m_aKeyIter; } } - refreshRow(); + if ( i_bFetchRow ) + refreshRow(); return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(); } @@ -1308,17 +1330,24 @@ sal_Bool SAL_CALL OKeySet::relative( sal_Int32 rows ) throw(SQLException, Runtim return absolute(getRow()+rows); } // ----------------------------------------------------------------------------- -sal_Bool SAL_CALL OKeySet::previous( ) throw(SQLException, RuntimeException) +sal_Bool OKeySet::previous_checked( sal_Bool i_bFetchRow ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::previous" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; if(m_aKeyIter != m_aKeyMap.begin()) { --m_aKeyIter; - refreshRow(); + if ( i_bFetchRow ) + refreshRow(); } return m_aKeyIter != m_aKeyMap.begin(); } +// ----------------------------------------------------------------------------- +sal_Bool SAL_CALL OKeySet::previous( ) throw(SQLException, RuntimeException) +{ + return previous_checked(sal_True); +} + // ----------------------------------------------------------------------------- void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) { diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 597f659f1d94..c002288bd9de 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -228,6 +228,11 @@ namespace dbaccess virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + + virtual sal_Bool previous_checked( sal_Bool i_bFetchRow ); + virtual sal_Bool absolute_checked( sal_Int32 row,sal_Bool i_bFetchRow ); + virtual sal_Bool last_checked( sal_Bool i_bFetchRow); }; } #endif // DBACCESS_CORE_API_KEYSET_HXX diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 0ca34e11b66b..1380c436ff0e 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -441,6 +441,13 @@ void ORowSetCache::setFetchSize(sal_Int32 _nSize) m_nStartPos = 0; m_nEndPos = _nSize; } + else if (m_nStartPos < m_nPosition && m_nPosition < m_nEndPos) + { + sal_Int32 nNewSt = -1; + fillMatrix(nNewSt,_nSize+1); + m_nStartPos = 0; + m_nEndPos = _nSize; + } } // ------------------------------------------------------------------------- @@ -654,34 +661,26 @@ sal_Bool ORowSetCache::next( ) // ------------------------------------------------------------------------- sal_Bool ORowSetCache::isBeforeFirst( ) { - // return !m_nPosition; - return m_bBeforeFirst; } // ------------------------------------------------------------------------- sal_Bool ORowSetCache::isAfterLast( ) { - return m_bAfterLast; } // ------------------------------------------------------------------------- sal_Bool ORowSetCache::isFirst( ) { - return m_nPosition == 1; // ask resultset for } // ------------------------------------------------------------------------- sal_Bool ORowSetCache::isLast( ) { - // return m_bRowCountFinal ? (m_nPosition==m_nRowCount) : m_pCacheSet->isLast(); - return m_nPosition == m_nRowCount; } // ------------------------------------------------------------------------- sal_Bool ORowSetCache::beforeFirst( ) { - - if(!m_bBeforeFirst) { m_bAfterLast = sal_False; @@ -696,8 +695,6 @@ sal_Bool ORowSetCache::beforeFirst( ) // ------------------------------------------------------------------------- sal_Bool ORowSetCache::afterLast( ) { - - if(!m_bAfterLast) { m_bBeforeFirst = sal_False; @@ -705,7 +702,7 @@ sal_Bool ORowSetCache::afterLast( ) if(!m_bRowCountFinal) { - m_pCacheSet->last(); + m_pCacheSet->last_checked(sal_False); m_bRowCountFinal = sal_True; m_nRowCount = m_pCacheSet->getRow();// + 1 removed } @@ -721,10 +718,22 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos { OSL_ENSURE(_nNewStartPos != _nNewEndPos,"ORowSetCache::fillMatrix: StartPos and EndPos can not be equal!"); // fill the whole window with new data - ORowSetMatrix::iterator aIter = m_pMatrix->begin(); - sal_Bool bCheck = m_pCacheSet->absolute(_nNewStartPos); // -1 no need to + ORowSetMatrix::iterator aIter; + sal_Int32 i; + sal_Bool bCheck; + if ( _nNewStartPos == -1 ) + { + aIter = m_pMatrix->begin() + m_nEndPos; + i = m_nEndPos+1; + } + else + { + aIter = m_pMatrix->begin(); + i = _nNewStartPos; + } + bCheck = m_pCacheSet->absolute(i); // -1 no need to + - sal_Int32 i=_nNewStartPos; for(;i<_nNewEndPos;++i,++aIter) { if(bCheck) @@ -738,7 +747,7 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos if(!m_bRowCountFinal) { - if(m_pCacheSet->previous()) // because we stand after the last row + if(m_pCacheSet->previous_checked(sal_False)) // because we stand after the last row m_nRowCount = m_pCacheSet->getRow(); // here we have the row count if(!m_nRowCount) m_nRowCount = i-1; // it can be that getRow return zero @@ -767,16 +776,18 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos } break; } - bCheck = m_pCacheSet->next(); + if ( i < (_nNewEndPos-1) ) + bCheck = m_pCacheSet->next(); } // m_nStartPos = _nNewStartPos; - // we have to read one row forward to enshure that we know when we are on last row + // we have to read one row forward to ensure that we know when we are on last row // but only when we don't know it already + /* if(!m_bRowCountFinal) { if(!m_pCacheSet->next()) { - if(m_pCacheSet->previous()) // because we stand after the last row + if(m_pCacheSet->previous_checked(sal_False)) // because we stand after the last row m_nRowCount = m_pCacheSet->getRow(); // here we have the row count m_bRowCountFinal = sal_True; } @@ -784,6 +795,7 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos m_nRowCount = std::max(i,m_nRowCount); } + */ return bCheck; } // ------------------------------------------------------------------------- @@ -921,19 +933,16 @@ sal_Bool ORowSetCache::moveWindow() // but only when we don't know it already if ( !m_bRowCountFinal ) { - bOk = m_pCacheSet->absolute( m_nPosition + 1 ); + bOk = m_pCacheSet->absolute_checked( m_nPosition + 1,sal_False ); if ( bOk ) m_nRowCount = std::max(sal_Int32(m_nPosition+1),m_nRowCount); } } - if(!bOk) + if(!bOk && !m_bRowCountFinal) { - if(!m_bRowCountFinal) - { - // because we stand after the last row - m_nRowCount = m_pCacheSet->previous() ? m_pCacheSet->getRow() : 0;// + 1 removed - m_bRowCountFinal = sal_True; - } + // because we stand after the last row + m_nRowCount = m_pCacheSet->previous_checked(sal_False) ? m_pCacheSet->getRow() : 0;// + 1 removed + m_bRowCountFinal = sal_True; } } } @@ -967,7 +976,7 @@ sal_Bool ORowSetCache::moveWindow() // now I can say how many rows we have if(!bOk) { - m_pCacheSet->previous(); // because we stand after the last row + m_pCacheSet->previous_checked(sal_False); // because we stand after the last row m_nRowCount = nPos; // here we have the row count m_bRowCountFinal = sal_True; } @@ -985,7 +994,7 @@ sal_Bool ORowSetCache::moveWindow() if ( !m_bRowCountFinal ) { - m_pCacheSet->previous(); // because we stand after the last row + m_pCacheSet->previous_checked(sal_False); // because we stand after the last row m_nRowCount = std::max(m_nRowCount,--nPos); // here we have the row count OSL_ENSURE(nPos == m_pCacheSet->getRow(),"nPos isn't valid!"); m_bRowCountFinal = sal_True; @@ -1001,7 +1010,7 @@ sal_Bool ORowSetCache::moveWindow() aIter = m_pMatrix->begin(); nPos = m_nStartPos; - bCheck = m_pCacheSet->absolute(m_nStartPos); + bCheck = m_pCacheSet->absolute_checked(m_nStartPos,sal_False); for(; !aIter->isValid() && bCheck;++aIter) { OSL_ENSURE(aIter != m_pMatrix->end(),"Invalid iterator"); diff --git a/dbaccess/source/ui/inc/dbu_qry.hrc b/dbaccess/source/ui/inc/dbu_qry.hrc index 26bd4c82b374..bf09f2356de4 100644 --- a/dbaccess/source/ui/inc/dbu_qry.hrc +++ b/dbaccess/source/ui/inc/dbu_qry.hrc @@ -56,8 +56,8 @@ #define STR_QUERY_NOTABLE RID_STR_QRY_START + 21 #define STR_QRY_ORDERBY_UNRELATED RID_STR_QRY_START + 22 #define STR_QUERY_HANDLETEXT RID_STR_QRY_START + 23 -#define STR_QUERY_FALSE RID_STR_QRY_START + 24 -#define STR_QUERY_TRUE RID_STR_QRY_START + 25 +// free +// free #define STR_QRY_TOO_MANY_COLUMNS RID_STR_QRY_START + 26 #define STR_SVT_SQL_SYNTAX_ERROR RID_STR_QRY_START + 27 #define STR_QUERYDESIGN_NO_VIEW_SUPPORT RID_STR_QRY_START + 28 diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src index d8a2162e1d14..01e4182e72ff 100644 --- a/dbaccess/source/ui/querydesign/query.src +++ b/dbaccess/source/ui/querydesign/query.src @@ -281,14 +281,6 @@ ErrorBox ERR_QRY_ORDERBY_ON_ASTERISK { Message [ en-US ] = "[*] cannot be used as a sort criterion."; }; -String STR_QUERY_TRUE -{ - Text [ en-US ] = "TRUE" ; -}; -String STR_QUERY_FALSE -{ - Text [ en-US ] = "FALSE" ; -}; String STR_QRY_TOO_MANY_TABLES { Text [ en-US ] = "There are too many tables."; -- cgit From a785deda745a1d77187d9f83d7448015a91e67d1 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Thu, 2 Dec 2010 14:54:34 +0100 Subject: dba34c: #i104351# fix name of dialog to correspond to menu entry --- dbaccess/source/ui/app/app.src | 6 +++--- dbaccess/source/ui/dlg/advancedsettings.src | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src index 4af2bdb70521..529e6ac55009 100644 --- a/dbaccess/source/ui/app/app.src +++ b/dbaccess/source/ui/app/app.src @@ -261,19 +261,19 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_DB_APP_DSPROPS; - Text[ en-US ] = "Properties"; + Text[ en-US ] = "Properties..."; Command = ".uno:DBDSProperties"; }; MenuItem { Identifier = SID_DB_APP_DSCONNECTION_TYPE; - Text[ en-US ] = "Connection Type"; + Text[ en-US ] = "Connection Type..."; Command = ".uno:DBDSConnectionType"; }; MenuItem { Identifier = SID_DB_APP_DSADVANCED_SETTINGS; - Text[ en-US ] = "Advanced Settings"; + Text[ en-US ] = "Advanced Settings..."; Command = ".uno:DBDSAdvancedSettings"; }; }; diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index 6d144890b415..f30b451025aa 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -383,5 +383,5 @@ TabDialog DLG_DATABASE_ADVANCED Text [ en-US ] = "Special Settings"; }; - Text [ en-US ] = "Advanced Properties" ; + Text [ en-US ] = "Advanced Settings" ; }; -- cgit From 199fe597e9506cdeec27c444cab9c9fe06177429 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Fri, 3 Dec 2010 09:25:36 +0100 Subject: dba34c: #i115398# add autoincrement to special type --- dbaccess/source/ui/tabledesign/FieldDescriptions.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index bb0231ba30b0..b11a18c8de74 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -629,6 +629,7 @@ TOTypeInfoSP OFieldDescription::getSpecialTypeInfo() const *pSpecialType = *m_pType; pSpecialType->nPrecision = GetPrecision(); pSpecialType->nMaximumScale = static_cast(GetScale()); + pSpecialType->bAutoIncrement = IsAutoIncrement(); // http://dba.openoffice.org/issues/show_bug.cgi?id=115398 fixed by ludob return pSpecialType; } // ----------------------------------------------------------------------------- -- cgit From e28d24e20f58c0736b31db3beee93a8881849bc9 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 3 Jan 2011 14:41:49 +0100 Subject: dba34c: fix for flush and text recognize --- dbaccess/source/core/dataaccess/datasource.cxx | 2 +- dbaccess/source/ui/misc/DExport.cxx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) mode change 100755 => 100644 dbaccess/source/core/dataaccess/datasource.cxx diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx old mode 100755 new mode 100644 index 835f5398efc7..4cd88751ea15 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -204,7 +204,7 @@ void SAL_CALL FlushNotificationAdapter::disposing( const EventObject& Source ) t if ( xListener.is() ) xListener->disposing( Source ); - impl_dispose( false ); + impl_dispose( true ); } //-------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index f4ff8064181d..e84cc8142f6a 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -447,7 +447,8 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl if ( eNumLang != LANGUAGE_NONE ) { nFormatKey = m_pFormatter->GetFormatForLanguageIfBuiltIn( nFormatKey, eNumLang ); - m_pFormatter->IsNumberFormat( m_sTextToken, nFormatKey, fOutNumber ); + if ( !m_pFormatter->IsNumberFormat( m_sTextToken, nFormatKey, fOutNumber ) ) + return NumberFormat::TEXT; } Reference xProp = xFormats->getByKey(nFormatKey); xProp->getPropertyValue(PROPERTY_TYPE) >>= nNumberFormat; -- cgit From 8a8d24e0e13629228731ee283fe72bf753e26179 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 3 Jan 2011 14:49:28 +0100 Subject: dba34c: #i96942# check if hit shape is a custom one --- reportdesign/source/ui/report/dlgedfunc.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 1535ce7d6ee1..13badddbb079 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -451,6 +451,7 @@ void DlgEdFunc::activateOle(SdrObject* _pObj) void DlgEdFunc::deactivateOle(bool _bSelect) { OLEObjCache& rObjCache = GetSdrGlobalData().GetOLEObjCache(); + OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController(); const ULONG nCount = rObjCache.Count(); for(ULONG i = 0 ; i< nCount;++i) { @@ -464,7 +465,6 @@ void DlgEdFunc::deactivateOle(bool _bSelect) m_bUiActive = false; if ( m_bShowPropertyBrowser ) { - OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController(); rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >()); } @@ -639,15 +639,17 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt) if (pObjOverlapped && !m_bSelectionMode) { colorizeOverlappedObject(pObjOverlapped); + } } } } } - } - else if ( aVEvt.pObj && !m_bSelectionMode) + else if ( aVEvt.pObj && (aVEvt.pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) && !m_bSelectionMode) { colorizeOverlappedObject(aVEvt.pObj); } + else + bIsSetPoint = false; return bIsSetPoint; } // ----------------------------------------------------------------------------- -- cgit From 9f338a693e1f7ca0b649827103edab417bd9b4d5 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 4 Jan 2011 13:12:33 +0100 Subject: dba34c: #i20306# support for window function and limit fetch first, ... added --- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 67385fd02d67..e0b4a665a8bc 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -2061,6 +2061,13 @@ namespace break; } + const OSQLParseNode* pTableExp = pParseTree->getChild(3); + if ( pTableExp->getChild(6)->count() > 0 || pTableExp->getChild(7)->count() > 0 || pTableExp->getChild(8)->count() > 0) + { + eErrorCode = eStatementTooComplex; + break; + } + Reference< XConnection> xConnection = rController.getConnection(); if ( !xConnection.is() ) { @@ -2142,7 +2149,7 @@ namespace pTableView->RemoveTabWin(aIterTableMap->second); } - if ( eOk == (eErrorCode = FillOuterJoins(_pView,pParseTree->getChild(3)->getChild(0)->getChild(1))) ) + if ( eOk == (eErrorCode = FillOuterJoins(_pView,pTableExp->getChild(0)->getChild(1))) ) { // check if we have a distinct statement if(SQL_ISTOKEN(pParseTree->getChild(1),DISTINCT)) -- cgit From b68968b86cc749515b42a80884491793cd21d033 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 5 Jan 2011 10:27:09 +0100 Subject: dba34c: #i110584# fix for FN escape function and check if table name is empty --- dbaccess/source/ui/browser/unodatbr.cxx | 56 ++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index d15fb125f234..eb72b2a6492c 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2701,6 +2701,8 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) sStatus.SearchAndReplaceAscii("$name$", aName); BrowserViewStatusDisplay aShowStatus(static_cast(getView()), sStatus); + + sal_Bool bEscapeProcessing = sal_True; if(xNameAccess.is() && xNameAccess->hasByName(sSimpleName)) { DBTreeListUserData* pData = static_cast(_pEntry->GetUserData()); @@ -2711,38 +2713,42 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) { pData->xObjectProperties = pData->xObjectProperties.query( xObject ); // if the query contains a parameterized statement and preview is enabled we won't get any data. - if ( m_bPreview && nCommandType == CommandType::QUERY && xObject.is() ) + if ( nCommandType == CommandType::QUERY && xObject.is() ) { - ::rtl::OUString sSql; Reference xObjectProps(xObject,UNO_QUERY); - xObjectProps->getPropertyValue(PROPERTY_COMMAND) >>= sSql; - Reference< XMultiServiceFactory > xFactory( pConData->xConnection, UNO_QUERY ); - if (xFactory.is()) + xObjectProps->getPropertyValue(PROPERTY_ESCAPE_PROCESSING) >>= bEscapeProcessing; + if ( m_bPreview ) { - try + ::rtl::OUString sSql; + xObjectProps->getPropertyValue(PROPERTY_COMMAND) >>= sSql; + Reference< XMultiServiceFactory > xFactory( pConData->xConnection, UNO_QUERY ); + if (xFactory.is()) { - Reference xAnalyzer(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY); - if ( xAnalyzer.is() ) + try { - xAnalyzer->setQuery(sSql); - Reference xParSup(xAnalyzer,UNO_QUERY); - if ( xParSup->getParameters()->getCount() > 0 ) + Reference xAnalyzer(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY); + if ( xAnalyzer.is() ) { - String sFilter = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WHERE ")); - sFilter = sFilter + xAnalyzer->getFilter(); - String sReplace(sSql); - sReplace.SearchAndReplace(sFilter,String()); - xAnalyzer->setQuery(sReplace); - Reference xComposer(xAnalyzer,UNO_QUERY); - xComposer->setFilter(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0=1"))); - aName = xAnalyzer->getQuery(); - nCommandType = CommandType::COMMAND; + xAnalyzer->setQuery(sSql); + Reference xParSup(xAnalyzer,UNO_QUERY); + if ( xParSup->getParameters()->getCount() > 0 ) + { + String sFilter = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WHERE ")); + sFilter = sFilter + xAnalyzer->getFilter(); + String sReplace(sSql); + sReplace.SearchAndReplace(sFilter,String()); + xAnalyzer->setQuery(sReplace); + Reference xComposer(xAnalyzer,UNO_QUERY); + xComposer->setFilter(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0=1"))); + aName = xAnalyzer->getQuery(); + nCommandType = CommandType::COMMAND; + } } } - } - catch (Exception&) - { - DBG_UNHANDLED_EXCEPTION(); + catch (Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } } } } @@ -2751,7 +2757,7 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) } String sDataSourceName( getDataSourceAcessor( pConnection ) ); - bSuccess = implLoadAnything( sDataSourceName, aName, nCommandType, sal_True, pConData->xConnection ); + bSuccess = implLoadAnything( sDataSourceName, aName, nCommandType, bEscapeProcessing, pConData->xConnection ); if ( !bSuccess ) { // clean up criticalFail(); -- cgit From 54b40663d23e6a56ce1dabb05a385d895958de34 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 6 Jan 2011 12:32:17 +0100 Subject: dba34c: #i113405# remove row from rowset when it can not be accessed anymore and adjust rowcount --- dbaccess/source/core/api/KeySet.cxx | 23 +++++++++++++++++------ dbaccess/source/core/api/KeySet.hxx | 4 +++- dbaccess/source/core/api/OptimisticSet.cxx | 5 +++-- dbaccess/source/core/api/OptimisticSet.hxx | 3 ++- dbaccess/source/core/api/RowSetCache.cxx | 8 ++------ 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 932314b72fbe..21dc7d8443e6 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -154,7 +154,8 @@ OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, const ::rtl::OUString& _rUpdateTableName, // this can be the alias or the full qualified name const Reference< XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, - sal_Int32 i_nMaxRows) + sal_Int32 i_nMaxRows, + sal_Int32& o_nRowCount) :OCacheSet(i_nMaxRows) ,m_aParameterValueForCache(_aParameterValueForCache) ,m_pKeyColumnNames(NULL) @@ -165,6 +166,7 @@ OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, ,m_xTableKeys(_xTableKeys) ,m_xComposer(_xComposer) ,m_sUpdateTableName(_rUpdateTableName) + ,m_rRowCount(o_nRowCount) ,m_bRowCountFinal(sal_False) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::OKeySet" ); @@ -1239,8 +1241,8 @@ sal_Bool SAL_CALL OKeySet::first( ) throw(SQLException, RuntimeException) ++m_aKeyIter; if(m_aKeyIter == m_aKeyMap.end() && !fetchRow()) m_aKeyIter = m_aKeyMap.end(); - - refreshRow(); + else + refreshRow(); return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(); } // ----------------------------------------------------------------------------- @@ -1403,9 +1405,18 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) OSL_ENSURE(m_xSet.is(),"No resultset form statement!"); sal_Bool bOK = m_xSet->next(); if ( !bOK ) - m_aKeyIter = m_aKeyMap.end(); - m_xRow.set(m_xSet,UNO_QUERY); - OSL_ENSURE(m_xRow.is(),"No row form statement!"); + { + OKeySetMatrix::iterator aTemp = m_aKeyIter; + ++m_aKeyIter; + m_aKeyMap.erase(aTemp); + --m_rRowCount; + refreshRow(); + } + else + { + m_xRow.set(m_xSet,UNO_QUERY); + OSL_ENSURE(m_xRow.is(),"No row form statement!"); + } } // ----------------------------------------------------------------------------- sal_Bool OKeySet::fetchRow() diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index c002288bd9de..2f9d1b002cb1 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -113,6 +113,7 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer > m_xComposer; ::rtl::OUString m_sUpdateTableName; ::std::vector< ::rtl::OUString > m_aFilterColumns; + sal_Int32& m_rRowCount; sal_Bool m_bRowCountFinal; @@ -160,7 +161,8 @@ namespace dbaccess const ::rtl::OUString& _rUpdateTableName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, - sal_Int32 i_nMaxRows); + sal_Int32 i_nMaxRows, + sal_Int32& o_nRowCount); // late ctor which can throw exceptions virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index d984ca2c78c6..2637a4f6bea6 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -103,8 +103,9 @@ OptimisticSet::OptimisticSet(const ::comphelper::ComponentContext& _rContext, const Reference< XConnection>& i_xConnection, const Reference< XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, - sal_Int32 i_nMaxRows) - :OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows) + sal_Int32 i_nMaxRows, + sal_Int32& o_nRowCount) + :OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows,o_nRowCount) ,m_aSqlParser( _rContext.getLegacyServiceFactory() ) ,m_aSqlIterator( i_xConnection, Reference(_xComposer,UNO_QUERY)->getTables(), m_aSqlParser, NULL ) ,m_bResultSetChanged(false) diff --git a/dbaccess/source/core/api/OptimisticSet.hxx b/dbaccess/source/core/api/OptimisticSet.hxx index da73eaeee8c5..f3b75e08ed5b 100644 --- a/dbaccess/source/core/api/OptimisticSet.hxx +++ b/dbaccess/source/core/api/OptimisticSet.hxx @@ -80,7 +80,8 @@ namespace dbaccess const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& i_xConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, - sal_Int32 i_nMaxRows); + sal_Int32 i_nMaxRows, + sal_Int32& o_nRowCount); // late ctor which can throw exceptions virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 1380c436ff0e..789fbadb794b 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -176,7 +176,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, if ( aTableNames.getLength() > 1 && !_rUpdateTableName.getLength() && bNeedKeySet ) {// here we have a join or union and nobody told us which table to update, so we update them all m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE; - OptimisticSet* pCursor = new OptimisticSet(m_aContext,xConnection,_xAnalyzer,_aParameterValueForCache,i_nMaxRows); + OptimisticSet* pCursor = new OptimisticSet(m_aContext,xConnection,_xAnalyzer,_aParameterValueForCache,i_nMaxRows,m_nRowCount); m_pCacheSet = pCursor; m_xCacheSet = m_pCacheSet; try @@ -309,7 +309,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, } } - OKeySet* pKeySet = new OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer,_aParameterValueForCache,i_nMaxRows); + OKeySet* pKeySet = new OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer,_aParameterValueForCache,i_nMaxRows,m_nRowCount); try { m_pCacheSet = pKeySet; @@ -825,7 +825,6 @@ sal_Bool ORowSetCache::moveWindow() if ( nNewStartPos < 1 ) { bCheck = m_pCacheSet->first(); - // aEnd = m_pMatrix->begin() + (sal_Int32)(m_nFetchSize*0.5); OSL_ENSURE((nNewEndPos - m_nStartPos - nNewStartPos) < (sal_Int32)m_pMatrix->size(),"Position is behind end()!"); aEnd = m_pMatrix->begin() + (nNewEndPos - m_nStartPos - nNewStartPos); aIter = aEnd; @@ -958,9 +957,6 @@ sal_Bool ORowSetCache::moveWindow() sal_Bool bCheck = m_pCacheSet->absolute(nPos); bCheck = fill(aIter,aEnd,nPos,bCheck); // refill the region wew don't need anymore -// // we know that this is the current maximal rowcount here -// if ( !m_bRowCountFinal && bCheck ) -// m_nRowCount = std::max(nPos,m_nRowCount); // we have to read one row forward to enshure that we know when we are on last row // but only when we don't know it already sal_Bool bOk = sal_True; -- cgit From 28750c30fb5dac69c63b6b7bfd0d9b0264b91d57 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 6 Jan 2011 13:40:20 +0100 Subject: dba34c: #i113184# remove the order clause when the column is not part of the table --- dbaccess/source/ui/browser/unodatbr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index eb72b2a6492c..85312df66684 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -469,7 +469,7 @@ void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow() // check if the order columns apply to tables which really exist in the statement const Reference< XIndexAccess > xOrderColumns( xComposer->getOrderColumns(), UNO_SET_THROW ); const sal_Int32 nOrderColumns( xOrderColumns->getCount() ); - bool invalidColumn = false; + bool invalidColumn = nOrderColumns == 0; for ( sal_Int32 c=0; ( c < nOrderColumns ) && !invalidColumn; ++c ) { const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); -- cgit From b06a3287f38af15af2172e20f2ad29a0d12cd8ff Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 7 Jan 2011 10:03:01 +0100 Subject: dba34c: #i116032# we have to recalc the bounding rect --- reportdesign/source/ui/report/ReportSection.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 04222d6e2f1e..6aa29551bcbf 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -544,22 +544,22 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) else { uno::Reference xReportDefinition = m_xSection->getReportDefinition(); + const sal_Int32 nLeftMargin = getStyleProperty(xReportDefinition,PROPERTY_LEFTMARGIN); + const sal_Int32 nRightMargin = getStyleProperty(xReportDefinition,PROPERTY_RIGHTMARGIN); + const sal_Int32 nPaperWidth = getStyleProperty(xReportDefinition,PROPERTY_PAPERSIZE).Width; + if ( _rEvent.PropertyName == PROPERTY_LEFTMARGIN ) { - const sal_Int32 nLeftMargin = getStyleProperty(xReportDefinition,PROPERTY_LEFTMARGIN); m_pPage->SetLftBorder(nLeftMargin); } else if ( _rEvent.PropertyName == PROPERTY_RIGHTMARGIN ) { - const sal_Int32 nRightMargin = getStyleProperty(xReportDefinition,PROPERTY_RIGHTMARGIN); m_pPage->SetRgtBorder(nRightMargin); } try { - const sal_Int32 nLeftMargin = getStyleProperty(xReportDefinition,PROPERTY_LEFTMARGIN); - const sal_Int32 nRightMargin = getStyleProperty(xReportDefinition,PROPERTY_RIGHTMARGIN); - const sal_Int32 nPaperWidth = getStyleProperty(xReportDefinition,PROPERTY_PAPERSIZE).Width; + sal_Int32 nRightBorder = nPaperWidth - nRightMargin; const sal_Int32 nCount = m_xSection->getCount(); for (sal_Int32 i = 0; i < nCount; ++i) { @@ -578,9 +578,9 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) aPos.X = nLeftMargin; bChanged = true; } - if ( (aPos.X + aSize.Width) > (nPaperWidth - nRightMargin) ) + if ( (aPos.X + aSize.Width) > nRightBorder ) { - aPos.X = nPaperWidth - nRightMargin - aSize.Width; + aPos.X = nRightBorder - aSize.Width; if ( aPos.X < nLeftMargin ) { aSize.Width += aPos.X - nLeftMargin; @@ -603,6 +603,8 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) aRet.setWidth(aRet.getWidth() + 1); if ( m_xSection.is() && (static_cast(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) ) m_xSection->setHeight(aRet.getHeight() + aRet.Top()); + + pObject->RecalcBoundRect(); } pBase->StartListening(); } -- cgit From 897ade45672a36ffd278b1cb9ba21694c0ee45c7 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 10 Jan 2011 13:41:20 +0100 Subject: dba34c: #i108415# handle structed filter handling --- .../dbaccess/SingleSelectQueryComposer.java | 84 ++++++++++++---------- .../source/core/api/SingleSelectQueryComposer.cxx | 28 +++++--- .../source/core/inc/SingleSelectQueryComposer.hxx | 30 -------- 3 files changed, 65 insertions(+), 77 deletions(-) diff --git a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java index 89d107ed5bb1..4823f5d50e4c 100755 --- a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java +++ b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java @@ -55,11 +55,12 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase { private XSingleSelectQueryComposer m_composer = null; - private final static String COMPLEXFILTER = "( \"ID\" = 1 AND \"Postal\" = '4' )" + - " OR ( \"ID\" = 2 AND \"Postal\" = '5' )" + - " OR ( \"ID\" = '3' AND \"Postal\" = '6' AND \"Address\" = '7' )" + - " OR ( \"Address\" = '8' )" + - " OR ( \"Postal\" = '9' )"; + private final static String COMPLEXFILTER = "( \"ID\" = 1 AND \"Postal\" = '4' )" + + " OR ( \"ID\" = 2 AND \"Postal\" = '5' )" + + " OR ( \"ID\" = 3 AND \"Postal\" = '6' AND \"Address\" = '7' )" + + " OR ( \"Address\" = '8' )" + + " OR ( \"Postal\" = '9' )" + + " OR ( NOW( ) = {D '2010-01-01' } )"; private final static String INNERPRODUCTSQUERY = "products (inner)"; // -------------------------------------------------------------------------------------------------------- @@ -135,15 +136,15 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase try { final String table = "SELECT * FROM \"customers\""; - m_composer.setCommand("customers",CommandType.TABLE); + m_composer.setCommand("customers", CommandType.TABLE); assertTrue("setCommand/getQuery TABLE inconsistent", m_composer.getQuery().equals(table)); m_database.getDatabase().getDataSource().createQuery("set command test", "SELECT * FROM \"orders for customer\" \"a\", \"customers\" \"b\" WHERE \"a\".\"Product Name\" = \"b\".\"Name\""); - m_composer.setCommand("set command test",CommandType.QUERY); + m_composer.setCommand("set command test", CommandType.QUERY); assertTrue("setCommand/getQuery QUERY inconsistent", m_composer.getQuery().equals(m_database.getDatabase().getDataSource().getQueryDefinition("set command test").getCommand())); final String sql = "SELECT * FROM \"orders for customer\" WHERE \"Product Name\" = 'test'"; - m_composer.setCommand(sql,CommandType.COMMAND); + m_composer.setCommand(sql, CommandType.COMMAND); assertTrue("setCommand/getQuery COMMAND inconsistent", m_composer.getQuery().equals(sql)); } catch (Exception e) @@ -151,6 +152,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase fail("Exception caught: " + e); } } + /** tests accessing attributes of the composer (order, filter, group by, having) */ @Test @@ -161,6 +163,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase try { System.out.println("check setElementaryQuery"); + final String simpleQuery2 = "SELECT * FROM \"customers\" WHERE \"Name\" = 'oranges'"; m_composer.setElementaryQuery(simpleQuery2); assertTrue("setElementaryQuery/getQuery inconsistent", m_composer.getQuery().equals(simpleQuery2)); @@ -177,16 +180,16 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase final XIndexAccess orderColumns = m_composer.getOrderColumns(); assertTrue("Order columns doesn't exist: \"Address\"", - orderColumns != null && orderColumns.getCount() == 1 && orderColumns.getByIndex(0) != null); + orderColumns != null && orderColumns.getCount() == 1 && orderColumns.getByIndex(0) != null); final XIndexAccess groupColumns = m_composer.getGroupColumns(); assertTrue("Group columns doesn't exist: \"City\"", - groupColumns != null && groupColumns.getCount() == 1 && groupColumns.getByIndex(0) != null); + groupColumns != null && groupColumns.getCount() == 1 && groupColumns.getByIndex(0) != null); // XColumnsSupplier final XColumnsSupplier xSelectColumns = UnoRuntime.queryInterface(XColumnsSupplier.class, m_composer); assertTrue("no select columns, or wrong number of select columns", - xSelectColumns != null && xSelectColumns.getColumns() != null && xSelectColumns.getColumns().getElementNames().length == 6); + xSelectColumns != null && xSelectColumns.getColumns() != null && xSelectColumns.getColumns().getElementNames().length == 6); // structured filter m_composer.setQuery("SELECT \"ID\", \"Postal\", \"Address\" FROM \"customers\""); @@ -194,6 +197,11 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase final PropertyValue[][] aStructuredFilter = m_composer.getStructuredFilter(); m_composer.setFilter(""); m_composer.setStructuredFilter(aStructuredFilter); + if (!m_composer.getFilter().equals(COMPLEXFILTER)) + { + System.out.println(COMPLEXFILTER); + System.out.println(m_composer.getFilter()); + } assertTrue("Structured Filter not identical", m_composer.getFilter().equals(COMPLEXFILTER)); // structured having clause @@ -244,6 +252,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase final XIndexAccess parameters = suppParams.getParameters(); final String expectedParamNames[] = + { "cname", "Product Name" @@ -276,6 +285,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase m_composer.setQuery("SELECT * FROM \"customers\""); final Object initArgs[] = + { new NamedValue("AutomaticAddition", Boolean.valueOf(true)) }; @@ -288,8 +298,8 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase filter.addProperty("Type", PropertyAttribute.MAYBEVOID, Integer.valueOf(DataType.LONGVARCHAR)); final XPropertySet column = UnoRuntime.queryInterface(XPropertySet.class, filter); - m_composer.appendFilterByColumn(column, true,SQLFilterOperator.LIKE); - assertTrue("At least one row should exist",m_database.getConnection().createStatement().executeQuery(m_composer.getQuery()).next()); + m_composer.appendFilterByColumn(column, true, SQLFilterOperator.LIKE); + assertTrue("At least one row should exist", m_database.getConnection().createStatement().executeQuery(m_composer.getQuery()).next()); } catch (Exception e) @@ -333,16 +343,16 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase { // a simple case: WHERE clause simply is a combination of predicates knitted with AND String query = - "SELECT \"customers\".\"Name\", " + - "\"customers\".\"Address\", " + - "\"customers\".\"City\", " + - "\"customers\".\"Postal\", " + - "\"products\".\"Name\" " + - "FROM \"orders\", \"customers\", \"orders_details\", \"products\" " + - "WHERE ( \"orders\".\"CustomerID\" = \"customers\".\"ID\" " + - "AND \"orders_details\".\"OrderID\" = \"orders\".\"ID\" " + - "AND \"orders_details\".\"ProductID\" = \"products\".\"ID\" " + - ") "; + "SELECT \"customers\".\"Name\", " + + "\"customers\".\"Address\", " + + "\"customers\".\"City\", " + + "\"customers\".\"Postal\", " + + "\"products\".\"Name\" " + + "FROM \"orders\", \"customers\", \"orders_details\", \"products\" " + + "WHERE ( \"orders\".\"CustomerID\" = \"customers\".\"ID\" " + + "AND \"orders_details\".\"OrderID\" = \"orders\".\"ID\" " + + "AND \"orders_details\".\"ProductID\" = \"products\".\"ID\" " + + ") "; impl_testDisjunctiveNormalForm(query, new PropertyValue[][] { @@ -356,20 +366,20 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase // somewhat more challenging: One of the conjunction terms is a disjunction itself query = - "SELECT \"customers\".\"Name\", " + - "\"customers\".\"Address\", " + - "\"customers\".\"City\", " + - "\"customers\".\"Postal\", " + - "\"products\".\"Name\" " + - "FROM \"orders\", \"customers\", \"orders_details\", \"products\" " + - "WHERE ( \"orders\".\"CustomerID\" = \"customers\".\"ID\" " + - "AND \"orders_details\".\"OrderID\" = \"orders\".\"ID\" " + - "AND \"orders_details\".\"ProductID\" = \"products\".\"ID\" " + - ") " + - "AND " + - "( \"products\".\"Name\" = 'Apples' " + - "OR \"products\".\"ID\" = 2 " + - ")"; + "SELECT \"customers\".\"Name\", " + + "\"customers\".\"Address\", " + + "\"customers\".\"City\", " + + "\"customers\".\"Postal\", " + + "\"products\".\"Name\" " + + "FROM \"orders\", \"customers\", \"orders_details\", \"products\" " + + "WHERE ( \"orders\".\"CustomerID\" = \"customers\".\"ID\" " + + "AND \"orders_details\".\"OrderID\" = \"orders\".\"ID\" " + + "AND \"orders_details\".\"ProductID\" = \"products\".\"ID\" " + + ") " + + "AND " + + "( \"products\".\"Name\" = 'Apples' " + + "OR \"products\".\"ID\" = 2 " + + ")"; impl_testDisjunctiveNormalForm(query, new PropertyValue[][] { diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index fa67a3d8cfdb..f3b40ffe968e 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -1243,16 +1244,12 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon ::rtl::OUString aValue; ::rtl::OUString aColumnName; - pCondition->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); + pCondition->getChild(2)->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); pCondition->getChild(0)->parseNodeToPredicateStr( aColumnName, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep .toChar() ) ); - // don't display the column name - aValue = aValue.copy(aColumnName.getLength()); - aValue.trim(); - aItem.Name = getColumnName(pCondition->getChild(0),_rIterator); aItem.Value <<= aValue; - aItem.Handle = pCondition->getNodeType(); + aItem.Handle = getPredicateType(pCondition->getChild(1)); rFilter.push_back(aItem); } else // kann sich nur um einen Expr. Ausdruck handeln @@ -1269,7 +1266,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon pLhs->getChild(i)->parseNodeToPredicateStr( aName, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); // Kriterium - aItem.Handle = pCondition->getChild(1)->getNodeType(); + aItem.Handle = getPredicateType(pCondition->getChild(1)); aValue = pCondition->getChild(1)->getTokenValue(); for(i=0;i< pRhs->count();i++) pRhs->getChild(i)->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); @@ -1514,7 +1511,7 @@ Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getOrderColumns( // ----------------------------------------------------------------------------- namespace { - ::rtl::OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& filter ) + ::rtl::OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& filter,const OPredicateInputController& i_aPredicateInputController,const Reference< XNameAccess >& i_xSelectColumns) { ::rtl::OUStringBuffer sRet; const Sequence< PropertyValue >* pOrIter = filter.getConstArray(); @@ -1531,6 +1528,15 @@ namespace sRet.append(pAndIter->Name); ::rtl::OUString sValue; pAndIter->Value >>= sValue; + if ( i_xSelectColumns.is() && i_xSelectColumns->hasByName(pAndIter->Name) ) + { + Reference xColumn(i_xSelectColumns->getByName(pAndIter->Name),UNO_QUERY); + sValue = i_aPredicateInputController.getPredicateValue(sValue,xColumn,sal_True); + } + else + { + sValue = i_aPredicateInputController.getPredicateValue(pAndIter->Name,sValue,sal_True); + } lcl_addFilterCriteria_throw(pAndIter->Handle,sValue,sRet); ++pAndIter; if ( pAndIter != pAndEnd ) @@ -1549,13 +1555,15 @@ namespace void SAL_CALL OSingleSelectQueryComposer::setStructuredFilter( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, ::com::sun::star::lang::IllegalArgumentException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredFilter" ); - setFilter(lcl_getCondition(filter)); + OPredicateInputController aPredicateInput(m_aContext.getLegacyServiceFactory(),m_xConnection); + setFilter(lcl_getCondition(filter,aPredicateInput,getColumns())); } // ----------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::setStructuredHavingClause( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredHavingClause" ); - setHavingClause(lcl_getCondition(filter)); + OPredicateInputController aPredicateInput(m_aContext.getLegacyServiceFactory(),m_xConnection); + setHavingClause(lcl_getCondition(filter,aPredicateInput,getColumns())); } // ----------------------------------------------------------------------------- void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria ,::std::mem_fun1_t& _aSetFunctor,sal_Int32 filterOperator) diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index 7c0d2ba4cea3..412fbb1c5231 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -27,51 +27,21 @@ #ifndef DBACCESS_CORE_API_SINGLESELECTQUERYCOMPOSER_HXX #define DBACCESS_CORE_API_SINGLESELECTQUERYCOMPOSER_HXX -#ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_ #include -#endif -#ifndef _CPPUHELPER_IMPLBASE5_HXX_ #include -#endif -#ifndef _CONNECTIVITY_PARSE_SQLITERATOR_HXX_ #include -#endif -#ifndef _CONNECTIVITY_SQLPARSE_HXX #include -#endif -#ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" -#endif -#ifndef _COMPHELPER_BROADCASTHELPER_HXX_ #include -#endif -#ifndef _COMPHELPER_UNO3_HXX_ #include -#endif -#ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_ #include -#endif -#ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_ #include -#endif -#ifndef COMPHELPER_COMPONENTCONTEXT_HXX #include -#endif #include -- cgit From 6e810686b628d54462f5cc885c7d8e0c68a964f6 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Mon, 17 Jan 2011 08:44:59 +0100 Subject: dba34d: #i37466# align icons to create list --- dbaccess/source/ui/app/AppDetailView.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index dbe9ad112458..839784599795 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -99,6 +99,7 @@ #include #include "dbtreelistbox.hxx" #include "IApplicationController.hxx" +#include "imageprovider.hxx" using namespace ::dbaui; using namespace ::com::sun::star::uno; @@ -135,6 +136,7 @@ OCreationList::OCreationList( OTasksWindow& _rParent ) SetSpaceBetweenEntries(nSize); SetSelectionMode( NO_SELECTION ); SetExtendedWinBits( EWB_NO_AUTO_CURENTRY ); + SetNodeDefaultImages( ); EnableEntryMnemonics(); } // ----------------------------------------------------------------------------- @@ -412,6 +414,12 @@ OTasksWindow::OTasksWindow(Window* _pParent,OApplicationDetailView* _pDetailView m_aHelpText.SetHelpId(HID_APP_HELP_TEXT); m_aDescription.SetHelpId(HID_APP_DESCRIPTION_TEXT); m_aDescription.SetText(ModuleRes(STR_DESCRIPTION)); + + ImageProvider aImageProvider; + Image aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM, false ); + m_aCreation.SetDefaultCollapsedEntryBmp( aFolderImage ); + m_aCreation.SetDefaultExpandedEntryBmp( aFolderImage ); + ImplInitSettings(sal_True,sal_True,sal_True); } // ----------------------------------------------------------------------------- -- cgit From 24b4d38a88aa617c7df8f61615848d119f8064b3 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Mon, 17 Jan 2011 08:59:17 +0100 Subject: dba34d: #i116187# get value from queryValue --- reportdesign/source/ui/report/ReportController.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index cf303fb8e706..23c8d1dadffd 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2496,8 +2496,11 @@ void OReportController::openPageDialog(const uno::Reference& _ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_LRSPACE,sal_True,&pItem)) { - xProp->setPropertyValue(PROPERTY_LEFTMARGIN,uno::makeAny(static_cast(pItem)->GetLeft())); - xProp->setPropertyValue(PROPERTY_RIGHTMARGIN,uno::makeAny(static_cast(pItem)->GetRight())); + Any aValue; + static_cast(pItem)->QueryValue(aValue,MID_L_MARGIN); + xProp->setPropertyValue(PROPERTY_LEFTMARGIN,aValue); + static_cast(pItem)->QueryValue(aValue,MID_R_MARGIN); + xProp->setPropertyValue(PROPERTY_RIGHTMARGIN,aValue); } if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_ULSPACE,sal_True,&pItem)) { -- cgit From b7487b7abcf37bc54cdcb870454ded5bf8938e95 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Mon, 17 Jan 2011 14:06:45 +0100 Subject: dba34d: #i116345# create a new var in for loop --- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index e0b4a665a8bc..fc5f89a997b2 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -2496,9 +2496,10 @@ namespace { OQueryController& rController = static_cast(_pView->getController()); ::connectivity::OSQLParseNode* pGroupBy = pSelectRoot->getChild(3)->getChild(2)->getChild(2); - OTableFieldDescRef aDragInfo = new OTableFieldDesc(); + for( sal_uInt32 i=0 ; i < pGroupBy->count() && eOk == eErrorCode; ++i ) { + OTableFieldDescRef aDragInfo = new OTableFieldDesc(); ::connectivity::OSQLParseNode* pParamRef = NULL; ::connectivity::OSQLParseNode* pArgument = pGroupBy->getChild( i ); if(SQL_ISRULE(pArgument,column_ref)) -- cgit From fa22008c7d4b50f1b3937e1ed10332c5866a5b65 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Wed, 19 Jan 2011 15:53:52 +0100 Subject: dba34d: comile error --- reportdesign/source/ui/report/ReportController.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 23c8d1dadffd..06aec876f725 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -106,6 +106,7 @@ #include #include +#include #include #include #include -- cgit From 7a6d6046982d98b1deab2f0ec8209fc7bd862b45 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 20 Jan 2011 14:11:33 +0100 Subject: dba34c: fix missed --- dbaccess/source/core/api/RowSetCache.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 789fbadb794b..2d4355edcaef 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -741,6 +741,8 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos if(!aIter->isValid()) *aIter = new ORowSetValueVector(m_xMetaData->getColumnCount()); m_pCacheSet->fillValueRow(*aIter,i); + if(!m_bRowCountFinal) + ++m_nRowCount; } else { // there are no more rows found so we can fetch some before start -- cgit From f503a43f0e297468a322c88b6e26a4e42b5d86ca Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 24 Jan 2011 12:49:10 +0100 Subject: dba34d: fixed unintentional no-op --- dbaccess/source/core/api/query.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index 75c56c65e0e3..2d1c12ad3f25 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -361,7 +361,7 @@ void OQuery::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _r { // the base class holds the property values itself, but we have to forward this to our CommandDefinition m_eDoingCurrently = SETTING_PROPERTIES; - OAutoActionReset(this); + OAutoActionReset aActionResetter(this); m_xCommandDefinition->setPropertyValue(sAggPropName, _rValue); if ( PROPERTY_ID_COMMAND == _nHandle ) -- cgit From a6f0350550d96ba8e00e79325a260a63a5899107 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Wed, 26 Jan 2011 12:26:48 +0100 Subject: dba34d: #i108967# introduce new settings into UI and driver config: RespectDriverResultSetType --- dbaccess/inc/dbaccess_helpid.hrc | 1 + dbaccess/source/core/api/RowSetCache.cxx | 18 +++++++++++----- dbaccess/source/ui/browser/brwctrlr.cxx | 15 +++++++++---- dbaccess/source/ui/dlg/DbAdminImpl.cxx | 1 + dbaccess/source/ui/dlg/advancedsettings.cxx | 33 ++++++++++++++++------------- dbaccess/source/ui/dlg/advancedsettings.hrc | 1 + dbaccess/source/ui/dlg/advancedsettings.hxx | 1 + dbaccess/source/ui/dlg/advancedsettings.src | 15 +++++++++++-- dbaccess/source/ui/dlg/dbadmin.cxx | 2 ++ dbaccess/source/ui/inc/dsitems.hxx | 3 ++- dbaccess/source/ui/inc/dsmeta.hxx | 1 + dbaccess/source/ui/misc/dsmeta.cxx | 1 + 12 files changed, 65 insertions(+), 27 deletions(-) mode change 100755 => 100644 dbaccess/source/ui/dlg/DbAdminImpl.cxx diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc index 29094bee1882..bb37eb5affff 100644 --- a/dbaccess/inc/dbaccess_helpid.hrc +++ b/dbaccess/inc/dbaccess_helpid.hrc @@ -436,6 +436,7 @@ #define HID_DSADMIN_IGNORECURRENCY "DBACCESS_HID_DSADMIN_IGNORECURRENCY" #define HID_MACRO_MIGRATION_BACKUP_LOCATION "DBACCESS_HID_MACRO_MIGRATION_BACKUP_LOCATION" #define HID_DSADMIN_PRIMARY_KEY_SUPPORT "DBACCESS_HID_DSADMIN_PRIMARY_KEY_SUPPORT" +#define HID_DSADMIN_RESPECTRESULTSETTYPE "DBACCESS_HID_DSADMIN_RESPECTRESULTSETTYPE" // this one below have hid in number space HID_SBA_START #define HID_DLG_ADABAS_NEWDB "DBACCESS_HID_DLG_ADABAS_NEWDB" diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 2d4355edcaef..7401a1016e53 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -116,11 +116,11 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, DBG_CTOR(ORowSetCache,NULL); // first try if the result can be used to do inserts and updates + Reference< XPropertySet> xProp(_xRs,UNO_QUERY); + Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo(); try { Reference< XResultSetUpdate> xUp(_xRs,UNO_QUERY_THROW); - Reference< XPropertySet> xProp(_xRs,UNO_QUERY); - Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo(); sal_Bool bBookmarkable = xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is(); if ( bBookmarkable ) @@ -139,14 +139,22 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, { (void)ex; } - _xRs->beforeFirst(); + try + { + if ( xPropInfo->hasPropertyByName(PROPERTY_RESULTSETTYPE) && + ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) != ResultSetType::FORWARD_ONLY) + _xRs->beforeFirst(); + } + catch(const SQLException& e) + { + (void)e; + } // check if all keys of the updateable table are fetched sal_Bool bAllKeysFound = sal_False; sal_Int32 nTablesCount = 0; - Reference< XPropertySet> xProp(_xRs,UNO_QUERY); - Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo(); + sal_Bool bNeedKeySet = !(xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is() ); bNeedKeySet = bNeedKeySet || (xPropInfo->hasPropertyByName(PROPERTY_RESULTSETCONCURRENCY) && diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 103267154da0..fdb225d620c9 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -760,11 +760,18 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY ); if ( xWarnings.is() ) { - SQLExceptionInfo aInfo( xWarnings->getWarnings() ); - if ( aInfo.isValid() ) + try + { + SQLExceptionInfo aInfo( xWarnings->getWarnings() ); + if ( aInfo.isValid() ) + { + showError( aInfo ); + impl_checkForCannotSelectUnfiltered( aInfo ); + } + } + catch(const SQLException& e) { - showError( aInfo ); - impl_checkForCannotSelectUnfiltered( aInfo ); + (void)e; } } diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx old mode 100755 new mode 100644 index 797cb73eb021..cbcd504c5cac --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -204,6 +204,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_DOSLINEENDS, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreferDosLikeLineEnds" ) ) ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SOCKET, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalSocket" ) ) ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_NAMED_PIPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedPipe" ) ) ) ); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_RESPECTRESULTSETTYPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RespectDriverResultSetType" ) ) ) ); // special settings for adabas m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SHUTSERVICE, ::rtl::OUString::createFromAscii("ShutdownDatabase"))); diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 1516c735f009..ae8ded9dd79b 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -95,6 +95,7 @@ namespace dbaui ,m_pIgnoreCurrency(NULL) ,m_pEscapeDateTime(NULL) ,m_pPrimaryKeySupport(NULL) + ,m_pRespectDriverResultSetType(NULL) ,m_pBooleanComparisonModeLabel( NULL ) ,m_pBooleanComparisonMode( NULL ) ,m_pMaxRowScanLabel( NULL ) @@ -206,6 +207,7 @@ namespace dbaui DELETEZ( m_pIgnoreCurrency ); DELETEZ( m_pEscapeDateTime ); DELETEZ( m_pPrimaryKeySupport ); + DELETEZ( m_pRespectDriverResultSetType ); DELETEZ( m_pBooleanComparisonModeLabel ); DELETEZ( m_pBooleanComparisonMode ); DELETEZ( m_pMaxRowScanLabel ); @@ -219,21 +221,22 @@ namespace dbaui // for easier maintainance, write the table in this form, then copy it to m_aBooleanSettings BooleanSettingDesc aSettings[] = { - { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false }, - { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false }, - { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false }, - { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false }, - { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false }, - { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false }, - { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true }, - { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false }, - { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false }, - { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false }, - { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false }, - { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false }, - { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false }, - { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false }, - { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false }, + { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false }, + { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false }, + { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false }, + { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false }, + { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false }, + { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false }, + { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true }, + { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false }, + { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false }, + { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false }, + { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false }, + { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false }, + { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false }, + { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false }, + { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false }, + { &m_pRespectDriverResultSetType, CB_RESPECTRESULTSETTYPE,DSID_RESPECTRESULTSETTYPE, false }, { NULL, 0, 0, false } }; diff --git a/dbaccess/source/ui/dlg/advancedsettings.hrc b/dbaccess/source/ui/dlg/advancedsettings.hrc index 193fdf5f3853..81c296916b09 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hrc +++ b/dbaccess/source/ui/dlg/advancedsettings.hrc @@ -62,6 +62,7 @@ #define CB_IGNORECURRENCY 14 #define CB_ESCAPE_DATETIME 15 #define CB_PRIMARY_KEY_SUPPORT 16 +#define CB_RESPECTRESULTSETTYPE 17 #define ET_AUTOINCREMENTVALUE 1 #define ET_RETRIEVE_AUTO 2 diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index 07620496b11f..88595832020a 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -73,6 +73,7 @@ namespace dbaui CheckBox* m_pIgnoreCurrency; CheckBox* m_pEscapeDateTime; CheckBox* m_pPrimaryKeySupport; + CheckBox* m_pRespectDriverResultSetType; FixedText* m_pBooleanComparisonModeLabel; ListBox* m_pBooleanComparisonMode; diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index f30b451025aa..d36a0b777563 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -217,6 +217,16 @@ Text [ en-US ] = "Supports primary keys"; \ }; +#define AUTO_RESPECTRESULTSETTYPE(AUTO_Y) \ + CheckBox CB_RESPECTRESULTSETTYPE \ + { \ + Pos = MAP_APPFONT ( 6 , AUTO_Y ) ; \ + Size = MAP_APPFONT ( ADVANCED_PAGE_X - 12 , CHECKBOX_HEIGHT ) ; \ + TabStop = TRUE ; \ + HelpId = HID_DSADMIN_RESPECTRESULTSETTYPE; \ + Text [ en-US ] = "Ignore the result set type from the database driver"; \ + }; + //------------------------------------------------------------------------- @@ -351,8 +361,9 @@ TabPage PAGE_ADVANCED_SETTINGS_SPECIAL AUTO_IGNORECURRENCY( 13*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 12*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_PRIMARY_KEY_SUPPORT( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS ) - AUTO_BOOLEANCOMPARISON( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) - AUTO_MAXROWSCAN( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) + AUTO_RESPECTRESULTSETTYPE( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 16*CHECKBOX_HEIGHT + RELATED_CONTROLS ) + AUTO_BOOLEANCOMPARISON( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) + AUTO_MAXROWSCAN( 18*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) }; //------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 1c1b945854ed..f03352497a98 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -411,6 +411,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, String()); *pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT ); *pCounter++ = new SfxInt32Item(DSID_MAX_ROW_SCAN, 100); + *pCounter++ = new SfxBoolItem( DSID_RESPECTRESULTSETTYPE,sal_False ); // create the pool static SfxItemInfo __READONLY_DATA aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = @@ -474,6 +475,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp {0,0}, {0,0}, {0,0}, + {0,0}, {0,0} }; diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx index 6b87bee2a61a..a29e2201f370 100644 --- a/dbaccess/source/ui/inc/dsitems.hxx +++ b/dbaccess/source/ui/inc/dsitems.hxx @@ -93,6 +93,7 @@ typedef sal_Int32 ItemID; #define DSID_NAMED_PIPE 58 #define DSID_PRIMARY_KEY_SUPPORT 59 #define DSID_MAX_ROW_SCAN 60 +#define DSID_RESPECTRESULTSETTYPE 61 // don't forget to adjust DSID_LAST_ITEM_ID below! @@ -100,7 +101,7 @@ typedef sal_Int32 ItemID; //= item range. Adjust this if you introduce new items above #define DSID_FIRST_ITEM_ID DSID_NAME -#define DSID_LAST_ITEM_ID DSID_MAX_ROW_SCAN +#define DSID_LAST_ITEM_ID DSID_RESPECTRESULTSETTYPE #endif // _DBAUI_DATASOURCEITEMS_HXX_ diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx index 87a93244cd3f..9d1275e073ff 100644 --- a/dbaccess/source/ui/inc/dsmeta.hxx +++ b/dbaccess/source/ui/inc/dsmeta.hxx @@ -133,6 +133,7 @@ namespace dbaui || has( DSID_ESCAPE_DATETIME ) || has( DSID_PRIMARY_KEY_SUPPORT ) || has( DSID_MAX_ROW_SCAN ) + || has( DSID_RESPECTRESULTSETTYPE ) ; } diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index 052d013f47a4..ad00b052a184 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -93,6 +93,7 @@ namespace dbaui { DSID_IGNORECURRENCY, "IgnoreCurrency" }, { DSID_ESCAPE_DATETIME, "EscapeDateTime" }, { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" }, + { DSID_RESPECTRESULTSETTYPE, "RespectDriverResultSetType" }, { DSID_MAX_ROW_SCAN, "MaxRowScan" }, { 0, NULL } }; -- cgit From bee746960f3d94d92e71006a7365a26669f52f8c Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Tue, 1 Feb 2011 13:42:47 +0100 Subject: dba34d: limit invalidate calls --- reportdesign/source/ui/inc/ReportSection.hxx | 4 + reportdesign/source/ui/inc/ReportWindow.hxx | 9 +- reportdesign/source/ui/misc/ColorListener.cxx | 16 ++- reportdesign/source/ui/report/DesignView.cxx | 4 - reportdesign/source/ui/report/EndMarker.cxx | 5 +- reportdesign/source/ui/report/ReportSection.cxx | 161 ++++++++++++------------ reportdesign/source/ui/report/ReportWindow.cxx | 13 ++ reportdesign/source/ui/report/SectionView.cxx | 1 + reportdesign/source/ui/report/SectionWindow.cxx | 35 +++--- reportdesign/source/ui/report/StartMarker.cxx | 19 +-- reportdesign/source/ui/report/ViewsWindow.cxx | 23 ++-- reportdesign/source/ui/report/dlgedfunc.cxx | 6 +- 12 files changed, 163 insertions(+), 133 deletions(-) diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx index a95fd72b7f40..00f3480f6964 100644 --- a/reportdesign/source/ui/inc/ReportSection.hxx +++ b/reportdesign/source/ui/inc/ReportSection.hxx @@ -59,6 +59,7 @@ namespace rptui ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pMulti; ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener; ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection; + sal_Int32 m_nPaintEntranceCount; DlgEdMode m_eMode; BOOL m_bDialogModelChanged; @@ -67,6 +68,9 @@ namespace rptui /** fills the section with all control from the report section */ void fill(); + /** checks all objects if they fit in the new paper width. + */ + void impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_Int32 i_nLeftMargin,sal_Int32 i_nRightMargin); OReportSection(OReportSection&); void operator =(OReportSection&); diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index 4267bc0ef6e4..9e7f7c6a8f90 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -36,6 +36,7 @@ #include #include +#include #include #include "ViewsWindow.hxx" @@ -54,12 +55,16 @@ namespace rptui class DlgEdFunc; class DlgEdFactory; - class OReportWindow : public Window, public IMarkedSection + class OReportWindow : public Window + , public IMarkedSection + , public ::cppu::BaseMutex + , public ::comphelper::OPropertyChangeListener { Ruler m_aHRuler; ODesignView* m_pView; OScrollWindowHelper* m_pParent; OViewsWindow m_aViewsWindow; + ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener; ::std::auto_ptr m_pObjFac; @@ -72,6 +77,8 @@ namespace rptui void operator =(OReportWindow&); protected: virtual void DataChanged( const DataChangedEvent& rDCEvt ); + // OPropertyChangeListener + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException); public: OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView); virtual ~OReportWindow(); diff --git a/reportdesign/source/ui/misc/ColorListener.cxx b/reportdesign/source/ui/misc/ColorListener.cxx index 2a53a5937095..78d7b8dba0fb 100644 --- a/reportdesign/source/ui/misc/ColorListener.cxx +++ b/reportdesign/source/ui/misc/ColorListener.cxx @@ -82,15 +82,21 @@ void OColorListener::DataChanged( const DataChangedEvent& rDCEvt ) // ----------------------------------------------------------------------------- void OColorListener::setCollapsed(sal_Bool _bCollapsed) { - m_bCollapsed = _bCollapsed; - if ( m_aCollapsedLink.IsSet() ) - m_aCollapsedLink.Call(this); + if ( m_bCollapsed != _bCollapsed ) + { + m_bCollapsed = _bCollapsed; + if ( m_aCollapsedLink.IsSet() ) + m_aCollapsedLink.Call(this); + } } // ----------------------------------------------------------------------------- void OColorListener::setMarked(sal_Bool _bMark) { - m_bMarked = _bMark; - Invalidate(); + if ( m_bMarked != _bMark) + { + m_bMarked = _bMark; + Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE); + } } // ======================================================================= } diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 8f703ab57f4f..b3165684d72d 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -495,10 +495,6 @@ IMPL_LINK( ODesignView, SplitHdl, void*, ) { long nOldSplitPos = getController().getSplitPos(); getController().setSplitPos(nTest); - if ( nOldSplitPos != -1 && nOldSplitPos <= nTest ) - { - Invalidate(/*INVALIDATE_NOCHILDREN*/); - } } return 0L; diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index c32a07d5fc76..0528631f851b 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -46,7 +46,6 @@ OEndMarker::OEndMarker(Window* _pParent ,const ::rtl::OUString& _sColorEntry) DBG_CTOR( rpt_OEndMarker,NULL); SetUniqueId(HID_RPT_ENDMARKER); ImplInitSettings(); - SetPaintTransparent(TRUE); } // ----------------------------------------------------------------------------- OEndMarker::~OEndMarker() @@ -89,6 +88,10 @@ void OEndMarker::Paint( const Rectangle& /*rRect*/ ) // ----------------------------------------------------------------------- void OEndMarker::ImplInitSettings() { + EnableChildTransparentMode( TRUE ); + SetParentClipMode( PARENTCLIPMODE_NOCLIP ); + SetPaintTransparent( TRUE ); + SetBackground( Wallpaper( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor) ); SetFillColor( Application::GetSettings().GetStyleSettings().GetShadowColor() ); } diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 6aa29551bcbf..ffc77bc3c115 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -95,14 +95,18 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re ,m_pMulti(NULL) ,m_pReportListener(NULL) ,m_xSection(_xSection) +,m_nPaintEntranceCount(0) ,m_eMode(RPTUI_SELECT) ,m_bDialogModelChanged(FALSE) ,m_bInDrag(sal_False) { DBG_CTOR( rpt_OReportSection,NULL); - EnableChildTransparentMode(); + //EnableChildTransparentMode(); SetHelpId(HID_REPORTSECTION); SetMapMode( MapMode( MAP_100TH_MM ) ); + SetParentClipMode( PARENTCLIPMODE_CLIP ); + EnableChildTransparentMode( FALSE ); + SetPaintTransparent( FALSE ); try { @@ -142,8 +146,9 @@ void OReportSection::Paint( const Rectangle& rRect ) { Window::Paint(rRect); - if ( m_pView ) + if ( m_pView && m_nPaintEntranceCount == 0) { + ++m_nPaintEntranceCount; // repaint, get PageView and prepare Region SdrPageView* pPgView = m_pView->GetSdrPageView(); const Region aPaintRectRegion(rRect); @@ -158,10 +163,7 @@ void OReportSection::Paint( const Rectangle& rRect ) OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)"); // draw background self using wallpaper OutputDevice& rTargetOutDev = pTargetPaintWindow->GetTargetOutputDevice(); - sal_Int32 nColor = m_xSection->getBackColor(); - if ( nColor == (sal_Int32)COL_TRANSPARENT ) - nColor = getStyleProperty(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR); - rTargetOutDev.DrawWallpaper(rRect, Wallpaper(Color(nColor))); + rTargetOutDev.DrawWallpaper(rRect, Wallpaper(pPgView->GetApplicationDocumentColor())); } // do paint (unbuffered) and mark repaint end @@ -172,21 +174,13 @@ void OReportSection::Paint( const Rectangle& rRect ) } m_pView->CompleteRedraw(this,aPaintRectRegion); + --m_nPaintEntranceCount; } } //------------------------------------------------------------------------------ void OReportSection::Resize() { Window::Resize(); - if ( m_xSection.is() && m_pPage && m_pView ) - { - uno::Reference xReportDefinition = m_xSection->getReportDefinition(); - m_pPage->SetSize( Size( getStyleProperty(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight()) ); - const Size aPageSize = m_pPage->GetSize(); - const sal_Int32 nLeftMargin = getStyleProperty(xReportDefinition,PROPERTY_LEFTMARGIN); - const sal_Int32 nRightMargin = getStyleProperty(xReportDefinition,PROPERTY_RIGHTMARGIN); - m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) ); - } } //------------------------------------------------------------------------------ void OReportSection::fill() @@ -235,8 +229,9 @@ void OReportSection::fill() nColor = getStyleProperty(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR); m_pView->SetApplicationDocumentColor(nColor); - const sal_Int32 nLeftMargin = getStyleProperty(m_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN); - const sal_Int32 nRightMargin = getStyleProperty(m_xSection->getReportDefinition(),PROPERTY_RIGHTMARGIN); + uno::Reference xReportDefinition = m_xSection->getReportDefinition(); + const sal_Int32 nLeftMargin = getStyleProperty(xReportDefinition,PROPERTY_LEFTMARGIN); + const sal_Int32 nRightMargin = getStyleProperty(xReportDefinition,PROPERTY_RIGHTMARGIN); m_pPage->SetLftBorder(nLeftMargin); m_pPage->SetRgtBorder(nRightMargin); @@ -247,15 +242,9 @@ void OReportSection::fill() m_pView->StartListening( *m_pModel ); /*Resize();*/ - if ( m_xSection.is() && m_pPage && m_pView ) - { - uno::Reference xReportDefinition = m_xSection->getReportDefinition(); - m_pPage->SetSize( Size( getStyleProperty(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight()) ); - const Size aPageSize = m_pPage->GetSize(); - const sal_Int32 nWorkAreaLeftMargin = getStyleProperty(xReportDefinition,PROPERTY_LEFTMARGIN); - const sal_Int32 nWorkAreaRightMargin = getStyleProperty(xReportDefinition,PROPERTY_RIGHTMARGIN); - m_pView->SetWorkArea( Rectangle( Point( nWorkAreaLeftMargin, 0), Size(aPageSize.Width() - nWorkAreaLeftMargin - nWorkAreaRightMargin,aPageSize.Height()) ) ); - } // if ( m_xSection.is() && m_pPage && m_pView ) + m_pPage->SetSize( Size( getStyleProperty(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight()) ); + const Size aPageSize = m_pPage->GetSize(); + m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) ); //SetBackground( Wallpaper( COL_BLUE )); } @@ -556,67 +545,77 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) { m_pPage->SetRgtBorder(nRightMargin); } - - try + const Size aOldPageSize = m_pPage->GetSize(); + sal_Int32 nNewHeight = 5*m_xSection->getHeight(); + if ( aOldPageSize.Height() != nNewHeight || nPaperWidth != aOldPageSize.Width() ) + { + m_pPage->SetSize( Size( nPaperWidth,nNewHeight) ); + const Size aPageSize = m_pPage->GetSize(); + m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) ); + } + impl_adjustObjectSizePosition(nPaperWidth,nLeftMargin,nRightMargin); + m_pParent->Invalidate(INVALIDATE_UPDATE | INVALIDATE_TRANSPARENT); + } + } +} +void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_Int32 i_nLeftMargin,sal_Int32 i_nRightMargin) +{ + try + { + sal_Int32 nRightBorder = i_nPaperWidth - i_nRightMargin; + const sal_Int32 nCount = m_xSection->getCount(); + for (sal_Int32 i = 0; i < nCount; ++i) + { + bool bChanged = false; + uno::Reference< report::XReportComponent> xReportComponent(m_xSection->getByIndex(i),uno::UNO_QUERY_THROW); + awt::Point aPos = xReportComponent->getPosition(); + awt::Size aSize = xReportComponent->getSize(); + SvxShape* pShape = SvxShape::getImplementation( xReportComponent ); + SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL; + if ( pObject ) { - sal_Int32 nRightBorder = nPaperWidth - nRightMargin; - const sal_Int32 nCount = m_xSection->getCount(); - for (sal_Int32 i = 0; i < nCount; ++i) + OObjectBase* pBase = dynamic_cast(pObject); + pBase->EndListening(sal_False); + if ( aPos.X < i_nLeftMargin ) + { + aPos.X = i_nLeftMargin; + bChanged = true; + } + if ( (aPos.X + aSize.Width) > nRightBorder ) { - bool bChanged = false; - uno::Reference< report::XReportComponent> xReportComponent(m_xSection->getByIndex(i),uno::UNO_QUERY_THROW); - awt::Point aPos = xReportComponent->getPosition(); - awt::Size aSize = xReportComponent->getSize(); - SvxShape* pShape = SvxShape::getImplementation( xReportComponent ); - SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL; - if ( pObject ) + aPos.X = nRightBorder - aSize.Width; + if ( aPos.X < i_nLeftMargin ) { - OObjectBase* pBase = dynamic_cast(pObject); - pBase->EndListening(sal_False); - if ( aPos.X < nLeftMargin ) - { - aPos.X = nLeftMargin; - bChanged = true; - } - if ( (aPos.X + aSize.Width) > nRightBorder ) - { - aPos.X = nRightBorder - aSize.Width; - if ( aPos.X < nLeftMargin ) - { - aSize.Width += aPos.X - nLeftMargin; - aPos.X = nLeftMargin; - // add listener around - pBase->StartListening(); - xReportComponent->setSize(aSize); - pBase->EndListening(sal_False); - } - bChanged = true; - } - if ( aPos.Y < 0 ) - aPos.Y = 0; - if ( bChanged ) - { - xReportComponent->setPosition(aPos); - correctOverlapping(pObject,*this,false); - Rectangle aRet(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); - aRet.setHeight(aRet.getHeight() + 1); - aRet.setWidth(aRet.getWidth() + 1); - if ( m_xSection.is() && (static_cast(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) ) - m_xSection->setHeight(aRet.getHeight() + aRet.Top()); - - pObject->RecalcBoundRect(); - } + aSize.Width += aPos.X - i_nLeftMargin; + aPos.X = i_nLeftMargin; + // add listener around pBase->StartListening(); + xReportComponent->setSize(aSize); + pBase->EndListening(sal_False); } - } // for (sal_Int32 i = 0; i < nCount; ++i) - } - catch(uno::Exception) - { - OSL_ENSURE(0,"Exception caught: OReportSection::_propertyChanged("); + bChanged = true; + } + if ( aPos.Y < 0 ) + aPos.Y = 0; + if ( bChanged ) + { + xReportComponent->setPosition(aPos); + correctOverlapping(pObject,*this,false); + Rectangle aRet(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); + aRet.setHeight(aRet.getHeight() + 1); + aRet.setWidth(aRet.getWidth() + 1); + if ( m_xSection.is() && (static_cast(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) ) + m_xSection->setHeight(aRet.getHeight() + aRet.Top()); + + pObject->RecalcBoundRect(); + } + pBase->StartListening(); } - - Resize(); - } + } // for (sal_Int32 i = 0; i < nCount; ++i) + } + catch(uno::Exception) + { + OSL_ENSURE(0,"Exception caught: OReportSection::_propertyChanged("); } } //------------------------------------------------------------------------------ diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 3a2f4559b43a..b59c30faac5c 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -31,6 +31,7 @@ #include "ViewsWindow.hxx" #include "ReportRuler.hxx" #include "DesignView.hxx" +#include "UITools.hxx" #include #include @@ -65,6 +66,7 @@ DBG_NAME( rpt_OReportWindow ) //------------------------------------------------------------------------------ OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView) : Window(_pParent,WB_DIALOGCONTROL) +, ::comphelper::OPropertyChangeListener(m_aMutex) ,m_aHRuler(this) ,m_pView(_pView) ,m_pParent(_pParent) @@ -88,11 +90,14 @@ OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView) m_aHRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); ImplInitSettings(); + m_pReportListener = addStyleListener(_pView->getController().getReportDefinition(),this); } //------------------------------------------------------------------------------ OReportWindow::~OReportWindow() { DBG_DTOR( rpt_OReportWindow,NULL); + if ( m_pReportListener.is() ) + m_pReportListener->dispose(); } // ----------------------------------------------------------------------------- void OReportWindow::initialize() @@ -438,6 +443,14 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const return nZoom; } +// ----------------------------------------------------------------------------- +void OReportWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException) +{ + Resize(); + m_aViewsWindow.Resize(); + static sal_Int32 nIn = INVALIDATE_TRANSPARENT; + Invalidate(nIn); +} //================================================================== } //rptui //================================================================== diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index e0d836a3d8c5..fc0cb8b8c310 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -52,6 +52,7 @@ OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, O ,m_pSectionWindow(_pSectionWindow) { DBG_CTOR( rpt_OSectionView,NULL); + // SetPagePaintingAllowed(false); SetBufferedOutputAllowed(true); SetBufferedOverlayAllowed(true); SetPageBorderVisible(false); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 26ce8c13c2a6..5cf8994cb1d2 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -109,7 +109,6 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep } _propertyChanged(aEvent); - SetPaintTransparent(TRUE); } // ----------------------------------------------------------------------------- OSectionWindow::~OSectionWindow() @@ -135,18 +134,15 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection(); if ( _rEvent.PropertyName.equals(PROPERTY_HEIGHT) ) { + static bool t4 = true; + if ( t4 ) m_pParent->getView()->SetUpdateMode(FALSE); - Resize(); + //Resize(); m_pParent->getView()->notifySizeChanged(); m_pParent->resize(*this); + if ( t4 ) m_pParent->getView()->SetUpdateMode(TRUE); - m_aStartMarker.Invalidate(INVALIDATE_NOERASE); - m_aEndMarker.Invalidate(INVALIDATE_NOERASE); - m_aReportSection.Invalidate(/*INVALIDATE_NOERASE*/); - getViewsWindow()->getView()->getReportView()->getController().resetZoomType(); - // Invalidate(INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT); - // m_pParent->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE|INVALIDATE_TRANSPARENT); - // m_pParent->Invalidate(/*INVALIDATE_NOCHILDREN | INVALIDATE_NOERASE |*/ INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT); + // getViewsWindow()->getView()->getReportView()->getController().resetZoomType(); } else if ( _rEvent.PropertyName.equals(PROPERTY_NAME) && !xSection->getGroup().is() ) { @@ -155,7 +151,9 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) || setReportSectionTitle(xReport,RID_STR_REPORT_FOOTER,::std::mem_fun(&OReportHelper::getReportFooter),::std::mem_fun(&OReportHelper::getReportFooterOn)) || setReportSectionTitle(xReport,RID_STR_PAGE_HEADER,::std::mem_fun(&OReportHelper::getPageHeader),::std::mem_fun(&OReportHelper::getPageHeaderOn)) || setReportSectionTitle(xReport,RID_STR_PAGE_FOOTER,::std::mem_fun(&OReportHelper::getPageFooter),::std::mem_fun(&OReportHelper::getPageFooterOn)) ) + { m_aStartMarker.Invalidate(INVALIDATE_NOERASE); + } else { String sTitle = String(ModuleRes(RID_STR_DETAIL)); @@ -167,10 +165,9 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) else if ( _rEvent.PropertyName.equals(PROPERTY_EXPRESSION) ) { uno::Reference< report::XGroup > xGroup(_rEvent.Source,uno::UNO_QUERY); - if ( xGroup.is() ) + if ( xGroup.is() && !setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn))) { - if ( !setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn)) ) - setGroupSectionTitle(xGroup,RID_STR_FOOTER,::std::mem_fun(&OGroupHelper::getFooter),::std::mem_fun(&OGroupHelper::getFooterOn)); + setGroupSectionTitle(xGroup,RID_STR_FOOTER,::std::mem_fun(&OGroupHelper::getFooter),::std::mem_fun(&OGroupHelper::getFooterOn)); } } } @@ -211,8 +208,14 @@ bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& //------------------------------------------------------------------------------ void OSectionWindow::ImplInitSettings() { + static bool t = false; + if ( t ) + { + EnableChildTransparentMode( TRUE ); + SetParentClipMode( PARENTCLIPMODE_NOCLIP ); + SetPaintTransparent( TRUE ); + } SetBackground( ); - //SetBackground( Wallpaper( COL_RED )); } //----------------------------------------------------------------------------- void OSectionWindow::DataChanged( const DataChangedEvent& rDCEvt ) @@ -307,10 +310,6 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker ) m_aSplitter.Show(bShow); m_pParent->resize(*this); - Resize(); - // TRY - // m_pParent->Invalidate(INVALIDATE_TRANSPARENT | INVALIDATE_NOCHILDREN); - Invalidate(); } return 0L; } @@ -409,8 +408,6 @@ void OSectionWindow::scrollChildren(long _nX) lcl_setOrigin(m_aSplitter,_nX, 0); lcl_scroll(m_aSplitter,aDiff); - - Resize(); } //============================================================================== } // rptui diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index c3fed866e534..91a9af79caf8 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -71,6 +71,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol initDefaultNodeImages(); ImplInitSettings(); m_aText.SetHelpId(HID_RPT_START_TITLE); + m_aText.SetPaintTransparent(TRUE); m_aImage.SetHelpId(HID_RPT_START_IMAGE); m_aText.Show(); m_aImage.Show(); @@ -83,7 +84,9 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol m_aVRuler.SetMargin2(); const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); - SetPaintTransparent(TRUE); + EnableChildTransparentMode( TRUE ); + SetParentClipMode( PARENTCLIPMODE_NOCLIP ); + SetPaintTransparent( TRUE ); } // ----------------------------------------------------------------------------- OStartMarker::~OStartMarker() @@ -107,21 +110,22 @@ sal_Int32 OStartMarker::getMinHeight() const // ----------------------------------------------------------------------------- void OStartMarker::Paint( const Rectangle& rRect ) { - Window::Paint( rRect ); //SetUpdateMode(FALSE); Size aSize = GetOutputSizePixel(); long nSize = aSize.Width(); const long nCornerWidth = long(CORNER_SPACE * (double)GetMapMode().GetScaleX()); - if ( !isCollapsed() ) + if ( isCollapsed() ) + { + SetClipRegion(); + } + else { const long nVRulerWidth = m_aVRuler.GetSizePixel().Width(); nSize = aSize.Width() - nVRulerWidth/* - m_nCornerSize*/; - SetClipRegion(Region(PixelToLogic(Rectangle(Point(),Size( nSize,aSize.Height()))))); aSize.Width() += nCornerWidth; - } // if ( !isCollapsed() ) - else - SetClipRegion(); + SetClipRegion(Region(PixelToLogic(Rectangle(Point(),Size(nSize,aSize.Height()))))); + } const Point aGcc3WorkaroundTemporary; Rectangle aWholeRect(aGcc3WorkaroundTemporary,aSize); @@ -272,7 +276,6 @@ void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint) == SFX_HINT_COLORS_CHANGED)) { setColor(); - //m_aText.Invalidate(); Invalidate(INVALIDATE_CHILDREN); } } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index bcd50236aab3..130acfc88592 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -184,7 +184,6 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow) ,m_bInUnmark(sal_False) { DBG_CTOR( rpt_OViewsWindow,NULL); - SetPaintTransparent(TRUE); SetUniqueId(UID_RPT_VIEWSWINDOW); SetMapMode( MapMode( MAP_100TH_MM ) ); m_aColorConfig.AddListener(this); @@ -244,8 +243,9 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow) if ( bSet ) { impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,bSet); - pSectionWindow->Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT); - pSectionWindow->getStartMarker().Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT ); + static sal_Int32 nIn = INVALIDATE_UPDATE | INVALIDATE_TRANSPARENT; + pSectionWindow->getStartMarker().Invalidate( nIn ); // INVALIDATE_NOERASE |INVALIDATE_NOCHILDREN| INVALIDATE_TRANSPARENT + pSectionWindow->getEndMarker().Invalidate( nIn ); } } // for (;aIter != aEnd ; ++aIter,++nPos) Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); @@ -256,7 +256,6 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow) m_pParent->notifySizeChanged(); Rectangle aRect(PixelToLogic(Point(0,0)),aOut); - Invalidate(aRect,INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT); } //------------------------------------------------------------------------------ void OViewsWindow::Resize() @@ -294,7 +293,7 @@ void OViewsWindow::Paint( const Rectangle& rRect ) //------------------------------------------------------------------------------ void OViewsWindow::ImplInitSettings() { - // SetBackground( Wallpaper( COL_LIGHTBLUE )); + EnableChildTransparentMode( TRUE ); SetBackground( ); SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); @@ -317,8 +316,6 @@ void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSectio ::boost::shared_ptr pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) ); m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow)); m_pParent->setMarked(&pSectionWindow->getReportSection().getSectionView(),m_aSections.size() == 1); - - Resize(); } //---------------------------------------------------------------------------- void OViewsWindow::removeSection(USHORT _nPosition) @@ -566,8 +563,8 @@ void OViewsWindow::unmarkAllObjects(OSectionView* _pSectionView) // ----------------------------------------------------------------------- void OViewsWindow::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32) { - ImplInitSettings(); - Invalidate(); + ImplInitSettings(); + Invalidate(); } // ----------------------------------------------------------------------------- void OViewsWindow::MouseButtonDown( const MouseEvent& rMEvt ) @@ -946,7 +943,8 @@ void OViewsWindow::setGridSnap(BOOL bOn) for (; aIter != aEnd ; ++aIter) { (*aIter)->getReportSection().getSectionView().SetGridSnap(bOn); - (*aIter)->getReportSection().Invalidate(); + static sal_Int32 nIn = 0; + (*aIter)->getReportSection().Invalidate(nIn); } } // ----------------------------------------------------------------------------- @@ -1826,7 +1824,8 @@ void OViewsWindow::zoom(const Fraction& _aZoom) aOut = PixelToLogic(aOut); Rectangle aRect(PixelToLogic(Point(0,0)),aOut); - Invalidate(aRect,/*INVALIDATE_NOERASE | */INVALIDATE_NOCHILDREN /*| INVALIDATE_TRANSPARENT*/); + static sal_Int32 nIn = INVALIDATE_NOCHILDREN; + Invalidate(aRect,nIn); } //---------------------------------------------------------------------------- void OViewsWindow::scrollChildren(const Point& _aThumbPos) @@ -1843,8 +1842,6 @@ void OViewsWindow::scrollChildren(const Point& _aThumbPos) SetMapMode( aMapMode ); //OWindowPositionCorrector aCorrector(this,0,-( aOld.Y() + aPosY.Y())); Scroll(0, -( aOld.Y() + aPosY.Y()),SCROLL_CHILDREN); - Resize(); - Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT); } TSectionsMap::iterator aIter = m_aSections.begin(); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 13badddbb079..3afb16b7ae0c 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -92,8 +92,12 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) aStartWidth *= m_pParent->GetMapMode().GetScaleX(); aOut.Width() -= (long)aStartWidth; + aOut.Height() = m_pParent->GetOutputSizePixel().Height(); - Rectangle aOutRect( pScrollWindow->getThumbPos(), aOut ); + Point aPos = pScrollWindow->getThumbPos(); + aPos.X() *= 0.5; + aPos.Y() *= 0.5; + Rectangle aOutRect( aPos, aOut ); aOutRect = m_pParent->PixelToLogic( aOutRect ); //Rectangle aWorkArea = m_pParent->getView()->GetWorkArea(); Point aGcc3WorkaroundTemporary; -- cgit From f7c840dba549a774ffb24c9d5910976c77f27452 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Tue, 1 Feb 2011 13:48:56 +0100 Subject: dba34d: #i116523# correct string --- dbaccess/source/ui/dlg/advancedsettings.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index d36a0b777563..151c0faf21ed 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -224,7 +224,7 @@ Size = MAP_APPFONT ( ADVANCED_PAGE_X - 12 , CHECKBOX_HEIGHT ) ; \ TabStop = TRUE ; \ HelpId = HID_DSADMIN_RESPECTRESULTSETTYPE; \ - Text [ en-US ] = "Ignore the result set type from the database driver"; \ + Text [ en-US ] = "Respect the result set type from the database driver"; \ }; -- cgit From d691fb3065d5ed29ac438a32d6cdfe4215f9e201 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Wed, 2 Feb 2011 09:43:05 +0100 Subject: dba34d: #i116214# set controldefault as string only --- dbaccess/source/ui/control/FieldDescControl.cxx | 30 +------------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index c5c2a084b64a..10ad1ef00a0a 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -1682,35 +1682,7 @@ void OFieldDescControl::SaveData( OFieldDescription* pFieldDescr ) } if ( sDefault.getLength() ) - { - sal_uInt32 nFormatKey; - try - { - if ( isTextFormat(pFieldDescr,nFormatKey) || pBoolDefault ) - { - pFieldDescr->SetControlDefault(makeAny(sDefault)); - } - else - { - try - { - double nValue = GetFormatter()->convertStringToNumber(nFormatKey,sDefault); - nValue = checkDoubleForDateFormat(nValue,nFormatKey,GetFormatter()); - pFieldDescr->SetControlDefault(makeAny(nValue)); - } - catch(const Exception&) - { - if ( sDefault.getLength() ) - pFieldDescr->SetControlDefault(makeAny(sDefault)); - else - pFieldDescr->SetControlDefault(Any()); - } - } - } - catch(const Exception&) - { - } - } // if ( sDefault.getLength() ) + pFieldDescr->SetControlDefault(makeAny(sDefault)); else pFieldDescr->SetControlDefault(Any()); -- cgit From d6421660dd2ef25c0aaebe078d24919462f67d31 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Wed, 2 Feb 2011 11:15:51 +0100 Subject: dba34d: #i116022# allow to jump between empty space for controls --- reportdesign/source/ui/misc/UITools.cxx | 11 +++--- reportdesign/source/ui/report/ViewsWindow.cxx | 50 +++++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 209017ed062e..288692a7d7de 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -885,14 +885,13 @@ SdrObject* isOver(const Rectangle& _rRect, SdrPage& _rPage, SdrView& _rView, boo OUnoObject* pObj = dynamic_cast(pObjIter); if (pObj != NULL) - { - - Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect()); - if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) - pOverlappedObj = pObjIter; + { + Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect()); + if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) + pOverlappedObj = pObjIter; + } } } - } return pOverlappedObj; } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 130acfc88592..164fb95f4d34 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -1652,6 +1652,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) { // restrict movement to work area Rectangle rWorkArea = rView.GetWorkArea(); + rWorkArea.Right()++; if ( !rWorkArea.IsEmpty() ) { @@ -1682,8 +1683,53 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) bCheck = dynamic_cast(pMark->GetMarkedSdrObj()) != NULL; } - if ( bCheck && isOver(aMarkRect,*rReportSection.getPage(),rView) ) - break; + + if ( bCheck ) + { + SdrObject* pOverlapped = isOver(aMarkRect,*rReportSection.getPage(),rView); + if ( pOverlapped ) + { + do + { + Rectangle aOver = pOverlapped->GetLastBoundRect(); + Point aPos; + if ( nCode == KEY_UP ) + { + aPos.X() = aMarkRect.Left(); + aPos.Y() = aOver.Top() - aMarkRect.getHeight(); + nY += (aPos.Y() - aMarkRect.Top()); + } + else if ( nCode == KEY_DOWN ) + { + aPos.X() = aMarkRect.Left(); + aPos.Y() = aOver.Bottom(); + nY += (aPos.Y() - aMarkRect.Top()); + } + else if ( nCode == KEY_LEFT ) + { + aPos.X() = aOver.Left() - aMarkRect.getWidth(); + aPos.Y() = aMarkRect.Top(); + nX += (aPos.X() - aMarkRect.Left()); + } + else if ( nCode == KEY_RIGHT ) + { + aPos.X() = aOver.Right(); + aPos.Y() = aMarkRect.Top(); + nX += (aPos.X() - aMarkRect.Left()); + } + + aMarkRect.SetPos(aPos); + if ( !rWorkArea.IsInside( aMarkRect ) ) + { + break; + } + pOverlapped = isOver(aMarkRect,*rReportSection.getPage(),rView); + } + while(pOverlapped != NULL); + if (pOverlapped != NULL) + break; + } + } } if ( nX != 0 || nY != 0 ) -- cgit From ac4b181239597f70edfd49bf684c1e16256d71ab Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Thu, 3 Feb 2011 11:58:53 +0100 Subject: dba34d: #i102719# do not allow charts to have negative positions --- reportdesign/source/core/sdr/RptObject.cxx | 41 ++++++++++++++++------ .../source/ui/inspection/GeometryHandler.cxx | 8 +++-- reportdesign/source/ui/misc/UITools.cxx | 12 +++---- reportdesign/source/ui/report/ViewsWindow.cxx | 8 ++--- reportdesign/source/ui/report/dlgedfunc.cxx | 2 +- 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 7d1cdbc6db30..272f0d6f4ecd 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -765,14 +765,7 @@ void OUnoObject::NbcMove( const Size& rSize ) } if (bPositionFixed) { - // OReportModel* pRptModel = static_cast(GetModel()); - // if ( pRptModel ) - // { - // if (! pRptModel->GetUndoEnv().IsLocked()) - // { - GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); - // } - // } + GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); } // set geometry properties SetPropsFromRect(GetLogicRect()); @@ -1040,14 +1033,40 @@ void OOle2Obj::NbcMove( const Size& rSize ) // stop listening OObjectBase::EndListening(sal_False); + bool bPositionFixed = false; + Size aUndoSize(0,0); + bool bUndoMode = false; if ( m_xReportComponent.is() ) { OReportModel* pRptModel = static_cast(GetModel()); + if (pRptModel->GetUndoEnv().IsUndoMode()) + { + // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode + bUndoMode = true; + } OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); - m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.A()); - m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.B()); - } + // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point? + int nNewX = m_xReportComponent->getPositionX() + rSize.A(); + // can this hinder us to set components outside the area? + // if (nNewX < 0) + // { + // nNewX = 0; + // } + m_xReportComponent->setPositionX(nNewX); + int nNewY = m_xReportComponent->getPositionY() + rSize.B(); + if (nNewY < 0 && !bUndoMode) + { + aUndoSize.B() = abs(nNewY); + bPositionFixed = true; + nNewY = 0; + } + m_xReportComponent->setPositionY(nNewY); + } + if (bPositionFixed) + { + GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); + } // set geometry properties SetPropsFromRect(GetLogicRect()); diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 084bd77f8d5b..af953a457edb 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -866,7 +866,10 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const uno::Reference< inspection::XNumericControl > xNumericControl(aOut.Control,uno::UNO_QUERY); xNumericControl->setDecimalDigits( 2 ); xNumericControl->setValueUnit( util::MeasureUnit::MM_100TH ); - xNumericControl->setMinValue(beans::Optional(sal_True,0.0)); + uno::Reference< drawing::XShapeDescriptor> xShapeDesc(m_xReportComponent,uno::UNO_QUERY); + bool bSetMin = !xShapeDesc.is() || xShapeDesc->getShapeType() != ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")); + if ( bSetMin ) + xNumericControl->setMinValue(beans::Optional(sal_True,0.0)); if ( nDisplayUnit != -1 ) xNumericControl->setDisplayUnit( nDisplayUnit ); uno::Reference< report::XReportComponent> xComp(m_xReportComponent,uno::UNO_QUERY); @@ -884,7 +887,8 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const case PROPERTY_ID_POSITIONX: case PROPERTY_ID_POSITIONY: case PROPERTY_ID_WIDTH: - xNumericControl->setMinValue(beans::Optional(sal_True,0.0)); + if ( bSetMin ) + xNumericControl->setMinValue(beans::Optional(sal_True,0.0)); xNumericControl->setMaxValue(beans::Optional(sal_True,double(aSize.Width - nLeftMargin - nRightMargin))); if ( PROPERTY_ID_WIDTH == nId ) { diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 288692a7d7de..fc553667341f 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -876,15 +876,14 @@ SdrObject* isOver(const Rectangle& _rRect, SdrPage& _rPage, SdrView& _rView, boo { if ( _pIgnore != pObjIter && (_bAllObjects || !_rView.IsObjMarked(pObjIter)) - && dynamic_cast(pObjIter) != NULL ) + && (dynamic_cast(pObjIter) != NULL || dynamic_cast(pObjIter) != NULL)) { if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == OBJ_CUSTOMSHAPE) { continue; } - OUnoObject* pObj = dynamic_cast(pObjIter); - if (pObj != NULL) + if (dynamic_cast(pObjIter) != NULL || dynamic_cast(pObjIter) != NULL) { Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect()); if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) @@ -922,7 +921,7 @@ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _ } if ( (_bAllObjects || !_rView.IsObjMarked(pObjIter)) - && dynamic_cast(pObjIter) != NULL ) + && (dynamic_cast(pObjIter) != NULL || dynamic_cast(pObjIter) != NULL) ) { Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect()); if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) @@ -936,10 +935,9 @@ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _ SdrObject* isOver(SdrObject* _pObj,SdrPage& _rPage,SdrView& _rView,bool _bUnMarkedObjects) { SdrObject* pOverlappedObj = NULL; - OUnoObject* pUnoObj = dynamic_cast(_pObj); - if ( pUnoObj ) // this doesn't need to be done for shapes + if (dynamic_cast(_pObj) != NULL || dynamic_cast(_pObj) != NULL) // this doesn't need to be done for shapes { - Rectangle aRect = pUnoObj->GetCurrentBoundRect(); + Rectangle aRect = _pObj->GetCurrentBoundRect(); pOverlappedObj = isOver(aRect,_rPage,_rView,_bUnMarkedObjects,_pObj); } return pOverlappedObj; diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 164fb95f4d34..d092d43d08fd 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -85,7 +85,7 @@ bool lcl_getNewRectSize(const Rectangle& _aObjRect,long& _nXMov, long& _nYMov,Sd aNewRect.Move(_nXMov,_nYMov); break; } - if ( dynamic_cast(_pObj) ) + if (dynamic_cast(_pObj) != NULL || dynamic_cast(_pObj) != NULL) { pOverlappedObj = isOver(aNewRect,*_pObj->GetPage(),*_pView,true,_pObj); if ( pOverlappedObj && _pObj != pOverlappedObj ) @@ -865,7 +865,7 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli TRectangleMap::iterator aInterSectRectIter = aSortRectangles.begin(); for (; aInterSectRectIter != aRectIter; ++aInterSectRectIter) { - if ( pView == aInterSectRectIter->second.second && dynamic_cast(aInterSectRectIter->second.first) ) + if ( pView == aInterSectRectIter->second.second && (dynamic_cast(aInterSectRectIter->second.first) || dynamic_cast(aInterSectRectIter->second.first))) { SdrObject* pPreviousObj = aInterSectRectIter->second.first; Rectangle aIntersectRect = aTest.GetIntersection(_bBoundRects ? pPreviousObj->GetCurrentBoundRect() : pPreviousObj->GetSnapRect()); @@ -1680,7 +1680,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i ) { SdrMark* pMark = rMarkList.GetMark(i); - bCheck = dynamic_cast(pMark->GetMarkedSdrObj()) != NULL; + bCheck = dynamic_cast(pMark->GetMarkedSdrObj()) != NULL|| dynamic_cast(pMark->GetMarkedSdrObj()); } @@ -1768,7 +1768,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i ) { SdrMark* pMark = rMarkList.GetMark(i); - bCheck = dynamic_cast(pMark->GetMarkedSdrObj()) != NULL; + bCheck = dynamic_cast(pMark->GetMarkedSdrObj()) != NULL || dynamic_cast(pMark->GetMarkedSdrObj()) != NULL; if ( bCheck ) aNewRect.Union(pMark->GetMarkedSdrObj()->GetLastBoundRect()); } diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 3afb16b7ae0c..efc19451725a 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -622,7 +622,7 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt) while( (pObjIter = aIter.Next()) != NULL && !bIsSetPoint) { if ( m_rView.IsObjMarked(pObjIter) - && dynamic_cast(pObjIter) != NULL ) + && (dynamic_cast(pObjIter) != NULL || dynamic_cast(pObjIter) != NULL) ) { Rectangle aNewRect = pObjIter->GetLastBoundRect(); long nDx = rDragStat.IsHorFixed() ? 0 : rDragStat.GetDX(); -- cgit From e239431ec10da5aab0a3c568bbc47ecd2d4b5b1d Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Thu, 3 Feb 2011 11:59:22 +0100 Subject: dba34d: remove unused code --- dbaccess/source/ui/browser/brwctrlr.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index fdb225d620c9..e8a1b84a5d1f 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -736,7 +736,7 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r const Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY); if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING))) xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser; - +#if 0 { const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY ); const Reference< XSingleSelectQueryAnalyzer > xAnalyzer( xRowSetProps->getPropertyValue( PROPERTY_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY ); @@ -756,6 +756,7 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r } } } +#endif Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY ); if ( xWarnings.is() ) -- cgit From 933795c27b41b3f8f66725a6d814d5fc608a8359 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Thu, 3 Feb 2011 13:07:12 +0100 Subject: dba34d: store max row scan --- dbaccess/source/ui/dlg/DbAdminImpl.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index cbcd504c5cac..2f770016c08f 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -205,6 +205,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SOCKET, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalSocket" ) ) ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_NAMED_PIPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedPipe" ) ) ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_RESPECTRESULTSETTYPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RespectDriverResultSetType" ) ) ) ); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_MAX_ROW_SCAN, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxRowScan" ) ) ) ); // special settings for adabas m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SHUTSERVICE, ::rtl::OUString::createFromAscii("ShutdownDatabase"))); -- cgit From dd096e1000bda039357dd9206a59489f94e56152 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 17 Feb 2011 08:41:35 +0100 Subject: dba34d: post-rebase fixes --- reportdesign/source/ui/report/EndMarker.cxx | 4 ++-- reportdesign/source/ui/report/ReportSection.cxx | 4 ++-- reportdesign/source/ui/report/SectionWindow.cxx | 4 ++-- reportdesign/source/ui/report/StartMarker.cxx | 4 ++-- reportdesign/source/ui/report/ViewsWindow.cxx | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index 7a5e47fef9b7..c8c508d3ddaa 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -88,9 +88,9 @@ void OEndMarker::Paint( const Rectangle& /*rRect*/ ) // ----------------------------------------------------------------------- void OEndMarker::ImplInitSettings() { - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); SetBackground( Wallpaper( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor) ); SetFillColor( Application::GetSettings().GetStyleSettings().GetShadowColor() ); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 9ba3d888be5a..020f7e24ca22 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -105,8 +105,8 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re SetHelpId(HID_REPORTSECTION); SetMapMode( MapMode( MAP_100TH_MM ) ); SetParentClipMode( PARENTCLIPMODE_CLIP ); - EnableChildTransparentMode( FALSE ); - SetPaintTransparent( FALSE ); + EnableChildTransparentMode( sal_False ); + SetPaintTransparent( sal_False ); try { diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 7d5a7f4549e0..ab08c11e0753 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -211,9 +211,9 @@ void OSectionWindow::ImplInitSettings() static bool t = false; if ( t ) { - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); } SetBackground( ); } diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index 289ba8c22fe6..14e884b04015 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -71,7 +71,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol initDefaultNodeImages(); ImplInitSettings(); m_aText.SetHelpId(HID_RPT_START_TITLE); - m_aText.SetPaintTransparent(TRUE); + m_aText.SetPaintTransparent(sal_True); m_aImage.SetHelpId(HID_RPT_START_IMAGE); m_aText.Show(); m_aImage.Show(); @@ -84,7 +84,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol m_aVRuler.SetMargin2(); const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); SetPaintTransparent( sal_True ); } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 2410e317c663..f3706fa786bd 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -294,7 +294,7 @@ void OViewsWindow::Paint( const Rectangle& rRect ) //------------------------------------------------------------------------------ void OViewsWindow::ImplInitSettings() { - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetBackground( ); SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); -- cgit From 61d2dfb35bb6434551bdefb17730ae65ae78365e Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 22 Feb 2011 10:00:34 +0100 Subject: dba34d: replace tools types --- reportdesign/source/ui/report/DesignView.cxx | 1 + reportdesign/source/ui/report/EndMarker.cxx | 4 ++-- reportdesign/source/ui/report/ReportSection.cxx | 4 ++-- reportdesign/source/ui/report/ReportWindow.cxx | 1 + reportdesign/source/ui/report/SectionWindow.cxx | 4 ++-- reportdesign/source/ui/report/StartMarker.cxx | 5 +++-- reportdesign/source/ui/report/ViewsWindow.cxx | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index f806d64112cd..48ec9dc626ca 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -494,6 +494,7 @@ IMPL_LINK( ODesignView, SplitHdl, void*, ) if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow.getMaxMarkerWidth(sal_False) ) { long nOldSplitPos = getController().getSplitPos(); + (void)nOldSplitPos; getController().setSplitPos(nTest); } diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index 7a5e47fef9b7..c8c508d3ddaa 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -88,9 +88,9 @@ void OEndMarker::Paint( const Rectangle& /*rRect*/ ) // ----------------------------------------------------------------------- void OEndMarker::ImplInitSettings() { - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); SetBackground( Wallpaper( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor) ); SetFillColor( Application::GetSettings().GetStyleSettings().GetShadowColor() ); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 9ba3d888be5a..020f7e24ca22 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -105,8 +105,8 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re SetHelpId(HID_REPORTSECTION); SetMapMode( MapMode( MAP_100TH_MM ) ); SetParentClipMode( PARENTCLIPMODE_CLIP ); - EnableChildTransparentMode( FALSE ); - SetPaintTransparent( FALSE ); + EnableChildTransparentMode( sal_False ); + SetPaintTransparent( sal_False ); try { diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 628e0028f0d2..35ef356005f5 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -446,6 +446,7 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const // ----------------------------------------------------------------------------- void OReportWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException) { + (void)_rEvent; Resize(); m_aViewsWindow.Resize(); static sal_Int32 nIn = INVALIDATE_TRANSPARENT; diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 7d5a7f4549e0..ab08c11e0753 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -211,9 +211,9 @@ void OSectionWindow::ImplInitSettings() static bool t = false; if ( t ) { - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); } SetBackground( ); } diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index 289ba8c22fe6..8e00e6654f98 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -71,7 +71,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol initDefaultNodeImages(); ImplInitSettings(); m_aText.SetHelpId(HID_RPT_START_TITLE); - m_aText.SetPaintTransparent(TRUE); + m_aText.SetPaintTransparent(sal_True); m_aImage.SetHelpId(HID_RPT_START_IMAGE); m_aText.Show(); m_aImage.Show(); @@ -84,7 +84,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol m_aVRuler.SetMargin2(); const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); SetPaintTransparent( sal_True ); } @@ -110,6 +110,7 @@ sal_Int32 OStartMarker::getMinHeight() const // ----------------------------------------------------------------------------- void OStartMarker::Paint( const Rectangle& rRect ) { + (void)rRect; //SetUpdateMode(sal_False); Size aSize = GetOutputSizePixel(); long nSize = aSize.Width(); diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 2410e317c663..f3706fa786bd 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -294,7 +294,7 @@ void OViewsWindow::Paint( const Rectangle& rRect ) //------------------------------------------------------------------------------ void OViewsWindow::ImplInitSettings() { - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetBackground( ); SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); -- cgit From 0ce16968e3dc0893462944b828195fbf14acbe9f Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 23 Feb 2011 09:40:45 +0100 Subject: dba34c: #i117046# check if query exists --- dbaccess/qa/complex/dbaccess/Query.java | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/dbaccess/qa/complex/dbaccess/Query.java b/dbaccess/qa/complex/dbaccess/Query.java index e78f6859fb88..2ea435bcd10c 100644 --- a/dbaccess/qa/complex/dbaccess/Query.java +++ b/dbaccess/qa/complex/dbaccess/Query.java @@ -90,23 +90,26 @@ public class Query extends TestCase { for ( int i = 0; i < queryNames.length; ++i ) { - final XPropertySet query = UnoRuntime.queryInterface( - XPropertySet.class, queries.getByName( queryNames[i] ) ); + if (queries.hasByName(queryNames[i])) + { + final XPropertySet query = UnoRuntime.queryInterface( + XPropertySet.class, queries.getByName( queryNames[i] ) ); - final XColumnsSupplier suppCols = UnoRuntime.queryInterface( - XColumnsSupplier.class, query); - final XIndexAccess columns = UnoRuntime.queryInterface( - XIndexAccess.class, suppCols.getColumns()); + final XColumnsSupplier suppCols = UnoRuntime.queryInterface( + XColumnsSupplier.class, query); + final XIndexAccess columns = UnoRuntime.queryInterface( + XIndexAccess.class, suppCols.getColumns()); - // check whether the columns supplied by the query match what we expected - assertTrue( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"", - columns.getCount() == expectedColumnNames[i].length ); - for ( int col = 0; col < columns.getCount(); ++col ) - { - final XNamed columnName = UnoRuntime.queryInterface( - XNamed.class, columns.getByIndex(col) ); - assertTrue( "column no. " + col + " of query \"" + queryNames[i] + "\" not matching", - columnName.getName().equals( expectedColumnNames[i][col] ) ); + // check whether the columns supplied by the query match what we expected + assertTrue( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"", + columns.getCount() == expectedColumnNames[i].length ); + for ( int col = 0; col < columns.getCount(); ++col ) + { + final XNamed columnName = UnoRuntime.queryInterface( + XNamed.class, columns.getByIndex(col) ); + assertTrue( "column no. " + col + " of query \"" + queryNames[i] + "\" not matching", + columnName.getName().equals( expectedColumnNames[i][col] ) ); + } } } } -- cgit From 9a2ce2d264be1ee44ac8406b39e821f7752d6947 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 23 Feb 2011 11:36:11 +0100 Subject: dba34c: #i117043# fix modified state of rowset --- dbaccess/qa/complex/dbaccess/Query.java | 16 +++--- dbaccess/qa/complex/dbaccess/RowSet.java | 4 ++ dbaccess/source/core/api/RowSet.cxx | 90 +++++++++++++++++--------------- dbaccess/source/core/api/RowSetBase.cxx | 9 +++- dbaccess/source/core/api/RowSetBase.hxx | 3 +- dbaccess/source/core/api/RowSetCache.cxx | 64 ++++++++++++++--------- 6 files changed, 110 insertions(+), 76 deletions(-) diff --git a/dbaccess/qa/complex/dbaccess/Query.java b/dbaccess/qa/complex/dbaccess/Query.java index 2ea435bcd10c..40af4387bb5c 100644 --- a/dbaccess/qa/complex/dbaccess/Query.java +++ b/dbaccess/qa/complex/dbaccess/Query.java @@ -40,7 +40,8 @@ import org.junit.Test; import static org.junit.Assert.*; // ------------------------------------------ -public class Query extends TestCase { +public class Query extends TestCase +{ connectivity.tools.HsqlDatabase m_database; @@ -49,17 +50,17 @@ public class Query extends TestCase { { try { - if ( m_database == null ) + if (m_database == null) { - final CRMDatabase database = new CRMDatabase( getMSF(), false ); + final CRMDatabase database = new CRMDatabase(getMSF(), false); m_database = database.getDatabase(); } } - catch( Exception e ) + catch (Exception e) { - System.out.println( "could not create the test case, error message:\n" + e.getMessage() ); - e.printStackTrace( System.err ); - fail( "failed to created the test case"); + System.out.println("could not create the test case, error message:\n" + e.getMessage()); + e.printStackTrace(System.err); + fail("failed to created the test case"); } } @@ -68,7 +69,6 @@ public class Query extends TestCase { // { // return (XMultiServiceFactory)param.getMSF(); // } - // -------------------------------------------------------------------------------------------------------- @Test public void testQueryColumns() diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java index 7716f7f30512..921aff2046ef 100644 --- a/dbaccess/qa/complex/dbaccess/RowSet.java +++ b/dbaccess/qa/complex/dbaccess/RowSet.java @@ -434,6 +434,10 @@ public class RowSet extends TestCase updRow.updateString(2, TEST21); testCursorMove(m_resultSet, cResSet.getMethod(NEXT, (Class[]) null), pRow, moves, null); + moves[RowSetEventListener.IS_MODIFIED] = false; + updRow.updateString(2, m_row.getString(2)); + testCursorMove(m_resultSet, cResSet.getMethod(NEXT, (Class[]) null), pRow, moves, null); + moves[RowSetEventListener.IS_MODIFIED] = false; final Class cupd = Class.forName("com.sun.star.sdbc.XResultSetUpdate"); final XResultSetUpdate upd = UnoRuntime.queryInterface( XResultSetUpdate.class, m_resultSet ); diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 4118794d5b52..38220bcade48 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -595,6 +595,7 @@ void ORowSet::freeResources( bool _bComplete ) m_bAfterLast = sal_False; m_bNew = sal_False; m_bModified = sal_False; + m_bIsInsertRow = sal_False; m_bLastKnownRowCountFinal = sal_False; m_nLastKnownRowCount = 0; if ( m_aOldRow.isValid() ) @@ -707,6 +708,7 @@ void ORowSet::updateValue(sal_Int32 columnIndex,const ORowSetValue& x) ORowSetValueVector::Vector& rRow = ((*m_aCurrentRow)->get()); ORowSetNotifier aNotify(this,rRow); m_pCache->updateValue(columnIndex,x,rRow,aNotify.getChangedColumns()); + m_bModified = m_bModified || !aNotify.getChangedColumns().empty(); aNotify.firePropertyChange(); } // ------------------------------------------------------------------------- @@ -722,6 +724,7 @@ void SAL_CALL ORowSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, R ORowSetValueVector::Vector& rRow = ((*m_aCurrentRow)->get()); ORowSetNotifier aNotify(this,rRow); m_pCache->updateNull(columnIndex,rRow,aNotify.getChangedColumns()); + m_bModified = m_bModified || !aNotify.getChangedColumns().empty(); aNotify.firePropertyChange(); } // ------------------------------------------------------------------------- @@ -819,6 +822,7 @@ void SAL_CALL ORowSet::updateCharacterStream( sal_Int32 columnIndex, const Refer ORowSetValueVector::Vector& rRow = ((*m_aCurrentRow)->get()); ORowSetNotifier aNotify(this,rRow); m_pCache->updateCharacterStream(columnIndex,x,length,rRow,aNotify.getChangedColumns()); + m_bModified = m_bModified || !aNotify.getChangedColumns().empty(); aNotify.firePropertyChange(); } // ------------------------------------------------------------------------- @@ -862,6 +866,7 @@ void SAL_CALL ORowSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw ORowSetValueVector::Vector& rRow = ((*m_aCurrentRow)->get()); ORowSetNotifier aNotify(this,rRow); m_pCache->updateObject(columnIndex,aNewValue,rRow,aNotify.getChangedColumns()); + m_bModified = m_bModified || !aNotify.getChangedColumns().empty(); aNotify.firePropertyChange(); } } @@ -875,6 +880,7 @@ void SAL_CALL ORowSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, ORowSetValueVector::Vector& rRow = ((*m_aCurrentRow)->get()); ORowSetNotifier aNotify(this,rRow); m_pCache->updateNumericObject(columnIndex,x,scale,rRow,aNotify.getChangedColumns()); + m_bModified = m_bModified || !aNotify.getChangedColumns().empty(); aNotify.firePropertyChange(); } // ------------------------------------------------------------------------- @@ -892,52 +898,49 @@ void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException) if(!m_pCache || !m_bNew || !m_bModified || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) throwFunctionSequenceException(*this); - if(m_bModified) - { - // remember old value for fire - sal_Bool bOld = m_bNew; + // remember old value for fire + sal_Bool bOld = m_bNew; - ORowSetRow aOldValues; - if ( !m_aCurrentRow.isNull() ) - aOldValues = new ORowSetValueVector( m_aCurrentRow->getBody() ); - Sequence aChangedBookmarks; - RowsChangeEvent aEvt(*this,RowChangeAction::INSERT,1,aChangedBookmarks); - notifyAllListenersRowBeforeChange(aGuard,aEvt); + ORowSetRow aOldValues; + if ( !m_aCurrentRow.isNull() ) + aOldValues = new ORowSetValueVector( m_aCurrentRow->getBody() ); + Sequence aChangedBookmarks; + RowsChangeEvent aEvt(*this,RowChangeAction::INSERT,1,aChangedBookmarks); + notifyAllListenersRowBeforeChange(aGuard,aEvt); - ::std::vector< Any > aBookmarks; - sal_Bool bInserted = m_pCache->insertRow(aBookmarks); + ::std::vector< Any > aBookmarks; + sal_Bool bInserted = m_pCache->insertRow(aBookmarks); - // make sure that our row is set to the new inserted row before clearing the insert flags in the cache - m_pCache->resetInsertRow(bInserted); + // make sure that our row is set to the new inserted row before clearing the insert flags in the cache + m_pCache->resetInsertRow(bInserted); - // notification order - // - column values - setCurrentRow( sal_False, sal_True, aOldValues, aGuard ); // we don't move here + // notification order + // - column values + setCurrentRow( sal_False, sal_True, aOldValues, aGuard ); // we don't move here - // read-only flag restored - impl_restoreDataColumnsWriteable_throw(); + // read-only flag restored + impl_restoreDataColumnsWriteable_throw(); - // - rowChanged - notifyAllListenersRowChanged(aGuard,aEvt); + // - rowChanged + notifyAllListenersRowChanged(aGuard,aEvt); - if ( !aBookmarks.empty() ) - { - RowsChangeEvent aUpEvt(*this,RowChangeAction::UPDATE,aBookmarks.size(),Sequence(&(*aBookmarks.begin()),aBookmarks.size())); - notifyAllListenersRowChanged(aGuard,aUpEvt); - } + if ( !aBookmarks.empty() ) + { + RowsChangeEvent aUpEvt(*this,RowChangeAction::UPDATE,aBookmarks.size(),Sequence(&(*aBookmarks.begin()),aBookmarks.size())); + notifyAllListenersRowChanged(aGuard,aUpEvt); + } - // - IsModified - if(!m_bModified) - fireProperty(PROPERTY_ID_ISMODIFIED,sal_False,sal_True); - OSL_ENSURE( !m_bModified, "ORowSet::insertRow: just updated, but _still_ modified?" ); + // - IsModified + if(!m_bModified) + fireProperty(PROPERTY_ID_ISMODIFIED,sal_False,sal_True); + OSL_ENSURE( !m_bModified, "ORowSet::insertRow: just updated, but _still_ modified?" ); - // - IsNew - if(m_bNew != bOld) - fireProperty(PROPERTY_ID_ISNEW,m_bNew,bOld); + // - IsNew + if(m_bNew != bOld) + fireProperty(PROPERTY_ID_ISNEW,m_bNew,bOld); - // - RowCount/IsRowCountFinal - fireRowcount(); - } + // - RowCount/IsRowCountFinal + fireRowcount(); } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL ORowSet::getRow( ) throw(SQLException, RuntimeException) @@ -946,7 +949,7 @@ sal_Int32 SAL_CALL ORowSet::getRow( ) throw(SQLException, RuntimeException) checkCache(); // check if we are inserting a row - return (m_pCache && ( m_pCache->m_bNew || m_bModified )) ? 0 : ORowSetBase::getRow(); + return (m_pCache && isInsertRow()) ? 0 : ORowSetBase::getRow(); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) @@ -975,6 +978,7 @@ void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) aEvt.Rows += aBookmarks.size(); m_aBookmark = m_pCache->getBookmark(); m_aCurrentRow = m_pCache->m_aMatrixIter; + m_bIsInsertRow = sal_False; if ( m_pCache->m_aMatrixIter != m_pCache->getEnd() && (*m_pCache->m_aMatrixIter).isValid() ) { if ( m_pCache->isResultSetChanged() ) @@ -1085,6 +1089,7 @@ void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQL m_aBookmark = m_pCache->getBookmark(); m_aCurrentRow = m_pCache->m_aMatrixIter; + m_bIsInsertRow = sal_False; m_aCurrentRow.setBookmark(m_aBookmark); // notification order @@ -1219,6 +1224,7 @@ void SAL_CALL ORowSet::moveToInsertRow( ) throw(SQLException, RuntimeException) m_pCache->moveToInsertRow(); m_aCurrentRow = m_pCache->m_aInsertRow; + m_bIsInsertRow = sal_True; // set read-only flag to false impl_setDataColumnsWriteable_throw(); @@ -1829,6 +1835,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi } m_pCache->setFetchSize(m_nFetchSize); m_aCurrentRow = m_pCache->createIterator(this); + m_bIsInsertRow = sal_False; m_aOldRow = m_pCache->registerOldRow(); } @@ -2716,6 +2723,7 @@ void ORowSet::doCancelModification( ) m_pCache->cancelRowModification(); } m_bModified = sal_False; + m_bIsInsertRow = sal_False; } // ----------------------------------------------------------------------------- @@ -2739,14 +2747,12 @@ sal_Bool ORowSet::isNew( ) // ----------------------------------------------------------------------------- void ORowSet::checkUpdateIterator() { - if(!m_bModified && !m_bNew) + if(!m_bIsInsertRow) { m_pCache->setUpdateIterator(m_aCurrentRow); m_aCurrentRow = m_pCache->m_aInsertRow; - m_bModified = sal_True; - } // if(!m_bModified && !m_bNew) - else if ( m_bNew ) // here we are modifing a value - m_bModified = sal_True; + m_bIsInsertRow = sal_True; + } } // ----------------------------------------------------------------------------- void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 4cb218d628b6..b8f489d65728 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -112,6 +112,7 @@ ORowSetBase::ORowSetBase( const ::comphelper::ComponentContext& _rContext, ::cpp ,m_bIgnoreResult(sal_False) ,m_bBeforeFirst(sal_True) // changed from sal_False ,m_bAfterLast(sal_False) + ,m_bIsInsertRow(sal_False) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::ORowSetBase" ); DBG_CTOR(ORowSetBase,NULL); @@ -257,6 +258,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) // currentrow is null when the clone moves the window positionCache( MOVE_NONE_REFRESH_ONLY ); m_aCurrentRow = m_pCache->m_aMatrixIter; + m_bIsInsertRow = sal_False; OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getValue: we don't stand on a valid row! Row is null."); bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->isValid() ); @@ -398,6 +400,7 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getBinaryS { positionCache( MOVE_NONE_REFRESH_ONLY ); m_aCurrentRow = m_pCache->m_aMatrixIter; + m_bIsInsertRow = sal_False; OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getBinaryStream: we don't stand on a valid row! Row is null."); bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->isValid() ); @@ -1121,6 +1124,7 @@ void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const OR m_aBookmark = m_pCache->getBookmark(); OSL_ENSURE(m_aBookmark.hasValue(),"Bookmark has no value!"); m_aCurrentRow = m_pCache->m_aMatrixIter; + m_bIsInsertRow = sal_False; OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is null!"); m_aCurrentRow.setBookmark(m_aBookmark); OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd(),"Position of matrix iterator isn't valid!"); @@ -1136,6 +1140,7 @@ void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const OR #endif OSL_ENSURE(nOldRow == nNewRow,"Old position is not equal to new postion"); m_aCurrentRow = m_pCache->m_aMatrixIter; + m_bIsInsertRow = sal_False; OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is nul after positionCache!"); #if OSL_DEBUG_LEVEL > 0 ORowSetRow rRow = (*m_aCurrentRow); @@ -1147,6 +1152,7 @@ void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const OR { positionCache( MOVE_NONE_REFRESH_ONLY ); m_aCurrentRow = m_pCache->m_aMatrixIter; + m_bIsInsertRow = sal_False; OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is nul after positionCache!"); } } @@ -1574,7 +1580,8 @@ void ORowSetNotifier::firePropertyChange() { m_pRowSet->firePropertyChange((*aIter)-1 ,m_pImpl->aRow[(*aIter)-1], ORowSetBase::GrantNotifierAccess()); } - m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,sal_True,sal_False, ORowSetBase::GrantNotifierAccess()); + if ( !m_pImpl->aChangedColumns.empty() ) + m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,sal_True,sal_False, ORowSetBase::GrantNotifierAccess()); } } } // namespace dbaccess diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx index 9a7e9182e1d0..83b4d2fb74ef 100644 --- a/dbaccess/source/core/api/RowSetBase.hxx +++ b/dbaccess/source/core/api/RowSetBase.hxx @@ -158,6 +158,7 @@ namespace dbaccess sal_Bool m_bIgnoreResult ; sal_Bool m_bBeforeFirst : 1; sal_Bool m_bAfterLast : 1; + sal_Bool m_bIsInsertRow : 1; protected: ORowSetBase( @@ -383,7 +384,7 @@ namespace dbaccess inline sal_Bool isModification( const GrantNotifierAccess& ) { return isModification(); } inline sal_Bool isModified( const GrantNotifierAccess& ) { return isModified(); } inline sal_Bool isNew( const GrantNotifierAccess& ) { return isNew(); } - inline sal_Bool isInsertRow() { return isNew() || isModified(); } + inline sal_Bool isInsertRow() { return m_bIsInsertRow; } // isNew() || isModified(); } inline void fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _bOld, const GrantNotifierAccess& ) { fireProperty( _nProperty, _bNew, _bOld ); diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 2d4355edcaef..6f3ec5e53265 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -555,13 +555,16 @@ void ORowSetCache::updateNull(sal_Int32 columnIndex,ORowSetValueVector::Vector& checkUpdateConditions(columnIndex); ORowSetValueVector::Vector& rInsert = ((*m_aInsertRow)->get()); - rInsert[columnIndex].setBound(sal_True); - rInsert[columnIndex].setNull(); - rInsert[columnIndex].setModified(); - io_aRow[columnIndex].setNull(); + if ( !rInsert[columnIndex].isNull() ) + { + rInsert[columnIndex].setBound(sal_True); + rInsert[columnIndex].setNull(); + rInsert[columnIndex].setModified(); + io_aRow[columnIndex].setNull(); - m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); - impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); + impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + } } // ----------------------------------------------------------------------------- void ORowSetCache::updateValue(sal_Int32 columnIndex,const ORowSetValue& x @@ -572,13 +575,16 @@ void ORowSetCache::updateValue(sal_Int32 columnIndex,const ORowSetValue& x checkUpdateConditions(columnIndex); ORowSetValueVector::Vector& rInsert = ((*m_aInsertRow)->get()); - rInsert[columnIndex].setBound(sal_True); - rInsert[columnIndex] = x; - rInsert[columnIndex].setModified(); - io_aRow[columnIndex] = rInsert[columnIndex]; + if ( rInsert[columnIndex] != x ) + { + rInsert[columnIndex].setBound(sal_True); + rInsert[columnIndex] = x; + rInsert[columnIndex].setModified(); + io_aRow[columnIndex] = rInsert[columnIndex]; - m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); - impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); + impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + } } // ------------------------------------------------------------------------- void ORowSetCache::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x @@ -610,13 +616,18 @@ void ORowSetCache::updateObject( sal_Int32 columnIndex, const Any& x checkUpdateConditions(columnIndex); ORowSetValueVector::Vector& rInsert = ((*m_aInsertRow)->get()); - rInsert[columnIndex].setBound(sal_True); - rInsert[columnIndex] = x; - rInsert[columnIndex].setModified(); - io_aRow[columnIndex] = rInsert[columnIndex]; + ORowSetValue aTemp; + aTemp.fill(x); + if ( rInsert[columnIndex] != aTemp ) + { + rInsert[columnIndex].setBound(sal_True); + rInsert[columnIndex] = aTemp; + rInsert[columnIndex].setModified(); + io_aRow[columnIndex] = rInsert[columnIndex]; - m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); - impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); + impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + } } // ------------------------------------------------------------------------- void ORowSetCache::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 /*scale*/ @@ -627,13 +638,18 @@ void ORowSetCache::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal checkUpdateConditions(columnIndex); ORowSetValueVector::Vector& rInsert = ((*m_aInsertRow)->get()); - rInsert[columnIndex].setBound(sal_True); - rInsert[columnIndex] = x; - rInsert[columnIndex].setModified(); - io_aRow[columnIndex] = rInsert[columnIndex]; + ORowSetValue aTemp; + aTemp.fill(x); + if ( rInsert[columnIndex] != aTemp ) + { + rInsert[columnIndex].setBound(sal_True); + rInsert[columnIndex] = aTemp; + rInsert[columnIndex].setModified(); + io_aRow[columnIndex] = rInsert[columnIndex]; - m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); - impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); + impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); + } } // ------------------------------------------------------------------------- // XResultSet -- cgit From c38ac7124a3a0f55b155569b8574f1ba4dc734ab Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 10 Mar 2011 10:59:14 +0100 Subject: dba34c: release param --- dbaccess/source/ui/browser/genericcontroller.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 200c87a729b3..99208c0de2ae 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -965,6 +965,9 @@ void OGenericUnoController::disposing() m_xMasterDispatcher = NULL; m_xSlaveDispatcher = NULL; m_xServiceFactory = NULL; + m_xTitleHelper.clear(); + m_xUrlTransformer.clear(); + m_aInitParameters.clear(); } // ----------------------------------------------------------------------------- -- cgit From e76d571936cb4ba720070a5fbb1880200e242a2b Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Mon, 14 Mar 2011 11:06:22 +0100 Subject: dba34d: #i116774# set date descriptions --- dbaccess/source/core/misc/DatabaseDataProvider.cxx | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index ab0ccc737a11..574139b78f76 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,7 @@ #include #include #include +#include #include #include @@ -781,6 +783,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat } ::std::vector< ::rtl::OUString > aRowLabels; + ::std::vector< double > aDateRowLabels; ::std::vector< ::std::vector< double > > aDataValues; sal_Int32 nRowCount = 0; ::connectivity::ORowSetValue aValue; @@ -789,7 +792,16 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat ++nRowCount; aValue.fill( aColumns[0].nResultSetPosition, aColumns[0].nDataType, xRow ); - aRowLabels.push_back( aValue.getString() ); + switch(aColumns[0].nDataType) + { + case sdbc::DataType::DATE: + case sdbc::DataType::TIMESTAMP: + aDateRowLabels.push_back( aValue.getDouble() ); + break; + default: + aRowLabels.push_back( aValue.getString() ); + break; + } ::std::vector< double > aRow; for ( ColumnDescriptions::const_iterator col = aColumns.begin(); @@ -839,7 +851,16 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat } // if ( !nRowCount ) uno::Reference< chart::XChartDataArray> xData(m_xInternal,uno::UNO_QUERY); - xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size())); + if ( aDateRowLabels.empty() ) + { + xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size())); + } + else + { + uno::Reference< chart::XDateCategories> xDate(m_xInternal,uno::UNO_QUERY); + xDate->setDateCategories(uno::Sequence< double >(&(*aDateRowLabels.begin()),aDateRowLabels.size())); + } + const size_t nOffset = bFirstColumnIsCategory ? 1 : 0; uno::Sequence< ::rtl::OUString > aColumnDescriptions( aColumns.size() - nOffset ); -- cgit From 1831ee1d1a173369f625ba4cfbf8b7229e040920 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 16 Mar 2011 12:48:58 +0100 Subject: dba34d: #i86167# fix for 64 bit long value to int32 --- dbaccess/source/ui/querydesign/JoinController.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 7a983f663ce7..e66ad6017be3 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -519,10 +519,10 @@ void OJoinController::saveTableWindows( ::comphelper::NamedValueCollection& o_rV aWindowData.put( "ComposedName", (*aIter)->GetComposedName() ); aWindowData.put( "TableName", (*aIter)->GetTableName() ); aWindowData.put( "WindowName", (*aIter)->GetWinName() ); - aWindowData.put( "WindowTop", (*aIter)->GetPosition().Y() ); - aWindowData.put( "WindowLeft", (*aIter)->GetPosition().X() ); - aWindowData.put( "WindowWidth", (*aIter)->GetSize().Width() ); - aWindowData.put( "WindowHeight", (*aIter)->GetSize().Height() ); + aWindowData.put( "WindowTop", static_cast((*aIter)->GetPosition().Y()) ); + aWindowData.put( "WindowLeft", static_cast((*aIter)->GetPosition().X()) ); + aWindowData.put( "WindowWidth", static_cast((*aIter)->GetSize().Width()) ); + aWindowData.put( "WindowHeight", static_cast((*aIter)->GetSize().Height()) ); aWindowData.put( "ShowAll", (*aIter)->IsShowAll() ); const ::rtl::OUString sTableName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Table" ) ) + ::rtl::OUString::valueOf( i ) ); -- cgit From ac254e099c57010222d8cc25a78796e2e71f490a Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 17 Mar 2011 14:37:53 +0100 Subject: dba34d: remove patch for date axises --- dbaccess/source/core/misc/DatabaseDataProvider.cxx | 23 ++-------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index 574139b78f76..dbed20058780 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -783,7 +783,6 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat } ::std::vector< ::rtl::OUString > aRowLabels; - ::std::vector< double > aDateRowLabels; ::std::vector< ::std::vector< double > > aDataValues; sal_Int32 nRowCount = 0; ::connectivity::ORowSetValue aValue; @@ -792,16 +791,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat ++nRowCount; aValue.fill( aColumns[0].nResultSetPosition, aColumns[0].nDataType, xRow ); - switch(aColumns[0].nDataType) - { - case sdbc::DataType::DATE: - case sdbc::DataType::TIMESTAMP: - aDateRowLabels.push_back( aValue.getDouble() ); - break; - default: - aRowLabels.push_back( aValue.getString() ); - break; - } + aRowLabels.push_back( aValue.getString() ); ::std::vector< double > aRow; for ( ColumnDescriptions::const_iterator col = aColumns.begin(); @@ -851,16 +841,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat } // if ( !nRowCount ) uno::Reference< chart::XChartDataArray> xData(m_xInternal,uno::UNO_QUERY); - if ( aDateRowLabels.empty() ) - { - xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size())); - } - else - { - uno::Reference< chart::XDateCategories> xDate(m_xInternal,uno::UNO_QUERY); - xDate->setDateCategories(uno::Sequence< double >(&(*aDateRowLabels.begin()),aDateRowLabels.size())); - } - + xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size())); const size_t nOffset = bFirstColumnIsCategory ? 1 : 0; uno::Sequence< ::rtl::OUString > aColumnDescriptions( aColumns.size() - nOffset ); -- cgit From 8473229179c9d94720f9822a9a04819d8725b975 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 18 Mar 2011 09:31:06 +0100 Subject: dba34d: #i66846# check bookmarable before use statis resultset --- dbaccess/source/core/api/RowSetCache.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 68ea76e7244c..0ab902c6a52f 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -118,10 +118,11 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, // first try if the result can be used to do inserts and updates Reference< XPropertySet> xProp(_xRs,UNO_QUERY); Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo(); + sal_Bool bBookmarkable = sal_False; try { Reference< XResultSetUpdate> xUp(_xRs,UNO_QUERY_THROW); - sal_Bool bBookmarkable = xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && + bBookmarkable = xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is(); if ( bBookmarkable ) { @@ -154,10 +155,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, sal_Bool bAllKeysFound = sal_False; sal_Int32 nTablesCount = 0; - - sal_Bool bNeedKeySet = !(xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && - any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is() ); - bNeedKeySet = bNeedKeySet || (xPropInfo->hasPropertyByName(PROPERTY_RESULTSETCONCURRENCY) && + sal_Bool bNeedKeySet = !bBookmarkable || (xPropInfo->hasPropertyByName(PROPERTY_RESULTSETCONCURRENCY) && ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETCONCURRENCY)) == ResultSetConcurrency::READ_ONLY); Reference< XIndexAccess> xUpdateTableKeys; @@ -280,6 +278,16 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, // oj removed because keyset uses only the next// || (xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_RESULTSETTYPE) && comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) == ResultSetType::FORWARD_ONLY) if(!bAllKeysFound ) { + if ( bBookmarkable ) + { + // here I know that we have a read only bookmarable cursor + _xRs->beforeFirst(); + m_nPrivileges = Privilege::SELECT; + m_pCacheSet = new WrappedResultSet(i_nMaxRows); + m_xCacheSet = m_pCacheSet; + m_pCacheSet->construct(_xRs,i_sRowSetFilter); + return; + } m_pCacheSet = new OStaticSet(i_nMaxRows); m_xCacheSet = m_pCacheSet; m_pCacheSet->construct(_xRs,i_sRowSetFilter); -- cgit From 0e40dca039bb46ebe1694d116b88482f0b753c0c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Mar 2011 08:40:30 +0100 Subject: dba34d: #i117521# --- reportdesign/source/ui/report/ViewsWindow.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index f3706fa786bd..bd6171cf9112 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -317,6 +317,7 @@ void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSectio ::boost::shared_ptr pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) ); m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow)); m_pParent->setMarked(&pSectionWindow->getReportSection().getSectionView(),m_aSections.size() == 1); + Resize(); } //---------------------------------------------------------------------------- void OViewsWindow::removeSection(sal_uInt16 _nPosition) -- cgit