summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
2014-02-20svl: sal_Bool -> boolStephan Bergmann
Change-Id: Ic31455a1f5ffffa35d4fdde901dd70734207b6f4
2014-02-19coverity#738853 Uninitialized scalar fieldCaolán McNamara
Change-Id: I01e72000f9e624b73351306e7d52c0ba18cbd8e1
2014-02-19coverity#738854 Uninitialized scalar fieldCaolán McNamara
Change-Id: Iace6e3f93f05342d7b1652e8118be01a142b82cc
2014-02-18Stick to a single O[U]String hash functionStephan Bergmann
8f8bc0dcf3bc253ae49159d52db049767f476ced "Move string hash function into String class" had introduced a new getHash64 that, besides returning sal_uInt64 instead of just sal_Int32, didn't do sampling of only a handful of characters, but always computed the hash over all characters (as the usage in SfxItemSet and SdPage appears to require for either performance or approximated correctness). However, it would be advantageous to keep the stable URE interface as small as possible. Now, O(1) sampling was apparently considered state of the art when the rtl string classes were first created, closely copying java.lang.String, which at that time demanded sampling for hashCode(), too---but never sampling more than 15 characters, with the obvious (in hindsight, at least) performance catastrophes, so they changed it to O(n) somewhere along the way. Based on that, this commit changes the existing hash functions to not do sampling any more, and removes the newly introduced -64 variants again. (Where the extended value range of sal_uInt64 compared to sal_Int32 was hopefully not vital to the existing uses.) The old implementation used sampling only for strings of length >= 256, so I did a "make check" build with an instrumented hash function that flagged all uses with inputs of length >= 256, and grepped workdir/{Cppunit,Junit,Python}Test for hits. Of the 2849 hits encountered, 2845 where in the range from 256 to 295 characters, and only the remaining four where of 2472 characters. Those four were from CppunitTest_sc_subsequent_filters_test, importing long text into a cell, causing ScDocumentImport::setStringCell to call svl::SharedStringPool::intern, which internally uses an unordered_set. These results appear to justify the change. Change-Id: I78fcc3b0f07389bdf36a21701b95a1ff0a0d970f
2014-02-18coverity#984145 Uninitialized scalar fieldCaolán McNamara
Change-Id: I08d4de5fc4cbc56feda0f57f95ae76cd25b124e3
2014-02-17ucbhelper: sal_Bool -> boolStephan Bergmann
Change-Id: Iee327c3dd75bebb35d99de01eaa7103956e08974
2014-02-13SimplificationStephan Bergmann
Change-Id: I949bf3cb9c3b26a8c2de6bde20cef63d7630fc54
2014-02-13-Werror,-Wunused-variableStephan Bergmann
Change-Id: I91ab5f87f859b855c858a41afd218f57b03ad3a2
2014-02-13n#757432: Styles (rename &) copy to different decks.Muthu Subramanian
While copying slides to different slide decks, styles were not being copied if there is already one with the same name. This patch renames and copies those to keep the formatting intact. Change-Id: I66f71493f1fd658eed43e39aa7ae7ee7b5463b34
2014-02-12remove SvStream::operator>> methodsNoel Grandin
in favour of ReadXXX methods. Change-Id: Ic2c0a7b6b92ff4c236ae99b39d77f3d935b301e3 Reviewed-on: https://gerrit.libreoffice.org/7915 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-02-12more SvStream:operator>> conversionNoel Grandin
Convert the template based read_lenPrefixed methods to regular methods. Change-Id: Ifd0e93aca055e55a0575e4377ec2b8e266dfb019 Reviewed-on: https://gerrit.libreoffice.org/7895 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-12convert SvStream::operator>> methods to ReadXXX methodsNoel Grandin
First, I updated the clang rewriter to do the conversion. Then I lightly hand-tweaked the output for the few places where the rewriter messed up, mostly when dealing with calls on "this". Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9 Reviewed-on: https://gerrit.libreoffice.org/7879 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-11coverity#440944 Logically dead codeCaolán McNamara
Change-Id: Ie01738985311c915ca9f2d8dd47ca6cb96d1b26c
2014-02-05SfxItemSet::operator == should return boolStephan Bergmann
...and need not be virtual Change-Id: I8cf38c4942526c6ca66595fdc3297be750ec09a0
2014-02-04convert specialised SvStream::operator>> methods to ReadXXX methodsNoel Grandin
as preparation for converting the SvStream::operator>> methods on primitive types Change-Id: I62f134bced15c687d6e0d46924f56e8d1c3d95b9 Reviewed-on: https://gerrit.libreoffice.org/7798 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-01-30fdo#63154 Removed unused solar.h ref. in linguc., sfx2, starmath, svl and svxAlexandre Vicenzi
Change-Id: I241661119371b75804fcf9215ff5e5da2a5b9265 Reviewed-on: https://gerrit.libreoffice.org/7732 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-01-29bool improvementsStephan Bergmann
Change-Id: I0dc09b7a6ee2849bd0c2ffc31be45f81cd2c15ee
2014-01-28bool improvementsStephan Bergmann
Change-Id: I6cf511b92383f3cd60923620518b9233b82850c0
2014-01-23Let C++ inline functions return bool instead of sal_BoolStephan Bergmann
...to improve diagnosing misuses of boolean expressions in client code (cf. compilerplugins/clang/implicitboolconversion.cxx). This change should be transparent to client code. Missing overloads of insert() for bool have been added to OStringBuffer and OUStringBuffer (which required dropping one !VALID_CONVERSION check that would now pick that overload, but would be flagged by compilerplugins/clang/pointertobool.cxx). Change-Id: I2d64cd923b8f47bfaa31e753def6515c29a3f8c9
2014-01-22convert more SvStream::operator<< callsNoel Grandin
.. to more explicit SvStream::Write* calls This was done using another run of the clang rewriter, and then a lot of hand tweaking to fix all the places where the rewriter did not play nice with various macros. Change-Id: I7bcab93851c8dfb59cde6bc76290c6484d88fb18 Reviewed-on: https://gerrit.libreoffice.org/7494 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-01-22Clean up SfxItemSet::PutStephan Bergmann
* Make inherited overloads visible via "using" in SfxAllItemSet. * The overload with SfxItemSet argument: ** need not be virtual (verified by temporarily marking it SAL_FINAL); ** should apparently return bool. Change-Id: I5c57ec3d757d3d32a3e23be12964e7ebb81e6211
2014-01-22bool improvements (related to mixing bool/sal_Bool in &=, |=, ^=)Stephan Bergmann
Change-Id: I9869d9709f28b68ef7b518527175589d80644668
2014-01-21bool improvementsStephan Bergmann
Change-Id: I5c72b0bc34d87312437ae32a506567c3fb3bfa19
2014-01-21bool improvementsStephan Bergmann
Change-Id: I28697ffd7902321730435e15fcf3018c78a61c5f
2014-01-17Translate German ("kein break") comments to English ("no break").Sven Wehner
Change-Id: Ibbc706d1c3cd36e21da2a15077392f9d75ba39fd Reviewed-on: https://gerrit.libreoffice.org/7498 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-01-16convert SvStream::operator<< overloads to more explicit methodsNoel Grandin
This is in preparation for more conversion of SvStream::operator<< calls to use more explicit method names. This converts the subclasses that have their own convenience overloads of operator<< to use normal methods. Change-Id: I5efd5d9a24c264cb86d2471303dd5849bf91ba80
2014-01-16fdo#54938: Convert svx and svl to cppu::supportsService...Marcos Paulo de Souza
...final season Change-Id: Ie51ac231def4a8a6e2681b81de7580798c95eed2
2014-01-10Use boolStephan Bergmann
Change-Id: I38f7ec288b907e889c71821cfbfac46a9688ba0c
2014-01-10SfxItemSet::Set should return boolStephan Bergmann
Change-Id: Icb38319f1307e94ce5c6d43b999a08db1fc38d85
2014-01-10SfxPoolItem::operator ==, != should return boolStephan Bergmann
...and SfxEnumItemInterface::HasBoolValue, too. Change-Id: Ia032e3d35a4c3b4c1efdc515ca36e466be03fc0a
2014-01-10re-write SvStream operator<< to non-overloaded methodsNoel Grandin
This is the actual re-write. Use a clang rewriter to rewrite SvStream::operator<< to methods like WriteuInt32. Note that the rewriter is not perfect, and I hand-tweaked the output. In particular, I had to adjust places doing things like (*this) << 1; Change-Id: I5923eda3f4ebaa8b452b6ef109e726e116235a2a Reviewed-on: https://gerrit.libreoffice.org/7342 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-01-07Fix typo in my commitNoel Grandin
Fix typo in my commit 82625bb98e256b83351328d3bf2a14e3dd244eef "remove unnecessary sal_Unicode casts in OUStringBuffer::append calls" Change-Id: I593c6a8ce5be3d4e2783acd3800626d7eb9a0480
2014-01-07remove unnecessary sal_Unicode casts in OUStringBuffer::append callsNoel Grandin
Convert code like: buf.append( static_cast<sal_Unicode>('!') ); to: buf.append( '!' ); Change-Id: Iacb03a61de65a895540940953b49620677b3d051
2013-12-27cppcheck: fix var reassignedJulien Nabet
Change-Id: I10bb64672d02626814c162b09b8bdd615f7fcad8
2013-12-23fix crash when erasing entry while iterating through vectorMarkus Mohrhard
Broadcast might result in calling Remove on the same object which erases the entry from the listeners vector. If we create a copy we can still iterate through the vector as all iterators are still valid.
2013-12-23iterators are not pointersEike Rathke
Change-Id: Ic9809beead66cf0d0e6a6a28bb97b220fb667578
2013-12-21Make the broadcasting work even when about to destruct.Jan Holesovsky
Change-Id: Idba9302e1ec5234d3d472cda047c09ba52afd328
2013-12-21Don't call EndListening() on already destructed listeners.Jan Holesovsky
Change-Id: I9bda35f2246de9d37077dda33c710b89ee008e5a
2013-12-21Speedup destruction of sheets with too many listeners & broadcasters.Jan Holesovsky
Listeners and broadcasters are M:N relationship. If you want to destruct them, you easily end up in O(M*N) situation; where for every listener, you iterate all broadcasters, to remove that one listener. To avoid that, announce to the broadcasters that they are going to die, and the listeners do not have to bother with removing themselves from the broadcaster. The broadcaster will not broadcast anything after the PrepareForDesctruction() call anyway. Change-Id: I68d78b23e73bcbb944de9139448b2c20dfa14f62
2013-12-20typo fixesAndras Timar
Change-Id: Ia5f104bfd707bcf4e159c78ca2764c861fb0b6d9
2013-12-19svl: whitespace fixes in grabbagitemMiklos Vajna
Change-Id: I363e8c0f1a51a18bf0ad0ac4f931107137fd1c58
2013-12-17Adapt all (non-extension, SharedLibrary) .components to environment="..."Stephan Bergmann
Change-Id: I56f38bd786f3a026cb2908f28540dc9c4003af83
2013-12-17remove unnecessary double calls to OUString constructorNoel Grandin
Change-Id: Ib2690e3ec9987b97363687b61fe8ddae4ace9058
2013-12-12simplify - use OUString::startsWith where possibleNoel Grandin
Convert code like if( !aStr.isEmpty() && aStr[0] == 'x' ) to if( aStr.startsWith("x") ) Change-Id: Iabc3a44ed3be2d29eed876e0eeef212ccd271edf
2013-12-12Don't hold css::uno::Type instances by pointerStephan Bergmann
...in comphelper::PropertyMapEntry and SfxItemPropertyMapEntry. And as the arrays of such need to be initialized dynamically anyway, also change their name members to proper OUStrings while at it. Plus some const clean-up. Change-Id: I67d4d7b5773fb020605f369daf39528bec930606
2013-12-11Revert "Don't hold css::uno::Type instances by pointer"Stephan Bergmann
This reverts commit 90f91088d238469b4a2262c91de3117ba40f5bde for now: Ach, old GCC doesn't like plain string literals to initialize members of OUString type... Change-Id: I50563a00406259bb5d41831e2a2796762450d097
2013-12-11Don't hold css::uno::Type instances by pointerStephan Bergmann
...in comphelper::PropertyMapEntry and SfxItemPropertyMapEntry. And as the arrays of such need to be initialized dynamically anyway, also change their name members to proper OUStrings while at it. Plus some const clean-up. Change-Id: I67d4d7b5773fb020605f369daf39528bec930606
2013-12-10Typos (mainly "propably")Julien Nabet
Change-Id: Ifeecd82f98f9be9f90d293a7b68691f91d7bbc34
2013-12-10svl: remove SfxDateTimeItem, which is actually unusedMichael Stahl
... since 2f44516d6c3fce6ebe372214ce4bfa11875bd3d1 Change-Id: I25905a69464a43e12fcbb4770c8b0e171ab3271b
2013-12-10editeng: fix more 32-bit Time breakageMichael Stahl
SfxDateTimeItem and SvxExtTimeField need to use 64-bit integer to store Time as well. These classes also have binary serialization Load()/Save() methods but they are unlikely to be used in a persistent way, just for the clipboard. The problem is easy to reproduce in Impress: Insert->Field->Time(fixed) (regression from 9830fd36dbdb72c79703b0c61efc027fba793c5a) Change-Id: I5946c5b94dd5a509805b6dc40461bbd910caffc4