summaryrefslogtreecommitdiff
path: root/sc/inc/dbdata.hxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-12-08 15:59:53 +0100
committerAndras Timar <andras.timar@collabora.com>2018-04-07 13:22:25 +0200
commitc40a1722f03c28522f8226574ed045e34eb80872 (patch)
tree846be4780bb5c042dfc1cd0e5a17b24336cd107f /sc/inc/dbdata.hxx
parent6eaf5fa22d90092c7261d17971896b61849e32dc (diff)
ofz#7121 NamedDBs::insert takes ownership of its argument
at one point this was based on std::auto_ptr and didn't free its arg on failure Adapt description to reality (cherry picked from commit f161cdc979587488df83e63002bee7ee15152d42) Reviewed-on: https://gerrit.libreoffice.org/51934 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit c4946ba195c9f0c2fb3f18f1028eea725c920e2e) Change-Id: I24133fb6c52bd7500037364120cb11d1b1f099c2 8aeed6876d80b7ebe4ebb5e2cfd12e00420bd207
Diffstat (limited to 'sc/inc/dbdata.hxx')
-rw-r--r--sc/inc/dbdata.hxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 328dd2a597e4..df6b88d4dbb9 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -257,8 +257,13 @@ public:
ScDBData* findByIndex(sal_uInt16 nIndex);
ScDBData* findByUpperName(const OUString& rName);
iterator findByUpperName2(const OUString& rName);
- // Takes ownership of p iff it returns true:
- SAL_WARN_UNUSED_RESULT bool insert(ScDBData* p);
+
+ /** Takes ownership of p and attempts to insert it into the collection.
+ Deletes p if it could not be inserted, i.e. duplicate name.
+ @return <TRUE/> if inserted, else <FALSE/>.
+ */
+ bool insert(ScDBData* p);
+
void erase(const iterator& itr);
bool empty() const;
size_t size() const;