summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/paintfrm.cxx
AgeCommit message (Collapse)AuthorFilesLines
2021-02-10tdf#91920 sw page gutter margin: handle mirrored marginsMiklos Vajna1-6/+15
- SwPageDesc::Mirror: generate "right gutter margin" from gutter margin for mirrored pages, we just lost the gutter margin here previously - SwBorderAttrs::CalcRight: handle right gutter margin, so gutter increases the right margin, not the left margin on mirrored pages - lcl_CalcBorderRect: similar to left and top margins, compensate for right margin gutter as well, so borders are independent from the gutter margin (Word compat) (cherry picked from commit ffe7fd5c3f3de474b201fbb1e25b8251cb13574d) Conflicts: editeng/source/items/frmitems.cxx include/editeng/lrspitem.hxx sw/source/core/layout/paintfrm.cxx Change-Id: Ie4d3459ab6edcc60b20c2fed08dbf45060ca9828 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110692 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-09tdf#91920 sw page gutter margin, from top: add layoutMiklos Vajna1-1/+9
Take the new doc setting into account and if it's true, then undo the existing "increase left margin" logic, and do an "increase top margin" one instead. (cherry picked from commit 59e816faa2a2bc0b88c39f063c53e00a33f23722) Conflicts: sw/source/core/layout/paintfrm.cxx Change-Id: I358a34790a52e2720ec23e6841d56e66858e28b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110640 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-09tdf#91920 sw page gutter margin: add layoutMiklos Vajna1-0/+10
Handle this in general by decreasing the print area of the page frame, that way the position and size of the child frames (header, body, etc) will be correct. One catch is that the page border is independent from the gutter margin in Word, so compensate for it in lcl_CalcBorderRect() have matching render result. (E.g. 1cm gutter margin, 1cm left and right margins, then we would default to drawing the left margin at 2cm from left edge, but 1cm is wanted.) (cherry picked from commit b1779452bdf8b4d00791f013945cb9aa12b19723) Conflicts: sw/qa/core/layout/layout.cxx Change-Id: I41a697e8230c975e7665a06c7b739df04826e9a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110625 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-07sw table cell borders: add optional Word-compatible border collapsingMiklos Vajna1-0/+12
We always compared border width and other aspects only after that, Word works with border weight according to their implementer notes. So extend svx::frame::Style to be able to collapse borders using weights and opt in for that from sw/ in case a compat mode (which is related to tables, off by default and is set by the DOC/DOCX import) is set. (cherry picked from commit e6fa52c2c371c7adc9c2c2cb18c3a8cf782cfa4b) Change-Id: I1f682789302c88a0d326c6c0263ad3007441cb24
2020-04-05tdf#131004 fix unstable paint of writer consecutive section framesSerge Krot1-4/+4
Change-Id: I565129dcd077ddbfccedb37dfbf1b9e1acf4eb95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91532 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 8666dfecbaac69b9dc9a9c23a05654d847608907) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91521
2019-09-10Fix typosAndrea Gelmini1-1/+1
Change-Id: Id62178a1a8b2e05d13c47f1ac4798578f140dbae Reviewed-on: https://gerrit.libreoffice.org/78794 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-08-24loplugin:returnconstval in swNoel Grandin1-1/+1
Change-Id: I15d8553bff7528f690ff92bee75d6a67037c0adf Reviewed-on: https://gerrit.libreoffice.org/78062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20loplugin:constvars in swNoel Grandin1-1/+1
Change-Id: Ic1f11240561ba8fffc51710c9a49933c3ab3849d Reviewed-on: https://gerrit.libreoffice.org/77826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-07Fix typosAndrea Gelmini1-6/+6
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-26tdf#126222 Headers/footers are at correct position after scrollingIlhan Yesil1-0/+12
After scrolling, the positions of headers and footers of the previous pages have to be updated, else these headers and footers could get visible at a wrong position. Change-Id: I25508cc0fc0bb7a6e59aeb996e2e7e0a0e23511f Reviewed-on: https://gerrit.libreoffice.org/75118 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-07-25Avoid using invalidated rRectStephan Bergmann1-1/+4
...as happens during `convert-to pdf doc/ooo107799-1.doc` (i.e., oracle apex.doc attached at <https://bz.apache.org/ooo/show_bug.cgi?id=107799#c1>): > ==29889==ERROR: AddressSanitizer: heap-use-after-free on address 0x61200034f548 at pc 0x0000002ebcaa bp 0x7fff9666f320 sp 0x7fff9666ead0 > READ of size 16 at 0x61200034f548 thread T0 > #0 in __asan_memcpy at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cc:22:3 > #1 in SwRect::SwRect(SwRect const&) at sw/inc/swrect.hxx:313:5 > #2 in SwRootFrame::PaintSwFrame(OutputDevice&, SwRect const&, SwPrintData const*) const at sw/source/core/layout/paintfrm.cxx:2971:12 > #3 in SwViewShell::PrintOrPDFExport(OutputDevice*, SwPrintData const&, int, bool) at sw/source/core/view/vprint.cxx:542:30 > #4 in SwXTextDocument::render(int, com::sun::star::uno::Any const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sw/source/uibase/uno/unotxdoc.cxx:3026:32 > #5 in PDFExport::ExportSelection(vcl::PDFWriter&, com::sun::star::uno::Reference<com::sun::star::view::XRenderable> const&, com::sun::star::uno::Any const&, StringRangeEnumerator const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&, int) at filter/source/pdf/pdfexport.cxx:227:34 > #6 in PDFExport::Export(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at filter/source/pdf/pdfexport.cxx:939:28 > > 0x61200034f548 is located 8 bytes inside of 272-byte region [0x61200034f540,0x61200034f650) > freed by thread T0 here: > #0 in operator delete(void*, unsigned long) at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:172:3 > #1 in SwPageFrame::~SwPageFrame() at sw/source/core/layout/pagechg.cxx:301:1 > #2 in SwFrame::DestroyFrame(SwFrame*) at sw/source/core/layout/ssfrm.cxx:389:9 > #3 in SwRootFrame::RemovePage(SwPageFrame**, SwRemoveResult) at sw/source/core/layout/pagechg.cxx:1426:5 > #4 in SwRootFrame::RemoveSuperfluous() at sw/source/core/layout/pagechg.cxx:1501:13 > #5 in SwLayAction::InternalAction(OutputDevice*) at sw/source/core/layout/layact.cxx:494:30 > #6 in SwLayAction::Action(OutputDevice*) at sw/source/core/layout/layact.cxx:349:5 > #7 in SwRootFrame::PaintSwFrame(OutputDevice&, SwRect const&, SwPrintData const*) const at sw/source/core/layout/paintfrm.cxx:2965:17 > #8 in SwViewShell::PrintOrPDFExport(OutputDevice*, SwPrintData const&, int, bool) at sw/source/core/view/vprint.cxx:542:30 > #9 in SwXTextDocument::render(int, com::sun::star::uno::Any const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sw/source/uibase/uno/unotxdoc.cxx:3026:32 Change-Id: I2931920d19d535f569c61fb9d7f1ce21bf7a0d88 Reviewed-on: https://gerrit.libreoffice.org/76270 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
2019-06-27tdf#125751 sw: fix crash on formatting in SwLayoutFrame::PaintSwFrame()Michael Stahl1-0/+1
It's less than ideal that the document is painted before being fully formatted, but let's try to apply a band-aid... 0x6120001a97d0 is located 144 bytes inside of 280-byte region [0x6120001a9740,0x6120001a9858) freed by thread T0 here: #1 SwFootnoteFrame::~SwFootnoteFrame() /home/ms/lo/master/sw/source/core/inc/ftnfrm.hxx:64:7 #2 SwFrame::DestroyFrame(SwFrame*) sw/source/core/layout/ssfrm.cxx:389:9 #3 SwContentFrame::Cut() sw/source/core/layout/wsfrm.cxx:1263:25 #4 SwFlowFrame::MoveBwd(bool&) sw/source/core/layout/flowfrm.cxx:2544:17 #5 SwContentFrame::MakeAll(OutputDevice*) sw/source/core/layout/calcmove.cxx:1522:17 #6 SwFrame::PrepareMake(OutputDevice*) sw/source/core/layout/calcmove.cxx:366:5 #7 SwFrame::Calc(OutputDevice*) const sw/source/core/layout/trvlfrm.cxx:1791:37 #8 SwLayoutFrame::PaintSwFrame(OutputDevice&, SwRect const&, SwPrintData const*) const sw/source/core/layout/paintfrm.cxx:3328:17 #9 SwLayoutFrame::PaintSwFrame(OutputDevice&, SwRect const&, SwPrintData const*) const sw/source/core/layout/paintfrm.cxx:3406:21 #10 SwLayoutFrame::PaintSwFrame(OutputDevice&, SwRect const&, SwPrintData const*) const sw/source/core/layout/paintfrm.cxx:3406:21 #11 SwRootFrame::PaintSwFrame(OutputDevice&, SwRect const&, SwPrintData const*) const sw/source/core/layout/paintfrm.cxx:3116:24 #12 SwViewShell::Paint(OutputDevice&, tools::Rectangle const&) sw/source/core/view/viewsh.cxx:1840:34 (reportedly a regression from 18765b9fa739337d2d891513f6e2fb7c3ce23b50) Change-Id: Iff5e783985c180b704b273fa26b7c498820640ac Reviewed-on: https://gerrit.libreoffice.org/74749 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-06-25improve loplugin:simplifyconstructNoel Grandin1-1/+1
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-12Fix failing assert "!mbWidthEmpty"Stephan Bergmann1-1/+4
After a46a257794f1f53b294735fc876c394be23a3811 "improve empty tools::Rectangle (width)", ´make clean && make CppunitTest_desktop_lib` fails with > #8 0x00007f5651bfc566 in __GI___assert_fail (assertion=0x7f563520c4b6 "!mbWidthEmpty", file=0x7f563536311f "include/tools/gen.hxx", line=390, function=0x7f56353300cb "long tools::Rectangle::Right() const") at /usr/src/debug/glibc-2.29-24-g2ec0b166bf/assert/assert.c:101 > #9 0x00007f5635bc769b in tools::Rectangle::Right() const (this=0x7fff9fcd5140) at include/tools/gen.hxx:390 > #10 0x00007f56364f7f77 in lcl_paintBitmapExToRect(OutputDevice*, Point const&, Size const&, BitmapEx const&, PaintArea) (pOut=0x24cceb0, aPoint=..., aSize=..., rBitmapEx=..., eArea=LEFT) at sw/source/core/layout/paintfrm.cxx:5699 > #11 0x00007f56364e5080 in SwPageFrame::PaintBorderAndShadow(SwRect const&, SwViewShell const*, bool, bool, bool) (_rPageRect=..., _pViewShell=0x242dba0, bPaintLeftShadow=true, bPaintRightShadow=true, bRightSidebar=true) at sw/source/core/layout/paintfrm.cxx:5862 > #12 0x00007f56364e0989 in SwRootFrame::PaintSwFrame(OutputDevice&, SwRect const&, SwPrintData const*) const (this=0x1f554c0, rRenderContext=..., rRect=..., pPrintData=0x0) at sw/source/core/layout/paintfrm.cxx:3122 > #13 0x00007f5636c57816 in SwViewShell::Paint(OutputDevice&, tools::Rectangle const&) (this=0x242dba0, rRenderContext=..., rRect=...) at sw/source/core/view/viewsh.cxx:1840 > #14 0x00007f5635cd6fbe in SwCursorShell::Paint(OutputDevice&, tools::Rectangle const&) (this=0x242dba0, rRenderContext=..., rRect=...) at sw/source/core/crsr/crsrsh.cxx:1411 > #15 0x00007f56370c3baf in SwEditWin::Paint(OutputDevice&, tools::Rectangle const&) (this=0x2491bf0, rRenderContext=..., rRect=...) at sw/source/uibase/docvw/edtwin2.cxx:449 > #16 0x00007f5640771bae in PaintHelper::DoPaint(vcl::Region const*) (this=0x7fff9fcd7ab0, pRegion=0x0) at vcl/source/window/paint.cxx:301 > #17 0x00007f56407738dd in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) (this=0x2491bf0, pRegion=0x0, nPaintFlags=(ImplPaintFlags::PaintAll | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at vcl/source/window/paint.cxx:605 [...] Change-Id: I039a175a732e0ecec3ac1d3bba2cb9195d6d7686 Reviewed-on: https://gerrit.libreoffice.org/73842 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-11tdf#42949 Fix IWYU warnings in include/svx/[sS][v-Z]*Gabor Kelemen1-0/+2
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie2a4122d67d2d40732e6fd00b584f33edd802c5b Reviewed-on: https://gerrit.libreoffice.org/73476 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-16tdf#42949 Fix IWYU warnings in include/svx/[e-g]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I861d3f0fa15ee3b7e0e830c4fac2e5794ea4071b Reviewed-on: https://gerrit.libreoffice.org/72213 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-14sw lok: assume no windows in SwLayoutFrame::PaintSwFrame()Miklos Vajna1-1/+6
The high-level problem was that a watermark shape in the background was rendered with lighter and darker gray as the user typed. The reason for this was that depending on what larger combined tile was rendered we did or did not repaint the layout frame. Handle the situation similar to when we have no vcl::Window at all, which ensures that we always paint only once. The rgb value matches the desktop rendering result this way. (Just assert that we render the gray light enough, the actual color channel value may be 190 or 191.) Change-Id: Ie8746ab70f49f7f1080632c39e3a826c4ce509df Reviewed-on: https://gerrit.libreoffice.org/72276 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-04-25WIP: Further preparations for deeper Item changesArmin Le Grand1-3/+4
(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 Kelemen1-0/+5
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-02-15loplugin:simplifybool extend to !(a == b) where comparison an overloaded opNoel Grandin1-2/+2
Change-Id: I08fcbe2569c07f5f97269ad861fa6d38f23a7cc7 Reviewed-on: https://gerrit.libreoffice.org/67816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13sw btlr writing mode layout: implement unmapping of this directionMiklos Vajna1-6/+16
Fix various cases which trigger this warning: warn:legacy.osl:10975:10975:sw/source/core/txtnode/swfont.cxx:427: Unsupported direction Which means that we tried to work with a VCL direction of 900, without passing around the btlr flag accordingly. Change-Id: I96374fc949f60e8324c5a84de48b710b6461bafb Reviewed-on: https://gerrit.libreoffice.org/67746 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-12sw btlr writing mode: implement initial layoutMiklos Vajna1-2/+2
The bulk of this commit is reasonably straightforward, the interesting parts are: - SwFrame::CheckDir() is where the layout reads the doc model, i.e. sets the new SwFrame::mbVertLRBT. - We had 3 text directions previously: horizontal, vertical (implicitly RL) and vertical LR (implicitly TB). This adds a 4th text direction for the LRBT case. - SwTextFrame::SwitchHorizontalToVertical() is responsible for re-locating the origo of a string to be painted from the top left to the bottom left corner (in addition to the height/width swap that's done for all vertical directions). - Finally MapDirection() is the place where we map Writer's new btlr mode (with no character rotation) to VCL's 900 (90 degrees) rotated direction. No functional changes intended for existing text directions. Lots of places are still not yet adapted, but this is good enough to paint a single word in a table cell at the correct position with the correct direction. Change-Id: I465c62db6562d8a2be140c3d37473e590830139e Reviewed-on: https://gerrit.libreoffice.org/67740 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-10loplugin:indentation in swNoel Grandin1-4/+5
Change-Id: I4936284bff568b6bb47e5df3821f4ddd78260e92 Reviewed-on: https://gerrit.libreoffice.org/67568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-06Enhance tagged PDF export for a11yArmin Le Grand1-1/+4
The current tagged PDF export does not well support quite some internal structures. This includes all apps (Draw/Impress/Writer/Calc) and some areas. -= AlternativeText ('/Alt'): Only writer currently at least adds Title information, but we also have Description (MS does add) and Name. Target is to add this information when available to content frames. Writer did that by manually adding that tag using PDFExtOutDevData::SetAlternateText, but only used Title so far. To make this work as broad as possible, better add this to primitives. There is already a primitive called ObjectInfoPrimitive2D that encapsulates any content adding Name/Title/Description using GroupPrimitive functionality. Changed Writer to use that way. Draw/Impress already uses it, all apps now use graphic paint using primitives, so we have a natural target to encapsulate. Add support to VclMetafileProcessor2D to interpret it and add - if mpPDFExtOutDevData->GetIsExportTaggedPDF() - that data using a combination of Name/Title/Description and add using mpPDFExtOutDevData->SetAlternateText. This works for Draw/Impress/Writer, but not for Calc because Calc does not create more complex data structures, so SetAlternateText does not work (see PDFWriterImpl::setAlternateText for more infos). -= Area tagged ListContent (use 'L', 'LI', 'LBody' PDF tags): To support this in Draw/Impress, we can also use a similar way to support in primitives. For this I evaluated how to add needed OutlineLevel information to the existing (and already used to write 'P') TextHierarchyParagraphPrimitive2D. Added this and now ready to use in VclMetafileProcessor2D ::processTextHierarchyParagraphPrimitive2D. Added now using the OutlineLevel information at the TextHierarchyParagraphPrimitive2D. Made sure there are fallbacks to unchanged old behaviour when no PDF export or no Tagged-PDF used. Creating now '/L', '/LI' and '/LBody' statements as tagged PDF wants us to do. Exported PDF still works well while additionally a verifier as 'PAC 3' shows the expected and wanted structure. This will work now for any text in Draw/Impress and for Draw-Objects using Lists in Calc. Need to check for direct text in Calc cells and Writer - and guess how big the effort would be for these to make it work there, too. -= Area '/Artifact': Target is to avoid too much ScreenReader hassle when Impress uses Pictures/FillPatterns etc. in Background - what means on MasterPage in Impress. Experimented with different possibilities. Decided to use existing StructureTagPrimitive2D and extend for info if encapsulated data is 'Background' data -> on MasterPage. Can be created in ImplRenderPaintProc in method createRedirectedPrimitive2DSeque as needed by checking for MasterPage member (remember: primitives need to be as independent from model data as possible, never include e.g. a SdrObject reference in any way). Tried different ways to use this in VclMetafileProcessor2D processStructureTagPrimitive2D, see comments there. Current best solution is to just *not* create StuctureTag information for these objects. Change-Id: Ib2a578b02c1256758cda6d15ce37799803d8205c
2019-01-17use unique_ptr in swNoel Grandin1-3/+3
Change-Id: I899d050e76f705002e943ae5384cc8c928789df9 Reviewed-on: https://gerrit.libreoffice.org/66512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-11use unique_ptr in swNoel Grandin1-5/+3
Change-Id: I471875142391e537a4301dfe42beb8f8803ff46b Reviewed-on: https://gerrit.libreoffice.org/66036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-04Fix up file permissionsTamás Zolnai1-0/+0
Change-Id: Icfc994cec2fff87e79de3d8e38a51b038e817940
2019-01-04Unfloat: Handle unfloat button visibilityTamás Zolnai1-0/+12
We need to update the state of the button every time when the frame's layout changes or when the selection changes. Show the button if the text frame is selected and it's a floating table which would hang out of the actual page after unfloating. Change-Id: I6b64affb063f552921915a0735e80889e5fd8124 Reviewed-on: https://gerrit.libreoffice.org/65819 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-12-18Get rid of aEmptyOUStrMike Kaganski1-2/+2
Commit 8051bb7e18ccae0f639e65dfa86bcc18a5fb9108 had removed its "String" counterpart. Change-Id: Id873a259e7f4b2794e94dec83d08ed6b57298beb Reviewed-on: https://gerrit.libreoffice.org/65299 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-07loplugin:singlevalfields extend to all static varsNoel Grandin1-2/+2
Change-Id: Ic238bb5291539fd1b7e98cb4afc9b25f37e7d528 Reviewed-on: https://gerrit.libreoffice.org/64710 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05remove unused GraphicManagerDrawFlags enumNoel Grandin1-1/+0
Change-Id: I12ef5e6257db337c4432b251bc92107a2c2ea88b Reviewed-on: https://gerrit.libreoffice.org/64557 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin1-2/+2
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27tdf#112195 Writer: page background covers whole pageLászló Németh1-1/+9
as in ODT implementation of Google Docs, and as in DOCX supporting basic requirements of creating digital and professional print media. This patch fixes DOCX import (tdf#121668) and it gives the required PDF export, too. In the case of solid color, color gradient, hatching, pattern and tiled bitmap (except stretched bitmap), this patch removes the obsolete white border around the text area, if the user modifies the page background. Note: likely the white border was good for home printing in former times, but now it forms only a serious barrier for most users to create de facto design standard whole page background formatting instead of its unacceptable poor man's version. Note 2: the OpenDocument standard refers XSL/CSS here, and browsers adapt background settings to the body margin area the same way, as Google Docs and fixed LibreOffice do. More information: tdf#112195 "(Whole-Page-Filling) - Allow page background to cover the whole page (reloaded)" tdf#33041 "Allow page background to cover the whole page, not only within page borders/margins" tdf#121668 "FILEOPEN DOCX Page Color created with Word disappears on the margins" ooo#9370 "Off-margin page background" (https://bz.apache.org/ooo/show_bug.cgi?id=9370) Change-Id: I7c6c96ceaf7102b38e3e5c1ed767db0ee63520ab Reviewed-on: https://gerrit.libreoffice.org/63914 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2018-11-26tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski1-1/+1
Change-Id: I1ac4c52ea51503373644bc58dcd4395c69f1a675 Reviewed-on: https://gerrit.libreoffice.org/64007 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-22improve function-local statics in swNoel Grandin1-14/+14
Change-Id: I36b0e9b2819a442f01182f551dbc2bf7d5c878f4 Reviewed-on: https://gerrit.libreoffice.org/63788 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21loplugin:redundantfcast improvementsNoel Grandin1-3/+3
check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-16loplugin:buriedassign in swNoel Grandin1-1/+2
Change-Id: If2adf22a0ac3e030fca1b4ecd0173cac58f0f21e Reviewed-on: https://gerrit.libreoffice.org/63470 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-15loplugin:staticmethods in sfx2Noel Grandin1-3/+3
Change-Id: Ide10d0186431e745c3bb17d321cf46724e801c8f Reviewed-on: https://gerrit.libreoffice.org/63404 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-14Simplify containers iterations in sw/source/core/[d-l]*Arkadiy Illarionov1-23/+7
Use range-based loop or replace with STL functions Change-Id: I143e9a769e1c1bb0228933a0a92150f00e3e1f20 Reviewed-on: https://gerrit.libreoffice.org/63347 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-06convert some macros to local functionsNoel Grandin1-18/+29
Change-Id: If2c89f0f53615f6200b6cd1fb6267cc9b47df927 Reviewed-on: https://gerrit.libreoffice.org/62884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-28Fix typoAndrea Gelmini1-1/+1
Change-Id: I05f36d03acaabb92b212b8fc3ef30850e1179935 Reviewed-on: https://gerrit.libreoffice.org/62467 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-10-28Fix typoAndrea Gelmini1-1/+1
Change-Id: I66a262953665cdb201bb06ddb3dc4bcd751119ed Reviewed-on: https://gerrit.libreoffice.org/62468 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-28tdf#115296 extend vertical FrameBorders for joined FramesArmin Le Grand1-2/+18
This feature was lost on my changes for FrameBorder primitive creation. It was calculated/applied formally in lcl_PaintLeftRightLine Change-Id: Ie44619a4c4e44ff4584533685cb21882c323742e Reviewed-on: https://gerrit.libreoffice.org/62451 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-10-25Reorganize FrameBorderPrimitive creation (II)Armin Le Grand1-2/+4
Step5: Move the view-dependent decomposition from BorderLinePrimitive2D to SdrFrameBorderPrimitive2D. It is now possible to use discrete sizes before the line and edge matching is done what will look much better. When it was done at BorderLinePrimitive2D and the matching was already done, that match was 'displaced' with the adapted forced scale to discrete units. The space and size used when zooming out for a single discrete unit (pixel) can heavily vary - it just covers a much larger logical area than the 'real' line/poly would do. All this needs to be handled (also for bound ranges) and can only be in a good way using primitives. Adapted to no longer do view-dependent changes in BorderLinePrimitive2D. Adapted to do these now at SdrFrameBorderPrimitive2D. Currently used to force the existing border partial lines (up to three) to not get taller than one logical unit. Adapted to no longer switch off AntiAliased rendering in VclPixelProcessor2D for processBorderLinePrimitive2D, this is problematic with various renderers on various systems (e.g. vcl still falls back to render multiple one-pixel-lines when taller than 3.5 pixels which looks horrible combined with other parts like filled polygons) All this needs fine balancing on - all systems - all renderers - all apps (which all have their own table implementation) - all render targets (pixel/PDF/print/slideshow/...) Done as thorough as possible, but may need additional finetuning. May also be a motivation to move away from vcl and implement these urgetly needed system-dependent primitive renderers... Adapted UnitTest testDoublePixelProcessing with the needed comments. Change-Id: Ie88bb76c2474b6ab3764d45a9cd1669264492acd Reviewed-on: https://gerrit.libreoffice.org/62344 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-10-24Reorganize FrameBorderPrimitive creationArmin Le Grand1-107/+89
Step1: Basic concept, move stuff to svx and new SdrFrameBorderPrimitive2D Step2: Adapt all creators/usages to use SdrFrameBorderData/SdrFrameBorderPrimitive2D, check functionality Step3: Re-implement mergre of BorderLinePrimitive2D during decomposition of SdrFrameBorderPrimitive2D to keep the number of primitives low from the start, make merge optional (not urgently needed) Step4: Migrate and isolate all helper methods and classes involved in geometry creation of border lines to the implementation (.cxx) of the new primitive Change-Id: I840b6765439bd995f2c57ef36315427b1f0f3e21 Reviewed-on: https://gerrit.libreoffice.org/62247 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-10-24clang-tidy performance-unnecessary-copy-init in swNoel Grandin1-2/+2
Change-Id: I515e3e8ddaee3e3ddc4bf3827fb85f3489e84539 Reviewed-on: https://gerrit.libreoffice.org/62253 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin1-1/+1
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann1-1/+1
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-03loplugin:constfields in swNoel Grandin1-5/+5
Change-Id: I1eb6583bb9ec815bc0564b0d7c676f5b1fb9045f Reviewed-on: https://gerrit.libreoffice.org/61177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03paintfrm white-spacing adjust: remove obsolete bracketsJustin Luth1-48/+46
doing this in a separate patch to avoid obscuring the changes inside of the other cleanup patch. This simply removes one layer of indenting. Change-Id: I295b2ef59fb8c62db14d18d2e529da6c4c578665 Reviewed-on: https://gerrit.libreoffice.org/61273 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>