[ooo-build-commit] Branch 'ooo/master' - 2 commits - dbaccess/qa dbaccess/source reportdesign/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Tue Sep 8 17:03:53 PDT 2009
dbaccess/qa/complex/dbaccess/makefile.mk | 6
dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 8
dbaccess/source/core/api/resultcolumn.cxx | 64 +-
dbaccess/source/core/api/resultcolumn.hxx | 15
dbaccess/source/core/inc/PropertyForward.hxx | 1
dbaccess/source/core/misc/ContainerMediator.cxx | 6
dbaccess/source/ui/inc/RelationController.hxx | 8
dbaccess/source/ui/misc/DExport.cxx | 21
dbaccess/source/ui/relationdesign/RelationController.cxx | 355 +++++++++------
dbaccess/source/ui/relationdesign/RelationTableView.cxx | 6
dbaccess/source/ui/tabledesign/TableController.cxx | 71 +--
reportdesign/source/core/sdr/RptObject.cxx | 2
reportdesign/source/ui/misc/UITools.cxx | 4
reportdesign/source/ui/misc/statusbarcontroller.cxx | 2
14 files changed, 374 insertions(+), 195 deletions(-)
New commits:
commit ac27e5a191413f26e9a0ccc68f6db7b3d16f10cf
Author: Oliver Bolte <obo at openoffice.org>
Date: Tue Sep 8 09:50:48 2009 +0000
CWS-TOOLING: integrate CWS dbaperf3
2009-08-28 08:04:41 +0200 oj r275515 : wrong replacement
2009-08-28 07:57:44 +0200 oj r275514 : declaration of 'nRealSize' shadows a previous local
2009-08-20 10:17:11 +0200 oj r275168 : CWS-TOOLING: rebase CWS dbaperf3 to trunk at 275001 (milestone: DEV300:m55)
2009-08-19 11:50:49 +0200 oj r275145 : #ii102891# minimize metadata calls
2009-06-22 12:20:15 +0200 oj r273213 : compile error
2009-06-22 12:19:45 +0200 oj r273212 : compile error
2009-06-18 08:54:08 +0200 oj r273099 : #i102891# reduce calls to databasemetadata
2009-06-18 08:19:55 +0200 oj r273095 : #i102891# reduce calls to databasemetadata
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index 574bd17..d62ee8d 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -344,7 +344,7 @@ void OSingleSelectQueryComposer::setQuery_Impl( const ::rtl::OUString& command )
// update columns and tables
// why? Shouldn't this be done on request only?
// otherwise nothing is working anymore :-)
- getColumns();
+// getColumns();
getTables();
}
// -----------------------------------------------------------------------------
@@ -380,6 +380,7 @@ void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference<
{
::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
+ getColumns();
if ( !column.is()
|| !m_aCurrentColumns[SelectColumns]
|| !column->getPropertySetInfo()->hasPropertyByName(PROPERTY_NAME)
@@ -734,7 +735,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr
if ( aSelectColumns->get().empty() )
{
- // This is a valid casse. If we can syntactically parse the query, but not semantically
+ // This is a valid case. If we can syntactically parse the query, but not semantically
// (e.g. because it is based on a table we do not know), then there will be no SelectColumns
aSelectColumns = ::connectivity::parse::OParseColumn::createColumnsForResultSet( xResultSetMeta, m_xMetaData );
break;
@@ -1476,7 +1477,8 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert
column->getPropertyValue(PROPERTY_VALUE) >>= aValue;
::rtl::OUStringBuffer aSQL;
- ::rtl::OUString aQuote = m_xMetaData->getIdentifierQuoteString();
+ const ::rtl::OUString aQuote = m_xMetaData->getIdentifierQuoteString();
+ getColumns();
if ( m_aCurrentColumns[SelectColumns] && m_aCurrentColumns[SelectColumns]->hasByName(aName) )
{
diff --git a/dbaccess/source/core/api/resultcolumn.cxx b/dbaccess/source/core/api/resultcolumn.cxx
index 671951b..b49d928 100644
--- a/dbaccess/source/core/api/resultcolumn.cxx
+++ b/dbaccess/source/core/api/resultcolumn.cxx
@@ -237,64 +237,84 @@ void OResultColumn::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const
break;
case PROPERTY_ID_ISSIGNED:
{
- sal_Bool bVal = m_xMetaData->isSigned(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_isSigned )
+ m_isSigned.reset( m_xMetaData->isSigned(m_nPos));
+ rValue <<= *m_isSigned;
} break;
case PROPERTY_ID_ISCURRENCY:
{
- sal_Bool bVal = m_xMetaData->isCurrency(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_isCurrency )
+ m_isCurrency.reset( m_xMetaData->isCurrency(m_nPos));
+ rValue <<= *m_isCurrency;
} break;
case PROPERTY_ID_ISSEARCHABLE:
{
- sal_Bool bVal = m_xMetaData->isSearchable(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_bSearchable )
+ m_bSearchable.reset( m_xMetaData->isSearchable(m_nPos));
+ rValue <<= *m_bSearchable;
} break;
case PROPERTY_ID_ISCASESENSITIVE:
{
- sal_Bool bVal = m_xMetaData->isCaseSensitive(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_isCaseSensitive )
+ m_isCaseSensitive.reset( m_xMetaData->isCaseSensitive(m_nPos));
+ rValue <<= *m_isCaseSensitive;
} break;
case PROPERTY_ID_ISREADONLY:
{
- sal_Bool bVal = m_xMetaData->isReadOnly(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_isReadOnly )
+ m_isReadOnly.reset( m_xMetaData->isReadOnly(m_nPos));
+ rValue <<= *m_isReadOnly;
} break;
case PROPERTY_ID_ISWRITABLE:
{
- sal_Bool bVal = m_xMetaData->isWritable(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_isWritable )
+ m_isWritable.reset( m_xMetaData->isWritable(m_nPos));
+ rValue <<= *m_isWritable;
} break;
case PROPERTY_ID_ISDEFINITELYWRITABLE:
{
- sal_Bool bVal = m_xMetaData->isDefinitelyWritable(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_isDefinitelyWritable )
+ m_isDefinitelyWritable.reset( m_xMetaData->isDefinitelyWritable(m_nPos));
+ rValue <<= *m_isDefinitelyWritable;
} break;
case PROPERTY_ID_ISAUTOINCREMENT:
{
- sal_Bool bVal = m_xMetaData->isAutoIncrement(m_nPos);
- rValue.setValue(&bVal, getBooleanCppuType());
+ if ( !m_isAutoIncrement )
+ m_isAutoIncrement.reset( m_xMetaData->isAutoIncrement(m_nPos));
+ rValue <<= *m_isAutoIncrement;
} break;
case PROPERTY_ID_SERVICENAME:
rValue <<= m_xMetaData->getColumnServiceName(m_nPos);
break;
case PROPERTY_ID_LABEL:
- rValue <<= m_xMetaData->getColumnLabel(m_nPos);
+ if ( !m_sColumnLabel )
+ m_sColumnLabel.reset( m_xMetaData->getColumnLabel(m_nPos));
+ rValue <<= *m_sColumnLabel;
break;
case PROPERTY_ID_DISPLAYSIZE:
- rValue <<= m_xMetaData->getColumnDisplaySize(m_nPos);
+ if ( !m_nColumnDisplaySize )
+ m_nColumnDisplaySize.reset( m_xMetaData->getColumnDisplaySize(m_nPos));
+ rValue <<= *m_nColumnDisplaySize;
break;
case PROPERTY_ID_TYPE:
- rValue <<= m_xMetaData->getColumnType(m_nPos);
+ if ( !m_nColumnType )
+ m_nColumnType.reset( m_xMetaData->getColumnType(m_nPos));
+ rValue <<= *m_nColumnType;
break;
case PROPERTY_ID_PRECISION:
- rValue <<= m_xMetaData->getPrecision(m_nPos);
+ if ( !m_nPrecision )
+ m_nPrecision.reset( m_xMetaData->getPrecision(m_nPos));
+ rValue <<= *m_nPrecision;
break;
case PROPERTY_ID_SCALE:
- rValue <<= m_xMetaData->getScale(m_nPos);
+ if ( !m_nScale )
+ m_nScale.reset( m_xMetaData->getScale(m_nPos));
+ rValue <<= *m_nScale;
break;
case PROPERTY_ID_ISNULLABLE:
- rValue <<= m_xMetaData->isNullable(m_nPos);
+ if ( !m_isNullable )
+ m_isNullable.reset( m_xMetaData->isNullable(m_nPos));
+ rValue <<= *m_isNullable;
break;
case PROPERTY_ID_TYPENAME:
rValue <<= m_xMetaData->getColumnTypeName(m_nPos);
diff --git a/dbaccess/source/core/api/resultcolumn.hxx b/dbaccess/source/core/api/resultcolumn.hxx
index c74addc..abbe8c7 100644
--- a/dbaccess/source/core/api/resultcolumn.hxx
+++ b/dbaccess/source/core/api/resultcolumn.hxx
@@ -37,6 +37,7 @@
#ifndef _DBA_COREAPI_COLUMN_HXX_
#include <column.hxx>
#endif
+#include <boost/optional.hpp>
namespace dbaccess
{
//************************************************************
@@ -50,6 +51,20 @@ namespace dbaccess
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xDBMetaData;
sal_Int32 m_nPos;
::com::sun::star::uno::Any m_aIsRowVersion;
+ mutable ::boost::optional< sal_Bool > m_isSigned;
+ mutable ::boost::optional< sal_Bool > m_isCurrency;
+ mutable ::boost::optional< sal_Bool > m_bSearchable;
+ mutable ::boost::optional< sal_Bool > m_isCaseSensitive;
+ mutable ::boost::optional< sal_Bool > m_isReadOnly;
+ mutable ::boost::optional< sal_Bool > m_isWritable;
+ mutable ::boost::optional< sal_Bool > m_isDefinitelyWritable;
+ mutable ::boost::optional< sal_Bool > m_isAutoIncrement;
+ mutable ::boost::optional< sal_Int32 > m_isNullable;
+ mutable ::boost::optional< ::rtl::OUString > m_sColumnLabel;
+ mutable ::boost::optional< sal_Int32 > m_nColumnDisplaySize;
+ mutable ::boost::optional< sal_Int32 > m_nColumnType;
+ mutable ::boost::optional< sal_Int32 > m_nPrecision;
+ mutable ::boost::optional< sal_Int32 > m_nScale;
virtual ~OResultColumn();
public:
diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx
index ebbebc0..b39181e 100644
--- a/dbaccess/source/ui/inc/RelationController.hxx
+++ b/dbaccess/source/ui/inc/RelationController.hxx
@@ -38,6 +38,7 @@
#endif
class VCLXWindow;
+class WaitObject;
namespace dbaui
{
class OTableConnectionData;
@@ -48,6 +49,8 @@ namespace dbaui
class ORelationController : public OJoinController
{
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xTables;
+ ::std::auto_ptr<WaitObject> m_pWaitObject;
+ ULONG m_nThreadEvent;
sal_Bool m_bRelationsPossible;
protected:
// all the features which should be handled by this class
@@ -59,7 +62,7 @@ namespace dbaui
ORelationDesignView* getRelationView() { return static_cast<ORelationDesignView*>(m_pView); }
void loadData();
- TTableWindowData::value_type existsTable(const ::rtl::OUString& _rComposedTableName) const;
+ TTableWindowData::value_type existsTable(const ::rtl::OUString& _rComposedTableName,sal_Bool _bCase) const;
// load the window positions out of the datasource
void loadLayoutInformation();
@@ -71,6 +74,8 @@ namespace dbaui
// temp
void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY );
+ void mergeData(const TTableConnectionData& _aConnectionData);
+
virtual sal_Bool Construct(Window* pParent);
// XServiceInfo
@@ -92,6 +97,7 @@ namespace dbaui
virtual void reset();
virtual void impl_initialize();
virtual ::rtl::OUString getPrivateTitle( ) const;
+ DECL_LINK( OnThreadFinished, void* );
};
}
#endif // DBAUI_RELATIONCONTROLLER_HXX
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index bb9bc9a..b47782b 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -157,6 +157,11 @@
#ifndef _SV_WAITOBJ_HXX
#include <vcl/waitobj.hxx>
#endif
+#include <osl/thread.hxx>
+#include <vos/mutex.hxx>
+
+
+#define MAX_THREADS 10
extern "C" void SAL_CALL createRegistryInfo_ORelationControl()
{
@@ -181,6 +186,7 @@ using namespace ::com::sun::star::util;
using namespace ::dbtools;
using namespace ::dbaui;
using namespace ::comphelper;
+using namespace ::osl;
//------------------------------------------------------------------------------
::rtl::OUString SAL_CALL ORelationController::getImplementationName() throw( RuntimeException )
@@ -214,6 +220,7 @@ DBG_NAME(ORelationController);
// -----------------------------------------------------------------------------
ORelationController::ORelationController(const Reference< XMultiServiceFactory >& _rM)
: OJoinController(_rM)
+ ,m_nThreadEvent(0)
,m_bRelationsPossible(sal_True)
{
DBG_CTOR(ORelationController,NULL);
@@ -321,13 +328,8 @@ void ORelationController::impl_initialize()
try
{
loadData();
- getView()->initialize(); // show the windows and fill with our informations
- getView()->Invalidate(INVALIDATE_NOERASE);
- getUndoMgr()->Clear(); // clear all undo redo things
- setModified(sal_False); // and we are not modified yet
-
- if(m_vTableData.empty())
- Execute(ID_BROWSER_ADDTABLE,Sequence<PropertyValue>());
+ if ( !m_nThreadEvent )
+ Application::PostUserEvent(LINK(this, ORelationController, OnThreadFinished));
}
catch( const Exception& )
{
@@ -369,24 +371,53 @@ void ORelationController::describeSupportedFeatures()
OJoinController::describeSupportedFeatures();
implDescribeSupportedFeature( ".uno:DBAddRelation", SID_RELATION_ADD_RELATION, CommandGroup::EDIT );
}
-// -----------------------------------------------------------------------------
-void ORelationController::loadData()
+namespace
{
- WaitObject aWaitCursor(getView());
- try
+ class RelationLoader : public ::osl::Thread
{
- if ( !m_xTables.is() )
- return;
- // this may take some time
+ DECLARE_STL_MAP(::rtl::OUString,::boost::shared_ptr<OTableWindowData>,::comphelper::UStringMixLess,TTableDataHelper);
+ TTableDataHelper m_aTableData;
+ TTableConnectionData m_vTableConnectionData;
+ const Sequence< ::rtl::OUString> m_aTableList;
+ ORelationController* m_pParent;
+ const Reference< XDatabaseMetaData> m_xMetaData;
+ const Reference< XNameAccess > m_xTables;
+ const sal_Int32 m_nStartIndex;
+ const sal_Int32 m_nEndIndex;
- Reference< XDatabaseMetaData> xMetaData = getConnection()->getMetaData();
- Sequence< ::rtl::OUString> aNames = m_xTables->getElementNames();
- const ::rtl::OUString* pIter = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pIter + aNames.getLength();
- for(;pIter != pEnd;++pIter)
+ public:
+ RelationLoader(ORelationController* _pParent
+ ,const Reference< XDatabaseMetaData>& _xMetaData
+ ,const Reference< XNameAccess >& _xTables
+ ,const Sequence< ::rtl::OUString>& _aTableList
+ ,const sal_Int32 _nStartIndex
+ ,const sal_Int32 _nEndIndex)
+ :m_aTableData(_xMetaData.is() && _xMetaData->supportsMixedCaseQuotedIdentifiers())
+ ,m_aTableList(_aTableList)
+ ,m_pParent(_pParent)
+ ,m_xMetaData(_xMetaData)
+ ,m_xTables(_xTables)
+ ,m_nStartIndex(_nStartIndex)
+ ,m_nEndIndex(_nEndIndex)
+ {
+ }
+
+ protected:
+ virtual ~RelationLoader(){}
+
+ /// Working method which should be overridden.
+ virtual void SAL_CALL run();
+ virtual void SAL_CALL onTerminated();
+ void loadTableData(const Any& _aTable);
+ };
+
+ void SAL_CALL RelationLoader::run()
+ {
+ const ::rtl::OUString* pIter = m_aTableList.getConstArray() + m_nStartIndex;
+ for(sal_Int32 i = m_nStartIndex; i < m_nEndIndex;++i,++pIter)
{
::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(xMetaData,
+ ::dbtools::qualifiedNameComponents(m_xMetaData,
*pIter,
sCatalog,
sSchema,
@@ -396,124 +427,210 @@ void ORelationController::loadData()
if ( sCatalog.getLength() )
aCatalog <<= sCatalog;
- Reference< XResultSet > xResult = xMetaData->getImportedKeys(aCatalog, sSchema,sTable);
- if ( xResult.is() && xResult->next() )
- loadTableData(m_xTables->getByName(*pIter));
+ try
+ {
+ Reference< XResultSet > xResult = m_xMetaData->getImportedKeys(aCatalog, sSchema,sTable);
+ if ( xResult.is() && xResult->next() )
+ {
+ ::comphelper::disposeComponent(xResult);
+ loadTableData(m_xTables->getByName(*pIter));
+ } // if ( xResult.is() && xResult->next() )
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
}
- catch(SQLException& e)
+ void SAL_CALL RelationLoader::onTerminated()
{
- showError(SQLExceptionInfo(e));
- }
- catch(const Exception&)
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-}
-// -----------------------------------------------------------------------------
-void ORelationController::loadTableData(const Any& _aTable)
-{
- Reference<XPropertySet> xTableProp(_aTable,UNO_QUERY);
- const ::rtl::OUString sSourceName = ::dbtools::composeTableName( getConnection()->getMetaData(), xTableProp, ::dbtools::eInTableDefinitions, false, false, false );
- TTableWindowData::value_type pReferencingTable = existsTable(sSourceName);
- bool bNotFound = true, bAdded = false;
- if ( !pReferencingTable )
- {
- pReferencingTable.reset(new OTableWindowData(xTableProp,sSourceName, sSourceName));
- pReferencingTable->ShowAll(FALSE);
- bAdded = true;
- m_vTableData.push_back(pReferencingTable);
+ m_pParent->mergeData(m_vTableConnectionData);
+ delete this;
}
- Reference<XIndexAccess> xKeys = pReferencingTable->getKeys();
- Reference<XKeysSupplier> xKeySup(xTableProp,UNO_QUERY);
-
- if ( !xKeys.is() && xKeySup.is() )
+ void RelationLoader::loadTableData(const Any& _aTable)
{
- xKeys = xKeySup->getKeys();
- }
-
- if ( xKeys.is() )
- {
- Reference<XPropertySet> xKey;
- const sal_Int32 nCount = xKeys->getCount();
- for(sal_Int32 i = 0 ; i < nCount ; ++i)
+ Reference<XPropertySet> xTableProp(_aTable,UNO_QUERY);
+ const ::rtl::OUString sSourceName = ::dbtools::composeTableName( m_xMetaData, xTableProp, ::dbtools::eInTableDefinitions, false, false, false );
+ TTableDataHelper::iterator aFind = m_aTableData.find(sSourceName);
+ bool bNotFound = true, bAdded = false;
+ if ( aFind == m_aTableData.end() )
+ {
+ aFind = m_aTableData.insert(TTableDataHelper::value_type(sSourceName,::boost::shared_ptr<OTableWindowData>(new OTableWindowData(xTableProp,sSourceName, sSourceName)))).first;
+ aFind->second->ShowAll(FALSE);
+ bAdded = true;
+ }
+ TTableWindowData::value_type pReferencingTable = aFind->second;
+ Reference<XIndexAccess> xKeys = pReferencingTable->getKeys();
+ const Reference<XKeysSupplier> xKeySup(xTableProp,UNO_QUERY);
+
+ if ( !xKeys.is() && xKeySup.is() )
{
- xKeys->getByIndex(i) >>= xKey;
- sal_Int32 nKeyType = 0;
- xKey->getPropertyValue(PROPERTY_TYPE) >>= nKeyType;
- if ( KeyType::FOREIGN == nKeyType )
+ xKeys = xKeySup->getKeys();
+ }
+
+ if ( xKeys.is() )
+ {
+ Reference<XPropertySet> xKey;
+ const sal_Int32 nCount = xKeys->getCount();
+ for(sal_Int32 i = 0 ; i < nCount ; ++i)
{
- bNotFound = false;
- ::rtl::OUString sReferencedTable;
- xKey->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= sReferencedTable;
- //////////////////////////////////////////////////////////////////////
- // insert windows
- TTableWindowData::value_type pReferencedTable = existsTable(sReferencedTable);
- if ( !pReferencedTable )
+ xKeys->getByIndex(i) >>= xKey;
+ sal_Int32 nKeyType = 0;
+ xKey->getPropertyValue(PROPERTY_TYPE) >>= nKeyType;
+ if ( KeyType::FOREIGN == nKeyType )
{
- if ( m_xTables->hasByName(sReferencedTable) )
+ bNotFound = false;
+ ::rtl::OUString sReferencedTable;
+ xKey->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= sReferencedTable;
+ //////////////////////////////////////////////////////////////////////
+ // insert windows
+ TTableDataHelper::iterator aRefFind = m_aTableData.find(sReferencedTable);
+ if ( aRefFind == m_aTableData.end() )
{
- Reference<XPropertySet> xReferencedTable(m_xTables->getByName(sReferencedTable),UNO_QUERY);
- pReferencedTable.reset(new OTableWindowData(xReferencedTable,sReferencedTable, sReferencedTable));
- pReferencedTable->ShowAll(FALSE);
- m_vTableData.push_back(pReferencedTable);
- }
- else
- continue; // table name could not be found so we do not show this table releation
- }
+ if ( m_xTables->hasByName(sReferencedTable) )
+ {
+ Reference<XPropertySet> xReferencedTable(m_xTables->getByName(sReferencedTable),UNO_QUERY);
+ aRefFind = m_aTableData.insert(TTableDataHelper::value_type(sReferencedTable,::boost::shared_ptr<OTableWindowData>(new OTableWindowData(xReferencedTable,sReferencedTable, sReferencedTable)))).first;
+ aRefFind->second->ShowAll(FALSE);
+ }
+ else
+ continue; // table name could not be found so we do not show this table releation
+ } // if ( aFind == m_aTableData.end() )
+ TTableWindowData::value_type pReferencedTable = aRefFind->second;
- ::rtl::OUString sKeyName;
- xKey->getPropertyValue(PROPERTY_NAME) >>= sKeyName;
- //////////////////////////////////////////////////////////////////////
- // insert connection
- ORelationTableConnectionData* pTabConnData = new ORelationTableConnectionData( pReferencingTable, pReferencedTable, sKeyName );
- m_vTableConnectionData.push_back(TTableConnectionData::value_type(pTabConnData));
- //////////////////////////////////////////////////////////////////////
- // insert columns
- Reference<XColumnsSupplier> xColsSup(xKey,UNO_QUERY);
- OSL_ENSURE(xColsSup.is(),"Key is no XColumnsSupplier!");
- Reference<XNameAccess> xColumns = xColsSup->getColumns();
- Sequence< ::rtl::OUString> aNames = xColumns->getElementNames();
- const ::rtl::OUString* pIter = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pIter + aNames.getLength();
- ::rtl::OUString sColumnName,sRelatedName;
- for(sal_uInt16 j=0;pIter != pEnd;++pIter,++j)
- {
- Reference<XPropertySet> xPropSet;
- xColumns->getByName(*pIter) >>= xPropSet;
- OSL_ENSURE(xPropSet.is(),"Invalid column found in KeyColumns!");
- if ( xPropSet.is() )
+ ::rtl::OUString sKeyName;
+ xKey->getPropertyValue(PROPERTY_NAME) >>= sKeyName;
+ //////////////////////////////////////////////////////////////////////
+ // insert connection
+ ORelationTableConnectionData* pTabConnData = new ORelationTableConnectionData( pReferencingTable, pReferencedTable, sKeyName );
+ m_vTableConnectionData.push_back(TTableConnectionData::value_type(pTabConnData));
+ //////////////////////////////////////////////////////////////////////
+ // insert columns
+ const Reference<XColumnsSupplier> xColsSup(xKey,UNO_QUERY);
+ OSL_ENSURE(xColsSup.is(),"Key is no XColumnsSupplier!");
+ const Reference<XNameAccess> xColumns = xColsSup->getColumns();
+ const Sequence< ::rtl::OUString> aNames = xColumns->getElementNames();
+ const ::rtl::OUString* pIter = aNames.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aNames.getLength();
+ ::rtl::OUString sColumnName,sRelatedName;
+ for(sal_uInt16 j=0;pIter != pEnd;++pIter,++j)
{
- xPropSet->getPropertyValue(PROPERTY_NAME) >>= sColumnName;
- xPropSet->getPropertyValue(PROPERTY_RELATEDCOLUMN) >>= sRelatedName;
+ const Reference<XPropertySet> xPropSet(xColumns->getByName(*pIter),UNO_QUERY);
+ OSL_ENSURE(xPropSet.is(),"Invalid column found in KeyColumns!");
+ if ( xPropSet.is() )
+ {
+ xPropSet->getPropertyValue(PROPERTY_NAME) >>= sColumnName;
+ xPropSet->getPropertyValue(PROPERTY_RELATEDCOLUMN) >>= sRelatedName;
+ }
+ pTabConnData->SetConnLine( j, sColumnName, sRelatedName );
}
- pTabConnData->SetConnLine( j, sColumnName, sRelatedName );
- }
- //////////////////////////////////////////////////////////////////////
- // Update/Del-Flags setzen
- sal_Int32 nUpdateRule = 0;
- sal_Int32 nDeleteRule = 0;
- xKey->getPropertyValue(PROPERTY_UPDATERULE) >>= nUpdateRule;
- xKey->getPropertyValue(PROPERTY_DELETERULE) >>= nDeleteRule;
-
- pTabConnData->SetUpdateRules( nUpdateRule );
- pTabConnData->SetDeleteRules( nDeleteRule );
+ //////////////////////////////////////////////////////////////////////
+ // Update/Del-Flags setzen
+ sal_Int32 nUpdateRule = 0;
+ sal_Int32 nDeleteRule = 0;
+ xKey->getPropertyValue(PROPERTY_UPDATERULE) >>= nUpdateRule;
+ xKey->getPropertyValue(PROPERTY_DELETERULE) >>= nDeleteRule;
+
+ pTabConnData->SetUpdateRules( nUpdateRule );
+ pTabConnData->SetDeleteRules( nDeleteRule );
- //////////////////////////////////////////////////////////////////////
- // Kardinalitaet setzen
- pTabConnData->SetCardinality();
+ //////////////////////////////////////////////////////////////////////
+ // Kardinalitaet setzen
+ pTabConnData->SetCardinality();
+ }
}
+ } // if ( xKeys.is() )
+ }
+}
+
+void ORelationController::mergeData(const TTableConnectionData& _aConnectionData)
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+
+ ::std::copy( _aConnectionData.begin(), _aConnectionData.end(), ::std::back_inserter( m_vTableConnectionData ));
+ //const Reference< XDatabaseMetaData> xMetaData = getConnection()->getMetaData();
+ const sal_Bool bCase = sal_True;//xMetaData.is() && xMetaData->supportsMixedCaseQuotedIdentifiers();
+ // here we are finished, so we can collect the table from connection data
+ TTableConnectionData::iterator aConnDataIter = m_vTableConnectionData.begin();
+ TTableConnectionData::iterator aConnDataEnd = m_vTableConnectionData.end();
+ for(;aConnDataIter != aConnDataEnd;++aConnDataIter)
+ {
+ if ( !existsTable((*aConnDataIter)->getReferencingTable()->GetComposedName(),bCase) )
+ {
+ m_vTableData.push_back((*aConnDataIter)->getReferencingTable());
+ }
+ if ( !existsTable((*aConnDataIter)->getReferencedTable()->GetComposedName(),bCase) )
+ {
+ m_vTableData.push_back((*aConnDataIter)->getReferencedTable());
}
- } // if ( xKeys.is() )
- if ( bNotFound && bAdded )
- m_vTableData.pop_back();
+ } // for(;aConnDataIter != aConnDataEnd;++aConnDataIter)
+ --m_nThreadEvent;
+ if ( !m_nThreadEvent )
+ Application::PostUserEvent(LINK(this, ORelationController, OnThreadFinished));
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( ORelationController, OnThreadFinished, void*, /*NOTINTERESTEDIN*/ )
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( getMutex() );
+ try
+ {
+ getView()->initialize(); // show the windows and fill with our informations
+ getView()->Invalidate(INVALIDATE_NOERASE);
+ getUndoMgr()->Clear(); // clear all undo redo things
+ setModified(sal_False); // and we are not modified yet
+
+ if(m_vTableData.empty())
+ Execute(ID_BROWSER_ADDTABLE,Sequence<PropertyValue>());
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ m_pWaitObject.reset();
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+void ORelationController::loadData()
+{
+ m_pWaitObject.reset( new WaitObject(getView()) );
+ try
+ {
+ if ( !m_xTables.is() )
+ return;
+ // this may take some time
+ const Reference< XDatabaseMetaData> xMetaData = getConnection()->getMetaData();
+ const Sequence< ::rtl::OUString> aNames = m_xTables->getElementNames();
+ const sal_Int32 nCount = aNames.getLength();
+ const sal_Int32 nMaxElements = (nCount / MAX_THREADS) +1;
+
+ sal_Int32 nStart = 0,nEnd = ::std::min(nMaxElements,nCount);
+ while(nStart != nEnd)
+ {
+ ++m_nThreadEvent;
+ RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,nStart,nEnd);
+ pThread->createSuspended();
+ pThread->setPriority(osl_Thread_PriorityBelowNormal);
+ pThread->resume();
+ nStart = nEnd;
+ nEnd += nMaxElements;
+ nEnd = ::std::min(nEnd,nCount);
+ } // for(;pIter != pEnd;++pIter)
+ }
+ catch(SQLException& e)
+ {
+ showError(SQLExceptionInfo(e));
+ }
+ catch(const Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
// -----------------------------------------------------------------------------
-TTableWindowData::value_type ORelationController::existsTable(const ::rtl::OUString& _rComposedTableName) const
+TTableWindowData::value_type ORelationController::existsTable(const ::rtl::OUString& _rComposedTableName,sal_Bool _bCase) const
{
- Reference<XDatabaseMetaData> xMeta = getConnection()->getMetaData();
- ::comphelper::UStringMixEqual bCase(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers());
+ ::comphelper::UStringMixEqual bCase(_bCase);
TTableWindowData::const_iterator aIter = m_vTableData.begin();
TTableWindowData::const_iterator aEnd = m_vTableData.end();
for(;aIter != aEnd;++aIter)
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index d3ae601..fd47db6 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -165,7 +165,7 @@ void ORelationTableView::ReSync()
// Verbindungen einfuegen
TTableConnectionData* pTabConnDataList = m_pView->getController().getTableConnectionData();
TTableConnectionData::reverse_iterator aConIter = pTabConnDataList->rbegin();
-
+
for(;aConIter != pTabConnDataList->rend();++aConIter)
{
ORelationTableConnectionData* pTabConnData = static_cast<ORelationTableConnectionData*>(aConIter->get());
@@ -182,8 +182,8 @@ void ORelationTableView::ReSync()
pTabConnDataList->erase( ::std::remove(pTabConnDataList->begin(),pTabConnDataList->end(),*aConIter),pTabConnDataList->end() );
continue;
}
- }
-
+ } // if ( !arrInvalidTables.empty() )
+
addConnection( new ORelationTableConnection(this, *aConIter), sal_False ); // don't add the data again
}
commit 66fa84c758ac66c1882cff507cae7cd7edf6b4ee
Author: Oliver Bolte <obo at openoffice.org>
Date: Tue Sep 8 08:54:47 2009 +0000
CWS-TOOLING: integrate CWS dba32f
2009-08-31 10:43:51 +0200 msc r275590 : #no issuezilla available# make the testcase more error proof
2009-08-31 10:43:28 +0200 msc r275589 : #no issuezilla available# make the testcase more error proof
2009-08-31 10:40:33 +0200 msc r275588 : i85993 remove bugid
2009-08-31 10:38:28 +0200 msc r275587 : i100000
2009-08-27 13:27:32 +0200 fs r275476 : #i103882#
2009-08-27 12:47:54 +0200 fs r275474 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 12:47:16 +0200 fs r275473 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 10:18:05 +0200 mav r275461 : #i103266# do not allow any stream operation on package streams while commiting the package
2009-08-20 15:25:48 +0200 fs r275184 : #i104362# fall back to a ViewObjectContactOfSdrObj in case we don't have a page view
2009-08-20 15:25:06 +0200 fs r275183 : AUGMENT_LIBRARY_PATH
2009-08-20 15:10:34 +0200 fs r275182 : AUGMENT_LIBRARY_PATH
2009-08-20 09:50:36 +0200 oj r275167 : #i104266# notify propertyforward when new dest was created
2009-08-19 08:01:28 +0200 mav r275133 : #i103266# fix the typo
2009-08-18 22:45:34 +0200 fs r275131 : #i10000#
2009-08-18 13:53:07 +0200 oj r275105 : #i104266# set column settings after alter columns
2009-08-18 13:41:49 +0200 fs r275103 : #i102550# do not interpret names of existing data sources as system path
2009-08-18 13:13:05 +0200 oj r275097 : #i103882# use correct number Format
2009-08-18 12:59:13 +0200 fs r275094 : #i104181#
2009-08-18 09:07:48 +0200 fs r275079 : updated readme to refer to proper 1.1.14
2009-08-18 08:32:31 +0200 oj r275077 : #i104187# wrong default for FirstCellAsLabel corrected
2009-08-18 08:10:00 +0200 oj r275076 : #i104187# dispose status controller to avoid access of dead statusBar in sfx
2009-08-17 21:56:19 +0200 fs r275074 : merge fix for issue #102564# from dba32e
2009-08-17 15:34:40 +0200 fs r275058 : don't set MaxFieldSize to 0 unconditionally
2009-08-17 14:33:57 +0200 oj r275054 : #i103528# patch for bitxtor
2009-08-17 14:12:26 +0200 oj r275051 : #i104160# fix VerticalAlignment
2009-08-17 14:11:47 +0200 oj r275050 : #i104160# fix VerticalAlignment
2009-08-14 15:54:04 +0200 mav r274989 : #i103266# avoid possibility for race condition
2009-08-13 13:52:43 +0200 fs r274939 : improved diagnostics
2009-08-13 13:52:28 +0200 fs r274938 : typo
2009-08-13 12:51:03 +0200 fs r274934 : #i103763# provided by cloph: correct libIDL check when compiling Mozilla
2009-08-13 12:43:23 +0200 fs r274933 : #i103763# provided by cloph: allow to cross-compile prebuilt zips on Mac
2009-08-13 12:41:15 +0200 fs r274932 : #i103371# fire PREPARECLOSEDOC even for embedded objects (why not?)
2009-08-13 12:24:49 +0200 fs r274930 : #i99890# remove 'Insert Control' from the popup menu
2009-08-13 12:23:38 +0200 fs r274929 : #i99890# DoToolboxAction: assert unknown/unimplemented actions
2009-08-13 09:32:07 +0200 fs r274923 : #i103721#
2009-08-13 09:26:32 +0200 fs r274922 : #i99894# provided by dtardon: xforms_nowFunction: use proper memory allocation function
2009-08-13 09:20:21 +0200 fs r274921 : #i103938# provided by cmc: pass proper arguments to OUString::intern
2009-08-12 22:34:28 +0200 fs r274916 : #i104139# when executing a PopupMenu, pass the POPUPMENU_NOMOUSEUPCLOSE flag
diff --git a/dbaccess/qa/complex/dbaccess/makefile.mk b/dbaccess/qa/complex/dbaccess/makefile.mk
index 0d86e53..0631169 100755
--- a/dbaccess/qa/complex/dbaccess/makefile.mk
+++ b/dbaccess/qa/complex/dbaccess/makefile.mk
@@ -61,6 +61,8 @@ JARCOMPRESS = TRUE
RUNNER_ARGS = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex
+RUNNER_CALL = $(AUGMENT_LIBRARY_PATH) java
+
# --- Targets ------------------------------------------------------
.IF "$(depend)" == ""
@@ -73,10 +75,10 @@ ALL: ALLDEP
run: $(CLASSDIR)$/$(JARTARGET)
- +java $(RUNNER_ARGS) -sce dbaccess.sce
+ +$(RUNNER_CALL) $(RUNNER_ARGS) -sce dbaccess.sce
run_%: $(CLASSDIR)$/$(JARTARGET)
- +java $(RUNNER_ARGS) -o complex.dbaccess.$(@:s/run_//)
+ +$(RUNNER_CALL) $(RUNNER_ARGS) -o complex.dbaccess.$(@:s/run_//)
.ELSE
.INCLUDE : target.mk
diff --git a/dbaccess/source/core/inc/PropertyForward.hxx b/dbaccess/source/core/inc/PropertyForward.hxx
index eb0656b..0ca98fe 100644
--- a/dbaccess/source/core/inc/PropertyForward.hxx
+++ b/dbaccess/source/core/inc/PropertyForward.hxx
@@ -82,6 +82,7 @@ namespace dbaccess
inline void setName(const ::rtl::OUString& _sName) { m_sName = _sName; }
void setDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDest);
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getDefinition() const { return m_xDest;}
};
//........................................................................
} // namespace dbaccess
diff --git a/dbaccess/source/core/misc/ContainerMediator.cxx b/dbaccess/source/core/misc/ContainerMediator.cxx
index 95515dd..d0841ab 100644
--- a/dbaccess/source/core/misc/ContainerMediator.cxx
+++ b/dbaccess/source/core/misc/ContainerMediator.cxx
@@ -289,7 +289,7 @@ Reference< XPropertySet > OContainerMediator::impl_getSettingsForInitialization_
void OContainerMediator::notifyElementCreated(const ::rtl::OUString& _sName,const Reference<XPropertySet>& _xDest)
{
PropertyForwardList::iterator aFind = m_aForwardList.find(_sName);
- if ( aFind == m_aForwardList.end() && m_xSettings.is() )
+ if ( (aFind == m_aForwardList.end() || !aFind->second->getDefinition().is() )&& m_xSettings.is() )
{
::std::vector< ::rtl::OUString> aPropertyList;
@@ -321,8 +321,8 @@ void OContainerMediator::notifyElementCreated(const ::rtl::OUString& _sName,cons
}
::rtl::Reference< OPropertyForward > pForward( new OPropertyForward( _xDest, m_xSettings, _sName, aPropertyList ) );
- m_aForwardList.insert( PropertyForwardList::value_type( _sName, pForward ) );
- }
+ m_aForwardList[_sName] = pForward;
+ } // if ( aFind == m_aForwardList.end() && m_xSettings.is() )
}
// -----------------------------------------------------------------------------
//........................................................................
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index e901f61..8f559e2 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -66,6 +66,7 @@
#include "WExtendPages.hxx"
#include "WCPage.hxx"
#include <svtools/syslocale.hxx>
+#include <svtools/zforlist.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/FValue.hxx>
#include <com/sun/star/sdbc/SQLWarning.hpp>
@@ -344,9 +345,14 @@ void ODatabaseExport::insertValueIntoColumn()
bool bNumberFormatError = false;
if ( m_pFormatter && m_sNumToken.Len() )
{
- LanguageType eNumLang;
- sal_uInt32 nNumberFormat2;
+ LanguageType eNumLang = LANGUAGE_NONE;
+ sal_uInt32 nNumberFormat2( nNumberFormat );
fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nNumberFormat2,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter);
+ if ( eNumLang != LANGUAGE_NONE )
+ {
+ nNumberFormat2 = m_pFormatter->GetFormatForLanguageIfBuiltIn( nNumberFormat2, eNumLang );
+ m_pFormatter->IsNumberFormat( m_sTextToken, nNumberFormat2, fOutNumber );
+ }
nNumberFormat = static_cast<sal_Int32>(nNumberFormat2);
}
else
@@ -357,6 +363,7 @@ void ODatabaseExport::insertValueIntoColumn()
NumberFormat::DATETIME
,NumberFormat::DATE
,NumberFormat::TIME
+ ,NumberFormat::CURRENCY
,NumberFormat::NUMBER
,NumberFormat::LOGICAL
};
@@ -438,9 +445,13 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl
if ( m_pFormatter && m_sNumToken.Len() )
{
LanguageType eNumLang;
- sal_uInt32 nFormatKey;
+ sal_uInt32 nFormatKey(0);
fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nFormatKey,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter);
- //double fOutNumber2 = SfxHTMLParser::GetTableDataOptionsValNum(nNumberFormat2,eNumLang,m_sValToken,m_sNumToken,*m_pFormatter);
+ if ( eNumLang != LANGUAGE_NONE )
+ {
+ nFormatKey = m_pFormatter->GetFormatForLanguageIfBuiltIn( nFormatKey, eNumLang );
+ m_pFormatter->IsNumberFormat( m_sTextToken, nFormatKey, fOutNumber );
+ }
Reference<XPropertySet> xProp = xFormats->getByKey(nFormatKey);
xProp->getPropertyValue(PROPERTY_TYPE) >>= nNumberFormat;
}
@@ -575,7 +586,7 @@ void ODatabaseExport::SetColumnTypes(const TColumnVector* _pList,const OTypeInfo
{
sal_Int32 nDataType;
sal_Int32 nLength(0),nScale(0);
- sal_Int16 nType = m_vNumberFormat[i];
+ sal_Int16 nType = m_vNumberFormat[i] & ~NumberFormat::DEFINED;
switch ( nType )
{
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index ac53e19..f236eb1 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -1179,7 +1179,8 @@ void OTableController::alterColumns()
::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_vRowList.begin();
::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_vRowList.end();
// first look for columns where something other than the name changed
- for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos)
+ sal_Int32 nPos = 0;
+ for(;aIter != aEnd;++aIter,++nPos)
{
OSL_ENSURE(*aIter,"OTableRow is null!");
OFieldDescription* pField = (*aIter)->GetActFieldDescr();
@@ -1198,10 +1199,9 @@ void OTableController::alterColumns()
xColumns->getByName(pField->GetName()) >>= xColumn;
OSL_ENSURE(xColumn.is(),"Column is null!");
- sal_Int32 nType=0,nPrecision=0,nScale=0,nNullable=0,nFormatKey=0,nAlignment=0;
+ sal_Int32 nType=0,nPrecision=0,nScale=0,nNullable=0;
sal_Bool bAutoIncrement = false;
- ::rtl::OUString sDescription, sTypeName;
- Any aControlDefault;
+ ::rtl::OUString sTypeName;
xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType;
xColumn->getPropertyValue(PROPERTY_PRECISION) >>= nPrecision;
@@ -1220,19 +1220,10 @@ void OTableController::alterColumns()
}
// xColumn->getPropertyValue(PROPERTY_ISCURRENCY,::cppu::bool2any(pField->IsCurrency()));
- if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT))
- xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sDescription;
- if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
- aControlDefault = xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT);
- if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY))
- xColumn->getPropertyValue(PROPERTY_FORMATKEY) >>= nFormatKey;
- if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN))
- xColumn->getPropertyValue(PROPERTY_ALIGN) >>= nAlignment;
-
// check if something changed
if((nType != pField->GetType() ||
sTypeName != pField->GetTypeName() ||
- nPrecision != pField->GetPrecision() ||
+ (nPrecision != pField->GetPrecision() && nPrecision ) ||
nScale != pField->GetScale() ||
nNullable != pField->GetIsNullable() ||
bAutoIncrement != pField->IsAutoIncrement())&&
@@ -1285,26 +1276,7 @@ void OTableController::alterColumns()
bReload = sal_True;
}
- if(nFormatKey != pField->GetFormatKey())
- {
- if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY))
- xColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(pField->GetFormatKey()));
- }
- if(nAlignment != dbaui::mapTextAllign(pField->GetHorJustify()))
- {
- if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN))
- xColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(pField->GetHorJustify())));
- }
- if(sDescription != pField->GetDescription())
- {
- if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT))
- xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetDescription()));
- }
- if ( aControlDefault != pField->GetControlDefault())
- {
- if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
- xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,pField->GetControlDefault());
- }
+
}
else if(xColumnFactory.is() && xAlter.is() && nPos < nColumnCount)
{ // we can't find the column so we could try it with the index before we drop and append a new column
@@ -1350,6 +1322,37 @@ void OTableController::alterColumns()
}
else
bReload = sal_True;
+ } // for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos)
+ // alter column settings
+ aIter = m_vRowList.begin();
+
+ // first look for columns where something other than the name changed
+ for(nPos = 0;aIter != aEnd;++aIter,++nPos)
+ {
+ OSL_ENSURE(*aIter,"OTableRow is null!");
+ OFieldDescription* pField = (*aIter)->GetActFieldDescr();
+ if ( !pField )
+ continue;
+ if ( (*aIter)->IsReadOnly() )
+ {
+ aColumns[pField->GetName()] = sal_True;
+ continue;
+ }
+
+ Reference<XPropertySet> xColumn;
+ if ( xColumns->hasByName(pField->GetName()) )
+ {
+ xColumns->getByName(pField->GetName()) >>= xColumn;
+ Reference<XPropertySetInfo> xInfo = xColumn->getPropertySetInfo();
+ if ( xInfo->hasPropertyByName(PROPERTY_HELPTEXT) )
+ xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetDescription()));
+ if(xInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
+ xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,pField->GetControlDefault());
+ if(xInfo->hasPropertyByName(PROPERTY_FORMATKEY))
+ xColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(pField->GetFormatKey()));
+ if(xInfo->hasPropertyByName(PROPERTY_ALIGN))
+ xColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(pField->GetHorJustify())));
+ } // if ( xColumns->hasByName(pField->GetName()) )
}
// second drop all columns which could be found by name
Reference<XNameAccess> xKeyColumns = getKeyColumns();
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 8e64894..eba35f6 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -1248,7 +1248,7 @@ void OOle2Obj::initializeChart( const uno::Reference< frame::XModel>& _xModel)
uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
aArgs[2] = beans::PropertyValue(
::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
- uno::makeAny( sal_False ), beans::PropertyState_DIRECT_VALUE );
+ uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE );
aArgs[3] = beans::PropertyValue(
::rtl::OUString::createFromAscii("DataRowSource"), -1,
uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 5295782..d5b11a6 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -363,7 +363,7 @@ namespace
_rItemSet.Put(aHorJustifyItem);
//_rItemSet.Put(SfxInt32Item(ITEMID_DEGREES,_rxReportControlFormat->getCharRotation()));
SvxVerJustifyItem aVerJustifyItem(ITEMID_VERJUSTIFY);
- aVerJustifyItem.PutValue(xSet->getPropertyValue(PROPERTY_VERTICALALIGN),0);
+ aVerJustifyItem.PutValue(xSet->getPropertyValue(PROPERTY_VERTICALALIGN),MID_HORJUST_ADJUST);
_rItemSet.Put(aVerJustifyItem);
//_rItemSet.Put(SfxInt32Item(ITEMID_IDENT,_rxReportControlFormat->getCharRotation()));
@@ -489,7 +489,7 @@ namespace
{
const SvxVerJustifyItem* pJustifyItem = static_cast<const SvxVerJustifyItem*>(pItem);
uno::Any aValue;
- pJustifyItem->QueryValue(aValue,0);
+ pJustifyItem->QueryValue(aValue,MID_HORJUST_ADJUST);
lcl_pushBack( _out_rProperties, PROPERTY_VERTICALALIGN, aValue );
}
if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARRELIEF,sal_True,&pItem) && pItem->ISA(SvxCharReliefItem))
diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx
index ecfb419..8cba088 100644
--- a/reportdesign/source/ui/misc/statusbarcontroller.cxx
+++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx
@@ -223,6 +223,8 @@ void SAL_CALL OStatusbarController::update() throw ( RuntimeException )
// XComponent
void SAL_CALL OStatusbarController::dispose() throw (::com::sun::star::uno::RuntimeException)
{
+ Reference< XComponent > xComp( m_pController.getRef(), UNO_QUERY );
+ ::comphelper::disposeComponent(xComp);
m_pController.dispose();
svt::StatusbarController::dispose();
}
More information about the ooo-build-commit
mailing list