Ctrl+A and Data Sort took ages to broadcast ALL cells, fdo#81501 related

Noticed when investigating fdo#81501
Squashed commits:

Fix high memory usage when sorting cells in Calc. (fdo#81501)

Empty columns were being unnecessarily included in the sorting
range which caused extra allocation. This happens when you select
the entire sheet to sort. There was already code to skip empty
trailing cells in rows but not to skip empty columns.

Reviewed-on: https://gerrit.libreoffice.org/13294
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit c50d8bf596f527bb53b86dd04da652ed72f2c549)

actually use identical code for both byRow and byCol, fdo#81501 follow-up

(cherry picked from commit 1e4235f8b2dc693b0fb1edade9db25a631bdbf94)

trim also empty leading column ranges, fdo#81501 follow-up

(cherry picked from commit c7b57c6c2b15a4b9f65dafb642e3f1da402e62ca)

Ctrl+A and Data Sort took ages to broadcast ALL cells

... now that also empty cells are to be broadcasted.

Set dirty and broadcast only the effective data range as determined by Sort.

This is more a workaround, a cleaner solution would be to refactor the
SetDirty() algorithm to iterate only through broadcasters and use
AreaBroadcast() to notify area listeners.

However, this can also be easily backported to 4-3.

(cherry picked from commit 9a568c41ccd1ccf6073758973da5914a44f629d2)

982e03a12dd80be0787f22dce4495065775e7de0
eaeea85149e4b6d263b112205bb17c155e2d12be
6d68ca0088cec6a8328a3e93364ac928ef69babe

Change-Id: Ieac22647bb13165cbf66cb1a93f567e5169fff6a
Reviewed-on: https://gerrit.libreoffice.org/13324
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
5 files changed
tree: 50f562da5bf4f4d74f0cbb074d1ab535f1fafc34
  1. .git-hooks/
  2. accessibility/
  3. android/
  4. animations/
  5. apple_remote/
  6. avmedia/
  7. basctl/
  8. basebmp/
  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. crashrep/
  29. cui/
  30. dbaccess/
  31. desktop/
  32. distro-configs/
  33. drawinglayer/
  34. dtrans/
  35. editeng/
  36. embeddedobj/
  37. embedserv/
  38. eventattacher/
  39. extensions/
  40. external/
  41. extras/
  42. filter/
  43. forms/
  44. formula/
  45. fpicker/
  46. framework/
  47. helpcompiler/
  48. hwpfilter/
  49. i18nlangtag/
  50. i18npool/
  51. i18nutil/
  52. icon-themes/
  53. idl/
  54. idlc/
  55. include/
  56. instsetoo_native/
  57. io/
  58. ios/
  59. javaunohelper/
  60. jurt/
  61. jvmaccess/
  62. jvmfwk/
  63. l10ntools/
  64. librelogo/
  65. libreofficekit/
  66. lingucomponent/
  67. linguistic/
  68. lotuswordpro/
  69. m4/
  70. mysqlc/
  71. nlpsolver/
  72. o3tl/
  73. odk/
  74. offapi/
  75. officecfg/
  76. oovbaapi/
  77. oox/
  78. osx/
  79. package/
  80. postprocess/
  81. pyuno/
  82. qadevOOo/
  83. readlicense_oo/
  84. registry/
  85. remotebridges/
  86. reportbuilder/
  87. reportdesign/
  88. ridljar/
  89. rsc/
  90. sal/
  91. salhelper/
  92. sax/
  93. sc/
  94. scaddins/
  95. sccomp/
  96. scp2/
  97. scripting/
  98. sd/
  99. sdext/
  100. setup_native/
  101. sfx2/
  102. shell/
  103. slideshow/
  104. smoketest/
  105. solenv/
  106. soltools/
  107. sot/
  108. starmath/
  109. stoc/
  110. store/
  111. svgio/
  112. svl/
  113. svtools/
  114. svx/
  115. sw/
  116. swext/
  117. sysui/
  118. test/
  119. testtools/
  120. toolkit/
  121. tools/
  122. touch/
  123. tubes/
  124. ucb/
  125. ucbhelper/
  126. udkapi/
  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. .gitattributes
  149. .gitignore
  150. .gitmodules
  151. .gitreview
  152. autogen.sh
  153. config.guess
  154. config.sub
  155. config_host.mk.in
  156. configure.ac
  157. COPYING
  158. COPYING.LGPL
  159. COPYING.MPL
  160. download.lst
  161. g
  162. install-sh
  163. Library_merged.mk
  164. Library_urelibs.mk
  165. lo.xcent.in
  166. logerrit
  167. Makefile.fetch
  168. Makefile.gbuild
  169. Makefile.in
  170. README.Android
  171. README.Code
  172. README.cross
  173. README.Solaris
  174. Repository.mk
  175. RepositoryExternal.mk
  176. RepositoryFixes.mk
  177. RepositoryModule_build.mk
  178. RepositoryModule_host.mk
  179. TEMPLATE.SOURCECODE.HEADER
  180. unusedcode.easy
  181. unusedcode.exclude
  182. unusedcode.README