tdf#138518 sw: layout: avoid moving flys forward prematurely

(regression from b9ef71476fd70bc13f50ebe80390e0730d1b7afb
"tdf#134298 sw: layout: remove left-over page frame without content")

When updating the 3rd ToX, the change to remove empty page frames
causes one page frame to be deleted.

On the subsequent layout, things generally move backward, but there are
some fly-related hiccups; the first problem is visible on page 7.

Commit eb85de8e6b61fb3fcb6c03ae0145f7fe5478bccf
"sw: layout: if fly's anchor moves forward, move fly off SwPageFrame"
helps quite a bit, but not completely; now the first problem happens on
page 54, when SwTextFrame 1261 and its fly 3132 are formatted.

Frame 1261 moves forward to page 55, and then
SwObjectFormatterTextFrame::CheckMovedFwdCondition() returns true and so
SwMovedFwdFramesByObjPos::Insert() is called to prevent frame 1261 from
moving back to page 54.

But the reason why it moved forward is that there are 3 flys on page 54
that are anchored on frames in the next-chain of 1261, namely 1275,
1283 and 1284; if these flys weren't on the page then 1261 would fit.

While the move forward cannot be easily prevented in the situation, it's
possible to avoid the entry into the SwMovedFwdFramesByObjPos map,
by detecting that there are flys on the page that would should forward
*before* the current one does.

With this fix and the above mentioned commit to get the flys off the
page, frame 1261 will eventually move back to page 54 again.

Change-Id: I83e44d65a0b889a49a313b0cd8b08efce4c3afa7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114478
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit c799de145f7e289f31e3669646e5bd12814e6c5e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114521
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 files changed
tree: 9057582bd87ab8c7161150c4089022261234a073
  1. .git-hooks/
  2. .github/
  3. accessibility/
  4. android/
  5. animations/
  6. apple_remote/
  7. avmedia/
  8. basctl/
  9. basegfx/
  10. basic/
  11. bean/
  12. bin/
  13. binaryurp/
  14. bridges/
  15. canvas/
  16. chart2/
  17. cli_ure/
  18. codemaker/
  19. comphelper/
  20. compilerplugins/
  21. config_host/
  22. configmgr/
  23. connectivity/
  24. cppcanvas/
  25. cppu/
  26. cppuhelper/
  27. cpputools/
  28. cui/
  29. dbaccess/
  30. desktop/
  31. distro-configs/
  32. drawinglayer/
  33. editeng/
  34. embeddedobj/
  35. embedserv/
  36. emfio/
  37. eventattacher/
  38. extensions/
  39. external/
  40. extras/
  41. filter/
  42. forms/
  43. formula/
  44. fpicker/
  45. framework/
  46. helpcompiler/
  47. hwpfilter/
  48. i18nlangtag/
  49. i18npool/
  50. i18nutil/
  51. icon-themes/
  52. idl/
  53. idlc/
  54. include/
  55. instsetoo_native/
  56. io/
  57. ios/
  58. javaunohelper/
  59. jurt/
  60. jvmaccess/
  61. jvmfwk/
  62. l10ntools/
  63. librelogo/
  64. libreofficekit/
  65. lingucomponent/
  66. linguistic/
  67. lotuswordpro/
  68. m4/
  69. nlpsolver/
  70. o3tl/
  71. odk/
  72. offapi/
  73. officecfg/
  74. onlineupdate/
  75. oovbaapi/
  76. oox/
  77. opencl/
  78. osx/
  79. package/
  80. pch/
  81. postprocess/
  82. pyuno/
  83. qadevOOo/
  84. readlicense_oo/
  85. registry/
  86. remotebridges/
  87. reportbuilder/
  88. reportdesign/
  89. ridljar/
  90. sal/
  91. salhelper/
  92. sax/
  93. sc/
  94. scaddins/
  95. sccomp/
  96. schema/
  97. scp2/
  98. scripting/
  99. sd/
  100. sdext/
  101. setup_native/
  102. sfx2/
  103. shell/
  104. slideshow/
  105. smoketest/
  106. solenv/
  107. soltools/
  108. sot/
  109. starmath/
  110. stoc/
  111. store/
  112. svgio/
  113. svl/
  114. svtools/
  115. svx/
  116. sw/
  117. swext/
  118. sysui/
  119. test/
  120. testtools/
  121. toolkit/
  122. tools/
  123. ucb/
  124. ucbhelper/
  125. udkapi/
  126. uitest/
  127. UnoControls/
  128. unodevtools/
  129. unoidl/
  130. unoil/
  131. unotest/
  132. unotools/
  133. unoxml/
  134. ure/
  135. uui/
  136. vbahelper/
  137. vcl/
  138. winaccessibility/
  139. wizards/
  140. writerfilter/
  141. writerperfect/
  142. xmerge/
  143. xmlhelp/
  144. xmloff/
  145. xmlreader/
  146. xmlscript/
  147. xmlsecurity/
  148. .buckconfig
  149. .buckversion
  150. .clang-format
  151. .editorconfig
  152. .git-blame-ignore-revs
  153. .gitattributes
  154. .gitignore
  155. .gitmodules
  156. .gitpod.dockerfile
  157. .gitpod.yml
  158. .gitreview
  159. antivirusDetection.vbs
  160. autogen.sh
  161. BUCK
  162. config.guess
  163. config.sub
  164. config_host.mk.in
  165. config_host_lang.mk.in
  166. configure.ac
  167. COPYING
  168. COPYING.LGPL
  169. COPYING.MPL
  170. download.lst
  171. g
  172. hardened_runtime.xcent.in
  173. install-sh
  174. leak-suppress.txt
  175. Library_merged.mk
  176. lo.xcent
  177. logerrit
  178. Makefile.fetch
  179. Makefile.gbuild
  180. Makefile.in
  181. README.cross
  182. README.md
  183. README.Solaris
  184. Repository.mk
  185. RepositoryExternal.mk
  186. RepositoryFixes.mk
  187. RepositoryModule_build.mk
  188. RepositoryModule_host.mk
  189. sanitize-ubsan-excludelist
  190. setup.cfg
  191. TEMPLATE.SOURCECODE.HEADER
