diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-04-21 09:36:47 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-04-21 10:00:35 +0200 |
commit | 9b8feec33d95f10642ee013ae1310320feb62067 (patch) | |
tree | 70331932263b4b1c920f0ff2d8344b668d2e219b /dbaccess/source/ui/querydesign | |
parent | a4d7976c99b9ec49202dcac7e4dcb416755415bf (diff) |
tableNames_t is only used as a set
(cf. fde48126df56ede640499f24ac67f6754b84efbf "Replace map to sal_Bool with map
to bool")
Change-Id: I0bb24a78d15eb876565e64ce7ca0f4bb04dce2e2
Diffstat (limited to 'dbaccess/source/ui/querydesign')
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 29cfd715268f..4be4c8864e13 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -56,6 +56,7 @@ #include "sqlmessage.hxx" #include <unotools/syslocale.hxx> #include <memory> +#include <set> using namespace ::dbaui; using namespace ::utl; @@ -461,7 +462,7 @@ namespace } return BuildJoin(_xConnection, rRh, BuildTable(_xConnection,pLh), &data); } - typedef ::std::map< OUString,bool> tableNames_t; + typedef std::set<OUString> tableNames_t; void addConnectionTableNames( const Reference< XConnection>& _xConnection, const OQueryTableConnection* const pEntryConn, tableNames_t &_rTableNames ) @@ -469,13 +470,8 @@ namespace // insert tables into table list to avoid double entries const OQueryTableWindow* const pEntryTabFrom = static_cast<OQueryTableWindow*>(pEntryConn->GetSourceWin()); const OQueryTableWindow* const pEntryTabTo = static_cast<OQueryTableWindow*>(pEntryConn->GetDestWin()); - - OUString sTabName(BuildTable(_xConnection,pEntryTabFrom)); - if(_rTableNames.find(sTabName) == _rTableNames.end()) - _rTableNames[sTabName] = true; - sTabName = BuildTable(_xConnection,pEntryTabTo); - if(_rTableNames.find(sTabName) == _rTableNames.end()) - _rTableNames[sTabName] = true; + _rTableNames.insert(BuildTable(_xConnection,pEntryTabFrom)); + _rTableNames.insert(BuildTable(_xConnection,pEntryTabTo)); } void GetNextJoin( const Reference< XConnection>& _xConnection, OQueryTableConnection* pEntryConn, @@ -1004,9 +1000,8 @@ namespace { OUString sTabName(BuildTable(_xConnection,_pTableWindow)); - if(_rTableNames.find(sTabName) == _rTableNames.end()) + if(_rTableNames.insert(sTabName).second) { - _rTableNames[sTabName] = true; _rsTableListStr += sTabName; _rsTableListStr += ","; } |