Kaydet (Commit) 044f7907 authored tarafından Eike Rathke's avatar Eike Rathke

TableRef: add ScDBData::GetColumnNameOffset()

Change-Id: Id80b9e8d1f54a8b795d0f4209bdf2f980f9a5344
üst 98ba3367
......@@ -112,6 +112,16 @@ public:
void SetStripData(bool bSet) { bStripData = bSet; }
void SetTableColumnNames( const ::std::vector< OUString >& rNames ) { maTableColumnNames = rNames; }
/** Finds the column named rName and returns the corresponding offset
within the table.
@returns -1 if not found.
XXX NOTE: there is no refresh of names or anything implemented yet, use
this only during document load time.
*/
sal_Int32 GetColumnNameOffset( const OUString& rName ) const;
OUString GetSourceString() const;
OUString GetOperations() const;
......
......@@ -603,6 +603,16 @@ void ScDBData::AdjustTableColumnNames( UpdateRefMode eUpdateRefMode, SCCOL nDx,
aNewNames.swap( maTableColumnNames);
}
sal_Int32 ScDBData::GetColumnNameOffset( const OUString& rName ) const
{
::std::vector<OUString>::const_iterator it(
::std::find( maTableColumnNames.begin(), maTableColumnNames.end(), rName));
if (it != maTableColumnNames.end())
return it - maTableColumnNames.begin();
return -1;
}
namespace {
class FindByTable : public unary_function<ScDBData, bool>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment