summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/flylay.cxx
AgeCommit message (Collapse)Author
2022-12-30tdf#146875 sw: move also at-frame flys off SwPageFrameMichael Stahl
The bugdoc contains an at-frame anchored fly on page 77, which is anchored to an at-page anchored fly. While layouting page 74, the fly is moved to page 77, and the content on page 74 invalidated. Unexpectedly, calling RegisterAtPage on a SwFlyLayFrame does absolutely nothing, as it calls the base class SwFlyFrame, so the fly stays on page 74. Thus, page 74 never actually becomes valid, and later pages are never layouted. (regression from commit eb85de8e6b61fb3fcb6c03ae0145f7fe5478bccf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144631 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit abef9ea8aa99561e6f84451acf387abde4ec14ab) Change-Id: I4fcbed4daf83f9e554de5a877a40b2c2419c0f2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144759 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2019-10-02tdf#124601 sw FollowTextFlow: fix hori pos of objects outside the current cellMiklos Vajna
The problem is that the image in the bugdoc's footer is anchored in one cell, but its position has a value that shifts it to the next column and next row. The next column is the problem for the horizontal position. So build on top of the previous vertical position fix, and make sure that CalcRelPosX() doesn't limit the position inside the current cell for an in-table, follow-text-flow, wrap-though image. Once that's in place, make sure that we don't try to grow the cell due to follow-text-flow, wrap-though objects in CalcPosition(), since in a wrap-through vs follow-text-flow situation, the wrap-though should have priority (should not affect size of cells). Finally, now that cells don't grow in this case, the previously added special-casing of footers in SwFlyFreeFrame::CheckClip() is no longer necessary. Not growing the cells means we don't try to re-position the object. Change-Id: Ic55e4b5188704fa70314f91fe9a01987b6a56d7b Reviewed-on: https://gerrit.libreoffice.org/80032 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-10-02tdf#124601 sw FollowTextFlow: fix vert pos of objects outside the current cellMiklos Vajna
There were two problems here: 1) CalcHeightWithFlys() considered all follow-text-flow objects when determining the cell size, while wrap-through objects should never influence the layout of text (i.e. when they conflict, the second should have priority). 2) Once the cell had correct height, the oscillaction described in the SwFlyFreeFrame::CheckClip() comment started. Such a position update was already disabled for headers, but footers have exactly the same problem. In the case of the bugdoc, we jumped between 14618 and 14744 twips, till finally layout loop control kicked in. [ FollowTextFlow is meant to be same behavior as Word's layoutInCell shape property, so this is expected to improve rendering of existing documents. It's not likely that any user would opt in for FollowTextFlow to have the old close-but-not-exactly-matching behavior. ] Change-Id: I6b3b672fc82c6c67dbbdd35c349613fe4cda610d Reviewed-on: https://gerrit.libreoffice.org/79980 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-08-07Fix typosAndrea Gelmini
Change-Id: Ie48d61e07ce44a3022b92cd295527b65532a64e7 Reviewed-on: https://gerrit.libreoffice.org/76773 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-03sw: fix moving of at-page anchored flys to different pageMichael Stahl
The problem is that some flys are anchored at a page with Y pos 35k and are moved to a page with Y pos 17k, while retaining mbFrameAreaPositionValid=true and their existing Y position. The flys will never be painted or even invalidated again because their position is off-page. This is somehow a regression from commit 0b53f794ffb2550288610b9488f11fd21ab85aae - without the new mutation of an empty-page to a normal page due to at-page flys by resetting m_bEmptyPage in SwPageFrame::UpdateAttr_() on it the problem didn't happen. Due to the above commit, the page 3 is not an empty-page any more as it has 2 flys anchored on it; previously those flys were moved (only in the layout, not in the model!) to page 4 by some funny code in SwRootFrame::AssertPageFlys(), which at first glance seems like an improvement. Change-Id: Ia071931b26e64245f90233232dd2ac0d64365ce6 Reviewed-on: https://gerrit.libreoffice.org/75009 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-04-25WIP: Further preparations for deeper Item changesArmin Le Grand
(1) Migrated all still existing binary load/save stuff in SfxPoolItem to legacy files. Isolated from Item implementations. Adapted all usages. No more methods Create/Store needed, also GetVersion removed (2) Removed operator= for SfxPoolItem. Adapted all usages. Goal ist to handle Items more as Objects ('Object-Oriented') in the sense to move/handle instances, not to copy one instance over another one (which is more and more problematic with hard to copy content as UNO API stuff or similar). This lead to much more usages of std::shared_ptr which correlates well with future plans fr Items (see dev branch). Next logic step will be to also remove copy constructor Linux build and corrections done Fixed Writer test and removed unused defines Fixed another unused m,acro Started to unify the AutoFormat stuff Changes to OUString constructor usages, tests completely No idea why, but SfxStringItem constructor which takes a OUString& now insists of not getting ::OUString's handed in - changed all 'SfxStringItem.*OUString.*".*"' accordingly Change-Id: Ibed7358b18fb019994a7490332b9d797a6694c29 Reviewed-on: https://gerrit.libreoffice.org/71075 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2019-03-19tdf#42949 Fix IWYU warnings in sw/source/core/inc/[a-f]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I6c3ae806cbb4a00381e39414ff8c8fede5bf1733 Reviewed-on: https://gerrit.libreoffice.org/69150 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-08new loplugin constvarsNoel Grandin
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-25tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: If173f42302553b164267909a0a3156bb25a6d558 Reviewed-on: https://gerrit.libreoffice.org/63957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-07loplugin:collapseif in swNoel Grandin
Change-Id: I61e32f6ecaf72d51528af4b067d651a17691d4b1 Reviewed-on: https://gerrit.libreoffice.org/62986 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-19sw: rework annoying GetFrameOfModify/getLayoutFrame parametersMichael Stahl
The bCalcFrame is only evaluated if a pPoint is given; this is surprising and should be more visible in the interface, so people don't go on a goose chase to find places that may do formatting in inappropriate places. So put these parameters into a pair instead, which doesn't have particularly good ergonomics in C++, particularly since compilers warn about taking the address of a temporary object... Change-Id: I101c6eeb5bd6baf83c2bd9a6cb91ccaa04036cc3 Reviewed-on: https://gerrit.libreoffice.org/60695 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-06-08sw_redlinehide: trivial GetNode() in atrfrm.cxx,fly.cxx,flylay.cxxMichael Stahl
Change-Id: Id15b867e8a275529822bab8ce82da5eb2eeb484b
2018-05-25SOSAW080: Derive SdrObjGroup from SdrObjListArmin Le Grand
Also simplify parent/child relationships, get rid of double data (SdrPage/Parent infos in SdrObjects, also in SdrObjList). This is all not needed - when a SdrObject is inserted to a SdrPage, get SdrPage by traveling over parents (no double info, member as soon as inserted, ...). More cleanups/reworks included, will need some more cleanups, too. Stabilizing: SetRectsDirty/DefaultStyleSheet Had to correct the SetRectsDirty stuff for 3D due to going down the hierarchy while the 2D implementation goes the other direction -> endless loops. Added special handling for 3D stuff for now (will be chnaged again when SnapRect is no longer needed at SdrObject level). Also had to adapt how the DefaultStyleSheet is set at incarnated SdrObjects - better: their properties. Since we now always have a SdrModel, it is possible to correctly initialize with the correct default StyleSheet from that SdrModel. This needs to be done after ForceDefaultAttributes and in a way that again deletes Items that are set in the StyleSheet. This leads to an error in CppunitTest_sd_import_tests where I checked tdf100491 - it is okay and thus I change the control instance of the imported, XML-dumped file. The less hard attributes, the better for Styles in general. Cleanup of comments for last two commits Corrected SvxShape::getParent() Needed to get the direct parent, so test for SdrObject first (to get SdrObjGroup/E3DScene), for SdrPage second Fixed CppunitTest_sc_subsequent_export_test Several problems arose. The used SdrCaptionObj was Cloned, but the clone not inserted to a SdrPage. This leads to not being able to access a UNO API imlementation of the SdrPage (SvxPage) on lower levels. It worked before due to SdrObject having a SdrPage* additionally to being added to a SdrPage - this is exactly the main cleanup this change does. Looked for why it is cloned, could see no reasons. The SdrCaptionObj exists during all im/export, not difference to other SdrObjects (that do not get cloned). It is not changed in any way. It *might* be to suppress a crash that happened due to UNO API Service emfio/emfio not being available in the UnitTest scenario. Interestingly it did not crash with the cloned SdrCaptionObj, but the Graphic exported was probably wrong. Fixed by no longer Cloning the SdrCaptionObj and adding emfio/emfio UNO API Service. d139f821a5b39535a3e7b9c6261df7e18f8ae8ac 910e7f4bc628a715fda7545dffaf3369d5e76ea0 ca1de01b723051e09ac37d7ec7bba978beea41c5 3a76da1471dfe75e69847f64a6a3519ad21c8c9c Change-Id: I986586e326b563acebf00d931a7084c6eb09e5f8 Reviewed-on: https://gerrit.libreoffice.org/54689 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-04-07Revert "long->sal_Int32 in tools/gen.hxx"Stephan Bergmann
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-03long->sal_Int32 in tools/gen.hxxNoel Grandin
which triggered a lot of changes in sw/ Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6 Reviewed-on: https://gerrit.libreoffice.org/48806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-21loplugin:changetoolsgen in swNoel Grandin
Change-Id: If07efe4c15cfc28df38a9327856d39313ca78d50 Reviewed-on: https://gerrit.libreoffice.org/50078 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24Fix some IWYU warningsMiklos Vajna
Change-Id: I4b6e799c1afc2a762a3729ee89f3226c59a6eef8 Reviewed-on: https://gerrit.libreoffice.org/48462 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-11RotateFlyFrameFix: Disable AutoContour for rotated FlysArmin Le Grand
As long as it is not clear when, how and why we should offer this feature and if ODF needs to be adapted to it, disable the feature for now. Discussion about how to support is ongoing. Change-Id: I8ecd91ef9aefb6f49840a4f6108f5d5a17072af0 Reviewed-on: https://gerrit.libreoffice.org/47721 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-01-04sw: convert SwPageFrame::m_pSortedObjs to unique_ptrMichael Stahl
Change-Id: Id0cac6143c4c9278fc450048cc0b276d72d0c1a1
2017-12-18coverity#1426315 Logically dead codeCaolán McNamara
Change-Id: I61368c5fa5675ac6a9e43642700ae3ea03d2fda9
2017-12-17coverity#1426169 refactor to be less obscureCaolán McNamara
and coverity#1426166 no logic changes intended Change-Id: I241f3f09c6a4ab143b67eb9341e8a52acbae64e3 a026f03980fdf1c80d1c6cffbd8ad0325c8f5d02 Reviewed-on: https://gerrit.libreoffice.org/46619 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-11tdf#112443 disable off-page content positioningPatrick Jaap
Disable the positioning for objects that are completely off-page. During import, LO writer forces content always back to the page and causes unwanted content on the page in constrast to MSO. To achive this the top/left position of the content is compared to the bottom/right border of the clipping region. A new compatibility flag OFF_PAGE_POSITIONING is introduced for legacy rendering of legacy documents. A unit test demonstrates the issue. It resolves tdf#112443. Change-Id: I263c129f9f09ed909ad777a34f8b9ffc84d871e4 Reviewed-on: https://gerrit.libreoffice.org/43313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-21Avoid static_cast on dead SwVirtFlyDrawObj object for nowStephan Bergmann
...in SwFlyFrame::GetVirtDrawObj (sw/source/core/layout/fly.cxx) after 487ac20ecd73cf3d98071ba30cf5597d957017f7 "RotateFlyFrame3: add support for AutoContour" added this code, which causes at least UBSan (e.g., during CppunitTest_sw_rtfimport) to produce errors (starting with <https://ci.libreoffice.org/job/lo_ubsan/733/console>). There appear to be no negative consequences across 'make check' with this code disabled, so do that for now to unblock UBSan builds, until a real fix is provided. The backtrace of the bad static_cast on dead SwVirtFlyDrawObj is > SwFlyFrame::GetVirtDrawObj() (/sw/source/core/layout/fly.cxx:2599) > SwFlyFreeFrame::~SwFlyFreeFrame() (/sw/source/core/layout/flylay.cxx:93) > SwFlyAtContentFrame::~SwFlyAtContentFrame() (/sw/source/core/inc/flyfrms.hxx:161) > SwFlyAtContentFrame::~SwFlyAtContentFrame() (/sw/source/core/inc/flyfrms.hxx:161) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:431) > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:517) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429) > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540) > SwPageFrame::DestroyImpl() (/sw/source/core/layout/pagechg.cxx:295) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429) > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540) > SwRootFrame::DestroyImpl() (/sw/source/core/layout/newfrm.cxx:621) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429) > std::_Sp_counted_deleter<SwRootFrame*, void (*)(SwFrame*), std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:470) > std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:154) > std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:684) > std::__shared_ptr<SwRootFrame, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:1123) > std::shared_ptr<SwRootFrame>::~shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr.h:93) > SwViewShell::~SwViewShell() (/sw/source/core/view/vnew.cxx:364) > SwCursorShell::~SwCursorShell() (/sw/source/core/crsr/crsrsh.cxx:2743) > SwEditShell::~SwEditShell() (/sw/source/core/edit/edws.cxx:64) > SwFEShell::~SwFEShell() (/sw/source/core/frmedt/fews.cxx:700) > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1662) > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1655) > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1045) > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1011) > SfxViewFrame::ReleaseObjectShell_Impl() (/sfx2/source/view/viewfrm.cxx:992) > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1363) > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1357) > SfxViewFrame::Close() (/sfx2/source/view/viewfrm.cxx:1044) > SfxFrame::DoClose_Impl() (/sfx2/source/view/frame.cxx:155) > SfxBaseController::dispose() (/sfx2/source/view/sfxbasecontroller.cxx:1003) > (anonymous namespace)::Frame::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) (/framework/source/services/frame.cxx:1474) > (anonymous namespace)::Frame::close(unsigned char) (/framework/source/services/frame.cxx:1681) > SfxFrame::DoClose() (/sfx2/source/view/frame.cxx:121) > SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) (/sfx2/source/view/viewfrm.cxx:1251) > SfxBroadcaster::Broadcast(SfxHint const&) (/svl/source/notify/SfxBroadcaster.cxx:49) > SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) (/sfx2/source/doc/objxtor.cxx:167) > SfxBaseModel::close(unsigned char) (/sfx2/source/doc/sfxbasemodel.cxx:1348) > SwXTextDocument::close(unsigned char) (/sw/source/uibase/uno/unotxdoc.cxx:623) > SfxBaseModel::dispose() (/sfx2/source/doc/sfxbasemodel.cxx:722) > SwXTextDocument::dispose() (/sw/source/uibase/uno/unotxdoc.cxx:615) > SwModelTestBase::tearDown() (/sw/qa/extras/inc/swmodeltestbase.hxx:206) > CppUnit::TestCaller<testN695479>::tearDown() (/workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:185) > CppUnit::TestCaseMethodFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32) > (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/test/source/vclbootstrapprotector.cxx:39) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20) > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20) > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63) and the backtrace of the destruction of that SwVirtFlyDrawObj object is > operator delete(void*) (/builddir/build/BUILD/valgrind-3.13.0/coregrind/m_replacemalloc/vg_replace_malloc.c:576) > SwVirtFlyDrawObj::~SwVirtFlyDrawObj() (/sw/source/core/draw/dflyobj.cxx:433) > SwFlyFrame::FinitDrawObj() (/sw/source/core/layout/fly.cxx:379) > SwFlyFrame::DestroyImpl() (/sw/source/core/layout/fly.cxx:277) > SwFlyFreeFrame::DestroyImpl() (/sw/source/core/layout/flylay.cxx:87) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429) > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:517) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429) > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540) > SwPageFrame::DestroyImpl() (/sw/source/core/layout/pagechg.cxx:295) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429) > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540) > SwRootFrame::DestroyImpl() (/sw/source/core/layout/newfrm.cxx:621) > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429) > std::_Sp_counted_deleter<SwRootFrame*, void (*)(SwFrame*), std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:470) > std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:154) > std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:684) > std::__shared_ptr<SwRootFrame, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:1123) > std::shared_ptr<SwRootFrame>::~shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr.h:93) > SwViewShell::~SwViewShell() (/sw/source/core/view/vnew.cxx:364) > SwCursorShell::~SwCursorShell() (/sw/source/core/crsr/crsrsh.cxx:2743) > SwEditShell::~SwEditShell() (/sw/source/core/edit/edws.cxx:64) > SwFEShell::~SwFEShell() (/sw/source/core/frmedt/fews.cxx:700) > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1662) > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1655) > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1045) > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1011) > SfxViewFrame::ReleaseObjectShell_Impl() (/sfx2/source/view/viewfrm.cxx:992) > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1363) > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1357) > SfxViewFrame::Close() (/sfx2/source/view/viewfrm.cxx:1044) > SfxFrame::DoClose_Impl() (/sfx2/source/view/frame.cxx:155) > SfxBaseController::dispose() (/sfx2/source/view/sfxbasecontroller.cxx:1003) > (anonymous namespace)::Frame::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) (/framework/source/services/frame.cxx:1474) > (anonymous namespace)::Frame::close(unsigned char) (/framework/source/services/frame.cxx:1681) > SfxFrame::DoClose() (/sfx2/source/view/frame.cxx:121) > SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) (/sfx2/source/view/viewfrm.cxx:1251) > SfxBroadcaster::Broadcast(SfxHint const&) (/svl/source/notify/SfxBroadcaster.cxx:49) > SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) (/sfx2/source/doc/objxtor.cxx:167) > SfxBaseModel::close(unsigned char) (/sfx2/source/doc/sfxbasemodel.cxx:1348) > SwXTextDocument::close(unsigned char) (/sw/source/uibase/uno/unotxdoc.cxx:623) > SfxBaseModel::dispose() (/sfx2/source/doc/sfxbasemodel.cxx:722) > SwXTextDocument::dispose() (/sw/source/uibase/uno/unotxdoc.cxx:615) > SwModelTestBase::tearDown() (/sw/qa/extras/inc/swmodeltestbase.hxx:206) > CppUnit::TestCaller<testN695479>::tearDown() (/workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:185) > CppUnit::TestCaseMethodFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32) > (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/test/source/vclbootstrapprotector.cxx:39) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20) > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20) Change-Id: Ida6e66c3bc8f85c9cbe60a33aaf40f5e83f16212 Reviewed-on: https://gerrit.libreoffice.org/44976 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-18RotateFlyFrame3: add support for AutoContourArmin Le Grand
For transformed FlyFrames with no Border and no Padding it would be nice to immediately start using AutoContour, added first implementation to do so. Added several conditions for AutoContour, need to work on reaction on changes to these. Corrected needed transform adaptions to Contour(s) Change-Id: Ia3d7845fd5d50c8a413d592ae07ce2041ccc91b9
2017-11-18RotateFlyFrame3: Made interactions work properlyArmin Le Grand
Have now created working interactive Rotation, Scale, Move and Crop. Using as much of the old code as possible since it does corrections based on BorderWidth/s stuff and similar. To do so, need to back-transform and execute in unrotated/ untransformed state as much as possible. Had some problems with SwVirtFlyDrawObj::NbcMove usages and hacks there, had to restructure some of these. Change-Id: Ibedf6d834f96b2f8e9c1ace2a0c984aa26cedc74
2017-11-18RotateFlyFrame3: Restructured TransformableSwFrameArmin Le Grand
No longer derive a SwFrame that needs Transformation support from TransformableSwFrame, but keep it as a member (in a std::unique_ptr). Adapted all usages, also added reset of local SwRect(s) in local SwFrameAreaDefinition during layouting. That makes PrintPreview work correctly. Change-Id: I2e7720e67b57d4d29c0feb065878e246192a8a4c
2017-11-18RotateFlyFrame3: Added basic transformation supportArmin Le Grand
In lcl_MoveAllLowers SwFrame(s) were directly modified, not even by calling any member method what makes it hard to react on changes to geometric definition(s). Added logic to Transform a SwFrame, currently basic by using e.g. SwFrame::Ltransform_translate, may be later unified to general Transformation usage with a homogen Matrix Change-Id: I7582fbd1472e12e481adacedda2e65cc0c282eac
2017-11-18RotateFlyFrame3: Isolated functionality and automationsArmin Le Grand
Isolated tooling stuff for SwFrames that support Transformations to TransformableSwFrame, adapted all usages. Developed functionality to reset temporarily the already adapted SwFrame of the outer frame to non-rotated to mate the layouting work. Made the outer frame being layouted always first. Change-Id: Ia60a971b8eaa28859d0f2a5243eabf68fe949846
2017-11-18RotateFlyFrame3: Late-Updating of AreasArmin Le Grand
When Layouting the update of the Areas is needed, but during layout needs to be stable on the unrotated values. Hard to find the right spot to do this, decided to use the inner/outer frame, layout both, and trigger the updates when the inner frame is layouted to non- rotated Areas for inner and outer frame. Still not sure if this will be correct, but is close to working well. Some repaints/updates missing Change-Id: I3d7dcbf624f3f32392e5e98420cb348d11d7d322
2017-11-18RotateFlyFrame3: Added transformation support to SwFrameArmin Le Grand
The layout element SwFrame now has methods to get linear transformations for the geometry-defining FrameAreaDefinitions. These return by default the SwRect (without being relative for the FramePrintArea to make things easier), but are replaced by the now two SwFrame derivates that support rotation. The layout will now use the BoundRects of the transformations, thus supporting a future that will allow all kinds of free transformations (including mirror, rotation and shear) Change-Id: I18b85f5ddc2970a1b8c137d30b0c2ee49bb8df72
2017-11-18RotateFlyFrame3: Initial support addedArmin Le Grand
First steps to get a rotated FlyFrame and content that only uses layouted sizes/positions and does not change the model data (except rotation). This works with persistence, after reload the rotation can be resetted with going back to the original FrameSize. Lot of stuff not yet working, experimental state. Change-Id: Ie29d501fe2e618a1cb4457d600ce97575ed372d0
2017-11-09new loplugin simplifydynamiccastNoel Grandin
simplify dynamic_cast followed by static_cast Change-Id: I965afcf05d1675094cfde53d3590a0fd00f26279 Reviewed-on: https://gerrit.libreoffice.org/44460 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-31RotateFlyFrame2: Unified FrameAreaDefinitionArmin Le Grand
Isolated all Frame AreaDefinition and it's layout flags to SwFrameAreaDefinition class which is now base for SwFrame. Adapted calls to get/set and WriteAccess hekper classes accordingly. This allows much deeper understanding what Writer is doing when layouting it's frames and needed when reaction on such changes is necessary Change-Id: I96220a1d140e69c76cc63023aae26e4ed17f3504
2017-10-30Adapted to get methods and WriteAccess helpersArmin Le Grand
Change-Id: Ife3c1b2391ad7beae8c7f31f796b1454709ddd26
2017-10-30Adapted to get/setSwFrame and get/setSwPrintArmin Le Grand
Change-Id: I6cce40ec49dd5bd32d94fe06b9d2dabd368448be
2017-10-30Migrated from SwFrame::PrintWA to setPrintArmin Le Grand
Change-Id: Ieea3b467f296a190de5b5f47721bef148bebf60b
2017-10-30Migrated from SwFrame::FrameWA to setFrameArmin Le Grand
Change-Id: I01f7b828fe2134411cc76639e880da46b415d767
2017-10-30Isolated SwFrame members maFrane and maPrtArmin Le Grand
To gain more control over changes of the Writer layout, isolated mentioned members and replaced all calls with inline methods for read and/or write access. Moved to own class to also identify 'private' accesses reliably. Change-Id: Ib0b7f852f5176744e860e2aad12dd13c9a906d68
2017-10-23loplugin:includeform: swStephan Bergmann
Change-Id: Ifc3c4c31a31ee7189eeab6f1af30b94d64f2f92a
2017-07-02loplugin:casttovoid: swStephan Bergmann
Change-Id: I224e9995962901e8740bfaed06d57f7c0389236c
2017-06-10tdf#108118 sw: fix recursive layouting during SwCursorShell::Paint()Michael Stahl
The problem, in a nutshell, is that SwDrawContact::Changed() is called during layout, and recursively starts another layout that removes a drawing object that is being iterated over in frame #28 SwObjectFormatter::FormatObjsAtFrame_() from the layout. Apparently SwDrawContact::Changed() is by far the most dangerous function to call during layout; set the quite targeted flag SetCallbackActionEnabled() to prevent the recursion. 0 SwSortedObjs::Remove(SwAnchoredObject&) (this=0x73e4a00, _rAnchoredObj=...) at sw/source/core/layout/sortedobjs.cxx:228 1 SwFrame::RemoveDrawObj(SwAnchoredObject&) (this=0x9430e20, _rToRemoveObj=...) at sw/source/core/layout/fly.cxx:2076 2 SwDrawVirtObj::RemoveFromWriterLayout() (this=0x95ce130) at sw/source/core/draw/dcontact.cxx:2199 3 SwDrawContact::DisconnectObjFromLayout(SdrObject*) (this=0x70fef00, _pDrawObj=0x95ce130) at sw/source/core/draw/dcontact.cxx:1663 4 SwLayoutFrame::DestroyImpl() (this=0x91c6c60) at sw/source/core/layout/ssfrm.cxx:489 5 SwFrame::DestroyFrame(SwFrame*) (pFrame=0x91c6c60) at sw/source/core/layout/ssfrm.cxx:389 6 SwLayoutFrame::DestroyImpl() (this=0x9435cd0) at sw/source/core/layout/ssfrm.cxx:500 7 SwPageFrame::DestroyImpl() (this=0x9435cd0) at sw/source/core/layout/pagechg.cxx:270 8 SwFrame::DestroyFrame(SwFrame*) (pFrame=0x9435cd0) at sw/source/core/layout/ssfrm.cxx:389 9 SwRootFrame::RemovePage(SwPageFrame**, SwRemoveResult) (this=0x36b26f0, pDelRef=0x7ffeafbf2e38, eResult=SwRemoveResult::Prev) at sw/source/core/layout/pagechg.cxx:1351 10 SwRootFrame::RemoveSuperfluous() (this=0x36b26f0) at sw/source/core/layout/pagechg.cxx:1426 11 SwLayAction::InternalAction(OutputDevice*) (this=0x7ffeafbf3250, pRenderContext=0x3595030) at sw/source/core/layout/layact.cxx:502 12 SwLayAction::Action(OutputDevice*) (this=0x7ffeafbf3250, pRenderContext=0x3595030) at sw/source/core/layout/layact.cxx:351 13 SwViewShell::ImplEndAction(bool) (this=0x364cc00, bIdleEnd=false) at sw/source/core/view/viewsh.cxx:279 14 SwViewShell::EndAction(bool) (this=0x364cc00, bIdleEnd=false) at sw/inc/viewsh.hxx:605 15 SwCursorShell::EndAction(bool, bool) (this=0x364cc00, bIdleEnd=false, DoSetPosX=false) at sw/source/core/crsr/crsrsh.cxx:259 16 SwRootFrame::EndAllAction(bool) (this=0x36b26f0, bVirDev=false) at sw/source/core/layout/pagechg.cxx:1728 17 SwDrawContact::Changed(SdrObject const&, SdrUserCallType, tools::Rectangle const&) (this=0x70fef00, rObj=..., eType=SdrUserCallType::MoveOnly, rOldBoundRect=...) at sw/source/core/draw/dcontact.cxx:985 18 SdrObject::SendUserCall(SdrUserCallType, tools::Rectangle const&) const (this=0x95ce130, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at svx/source/svdraw/svdobj.cxx:2736 19 SdrObject::Move(Size const&) (this=0x95ce130, rSiz=Size = {...}) at svx/source/svdraw/svdobj.cxx:1482 20 SwDrawVirtObj::Move(Size const&) (this=0x95ce130, rSiz=Size = {...}) at sw/source/core/draw/dcontact.cxx:2366 21 SwAnchoredDrawObject::SetObjTop_(long) (this=0x95ce250, _nTop=777490) at sw/source/core/layout/anchoreddrawobject.cxx:677 22 SwAnchoredObject::SetObjTop(long) (this=0x95ce250, _nTop=777490) at sw/source/core/layout/anchoredobject.cxx:593 23 objectpositioning::SwToContentAnchoredObjectPosition::CalcPosition() (this=0x7ffeafbf3980) at sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx:739 24 SwAnchoredDrawObject::MakeObjPosAnchoredAtPara() (this=0x95ce250) at sw/source/core/layout/anchoreddrawobject.cxx:421 25 SwAnchoredDrawObject::MakeObjPos() (this=0x95ce250) at sw/source/core/layout/anchoreddrawobject.cxx:318 26 SwObjectFormatter::FormatObj_(SwAnchoredObject&) (this=0x90623d0, _rAnchoredObj=...) at sw/source/core/layout/objectformatter.cxx:374 27 SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool) (this=0x90623d0, _rAnchoredObj=..., _bCheckForMovedFwd=false) at sw/source/core/layout/objectformattertxtfrm.cxx:126 28 SwObjectFormatter::FormatObjsAtFrame_(SwTextFrame*) (this=0x90623d0, _pMasterTextFrame=0x0) at sw/source/core/layout/objectformatter.cxx:443 29 SwObjectFormatterTextFrame::DoFormatObjs() (this=0x90623d0) at sw/source/core/layout/objectformattertxtfrm.cxx:328 30 SwObjectFormatter::FormatObjsAtFrame(SwFrame&, SwPageFrame const&, SwLayAction*) (_rAnchorFrame=..., _rPageFrame=..., _pLayAction=0x0) at sw/source/core/layout/objectformatter.cxx:191 31 SwHeadFootFrame::FormatSize(long, SwBorderAttrs const*) (this=0x91c6c60, nUL=663, pAttrs=0x8fbc530) at sw/source/core/layout/hffrm.cxx:263 32 SwHeadFootFrame::Format(OutputDevice*, SwBorderAttrs const*) (this=0x91c6c60, pRenderContext=0x3595030, pAttrs=0x8fbc530) at sw/source/core/layout/hffrm.cxx:416 33 SwLayoutFrame::MakeAll(OutputDevice*) (this=0x91c6c60) at sw/source/core/layout/calcmove.cxx:913 34 SwFrame::PrepareMake(OutputDevice*) (this=0x91c6c60, pRenderContext=0x3595030) at sw/source/core/layout/calcmove.cxx:346 35 SwFrame::Calc(OutputDevice*) const (this=0x91c6c60, pRenderContext=0x3595030) at sw/source/core/layout/trvlfrm.cxx:1783 36 lcl_FormatLay(SwLayoutFrame*) (pLay=0x91c6c60) at sw/source/core/layout/pagechg.cxx:360 37 lcl_FormatLay(SwLayoutFrame*) (pLay=0x9435cd0) at sw/source/core/layout/pagechg.cxx:357 38 SwPageFrame::PreparePage(bool) (this=0x9435cd0, bFootnote=false) at sw/source/core/layout/pagechg.cxx:456 39 (anonymous namespace)::doInsertPage(SwRootFrame*, SwPageFrame**, SwFrameFormat*, SwPageDesc*, bool, SwPageFrame**) (pRoot=0x36b26f0, pRefSibling=0x7ffeafbf43c8, pFormat=0x3076050, pDesc=0x3076010, bFootnote=false, pRefPage=0x7ffeafbf43d8) at sw/source/core/layout/pagechg.cxx:1210 40 SwFrame::InsertPage(SwPageFrame*, bool) (this=0x3620d70, pPrevPage=0x9227900, bFootnote=false) at sw/source/core/layout/pagechg.cxx:1269 41 SwFrame::GetNextLeaf(MakePageType) (this=0x3620d70, eMakePage=MAKEPAGE_INSERT) at sw/source/core/layout/flowfrm.cxx:994 42 SwFrame::GetLeaf(MakePageType, bool) (this=0x3620d70, eMakePage=MAKEPAGE_INSERT, bFwd=true) at sw/source/core/layout/flowfrm.cxx:797 43 SwFlowFrame::MoveFwd(bool, bool, bool) (this=0x3620e18, bMakePage=true, bPageBreak=false, bMoveAlways=false) at sw/source/core/layout/flowfrm.cxx:1851 44 SwContentFrame::MakeAll(OutputDevice*) (this=0x3620d70) at sw/source/core/layout/calcmove.cxx:1681 45 SwFrame::PrepareMake(OutputDevice*) (this=0x707a340, pRenderContext=0x3595030) at sw/source/core/layout/calcmove.cxx:312 46 SwFrame::Calc(OutputDevice*) const (this=0x707a340, pRenderContext=0x3595030) at sw/source/core/layout/trvlfrm.cxx:1783 47 GetFrameOfModify(SwRootFrame const*, SwModify const&, SwFrameType, Point const*, SwPosition const*, bool) (pLayout=0x36b26f0, rMod=..., nFrameType=(SwFrameType::Txt | SwFrameType::NoTxt), pPoint=0x707c6f0, pPos=0x707c720, bCalcFrame=true) at sw/source/core/layout/frmtool.cxx:3247 48 SwContentNode::getLayoutFrame(SwRootFrame const*, Point const*, SwPosition const*, bool) const (this=0x71328c0, _pRoot=0x36b26f0, pPoint=0x707c6f0, pPos=0x707c720, bCalcFrame=true) at sw/source/core/docnode/node.cxx:1118 49 SwRootFrame::CalcFrameRects(SwShellCursor&) (this=0x36b26f0, rCursor=...) at sw/source/core/layout/trvlfrm.cxx:2028 50 SwShellCursor::FillRects() (this=0x707c680) at sw/source/core/crsr/viscrs.cxx:609 51 SwSelPaintRects::Show(std::__debug::vector<rtl::OString, std::allocator<rtl::OString> >*) (this=0x707c680, pSelectionRectangles=0x7ffeafbf5570) at sw/source/core/crsr/viscrs.cxx:332 52 SwShellCursor::Show(SfxViewShell*) (this=0x707c680, pViewShell=0x0) at sw/source/core/crsr/viscrs.cxx:619 53 SwCursorShell::Paint(OutputDevice&, tools::Rectangle const&) (this=0x364cc00, rRenderContext=..., rRect=...) at sw/source/core/crsr/crsrsh.cxx:1283 54 SwEditWin::Paint(OutputDevice&, tools::Rectangle const&) (this=0x3595030, rRenderContext=..., rRect=...) at sw/source/uibase/docvw/edtwin2.cxx:476 Change-Id: I1b237f0f425e58bb95bae9f19019f26fe5da21fd
2017-05-30teach redundantcast plugin about functional castsNoel Grandin
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0 Reviewed-on: https://gerrit.libreoffice.org/37910 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-20convert RndStdIds to scoped enumNoel Grandin
Change-Id: I029ad67dfcbc40f3953adf485957efcbd97f23d0 Reviewed-on: https://gerrit.libreoffice.org/35328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-18Typo: sucess->success + "adminsitrator" fixJulien Nabet
Change-Id: I42fdb0a60b987af92e0433e7ff0e5754bc1da748 Reviewed-on: https://gerrit.libreoffice.org/35412 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-12-08SwRectFnSet: hide pointer-to-(member)function syntaxMike Kaganski
Change-Id: I700e51dbfe0768642d482556299407f8f198e998 Reviewed-on: https://gerrit.libreoffice.org/31709 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-09-23Replace SWRECTFN macro with a classMike Kaganski
Change-Id: Ib400c5930be84d26665b0e12a61508c8fbfd7f08 Reviewed-on: https://gerrit.libreoffice.org/29105 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2016-07-08loplugin:redundantcast: redundant static_casts in swStephan Bergmann
Change-Id: I09c1ebaf5742e983ee05942a4c7c17c6aa5179cc
2016-05-12clang-tidy modernize-loop-convert in swNoel Grandin
Change-Id: I1f4a0ad6658bd3154c48940296aa8edc1ea1612c Reviewed-on: https://gerrit.libreoffice.org/24876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-03-31tdf#84938 convert FRM_ constants to scoped enumNoel Grandin
Change-Id: I785d154a5df9a33b7d513dee1d3d859e5e800e7a