Commit graph

154 commits

Author SHA1 Message Date
Noel Grandin
6f50961e69 remove more rtl::OUString and OString prefixes
which seem to have snuck back in since the great rounds of removals.

Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1
Reviewed-on: https://gerrit.libreoffice.org/62229
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24 14:43:34 +02:00
Jan-Marek Glogowski
16a338e173 Convert ImplFontCache to use o3tl::lru_map
We still do our own cleanup of the LRU map, as we can't drop
any fonts in use.

Change-Id: I8ec5c6ce8f80893635621357e9085950e7010f5b
Reviewed-on: https://gerrit.libreoffice.org/61455
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-06 16:23:44 +02:00
Jan-Marek Glogowski
612339e574 Add a glyph-bound-rect cache to the font cache
This way the font cache can correctly invalidate the cached glyph
rects when a font is dropped from the cache.

Change-Id: I050866099742334f01cac1b872228a017ddb5e9b
Reviewed-on: https://gerrit.libreoffice.org/61371
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-06 15:17:52 +02:00
Noel Grandin
bb2ff07564 loplugin:useuniqueptr in SwHTMLPosFlyFrames
and add a new method erase_extract to o3tl::sorted_vector, otherwise
there is no decent way to extract an element from such a vector without
freeing it.

Change-Id: I769782c04a54a2d7433e8349c99134f997a54689
Reviewed-on: https://gerrit.libreoffice.org/61345
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-06 08:16:24 +02:00
Jan-Marek Glogowski
e7d5bad5ae lru_map: fix std::move insert
After the move the std::pair is invalid.
That caused invalid iterators on lookups - hard to debug...
Also adds an assertion to warn if size of map and list differ.

Change-Id: Ib987d47963d5e1009d64a96dcdd588a0bc27cd77
Reviewed-on: https://gerrit.libreoffice.org/61451
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-06 02:25:40 +02:00
Noel Grandin
04c5f27e8f loplugin:useuniqueptr in SetGetExpFields
and a couple more utility methods to o3tl::sorted_vector to make this
easier

Change-Id: Iebbbb8899b67fffa1ac98ae46b7fa70a7e35f866
Reviewed-on: https://gerrit.libreoffice.org/61344
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-04 12:46:33 +02:00
Noel Grandin
0bc059f2a8 implement find(T*) for o3tl::sorted_vector when it contains unique_ptr<T>
and add some unit tests

Change-Id: I9a01c9fa2fbbf3a553663a980ee6e958f9819645
Reviewed-on: https://gerrit.libreoffice.org/60737
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-19 10:33:28 +02:00
Noel Grandin
fad919eb0d make SwWriteTableRows be a vector of std::unique_ptr
and update o3tl::sorted_vector to handle that

Change-Id: I11a9ec3ec09f835cbd7e49ccda133b9f210d761e
Reviewed-on: https://gerrit.libreoffice.org/59931
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06 09:41:48 +02:00
Stephan Bergmann
9ab68b9fb0 32-bit Clang trunk (towards Clang 9) still doesn't have __mulodi4
Change-Id: I7579ff88d34c931a51c820b53960a281e6e3678e
Reviewed-on: https://gerrit.libreoffice.org/59763
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-29 15:10:16 +02:00
Stephan Bergmann
2d2ccd18ea RTF picture sizes are 32-bit signed
...not 16-bit unsigned.  Word2007RTFSpec9.docx states "A small number of control
words take values in the range −2,147,483,648 to 2,147,483,647 (32-bit signed
integer)." and for \picwN, \pichN, \picwgoalN, and \pichgoalN it states "The N
argument is a long integer."

This was found with Clang's new -fsanitize=implicit-conversion during
CppunitTest_writerfilter_rtftok, where
writerfilter/qa/cppunittests/rtftok/data/pass/TCI-TN65GP-DDRHDLL-partial.rtf
contains "\pich81306":

