summaryrefslogtreecommitdiff
path: root/include/o3tl
AgeCommit message (Collapse)Author
2017-10-27ofz#3819 Integer-overflowCaolán McNamara
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-26array_view std::hash override should be constNoel Grandin
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-26Fix o3tl::saturating_add for negative bStephan Bergmann
Change-Id: I665f6c2f94b6c03d6fb5136fff3054ad6f0ca962
2017-10-25improve o3tl::enumarray const-nessNoel Grandin
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-25add checked_subCaolán McNamara
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-25add checked_addCaolán McNamara
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-21coverity#1401307 document checked 'Uncaught exception'Caolán McNamara
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-06Fix -fsanitize=signed-integer-overflowStephan Bergmann
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::star::uno::Reference<com::sun::star::frame::XFrame> const&) /sfx2/source/view/sfxbasecontroller.cxx:550:13 > #36 0x2b6542084861 in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView(com::sun::star::uno::Reference<com::sun::star::frame::XModel2> const&, com::sun::star::uno::Reference<com::sun::star::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::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::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::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:158:9 > #41 0x2b65b10e0078 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::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::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:606:64 > #43 0x2b657183ee13 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::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-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) 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-09-06const correctness in o3tl::array_viewNoel Grandin
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-04loplugin:unnecessaryparen include c++ castsNoel Grandin
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-07-14Fix o3tl::make_uniqueStephan Bergmann
...after 3f20471490c61b19fe4222f8c40df255051f6e3d "use std::unique_ptr in FlatFndBox: and extend o3tl::make_unique to cope with arrays" Change-Id: I17a07d0be677aa4a5427be4a5c2f05ed8b675726
2017-07-07fix compile error due to missing include<functional>Dennis Francis
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-07C++11 remove std::binary_function bases from functorsJochen Nitschke
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-06-27-Werror=shadow (GCC 8)Stephan Bergmann
> 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-21android:update safeint header to use the else implementation with clangbrainbreaker
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-17create o3tl::array_viewNoel Grandin
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-15use std::unique_ptr in FlatFndBoxNoel Grandin
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-06coverity#1409892 silence Operands don't affect resultCaolán McNamara
Change-Id: I283701880ea9e0a8485ef131afc93438c77451e1
2017-05-29coverity#1409892 silence Operands don't affect resultCaolán McNamara
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-18Revert "Fix typos"Stephan Bergmann
This reverts commit 26a67002fcb9381b54de6cae1aaa37120d49066a. "Iff" is not a typo, see 2a65bf32ec270484dcea4d22d3c93552dc0c24dd "Revert 'Typo: iff->if'".
2017-05-18Fix typosAndrea Gelmini
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-16Blind fix for MSVC 2017 warning C4018: '>=': signed/unsigned mismatchStephan Bergmann
...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-14catch out of range values in strong_int constructorNoel Grandin
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-04-26use strong_int for LanguageTypeNoel Grandin
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-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-12Revert "Work around clang-cl issue with MSVC's safeint.h for now"Stephan Bergmann
This reverts commit acbb7e3243afec515bf98b2b34454afc5320bf66. No longer needed with safeint.h from recent "Windows Software Development Kit - Windows 10.0.15063.137".
2017-04-10Clean up uses of SAL_U/SAL_W: embedservStephan Bergmann
Change-Id: I5a73acf6ccfc1709e95e55fa15c32ec6dda2657a
2017-04-07Introduce o3tl::string_view.hxx approximation of C++17 <string_view>Stephan Bergmann
...and use it in configmgr/source/writemodfile.hxx Change-Id: Ie683dc21010ed45cc454ff89bea0376994b351f2 Reviewed-on: https://gerrit.libreoffice.org/36270 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04Work around clang-cl issue with MSVC's safeint.h for nowStephan Bergmann
At least some C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\ safeint_internal.h, in the specialization of LargeIntRegMultiply::RegMultiply for signed __int64, contains an (unnecessary) C-style cast from l-value unsigned __int64 tmp RegMultiply( ..., ..., (unsigned _int64)tmp ) == SafeIntNoError ) which clang-cl correctly identifies as producing a prvalue (so cannot bind to the third 'unsigned __int64& ret' parameter of that RegMultiply call), while MSVC apparently has a non-standard mis-feature of treating such a "self-cast" as an lvalue. Until clang-cl learns about that mis-feature too, use the fallback implementation of o3tl/safeint.hxx when compiling with clang-cl. Change-Id: I7a454134589d958ad7ba845c37584b3aa7b94926 Reviewed-on: https://gerrit.libreoffice.org/36066 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-27create SfxInterfaceId o3tl::strong_intNoel Grandin
Change-Id: Ie52f63382a9fb36f9a472801be012b140bfb51f6 Reviewed-on: https://gerrit.libreoffice.org/35722 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-25Fix typosAndrea Gelmini
Change-Id: I998e9b2ad8ebdcc983239192cb61f6689e378ad9 Reviewed-on: https://gerrit.libreoffice.org/35633 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-22Use consistent include guard macro namesTor Lillqvist
Change-Id: Icc83a9a1257e422aa7593d6a8dd5af25a06a3384
2017-03-22check for overflow in multiplyCaolán McNamara
gcc >= 5 and clang have builtins for this msvc has safeint.h and functions in the msl::utilties namespace otherwise fall back to certs demo implementations Change-Id: I6001a278c24b0be4b381d933d256f01f91ead55d Reviewed-on: https://gerrit.libreoffice.org/35505 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-16Clean up integers representing positions in SwOutlineNodes vectorsStephan Bergmann
Change-Id: If1a6a9cb61ffd355a85835127e7c893969833587
2017-03-14make o3tl::strong_int constructor explicitNoel Grandin
Could have sworn I did this originally, somehow it got lost. Also fix a thinko in tools::ResId I introduced in commit 2b70fb58be039fbd05ea833a40b1b3e9f922e45c "Use o3tl::strong_int on RESOURCE_TYPE" Change-Id: Id3b39962255297010cd1feaaca6d822168311081 Reviewed-on: https://gerrit.libreoffice.org/35108 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03Remove uses of SAL_CONSTEXPR in LIBO_INTERNAL_ONLYStephan Bergmann
Change-Id: I9a7dc7c83302b3361f056fcf6636bbba7672f15f Reviewed-on: https://gerrit.libreoffice.org/34840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-02Remove HAVE_CXX11_CONSTEXPR, always true nowStephan Bergmann
...after 84b36c704d73362d4d86dc9e9c0efa0625958347 "Drop support for MSVC 2013". Make this a fatal configuration error for now. The check should be removed completely after LO 5.4 branch-off. Change-Id: I990fd8fcb4ec1327282df4efe21640c938d3cf06 Reviewed-on: https://gerrit.libreoffice.org/34821 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-22Revert "Fix typos"jan iversen
This reverts commit ffd7f8fcfc2b551509e9cb31c0920e0f64292ea7. Caused some problems, need to be broken down. Change-Id: Iee816a266c32e7cebe623d36300c13d079e77c52 Reviewed-on: https://gerrit.libreoffice.org/34534 Reviewed-by: jan iversen <jani@libreoffice.org> Tested-by: jan iversen <jani@libreoffice.org>
2017-02-22Fix typosAndrea Gelmini
Change-Id: I61764094dd6f8e13f29ca554373d30d1d5def447 Reviewed-on: https://gerrit.libreoffice.org/34476 Reviewed-by: jan iversen <jani@libreoffice.org> Tested-by: jan iversen <jani@libreoffice.org>
2017-02-13create strong_int template and use it in tools::UniqueIndexNoel Grandin
an experiment to see how useful a strong_int template works out Change-Id: Ib77700350f0fa3b018a1926233adf7a40d728d16 Reviewed-on: https://gerrit.libreoffice.org/34072 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-23New o3tl::runtimeToOUString to convert from C++ runtime NTBS to OUStringStephan Bergmann
Change-Id: I613bb70b6828f615fd45af38b2d873ece55ace60
2016-10-07might as well go back to a std::stack nowCaolán McNamara
after... commit 8daf6707ef203b26a744140f74d7cd231a25f0dd Author: Michael Stahl <mstahl@redhat.com> Date: Thu Oct 6 23:37:51 2016 +0200 xmloff: fix crash in ~XMLParaContext on fdo72541-1.fodt Change-Id: I57f10e60a2f76dde048a594d8391bb5b246dfc63
2016-10-04crashtesting: use a stack with the expected dtor order for its elementsCaolán McNamara
contains test document which crashes if it doesn't Change-Id: Ieeee6cc7007a90d37225fffd636c9648289f04d7
2016-09-20o3tl: replace yet another sal_Size with std::size_tMichael Stahl
Change-Id: I3f6a401d6d5ed7b44a71dc8bda559dcc4d57ee32
2016-09-19o3tl: refcounts should be native platform int widthThorsten Behrens
Change-Id: I19854d85b680612733557c42ee58b35adb5ea4c3 Reviewed-on: https://gerrit.libreoffice.org/29002 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-09-17fix warning in windows debug buildJochen Nitschke
> o3tl/typed_flags_set.hxx(82) : warning C4309: ´static_cast´ : > truncation of constant value Change-Id: I396b68e47d682ffe90ba3afb2ebf846cf100e20c Reviewed-on: https://gerrit.libreoffice.org/28977 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-09-16Try silence cid#1371124 ("Operands don't affect result")Stephan Bergmann
...where Coverity doesn't reveal which instantiation of the templated code it is complaining about, but it must be ScRefFlags (sc/inc/address.hxx), which has underlying type sal_uInt16 and a mask of 0xFFFF. Change-Id: If0abd195885acdffb3c61cdab88d7a2c87c00c4f
2016-06-10o3tl::tryGet on a temporary is dangerousStephan Bergmann
...so rename to o3tl::tryAccess to make it more obvious that the returned proxy points into the internals of the given Any, and forbid calling o3tl::tryAccess on a temporary Change-Id: Ia412c6b2b06693811b9b7f0076a08bbf97142df9