README.md

LibreOffice

Coverity Scan Build Status CII Best Practices Translation status

LibreOffice is an integrated office suite based on copyleft licenses and compatible with most document formats and standards. Libreoffice is backed by The Document Foundation, which represents a large independent community of enterprises, developers and other volunteers moved by the common goal of bringing to the market the best software for personal productivity. LibreOffice is open source, and free to download, use and distribute.

A quick overview of the LibreOffice code structure.

Overview

You can develop for LibreOffice in one of two ways, one recommended and one much less so. First the somewhat less recommended way: it is possible to use the SDK to develop an extension, for which you can read the API docs here and here. This re-uses the (extremely generic) UNO APIs that are also used by macro scripting in StarBasic.

The best way to add a generally useful feature to LibreOffice is to work on the code base however. Overall this way makes it easier to compile and build your code, it avoids any arbitrary limitations of our scripting APIs, and in general is far more simple and intuitive - if you are a reasonably able C++ programmer.

The build chain and runtime baselines

These are the current minimal operating system and compiler versions to run and compile LibreOffice, also used by the TDF builds:

  • Windows:
    • Runtime: Windows 7
    • Build: Cygwin + Visual Studio 2019 version 16.4
  • macOS:
    • Runtime: 10.10
    • Build: 10.14.4 + Xcode 11.3
  • Linux:
    • Runtime: RHEL 7 or CentOS 7
    • Build: either GCC 7.0.0; or Clang 5.0.2 with libstdc++ 7.3.0
  • iOS (only for LibreOfficeKit):
    • Runtime: 11.4 (only support for newer i devices == 64 bit)
    • Build: Xcode 9.3 and iPhone SDK 11.4
  • Android:
    • Build: NDK r19c and SDK 22.6.2

If you want to use Clang with the LibreOffice compiler plugins, the minimal version of Clang is 5.0.2. Since Xcode doesn't provide the compiler plugin headers, you have to compile your own Clang to use them on macOS.

You can find the TDF configure switches in the distro-configs/ directory.

To setup your initial build environment on Windows and macOS, we provide the LibreOffice Development Environment (LODE) scripts.

For more information see the build instructions for your platform in the TDF wiki.

The important bits of code

Each module should have a README file inside it which has some degree of documentation for that module; patches are most welcome to improve those. We have those turned into a web page here:

https://docs.libreoffice.org/

However, there are two hundred modules, many of them of only peripheral interest for a specialist audience. So - where is the good stuff, the code that is most useful. Here is a quick overview of the most important ones:

ModuleDescription
sal/this provides a simple System Abstraction Layer
tools/this provides basic internal types: 'Rectangle', 'Color' etc.
vcl/this is the widget toolkit library and one rendering abstraction
frameworkUNO framework, responsible for building toolbars, menus, status bars, and the chrome around the document using widgets from VCL, and XML descriptions from /uiconfig/ files
sfx2/legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc.
svx/drawing model related helper code, including much of Draw/Impress

Then applications

ModuleDescription
desktop/this is where the 'main' for the application lives, init / bootstrap. the name dates back to an ancient StarOffice that also drew a desktop
sw/Writer
sc/Calc
sd/Draw / Impress

There are several other libraries that are helpful from a graphical perspective:

ModuleDescription
basegfx/algorithms and data-types for graphics as used in the canvas
canvas/new (UNO) canvas rendering model with various backends
cppcanvas/C++ helper classes for using the UNO canvas
drawinglayer/View code to render drawable objects and break them down into primitives we can render more easily.

Rules for #include directives (C/C++)

Use the "..." form if and only if the included file is found next to the including file. Otherwise, use the <...> form. (For further details, see the mail Re: C[++]: Normalizing include syntax ("" vs <>).)

The UNO API include files should consistently use double quotes, for the benefit of external users of this API.

loplugin:includeform (compilerplugins/clang/includeform.cxx) enforces these rules.

Finding out more

Beyond this, you can read the README files, send us patches, ask on the mailing list libreoffice@lists.freedesktop.org (no subscription required) or poke people on IRC #libreoffice-dev on irc.freenode.net - we're a friendly and generally helpful mob. We know the code can be hard to get into at first, and so there are no silly questions.