diff options
Diffstat (limited to 'oox/source/xls/querytablebuffer.cxx')
-rw-r--r-- | oox/source/xls/querytablebuffer.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx index 8f65fe1438db..2a4df73287ca 100644 --- a/oox/source/xls/querytablebuffer.cxx +++ b/oox/source/xls/querytablebuffer.cxx @@ -283,18 +283,14 @@ void QueryTable::importQueryTable( BiffInputStream& rStrm ) // create a new connection object that will store settings from following records OSL_ENSURE( maModel.mnConnId == -1, "QueryTable::importQueryTable - multiple call" ); - ConnectionRef xConnection = getConnections().createConnection(); - OSL_ENSURE( xConnection.get(), "QueryTable::importQueryTable - cannot create connection object" ); - if( xConnection.get() ) - { - maModel.mnConnId = xConnection->getConnectionId(); - - // a DBQUERY record with some PCITEM_STRING records must follow - bool bHasDbQuery = (rStrm.getNextRecId() == BIFF_ID_DBQUERY) && rStrm.startNextRecord(); - OSL_ENSURE( bHasDbQuery, "QueryTable::importQueryTable - missing DBQUERY record" ); - if( bHasDbQuery ) - xConnection->importDbQuery( rStrm ); - } + Connection& rConnection = getConnections().createConnectionWithId(); + maModel.mnConnId = rConnection.getConnectionId(); + + // a DBQUERY record with some PCITEM_STRING records must follow + bool bHasDbQuery = (rStrm.getNextRecId() == BIFF_ID_DBQUERY) && rStrm.startNextRecord(); + OSL_ENSURE( bHasDbQuery, "QueryTable::importQueryTable - missing DBQUERY record" ); + if( bHasDbQuery ) + rConnection.importDbQuery( rStrm ); } void QueryTable::importQueryTableRefresh( BiffInputStream& rStrm ) |