> Testing file:///home/sbergman/lo/core/writerfilter/qa/cppunittests/rtftok/data/pass/TCI-TN65GP-DDRHDLL-partial.rtf:
[...]
> writerfilter/source/rtftok/rtfdispatchvalue.cxx:770:48: runtime error: implicit conversion from type 'int' of value 81306 (32-bit, signed) to type 'sal_uInt16' (aka 'unsigned short') changed the value to 15770 (16-bit, unsigned)
>  #0 in writerfilter::rtftok::RTFDocumentImpl::dispatchValue(writerfilter::rtftok::RTFKeyword, int) at writerfilter/source/rtftok/rtfdispatchvalue.cxx:770:48 (instdir/program/libwriterfilterlo.so +0xb96f2f)
>  #1 in writerfilter::rtftok::RTFTokenizer::dispatchKeyword(rtl::OString const&, bool, int) at writerfilter/source/rtftok/rtftokenizer.cxx:311:29 (instdir/program/libwriterfilterlo.so +0xd86c93)
>  #2 in writerfilter::rtftok::RTFTokenizer::resolveKeyword() at writerfilter/source/rtftok/rtftokenizer.cxx:243:12 (instdir/program/libwriterfilterlo.so +0xd84b06)
>  #3 in writerfilter::rtftok::RTFTokenizer::resolveParse() at writerfilter/source/rtftok/rtftokenizer.cxx:123:27 (instdir/program/libwriterfilterlo.so +0xd8299a)
>  #4 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:786:27 (instdir/program/libwriterfilterlo.so +0xbf03bd)
>  #5 in RtfFilter::filter(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) at writerfilter/source/filter/RtfFilter.cxx:144:20 (instdir/program/libwriterfilterlo.so +0x132d911)
>  #6 in RtfTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) at writerfilter/qa/cppunittests/rtftok/testrtftok.cxx:58:27 (workdir/LinkTarget/CppunitTest/libtest_writerfilter_rtftok.so +0x15c6e)
>  #7 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:130:20 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x5724c)
>  #8 in test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:155:5 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x57ec9)
>  #9 in RtfTest::test() at writerfilter/qa/cppunittests/rtftok/testrtftok.cxx:78:5 (workdir/LinkTarget/CppunitTest/libtest_writerfilter_rtftok.so +0x16214)

(Needs to add o3tl::clamp as a compatibility wrapper for C++17 std::clamp.)

Change-Id: I515e70a435c2585777062fd5a27d1de8ddbe1b74
Reviewed-on: https://gerrit.libreoffice.org/59038
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
2018-08-15 10:59:00 +02:00
Gabor Kelemen
bdb0775a26 Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories from filter to jvmfwk

Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5
Reviewed-on: https://gerrit.libreoffice.org/58204
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-30 09:28:40 +02:00
Stephan Bergmann
de573ba8e6 o3tl: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)
...by removing explicitly user-provided functions that do the same as their
implicitly-defined counterparts, but may prevent implicitly declared copy
functions from being defined as non-deleted in the future

Change-Id: If3430e23fff7bb0da12ae20579696869bdf9b3d8
Reviewed-on: https://gerrit.libreoffice.org/58082
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-26 20:44:51 +02:00
Michael Stahl
98e4c241e9 o3tl: add more strong_int operators
Change-Id: Ibb0f883353b6d172275744eaa59d27ba39930623
Reviewed-on: https://gerrit.libreoffice.org/55264
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-06-04 11:53:39 +02:00
Noel Grandin
a28a839b9f no need declare these tag structs separately
Change-Id: I00f336ee4eced431155c79bee6e2373e145ae95c
Reviewed-on: https://gerrit.libreoffice.org/54780
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-25 12:34:37 +02:00
Stephan Bergmann
649313625b New o3tl::temporary to simplify calls of std::modf
...that ignore the out-parameter integral part

Change-Id: I05f07c1a8909023232f8aecf75ea5541d4eb81ca
Reviewed-on: https://gerrit.libreoffice.org/54474
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-17 21:03:12 +02:00
Noel Grandin
8094fa1720 improve commit 95eb921ec06ee7
"tdf#108608 more Draw text editing responsiveness fixes"

lru_map is fine on Windows, was a bug in the new clear method I
added.

Change-Id: I27565675dfe0f57e2ba3c3e0c50297770761dc6a
Reviewed-on: https://gerrit.libreoffice.org/52728
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-11 19:01:21 +02:00
Noel Grandin
8a94d3dcfa tdf#108608 more Draw text editing responsiveness fixes
Turns out Windows is rather slow at at calculating glyph outlines
(compared to Linux), I'm guessing it does no caching at all, so
just add our own little cache.

I tried to use o3tl::lru_map here, but it crashes under MSVC2015.

