From 834027b53dee10402352c1babf46f98493f33af6 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 11 Nov 2009 14:01:37 +0100 Subject: #i105086# impl clob and blob --- dbaccess/source/ui/uno/copytablewizard.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dbaccess/source/ui') diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 26f859cf2045..ce79281f0cac 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include #include @@ -127,6 +129,8 @@ namespace dbaui using ::com::sun::star::sdbc::XParameters; using ::com::sun::star::sdbc::XResultSet; using ::com::sun::star::sdbc::XRow; + using ::com::sun::star::sdbc::XBlob; + using ::com::sun::star::sdbc::XClob; using ::com::sun::star::sdbcx::XRowLocate; using ::com::sun::star::sdbc::XResultSetMetaDataSupplier; using ::com::sun::star::sdbc::XResultSetMetaData; @@ -1281,6 +1285,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou case DataType::LONGVARBINARY: case DataType::BINARY: case DataType::VARBINARY: + case DataType::BIT: aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); break; @@ -1296,7 +1301,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp ); break; - case DataType::BIT: case DataType::BOOLEAN: aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean ); break; @@ -1313,6 +1317,14 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aTransfer.transferValue( &XRow::getInt, &XParameters::setInt ); break; + case DataType::BLOB: + aTransfer.transferComplexValue( &XRow::getBlob, &XParameters::setBlob ); + break; + + case DataType::CLOB: + aTransfer.transferComplexValue( &XRow::getClob, &XParameters::setClob ); + break; + default: { ::rtl::OUString aMessage( String( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ) ); -- cgit From 213f722450f4fd01fd65b540b912ce77d01a80b7 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 11 Nov 2009 14:02:49 +0100 Subject: #i105086# impl clob and blob --- dbaccess/source/ui/tabledesign/FieldDescriptions.cxx | 15 +++++++++++++-- dbaccess/source/ui/tabledesign/TableController.cxx | 2 +- dbaccess/source/ui/tabledesign/table.src | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'dbaccess/source/ui') diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index 699a2db8404b..6e90ebed7e88 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -239,8 +239,19 @@ void OFieldDescription::FillFromTypeInfo(const TOTypeInfoSP& _pType,sal_Bool _bF if ( bForce ) { sal_Int32 nPrec = DEFAULT_OTHER_PRECSION; - if ( GetPrecision() ) - nPrec = GetPrecision(); + switch ( _pType->nType ) + { + case DataType::BIT: + case DataType::BLOB: + case DataType::CLOB: + nPrec = _pType->nPrecision; + break; + default: + if ( GetPrecision() ) + nPrec = GetPrecision(); + break; + } + if ( _pType->nPrecision ) SetPrecision(::std::min(nPrec ? nPrec : DEFAULT_NUMERIC_PRECSION,_pType->nPrecision)); if ( _pType->nMaximumScale ) diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 98f57b61fbdc..1eed02543cda 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -1390,7 +1390,7 @@ void OTableController::alterColumns() bNeedAppendKey = sal_True; } - if ( bNeedDropKey ) + if ( bNeedDropKey && xKeyColumns.is() && xKeyColumns->getElementNames().getLength() ) dropPrimaryKey(); if ( bNeedAppendKey ) diff --git a/dbaccess/source/ui/tabledesign/table.src b/dbaccess/source/ui/tabledesign/table.src index af911ec85c07..9fa0b0743ef4 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -56,7 +56,7 @@ String STR_TABLEDESIGN_DBFIELDTYPES { - Text [ en-US ] = "Unknown;Text;Number;Date/Time;Date;Time;Yes/No;Currency;Memo;Counter;Image;Text (fix);Decimal;Binary (fix);Binary;BigInt;Double;Float;Real;Integer;Small Integer;Tiny Integer;SQL Null;Object;Distinct;Structure;Field;BLOB;CLOB;REF;OTHER"; + Text [ en-US ] = "Unknown;Text;Number;Date/Time;Date;Time;Yes/No;Currency;Memo;Counter;Image;Text (fix);Decimal;Binary (fix);Binary;BigInt;Double;Float;Real;Integer;Small Integer;Tiny Integer;SQL Null;Object;Distinct;Structure;Field;BLOB;CLOB;REF;OTHER;Bit (fix)"; }; String STR_TABLEDESIGN_UNDO_PRIMKEY -- cgit From 4330cde0b9a8b3684ddc63df0ade2e894a30ac3f Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 11 Nov 2009 14:03:52 +0100 Subject: #i105086# impl clob and blob --- dbaccess/source/ui/misc/RowSetDrop.cxx | 6 ++++++ dbaccess/source/ui/misc/UITools.cxx | 12 +++++++++++- dbaccess/source/ui/misc/WCopyTable.cxx | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) (limited to 'dbaccess/source/ui') diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 53b1105c6aba..2c679ba22da8 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -237,6 +237,12 @@ sal_Bool ORowSetImportExport::insertNewRow() case DataType::VARBINARY: aValue <<= m_xRow->getBytes(*aIter); break; + case DataType::BLOB: + aValue <<= m_xRow->getBlob(*aIter); + break; + case DataType::CLOB: + aValue <<= m_xRow->getClob(*aIter); + break; default: OSL_ENSURE(0,"Unknown type"); } diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 25a6299bae12..8d97d4829173 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -803,6 +803,12 @@ void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo aName = _rsTypeNames.GetToken(TYPE_DATETIME); break; case DataType::BIT: + if ( pInfo->aCreateParams.getLength() ) + { + aName = _rsTypeNames.GetToken(TYPE_BIT); + break; + } + // run through case DataType::BOOLEAN: aName = _rsTypeNames.GetToken(TYPE_BOOL); break; @@ -1155,7 +1161,7 @@ sal_Bool callColumnFormatDialog(Window* _pParent, if (_bHasFormat) { // if the col is bound to a text field we have to disallow all non-text formats - if ((DataType::CHAR == _nDataType) || (DataType::VARCHAR == _nDataType) || (DataType::LONGVARCHAR == _nDataType)) + if ((DataType::CHAR == _nDataType) || (DataType::VARCHAR == _nDataType) || (DataType::LONGVARCHAR == _nDataType) || (DataType::CLOB == _nDataType)) { bText = sal_True; pFormatDescriptor->Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA, sal_True)); @@ -1622,6 +1628,10 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType if ( pTypeInfo = queryTypeInfoByType(DataType::LONGVARCHAR,_rTypeInfo) ) break; break; + case DataType::LONGVARCHAR: + if ( pTypeInfo = queryTypeInfoByType(DataType::CLOB,_rTypeInfo) ) + break; + break; default: ; } // switch(_nDataType) diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 82fa7b7ec2bf..2b664c02f7e2 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -633,6 +633,22 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD if ( !lcl_sameConnection_throw( _xSourceConnection, m_xDestConnection ) ) bAllowViews = false; + if ( m_bInterConnectionCopy ) + { + Reference< XDatabaseMetaData > xSrcMeta = _xSourceConnection->getMetaData(); + ::rtl::OUString sCatalog; + ::rtl::OUString sSchema; + ::rtl::OUString sTable; + ::dbtools::qualifiedNameComponents( xSrcMeta, + m_sName, + sCatalog, + sSchema, + sTable, + ::dbtools::eInDataManipulation); + + m_sName = ::dbtools::composeTableName(m_xDestConnection->getMetaData(),sCatalog,sSchema,sTable,sal_False,::dbtools::eInTableDefinitions); + } + OCopyTable* pPage1( new OCopyTable( this ) ); pPage1->disallowUseHeaderLine(); if ( !bAllowViews ) @@ -1581,6 +1597,10 @@ TOTypeInfoSP OCopyTableWizard::convertType(const TOTypeInfoSP& _pType,sal_Bool& if ( supportsType(DataType::LONGVARCHAR,nDefaultType) ) break; break; + case DataType::LONGVARCHAR: + if ( supportsType(DataType::CLOB,nDefaultType) ) + break; + break; default: nDefaultType = DataType::VARCHAR; } -- cgit From 373cc84bba0ab3521e41489f9e3188dc0682e878 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 11 Nov 2009 14:07:55 +0100 Subject: #i105086# impl clob and blob --- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 53 +++++++++++++++++++--- .../source/ui/querydesign/SelectionBrowseBox.cxx | 27 +++++++++++ .../source/ui/querydesign/SelectionBrowseBox.hxx | 1 + .../source/ui/querydesign/querycontainerwindow.cxx | 9 ++-- 4 files changed, 78 insertions(+), 12 deletions(-) (limited to 'dbaccess/source/ui') diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index e489a0c2a585..f7f08cd63df5 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -369,6 +369,7 @@ namespace case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: + case DataType::CLOB: rNewValue = ::dbtools::quoteName(aQuote,rValue); break; case DataType::DECIMAL: @@ -382,6 +383,7 @@ namespace case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: + case DataType::BLOB: rNewValue = rValue; break; case DataType::BIT: @@ -1385,6 +1387,9 @@ namespace // first extract the inner joins conditions GetInnerJoinCriteria(_pView,pNodeTmp); + // now simplify again, join are checked in ComparisonPredicate + ::connectivity::OSQLParseNode::absorptions(pNodeTmp); + pNodeTmp = pNode->getChild(1); // it could happen that pCondition is not more valid eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pNodeTmp, rLevel); @@ -1395,7 +1400,7 @@ namespace SqlParseError GetANDCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, - const sal_uInt16 nLevel, + sal_uInt16& nLevel, sal_Bool bHaving, bool bAddOrOnOneLine); //------------------------------------------------------------------------------ @@ -1432,7 +1437,11 @@ namespace if ( SQL_ISRULE(pChild,search_condition) ) eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pChild,nLevel,bHaving,bAddOrOnOneLine); else - eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, bAddOrOnOneLine ? nLevel : nLevel++,bHaving, i == 0 ? false : bAddOrOnOneLine); + { + eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, nLevel,bHaving, i == 0 ? false : bAddOrOnOneLine); + if ( !bAddOrOnOneLine) + nLevel++; + } } } else @@ -1466,7 +1475,7 @@ namespace SqlParseError GetANDCriteria( OQueryDesignView* _pView, OSelectionBrowseBox* _pSelectionBrw, const ::connectivity::OSQLParseNode * pCondition, - const sal_uInt16 nLevel, + sal_uInt16& nLevel, sal_Bool bHaving, bool bAddOrOnOneLine) { @@ -1480,10 +1489,18 @@ namespace // Runde Klammern if (SQL_ISRULE(pCondition,boolean_primary)) { - sal_uInt16 nLevel2 = nLevel; // check if we have to put the or criteria on one line. - bool bMustAddOrOnOneLine = CheckOrCriteria(pCondition->getChild(1),NULL); - eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pCondition->getChild(1), nLevel2,bHaving,bMustAddOrOnOneLine ); + const ::connectivity::OSQLParseNode* pSearchCondition = pCondition->getChild(1); + bool bMustAddOrOnOneLine = CheckOrCriteria(pSearchCondition,NULL); + if ( SQL_ISRULE( pSearchCondition, search_condition) ) // we have a or + { + _pSelectionBrw->DuplicateConditionLevel( nLevel); + eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(0), nLevel,bHaving,bMustAddOrOnOneLine ); + ++nLevel; + eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(2), nLevel,bHaving,bMustAddOrOnOneLine ); + } + else + eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition, nLevel,bHaving,bMustAddOrOnOneLine ); } // Das erste Element ist (wieder) eine AND-Verknuepfung else if ( SQL_ISRULE(pCondition,boolean_term) ) @@ -1579,10 +1596,32 @@ namespace _pSelectionBrw->AddCondition(aDragLeft, sCondition, nLevel,bAddOrOnOneLine); } } + else + { + // Funktions-Bedingung parsen + ::rtl::OUString sCondition = ParseCondition(rController,pCondition,sDecimal,aLocale,1); + Reference< XConnection> xConnection = rController.getConnection(); + Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); + // the international doesn't matter I have a string + ::rtl::OUString sName; + pCondition->getChild(0)->parseNodeToPredicateStr(sName, + xConnection, + rController.getNumberFormatter(), + aLocale, + static_cast(sDecimal.toChar()), + &rController.getParser().getContext()); + + OTableFieldDescRef aDragLeft = new OTableFieldDesc(); + aDragLeft->SetField(sName); + aDragLeft->SetFunctionType(FKT_OTHER); + + if ( bHaving ) + aDragLeft->SetGroupBy(sal_True); + _pSelectionBrw->AddCondition(aDragLeft, sCondition, nLevel,bAddOrOnOneLine); + } } else if( SQL_ISRULEOR2(pCondition,existence_test,unique_test) ) { - // Funktions-Bedingung parsen ::rtl::OUString aCondition = ParseCondition(rController,pCondition,sDecimal,aLocale,0); diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 6b48bc528776..27ad175c071c 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -1207,6 +1207,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: + case DataType::CLOB: if(aText.GetChar(0) != '\'' || aText.GetChar(aText.Len() -1) != '\'') { aText.SearchAndReplaceAll(String::CreateFromAscii("'"),String::CreateFromAscii("''")); @@ -1836,6 +1837,32 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt } } //------------------------------------------------------------------------------ +void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel) +{ + DBG_CHKTHIS(OSelectionBrowseBox,NULL); + const sal_uInt16 nNewLevel = nLevel +1; + OTableFields& rFields = getFields(); + OTableFields::iterator aIter = rFields.begin(); + OTableFields::iterator aEnd = rFields.end(); + for(;aIter != aEnd;++aIter) + { + OTableFieldDescRef pEntry = *aIter; + + ::rtl::OUString sValue = pEntry->GetCriteria(nLevel); + if ( sValue.getLength() ) + { + pEntry->SetCriteria( nNewLevel, sValue); + if ( nNewLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1) ) + { + RowInserted( GetRowCount()-1, 1, TRUE ); + m_bVisibleRow.push_back(sal_True); + ++m_nVisibleCount; + } + m_bVisibleRow[BROW_CRIT1_ROW + nNewLevel] = sal_True; + } // if (!pEntry->GetCriteria(nLevel).getLength() ) + } // for(;aIter != getFields().end();++aIter) +} +//------------------------------------------------------------------------------ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const String& rValue, const sal_uInt16 nLevel,bool _bAddOrOnOneLine ) { Reference< XConnection> xConnection = static_cast(getDesignView()->getController()).getConnection(); diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 1d4a188dab9d..c92ce7caf7f0 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -132,6 +132,7 @@ namespace dbaui const String& rValue, const sal_uInt16 nLevel, bool _bAddOrOnOneLine ); + void DuplicateConditionLevel( const sal_uInt16 nLevel); void AddOrder(const OTableFieldDescRef& rInfo, const EOrderDir eDir, sal_uInt32 _nCurrentPos); void ClearAll(); OTableFieldDescRef AppendNewCol( sal_uInt16 nCnt=1 ); diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 2f3a70890e92..785e29bb9a0c 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -229,16 +229,17 @@ namespace dbaui Reference < XFrame > xBeamerFrame( m_pViewSwitch->getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Frame")),UNO_QUERY ); m_xBeamer.set( xBeamerFrame ); + OSL_ENSURE(m_xBeamer.is(),"No frame created!"); + m_xBeamer->initialize( VCLUnoHelper::GetInterface ( m_pBeamer ) ); // notify layout manager to not create internal toolbars Reference < XPropertySet > xPropSet( xBeamerFrame, UNO_QUERY ); try { const ::rtl::OUString aLayoutManager( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )); - Reference < XPropertySet > xLMPropSet; + Reference < XPropertySet > xLMPropSet(xPropSet->getPropertyValue( aLayoutManager ),UNO_QUERY); - Any a = xPropSet->getPropertyValue( aLayoutManager ); - if ( a >>= xLMPropSet ) + if ( xLMPropSet.is() ) { const ::rtl::OUString aAutomaticToolbars( RTL_CONSTASCII_USTRINGPARAM( "AutomaticToolbars" )); xLMPropSet->setPropertyValue( aAutomaticToolbars, Any( sal_False )); @@ -248,8 +249,6 @@ namespace dbaui { } - OSL_ENSURE(m_xBeamer.is(),"No frame created!"); - m_xBeamer->initialize( VCLUnoHelper::GetInterface ( m_pBeamer ) ); m_xBeamer->setName(FRAME_NAME_QUERY_PREVIEW); // append our frame -- cgit From b008a8ac98a3e719ca8464c5177d7ebbf9f5a28b Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Wed, 11 Nov 2009 14:09:11 +0100 Subject: #i105086# impl clob and blob --- dbaccess/source/ui/browser/sbagrid.cxx | 46 ++++++++++++------------- dbaccess/source/ui/browser/unodatbr.cxx | 1 + dbaccess/source/ui/control/FieldDescControl.cxx | 12 ++++++- dbaccess/source/ui/inc/TypeInfo.hxx | 1 + 4 files changed, 36 insertions(+), 24 deletions(-) (limited to 'dbaccess/source/ui') diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 1ca1a737dfd2..d75411cb7997 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -985,13 +985,13 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT)); rMenu.InsertSeparator(nPos++); } // if (!IsReadOnlyDB()) - - if ( GetSelectRowCount() > 0 ) - { - rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, nPos++); - rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY)); - - rMenu.InsertSeparator(nPos++); + + if ( GetSelectRowCount() > 0 ) + { + rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, nPos++); + rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY)); + + rMenu.InsertSeparator(nPos++); } } @@ -1428,20 +1428,20 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) } // ----------------------------------------------------------------------- -void SbaGridControl::CopySelectedRowsToClipboard() -{ - DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); - implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true ); -} - -// ----------------------------------------------------------------------- -void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) -{ - implTransferSelectedRows( nRowPos, false ); -} - -// ----------------------------------------------------------------------- -void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) +void SbaGridControl::CopySelectedRowsToClipboard() +{ + DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); + implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true ); +} + +// ----------------------------------------------------------------------- +void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) +{ + implTransferSelectedRows( nRowPos, false ); +} + +// ----------------------------------------------------------------------- +void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); DBG_ASSERT(xDataSource.is(), "SbaGridControl::implTransferSelectedRows : invalid data source !"); @@ -1478,8 +1478,8 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC ODataClipboard* pTransfer = new ODataClipboard(xDataSource, aSelectedRows,xRowSetClone, getServiceManager()); Reference< XTransferable > xEnsureDelete = pTransfer; - if ( _bTrueIfClipboardFalseIfDrag ) - pTransfer->CopyToClipboard( this ); + if ( _bTrueIfClipboardFalseIfDrag ) + pTransfer->CopyToClipboard( this ); else pTransfer->StartDrag(this, DND_ACTION_COPY | DND_ACTION_LINK); } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 8f2528e1f96a..7619c2000042 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -633,6 +633,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: break; case DataType::LONGVARCHAR: + case DataType::CLOB: aInitialValues.push_back( NamedValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), makeAny( (sal_Bool)sal_True ) ) ); // NO break! case DataType::BINARY: diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 4d9e81bc1f83..7eecfced5457 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -1375,6 +1375,14 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) ActivateAggregate( tpFormat ); break; case DataType::BIT: + if ( pFieldType->aCreateParams.getLength() ) + { + DeactivateAggregate( tpFormat ); + DeactivateAggregate( tpTextLen ); + DeactivateAggregate( tpBoolDefault ); + break; + } + // run through case DataType::BOOLEAN: DeactivateAggregate( tpTextLen ); DeactivateAggregate( tpFormat ); @@ -1473,7 +1481,9 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if( pBoolDefault ) { // wenn pRequired auf sal_True gesetzt ist, dann darf das sal_Bool Feld nicht den Eintrag <> besitzen - String sDef = BoolStringUI(::comphelper::getString(pFieldDescr->GetControlDefault())); + ::rtl::OUString sValue; + pFieldDescr->GetControlDefault() >>= sValue; + String sDef = BoolStringUI(sValue); // sicher stellen das <> nur vorhanden ist, wenn das Feld NULL sein darf if ( ( pFieldType.get() && !pFieldType->bNullable ) || !pFieldDescr->IsNullable() ) diff --git a/dbaccess/source/ui/inc/TypeInfo.hxx b/dbaccess/source/ui/inc/TypeInfo.hxx index b44daeba3beb..ee5a5235da68 100644 --- a/dbaccess/source/ui/inc/TypeInfo.hxx +++ b/dbaccess/source/ui/inc/TypeInfo.hxx @@ -83,6 +83,7 @@ const sal_uInt16 TYPE_BLOB = 27; const sal_uInt16 TYPE_CLOB = 28; const sal_uInt16 TYPE_REF = 29; const sal_uInt16 TYPE_OTHER = 30; +const sal_uInt16 TYPE_BIT = 31; class OTypeInfo { -- cgit