summaryrefslogtreecommitdiff
path: root/sw/inc
AgeCommit message (Collapse)Author
2021-12-09tdf#146144 sw: add tooltip to table rows with change trackingLászló Németh
Showing "Row Deleted" and "Row Inserted" with Author and Date (of the associated SwRangeRedline: latest tracked deletion in deleted rows, and first tracked insertion in inserted rows). Follow-up to commit c6af542a31e167e5a01908d049e399ce06a5e4e4 "tdf#146120 sw: show tracked table changes with different color" and Change-Id: I913e234de1a60311306fbebdfb1ae16dcea7cd8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126575 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-12-08use more OUStringLiteral in variousNoel Grandin
and remove some unused defines Change-Id: Ie560fccb674568ba88175d2e68ca83b92cfcf312 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126544 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-08loplugin:stringliteraldefine in swNoel Grandin
Change-Id: I583f2a23b7912e48889b49a0dce0f4681ef45566 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-08tdf#146120 sw: show tracked table changes with different colorLászló Németh
In Change Tracking, show deleted table rows in cyan and inserted rows in pink. In this case, don't show original table row or cell background. Follow-up to commit f481c2c8e74bded11fac754e493560391229dbcd "tdf#144057 sw track changes: hide deleted table rows". Change-Id: Ib9cc411b62b92bc8a83dda7589f3e798f7e96f41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126482 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-12-07loplugin:unusedmethodsNoel Grandin
Change-Id: Ic1ba90447575278d854af85312271c41766b776b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-06Add image preffered DPI document setting, use it in Writer, ImpressTomaž Vajngerl
This adds a "image preferred DPI" document setting, which is used as a suggestion of the DPI that an image should have in the document. This is currently used when the image is inserted into the document (Writer, Impress/Draw) to resize it to the preferred DPI value. Change-Id: I3ee9d409257e3c6aa2ead05144ecbba7b3b916f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126334 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-12-03tdf#145062 sw: deal with failing insertion of field in SwWrtShellMichael Stahl
Change-Id: Ic0c479e97b7a5f6fcc7f7eb454eb77a5c47de9db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126191 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-12-02sw: update previews of OLE objects on "update all"Miklos Vajna
Charts were already updated, it was not consistent that other embedded objects are not updated. This is especially useful if an ODT file is manipulated by a 3rd-party, then loaded into Writer just to update the previews of OLE objects. Change-Id: If61aa037739c593abade933dcdd5474ad566b3e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126253 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-01use more OInterfaceContainerHelper3 in swNoel Grandin
Change-Id: Icb194de0521bf60f3db623c35e695afc3a3edbcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125982 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-01sw doc model xml dump: show the format of section nodesMiklos Vajna
The SwSectionNode has an SwSection, which is registered in an SwSectionFormat, which finally tells us if it's a protected one. Change-Id: Ie46c516f900f1c479c11cbbaf061973400614a2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126151 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-29tdf#54465 tdf#139336 sw: add compat. flag for footnote in columnAttila Szűcs
Add compatibility option FOOTNOTE_IN_COLUMN_TO_PAGEEND to keep layout of old ODT files, where multicolumn sections have footnotes in columns, growing sections to the full page. Note: Multicolumn page styles or not evenly distributed multicolumn sections, or footnotes not collected at the end of the sections still use footnotes in columns, so they don't need this compatibility option. Follow-up to commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I7d6a1f804b555dc5372767014b8fb5e3fa57ba9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125442 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-28Revert "tdf#129183 sw: textboxes in group shapes - part 3"Stephan Bergmann
This reverts commit eabcfb3f18a6944d9ad89cecd3eb3ca7a2259cf3. Conflicts: sw/source/core/doc/textboxhelper.cxx It caused UITest_writer_tests4 to fail in an ASan build with > ==2987325==ERROR: AddressSanitizer: heap-use-after-free on address 0x6130000e5048 at pc 0x7f20cb3112ac bp 0x7f1e62de92d0 sp 0x7f1e62de92c8 > WRITE of size 8 at 0x6130000e5048 thread T47 > #0 in SwFrameFormat::SetOtherTextBoxFormat(SwTextBoxNode*) at sw/inc/frmfmt.hxx:106:77 > #1 in SwTextBoxNode::~SwTextBoxNode() at sw/source/core/doc/textboxhelper.cxx:1680:30 > #2 in SwFrameFormat::~SwFrameFormat() at sw/source/core/layout/atrfrm.cxx:2564:9 > #3 in SwDrawFrameFormat::~SwDrawFrameFormat() at sw/source/core/layout/atrfrm.cxx:3455:1 > #4 in SwDrawFrameFormat::~SwDrawFrameFormat() at sw/source/core/layout/atrfrm.cxx:3453:1 > #5 in SwFrameFormats::DeleteAndDestroyAll(bool) at sw/source/core/doc/docfmt.cxx:2115:9 > #6 in SwDoc::~SwDoc() at sw/source/core/doc/docnew.cxx:565:28 > #7 in SwDoc::release() at sw/source/core/doc/doc.cxx:118:9 > #8 in rtl::Reference<SwDoc>::clear() at include/rtl/ref.hxx:196:19 > #9 in SwDocShell::RemoveLink() at sw/source/uibase/app/docshini.cxx:444:16 > #10 in SwDocShell::~SwDocShell() at sw/source/uibase/app/docshini.cxx:372:5 > #11 in SwDocShell::~SwDocShell() at sw/source/uibase/app/docshini.cxx:362:1 > #12 in SwDocShell::~SwDocShell() at sw/source/uibase/app/docshini.cxx:362:1 > #13 in SvRefBase::ReleaseRef() at include/tools/ref.hxx:163:29 > #14 in tools::SvRef<SfxObjectShell>::~SvRef() at include/tools/ref.hxx:56:36 > #15 in IMPL_SfxBaseModel_DataContainer::~IMPL_SfxBaseModel_DataContainer() at sfx2/source/doc/sfxbasemodel.cxx:245:5 > #16 in void std::destroy_at<IMPL_SfxBaseModel_DataContainer>(IMPL_SfxBaseModel_DataContainer*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_construct.h:88:15 > #17 in void std::allocator_traits<std::allocator<IMPL_SfxBaseModel_DataContainer> >::destroy<IMPL_SfxBaseModel_DataContainer>(std::allocator<IMPL_SfxBaseModel_DataContainer>&, IMPL_SfxBaseModel_DataContainer*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/alloc_traits.h:537:4 > #18 in std::_Sp_counted_ptr_inplace<IMPL_SfxBaseModel_DataContainer, std::allocator<IMPL_SfxBaseModel_DataContainer>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:528:2 > #19 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:168:6 > #20 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:705:11 > #21 in std::__shared_ptr<IMPL_SfxBaseModel_DataContainer, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:1154:31 > #22 in std::__shared_ptr<IMPL_SfxBaseModel_DataContainer, (__gnu_cxx::_Lock_policy)2>::reset() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:1272:9 > #23 in SfxBaseModel::dispose() at sfx2/source/doc/sfxbasemodel.cxx:757:13 > #24 in SwXTextDocument::dispose() at sw/source/uibase/uno/unotxdoc.cxx:549:19 > #25 in SfxBaseModel::close(unsigned char) at sfx2/source/doc/sfxbasemodel.cxx:1482:5 > #26 in SwXTextDocument::close(unsigned char) at sw/source/uibase/uno/unotxdoc.cxx:562:19 > #27 in SfxBaseModel::dispose() at sfx2/source/doc/sfxbasemodel.cxx:718:13 > #28 in SwXTextDocument::dispose() at sw/source/uibase/uno/unotxdoc.cxx:549:19 > #29 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5 > #30 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13 > #31 in unoInterfaceProxyDispatch at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413:13 > #32 in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const at binaryurp/source/incomingrequest.cxx:235:13 > #33 in binaryurp::IncomingRequest::execute() const at binaryurp/source/incomingrequest.cxx:78:26 > #34 in request at binaryurp/source/reader.cxx:85:9 > #35 in cppu_threadpool::JobQueue::enter(void const*, bool) at cppu/source/threadpool/jobqueue.cxx:100:17 > #36 in cppu_threadpool::ORequestThread::run() at cppu/source/threadpool/thread.cxx:164:31 > #37 in threadFunc at include/osl/thread.hxx:189:15 > #38 in osl_thread_start_Impl(void*) at sal/osl/unx/thread.cxx:264:9 > #39 in start_thread at <null> > #40 in __GI___clone3 at <null> > > 0x6130000e5048 is located 328 bytes inside of 376-byte region [0x6130000e4f00,0x6130000e5078) > freed by thread T47 here: > #0 in operator delete(void*, unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:164:3 > #1 in SwFlyFrameFormat::~SwFlyFrameFormat() at sw/source/core/layout/atrfrm.cxx:2912:1 > #2 in SwFrameFormats::DeleteAndDestroyAll(bool) at sw/source/core/doc/docfmt.cxx:2115:9 > #3 in SwDoc::~SwDoc() at sw/source/core/doc/docnew.cxx:565:28 > #4 in SwDoc::release() at sw/source/core/doc/doc.cxx:118:9 > #5 in rtl::Reference<SwDoc>::clear() at include/rtl/ref.hxx:196:19 > #6 in SwDocShell::RemoveLink() at sw/source/uibase/app/docshini.cxx:444:16 > #7 in SwDocShell::~SwDocShell() at sw/source/uibase/app/docshini.cxx:372:5 > #8 in SwDocShell::~SwDocShell() at sw/source/uibase/app/docshini.cxx:362:1 > #9 in SwDocShell::~SwDocShell() at sw/source/uibase/app/docshini.cxx:362:1 > #10 in SvRefBase::ReleaseRef() at include/tools/ref.hxx:163:29 > #11 in tools::SvRef<SfxObjectShell>::~SvRef() at include/tools/ref.hxx:56:36 > #12 in IMPL_SfxBaseModel_DataContainer::~IMPL_SfxBaseModel_DataContainer() at sfx2/source/doc/sfxbasemodel.cxx:245:5 > #13 in void std::destroy_at<IMPL_SfxBaseModel_DataContainer>(IMPL_SfxBaseModel_DataContainer*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_construct.h:88:15 > #14 in void std::allocator_traits<std::allocator<IMPL_SfxBaseModel_DataContainer> >::destroy<IMPL_SfxBaseModel_DataContainer>(std::allocator<IMPL_SfxBaseModel_DataContainer>&, IMPL_SfxBaseModel_DataContainer*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/alloc_traits.h:537:4 > #15 in std::_Sp_counted_ptr_inplace<IMPL_SfxBaseModel_DataContainer, std::allocator<IMPL_SfxBaseModel_DataContainer>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:528:2 > #16 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:168:6 > #17 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:705:11 > #18 in std::__shared_ptr<IMPL_SfxBaseModel_DataContainer, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:1154:31 > #19 in std::__shared_ptr<IMPL_SfxBaseModel_DataContainer, (__gnu_cxx::_Lock_policy)2>::reset() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:1272:9 > > previously allocated by thread T10 here: > #0 in operator new(unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3 > #1 in SwDoc::MakeFlyFrameFormat(rtl::OUString const&, SwFrameFormat*) at sw/source/core/doc/docfmt.cxx:756:33 > #2 in SwDoc::MakeFlySection_(SwPosition const&, SwContentNode const&, RndStdIds, SfxItemSet const*, SwFrameFormat*) at sw/source/core/doc/doclay.cxx:171:33 > #3 in SwDoc::MakeFlySection(RndStdIds, SwPosition const*, SfxItemSet const*, SwFrameFormat*, bool) at sw/source/core/doc/doclay.cxx:337:19 > #4 in SwXFrame::attachToRange(com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&, SwPaM const*) at sw/source/core/unocore/unoframe.cxx:2821:29 > #5 in SwXFrame::attach(com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sw/source/core/unocore/unoframe.cxx:3115:9 > #6 in SwXTextFrame::attach(com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sw/source/core/unocore/unoframe.cxx:3346:15 > #7 in SwXText::insertTextContent(com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&, com::sun::star::uno::Reference<com::sun::star::text::XTextContent> const&, unsigned char) at sw/source/core/unocore/unotext.cxx:615:15 > #8 in SwXText::insertTextContentWithProperties(com::sun::star::uno::Reference<com::sun::star::text::XTextContent> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sw/source/core/unocore/unotext.cxx:1472:5 > #9 in non-virtual thunk to SwXText::insertTextContentWithProperties(com::sun::star::uno::Reference<com::sun::star::text::XTextContent> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sw/source/core/unocore/unotext.cxx > #10 in SwTextBoxHelper::create(SwFrameFormat*, SdrObject*, bool) at sw/source/core/doc/textboxhelper.cxx:100:29 > #11 in SwXShape::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) at sw/source/core/unocore/unodraw.cxx:1165:25 > #12 in SdXMLShapeContext::SetStyle(bool) at xmloff/source/draw/ximpshap.cxx:701:27 > #13 in SdXMLCustomShapeContext::startFastElement(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at xmloff/source/draw/ximpshap.cxx:3545:5 > #14 in SvXMLImport::startFastElement(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at xmloff/source/core/xmlimp.cxx:805:15 > #15 in (anonymous namespace)::Entity::startElement((anonymous namespace)::Event const*) at sax/source/fastparser/fastparser.cxx:468:27 > #16 in sax_fastparser::FastSaxParserImpl::callbackStartElement(unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, unsigned char const**) at sax/source/fastparser/fastparser.cxx:1304:21 > #17 in (anonymous namespace)::call_callbackStartElement(void*, unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, int, unsigned char const**) at sax/source/fastparser/fastparser.cxx:331:18 > #18 in xmlParseStartTag2 at workdir/UnpackedTarball/libxml2/parser.c:9658:6 > #19 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11453:14 Change-Id: I752190e05fc3c282b75021724527f623f56ee6a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125977 Tested-by: Jenkins Tested-by: René Engelhard <rene@debian.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-27Library_msword needs sw::LegacyModifyHint RTTI now in UBSan buildStephan Bergmann
...since 7d3aadce8d184f72e4785827ad706d27c31a2edb "ofz#41398 drop a para scheduled for deletion if something else deletes it", causing e.g. CppunitTest_chart2_export to fail with > [_RUN_____] Chart2ExportTest::testStockChart [...] > warn:sal.osl:1981149:1981149:sal/osl/unx/module.cxx:155: dlopen(/home/sbergman/lo/core/instdir/program/libmswordlo.so, 257): /home/sbergman/lo/core/instdir/program/libmswordlo.so: undefined symbol: _ZTIN2sw16LegacyModifyHintE > warn:sfx.doc:1981149:1981149:sfx2/source/doc/sfxbasemodel.cxx:3147: Storing has failed, no error is set! > unknown:0:Chart2ExportTest::testStockChart > > An uncaught exception of type com.sun.star.io.IOException > - SfxBaseModel::impl_store <file:///home/sbergman/lo/tmp/Chart2ExportTest__testStockChart_4rivgy.tmp> failed: 0xc10(Error Area:Io Class:Write Code:16) /home/sbergman/lo/core/sfx2/source/doc/sfxbasemodel.cxx:3194 /home/sbergman/lo/core/sfx2/source/doc/sfxbasemodel.cxx:1775 Change-Id: I47ce1c10b7757b27e4279f35d59e34d5312c8b07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125945 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-25sw: allow viewing OLE objects in protected sectionsMiklos Vajna
The problem was that we don't allow even opening embedded objects in protected sections, which means the content of multi-page embedded objects can't even be viewed in protected sections, which probably goes too far. Fix this relaxing the condition in SwEditWin::MouseButtonDown() to allow launching the OLE object on double-click, and then make sure that the native data is not updated in SfxInPlaceClient_Impl::saveObject() and the replacement image is not updated in svt::EmbedEventListener_Impl::stateChanged(). This is complicated by only the Writer layout knowing if a given OLE object is anchored in a protected frame, so pass down a callback to sfx2/ and svtools/ to check if the OLE object is protected. Not copying the protected bit has the benefit of behaving correctly if the section turns into non-protected: copying would not work properly, as SfxInPlaceClient is created on demand, so not re-created when the protectedness of the section is changed. Change-Id: Ib3a8f2092d27dc1ebd3ef355c95a4a473988b163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125815 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-24tdf#129183 sw: textboxes in group shapes - part 3Attila Bakos (NISZ)
Grouping/ungrouping nested groups works now. Manual test: 1. Insert Shape. 2. Right-click on selected shape, Add Text Box (and some text). 3. Insert a new shape. 4. Select and group the two shapes. 3. Insert a third shape. 4. Select and group the shape and the previously grouped shapes. The text box remains in the nested shape group. Details: 1) tdf#144271 memory leak of SwTextBoxHelper, by replacing the textbox structure vector with std::unordered map, and rethinking of the ownership of the objects. If a SwFrameFormat dies, and that is a FLYFRMFMT, it will be deleted from the textbox node and the FrameFormat table in the doc too, and the drawing will be stay as it was before. If the dying format is a drawing, all the textboxes, and the node will be deleted. 2) Introducing the new UNO property TextBoxContent, which is needed for writerfilter/xmloff later to set a new textbox for the shape via UNO. 3) Missing parameters are present now for syncing the textbox parameters. 4) Introducing a new function namely the handleGroupTextBox() to do the tasks simply with all textboxes in a group shape. This can handle nested groups as well (group in a group). Known issues: now copy of nested group objects is implemented but not enabled, because it causes an assert. Change-Id: I931886eda01c7a3db93098de10f5e5f48f2f217b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124657 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-23tdf#145719 sw: track moved text in import and ChangesInMarginLászló Németh
Recognize moved text by accessing to the hidden redline content pContentSect during ODT import (in the case of Delete redlines) and ChangesInMargin mode (Delete or Insert redlines depending on Deletion in Margin or Insertion in Margin modes). Fix Undo and redline stack handling by moving IsMoved bit to SwRedlineData from SwRangeRedline. Note: .fodt format is applicable for the unit test document, because it's not affected by the problem. Change-Id: Ifd4f993520bec4b845d978a844c465509ea87b50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125552 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-22sw: prefix members of SwDBManager, SwWebGlosDocShell, SwWordCountWrapper ...Miklos Vajna
... and SwZoomControl See tdf#94879 for motivation. Change-Id: I74f31e45a8c215d406371a23b64d548fbb851d28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125641 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-18tdf#145721 sw: add 'moved text' icons to Manage ChangesLászló Németh
For Moved (deletion) and Moved (insertion) text changes, add new Action icons to Manage Changes dialog window (Edit->Track Changes->Manage...), re-using existing Cut and Paste icons. Follow-up to commit 970f8ec7c8eb6007181ce55d885eef771dd49cc6 "tdf#145721 sw track changes: sign text moving in redline tooltips". Change-Id: Ic202538ec31963e5e27170c7e5ea819a7f2bde9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125445 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-17tdf#145721 sw track changes: sign text moving in redline tooltipsLászló Németh
Write "Moved (deletion)" and "Moved (insertion)" instead of "Deleted" and "Inserted" in tooltip of tracked text movings. Follow-up to commit f51fa7534421a195a58b4a737a2e836d8c25ba81 "tdf#145718 sw, DOCX import: complete tracked text moving" Change-Id: I5db3025ddb7b4758e3699c10971a765784555a20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125405 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-17tdf#145718 sw, DOCX import: complete tracked text movingLászló Németh
Add IsMoved bit to SwRangeRedline, and keep it in both parts of a split Delete/Insert redline. Set this bit during DOCX import, fixing incomplete import of moveFrom/moveTo elements. Details: - Search text moving only at redline Insert() and AppendRedline() instead in the layout code (which was much slower, because triggered by also mouse hovering): - detect text moving in Hide Changes mode, too; - Insertion inside or directly after tracked text moving keeps "moved text" layout of the original moved text parts (before and after the insertion). - at detection of text moving, invalidate (update) layout of the redline pair, too. - fix DOCX import: extend makeRedline() with property RedlineMoved to keep all moveFrom/moveTo stored in DOCX instead of losing them (joining them with normal redlines) in the case of missing Delete/Insert pair (see unit test document); Follow-up to commit ec577f566fa3e6d2666069180f8ec8474054aea9 "tdf#145233 sw track changes: show moved text in green color", commit bcdebc832b272662d28035007a4796e42d1305ae "tdf#104797 DOCX change tracking: handle moveFrom and moveTo" and commit d32d9a2b3c5e3963f4a18f6c7bbf50fab2e9b2be "tdf#123460 DOCX track changes: moveFrom completely". Change-Id: Iaca80e5e326a172bc7ba5fec64b63668b9378e2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125317 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-17replace an ugly coverity warning suppressionCaolán McNamara
Change-Id: I320d84901368f0586a113fd2afe1cb6a5eb19b11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125320 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-16Drop redundant 'using rtl::OUString'Mike Kaganski
obsoleted by 6080259862ee9886d1dabcb7c06132268a398cc6 Change-Id: I246dc6050fe7adf60ab3c836db3cfa781578d483 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125142 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-15replace an ugly coverity warning suppressionCaolán McNamara
Change-Id: I73921e43e7e955793493e2accab4e3799cfd121c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125221 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-15sw: prefix members of SwInsertIdxMarkWrapper, ...Miklos Vajna
... SwLinguServiceEventListener, SwTemplateControl and SwTypeNumber See tdf#94879 for motivation. Change-Id: Ia76bd27b6ae361dbeb03d2cdab5b95bd0033460b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125217 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-14remove an ugly coverity warning suppressionCaolán McNamara
Change-Id: I243638e242f68d61b639d4afbcb5d65575cc46e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125172 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-13make SwNodeOffset operator+ and operator- inlineNoel Grandin
forgot to do this spotted by llunak Change-Id: I5e8c723850f77346789ea0b1fb364f5e0d44ae42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125097 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-12make it explicit whether to ignore the result of getLOKPayload()Luboš Luňák
Returning an empty string to signify 'ignore' was a poor design, as some messages types actually may have valid empty messages. Change-Id: Ia82d3d97d150bc5ef412a1bd4b1091d9b2d84385 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124979 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-10sw: allow undo of typing in 2 views independent from each otherMiklos Vajna
Undoing out of order is dangerous by default, so limit this to a very specific case as a start, that allows growing in follow-up commits. For now, allow out of order undo if: 1) redo stack is empty 2) we're in LOK mode (different views represent different users) 3) we undo a single action (count is 1) 4) the top undo action doesn't belong to the current view 5) the top and the previous undo actions are independent Which only requires that SwUndoInsert::UndoImpl() is independent for two different paragraphs, which seems to be the case. Independent undo actions opt in for this, currently the only such allowed undo action is SwUndoInsert ("typing"), which adds characters to a single text node. Even those are only considered independent if they operate on different text nodes. On the positive side, this allows out of order undo in the frequent case where two users collaborate on a long document and they just type some new content into the document at different paragraphs. Change-Id: Ibb4551e8f7046b4947491b8bf751eaa0cbb2d060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124949 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-09tdf#145089 DOCX export: fix track changes of table row insertionLászló Németh
Newly inserted table rows lost their change tracking during DOCX import, i.e. rejection didn't remove the rows. Note: start to clean-up DOCX export and SwTableLine::IsDeleted(), preparing the fix for tdf#145091. Follow-up to commit dbc82c02eb24ec1c97c6ee32069771d8deb394f9 "tdf#143358 sw: track insertion of empty table rows". Change-Id: Ib90b745632ec4aeb30651fbff209ecef69657f4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124922 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-08sw: try grouping undo actions of IME-edited textMiklos Vajna
This is a problem since commit e7760d428bc82ccfcae14f1907b78f9f1013b88c (Fix tdf#87500 - Freeze with English/Japanese mixture undo., 2015-09-08), that started not grouping IME-edited text completely. This means that in case you go via SwEditWin::Command() instead of SwEditWin::KeyInput() to type a 4 characters word, then it'll create 4 undo actions. Fix the problem by tracking who was the last caller of sw::DocumentContentOperationsManager::InsertString(), so we can only disable grouping switching between IME and non-IME, and we can have grouping for a series of IME input. Change-Id: I31bd02db4fe653ab63e41a77c75b8bebfc749ff1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124766 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-05use more DECL_DLLPRIVATE_LINKNoel Grandin
to avoid unnecessarily exporting symbols Change-Id: I6855894d0166c300ced169e36861f38811baa48d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-04Resolves: tdf#143643 ensure relayout on undo of insert commentCaolán McNamara
Change-Id: I732e23b8ff7c17abf4b5b9b7c7964fca6069543c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124685 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-01Related: tdf#145363 provide an explicit parent for page formatCaolán McNamara
when launched from another dialog let it take that as the parent Change-Id: I07bfe03717cbe140301060e6e85bdbdef953bf5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124560 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-01tdf#145363 provide an explicit parent for numbering-style dialogCaolán McNamara
when launched from another dialog let it take that as the parent Change-Id: I64247b0b670c3e44176b6323c074cfd0711feefb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124558 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-29use virtual function call for dynamic dispatchBjoern Michaelsen
... as it is around since the dawn of C++ and should be stable -- certainly more stable and less errorprone that manual typetagging. Change-Id: I5dfe2ce40c2334dc8fe60705d358779fa4bf1586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124131 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2021-10-29consolidate DDE updates in FieldTypeBjoern Michaelsen
Change-Id: I70243dad4cd62ab1f601d010e0bcf441831ec556 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124130 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2021-10-25use pull model also for LOK text selectionLuboš Luňák
Make LOK_CALLBACK_TEXT_SELECTION, LOK_CALLBACK_TEXT_SELECTION_START, LOK_CALLBACK_TEXT_SELECTION_END and LOK_CALLBACK_TEXT_VIEW_SELECTION also use pull model, i.e. LO core will only set a flag and when CallbackFlushHandler needs the actual data it'll use getLOKPayload(). This again avoids a large number of messages passed to CallbackFlushHandler only for them to be sooner or later discarded. Change-Id: Ia7528039be996a6e9e8491b4eba3f4133582fa56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124146 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-25tdf#138531: Also update DDE tables, not only fieldsBjoern Michaelsen
Change-Id: I0cbf8ce355b460b2f7ea73c8fae653641c980979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124129 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-24change some LOK internal updates to be pull model instead of pushLuboš Luňák
Some LOK messages may get called very often, such as updates about cursor position. And since only the last one matters, they get generated every time, which costs some time, and then later except for one they get all discard again from CallbackFlushHandler queue, which again costs time. Change the model to instead only set an 'updated' flag, and CallbackFlushHandler will request the actual message payload only before flushing. This commit changes LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR and LOK_CALLBACK_INVALIDATE_VIEW_CURSOR to work this way. Change-Id: I376be63176c0b4b5cb492fbf529c21ed01b35481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124083 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22re-arrange BlockInfo a littleNoel Grandin
so that it is more likely that the interesting data is next to each other and thus in CPU cache (i.e. the control fields and the first few elements of the array) Change-Id: I50e46df3f639899e39f1b7733cf8e754d2435b4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124038 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-21use sal_Int32 in BigPtrArrayNoel Grandin
now that it's only use-case is also using sal_Int32 Change-Id: I9c51bb8fd6b8f5713b84b1a1f0a216e676a73299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123995 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-21introduce SwNodeOffset strong typedefNoel Grandin
for indexing into node children. Replaces various usage of sal_uLong, tools::Long, sal_uInt32 with an underlying type of sal_Int32. Also add a NODE_OFFSET_MAX constant to replace usage of ULONG_MAX Change-Id: I2f466922e1ebc19029bb2883d2b29aa4c0614170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-20tdf#145233 sw track changes: show moved text in green colorLászló Németh
and with double strikethrough or underlines during change tracking to speed up reviewing, e.g. re-ordered list elements or changed paragraph or sentence order is more visible this way. Note: skip terminating white spaces of the changes during recognition of the text movement, as a workaround for a typical difference resulted by e.g. Writer UX: selecting a sentence or a word, and moving it with the mouse, Writer removes a space at the deletion to avoid double spaces, also inserts a space at the insertion point automatically. Because the result can be different (space before and space after the moved text), compare the changes without terminating spaces. See also commit bcdebc832b272662d28035007a4796e42d1305ae "tdf#104797 DOCX change tracking: handle moveFrom and moveTo". Change-Id: If2a16f1f43315ecab659b24425692ac14bcda619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123814 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-18sw: prefix members of MailDeliveryErrorNotifier, SwAddressIterator, ...Miklos Vajna
... SwAddressPreview and SwCondCollItem See tdf#94879 for motivation. Change-Id: I6702b3d2287aa3c9df1bac8520746901ae2e2f25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123729 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-10-15delay, collect and compress LOK invalidations for Writer viewsLuboš Luňák
Due the to way views are updated on any document change, invalidations are at least O(n^2), and since LOK may use a number of views and for each view the entire document is considered to be the view area, this can lead to a huge number of invalidations that are mostly the same repeated rectangles. Change-Id: I63682958d2fc388344641dcd19fa1d2b39054b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123617 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-15Avoid usage of incomplete types in member functions defined in-classStephan Bergmann
...that started to fail now at least with clang-cl (where the MSVC rules when to emit inline member function definitions are more aggressive than for other ABIs) with --with-latest-c++ and --with-visual-studio=2022 (where usage of incomplete types in std::vector now triggered > In file included from C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:31: > In file included from C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\memory:11: > In file included from C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\exception:12: > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(744,50): error: incomplete type 'Primitive' used in type trait expression > struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> { > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(59,53): note: in instantiation of template class 'std::is_trivially_destructible<Primitive>' requested here > struct conjunction<_First, _Rest...> : _Conjunction<_First::value, _First, _Rest...>::type { > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(64,44): note: in instantiation of template class 'std::conjunction<std::is_trivially_destructible<Primitive>, std::disjunction<std::_Is_default_allocator<std::allocator<Primitive>>, std::_Has_no_alloc_destroy<std::allocator<Primitive>, Primitive *>>>' requested here > _INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value; > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\xmemory(934,20): note: in instantiation of variable template specialization 'std::conjunction_v<std::is_trivially_destructible<Primitive>, std::disjunction<std::_Is_default_allocator<std::allocator<Primitive>>, std::_Has_no_alloc_destroy<std::allocator<Primitive>, Primitive *>>>' requested here > if constexpr (!conjunction_v<is_trivially_destructible<_Ty>, _Uses_default_destroy<_Alloc, _Ty*>>) { > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(1632,13): note: in instantiation of function template specialization 'std::_Destroy_range<std::allocator<Primitive>>' requested here > _Destroy_range(_Myfirst, _Mylast, _Al); > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(583,9): note: in instantiation of member function 'std::vector<Primitive>::_Tidy' requested here > _Tidy(); > ^ > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(74,5): note: in instantiation of member function 'std::vector<Primitive>::~vector' requested here > TransitionScene( > ^ > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(42,7): note: forward declaration of 'Primitive' > class Primitive; > ^ etc.). Which in turn required tweaking of loplugin:unnecessaryoverride to avoid false > In file included from C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:67: > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(389,18): error: unnecessary user-declared destructor [loplugin:unnecessaryoverride] > TransitionScene::~TransitionScene() = default; > ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(81,12): note: declared here [loplugin:unnecessaryoverride] > inline ~TransitionScene(); > ~~~~~~~^~~~~~~~~~~~~~~~~~ Change-Id: Ia72fb44e6e92ff47376d7b7159c0df7cbf883b69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123648 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-11loplugin:moveparam in swNoel Grandin
Change-Id: I4fa524e4abb101ed0ff1b8f97b84582b84aa1d07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123387 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-10use SfxItemSetFixed in swNoel Grandin
Change-Id: I69e188d7599b7fc439f613cec0a0967ccb748b7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123313 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-09Rename bookmrk* -> bookmark*Julien Nabet
Change-Id: I9dec77b2af8abe5abb286ff76ed85d1e4078ee6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123325 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-06Fix typoAndrea Gelmini
Change-Id: I2f229b95c997a6e4f87f3d91fab1bf299cfe9670 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123149 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>