Change-Id: I78d2a787ec8f734fa821f41f13236771efa1c8d4
Reviewed-on: https://gerrit.libreoffice.org/52623
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-11 10:07:19 +02:00
Caolán McNamara
b99af181a4 ofz#6432 bad-cast
ofz#6433 head-use-after-free
ofz#6435 bad-cast

Change-Id: Ic43edbab68d96e852039c3247853074180fd5091
Reviewed-on: https://gerrit.libreoffice.org/49984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-19 15:21:38 +01:00
Caolán McNamara
e89964ebb3 ofz: Pos2Page returns true on same value that returned false previously
a failed position returns false, but stays at the failed position, so
next time its called without moving it then it returns true

store what we return for a given position for reuse if the position
doesn't change

Change-Id: I404c65ac89eb6f5c867f62a62028b87effdbcbf8
Reviewed-on: https://gerrit.libreoffice.org/49308
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-07 10:25:25 +01:00
Mike Kaganski
1e96364cf0 o3tl: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: Id9d038d50d5b6335a2f354c759b2c1e5dd413cec
Reviewed-on: https://gerrit.libreoffice.org/49037
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-01 17:56:23 +01:00
Andrea Gelmini
9ec6f974a3 Fix typos
Change-Id: I4f15a41b7a67abe9f2c45b6004948decd58a8360
Reviewed-on: https://gerrit.libreoffice.org/48832
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-29 15:33:05 +01:00
Caolán McNamara
9482339287 ofz#5621 Integer-overflow
Change-Id: Ie0a7c29428e686e5c480997b84b8d12e5be4539f
Reviewed-on: https://gerrit.libreoffice.org/48790
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-28 18:15:07 +01:00
Stephan Bergmann
64c9bda0b9 Remove include of config_global.h from sal/config.h
(where it is not actually needed), and instead include it where needed

