summaryrefslogtreecommitdiff
path: root/sd
AgeCommit message (Collapse)AuthorFilesLines
2021-06-11tdf#130428 remove unnecessary usage of SfxItemState::UNKNOWNArmin Le Grand (Allotropia)1-2/+2
FontworkBar::getState does not need to check for SfxItemState::UNKNOWN at all, actions solely depend on FontWork object being selected. This also greatly simplifies that method. Also, the optimization by passing in a variable to checkForSelectedFontWork and remember if already computed can be removed - also in other places where it had to be given, but was not re-used at all Change-Id: I35b1f36195feb1d645619665d2dd65a84b75b118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117014 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-06-10sd: ubsan - fix heap-use-after-free in SdOutlinerTomaž Vajngerl2-30/+36
OutlinerView can change (old one deleted and new one create) so we can't store it in a local vairable and need to always fetch it. UBSAN Error log: ==21484==ERROR: AddressSanitizer: heap-use-after-free on address 0x606000af7d28 at pc 0x2ab7c5979405 bp 0x7ffcd1a3d1a0 sp 0x7ffcd1a3d198 READ of size 8 at 0x606000af7d28 thread T0 -0 0x2ab7c5979404 in std::__uniq_ptr_impl<EditView, std::default_delete<EditView> >::_M_ptr() const /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:147:42 -1 0x2ab7c59792ea in std::unique_ptr<EditView, std::default_delete<EditView> >::get() const /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:337:21 -2 0x2ab7c59791d9 in std::unique_ptr<EditView, std::default_delete<EditView> >::operator*() const /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:322:2 -3 0x2ab7c59725da in OutlinerView::GetEditView() const /include/editeng/outliner.hxx:209:46 -4 0x2ab7c70e36bb in SdOutliner::SearchAndReplaceOnce(std::__debug::vector<sd::SearchSelection, std::allocator<sd::SearchSelection> >*) /sd/source/ui/view/Outliner.cxx:903:21 -5 0x2ab7c70dcb32 in SdOutliner::SearchAndReplaceAll() /sd/source/ui/view/Outliner.cxx:622:29 -6 0x2ab7c70da81b in SdOutliner::StartSearchAndReplace(SvxSearchItem const*) /sd/source/ui/view/Outliner.cxx:478:28 -7 0x2ab7c61e4fc5 in sd::FuSearch::SearchAndReplace(SvxSearchItem const*) /sd/source/ui/func/fusearch.cxx:128:44 -8 0x2ab7c5c61fc5 in sd::DrawDocShell::Execute(SfxRequest&) /sd/source/ui/docshell/docshel3.cxx:228:36 -9 0x2ab7c5cac074 in SfxStubDrawDocShellExecute(SfxShell*, SfxRequest&) /workdir/SdiTarget/sd/sdi/sdslots.hxx:18384:1 -10 0x2ab7cd885d8f in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) /sfx2/source/control/dispatch.cxx:253:9 -11 0x2ab7cd89bd8f in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) /sfx2/source/control/dispatch.cxx:753:9 -12 0x2ab7cd89ccd6 in SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxItemSet const*, SfxItemSet const*, unsigned short) /sfx2/source/control/dispatch.cxx:811:9 -13 0x2ab7cdd11d76 in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:738:46 -14 0x2ab7cdd15135 in SfxOfficeDispatch::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:243:16 -15 0x2ab7f54b25d7 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatch> const&, com::sun::star::util::URL const&, bool, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:159:30 -16 0x2ab7f54b1531 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:117:16 -17 0x2ab7f54b2d17 in non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx -18 0x2ab7e63c546f in unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:85:22 -19 0x2ab7b1a9ac2d in testSearchAllInDocumentAndNotes::TestBody() /sd/qa/unit/uiimpress.cxx:715:5 -20 0x2ab7b1b43f84 in void std::__invoke_impl<void, void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&>(std::__invoke_memfun_deref, void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14 -21 0x2ab7b1b43b5e in std::__invoke_result<void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&>::type std::__invoke<void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&>(void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:95:14 -22 0x2ab7b1b439b2 in void std::_Bind<void (testSearchAllInDocumentAndNotes::* (testSearchAllInDocumentAndNotes*))()>::__call<void, 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:467:11 -23 0x2ab7b1b43612 in void std::_Bind<void (testSearchAllInDocumentAndNotes::* (testSearchAllInDocumentAndNotes*))()>::operator()<void>() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:549:17 -24 0x2ab7b1b426a1 in std::_Function_handler<void (), std::_Bind<void (testSearchAllInDocumentAndNotes::* (testSearchAllInDocumentAndNotes*))()> >::_M_invoke(std::_Any_data const&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:316:2 -25 0x2ab7b1aec1f1 in std::function<void ()>::operator()() const /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:706:14 -26 0x2ab7b1b41984 in CppUnit::TestCaller<testSearchAllInDocumentAndNotes>::runTest() /workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175:7 -27 0x2ab765f655ba in CppUnit::TestCaseMethodFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5 -28 0x2ab780dd0937 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /test/source/vclbootstrapprotector.cxx:46:14 -29 0x2ab765f36c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 -30 0x2ab775453fd7 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:78:12 -31 0x2ab765f36c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 -32 0x2ab771f47962 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:62:16 -33 0x2ab765f36c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 -34 0x2ab765ecdf84 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12 -35 0x2ab765f36c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 -36 0x2ab765f30697 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:86:18 -37 0x2ab765fcfa79 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:182:28 -38 0x2ab765f63c21 in CppUnit::TestCase::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13 -39 0x2ab765f67a52 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30 -40 0x2ab765f66c4a in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3 -41 0x2ab765f67a52 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30 -42 0x2ab765f66c4a in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3 -43 0x2ab765ffd60e in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27 -44 0x2ab765fce4de in CppUnit::TestResult::runTest(CppUnit::Test*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:149:9 -45 0x2ab765ffe56b in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14 -46 0x4ff42e in (anonymous namespace)::ProtectedFixtureFunctor::run() const /sal/cppunittester/cppunittester.cxx:324:20 -47 0x4fb90c in sal_main() /sal/cppunittester/cppunittester.cxx:474:20 -48 0x4fa40e in main /sal/cppunittester/cppunittester.cxx:381:1 -49 0x2ab767c44554 in __libc_start_main (/lib64/libc.so.6+0x22554) -50 0x425e04 in _start (/workdir/LinkTarget/Executable/cppunittester+0x425e04) 0x606000af7d28 is located 8 bytes inside of 56-byte region [0x606000af7d20,0x606000af7d58) freed by thread T0 here: -0 0x4f75f0 in operator delete(void*) /home/tdf/lode/packages/llvm-llvmorg-9.0.1.src/compiler-rt/lib/asan/asan_new_delete.cc:160 -1 0x2ab7c70c42b1 in SdOutliner::Implementation::ProvideOutlinerView(Outliner&, std::shared_ptr<sd::ViewShell> const&, vcl::Window*) /sd/source/ui/view/Outliner.cxx:1988:17 -2 0x2ab7c70c1302 in SdOutliner::SetViewShell(std::shared_ptr<sd::ViewShell> const&) /sd/source/ui/view/Outliner.cxx:1743:17 -3 0x2ab7c70ed9f4 in SdOutliner::SetViewMode(PageKind) /sd/source/ui/view/Outliner.cxx:1571:5 -4 0x2ab7c70f309e in SdOutliner::SetObject(sd::outliner::IteratorPosition const&) /sd/source/ui/view/Outliner.cxx:1720:5 -5 0x2ab7c70f3db6 in SdOutliner::PrepareSearchAndReplace() /sd/source/ui/view/Outliner.cxx:1507:13 -6 0x2ab7c70d4b3f in SdOutliner::ProvideNextTextObject() /sd/source/ui/view/Outliner.cxx:1302:33 -7 0x2ab7c70e30f0 in SdOutliner::SearchAndReplaceOnce(std::__debug::vector<sd::SearchSelection, std::allocator<sd::SearchSelection> >*) /sd/source/ui/view/Outliner.cxx:892:17 -8 0x2ab7c70dcb32 in SdOutliner::SearchAndReplaceAll() /sd/source/ui/view/Outliner.cxx:622:29 -9 0x2ab7c70da81b in SdOutliner::StartSearchAndReplace(SvxSearchItem const*) /sd/source/ui/view/Outliner.cxx:478:28 -10 0x2ab7c61e4fc5 in sd::FuSearch::SearchAndReplace(SvxSearchItem const*) /sd/source/ui/func/fusearch.cxx:128:44 -11 0x2ab7c5c61fc5 in sd::DrawDocShell::Execute(SfxRequest&) /sd/source/ui/docshell/docshel3.cxx:228:36 -12 0x2ab7c5cac074 in SfxStubDrawDocShellExecute(SfxShell*, SfxRequest&) /workdir/SdiTarget/sd/sdi/sdslots.hxx:18384:1 -13 0x2ab7cd885d8f in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) /sfx2/source/control/dispatch.cxx:253:9 -14 0x2ab7cd89bd8f in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) /sfx2/source/control/dispatch.cxx:753:9 -15 0x2ab7cd89ccd6 in SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxItemSet const*, SfxItemSet const*, unsigned short) /sfx2/source/control/dispatch.cxx:811:9 -16 0x2ab7cdd11d76 in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:738:46 -17 0x2ab7cdd15135 in SfxOfficeDispatch::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:243:16 -18 0x2ab7f54b25d7 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatch> const&, com::sun::star::util::URL const&, bool, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:159:30 -19 0x2ab7f54b1531 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:117:16 -20 0x2ab7f54b2d17 in non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx -21 0x2ab7e63c546f in unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:85:22 -22 0x2ab7b1a9ac2d in testSearchAllInDocumentAndNotes::TestBody() /sd/qa/unit/uiimpress.cxx:715:5 -23 0x2ab7b1b43f84 in void std::__invoke_impl<void, void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&>(std::__invoke_memfun_deref, void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14 -24 0x2ab7b1b43b5e in std::__invoke_result<void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&>::type std::__invoke<void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&>(void (testSearchAllInDocumentAndNotes::*&)(), testSearchAllInDocumentAndNotes*&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:95:14 -25 0x2ab7b1b439b2 in void std::_Bind<void (testSearchAllInDocumentAndNotes::* (testSearchAllInDocumentAndNotes*))()>::__call<void, 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:467:11 -26 0x2ab7b1b43612 in void std::_Bind<void (testSearchAllInDocumentAndNotes::* (testSearchAllInDocumentAndNotes*))()>::operator()<void>() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:549:17 -27 0x2ab7b1b426a1 in std::_Function_handler<void (), std::_Bind<void (testSearchAllInDocumentAndNotes::* (testSearchAllInDocumentAndNotes*))()> >::_M_invoke(std::_Any_data const&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:316:2 -28 0x2ab7b1aec1f1 in std::function<void ()>::operator()() const /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:706:14 -29 0x2ab7b1b41984 in CppUnit::TestCaller<testSearchAllInDocumentAndNotes>::runTest() /workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175:7 Change-Id: I0b4616cd3813565bc58b7a84320cbf52dd654a3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116879 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-09Simplify Sequences initializations (sd)Julien Nabet3-24/+22
Change-Id: I968f1209961ba30ad0837846ae1ba4a9249663c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116934 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-09-Werror,-Wunused-but-set-variable (Clang 13 trunk)Stephan Bergmann2-12/+3
> sd/source/ui/dlg/BulletAndPositionDlg.cxx:707:14: error: variable 'sSelectStyle' set but not used [-Werror,-Wunused-but-set-variable] > OUString sSelectStyle; > ^ ...ever since the code's introduction in e3015d7021e689c71c2ed8e5dd01a74d832c84f0 "Add new customize and position merged dialog", and which means that SvxBulletAndPositionDlg::m_sBulletCharFormatName and second parameter of SvxBulletAndPositionDlg::SetCharFmts, both also introduced in that commit, were equally unused Change-Id: Id07c05777817298073d85719689b391bda533221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116821 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-09-Werror,-Wunused-but-set-variable (Clang 13 trunk)Stephan Bergmann1-2/+0
...after 096168cacc574a71482520e5c3fbd79f975dc6ad "loplugin:writeonlyvars" had removed the (only) read of sFirstCharFmt Change-Id: I8b59f54b2bb8669c66a14df80c4c74fceb56b1c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-08sd: split CppunitTest_sd_export_tests-ooxml2 into twoXisco Fauli4-1576/+1745
Change-Id: Ida23d59cd010d6fb9bf4fb8b5f82d2d764281773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116826 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-06-08tdf#47365 PPTX export: support loop attributeTibor Nagy3-0/+50
Follow-up to commit ad2809b4b6dc4837b0c1cadd89a14a234d995fb2 "tdf#47365: import support for PPTX presentation's loop attribute". Change-Id: I7f75acc2bbd6301384883691d5ef4069b1757a05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116560 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-06-08editengine-columns: PPTX support (tdf#118458)Mike Kaganski5-72/+144
The unit tests that used to check the workaround using tables to emulate columns (implemented in tdf#120028) are changed to test import of the columns. This reverts some commits related to the mentioned workaround, namely aef569ed83a3ccc02639e5b2a1c7cc131ba262fc, c50ae6a282ed83762bf634fed5c91033eb305c88, 7b64bd90637a6722438bf873b1ded74ab3424c46, 33696b2820ce3c8b21b753d2c2bf92345ecb9276, 99dff69b561a8fe2d9437e6aa67a9581a6666f41. Change-Id: I97693ad4a981780e822070938992f274920df5a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116738 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08editengine-columns: Implement layoutMike Kaganski5-12/+115
This changes the way how different parts access positions of lines and paragraphs. Now there is ImpEditEngine::IterateLineAreas, which performs uniform iteration over all ParaPortions and lines in order, calling a user-provided callback function for each portion and line; it passes all information about current portion, line, area, and column to the callback, and checks the return from the callback, to decide if it needs to continue iteration (in case when callback indicated that if doesn't need further data), and if it needs calling the callback for the rest of current portion's lines. This allows to have the code that calculates and iterates dimensions of lines in one central place, without the need to have duplicating logic in several places. One important exception is ImpEditEngine::Paint, which iterates without ImpEditEngine::IterateLineAreas, because it does many atomic paint operations in different points of iteration process, and implementing ImpEditEngine::IterateLineAreas to call callback in the required places would require increased complexity, which is left for a future change. To make that possible, ImpEditEngine::IterFlag should be extended to indicate additional requirements. Note that in fact, ImpEditEngine::Paint was taken as the model for implementation of ImpEditEngine::IterateLineAreas, with its detailed handling of all the vertical offsets like additional line spacing and interparagraph spacings that depend on context. The notable result of the centralization of the iteration code is slight change of heights reported by ImpEditEngine::CalcTextHeight. Previously it simply added all pre-calculated heights of portions, and not taking into account all the spacing handling that ImpEditEngine::Paint did, which was inconsistent (calculated height was different from painted height). Now ImpEditEngine::CalcTextHeight should provide more accurate results, which required small changes in the unit tests. Change-Id: I33cbb978deb974b314d36fda8674186a03991107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116034 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08editengine-columns: ODF support [API CHANGE]Mike Kaganski3-0/+82
This uses existing ODF markup, as used by Writer's text frame: style::columns child element of style:graphic-properties, its fo:column-count and fo:column-gap attributes. No ODF extension is required. Since currently only columns with same width and spacing are implemented, without additional settings, style:column child elements are exported, but ignored on import. This adds new property to css::drawing::TextProperties service: TextColumns (of type css::text::XTextColumns). Change-Id: I7e63293e5814b281ceec8a9632e696322d3629e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116035 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08editengine-columns: Create document model and dialog pageMike Kaganski2-0/+102
Change-Id: I056aad9474ca18134d1f1686a53618cc9ab3d525 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116038 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08Remove SfxItemState::READONLYArmin Le Grand2-2/+0
As I experimented with redesigning the whole Item/ItemSet/ItemPool paradigm, I alredy checked that SfxItemState::READONLY is not used (and no one really knows what it should do or stands for). Since a removal of complexity is needed to get forward with that redesign and I already made some experiences in branch item_refactor2, I propose to remove this state. It is not really used (gets never set). It is mirrored/used in the UNO API in css::frame::status::ItemState as 'READ_ONLY', but also not used in the office's code. ItenmState itself is used in three places, but all set the Item involved by using a SfxVoidItem to state SfxItemState::DISABLED, which I described in ItemState.idl. This means that no state of READ_ONLY in UNO API is ever imported to office code as DISABLED state at all, so not used. I also marked it as deprecated in the *.idl file. I think - including the experimenting in the mentioned branch - that this is safe for now. I already run a full 'make check' on the changed stuff. Change-Id: I8c15cf7b4f803076ecaaea67659f6e022ac7ef70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116752 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-06-07sd: use registerOOXMLNamespaces and registerODFNamespacesXisco Fauli5-102/+5
While at it, fix incorrect r:Relationships with rels:Relationships Change-Id: Ia8e6556b0e7d3839e00936626627471a7a276071 Change-Id: I77f950dabd4d2131256673e517625d31ade9aa76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116800 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-06-07sd: Use template for export test modulesXisco Fauli7-232/+120
Change-Id: Ib604d0ad64dc16dbf9c0115a0fb30a8e3c6da337 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116787 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-06-07Move PPTX testdoc to respective directoryMike Kaganski2-1/+1
Change-Id: I020998c8e8b2a715a7f0a924bd24e09082599a6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116788 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-07Resolves tdf#142513 fix zoom caller handlingJim Raykowski4-8/+10
Calling ZoomPlus has always executed shell SID_ZOOM_OUT case handling. ZoomMinus, which replaced ZoomIn, does SID_ZOOM_IN case handling. This patch changes ZoomPlus to do SID_ZOOM_IN case handling and ZoomMinus to do SID_ZOOM_OUT case handling and makes appropriate changes required by these name changes to provide expected zoom results in all module shells that have handling for these calls. Change-Id: If148f4f7866bfc8fc6452ad1c1dace723a125ef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116287 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2021-06-07tdf#142478 add test that triggers find all and crashesTomaž Vajngerl2-0/+25
String "Crash" in document and notes, then trigger "find all", which produced a crash without the fix in-place. Change-Id: I8e6e4a9da1afc85643648aee36a03c1fb39ca16d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116769 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-07Restrict test a bit to verify that there indeed is scalingMike Kaganski1-1/+1
... just to make sure that changes like a1ae30166e92a0a40dff06740f0bb8e9ee63f70a don't break the test. Change-Id: I4d9f8a6a85fc155c2b67c76152b1aaa7df384a38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116701 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-06Fix and unify the two methods that get scaled text sizeMike Kaganski1-3/+2
GetTextFitToSizeScale and SdrTextObj::GetFontScaleY both didn't initialize outliners properly, and thus returned wrong results. Change-Id: I6fe63c51ed838a0d0fafdfa03597cac97ce29831 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116765 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-06tdf#142478 fix crash when searching and a viewshell change occursTomaž Vajngerl1-1/+11
When searching a impress document for a word, and the word is in notes as welll as in the document, a crash happens (only when searching with "find all"). The regressing commit changed that the search is now bound to a view (and to a viewshell). When searching for words in notes and document, at the transition from "standard" to "notes" page kind mode, the view and viewshells are destroyed and the new one created again. The problem lies here as when we destroy the viewshell, we also destroy the search context and FuSearch objects, but we are still executing the search -> crash. The solution for this is that when we change the page kind, we take the FuSearch object from the old viewshell and put it into the newly created viewshell, so that we keep the FuSearch object alive and don't throw away the search context too. Change-Id: I50931cca2a20c5704f7450e3cc8b3466af4c5a3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116758 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-04sd: Unit test for Table deletion with Delete Keymerttumer1-0/+26
Change-Id: I9849f55a143007b49bdcaac392dd84e32d610998 Signed-off-by: merttumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116069 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116300 Tested-by: Jenkins
2021-06-04Unit tests for .uno:MoveShapeHandle commandmerttumer1-0/+59
Change-Id: Ia1049325bf26fbe6a3c8ac77c873d1af010d3581 Signed-off-by: merttumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115541 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116297 Tested-by: Jenkins
2021-06-03cid#1485165 avoid Missing move assignment operatorCaolán McNamara1-1/+1
Change-Id: I9113e589f74a119fc24e174e7e35036beb0d7acd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116643 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-01cid#1485150 Uncaught exceptionCaolán McNamara4-12/+27
remove the reported exception path from the dtor call Change-Id: I438a9c3de41d516e1994aeb1509bb8ee333bf23f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116532 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-01no need to allocate these on the heapNoel Grandin3-14/+14
Change-Id: I6eb3853883c724b5cb28bbf4debf6f56a587ff88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116515 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-01no need to allocate these on the heapNoel Grandin7-63/+63
Change-Id: Iddbc48638fbd1326df79b59080132280029c5d46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31flatten vectorNoel Grandin2-10/+9
Change-Id: I7459bcc499d6734328b5be63a4bebd2102d52e0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116481 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31no need to allocate these on the heapNoel Grandin4-26/+26
Change-Id: I05c00d0a4f077594d91b05698a1c04922f06a1cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116478 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31GtkLabel:track-visited-links was removedCaolán McNamara1-1/+0
but we have some uses of it, which all look accidental Change-Id: Iccb12d904e8dc7410205735e49526b73bb81083e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116488 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-31no need to allocate SvxNumRule separately in SvxNumBulletItemNoel Grandin14-61/+49
Change-Id: I7903565a468fc0fbec603c88b92cca6560a86728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116424 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-31Simplify construction of a hardcoded IPv4 addressStephan Bergmann1-11/+1
Change-Id: I822313ee708935dd4ecb636c13a961fdd054d660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116434 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-31tdf#142537 PPTX export: fix placeholder style exportAttila Bakos (NISZ)3-0/+71
Regression from: b6b02e0b4c9d739836e1f61a886ea45b01e6696e (tdf#111903 tdf#137152 PPTX export: fix placeholders) Placeholders lost the formatting, which has been fixed. (fill, effects, and outline) Change-Id: I2b9300b85cf3641d89d748a03377f950e668a2af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116113 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-31Clean redundant SvxBackgroundColorItem and use SvxColorItem instead.Gülşah Köse7-23/+24
SvxBackgroundColorItem is just copied from SvxColorItem. There is nothing special to SvxBackgroundColorItem class. SvxColorItem is a generic item and it's used on many places related with colors. We can use SvxColorItem for background colors too. Change-Id: Iacea31a7557b806e95f5859ff60add9a2626ec05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116282 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins
2021-05-28no need to allocate SfxStyleFamilies on the heapNoel Grandin2-6/+6
Change-Id: Ibedb36dec14c61927ef594ddf47fda94728530a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116319 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-28tdf#125071 PPTX: fix missing custom slide show exportTibor Nagy4-0/+85
Follow-up to commit ecf48b2d4f3e54dbb2c1e295120d73e7b7a11338 "tdf#131390 PPTX: fix custom slide show is not imported". Change-Id: I2a85e2ea08f6a70cd5f26cfb99a0ff1add2c296a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116177 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-28no need to allocate these SfxItemSet on the heapNoel Grandin2-53/+53
use std::optional where the code needs to control the lifetime of the object explicitly Change-Id: Ia550ce051360f68911abc68c945a97d62a637b06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-26Refactor module media item handlingJan-Marek Glogowski1-80/+17
Move common functionality into svx::MediaShellHelpers. Change-Id: I6f5db59bdcff7cad00a64e76f6aad7b8ecb4ffa9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116126 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-05-26tdf#96061 Unset the highlight propertyGülşah Köse2-0/+36
When we have highlight property on specific part of the text the following texts were highligthing. To prevent this we unset the highlight property when we have not highlight property anymore. Change-Id: I802cde1c784afe47201a9ba4f41827dd0c705035 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115800 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-05-25tdf#131390 PPTX: fix custom slide show is not imported.Tibor Nagy2-0/+19
Change-Id: I62e1bfaae23d1b18e71a2c16651d01144a26907c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115475 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-21add Toggleable as a separate thing to a ButtonCaolán McNamara26-69/+68
and inherit ToggleButton from both it and Button Change-Id: If0e500aca8d0ffa087cb5e2bfc1786372fbff4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115921 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-21use toggle instead of click for RadioButtonCaolán McNamara4-52/+66
Change-Id: I57cd1c074e4c4fc48ee83ac63a7c0ec5bcae5ae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115890 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-21use toggle instead of click for RadioButtonCaolán McNamara2-7/+18
Change-Id: Ic246c68749f79cc1b25fed08a66fd8a0d57495f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115884 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-20use toggle instead of click for CheckButtonCaolán McNamara2-3/+3
Change-Id: Ic8957a59addbf08f2b2e4e84167991f00048c6a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115876 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-20use toggle instead of click for RadioButtonCaolán McNamara2-4/+4
Change-Id: Icacf5444d65fb5bac4a6c85d9e5c36b98da3e57a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115867 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-20use toggle instead of click for CheckButtonCaolán McNamara6-19/+25
Change-Id: I6a80946481ee6fc40b2ee207a64287d1a5f96110 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115864 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-20only the listbox handler does anything, remove the othersCaolán McNamara1-19/+3
Change-Id: I7c63b21c0902edd4586e6f249d50e6f0d475a851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115860 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-19Fix typosAndrea Gelmini1-2/+2
Change-Id: I800e966cee8343099fb79f08959ba246a831aee0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115826 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-19use toggle instead of click for CheckButtonCaolán McNamara2-1/+7
Change-Id: I0cbe6cd1b93557ceba535a835c4a199761ca5f00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115812 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-19tdf#108450 and tdf#134665 Fix Impress Grow/Shrink Animation ScalingEdward Lynch1-21/+40
Also, change typo from 'veri' to 'vert' which was preventing the selection of the vertical option in the 'Size' drop down menu Change-Id: Ied568a607ca0ac70b481842eee33d54805685116 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106815 Tested-by: Jenkins Reviewed-by: Katarina Behrens <bubli@bubli.org>
2021-05-19ImplPlayWithRenderer never checks its OutputDevice against nullptrCaolán McNamara4-5/+5
just pass a reference instead and spread that around to some similar cases Change-Id: Ifb2dee8c7bf02a9f01982b928c90666cbbdd84fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115759 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>