summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/source/core/api/RowSet.cxx4
-rw-r--r--dbaccess/source/core/api/definitioncolumn.cxx11
-rw-r--r--dbaccess/source/core/api/query.cxx27
-rw-r--r--dbaccess/source/core/inc/definitioncolumn.hxx3
-rw-r--r--dbaccess/source/ui/browser/dsEntriesNoExp.cxx8
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx34
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx7
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.cxx11
8 files changed, 90 insertions, 15 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 1adddab143c1..937bcbe82f37 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1904,6 +1904,8 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
if(!xColumn.is())
{
// no column found so we could look at the position i
+ //bReFetchName = sal_True;
+ //sColumnLabel = ::rtl::OUString();
Reference<XIndexAccess> xIndexAccess(m_xColumns,UNO_QUERY);
if(xIndexAccess.is() && i <= xIndexAccess->getCount())
{
@@ -1913,7 +1915,9 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
{
Sequence< ::rtl::OUString> aSeq = m_xColumns->getElementNames();
if( i <= aSeq.getLength())
+ {
m_xColumns->getByName(aSeq.getConstArray()[i-1]) >>= xColumn;
+ }
}
}
if(bReFetchName && xColumn.is())
diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx
index 9f9e511fc9b4..77a29812b105 100644
--- a/dbaccess/source/core/api/definitioncolumn.cxx
+++ b/dbaccess/source/core/api/definitioncolumn.cxx
@@ -192,7 +192,7 @@ rtl::OUString OTableColumn::getImplementationName( ) throw (RuntimeException)
DBG_NAME( OQueryColumn );
// -------------------------------------------------------------------------
-OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, const Reference< XConnection >& _rxConnection )
+OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, const Reference< XConnection >& _rxConnection,const ::rtl::OUString& _sNewName )
:OTableColumnDescriptor( false /* do not act as descriptor */ )
{
const sal_Int32 nPropAttr = PropertyAttribute::READONLY;
@@ -210,7 +210,14 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co
OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_TYPE ) >>= m_nType );
OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_ISAUTOINCREMENT ) >>= m_bAutoIncrement );
OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_ISCURRENCY ) >>= m_bCurrency );
- OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_NAME ) >>= m_sName );
+ if ( _sNewName.getLength() )
+ {
+ m_sName = _sNewName;
+ }
+ else
+ {
+ OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_NAME ) >>= m_sName );
+ }
m_bRowVersion = sal_False;
Reference< XPropertySetInfo > xPSI( _rxParserColumn->getPropertySetInfo(), UNO_SET_THROW );
diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx
index 7468e88f4fff..3f3ccc57db2e 100644
--- a/dbaccess/source/core/api/query.cxx
+++ b/dbaccess/source/core/api/query.cxx
@@ -191,9 +191,10 @@ void OQuery::rebuildColumns()
m_pColumnMediator = NULL;
Reference<XColumnsSupplier> xColSup(m_xCommandDefinition,UNO_QUERY);
+ Reference< XNameAccess > xColumnDefinitions;
if ( xColSup.is() )
{
- Reference< XNameAccess > xColumnDefinitions = xColSup->getColumns();
+ xColumnDefinitions = xColSup->getColumns();
if ( xColumnDefinitions.is() )
m_pColumnMediator = new OContainerMediator( m_pColumns, xColumnDefinitions, m_xConnection, OContainerMediator::eColumns );
}
@@ -236,19 +237,29 @@ void OQuery::rebuildColumns()
}
Sequence< ::rtl::OUString> aNames = xColumns->getElementNames();
- const ::rtl::OUString* pBegin = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
- for ( ;pBegin != pEnd; ++pBegin)
+ Sequence< ::rtl::OUString> aDefintionNames;
+ bool bApplyDefinitionNames = false;
+ //if ( xColumnDefinitions.is() )
+ //{
+ // aDefintionNames = xColumnDefinitions->getElementNames();
+ // bApplyDefinitionNames = aDefintionNames.getLength() == aNames.getLength();
+ //}
+
+ ::rtl::OUString sEmpty;
+ const ::rtl::OUString* pIter = aNames.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aNames.getLength();
+ for ( sal_Int32 i = 0;pIter != pEnd; ++pIter,++i)
{
- Reference<XPropertySet> xSource(xColumns->getByName( *pBegin ),UNO_QUERY);
- OQueryColumn* pColumn = new OQueryColumn( xSource, m_xConnection );
+ Reference<XPropertySet> xSource(xColumns->getByName( *pIter ),UNO_QUERY);
+ OQueryColumn* pColumn = new OQueryColumn( xSource, m_xConnection, bApplyDefinitionNames ? aDefintionNames[i] : sEmpty);
Reference< XChild > xChild( *pColumn, UNO_QUERY_THROW );
xChild->setParent( *this );
- implAppendColumn( *pBegin, pColumn );
+ ::rtl::OUString sNewName = bApplyDefinitionNames ? aDefintionNames[i] : *pIter;
+ implAppendColumn( sNewName, pColumn );
Reference< XPropertySet > xDest( *pColumn, UNO_QUERY_THROW );
if ( m_pColumnMediator.is() )
- m_pColumnMediator->notifyElementCreated( *pBegin, xDest );
+ m_pColumnMediator->notifyElementCreated( sNewName, xDest );
}
}
catch( const SQLContext& e )
diff --git a/dbaccess/source/core/inc/definitioncolumn.hxx b/dbaccess/source/core/inc/definitioncolumn.hxx
index c5151e6bffd5..b67b0de70c59 100644
--- a/dbaccess/source/core/inc/definitioncolumn.hxx
+++ b/dbaccess/source/core/inc/definitioncolumn.hxx
@@ -167,7 +167,8 @@ namespace dbaccess
public:
OQueryColumn(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxParserColumn,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::rtl::OUString& _sNewName
);
// XTypeProvider
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
index 2af41d70cc13..6e522dd293f0 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -126,8 +126,14 @@ SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getEntryType( SvLBoxEntry*
return etQuery;
}
+ while( pEntryParent != pQueries )
+ {
+ pEntryParent = m_pTreeView->getListBox().GetParent(pEntryParent);
+ if ( !pEntryParent )
+ return etUnknown;
+ }
- return etUnknown;
+ return etQueryContainer;
}
//------------------------------------------------------------------------------
void SbaTableQueryBrowser::select(SvLBoxEntry* _pEntry, sal_Bool _bSelect)
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 8377edda3017..5b32eff98d25 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1109,8 +1109,38 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS
::rtl::OUString sPath = sCommand.getToken( 0, '/', nIndex );
pObject = m_pTreeView->getListBox().GetEntryPosByName(sPath, pCommandType);
pCommandType = pObject;
- if (_bExpandAncestors && nIndex >= 0 )
- m_pTreeView->getListBox().Expand(pCommandType);
+ if ( nIndex >= 0 )
+ {
+ if (ensureEntryObject(pObject))
+ {
+ DBTreeListUserData* pParentData = static_cast< DBTreeListUserData* >( pObject->GetUserData() );
+ Reference< XNameAccess > xCollection( pParentData->xContainer, UNO_QUERY );
+ sal_Int32 nIndex2 = nIndex;
+ sPath = sCommand.getToken( 0, '/', nIndex2 );
+ try
+ {
+ if ( xCollection->hasByName(sPath) )
+ {
+ if(!m_pTreeView->getListBox().GetEntryPosByName(sPath,pObject))
+ {
+ Reference<XNameAccess> xChild(xCollection->getByName(sPath),UNO_QUERY);
+ DBTreeListUserData* pEntryData = new DBTreeListUserData;
+ pEntryData->eType = etQuery;
+ if ( xChild.is() )
+ {
+ pEntryData->eType = etQueryContainer;
+ }
+ implAppendEntry( pObject, sPath, pEntryData, pEntryData->eType );
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ DBG_ERROR("SbaTableQueryBrowser::populateTree: could not fill the tree");
+ }
+ }
+ }
+ // m_pTreeView->getListBox().Expand(pCommandType);
}
while ( nIndex >= 0 );
}
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index aff63a9eb6f8..3cb44abcc17a 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -1117,6 +1117,13 @@ sal_Bool ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDef
::rtl::OUString sExpression = xGroup->getExpression();
if ( sExpression.getLength() )
{
+ static ::rtl::OUString s_sQuote(RTL_CONSTASCII_USTRINGPARAM("\"\""));
+ sal_Int32 nIndex = sExpression.indexOf('"');
+ while ( nIndex > -1 )
+ {
+ sExpression = sExpression.replaceAt(nIndex,1,s_sQuote);
+ nIndex = sExpression.indexOf('"',nIndex+2);SELECT "D4 Product"."P10 Color" || ',' || "D2 Market"."M04 Region" , "F1 Revenue"."1-01 Revenue (Sum All)" FROM "Sample Sales"
+ }
::rtl::OUString sFormula(RTL_CONSTASCII_USTRINGPARAM("rpt:HASCHANGED(\""));
TGroupFunctionMap::iterator aGroupFind = m_aGroupFunctionMap.find(xGroup);
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index 195b41aaa3c0..b49f6b0e7b9c 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -105,6 +105,7 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
sal_Int32 nLen = sValue.getLength();
if ( nLen )
{
+
const static ::rtl::OUString s_sChanged(RTL_CONSTASCII_USTRINGPARAM("rpt:HASCHANGED(\""));
sal_Int32 nPos = sValue.indexOf(s_sChanged);
if ( nPos == -1 )
@@ -112,7 +113,15 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
else
{
nPos = s_sChanged.getLength();
- --nLen;
+ static ::rtl::OUString s_sQuote(RTL_CONSTASCII_USTRINGPARAM("\"\""));
+ static ::rtl::OUString s_sSingleQuote(RTL_CONSTASCII_USTRINGPARAM("\""));
+ sal_Int32 nIndex = sValue.indexOf(s_sQuote,nPos);
+ while ( nIndex > -1 )
+ {
+ sValue = sValue.replaceAt(nIndex,2,s_sSingleQuote);
+ nIndex = sValue.indexOf(s_sQuote,nIndex+2);
+ }
+ nLen = sValue.getLength() - 1;
}
sValue = sValue.copy(nPos,nLen-nPos-1);
const ORptFilter::TGroupFunctionMap& aFunctions = _rImport.getFunctions();