Change-Id: I107f8d4002d3001393b89834dd30a30b0c53a792
Reviewed-on: https://gerrit.libreoffice.org/48152
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-19 09:35:22 +01:00
Stephan Bergmann
e1771984c5 More loplugin:cstylecast: o3tl
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I7cb2c6ff2421d615599d178dc6eb3d62dd1becf7
2018-01-12 20:19:27 +01:00
Michael Stahl
3331aecdf8 o3tl: 32-bit clang 4.0.1 fails with undefined reference to `__mulodi4'
... so prevent it from using __builtin_mul_overflow().

Change-Id: Id716f88abb0385701b6df42353b663479abfd496
2017-12-11 17:47:26 +01:00
Caolán McNamara
7ee3953ce5 ofz#3819 Integer-overflow
Change-Id: Ic45692152b039c0ee2f5659d7739c3a2517c5e83
Reviewed-on: https://gerrit.libreoffice.org/43876
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-27 12:28:30 +02:00
Noel Grandin
02a3abccee array_view std::hash override should be const
Change-Id: I8ffdf86e98e261b337cfa81b1be0cb64539c9a9c
Reviewed-on: https://gerrit.libreoffice.org/43871
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-26 15:47:12 +02:00
Stephan Bergmann
ade8521657 Fix o3tl::saturating_add for negative b
Change-Id: I665f6c2f94b6c03d6fb5136fff3054ad6f0ca962
2017-10-26 15:33:40 +02:00
Noel Grandin
a0032a2dc2 improve o3tl::enumarray const-ness
Change-Id: I7b0d10b024edf604a7dea0e3b1399073f4bcba92
Reviewed-on: https://gerrit.libreoffice.org/43773
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-25 16:42:08 +02:00
Caolán McNamara
7b0bb820bb add checked_sub
Change-Id: I440cd18c249f38194cfd3dfd4a1fc4b7f80858d6
Reviewed-on: https://gerrit.libreoffice.org/43810
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25 15:19:15 +02:00
Caolán McNamara
9cfb27ae6c add checked_add
Change-Id: I10cba898bba528f5f1bfbd583e27a6821c789ab9
Reviewed-on: https://gerrit.libreoffice.org/43779
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25 09:54:14 +02:00
Caolán McNamara
e26f8d2592 coverity#1401307 document checked 'Uncaught exception'
markup std::unique_ptr where coverity warns a dtor might throw exceptions which
won't throw in practice, or where std::terminate is an acceptable response if
they do

Change-Id: Icc99cdecf8d8b011e599574f0a05b59efd1c65c2
Reviewed-on: https://gerrit.libreoffice.org/41561
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-21 10:36:39 +02:00
Stephan Bergmann
97dcb242f5 Fix -fsanitize=signed-integer-overflow
during CppunitTest_sw_uiwriter (see below).  vmiklos suggested making that addition
saturating, so I introduced o3tl::saturating_add for that.

<https://ci.libreoffice.org/job/lo_ubsan/684/console>:
> /sw/source/core/layout/sectfrm.cxx:1964:23: runtime error: signed integer overflow: 6203 + 9223372036854774315 cannot be represented in type 'long'
>     #0 0x2b65623b9a65 in SwSectionFrame::Grow_(long, bool) /sw/source/core/layout/sectfrm.cxx:1964:23
>     #1 0x2b65625d6f51 in SwFrame::Grow(long, bool, bool) /sw/source/core/layout/wsfrm.cxx:1172:20
>     #2 0x2b6562385999 in SwSectionFrame::MakeAll(OutputDevice*) /sw/source/core/layout/sectfrm.cxx:749:12
>     #3 0x2b6561b6c728 in SwFrame::PrepareMake(OutputDevice*) /sw/source/core/layout/calcmove.cxx:346:5
>     #4 0x2b656257f355 in SwFrame::Calc(OutputDevice*) const /sw/source/core/layout/trvlfrm.cxx:1769:9
>     #5 0x2b656247d232 in lcl_InnerCalcLayout(SwFrame*, long, bool) /sw/source/core/layout/tabfrm.cxx:1522:13
>     #6 0x2b656247d635 in lcl_InnerCalcLayout(SwFrame*, long, bool) /sw/source/core/layout/tabfrm.cxx:1524:25
>     #7 0x2b656247d635 in lcl_InnerCalcLayout(SwFrame*, long, bool) /sw/source/core/layout/tabfrm.cxx:1524:25
>     #8 0x2b65624b9b2e in lcl_RecalcRow(SwRowFrame&, long) /sw/source/core/layout/tabfrm.cxx:1559:16
>     #9 0x2b65624b0a9f in SwTabFrame::MakeAll(OutputDevice*) /sw/source/core/layout/tabfrm.cxx:2454:29
>     #10 0x2b6561b6c728 in SwFrame::PrepareMake(OutputDevice*) /sw/source/core/layout/calcmove.cxx:346:5
>     #11 0x2b656257f355 in SwFrame::Calc(OutputDevice*) const /sw/source/core/layout/trvlfrm.cxx:1769:9
>     #12 0x2b6561b68bf1 in SwFrame::PrepareMake(OutputDevice*) /sw/source/core/layout/calcmove.cxx:249:13
>     #13 0x2b656257f355 in SwFrame::Calc(OutputDevice*) const /sw/source/core/layout/trvlfrm.cxx:1769:9
>     #14 0x2b6561b68bf1 in SwFrame::PrepareMake(OutputDevice*) /sw/source/core/layout/calcmove.cxx:249:13
>     #15 0x2b656257f355 in SwFrame::Calc(OutputDevice*) const /sw/source/core/layout/trvlfrm.cxx:1769:9
>     #16 0x2b6561b6e7de in SwFrame::OptPrepareMake() /sw/source/core/layout/calcmove.cxx:357:13
>     #17 0x2b6561fa557d in SwFrame::OptCalc() const /sw/source/core/inc/frame.hxx:889:9
>     #18 0x2b6561f6f40c in SwLayAction::FormatLayout(OutputDevice*, SwLayoutFrame*, bool) /sw/source/core/layout/layact.cxx:1368:13
>     #19 0x2b6561f6f04a in SwLayAction::FormatLayout(OutputDevice*, SwLayoutFrame*, bool) /sw/source/core/layout/layact.cxx:1363:29
>     #20 0x2b6561f8737e in SwLayAction::FormatLayoutTab(SwTabFrame*, bool) /sw/source/core/layout/layact.cxx:1576:25
>     #21 0x2b6561f6eb14 in SwLayAction::FormatLayout(OutputDevice*, SwLayoutFrame*, bool) /sw/source/core/layout/layact.cxx:1360:32
>     #22 0x2b6561f6f04a in SwLayAction::FormatLayout(OutputDevice*, SwLayoutFrame*, bool) /sw/source/core/layout/layact.cxx:1363:29
>     #23 0x2b6561f50723 in SwLayAction::InternalAction(OutputDevice*) /sw/source/core/layout/layact.cxx:550:25
>     #24 0x2b6561f47023 in SwLayAction::Action(OutputDevice*) /sw/source/core/layout/layact.cxx:341:5
>     #25 0x2b6564f03b8f in SwViewShell::ImplEndAction(bool) /sw/source/core/view/viewsh.cxx:280:9
>     #26 0x2b655ee80f89 in SwViewShell::EndAction(bool) /sw/inc/viewsh.hxx:605:9
>     #27 0x2b655edcccbe in SwCursorShell::EndAction(bool, bool) /sw/source/core/crsr/crsrsh.cxx:258:5
>     #28 0x2b6567ac5b5b in SwView::OuterResizePixel(Point const&, Size const&) /sw/source/uibase/uiview/viewport.cxx:1116:9
>     #29 0x2b65421f88c1 in SfxViewFrame::DoAdjustPosSizePixel(SfxViewShell*, Point const&, Size const&, bool) /sfx2/source/view/viewfrm.cxx:1490:13
>     #30 0x2b6542228d89 in SfxViewFrame::Resize(bool) /sfx2/source/view/viewfrm.cxx:2275:17
>     #31 0x2b654226038f in SfxFrameViewWindow_Impl::Resize() /sfx2/source/view/viewfrm2.cxx:73:9
>     #32 0x2b650ff227aa in vcl::Window::ImplCallResize() /vcl/source/window/event.cxx:522:5
>     #33 0x2b6510a8d5f6 in vcl::Window::Show(bool, ShowFlags) /vcl/source/window/window.cxx:2276:13
>     #34 0x2b6542132a1e in SfxBaseController::ConnectSfxFrame_Impl(SfxBaseController::ConnectSfxFrame) /sfx2/source/view/sfxbasecontroller.cxx:1250:13
>     #35 0x2b654212c985 in SfxBaseController::attachFrame(com::sun::uno::Reference<com::sun::frame::XFrame> const&) /sfx2/source/view/sfxbasecontroller.cxx:550:13
>     #36 0x2b6542084861 in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView(com::sun::uno::Reference<com::sun::frame::XModel2> const&, com::sun::uno::Reference<com::sun::frame::XFrame> const&, comphelper::NamedValueCollection const&, rtl::OUString const&) /sfx2/source/view/frmload.cxx:599:5
>     #37 0x2b65420777e9 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, com::sun::uno::Reference<com::sun::frame::XFrame> const&) /sfx2/source/view/frmload.cxx:716:13
>     #38 0x2b65b0ed3384 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1087:24
>     #39 0x2b65b0eb7531 in framework::LoadEnv::startLoading() /framework/source/loadenv/loadenv.cxx:372:20
>     #40 0x2b65b0eb0063 in framework::LoadEnv::loadComponentFromURL(com::sun::uno::Reference<com::sun::frame::XComponentLoader> const&, com::sun::uno::Reference<com::sun::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:158:9
>     #41 0x2b65b10e0078 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) /framework/source/services/desktop.cxx:618:12
>     #42 0x2b65b10e02fa in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) /framework/source/services/desktop.cxx:606:64
>     #43 0x2b657183ee13 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:50:51
>     #44 0x2b6533b674a3 in SwModelTestBase::loadURL(rtl::OUString const&, char const*, char const*) /sw/qa/extras/inc/swmodeltestbase.hxx:668:23
>     #45 0x2b6533b69aa0 in SwModelTestBase::load(rtl::OUString const&, char const*, char const*) /sw/qa/extras/inc/swmodeltestbase.hxx:639:16
>     #46 0x2b6533716c59 in SwUiWriterTest::createDoc(char const*) /sw/qa/extras/uiwriter/uiwriter.cxx:446:9
>     #47 0x2b6533b50a9d in SwUiWriterTest::testTdf108524() /sw/qa/extras/uiwriter/uiwriter.cxx:5101:5
>     #48 0x2b6533d7e36a in void std::_Mem_fn_base<void (SwUiWriterTest::*)(), true>::operator()<, void>(SwUiWriterTest*) const /home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:600:11
>     #49 0x2b6533d7e073 in void std::_Bind<std::_Mem_fn<void (SwUiWriterTest::*)()> (SwUiWriterTest*)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) /home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:1073:11
>     #50 0x2b6533d7da81 in void std::_Bind<std::_Mem_fn<void (SwUiWriterTest::*)()> (SwUiWriterTest*)>::operator()<, void>() /home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:1131:11
>     #51 0x2b6533d7c459 in std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (SwUiWriterTest::*)()> (SwUiWriterTest*)> >::_M_invoke(std::_Any_data const&) /home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:1871:2
>     #52 0x2b6533d7edf0 in std::function<void ()>::operator()() const /home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:2271:14
>     #53 0x2b6533d7aaf5 in CppUnit::TestCaller<SwUiWriterTest>::runTest() /workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175:7
>     #54 0x2b64ed1ff0ad in CppUnit::TestCaseMethodFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
>     #55 0x2b6508a28ea6 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /test/source/vclbootstrapprotector.cxx:39:14
>     #56 0x2b64ed1bdb77 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #57 0x2b64fca7f7f6 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89:12
>     #58 0x2b64ed1bdb77 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #59 0x2b64f8c39e73 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63:16
>     #60 0x2b64ed1bdb77 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #61 0x2b64ed13950f in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
>     #62 0x2b64ed1bdb77 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #63 0x2b64ed1b3da0 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:86:18
>     #64 0x2b64ed288efb in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::string const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:182:10
>     #65 0x2b64ed1fc12d in CppUnit::TestCase::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:5
>     #66 0x2b64ed2022e3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:5
>     #67 0x2b64ed20124d in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>     #68 0x2b64ed2022e3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:5
>     #69 0x2b64ed20124d in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>     #70 0x2b64ed2c88b6 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:5
>     #71 0x2b64ed287049 in CppUnit::TestResult::runTest(CppUnit::Test*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:149:3
>     #72 0x2b64ed2c9d57 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::string const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:3
>     #73 0x515fdd in (anonymous namespace)::ProtectedFixtureFunctor::run() const /sal/cppunittester/cppunittester.cxx:319:13
>     #74 0x51098f in sal_main() /sal/cppunittester/cppunittester.cxx:469:14
>     #75 0x50eaa2 in main /sal/cppunittester/cppunittester.cxx:376:1
>     #76 0x2b64eeeefc04 in __libc_start_main (/lib64/libc.so.6+0x21c04)
>     #77 0x433704 in _start (/workdir/LinkTarget/Executable/cppunittester+0x433704)> /sw/source/core/layout/sectfrm.cxx:1964:23: runtime error: signed integer overflow: 6203 + 9223372036854774315 cannot be represented in type 'long'

Change-Id: Idda17d4f03997f9cc0555103a27f480f33e43877
2017-10-06 09:33:56 +02:00
Mike Kaganski
1944e3ddc0 Rename and move SAL_U/W to o3tl::toU/W
Previosly (since commit 9ac98e6e34)
it was expected to gradually remove SAL_U/W usage in Windows code
by replacing with reinterpret_cast or changing to some bettertypes.
But as it's useful to make use of fact that LibreOffice and Windows
use compatible representation of strings, this commit puts these
functions to a better-suited o3tl, and recommends that the functions
be consistently used throughout Windows-specific code to reflect the
compatibility and keep the casts safe.

Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6
Reviewed-on: https://gerrit.libreoffice.org/43150
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-05 16:02:52 +02:00
Noel Grandin
4d830ab33c const correctness in o3tl::array_view
Change-Id: I44c1ace97ae44069c5a0c6a247aa8a0b49896ad3
Reviewed-on: https://gerrit.libreoffice.org/41985
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-06 15:18:33 +02:00
Noel Grandin
7aa7f4d9e4 loplugin:unnecessaryparen include c++ casts
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb
Reviewed-on: https://gerrit.libreoffice.org/41874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-04 10:52:41 +02:00
Stephan Bergmann
64d06e5f16 Fix o3tl::make_unique
...after 3f20471490 "use std::unique_ptr in
FlatFndBox: and extend o3tl::make_unique to cope with arrays"

Change-Id: I17a07d0be677aa4a5427be4a5c2f05ed8b675726
2017-07-14 08:52:33 +02:00
Dennis Francis
99cd7dc54f fix compile error due to missing include<functional>
Change-Id: I087c47084347c28f1af7881129de1a7b01960715
Reviewed-on: https://gerrit.libreoffice.org/39678
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2017-07-07 12:14:38 +02:00
Jochen Nitschke
db4741043d C++11 remove std::binary_function bases from functors
std::binary_function is deprecated since C++11 and removed in C++17

90% done with regexp magic.
removed obsolete <functional> includes.

The std::binary_function base class was used by deprecated
std::bind2nd, this was solved in individual commits.

The members first_argument_type and second_argument_type were used
in chart2/source/controller/dialogs/DataBrowserModel.cxx:
DataBrowserModel::implColumnLess and are inlined in this commit.

Change-Id: I60ded60a8d4afd59e15ac15a58e18d2498c9be5a
Reviewed-on: https://gerrit.libreoffice.org/39659
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-07 08:31:48 +02:00
Stephan Bergmann
538c649f79 -Werror=shadow (GCC 8)
> include/o3tl/lru_map.hxx:70:24: error: declaration of ‘iterator’ shadows a previous local [-Werror=shadow]
>          map_iterator_t iterator = mLruMap.find(rPair.first);
>                         ^~~~~~~~
> include/o3tl/lru_map.hxx:61:29: note: shadowed declaration is here
>      typedef list_iterator_t iterator;
>                              ^~~~~~~~

Change-Id: Ic0f8ab4609a06b713ffa6e8e9fdd04f0c42869d7
2017-06-27 18:02:32 +02:00
brainbreaker
2149d4a88e android:update safeint header to use the else implementation with clang
Clang toolchain does not defines the __builtin_mul_overflow for 32-bit
ARM. So, fallback to else implementation of checked_multiply when
building Android with Clang

Change-Id: I6120606f521ce121541a5b7f1150229258012d55
Reviewed-on: https://gerrit.libreoffice.org/39005
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-21 10:12:36 +02:00
Noel Grandin
470752f50c create o3tl::array_view
A very basic implementation of the proposed std::array_view, similar to
clang's llvm::ArrayRef.

Mostly cribbed from the string_view implementation :-)

Use it for the SfxDispatcher::setSlotFilter function

Change-Id: Ife7e4971741b41827e145787899872c9b2bea82b
Reviewed-on: https://gerrit.libreoffice.org/38817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17 15:08:07 +02:00
Noel Grandin
3f20471490 use std::unique_ptr in FlatFndBox
and extend o3tl::make_unique to cope with arrays

Change-Id: I84caa46ab5060f9777bfe275f229499cb0b407be
Reviewed-on: https://gerrit.libreoffice.org/38794
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-15 08:25:03 +02:00
Caolán McNamara
d8ea0efb03 coverity#1409892 silence Operands don't affect result
Change-Id: I283701880ea9e0a8485ef131afc93438c77451e1
2017-06-06 14:08:48 +01:00
Caolán McNamara
98a4aa7ca4 coverity#1409892 silence Operands don't affect result
this might work to make this appear deliberate to coverity

Change-Id: Iad11e72feb154991b04cfb5960bd06d33c6b96a0
Reviewed-on: https://gerrit.libreoffice.org/38116
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-29 00:42:50 +02:00
Stephan Bergmann
52ef15cbdb Revert "Fix typos"
This reverts commit 26a67002fc.  "Iff" is not a
typo, see 2a65bf32ec "Revert 'Typo: iff->if'".
2017-05-18 21:58:31 +02:00
Andrea Gelmini
26a67002fc Fix typos
Only replaced "iff" with "if"

Change-Id: Ib9dfa5c12b05500043147fe3b65f923b1b12a581
Reviewed-on: https://gerrit.libreoffice.org/37782
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-18 18:55:17 +02:00
Stephan Bergmann
a6f29aae36 Blind fix for MSVC 2017 warning C4018: '>=': signed/unsigned mismatch
...and get rid of the arbitrary, bogus 'long' strong_int ctor parameter
type

Change-Id: If71f4d3993e984b4089b74ff96dce75c68a6cf77
Reviewed-on: https://gerrit.libreoffice.org/37665
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-05-16 14:13:25 +02:00
Noel Grandin
a446d76ca4 catch out of range values in strong_int constructor
Change-Id: Ibcbb873fda6cb82ad8f575673705ba6cb16217e6
Reviewed-on: https://gerrit.libreoffice.org/37533
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-14 18:43:38 +02:00
Noel Grandin
c70d49c7c8 use strong_int for LanguageType
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448
Reviewed-on: https://gerrit.libreoffice.org/36629
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-26 08:50:54 +02:00