[Libreoffice-commits] core.git: Branch 'distro/collabora/cd-5.3' - 74 commits - avmedia/source basctl/source basic/qa basic/source bin/findunusedcode canvas/source chart2/source comphelper/source compilerplugins/clang config_host/config_graphite.h.in config_host.mk.in configure.ac connectivity/source cppuhelper/source cui/source dbaccess/source desktop/source distro-configs/LibreOfficeEmscripten.conf editeng/source extensions/source external/cairo filter/source forms/source formula/source fpicker/source framework/source include/basic include/editeng include/rtl include/sfx2 include/svl include/svtools include/svx include/tools include/unotools include/vcl libreofficekit/qa libreofficekit/source linguistic/source oox/source reportdesign/source sal/qa sal/rtl sal/util sc/inc scripting/source sc/source sdext/source sd/source sfx2/source slideshow/source sot/source starmath/inc starmath/source svgio/source svl/source svtools/source svx/inc svx/source sw/inc sw/qa sw/source toolkit/source tools/inc to ols/qa tools/source ucb/source unotools/source uui/source vbahelper/source vcl/CustomTarget_afm_hash.mk vcl/headless vcl/inc vcl/Library_vcl.mk vcl/Module_vcl.mk vcl/opengl vcl/qa vcl/quartz vcl/source vcl/unx vcl/win xmloff/source

Ashod Nakashian ashod.nakashian at collabora.co.uk
Thu Dec 14 06:13:22 UTC 2017


 avmedia/source/gstreamer/gstmanager.cxx                           |    2 
 avmedia/source/macavf/manager.mm                                  |    2 
 avmedia/source/quicktime/manager.mm                               |    2 
 avmedia/source/viewer/mediawindow.cxx                             |    4 
 avmedia/source/viewer/mediawindow_impl.cxx                        |    2 
 avmedia/source/win/manager.cxx                                    |    2 
 basctl/source/basicide/baside2.cxx                                |   18 
 basctl/source/basicide/baside2.hxx                                |    5 
 basctl/source/basicide/baside3.cxx                                |    2 
 basctl/source/basicide/basides1.cxx                               |    4 
 basctl/source/basicide/basidesh.cxx                               |    4 
 basctl/source/basicide/bastypes.cxx                               |    4 
 basctl/source/basicide/iderdll.cxx                                |    6 
 basctl/source/basicide/iderdll2.hxx                               |    2 
 basctl/source/basicide/moduldl2.cxx                               |   22 
 basctl/source/inc/basidesh.hxx                                    |    2 
 basctl/source/inc/bastypes.hxx                                    |    7 
 basic/qa/cppunit/test_vba.cxx                                     |    1 
 basic/source/basmgr/basmgr.cxx                                    |   14 
 basic/source/classes/errobject.cxx                                |    7 
 basic/source/classes/sb.cxx                                       |   10 
 basic/source/classes/sbunoobj.cxx                                 |    9 
 basic/source/classes/sbxmod.cxx                                   |   44 
 basic/source/inc/runtime.hxx                                      |   68 
 basic/source/inc/sbintern.hxx                                     |    4 
 basic/source/runtime/methods.cxx                                  |   10 
 basic/source/runtime/methods1.cxx                                 |    2 
 basic/source/runtime/runtime.cxx                                  |   30 
 basic/source/uno/namecont.cxx                                     |  114 
 basic/source/uno/scriptcont.cxx                                   |   16 
 bin/findunusedcode                                                |    1 
 canvas/source/vcl/canvashelper.cxx                                |    8 
 chart2/source/controller/drawinglayer/ViewElementListProvider.cxx |    3 
 chart2/source/controller/main/ElementSelector.cxx                 |    4 
 chart2/source/controller/main/ElementSelector.hxx                 |    2 
 comphelper/source/misc/documentinfo.cxx                           |    2 
 compilerplugins/clang/fpcomparison.cxx                            |    6 
 config_host.mk.in                                                 |    1 
 config_host/config_graphite.h.in                                  |    6 
 configure.ac                                                      |   47 
 connectivity/source/drivers/calc/CConnection.cxx                  |    2 
 connectivity/source/drivers/dbase/DTable.cxx                      |   30 
 connectivity/source/drivers/file/FConnection.cxx                  |    2 
 connectivity/source/drivers/file/FDatabaseMetaData.cxx            |    8 
 connectivity/source/drivers/flat/ETable.cxx                       |    2 
 cppuhelper/source/servicemanager.cxx                              |   42 
 cui/source/customize/macropg.cxx                                  |    4 
 cui/source/dialogs/SpellDialog.cxx                                |    4 
 cui/source/dialogs/cuigaldlg.cxx                                  |   10 
 cui/source/dialogs/hldocntp.cxx                                   |   14 
 cui/source/dialogs/hlinettp.cxx                                   |    4 
 cui/source/dialogs/hlmailtp.cxx                                   |    2 
 cui/source/dialogs/hltpbase.cxx                                   |    6 
 cui/source/dialogs/insdlg.cxx                                     |    6 
 cui/source/dialogs/linkdlg.cxx                                    |    6 
 cui/source/dialogs/multipat.cxx                                   |    4 
 cui/source/inc/SpellDialog.hxx                                    |    2 
 cui/source/inc/headertablistbox.hxx                               |    2 
 cui/source/inc/treeopt.hxx                                        |    2 
 cui/source/options/connpooloptions.cxx                            |    4 
 cui/source/options/connpooloptions.hxx                            |    2 
 cui/source/options/doclinkdialog.cxx                              |    2 
 cui/source/options/optjava.cxx                                    |    4 
 cui/source/options/optlingu.cxx                                   |    2 
 cui/source/options/optpath.cxx                                    |    2 
 cui/source/options/treeopt.cxx                                    |    4 
 cui/source/tabpages/numpages.cxx                                  |    2 
 cui/source/tabpages/tplnedef.cxx                                  |    8 
 cui/source/tabpages/tplneend.cxx                                  |    8 
 dbaccess/source/core/dataaccess/databasecontext.cxx               |    2 
 dbaccess/source/core/dataaccess/databasedocument.cxx              |    2 
 dbaccess/source/core/dataaccess/datasource.cxx                    |    2 
 dbaccess/source/ext/macromigration/macromigrationpages.cxx        |    2 
 dbaccess/source/filter/xml/xmlfilter.cxx                          |    4 
 dbaccess/source/ui/app/AppController.cxx                          |    6 
 dbaccess/source/ui/app/AppDetailPageHelper.cxx                    |    6 
 dbaccess/source/ui/browser/dbloader.cxx                           |    2 
 dbaccess/source/ui/browser/unodatbr.cxx                           |    6 
 dbaccess/source/ui/control/opendoccontrols.cxx                    |    4 
 dbaccess/source/ui/control/sqledit.cxx                            |    2 
 dbaccess/source/ui/dlg/ConnectionHelper.cxx                       |   12 
 dbaccess/source/ui/dlg/dbfindex.cxx                               |    2 
 dbaccess/source/ui/dlg/dbwizsetup.cxx                             |   14 
 dbaccess/source/ui/inc/sqledit.hxx                                |    3 
 dbaccess/source/ui/misc/TableCopyHelper.cxx                       |    2 
 dbaccess/source/ui/misc/UITools.cxx                               |    4 
 dbaccess/source/ui/querydesign/limitboxcontroller.cxx             |    8 
 desktop/source/app/app.cxx                                        |    4 
 desktop/source/deployment/gui/dp_gui_dialog2.cxx                  |    6 
 desktop/source/deployment/gui/dp_gui_dialog2.hxx                  |    2 
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx               |    4 
 desktop/source/deployment/gui/dp_gui_extlistbox.hxx               |    2 
 desktop/source/deployment/gui/license_dialog.cxx                  |    3 
 desktop/source/lib/init.cxx                                       |   40 
 desktop/source/migration/migration.cxx                            |    6 
 desktop/source/migration/services/basicmigration.cxx              |    4 
 desktop/source/migration/services/oo3extensionmigration.cxx       |    4 
 desktop/source/migration/services/wordbookmigration.cxx           |    4 
 distro-configs/LibreOfficeEmscripten.conf                         |    1 
 editeng/source/editeng/editdoc.cxx                                |    2 
 editeng/source/editeng/editdoc.hxx                                |   23 
 editeng/source/editeng/editeng.cxx                                |   29 
 editeng/source/editeng/editundo.cxx                               |    2 
 editeng/source/editeng/editundo.hxx                               |   10 
 editeng/source/editeng/editview.cxx                               |    4 
 editeng/source/editeng/edtspell.cxx                               |    2 
 editeng/source/editeng/eehtml.cxx                                 |    2 
 editeng/source/editeng/impedit.cxx                                |   20 
 editeng/source/editeng/impedit.hxx                                |   51 
 editeng/source/editeng/impedit2.cxx                               |   48 
 editeng/source/editeng/impedit3.cxx                               |   18 
 editeng/source/editeng/impedit5.cxx                               |    6 
 editeng/source/items/flditem.cxx                                  |    8 
 editeng/source/misc/acorrcfg.cxx                                  |    2 
 editeng/source/misc/svxacorr.cxx                                  |    8 
 extensions/source/abpilot/abpfinalpage.cxx                        |    2 
 extensions/source/abpilot/datasourcehandling.cxx                  |    4 
 extensions/source/dbpilots/controlwizard.cxx                      |    2 
 extensions/source/propctrlr/browserlistbox.cxx                    |    4 
 extensions/source/propctrlr/browserlistbox.hxx                    |    2 
 extensions/source/propctrlr/browserview.cxx                       |    4 
 extensions/source/propctrlr/browserview.hxx                       |    2 
 extensions/source/propctrlr/formcomponenthandler.cxx              |    2 
 external/cairo/cairo/cairo-1.10.2.patch                           |  137 
 filter/source/config/cache/filtercache.cxx                        |    2 
 filter/source/config/cache/typedetection.cxx                      |    2 
 filter/source/flash/swfwriter1.cxx                                |    8 
 filter/source/graphicfilter/eps/eps.cxx                           |   16 
 filter/source/graphicfilter/icgm/actimpr.cxx                      |    6 
 filter/source/graphicfilter/icgm/class4.cxx                       |    8 
 filter/source/graphicfilter/icgm/outact.hxx                       |    2 
 filter/source/msfilter/escherex.cxx                               |    8 
 filter/source/msfilter/msdffimp.cxx                               |    6 
 filter/source/pdf/pdfexport.cxx                                   |    2 
 filter/source/storagefilterdetect/filterdetect.cxx                |    2 
 filter/source/svg/svgwriter.cxx                                   |    2 
 filter/source/textfilterdetect/filterdetect.cxx                   |    2 
 filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx               |    4 
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx              |    8 
 filter/source/xsltdialog/xmlfiltersettingsdialog.hxx              |    4 
 filter/source/xsltdialog/xmlfiltertestdialog.cxx                  |    2 
 filter/source/xsltfilter/XSLTFilter.cxx                           |    6 
 forms/source/component/Button.cxx                                 |    2 
 forms/source/component/DatabaseForm.cxx                           |   14 
 forms/source/component/ImageButton.cxx                            |    2 
 forms/source/richtext/richtextvclcontrol.cxx                      |    6 
 forms/source/richtext/richtextvclcontrol.hxx                      |    2 
 forms/source/xforms/submission/replace.cxx                        |    2 
 forms/source/xforms/submission/submission_get.cxx                 |    2 
 forms/source/xforms/submission/submission_post.cxx                |    2 
 forms/source/xforms/submission/submission_put.cxx                 |    2 
 formula/source/ui/dlg/funcutl.cxx                                 |    2 
 fpicker/source/office/OfficeFilePicker.cxx                        |    6 
 fpicker/source/office/OfficeFolderPicker.cxx                      |    2 
 fpicker/source/office/PlacesListBox.cxx                           |    4 
 fpicker/source/office/PlacesListBox.hxx                           |    2 
 fpicker/source/office/RemoteFilesDialog.cxx                       |   22 
 fpicker/source/office/iodlg.cxx                                   |   50 
 fpicker/source/office/iodlg.hxx                                   |    2 
 fpicker/source/office/iodlgimp.cxx                                |    2 
 framework/source/accelerators/globalacceleratorconfiguration.cxx  |    3 
 framework/source/fwe/helper/titlehelper.cxx                       |    8 
 framework/source/services/substitutepathvars.cxx                  |    6 
 framework/source/services/uriabbreviation.cxx                     |    2 
 framework/source/services/urltransformer.cxx                      |   26 
 framework/source/uielement/fontmenucontroller.cxx                 |    2 
 framework/source/uielement/generictoolbarcontroller.cxx           |    2 
 framework/source/uielement/recentfilesmenucontroller.cxx          |    2 
 include/basic/sbdef.hxx                                           |   17 
 include/basic/sbmeth.hxx                                          |    8 
 include/basic/sbstar.hxx                                          |   14 
 include/editeng/editeng.hxx                                       |    6 
 include/rtl/alloc.h                                               |   17 
 include/sfx2/basedlgs.hxx                                         |    4 
 include/sfx2/dockwin.hxx                                          |    2 
 include/sfx2/new.hxx                                              |    7 
 include/sfx2/objface.hxx                                          |    5 
 include/sfx2/prnmon.hxx                                           |    2 
 include/sfx2/shell.hxx                                            |   23 
 include/sfx2/sidebar/Deck.hxx                                     |    2 
 include/sfx2/sidebar/SidebarToolBox.hxx                           |    2 
 include/sfx2/sidebar/TabBar.hxx                                   |    2 
 include/svl/hint.hxx                                              |    1 
 include/svl/urihelper.hxx                                         |   10 
 include/svtools/ctrltool.hxx                                      |    6 
 include/svtools/editbrowsebox.hxx                                 |    2 
 include/svtools/fileurlbox.hxx                                    |    2 
 include/svtools/fmtfield.hxx                                      |    2 
 include/svtools/inettbc.hxx                                       |    2 
 include/svtools/place.hxx                                         |    2 
 include/svtools/prnsetup.hxx                                      |    2 
 include/svtools/urlcontrol.hxx                                    |    2 
 include/svtools/wizdlg.hxx                                        |    2 
 include/svx/colrctrl.hxx                                          |    2 
 include/svx/itemwin.hxx                                           |    8 
 include/svx/ruler.hxx                                             |    1 
 include/svx/sidebar/PanelLayout.hxx                               |    2 
 include/svx/svdpntv.hxx                                           |    2 
 include/svx/svdview.hxx                                           |    2 
 include/svx/xpoly.hxx                                             |   17 
 include/tools/fontenum.hxx                                        |    3 
 include/tools/poly.hxx                                            |   15 
 include/tools/urlobj.hxx                                          |   90 
 include/unotools/options.hxx                                      |   24 
 include/unotools/syslocaleoptions.hxx                             |   10 
 include/vcl/combobox.hxx                                          |    2 
 include/vcl/ctrl.hxx                                              |    2 
 include/vcl/dialog.hxx                                            |    2 
 include/vcl/dockwin.hxx                                           |    2 
 include/vcl/field.hxx                                             |   24 
 include/vcl/floatwin.hxx                                          |    2 
 include/vcl/font.hxx                                              |   10 
 include/vcl/layout.hxx                                            |    2 
 include/vcl/longcurr.hxx                                          |    4 
 include/vcl/metric.hxx                                            |    6 
 include/vcl/outdev.hxx                                            |    6 
 include/vcl/settings.hxx                                          |    3 
 include/vcl/spinfld.hxx                                           |    2 
 include/vcl/syswin.hxx                                            |    2 
 include/vcl/tabctrl.hxx                                           |    2 
 include/vcl/toolbox.hxx                                           |    2 
 include/vcl/vclmedit.hxx                                          |    2 
 include/vcl/window.hxx                                            |    2 
 libreofficekit/qa/tilebench/tilebench.cxx                         |   73 
 libreofficekit/source/gtk/lokdocview.cxx                          |    2 
 linguistic/source/convdiclist.cxx                                 |    8 
 linguistic/source/dlistimp.cxx                                    |    2 
 linguistic/source/misc2.cxx                                       |    6 
 oox/source/export/drawingml.cxx                                   |    8 
 oox/source/ppt/pptimport.cxx                                      |    2 
 reportdesign/source/ui/inc/ColorListener.hxx                      |    1 
 reportdesign/source/ui/inc/ScrollHelper.hxx                       |    2 
 reportdesign/source/ui/inc/StartMarker.hxx                        |    1 
 reportdesign/source/ui/inc/ViewsWindow.hxx                        |    2 
 reportdesign/source/ui/report/ScrollHelper.cxx                    |    4 
 reportdesign/source/ui/report/ViewsWindow.cxx                     |    2 
 sal/qa/rtl/alloc/rtl_alloc.cxx                                    |   70 
 sal/rtl/alloc_arena.cxx                                           |   31 
 sal/rtl/alloc_arena.hxx                                           |    8 
 sal/rtl/alloc_cache.cxx                                           |   20 
 sal/rtl/alloc_global.cxx                                          |    4 
 sal/rtl/strimp.cxx                                                |   68 
 sal/rtl/strimp.hxx                                                |    6 
 sal/rtl/string.cxx                                                |    6 
 sal/rtl/strtmpl.cxx                                               |    4 
 sal/rtl/ustring.cxx                                               |    8 
 sal/util/sal.map                                                  |    4 
 sc/inc/attarray.hxx                                               |    3 
 sc/inc/chgtrack.hxx                                               |    2 
 sc/inc/column.hxx                                                 |   14 
 sc/inc/scmod.hxx                                                  |    2 
 sc/source/core/data/cellvalue.cxx                                 |    4 
 sc/source/core/data/column.cxx                                    |  106 
 sc/source/core/data/column2.cxx                                   |   32 
 sc/source/core/data/column3.cxx                                   |  107 
 sc/source/core/data/column4.cxx                                   |   19 
 sc/source/core/data/dociter.cxx                                   |    4 
 sc/source/core/data/documen2.cxx                                  |    2 
 sc/source/core/data/documen8.cxx                                  |    4 
 sc/source/core/data/document.cxx                                  |    6 
 sc/source/core/data/global2.cxx                                   |    6 
 sc/source/core/data/globalx.cxx                                   |    2 
 sc/source/core/data/table4.cxx                                    |    2 
 sc/source/core/tool/autoform.cxx                                  |    4 
 sc/source/core/tool/chgtrack.cxx                                  |    2 
 sc/source/core/tool/compiler.cxx                                  |    4 
 sc/source/core/tool/formulalogger.cxx                             |    2 
 sc/source/core/tool/interpr1.cxx                                  |    2 
 sc/source/filter/excel/xecontent.cxx                              |    6 
 sc/source/filter/excel/xicontent.cxx                              |    2 
 sc/source/filter/lotus/lotus.cxx                                  |    2 
 sc/source/filter/xcl97/xcl97rec.cxx                               |    2 
 sc/source/ui/app/drwtrans.cxx                                     |    2 
 sc/source/ui/app/inputhdl.cxx                                     |  258 -
 sc/source/ui/app/inputwin.cxx                                     |   14 
 sc/source/ui/app/scmod.cxx                                        |    5 
 sc/source/ui/cctrl/checklistmenu.cxx                              |    4 
 sc/source/ui/condformat/condformatdlgentry.cxx                    |    4 
 sc/source/ui/dbgui/csvgrid.cxx                                    |    2 
 sc/source/ui/docshell/docsh.cxx                                   |    4 
 sc/source/ui/docshell/docsh3.cxx                                  |    2 
 sc/source/ui/docshell/docsh8.cxx                                  |   12 
 sc/source/ui/docshell/externalrefmgr.cxx                          |    8 
 sc/source/ui/drawfunc/chartsh.cxx                                 |    3 
 sc/source/ui/drawfunc/drawsh.cxx                                  |    3 
 sc/source/ui/drawfunc/drformsh.cxx                                |    3 
 sc/source/ui/drawfunc/drtxtob.cxx                                 |    3 
 sc/source/ui/drawfunc/graphsh.cxx                                 |    3 
 sc/source/ui/drawfunc/mediash.cxx                                 |    2 
 sc/source/ui/drawfunc/oleobjsh.cxx                                |    3 
 sc/source/ui/formdlg/formula.cxx                                  |    2 
 sc/source/ui/inc/checklistmenu.hxx                                |    2 
 sc/source/ui/inc/condformatdlgentry.hxx                           |    5 
 sc/source/ui/inc/csvgrid.hxx                                      |    2 
 sc/source/ui/inc/inputhdl.hxx                                     |    3 
 sc/source/ui/inc/inputwin.hxx                                     |    2 
 sc/source/ui/inc/navipi.hxx                                       |    9 
 sc/source/ui/inc/tabvwsh.hxx                                      |    5 
 sc/source/ui/navipi/navipi.cxx                                    |    8 
 sc/source/ui/navipi/scenwnd.cxx                                   |    4 
 sc/source/ui/vba/vbaworkbook.cxx                                  |    4 
 sc/source/ui/view/cellsh.cxx                                      |    3 
 sc/source/ui/view/formatsh.cxx                                    |    3 
 sc/source/ui/view/gridwin5.cxx                                    |    2 
 sc/source/ui/view/prevwsh.cxx                                     |    7 
 sc/source/ui/view/printfun.cxx                                    |    4 
 sc/source/ui/view/tabvwsh.cxx                                     |    3 
 sc/source/ui/view/tabvwsh3.cxx                                    |    2 
 sc/source/ui/view/tabvwsh4.cxx                                    |   19 
 sc/source/ui/view/tabvwsha.cxx                                    |    6 
 sc/source/ui/view/viewfun4.cxx                                    |    2 
 sc/source/ui/xmlsource/xmlsourcedlg.cxx                           |    2 
 scripting/source/dlgprov/dlgprov.cxx                              |    2 
 scripting/source/provider/MasterScriptProvider.cxx                |    2 
 scripting/source/stringresource/stringresource.cxx                |    4 
 sd/source/core/CustomAnimationCloner.cxx                          |    7 
 sd/source/core/CustomAnimationEffect.cxx                          |    1 
 sd/source/core/EffectMigration.cxx                                |    3 
 sd/source/core/TransitionPreset.cxx                               |    1 
 sd/source/core/annotations/AnnotationEnumeration.cxx              |    1 
 sd/source/core/drawdoc.cxx                                        |    2 
 sd/source/core/drawdoc2.cxx                                       |    2 
 sd/source/core/drawdoc3.cxx                                       |    2 
 sd/source/core/drawdoc4.cxx                                       |    2 
 sd/source/core/sdpage_animations.cxx                              |    1 
 sd/source/filter/cgm/sdcgmfilter.cxx                              |    2 
 sd/source/filter/eppt/epptso.cxx                                  |    4 
 sd/source/filter/grf/sdgrffilter.cxx                              |    2 
 sd/source/filter/html/htmlex.cxx                                  |    4 
 sd/source/filter/html/pubdlg.cxx                                  |   10 
 sd/source/filter/ppt/pptin.cxx                                    |   10 
 sd/source/ui/animations/CustomAnimationDialog.cxx                 |    2 
 sd/source/ui/app/sdmod.cxx                                        |    2 
 sd/source/ui/dlg/PhotoAlbumDialog.cxx                             |    6 
 sd/source/ui/dlg/RemoteDialogClientBox.cxx                        |    4 
 sd/source/ui/dlg/RemoteDialogClientBox.hxx                        |    2 
 sd/source/ui/dlg/docprev.cxx                                      |    4 
 sd/source/ui/dlg/navigatr.cxx                                     |    8 
 sd/source/ui/dlg/sdpreslt.cxx                                     |    2 
 sd/source/ui/dlg/sdtreelb.cxx                                     |    2 
 sd/source/ui/dlg/tpaction.cxx                                     |    6 
 sd/source/ui/docshell/docshel4.cxx                                |    2 
 sd/source/ui/func/fucon3d.cxx                                     |   16 
 sd/source/ui/func/fudraw.cxx                                      |   10 
 sd/source/ui/func/fuinsert.cxx                                    |    2 
 sd/source/ui/func/fusel.cxx                                       |    4 
 sd/source/ui/func/futext.cxx                                      |    2 
 sd/source/ui/inc/DrawViewShell.hxx                                |    2 
 sd/source/ui/inc/Window.hxx                                       |    2 
 sd/source/ui/inc/WindowUpdater.hxx                                |    2 
 sd/source/ui/inc/docprev.hxx                                      |    2 
 sd/source/ui/inc/navigatr.hxx                                     |    2 
 sd/source/ui/sidebar/MasterPageDescriptor.cxx                     |    2 
 sd/source/ui/slideshow/slideshowimpl.cxx                          |    6 
 sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx             |    2 
 sd/source/ui/slidesorter/shell/SlideSorter.cxx                    |    4 
 sd/source/ui/slidesorter/view/SlideSorterView.cxx                 |    2 
 sd/source/ui/unoidl/UnoDocumentSettings.cxx                       |    2 
 sd/source/ui/view/WindowUpdater.cxx                               |    2 
 sd/source/ui/view/drviews3.cxx                                    |    2 
 sd/source/ui/view/drviewse.cxx                                    |    4 
 sd/source/ui/view/drviewsk.cxx                                    |    2 
 sd/source/ui/view/outlnvsh.cxx                                    |    4 
 sd/source/ui/view/presvish.cxx                                    |    8 
 sd/source/ui/view/sdview4.cxx                                     |    2 
 sd/source/ui/view/sdwindow.cxx                                    |    4 
 sdext/source/minimizer/optimizerdialog.cxx                        |    2 
 sfx2/source/appl/appdde.cxx                                       |    8 
 sfx2/source/appl/appopen.cxx                                      |    2 
 sfx2/source/appl/macroloader.cxx                                  |    6 
 sfx2/source/appl/newhelp.cxx                                      |   26 
 sfx2/source/appl/newhelp.hxx                                      |   10 
 sfx2/source/appl/opengrf.cxx                                      |    6 
 sfx2/source/appl/sfxhelp.cxx                                      |    2 
 sfx2/source/appl/sfxpicklist.cxx                                  |    4 
 sfx2/source/appl/shutdowniconaqua.mm                              |    2 
 sfx2/source/appl/workwin.cxx                                      |   61 
 sfx2/source/bastyp/fltfnc.cxx                                     |    4 
 sfx2/source/bastyp/frmhtmlw.cxx                                   |    2 
 sfx2/source/bastyp/helper.cxx                                     |    4 
 sfx2/source/control/dispatch.cxx                                  |   35 
 sfx2/source/control/objface.cxx                                   |   51 
 sfx2/source/control/recentdocsview.cxx                            |    2 
 sfx2/source/control/recentdocsviewitem.cxx                        |    2 
 sfx2/source/control/unoctitm.cxx                                  |    2 
 sfx2/source/dialog/basedlgs.cxx                                   |   16 
 sfx2/source/dialog/dinfdlg.cxx                                    |    6 
 sfx2/source/dialog/dockwin.cxx                                    |   14 
 sfx2/source/dialog/filedlghelper.cxx                              |   26 
 sfx2/source/dialog/mailmodel.cxx                                  |   10 
 sfx2/source/dialog/partwnd.cxx                                    |    4 
 sfx2/source/dialog/templdlg.cxx                                   |    8 
 sfx2/source/doc/docfile.cxx                                       |   76 
 sfx2/source/doc/docinsert.cxx                                     |    2 
 sfx2/source/doc/docmacromode.cxx                                  |    2 
 sfx2/source/doc/doctempl.cxx                                      |   34 
 sfx2/source/doc/doctemplates.cxx                                  |  114 
 sfx2/source/doc/frmdescr.cxx                                      |    2 
 sfx2/source/doc/guisaveas.cxx                                     |   24 
 sfx2/source/doc/iframe.cxx                                        |    4 
 sfx2/source/doc/new.cxx                                           |   16 
 sfx2/source/doc/objcont.cxx                                       |    2 
 sfx2/source/doc/objmisc.cxx                                       |   26 
 sfx2/source/doc/objstor.cxx                                       |    8 
 sfx2/source/doc/objxtor.cxx                                       |    2 
 sfx2/source/doc/printhelper.cxx                                   |    4 
 sfx2/source/doc/sfxbasemodel.cxx                                  |    2 
 sfx2/source/doc/templatedlg.cxx                                   |    4 
 sfx2/source/inc/partwnd.hxx                                       |    2 
 sfx2/source/inc/templdgi.hxx                                      |    4 
 sfx2/source/inc/workwin.hxx                                       |   26 
 sfx2/source/inet/inettbc.cxx                                      |    2 
 sfx2/source/notify/eventsupplier.cxx                              |    2 
 sfx2/source/sidebar/Deck.cxx                                      |    4 
 sfx2/source/sidebar/SidebarToolBox.cxx                            |    6 
 sfx2/source/sidebar/TabBar.cxx                                    |    2 
 sfx2/source/view/frame2.cxx                                       |    8 
 sfx2/source/view/printer.cxx                                      |    4 
 sfx2/source/view/viewfrm.cxx                                      |   12 
 sfx2/source/view/viewfrm2.cxx                                     |    2 
 sfx2/source/view/viewsh.cxx                                       |    4 
 slideshow/source/engine/shapes/gdimtftools.cxx                    |    2 
 slideshow/source/engine/shapes/shapeimporter.cxx                  |    2 
 slideshow/source/engine/soundplayer.cxx                           |    2 
 sot/source/sdstor/storage.cxx                                     |    4 
 sot/source/sdstor/ucbstorage.cxx                                  |   10 
 starmath/inc/smmod.hxx                                            |    2 
 starmath/source/smmod.cxx                                         |    2 
 starmath/source/view.cxx                                          |    3 
 svgio/source/svgreader/svgnode.cxx                                |    2 
 svl/source/config/cjkoptions.cxx                                  |    4 
 svl/source/config/ctloptions.cxx                                  |   16 
 svl/source/fsstor/fsstorage.cxx                                   |   74 
 svl/source/misc/filenotation.cxx                                  |    2 
 svl/source/misc/inethist.cxx                                      |   14 
 svl/source/misc/lockfilecommon.cxx                                |    4 
 svl/source/misc/urihelper.cxx                                     |   20 
 svl/source/numbers/zforlist.cxx                                   |   10 
 svtools/source/brwbox/editbrowsebox.cxx                           |    4 
 svtools/source/config/accessibilityoptions.cxx                    |    2 
 svtools/source/config/colorcfg.cxx                                |    4 
 svtools/source/contnr/fileview.cxx                                |   14 
 svtools/source/contnr/foldertree.cxx                              |    4 
 svtools/source/contnr/simptabl.cxx                                |    2 
 svtools/source/control/breadcrumb.cxx                             |    4 
 svtools/source/control/calendar.cxx                               |    6 
 svtools/source/control/ctrltool.cxx                               |   25 
 svtools/source/control/fileurlbox.cxx                             |    6 
 svtools/source/control/fmtfield.cxx                               |    4 
 svtools/source/control/inettbc.cxx                                |   50 
 svtools/source/control/urlcontrol.cxx                             |    6 
 svtools/source/dialogs/PlaceEditDialog.cxx                        |   10 
 svtools/source/dialogs/ServerDetailsControls.cxx                  |    4 
 svtools/source/dialogs/addresstemplate.cxx                        |    4 
 svtools/source/dialogs/prnsetup.cxx                               |    4 
 svtools/source/dialogs/wizdlg.cxx                                 |    4 
 svtools/source/hatchwindow/ipwin.cxx                              |    4 
 svtools/source/hatchwindow/ipwin.hxx                              |    2 
 svtools/source/misc/imagemgr.cxx                                  |    6 
 svtools/source/misc/imap.cxx                                      |    2 
 svtools/source/misc/templatefoldercache.cxx                       |    6 
 svtools/source/misc/transfer.cxx                                  |    2 
 svtools/source/table/tabledatawindow.cxx                          |    4 
 svtools/source/table/tabledatawindow.hxx                          |    2 
 svx/inc/galbrws2.hxx                                              |    1 
 svx/inc/xpolyimp.hxx                                              |    2 
 svx/source/core/graphichelper.cxx                                 |    4 
 svx/source/dialog/docrecovery.cxx                                 |    6 
 svx/source/dialog/imapdlg.cxx                                     |    8 
 svx/source/dialog/imapwnd.cxx                                     |    2 
 svx/source/dialog/langbox.cxx                                     |    2 
 svx/source/form/databaselocationinput.cxx                         |    2 
 svx/source/form/datanavi.cxx                                      |    6 
 svx/source/form/fmpage.cxx                                        |    2 
 svx/source/form/fmshell.cxx                                       |   12 
 svx/source/gallery2/galbrws1.cxx                                  |    2 
 svx/source/gallery2/galbrws1.hxx                                  |    1 
 svx/source/gallery2/galbrws2.cxx                                  |    6 
 svx/source/gallery2/galctrl.cxx                                   |    4 
 svx/source/gallery2/galexpl.cxx                                   |    2 
 svx/source/gallery2/galini.cxx                                    |    2 
 svx/source/gallery2/gallery1.cxx                                  |   12 
 svx/source/gallery2/galmisc.cxx                                   |   24 
 svx/source/gallery2/galobj.cxx                                    |    2 
 svx/source/gallery2/galtheme.cxx                                  |   66 
 svx/source/gengal/gengal.cxx                                      |    6 
 svx/source/inc/datanavi.hxx                                       |    2 
 svx/source/inc/filtnav.hxx                                        |    1 
 svx/source/inc/fmexpl.hxx                                         |    1 
 svx/source/sidebar/PanelLayout.cxx                                |    4 
 svx/source/sidebar/nbdtmg.cxx                                     |    4 
 svx/source/svdraw/svdoedge.cxx                                    |   36 
 svx/source/svdraw/svdomedia.cxx                                   |    2 
 svx/source/svdraw/svdopath.cxx                                    |   62 
 svx/source/svdraw/svdotxln.cxx                                    |    6 
 svx/source/svdraw/svdpntv.cxx                                     |    2 
 svx/source/svdraw/svdview.cxx                                     |    4 
 svx/source/tbxctrls/colrctrl.cxx                                  |    4 
 svx/source/tbxctrls/grafctrl.cxx                                  |    6 
 svx/source/tbxctrls/itemwin.cxx                                   |   16 
 svx/source/tbxctrls/tbcontrl.cxx                                  |   12 
 svx/source/tbxctrls/tbunocontroller.cxx                           |    6 
 svx/source/toolbars/extrusionbar.cxx                              |    2 
 svx/source/toolbars/fontworkbar.cxx                               |    2 
 svx/source/unogallery/unogalitem.cxx                              |    2 
 svx/source/xoutdev/_xoutbmp.cxx                                   |   18 
 svx/source/xoutdev/_xpoly.cxx                                     |   48 
 svx/source/xoutdev/xtable.cxx                                     |    6 
 sw/inc/crsrsh.hxx                                                 |    2 
 sw/inc/doc.hxx                                                    |    2 
 sw/inc/ndgrf.hxx                                                  |    4 
 sw/inc/ndnotxt.hxx                                                |    6 
 sw/inc/ndole.hxx                                                  |    4 
 sw/inc/ndtxt.hxx                                                  |    4 
 sw/inc/ndtyp.hxx                                                  |   27 
 sw/inc/node.hxx                                                   |   52 
 sw/inc/swmodule.hxx                                               |    2 
 sw/qa/core/uwriter.cxx                                            |    6 
 sw/source/core/access/accdoc.cxx                                  |    1 
 sw/source/core/access/accdoc.hxx                                  |    1 
 sw/source/core/access/accfootnote.cxx                             |    1 
 sw/source/core/access/accframebase.cxx                            |    4 
 sw/source/core/access/accframebase.hxx                            |    2 
 sw/source/core/access/accheaderfooter.cxx                         |    1 
 sw/source/core/access/acchyperlink.cxx                            |    1 
 sw/source/core/access/accmap.cxx                                  |    9 
 sw/source/core/access/accnotextframe.cxx                          |    3 
 sw/source/core/access/accpara.cxx                                 |    2 
 sw/source/core/access/accportions.cxx                             |    2 
 sw/source/core/access/accselectionhelper.hxx                      |    1 
 sw/source/core/access/acctextframe.cxx                            |    1 
 sw/source/core/attr/format.cxx                                    |    1 
 sw/source/core/bastyp/breakit.cxx                                 |    1 
 sw/source/core/bastyp/calc.cxx                                    |    1 
 sw/source/core/bastyp/init.cxx                                    |    2 
 sw/source/core/crsr/callnk.cxx                                    |   14 
 sw/source/core/crsr/callnk.hxx                                    |    4 
 sw/source/core/crsr/crsrsh.cxx                                    |   10 
 sw/source/core/crsr/swcrsr.cxx                                    |    1 
 sw/source/core/doc/DocumentContentOperationsManager.cxx           |    2 
 sw/source/core/doc/DocumentLayoutManager.cxx                      |    8 
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx         |    2 
 sw/source/core/doc/DocumentStatisticsManager.cxx                  |   15 
 sw/source/core/doc/doc.cxx                                        |    7 
 sw/source/core/doc/doccomp.cxx                                    |   43 
 sw/source/core/doc/docedt.cxx                                     |    7 
 sw/source/core/doc/docfmt.cxx                                     |    2 
 sw/source/core/doc/docglbl.cxx                                    |    2 
 sw/source/core/doc/doclay.cxx                                     |   21 
 sw/source/core/doc/docnew.cxx                                     |    5 
 sw/source/core/doc/docnum.cxx                                     |    8 
 sw/source/core/doc/docsort.cxx                                    |    2 
 sw/source/core/doc/docxforms.cxx                                  |    1 
 sw/source/core/doc/notxtfrm.cxx                                   |   10 
 sw/source/core/doc/tblrwcl.cxx                                    |    1 
 sw/source/core/doc/visiturl.cxx                                   |    2 
 sw/source/core/docnode/finalthreadmanager.cxx                     |    1 
 sw/source/core/docnode/ndnotxt.cxx                                |    2 
 sw/source/core/docnode/ndsect.cxx                                 |    2 
 sw/source/core/docnode/ndtbl.cxx                                  |   15 
 sw/source/core/docnode/node.cxx                                   |   61 
 sw/source/core/docnode/nodes.cxx                                  |   64 
 sw/source/core/draw/dpage.cxx                                     |    8 
 sw/source/core/draw/drawdoc.cxx                                   |    1 
 sw/source/core/edit/edattr.cxx                                    |    6 
 sw/source/core/edit/edfldexp.cxx                                  |    2 
 sw/source/core/edit/edglss.cxx                                    |    4 
 sw/source/core/edit/editsh.cxx                                    |    9 
 sw/source/core/edit/edlingu.cxx                                   |    1 
 sw/source/core/edit/edtab.cxx                                     |    1 
 sw/source/core/edit/edws.cxx                                      |    7 
 sw/source/core/fields/docufld.cxx                                 |   21 
 sw/source/core/fields/macrofld.cxx                                |    1 
 sw/source/core/fields/reffld.cxx                                  |    1 
 sw/source/core/frmedt/feflyole.cxx                                |    1 
 sw/source/core/frmedt/feshview.cxx                                |   10 
 sw/source/core/graphic/grfatr.cxx                                 |   12 
 sw/source/core/graphic/ndgrf.cxx                                  |   10 
 sw/source/core/inc/retrieveinputstream.hxx                        |    1 
 sw/source/core/inc/rolbck.hxx                                     |    6 
 sw/source/core/inc/unofootnote.hxx                                |    1 
 sw/source/core/inc/unoparaframeenum.hxx                           |    3 
 sw/source/core/inc/unosection.hxx                                 |    1 
 sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx |    1 
 sw/source/core/ole/ndole.cxx                                      |    8 
 sw/source/core/para/paratr.cxx                                    |   13 
 sw/source/core/swg/SwXMLTextBlocks.cxx                            |    2 
 sw/source/core/swg/swblocks.cxx                                   |    2 
 sw/source/core/text/EnhancedPDFExportHelper.cxx                   |    2 
 sw/source/core/text/itradj.cxx                                    |    1 
 sw/source/core/text/itratr.cxx                                    |    1 
 sw/source/core/text/pormulti.cxx                                  |    1 
 sw/source/core/tox/toxhlp.cxx                                     |    1 
 sw/source/core/txtnode/fntcache.cxx                               |   30 
 sw/source/core/txtnode/ndtxt.cxx                                  |   14 
 sw/source/core/txtnode/txtedt.cxx                                 |    1 
 sw/source/core/undo/rolbck.cxx                                    |    6 
 sw/source/core/undo/undel.cxx                                     |    4 
 sw/source/core/undo/unins.cxx                                     |   12 
 sw/source/core/undo/unmove.cxx                                    |    6 
 sw/source/core/undo/untbl.cxx                                     |    4 
 sw/source/core/unocore/swunohelper.cxx                            |    6 
 sw/source/core/unocore/unocoll.cxx                                |   12 
 sw/source/core/unocore/unoobj2.cxx                                |    6 
 sw/source/core/unocore/unoredline.cxx                             |    6 
 sw/source/core/unocore/unotext.cxx                                |    4 
 sw/source/core/view/vprint.cxx                                    |    1 
 sw/source/filter/basflt/iodetect.cxx                              |    2 
 sw/source/filter/basflt/shellio.cxx                               |    4 
 sw/source/filter/html/SwAppletImpl.cxx                            |    2 
 sw/source/filter/html/htmlgrin.cxx                                |    2 
 sw/source/filter/html/htmlplug.cxx                                |    2 
 sw/source/filter/html/wrthtml.cxx                                 |    2 
 sw/source/filter/writer/wrt_fn.cxx                                |    6 
 sw/source/filter/ww8/writerhelper.cxx                             |    4 
 sw/source/filter/ww8/wrtw8esh.cxx                                 |    6 
 sw/source/filter/ww8/wrtw8nds.cxx                                 |   23 
 sw/source/filter/ww8/ww8graf2.cxx                                 |    4 
 sw/source/filter/ww8/ww8par.cxx                                   |    6 
 sw/source/filter/ww8/ww8par2.cxx                                  |    4 
 sw/source/filter/xml/xmltexti.cxx                                 |    4 
 sw/source/ui/chrdlg/chardlg.cxx                                   |    2 
 sw/source/ui/dbui/addresslistdialog.cxx                           |    2 
 sw/source/ui/dbui/createaddresslistdialog.cxx                     |    2 
 sw/source/ui/dbui/mmaddressblockpage.hxx                          |    2 
 sw/source/ui/dbui/mmdocselectpage.cxx                             |    2 
 sw/source/ui/dbui/mmresultdialogs.cxx                             |    6 
 sw/source/ui/dialog/uiregionsw.cxx                                |   12 
 sw/source/ui/frmdlg/frmpage.cxx                                   |    4 
 sw/source/ui/index/cnttab.cxx                                     |    6 
 sw/source/ui/misc/glosbib.cxx                                     |    2 
 sw/source/ui/vba/vbatemplate.cxx                                  |    2 
 sw/source/uibase/app/apphdl.cxx                                   |   12 
 sw/source/uibase/app/applab.cxx                                   |    1 
 sw/source/uibase/app/docsh.cxx                                    |    4 
 sw/source/uibase/app/docsh2.cxx                                   |    5 
 sw/source/uibase/app/swmodule.cxx                                 |    1 
 sw/source/uibase/cctrl/actctrl.cxx                                |    4 
 sw/source/uibase/config/uinums.cxx                                |    2 
 sw/source/uibase/config/usrpref.cxx                               |    1 
 sw/source/uibase/dbui/dbmgr.cxx                                   |   36 
 sw/source/uibase/dbui/dbtree.cxx                                  |    5 
 sw/source/uibase/dbui/mmconfigitem.cxx                            |    4 
 sw/source/uibase/dochdl/gloshdl.cxx                               |    2 
 sw/source/uibase/dochdl/swdtflvr.cxx                              |   17 
 sw/source/uibase/docvw/edtwin2.cxx                                |    4 
 sw/source/uibase/fldui/fldmgr.cxx                                 |    2 
 sw/source/uibase/fldui/xfldui.cxx                                 |    2 
 sw/source/uibase/frmdlg/frmmgr.cxx                                |    1 
 sw/source/uibase/inc/SwXFilterOptions.hxx                         |    1 
 sw/source/uibase/inc/actctrl.hxx                                  |    3 
 sw/source/uibase/inc/conttree.hxx                                 |   20 
 sw/source/uibase/inc/cption.hxx                                   |    7 
 sw/source/uibase/inc/dbinsdlg.hxx                                 |    1 
 sw/source/uibase/inc/glossary.hxx                                 |    7 
 sw/source/uibase/inc/labimp.hxx                                   |   44 
 sw/source/uibase/inc/navipi.hxx                                   |    1 
 sw/source/uibase/inc/redlndlg.hxx                                 |    1 
 sw/source/uibase/inc/srcedtw.hxx                                  |    1 
 sw/source/uibase/inc/swrenamexnameddlg.hxx                        |    3 
 sw/source/uibase/inc/swuicnttab.hxx                               |    2 
 sw/source/uibase/inc/uivwimp.hxx                                  |    1 
 sw/source/uibase/inc/unotools.hxx                                 |    2 
 sw/source/uibase/inc/unotxvw.hxx                                  |    1 
 sw/source/uibase/inc/wrtsh.hxx                                    |    1 
 sw/source/uibase/index/idxmrk.cxx                                 |    3 
 sw/source/uibase/lingu/hyp.cxx                                    |    1 
 sw/source/uibase/lingu/olmenu.cxx                                 |    5 
 sw/source/uibase/lingu/sdrhhcwrap.cxx                             |    1 
 sw/source/uibase/ribbar/workctrl.cxx                              |   12 
 sw/source/uibase/shells/annotsh.cxx                               |    4 
 sw/source/uibase/shells/beziersh.cxx                              |    2 
 sw/source/uibase/shells/drawsh.cxx                                |    2 
 sw/source/uibase/shells/drformsh.cxx                              |    2 
 sw/source/uibase/shells/drwtxtex.cxx                              |    1 
 sw/source/uibase/shells/drwtxtsh.cxx                              |    2 
 sw/source/uibase/shells/frmsh.cxx                                 |    2 
 sw/source/uibase/shells/grfsh.cxx                                 |    4 
 sw/source/uibase/shells/grfshex.cxx                               |    3 
 sw/source/uibase/shells/listsh.cxx                                |    2 
 sw/source/uibase/shells/mediash.cxx                               |    2 
 sw/source/uibase/shells/olesh.cxx                                 |    2 
 sw/source/uibase/shells/tabsh.cxx                                 |    2 
 sw/source/uibase/shells/textsh.cxx                                |    2 
 sw/source/uibase/shells/textsh1.cxx                               |    2 
 sw/source/uibase/shells/textsh2.cxx                               |    8 
 sw/source/uibase/sidebar/PageFooterPanel.cxx                      |    3 
 sw/source/uibase/sidebar/PageFooterPanel.hxx                      |    1 
 sw/source/uibase/sidebar/PageFormatPanel.cxx                      |    3 
 sw/source/uibase/sidebar/PageFormatPanel.hxx                      |    1 
 sw/source/uibase/sidebar/PageHeaderPanel.cxx                      |    3 
 sw/source/uibase/sidebar/PageHeaderPanel.hxx                      |    1 
 sw/source/uibase/sidebar/PageOrientationControl.cxx               |    2 
 sw/source/uibase/sidebar/PageOrientationControl.hxx               |    2 
 sw/source/uibase/sidebar/PageStylesPanel.cxx                      |    3 
 sw/source/uibase/sidebar/PageStylesPanel.hxx                      |    1 
 sw/source/uibase/sidebar/StylePresetsPanel.cxx                    |    4 
 sw/source/uibase/sidebar/StylePresetsPanel.hxx                    |    1 
 sw/source/uibase/sidebar/ThemePanel.cxx                           |    5 
 sw/source/uibase/sidebar/ThemePanel.hxx                           |    1 
 sw/source/uibase/table/chartins.cxx                               |    4 
 sw/source/uibase/uiview/pview.cxx                                 |    3 
 sw/source/uibase/uiview/srcview.cxx                               |    5 
 sw/source/uibase/uiview/uivwimp.cxx                               |    2 
 sw/source/uibase/uiview/view0.cxx                                 |    2 
 sw/source/uibase/uiview/view1.cxx                                 |    1 
 sw/source/uibase/uiview/view2.cxx                                 |    5 
 sw/source/uibase/uiview/viewling.cxx                              |    1 
 sw/source/uibase/uiview/viewprt.cxx                               |    1 
 sw/source/uibase/uno/dlelstnr.cxx                                 |    2 
 sw/source/uibase/uno/unoatxt.cxx                                  |    3 
 sw/source/uibase/uno/unomailmerge.cxx                             |    6 
 sw/source/uibase/uno/unomod.cxx                                   |    1 
 sw/source/uibase/utlui/content.cxx                                |    4 
 sw/source/uibase/utlui/glbltree.cxx                               |   72 
 sw/source/uibase/utlui/navipi.cxx                                 |    2 
 sw/source/uibase/utlui/numfmtlb.cxx                               |    1 
 sw/source/uibase/web/wformsh.cxx                                  |    2 
 sw/source/uibase/web/wfrmsh.cxx                                   |    2 
 sw/source/uibase/web/wgrfsh.cxx                                   |    2 
 sw/source/uibase/web/wlistsh.cxx                                  |    2 
 sw/source/uibase/web/wolesh.cxx                                   |    2 
 sw/source/uibase/web/wtabsh.cxx                                   |    2 
 sw/source/uibase/web/wtextsh.cxx                                  |    2 
 sw/source/uibase/web/wview.cxx                                    |    2 
 sw/source/uibase/wrtsh/wrtsh1.cxx                                 |    1 
 toolkit/source/awt/animatedimagespeer.cxx                         |    2 
 toolkit/source/controls/controlmodelcontainerbase.cxx             |    2 
 tools/inc/poly.h                                                  |    7 
 tools/qa/cppunit/test_urlobj.cxx                                  |   56 
 tools/source/fsys/urlobj.cxx                                      |  112 
 tools/source/generic/poly.cxx                                     |   76 
 ucb/source/core/FileAccess.cxx                                    |   46 
 ucb/source/ucp/cmis/cmis_content.cxx                              |    8 
 ucb/source/ucp/cmis/cmis_url.cxx                                  |   10 
 unotools/source/config/lingucfg.cxx                               |    4 
 unotools/source/config/options.cxx                                |   10 
 unotools/source/config/pathoptions.cxx                            |   16 
 unotools/source/config/syslocaleoptions.cxx                       |   32 
 unotools/source/config/useroptions.cxx                            |    2 
 unotools/source/misc/syslocale.cxx                                |    8 
 unotools/source/ucbhelper/ucbhelper.cxx                           |   14 
 uui/source/fltdlg.cxx                                             |    2 
 uui/source/passworddlg.cxx                                        |    2 
 vbahelper/source/vbahelper/vbadocumentbase.cxx                    |    2 
 vcl/CustomTarget_afm_hash.mk                                      |   20 
 vcl/Library_vcl.mk                                                |   23 
 vcl/Module_vcl.mk                                                 |    1 
 vcl/headless/svpbmp.cxx                                           |  206 -
 vcl/headless/svpframe.cxx                                         |    4 
 vcl/headless/svpgdi.cxx                                           |  459 ++-
 vcl/headless/svptext.cxx                                          |    9 
 vcl/headless/svpvd.cxx                                            |   21 
 vcl/inc/BitmapProcessor.hxx                                       |    6 
 vcl/inc/PhysicalFontCollection.hxx                                |    2 
 vcl/inc/PhysicalFontFace.hxx                                      |    1 
 vcl/inc/PhysicalFontFamily.hxx                                    |    4 
 vcl/inc/fontattributes.hxx                                        |   12 
 vcl/inc/graphite_features.hxx                                     |   65 
 vcl/inc/graphite_layout.hxx                                       |  159 -
 vcl/inc/graphite_serverfont.hxx                                   |  110 
 vcl/inc/graphite_static.hxx                                       |   21 
 vcl/inc/headless/svpgdi.hxx                                       |   22 
 vcl/inc/headless/svpvd.hxx                                        |    1 
 vcl/inc/impfont.hxx                                               |   16 
 vcl/inc/impfontmetric.hxx                                         |    6 
 vcl/inc/impfontmetricdata.hxx                                     |    9 
 vcl/inc/listbox.hxx                                               |    2 
 vcl/inc/openglgdiimpl.hxx                                         |    8 
 vcl/inc/pch/precompiled_vcl.hxx                                   |    1 
 vcl/inc/quartz/salgdi.h                                           |   15 
 vcl/inc/salgdi.hxx                                                |   19 
 vcl/inc/salgdiimpl.hxx                                            |    9 
 vcl/inc/sallayout.hxx                                             |    2 
 vcl/inc/svdata.hxx                                                |    2 
 vcl/inc/textlineinfo.hxx                                          |   11 
 vcl/inc/textrender.hxx                                            |    2 
 vcl/inc/unx/cairotextrender.hxx                                   |    4 
 vcl/inc/unx/fontmanager.hxx                                       |  177 -
 vcl/inc/unx/freetype_glyphcache.hxx                               |   12 
 vcl/inc/unx/genpspgraphics.h                                      |   15 
 vcl/inc/unx/glyphcache.hxx                                        |   56 
 vcl/inc/unx/gtk/gtkframe.hxx                                      |    2 
 vcl/inc/unx/printergfx.hxx                                        |   34 
 vcl/inc/unx/salgdi.h                                              |   13 
 vcl/inc/win/salgdi.h                                              |   44 
 vcl/inc/win/winlayout.hxx                                         |   59 
 vcl/opengl/gdiimpl.cxx                                            |   12 
 vcl/qa/cppunit/BitmapTest.cxx                                     |   22 
 vcl/qa/cppunit/font.cxx                                           |   50 
 vcl/qa/cppunit/fontmetric.cxx                                     |   38 
 vcl/qa/cppunit/lifecycle.cxx                                      |    2 
 vcl/quartz/CTRunData.cxx                                          |   94 
 vcl/quartz/CTRunData.hxx                                          |   42 
 vcl/quartz/ctfonts.cxx                                            |   28 
 vcl/quartz/ctlayout.cxx                                           |  787 -----
 vcl/quartz/salgdi.cxx                                             |   30 
 vcl/quartz/salgdicommon.cxx                                       |    8 
 vcl/source/app/settings.cxx                                       |    6 
 vcl/source/app/svdata.cxx                                         |    2 
 vcl/source/bitmap/BitmapProcessor.cxx                             |    3 
 vcl/source/bitmap/CommandImageResolver.cxx                        |    2 
 vcl/source/components/dtranscomp.cxx                              |   20 
 vcl/source/components/fontident.cxx                               |    5 
 vcl/source/control/combobox.cxx                                   |    4 
 vcl/source/control/ctrl.cxx                                       |    4 
 vcl/source/control/field.cxx                                      |   24 
 vcl/source/control/field2.cxx                                     |   24 
 vcl/source/control/imp_listbox.cxx                                |    4 
 vcl/source/control/longcurr.cxx                                   |    8 
 vcl/source/control/notebookbar.cxx                                |    1 
 vcl/source/control/spinfld.cxx                                    |    4 
 vcl/source/control/tabctrl.cxx                                    |    4 
 vcl/source/edit/textview.cxx                                      |    5 
 vcl/source/edit/vclmedit.cxx                                      |    4 
 vcl/source/filter/graphicfilter.cxx                               |    9 
 vcl/source/filter/graphicfilter2.cxx                              |    2 
 vcl/source/filter/igif/decode.cxx                                 |   20 
 vcl/source/filter/igif/decode.hxx                                 |    8 
 vcl/source/filter/sgvmain.cxx                                     |    4 
 vcl/source/filter/wmf/emfwr.cxx                                   |    4 
 vcl/source/filter/wmf/winmtf.cxx                                  |    6 
 vcl/source/font/PhysicalFontCollection.cxx                        |    7 
 vcl/source/font/PhysicalFontFace.cxx                              |   40 
 vcl/source/font/PhysicalFontFamily.cxx                            |   13 
 vcl/source/font/font.cxx                                          |   17 
 vcl/source/font/fontattributes.cxx                                |   12 
 vcl/source/font/fontcharmap.cxx                                   |   11 
 vcl/source/font/fontmetric.cxx                                    |   40 
 vcl/source/gdi/CommonSalLayout.cxx                                |    2 
 vcl/source/gdi/impgraph.cxx                                       |   10 
 vcl/source/gdi/pdfwriter_impl.cxx                                 |  274 -
 vcl/source/gdi/pdfwriter_impl2.cxx                                |    4 
 vcl/source/gdi/pngread.cxx                                        |   84 
 vcl/source/gdi/salgdilayout.cxx                                   |    8 
 vcl/source/gdi/sallayout.cxx                                      |    1 
 vcl/source/gdi/svmconverter.cxx                                   |    2 
 vcl/source/gdi/virdev.cxx                                         |    2 
 vcl/source/glyphs/graphite_features.cxx                           |  265 -
 vcl/source/glyphs/graphite_layout.cxx                             | 1143 -------
 vcl/source/helper/commandinfoprovider.cxx                         |    4 
 vcl/source/image/Image.cxx                                        |    2 
 vcl/source/image/ImageArrayData.cxx                               |    2 
 vcl/source/image/ImplImageTree.cxx                                |    7 
 vcl/source/outdev/curvedshapes.cxx                                |    8 
 vcl/source/outdev/font.cxx                                        |   23 
 vcl/source/outdev/line.cxx                                        |    4 
 vcl/source/outdev/polygon.cxx                                     |   12 
 vcl/source/outdev/polyline.cxx                                    |    8 
 vcl/source/outdev/rect.cxx                                        |    4 
 vcl/source/outdev/text.cxx                                        |   98 
 vcl/source/uitest/uno/uitest_uno.cxx                              |    5 
 vcl/source/window/dialog.cxx                                      |    4 
 vcl/source/window/dockwin.cxx                                     |    6 
 vcl/source/window/event.cxx                                       |    2 
 vcl/source/window/floatwin.cxx                                    |    4 
 vcl/source/window/layout.cxx                                      |    4 
 vcl/source/window/mouse.cxx                                       |    6 
 vcl/source/window/syswin.cxx                                      |    4 
 vcl/source/window/toolbox.cxx                                     |   10 
 vcl/source/window/window.cxx                                      |    4 
 vcl/source/window/window2.cxx                                     |   16 
 vcl/unx/generic/app/wmadaptor.cxx                                 |   16 
 vcl/unx/generic/dtrans/config.cxx                                 |    9 
 vcl/unx/generic/fontmanager/adobe_encoding_table.hxx              | 1078 -------
 vcl/unx/generic/fontmanager/afm_keyword_list                      |   62 
 vcl/unx/generic/fontmanager/fontcache.cxx                         |  161 -
 vcl/unx/generic/fontmanager/fontconfig.cxx                        |   24 
 vcl/unx/generic/fontmanager/fontmanager.cxx                       | 1028 -------
 vcl/unx/generic/fontmanager/helper.cxx                            |    2 
 vcl/unx/generic/fontmanager/parseAFM.cxx                          | 1465 ----------
 vcl/unx/generic/fontmanager/parseAFM.hxx                          |  323 --
 vcl/unx/generic/gdi/cairotextrender.cxx                           |   97 
 vcl/unx/generic/gdi/font.cxx                                      |    9 
 vcl/unx/generic/gdi/gdiimpl.cxx                                   |    8 
 vcl/unx/generic/gdi/gdiimpl.hxx                                   |    8 
 vcl/unx/generic/gdi/salbmp.cxx                                    |  165 -
 vcl/unx/generic/gdi/salgdi.cxx                                    |    8 
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx                    |  364 --
 vcl/unx/generic/glyphs/gcach_layout.cxx                           |  621 ----
 vcl/unx/generic/glyphs/glyphcache.cxx                             |    6 
 vcl/unx/generic/glyphs/graphite_serverfont.cxx                    |  134 
 vcl/unx/generic/print/bitmap_gfx.cxx                              |   15 
 vcl/unx/generic/print/common_gfx.cxx                              |   22 
 vcl/unx/generic/print/genprnpsp.cxx                               |   17 
 vcl/unx/generic/print/genpspgraphics.cxx                          |  391 --
 vcl/unx/generic/print/glyphset.cxx                                |  456 ---
 vcl/unx/generic/print/glyphset.hxx                                |   32 
 vcl/unx/generic/print/text_gfx.cxx                                |  482 ---
 vcl/unx/generic/printer/ppdparser.cxx                             |   10 
 vcl/unx/generic/printer/printerinfomanager.cxx                    |    4 
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx                          |    4 
 vcl/unx/gtk3/gtk3gtkframe.cxx                                     |   67 
 vcl/win/gdi/gdiimpl.cxx                                           |   36 
 vcl/win/gdi/gdiimpl.hxx                                           |    8 
 vcl/win/gdi/salfont.cxx                                           |  356 --
 vcl/win/gdi/salgdi.cxx                                            |    8 
 vcl/win/gdi/winlayout.cxx                                         |  178 -
 xmloff/source/core/xmlexp.cxx                                     |    4 
 xmloff/source/core/xmlimp.cxx                                     |    6 
 xmloff/source/draw/eventimp.cxx                                   |    2 
 901 files changed, 4661 insertions(+), 14519 deletions(-)

New commits:
commit e8ba02b1d56dc7b59a4f0a7373995b28653a0597
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sat Dec 9 16:28:42 2017 -0500

    vcl-svp: add 24-bit (3-byte) RGB surface support to Cairo
    
    Change-Id: I7707219eae4c2d6d40c8dc957207b63d3049a75f

diff --git a/external/cairo/cairo/cairo-1.10.2.patch b/external/cairo/cairo/cairo-1.10.2.patch
index d564d53ab9e0..c11a68675069 100644
--- a/external/cairo/cairo/cairo-1.10.2.patch
+++ b/external/cairo/cairo/cairo-1.10.2.patch
@@ -1,5 +1,6 @@
---- misc/cairo-1.10.2/build/Makefile.win32.features	2010-08-18 09:47:30.000000000 +0200
-+++ misc/build/cairo-1.10.2/build/Makefile.win32.features	2011-12-20 09:57:06.428170146 +0100
+diff -ruNw misc/cairo-1.10.2/build/Makefile.win32.features misc/build/cairo-1.10.2/build/Makefile.win32.features
+--- misc/cairo-1.10.2/build/Makefile.win32.features	2015-10-27 17:04:21.000000000 -0400
++++ misc/build/cairo-1.10.2/build/Makefile.win32.features	2017-11-24 21:43:14.103524768 -0500
 @@ -30,7 +30,7 @@
  CAIRO_HAS_FC_FONT=0
  CAIRO_HAS_PS_SURFACE=1
@@ -9,9 +10,10 @@
  CAIRO_HAS_TEST_SURFACES=0
  CAIRO_HAS_TEE_SURFACE=0
  CAIRO_HAS_XML_SURFACE=0
---- misc/cairo-1.10.2/configure	2010-12-25 15:22:57.000000000 +0100
-+++ misc/build/cairo-1.10.2/configure	2010-12-25 15:22:57.000000000 +0100
-@@ -19259,59 +19259,10 @@
+diff -ruNw misc/cairo-1.10.2/configure misc/build/cairo-1.10.2/configure
+--- misc/cairo-1.10.2/configure	2015-12-09 15:41:45.000000000 -0500
++++ misc/build/cairo-1.10.2/configure	2017-11-24 21:43:14.103524768 -0500
+@@ -20580,61 +20580,12 @@
  rm -f confcache
  
  
@@ -58,8 +60,8 @@
  	  have_libz=yes
  
  $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
--
--
+ 
+ 
 -else
 -  have_libz="no (requires zlib http://www.gzip.org/zlib/)"
 -fi
@@ -68,10 +70,12 @@
 -else
 -  have_libz="no (requires zlib http://www.gzip.org/zlib/)"
 -fi
- 
- 
+-
+-
  save_LIBS="$LIBS"
-@@ -29424,7 +29424,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo2a_decompress in -llzo2" >&5
+ $as_echo_n "checking for lzo2a_decompress in -llzo2... " >&6; }
+@@ -30069,7 +30020,7 @@
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - OK" >&5
  $as_echo "$FREETYPE_VERSION - OK" >&6; }
  			   ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags`
@@ -80,7 +84,7 @@
      else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - Too old" >&5
  $as_echo "$FREETYPE_VERSION - Too old" >&6; }
  			   use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)"
-@@ -29434,7 +29434,7 @@
+@@ -30079,7 +30030,7 @@
      fi
  
    ft_CFLAGS="$FREETYPE_CFLAGS"
@@ -89,7 +93,7 @@
  
  
  		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's FreeType font backend feature could be enabled" >&5
-@@ -30121,7 +30121,7 @@
+@@ -30686,7 +30637,7 @@
  
      # The ps backend requires zlib.
      use_ps=$have_libz
@@ -98,7 +102,7 @@
  
  
  		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PostScript surface backend feature could be enabled" >&5
-@@ -30549,7 +30549,7 @@
+@@ -31082,7 +31033,7 @@
  
      # The pdf backend requires zlib.
      use_pdf=$have_libz
@@ -107,7 +111,7 @@
  
  
  		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PDF surface backend feature could be enabled" >&5
-@@ -32296,7 +32296,7 @@
+@@ -32973,7 +32924,7 @@
  
  
      use_xml=$have_libz
@@ -116,4 +120,107 @@
  
  
  		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's xml surface backend feature could be enabled" >&5
-$as_echo_n "checking whether cairo's xml surface backend feature could be enabled... " >&6; }
+diff -ruNw misc/cairo-1.10.2/src/cairo.h misc/build/cairo-1.10.2/src/cairo.h
+--- misc/cairo-1.10.2/src/cairo.h	2015-10-27 17:04:21.000000000 -0400
++++ misc/build/cairo-1.10.2/src/cairo.h	2017-12-10 18:26:56.584047695 -0500
+@@ -397,6 +397,8 @@
+  *   with red in the upper 5 bits, then green in the middle
+  *   6 bits, and blue in the lower 5 bits. (Since 1.2)
+  * @CAIRO_FORMAT_RGB30: like RGB24 but with 10bpc. (Since 1.12)
++ * @CAIRO_FORMAT_24BIT_RGB: each pixel is a 24-bit quantity,
++ *   with Red, Green, Blue taking 8-bits each, in that order. (Since 1.1x)
+  *
+  * #cairo_format_t is used to identify the memory format of
+  * image data.
+@@ -412,9 +414,16 @@
+     CAIRO_FORMAT_A8        = 2,
+     CAIRO_FORMAT_A1        = 3,
+     CAIRO_FORMAT_RGB16_565 = 4,
+-    CAIRO_FORMAT_RGB30     = 5
++    CAIRO_FORMAT_RGB30     = 5,
++    CAIRO_FORMAT_24BIT_RGB = 6
+ } cairo_format_t;
+ 
++/**
++ * Need this until CAIRO_FORMAT_24BIT_RGB is in some official release.
++ * Otherwise we can't reliably check if this is available or we should
++ * convert from 24-bit RGB to 32-bit RGB before passing to Cairo.
++ **/
++#define HAVE_CAIRO_FORMAT_24BIT_RGB
+ 
+ /**
+  * cairo_write_func_t:
+diff -ruNw misc/cairo-1.10.2/src/cairo-image-source.c misc/build/cairo-1.10.2/src/cairo-image-source.c
+--- misc/cairo-1.10.2/src/cairo-image-source.c	2015-10-27 17:04:30.000000000 -0400
++++ misc/build/cairo-1.10.2/src/cairo-image-source.c	2017-12-10 22:31:08.911151137 -0500
+@@ -508,6 +508,19 @@
+ 	color.blue = expand_channel(pixel & 0x3fff, 10);
+ 	return pixman_image_create_solid_fill (&color);
+ 
++    case CAIRO_FORMAT_24BIT_RGB:
++	pixel = *(uint32_t *) (image->data + y * image->stride + 3 * x);
++	pixel &= 0x00ffffff; /* ignore next pixel bits */
++	if (pixel == 0)
++	    return _pixman_black_image ();
++	if (pixel == 0x00ffffff)
++	    return _pixman_white_image ();
++
++	color.red = (pixel >> 16 & 0xff) | (pixel >> 8 & 0xff00);
++	color.green = (pixel >> 8 & 0xff) | (pixel & 0xff00);
++	color.blue = (pixel & 0xff) | (pixel << 8 & 0xff00);
++	return pixman_image_create_solid_fill (&color);
++
+     case CAIRO_FORMAT_ARGB32:
+     case CAIRO_FORMAT_RGB24:
+ 	pixel = *(uint32_t *) (image->data + y * image->stride + 4 * x);
+diff -ruNw misc/cairo-1.10.2/src/cairo-image-surface.c misc/build/cairo-1.10.2/src/cairo-image-surface.c
+--- misc/cairo-1.10.2/src/cairo-image-surface.c	2015-10-27 17:04:30.000000000 -0400
++++ misc/build/cairo-1.10.2/src/cairo-image-surface.c	2017-12-09 16:23:41.702363265 -0500
+@@ -104,13 +104,15 @@
+ 	return CAIRO_FORMAT_A1;
+     case PIXMAN_r5g6b5:
+ 	return CAIRO_FORMAT_RGB16_565;
++	case PIXMAN_r8g8b8:
++	return CAIRO_FORMAT_24BIT_RGB;
+ #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0)
+     case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8:
+ #endif
+ #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2)
+     case PIXMAN_a8r8g8b8_sRGB:
+ #endif
+-    case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8:
++	case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8:
+     case PIXMAN_b8g8r8:   case PIXMAN_b5g6r5:
+     case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5:
+     case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4:
+@@ -320,6 +322,9 @@
+     case CAIRO_FORMAT_RGB16_565:
+ 	ret = PIXMAN_r5g6b5;
+ 	break;
++	case CAIRO_FORMAT_24BIT_RGB:
++	ret = PIXMAN_r8g8b8;
++	break;
+     case CAIRO_FORMAT_ARGB32:
+     case CAIRO_FORMAT_INVALID:
+     default:
+@@ -718,6 +723,8 @@
+     case CAIRO_FORMAT_RGB30:
+     case CAIRO_FORMAT_RGB24:
+ 	return 32;
++	case CAIRO_FORMAT_24BIT_RGB:
++	return 24;
+     case CAIRO_FORMAT_RGB16_565:
+ 	return 16;
+     case CAIRO_FORMAT_A8:
+diff -ruNw misc/cairo-1.10.2/src/cairoint.h misc/build/cairo-1.10.2/src/cairoint.h
+--- misc/cairo-1.10.2/src/cairoint.h	2015-10-27 17:04:30.000000000 -0400
++++ misc/build/cairo-1.10.2/src/cairoint.h	2017-12-09 14:32:01.555523101 -0500
+@@ -1486,7 +1486,7 @@
+  * in cairo-xlib-surface.c--again see -Wswitch-enum).
+  */
+ #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 &&		\
+-                                    (format) <= CAIRO_FORMAT_RGB30)
++                                    (format) <= CAIRO_FORMAT_24BIT_RGB)
+ 
+ /* pixman-required stride alignment in bytes. */
+ #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index cd546ab5fdb1..f54f7a531352 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -37,9 +37,9 @@
 #include <cairo.h>
 
 #if ENABLE_CAIRO_CANVAS
-#if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
-#   define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23))
-#endif
+#   if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
+#      define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23))
+#   endif
 #endif
 
 namespace
@@ -103,9 +103,18 @@ namespace
     cairo_format_t getCairoFormat(const BitmapBuffer& rBuffer)
     {
         cairo_format_t nFormat;
+#ifdef HAVE_CAIRO_FORMAT_24BIT_RGB
+        assert(rBuffer.mnBitCount == 32 || rBuffer.mnBitCount == 24 || rBuffer.mnBitCount == 1);
+#else
         assert(rBuffer.mnBitCount == 32 || rBuffer.mnBitCount == 1);
+#endif
+
         if (rBuffer.mnBitCount == 32)
             nFormat = CAIRO_FORMAT_ARGB32;
+#ifdef HAVE_CAIRO_FORMAT_24BIT_RGB
+        else if (rBuffer.mnBitCount == 24)
+            nFormat = CAIRO_FORMAT_24BIT_RGB;
+#endif
         else
             nFormat = CAIRO_FORMAT_A1;
         return nFormat;
@@ -179,6 +188,15 @@ namespace
             {
                 if ((SVP_CAIRO_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcRgba)
                 {
+                    assert((SVP_24BIT_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcRgb);
+                    pD[0] = pS[0];
+                    pD[1] = pS[1];
+                    pD[2] = pS[2];
+                    pD[3] = 0xff; // Alpha
+                }
+                else if ((SVP_CAIRO_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcBgra)
+                {
+                    assert((SVP_24BIT_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcBgr);
                     pD[0] = pS[0];
                     pD[1] = pS[1];
                     pD[2] = pS[2];
@@ -186,18 +204,12 @@ namespace
                 }
                 else if ((SVP_CAIRO_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcArgb)
                 {
+                    assert((SVP_24BIT_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcRgb);
                     pD[0] = 0xff; // Alpha
                     pD[1] = pS[0];
                     pD[2] = pS[1];
                     pD[3] = pS[2];
                 }
-                else if ((SVP_CAIRO_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcBgra)
-                {
-                    pD[0] = pS[2];
-                    pD[1] = pS[1];
-                    pD[2] = pS[0];
-                    pD[3] = 0xff; // Alpha
-                }
                 else
                 {
                     assert(!"Unsupported SVP_CAIRO_FORMAT!");
@@ -217,7 +229,11 @@ namespace
         explicit SourceHelper(const SalBitmap& rSourceBitmap)
         {
             const SvpSalBitmap& rSrcBmp = static_cast<const SvpSalBitmap&>(rSourceBitmap);
+#ifdef HAVE_CAIRO_FORMAT_24BIT_RGB
+            if (rSrcBmp.GetBitCount() != 32 && rSrcBmp.GetBitCount() != 24)
+#else
             if (rSrcBmp.GetBitCount() != 32)
+#endif
             {
                 //big stupid copy here
                 static bool bWarnedOnce = false;
@@ -1439,8 +1455,12 @@ namespace
         if (!pBuffer)
             return false;
 
-        // Cairo doesn't support 24-bit RGB; only ARGB with the alpha ignored.
+        // We use Cairo that supports 24-bit RGB.
+#ifdef HAVE_CAIRO_FORMAT_24BIT_RGB
+        if (pBuffer->mnBitCount != 32 && pBuffer->mnBitCount != 24 && pBuffer->mnBitCount != 1)
+#else
         if (pBuffer->mnBitCount != 32 && pBuffer->mnBitCount != 1)
+#endif
             return false;
 
         cairo_format_t nFormat = getCairoFormat(*pBuffer);
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index f092b0375822..27ebad049d16 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -38,19 +38,23 @@
 //which is internal in that case, to swap the rgb components so that
 //cairo then matches the OpenGL GL_RGBA format so we can use it there
 //where we don't have GL_BGRA support.
+// SVP_24BIT_FORMAT is used to store 24-bit images in 3-byte pixels to conserve memory.
 #if defined ANDROID
+#   define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcRgb | ScanlineFormat::TopDown)
 #   define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcRgba | ScanlineFormat::TopDown)
 #   define SVP_CAIRO_BLUE 1
 #   define SVP_CAIRO_GREEN 2
 #   define SVP_CAIRO_RED 0
 #   define SVP_CAIRO_ALPHA 3
 #elif defined OSL_BIGENDIAN
+#   define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcRgb | ScanlineFormat::TopDown)
 #   define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcArgb | ScanlineFormat::TopDown)
 #   define SVP_CAIRO_BLUE 3
 #   define SVP_CAIRO_GREEN 2
 #   define SVP_CAIRO_RED 1
 #   define SVP_CAIRO_ALPHA 0
 #else
+#   define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcBgr | ScanlineFormat::TopDown)
 #   define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcBgra | ScanlineFormat::TopDown)
 #   define SVP_CAIRO_BLUE 0
 #   define SVP_CAIRO_GREEN 1
@@ -58,9 +62,6 @@
 #   define SVP_CAIRO_ALPHA 3
 #endif
 
-// Used to store 24-bit images in 3-byte pixels to conserve memory.
-#define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcRgb | ScanlineFormat::TopDown)
-
 struct BitmapBuffer;
 class GlyphCache;
 class FreetypeFont;
commit 1168a11278ed3c2a00058e1f802f6e44cb925318
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Dec 6 19:41:45 2017 -0500

    sc: compact ScColumn
    
    Remove ScDocument* member from ScColumn
    and re-use the one in ScAttrArray.
    
    This saves 8 bytes and makes the code more
    homogenious by using GetDoc() member everywhere.
    
    Change-Id: I16a94b7ef7c45ef3af14e812b45f255f39939a6e

diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index 49626ea9e124..e6cfbab5201f 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -83,7 +83,7 @@ class ScAttrArray
 private:
     SCCOL           nCol;
     SCTAB           nTab;
-    ScDocument*     pDocument;
+    ScDocument* const     pDocument;
 
     SCSIZE          nCount;
     SCSIZE          nLimit;
@@ -109,6 +109,7 @@ public:
             ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc, ScAttrArray* pNextColAttrArray = nullptr, bool bCreateEmpty = false );
             ~ScAttrArray();
 
+    ScDocument* GetDoc() { return pDocument; }
     void    SetTab(SCTAB nNewTab)   { nTab = nNewTab; }
     void    SetCol(SCCOL nNewCol)   { nCol = nNewCol; }
 #if DEBUG_SC_TESTATTRARRAY
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 569f1ec06e5c..93ed1ce94e8d 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -29,6 +29,7 @@
 #include "mtvelements.hxx"
 #include <formula/types.hxx>
 #include <svl/zforlist.hxx>
+#include "attarray.hxx"
 
 #include <set>
 #include <vector>
@@ -137,14 +138,13 @@ class ScColumn
     // Cell values.
     sc::CellStoreType maCells;
 
-    SCCOL           nCol;
-    SCTAB           nTab;
-
-    ScAttrArray*          pAttrArray;
-    ScDocument*           pDocument;
+    ScAttrArray* pAttrArray;
 
     size_t mnBlkCountFormula;
 
+    SCCOL           nCol;
+    SCTAB           nTab;
+
 friend class ScDocument;                    // for FillInfo
 friend class ScTable;
 friend class ScValueIterator;
@@ -188,8 +188,7 @@ public:
 
     void        Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc, bool bEmptyAttrArray = false);
 
-    ScDocument& GetDoc() { return *pDocument;}
-    const ScDocument& GetDoc() const { return *pDocument;}
+    ScDocument* GetDoc() const { return pAttrArray->GetDoc(); }
     SCTAB GetTab() const { return nTab; }
     SCCOL GetCol() const { return nCol; }
     sc::CellStoreType& GetCellStore() { return maCells; }
diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx
index 75b7c5bbb12f..5eb57751b312 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -115,7 +115,7 @@ void commitToColumn( const ScCellValue& rCell, ScColumn& rColumn, SCROW nRow )
             rColumn.SetRawString(nRow, *rCell.mpString);
         break;
         case CELLTYPE_EDIT:
-            rColumn.SetEditText(nRow, ScEditUtil::Clone(*rCell.mpEditText, rColumn.GetDoc()));
+            rColumn.SetEditText(nRow, ScEditUtil::Clone(*rCell.mpEditText, *rColumn.GetDoc()));
         break;
         case CELLTYPE_VALUE:
             rColumn.SetValue(nRow, rCell.mfValue);
@@ -123,7 +123,7 @@ void commitToColumn( const ScCellValue& rCell, ScColumn& rColumn, SCROW nRow )
         case CELLTYPE_FORMULA:
         {
             ScAddress aDestPos(rColumn.GetCol(), nRow, rColumn.GetTab());
-            rColumn.SetFormulaCell(nRow, new ScFormulaCell(*rCell.mpFormula, rColumn.GetDoc(), aDestPos));
+            rColumn.SetFormulaCell(nRow, new ScFormulaCell(*rCell.mpFormula, *rColumn.GetDoc(), aDestPos));
         }
         break;
         default:
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 3d68df45f50e..fa79b936c48f 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -88,11 +88,10 @@ ScColumn::ScColumn() :
     maBroadcasters(MAXROWCOUNT),
     maCellsEvent(this),
     maCells(maCellsEvent),
-    nCol( 0 ),
-    nTab( 0 ),
     pAttrArray( nullptr ),
-    pDocument( nullptr ),
-    mnBlkCountFormula(0)
+    mnBlkCountFormula(0),
+    nCol( 0 ),
+    nTab( 0 )
 {
     maCells.resize(MAXROWCOUNT);
 }
@@ -107,11 +106,10 @@ void ScColumn::Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc, bool bEmptyA
 {
     nCol = nNewCol;
     nTab = nNewTab;
-    pDocument = pDoc;
     if ( !bEmptyAttrArray )
-        pAttrArray = new ScAttrArray( nCol, nTab, pDocument, &pDocument->maTabs[nTab]->aNextColAttrArray, bEmptyAttrArray );
+        pAttrArray = new ScAttrArray( nCol, nTab, pDoc, &pDoc->maTabs[nTab]->aNextColAttrArray, bEmptyAttrArray );
     else
-        pAttrArray = new ScAttrArray( nCol, nTab, pDocument, nullptr, true );
+        pAttrArray = new ScAttrArray( nCol, nTab, pDoc, nullptr, true );
 }
 
 SCsROW ScColumn::GetNextUnprotected( SCROW nRow, bool bUp ) const
@@ -276,7 +274,7 @@ bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const
                         aCurOrigin = aOrigin;
                         const ScFormulaCell* pFCell;
                         if (pCell->GetMatrixFlag() == MM_REFERENCE)
-                            pFCell = pDocument->GetFormulaCell(aOrigin);
+                            pFCell = GetDoc()->GetFormulaCell(aOrigin);
                         else
                             pFCell = pCell;
 
@@ -388,7 +386,7 @@ const ScPatternAttr* ScColumn::GetMostUsedPattern( SCROW nStartRow, SCROW nEndRo
     const ScPatternAttr* pMaxPattern = nullptr;
     size_t nMaxCount = 0;
 
-    ScAttrIterator aAttrIter( pAttrArray, nStartRow, nEndRow, pDocument->GetDefPattern() );
+    ScAttrIterator aAttrIter( pAttrArray, nStartRow, nEndRow, GetDoc()->GetDefPattern() );
     const ScPatternAttr* pPattern;
     SCROW nAttrRow1 = 0, nAttrRow2 = 0;
 
@@ -408,6 +406,7 @@ const ScPatternAttr* ScColumn::GetMostUsedPattern( SCROW nStartRow, SCROW nEndRo
 
 sal_uInt32 ScColumn::GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const
 {
+    ScDocument* pDocument = GetDoc();
     SCROW nPatStartRow, nPatEndRow;
     const ScPatternAttr* pPattern = pAttrArray->GetPatternRange(nPatStartRow, nPatEndRow, nStartRow);
     sal_uInt32 nFormat = pPattern->GetNumberFormat(pDocument->GetFormatTable());
@@ -424,7 +423,7 @@ sal_uInt32 ScColumn::GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const
 
 sal_uInt32 ScColumn::GetNumberFormat( SCROW nRow ) const
 {
-    return pAttrArray->GetPattern( nRow )->GetNumberFormat( pDocument->GetFormatTable() );
+    return pAttrArray->GetPattern( nRow )->GetNumberFormat( GetDoc()->GetFormatTable() );
 }
 
 SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray )
@@ -493,7 +492,7 @@ void ScColumn::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rM
 void ScColumn::ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr )
 {
     const SfxItemSet* pSet = &rPatAttr.GetItemSet();
-    SfxItemPoolCache aCache( pDocument->GetPool(), pSet );
+    SfxItemPoolCache aCache( GetDoc()->GetPool(), pSet );
 
     const ScPatternAttr* pPattern = pAttrArray->GetPattern( nRow );
 
@@ -509,7 +508,7 @@ void ScColumn::ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPattern
                                  ScEditDataArray* pDataArray )
 {
     const SfxItemSet* pSet = &rPatAttr.GetItemSet();
-    SfxItemPoolCache aCache( pDocument->GetPool(), pSet );
+    SfxItemPoolCache aCache( GetDoc()->GetPool(), pSet );
     pAttrArray->ApplyCacheArea( nStartRow, nEndRow, &aCache, pDataArray );
 }
 
@@ -517,8 +516,8 @@ void ScColumn::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
         const ScPatternAttr& rPattern, short nNewType )
 {
     const SfxItemSet* pSet = &rPattern.GetItemSet();
-    SfxItemPoolCache aCache( pDocument->GetPool(), pSet );
-    SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
+    SfxItemPoolCache aCache( GetDoc()->GetPool(), pSet );
+    SvNumberFormatter* pFormatter = GetDoc()->GetFormatTable();
     SCROW nEndRow = rRange.aEnd.Row();
     for ( SCROW nRow = rRange.aStart.Row(); nRow <= nEndRow; nRow++ )
     {
@@ -611,6 +610,7 @@ const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, bool&
     const ScStyleSheet* pStyle = nullptr;
     const ScStyleSheet* pNewStyle;
 
+    ScDocument* pDocument = GetDoc();
     ScMultiSelIter aMultiIter( rMark.GetMultiSelData(), nCol );
     SCROW nTop;
     SCROW nBottom;
@@ -642,7 +642,7 @@ const ScStyleSheet* ScColumn::GetAreaStyle( bool& rFound, SCROW nRow1, SCROW nRo
     const ScStyleSheet* pStyle = nullptr;
     const ScStyleSheet* pNewStyle;
 
-    ScAttrIterator aAttrIter( pAttrArray, nRow1, nRow2, pDocument->GetDefPattern() );
+    ScAttrIterator aAttrIter( pAttrArray, nRow1, nRow2, GetDoc()->GetDefPattern() );
     SCROW nRow;
     SCROW nDummy;
     const ScPatternAttr* pPattern;
@@ -699,7 +699,7 @@ void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr )
     //  in order to only create a new SetItem, we don't need SfxItemPoolCache.
     //TODO: Warning: SfxItemPoolCache seems to create to many Refs for the new SetItem ??
 
-    ScDocumentPool* pDocPool = pDocument->GetPool();
+    ScDocumentPool* pDocPool = GetDoc()->GetPool();
 
     const ScPatternAttr* pOldPattern = pAttrArray->GetPattern( nRow );
     std::unique_ptr<ScPatternAttr> pTemp(new ScPatternAttr(*pOldPattern));
@@ -928,7 +928,7 @@ public:
                 std::vector<EditTextObject*> aCloned;
                 aCloned.reserve(nDataSize);
                 for (; it != itEnd; ++it)
-                    aCloned.push_back(ScEditUtil::Clone(**it, mrDestCol.GetDoc()));
+                    aCloned.push_back(ScEditUtil::Clone(**it, *mrDestCol.GetDoc()));
 
                 maDestPos.miCellPos = mrDestCol.GetCellStore().set(
                     maDestPos.miCellPos, nTopRow, aCloned.begin(), aCloned.end());
@@ -947,10 +947,10 @@ public:
                 for (; it != itEnd; ++it, aDestPos.IncRow())
                 {
                     const ScFormulaCell& rOld = **it;
-                    if (rOld.GetDirty() && mrSrcCol.GetDoc().GetAutoCalc())
+                    if (rOld.GetDirty() && mrSrcCol.GetDoc()->GetAutoCalc())
                         const_cast<ScFormulaCell&>(rOld).Interpret();
 
-                    aCloned.push_back(new ScFormulaCell(rOld, mrDestCol.GetDoc(), aDestPos));
+                    aCloned.push_back(new ScFormulaCell(rOld, *mrDestCol.GetDoc(), aDestPos));
                 }
 
                 // Group the cloned formula cells.
@@ -1047,6 +1047,7 @@ void ScColumn::CopyStaticToDocument(
 
     aDestPos.miCellPos = rDestCol.maCells.begin();
 
+    ScDocument* pDocument = GetDoc();
     std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nRow1);
     sc::CellStoreType::const_iterator it = aPos.first;
     size_t nOffset = aPos.second;
@@ -1158,6 +1159,7 @@ void ScColumn::CopyStaticToDocument(
 
 void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDestCol )
 {
+    ScDocument* pDocument = GetDoc();
     std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nSrcRow);
     sc::CellStoreType::const_iterator it = aPos.first;
     bool bSet = true;
@@ -1172,10 +1174,10 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDes
         case sc::element_type_edittext:
         {
             EditTextObject* p = sc::edittext_block::at(*it->data, aPos.second);
-            if (pDocument == rDestCol.pDocument)
+            if (pDocument == rDestCol.GetDoc())
                 rDestCol.maCells.set(nDestRow, p->Clone());
             else
-                rDestCol.maCells.set(nDestRow, ScEditUtil::Clone(*p, *rDestCol.pDocument));
+                rDestCol.maCells.set(nDestRow, ScEditUtil::Clone(*p, *rDestCol.GetDoc()));
         }
         break;
         case sc::element_type_formula:
@@ -1186,7 +1188,7 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDes
 
             ScAddress aDestPos = p->aPos;
             aDestPos.SetRow(nDestRow);
-            ScFormulaCell* pNew = new ScFormulaCell(*p, *rDestCol.pDocument, aDestPos);
+            ScFormulaCell* pNew = new ScFormulaCell(*p, *rDestCol.GetDoc(), aDestPos);
             rDestCol.SetFormulaCell(nDestRow, pNew);
         }
         break;
@@ -1204,7 +1206,7 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDes
         if (pNote)
         {
             pNote = pNote->Clone(ScAddress(nCol, nSrcRow, nTab),
-                                 rDestCol.GetDoc(),
+                                 *rDestCol.GetDoc(),
                                  ScAddress(rDestCol.nCol, nDestRow, rDestCol.nTab),
                                  false);
             rDestCol.maCellNotes.set(nDestRow, pNote);
@@ -1265,7 +1267,7 @@ class CopyAsLinkHandler
 
         ScTokenArray aArr;
         aArr.AddSingleReference(aRef);
-        return new ScFormulaCell(&mrDestCol.GetDoc(), ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()), aArr);
+        return new ScFormulaCell(mrDestCol.GetDoc(), ScAddress(mrDestCol.GetCol(), nRow, mrDestCol.GetTab()), aArr);
     }
 
     void createRefBlock(const sc::CellStoreType::value_type& aNode, size_t nOffset, size_t nDataSize)
@@ -1338,7 +1340,7 @@ public:
                 ScAddress aSrcPos(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab());
                 for (; it != itEnd; ++it, aSrcPos.IncRow(), ++nRow)
                 {
-                    if (!canCopyValue(mrSrcCol.GetDoc(), aSrcPos, mnCopyFlags))
+                    if (!canCopyValue(*mrSrcCol.GetDoc(), aSrcPos, mnCopyFlags))
                         continue;
 
                     maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nRow, createRefCell(nRow));
@@ -1422,14 +1424,14 @@ class CopyByCloneHandler
         if (bForceFormula || bCloneFormula)
         {
             // Clone as formula cell.
-            ScFormulaCell* pCell = new ScFormulaCell(rSrcCell, mrDestCol.GetDoc(), aDestPos, mnFormulaCellCloneFlags);
+            ScFormulaCell* pCell = new ScFormulaCell(rSrcCell, *mrDestCol.GetDoc(), aDestPos, mnFormulaCellCloneFlags);
             pCell->SetDirtyVar();
             mrDestCol.SetFormulaCell(maDestPos, nRow, pCell, meListenType);
             setDefaultAttrToDest(nRow);
             return;
         }
 
-        if (mrDestCol.GetDoc().IsUndo())
+        if (mrDestCol.GetDoc()->IsUndo())
             return;
 
         if (bCloneValue)
@@ -1438,7 +1440,7 @@ class CopyByCloneHandler
             if (nErr != FormulaError::NONE)
             {
                 // error codes are cloned with values
-                ScFormulaCell* pErrCell = new ScFormulaCell(&mrDestCol.GetDoc(), aDestPos);
+                ScFormulaCell* pErrCell = new ScFormulaCell(mrDestCol.GetDoc(), aDestPos);
                 pErrCell->SetErrCode(nErr);
                 mrDestCol.SetFormulaCell(maDestPos, nRow, pErrCell, meListenType);
                 setDefaultAttrToDest(nRow);
@@ -1450,7 +1452,7 @@ class CopyByCloneHandler
         {
             if (rSrcCell.IsValue())
             {
-                if (canCopyValue(mrSrcCol.GetDoc(), ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab()), mnCopyFlags))
+                if (canCopyValue(*mrSrcCol.GetDoc(), ScAddress(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab()), mnCopyFlags))
                 {
                     maDestPos.miCellPos = mrDestCol.GetCellStore().set(
                         maDestPos.miCellPos, nRow, rSrcCell.GetValue());
@@ -1471,7 +1473,7 @@ class CopyByCloneHandler
             if (rSrcCell.IsMultilineResult())
             {
                 // Clone as an edit text object.
-                EditEngine& rEngine = mrDestCol.GetDoc().GetEditEngine();
+                EditEngine& rEngine = mrDestCol.GetDoc()->GetEditEngine();
                 rEngine.SetText(aStr.getString());
                 maDestPos.miCellPos =
                     mrDestCol.GetCellStore().set(maDestPos.miCellPos, nRow, rEngine.CreateTextObject());
@@ -1557,7 +1559,7 @@ public:
                 ScAddress aSrcPos(mrSrcCol.GetCol(), nRow, mrSrcCol.GetTab());
                 for (; it != itEnd; ++it, aSrcPos.IncRow(), ++nRow)
                 {
-                    if (!canCopyValue(mrSrcCol.GetDoc(), aSrcPos, mnCopyFlags))
+                    if (!canCopyValue(*mrSrcCol.GetDoc(), aSrcPos, mnCopyFlags))
                         continue;
 
                     maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nRow, *it);
@@ -1618,7 +1620,7 @@ public:
                 std::vector<EditTextObject*> aCloned;
                 aCloned.reserve(nDataSize);
                 for (; it != itEnd; ++it)
-                    aCloned.push_back(ScEditUtil::Clone(**it, mrDestCol.GetDoc()));
+                    aCloned.push_back(ScEditUtil::Clone(**it, *mrDestCol.GetDoc()));
 
                 maDestPos.miCellPos = mrDestCol.GetCellStore().set(
                     maDestPos.miCellPos, nRow, aCloned.begin(), aCloned.end());
@@ -1703,8 +1705,8 @@ void ScColumn::CopyToColumn(
             // Compare the ScDocumentPool* to determine if we are copying
             // within the same document. If not, re-intern shared strings.
             svl::SharedStringPool* pSharedStringPool =
-                (pDocument->GetPool() != rColumn.pDocument->GetPool()) ?
-                &rColumn.pDocument->GetSharedStringPool() : nullptr;
+                (GetDoc()->GetPool() != rColumn.GetDoc()->GetPool()) ?
+                &rColumn.GetDoc()->GetSharedStringPool() : nullptr;
             CopyByCloneHandler aFunc(*this, rColumn, rCxt.getBlockPosition(rColumn.nTab, rColumn.nCol), nFlags,
                     pSharedStringPool, bGlobalNamesToLocal);
             aFunc.setStartListening(rCxt.isStartListening());
@@ -1755,6 +1757,7 @@ void ScColumn::CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const
 void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol )
 {
     //  This is the scenario table, the data is copied into it
+    ScDocument* pDocument = GetDoc();
     ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW, pDocument->GetDefPattern() );
     SCROW nStart = -1, nEnd = -1;
     const ScPatternAttr* pPattern = aAttrIter.Next( nStart, nEnd );
@@ -1783,6 +1786,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol )
 void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
 {
     //  This is the scenario table, the data is copied to the other
+    ScDocument* pDocument = GetDoc();
     ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW, pDocument->GetDefPattern() );
     SCROW nStart = -1, nEnd = -1;
     const ScPatternAttr* pPattern = aAttrIter.Next( nStart, nEnd );
@@ -1791,7 +1795,7 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
         if ( static_cast<const ScMergeFlagAttr&>(pPattern->GetItem( ATTR_MERGE_FLAG )).IsScenario() )
         {
             rDestCol.DeleteArea( nStart, nEnd, InsertDeleteFlags::CONTENTS );
-            sc::CopyToDocContext aCxt(*rDestCol.pDocument);
+            sc::CopyToDocContext aCxt(*rDestCol.GetDoc());
             CopyToColumn(aCxt, nStart, nEnd, InsertDeleteFlags::CONTENTS, false, rDestCol);
 
             sc::RefUpdateContext aRefCxt(*pDocument);
@@ -1808,7 +1812,7 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
 bool ScColumn::TestCopyScenarioTo( const ScColumn& rDestCol ) const
 {
     bool bOk = true;
-    ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW, pDocument->GetDefPattern() );
+    ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW, GetDoc()->GetDefPattern() );
     SCROW nStart = 0, nEnd = 0;
     const ScPatternAttr* pPattern = aAttrIter.Next( nStart, nEnd );
     while (pPattern && bOk)
@@ -1826,7 +1830,7 @@ void ScColumn::MarkScenarioIn( ScMarkData& rDestMark ) const
 {
     ScRange aRange( nCol, 0, nTab );
 
-    ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW, pDocument->GetDefPattern() );
+    ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW, GetDoc()->GetDefPattern() );
     SCROW nStart = -1, nEnd = -1;
     const ScPatternAttr* pPattern = aAttrIter.Next( nStart, nEnd );
     while (pPattern)
@@ -1960,6 +1964,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
     rCol.CellStorageModified();
 
     // Broadcast on moved ranges. Area-broadcast only.
+    ScDocument* pDocument = GetDoc();
     ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, 0, nTab));
     ScAddress& rPos = aHint.GetAddress();
     sc::SingleColumnSpanSet::SpansType::const_iterator itRange = aRanges.begin(), itRangeEnd = aRanges.end();
@@ -2388,7 +2393,7 @@ bool ScColumn::UpdateReference( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc
     if (rCxt.meMode == URM_COPY)
         return UpdateReferenceOnCopy(rCxt, pUndoDoc);
 
-    if (IsEmptyData() || pDocument->IsClipOrUndo())
+    if (IsEmptyData() || GetDoc()->IsClipOrUndo())
         // Cells in this column are all empty, or clip or undo doc. No update needed.
         return false;
 
@@ -3137,7 +3142,7 @@ bool ScColumn::IsFormulaDirty( SCROW nRow ) const
 
 void ScColumn::CheckVectorizationState()
 {
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
     CheckVectorizationHandler aFunc;
     sc::ProcessFormula(maCells, aFunc);
 }
@@ -3145,8 +3150,8 @@ void ScColumn::CheckVectorizationState()
 void ScColumn::SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt )
 {
     // is only done documentwide, no FormulaTracking
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
-    SetDirtyHandler aFunc(*pDocument, rCxt);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
+    SetDirtyHandler aFunc(*GetDoc(), rCxt);
     sc::ProcessFormula(maCells, aFunc);
 }
 
@@ -3154,7 +3159,7 @@ void ScColumn::SetDirtyFromClip( SCROW nRow1, SCROW nRow2, sc::ColumnSpanSet& rB
 {
     // Set all formula cells in the range dirty, and pick up all non-formula
     // cells for later broadcasting.  We don't broadcast here.
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
 
     SetDirtyOnRangeHandler aHdl(*this);
     sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aHdl, aHdl);
@@ -3200,7 +3205,7 @@ bool ScColumn::BroadcastBroadcasters( SCROW nRow1, SCROW nRow2, ScHint& rHint )
 void ScColumn::SetDirty( SCROW nRow1, SCROW nRow2, BroadcastMode eMode )
 {
     // broadcasts everything within the range, with FormulaTracking
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
 
     switch (eMode)
     {
@@ -3232,7 +3237,7 @@ void ScColumn::SetDirty( SCROW nRow1, SCROW nRow2, BroadcastMode eMode )
                     // formulas via ScDocument::Broadcast(), which
                     // BroadcastBroadcastersHandler doesn't, so explicitly
                     // track them here.
-                    pDocument->TrackFormulas();
+                    GetDoc()->TrackFormulas();
                 }
             }
             break;
@@ -3241,7 +3246,7 @@ void ScColumn::SetDirty( SCROW nRow1, SCROW nRow2, BroadcastMode eMode )
 
 void ScColumn::SetTableOpDirty( const ScRange& rRange )
 {
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
 
     SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
     SetTableOpDirtyOnRangeHandler aHdl(*this);
@@ -3251,7 +3256,7 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange )
 
 void ScColumn::SetDirtyAfterLoad()
 {
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
     SetDirtyAfterLoadHandler aFunc;
     sc::ProcessFormula(maCells, aFunc);
 }
@@ -3278,14 +3283,14 @@ public:
 
 void ScColumn::SetDirtyIfPostponed()
 {
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
     SetDirtyIfPostponedHandler aFunc;
     sc::ProcessFormula(maCells, aFunc);
 }
 
 void ScColumn::BroadcastRecalcOnRefMove()
 {
-    sc::AutoCalcSwitch aSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aSwitch(*GetDoc(), false);
     RecalcOnRefMoveCollector aFunc;
     sc::ProcessFormula(maCells, aFunc);
     BroadcastCells(aFunc.getDirtyRows(), SC_HINT_DATACHANGED);
@@ -3426,7 +3431,7 @@ void ScColumn::TransferListeners(
     }
 
     // Remove any broadcasters that have no listeners.
-    RemoveEmptyBroadcasterHandler aFuncRemoveEmpty(*pDocument, nCol, nTab);
+    RemoveEmptyBroadcasterHandler aFuncRemoveEmpty(*GetDoc(), nCol, nTab);
     sc::ProcessBroadcaster(maBroadcasters.begin(), maBroadcasters, nRow1, nRow2, aFuncRemoveEmpty);
     aFuncRemoveEmpty.purge();
 }
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 0e68d17ca32e..594f00a922f0 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -129,6 +129,7 @@ long ScColumn::GetNeededSize(
     }
 
     //      conditional formatting
+    ScDocument* pDocument = GetDoc();
     const SfxItemSet* pCondSet = pDocument->GetCondResult( nCol, nRow, nTab );
 
     //The pPattern may change in GetCondResult
@@ -649,6 +650,7 @@ sal_uInt16 ScColumn::GetOptimalColWidth(
 
     sal_uInt16 nWidth = static_cast<sal_uInt16>(nOldWidth*nPPTX);
     bool bFound = false;
+    ScDocument* pDocument = GetDoc();
 
     if ( pParam && pParam->mbSimpleText )
     {   // all the same except for number format
@@ -787,6 +789,7 @@ static sal_uInt16 lcl_GetAttribHeight( const ScPatternAttr& rPattern, sal_uInt16
 void ScColumn::GetOptimalHeight(
     sc::RowHeightContext& rCxt, SCROW nStartRow, SCROW nEndRow, sal_uInt16 nMinHeight, SCROW nMinStart )
 {
+    ScDocument* pDocument = GetDoc();
     ScFlatUInt16RowSegments& rHeights = rCxt.getHeightArray();
     ScAttrIterator aIter( pAttrArray, nStartRow, nEndRow, pDocument->GetDefPattern() );
 
@@ -979,6 +982,7 @@ void ScColumn::GetOptimalHeight(
 
 bool ScColumn::GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& rData) const
 {
+    ScDocument* pDocument = GetDoc();
     bool bStop = false;
     sc::CellStoreType::const_iterator it = maCells.position(nRow).first;
     mdds::mtv::element_t eType = it->type;
@@ -1143,7 +1147,7 @@ public:
 
 void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow )
 {
-    RemoveEditAttribsHandler aFunc(maCells, pDocument);
+    RemoveEditAttribsHandler aFunc(maCells, GetDoc());
     sc::ProcessEditText(maCells.begin(), maCells, nStartRow, nEndRow, aFunc);
     aFunc.commitStrings();
 }
@@ -1419,7 +1423,7 @@ SCROW ScColumn::FindNextVisibleRow(SCROW nRow, bool bForward) const
     {
         nRow++;
         SCROW nEndRow = 0;
-        bool bHidden = pDocument->RowHidden(nRow, nTab, nullptr, &nEndRow);
+        bool bHidden = GetDoc()->RowHidden(nRow, nTab, nullptr, &nEndRow);
         if(bHidden)
             return std::min<SCROW>(MAXROW, nEndRow + 1);
         else
@@ -1429,7 +1433,7 @@ SCROW ScColumn::FindNextVisibleRow(SCROW nRow, bool bForward) const
     {
         nRow--;
         SCROW nStartRow = MAXROW;
-        bool bHidden = pDocument->RowHidden(nRow, nTab, &nStartRow);
+        bool bHidden = GetDoc()->RowHidden(nRow, nTab, &nStartRow);
         if(bHidden)
             return std::max<SCROW>(0, nStartRow - 1);
         else
@@ -1440,6 +1444,7 @@ SCROW ScColumn::FindNextVisibleRow(SCROW nRow, bool bForward) const
 SCROW ScColumn::FindNextVisibleRowWithContent(
     sc::CellStoreType::const_iterator& itPos, SCROW nRow, bool bForward) const
 {
+    ScDocument* pDocument = GetDoc();
     if (bForward)
     {
         do
@@ -1681,7 +1686,7 @@ struct ColumnStorageDumper : std::unary_function<sc::CellStoreType::value_type,
 void ScColumn::DumpColumnStorage() const
 {
     cout << "-- table: " << nTab << "; column: " << nCol << endl;
-    std::for_each(maCells.begin(), maCells.end(), ColumnStorageDumper(pDocument));
+    std::for_each(maCells.begin(), maCells.end(), ColumnStorageDumper(GetDoc()));
     cout << "--" << endl;
 }
 #endif
@@ -1780,9 +1785,9 @@ public:
         SCROW nDestRow = nRow + mnDestOffset;
         ScAddress aSrcPos(mnSrcCol, nRow, mnSrcTab);
         ScAddress aDestPos(mnDestCol, nDestRow, mnDestTab);
-        miPos = mrDestNotes.set(miPos, nDestRow, p->Clone(aSrcPos, mrDestCol.GetDoc(), aDestPos, mbCloneCaption));
+        miPos = mrDestNotes.set(miPos, nDestRow, p->Clone(aSrcPos, *mrDestCol.GetDoc(), aDestPos, mbCloneCaption));
         // Notify our LOK clients also
-        ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, &mrDestCol.GetDoc(), aDestPos, p);
+        ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, mrDestCol.GetDoc(), aDestPos, p);
     }
 };
 
@@ -1795,7 +1800,7 @@ void ScColumn::CopyCellNotesToDocument(
         // The column has no cell notes to copy between specified rows.
         return;
 
-    ScDrawLayer *pDrawLayer = rDestCol.GetDoc().GetDrawLayer();
+    ScDrawLayer *pDrawLayer = rDestCol.GetDoc()->GetDrawLayer();
     bool bWasLocked = bool();
     if (pDrawLayer)
     {
@@ -1905,7 +1910,7 @@ namespace {
 void ScColumn::CellNotesDeleting(SCROW nRow1, SCROW nRow2, bool bForgetCaptionOwnership)
 {
     ScAddress aAddr(nCol, 0, nTab);
-    CellNoteHandler aFunc(pDocument, aAddr, bForgetCaptionOwnership);
+    CellNoteHandler aFunc(GetDoc(), aAddr, bForgetCaptionOwnership);
     sc::ParseNote(maCellNotes.begin(), maCellNotes, nRow1, nRow2, aFunc);
 }
 
@@ -2109,8 +2114,8 @@ formula::FormulaTokenRef ScColumn::ResolveStaticReference( SCROW nRow )
         case sc::element_type_edittext:
         {
             const EditTextObject* pText = sc::edittext_block::at(*it->data, aPos.second);
-            OUString aStr = ScEditUtil::GetString(*pText, pDocument);
-            svl::SharedString aSS( pDocument->GetSharedStringPool().intern(aStr));
+            OUString aStr = ScEditUtil::GetString(*pText, GetDoc());
+            svl::SharedString aSS( GetDoc()->GetSharedStringPool().intern(aStr));
             return formula::FormulaTokenRef(new formula::FormulaStringToken(aSS));
         }
         case sc::element_type_empty:
@@ -2167,7 +2172,7 @@ bool ScColumn::ResolveStaticReference( ScMatrix& rMat, SCCOL nMatCol, SCROW nRow
     if (nRow1 > nRow2)
         return false;
 
-    ToMatrixHandler aFunc(rMat, nMatCol, nRow1, pDocument);
+    ToMatrixHandler aFunc(rMat, nMatCol, nRow1, GetDoc());
     sc::ParseAllNonEmpty(maCells.begin(), maCells, nRow1, nRow2, aFunc);
     return true;
 }
@@ -2369,7 +2374,7 @@ public:
 
 void ScColumn::FillMatrix( ScMatrix& rMat, size_t nMatCol, SCROW nRow1, SCROW nRow2, svl::SharedStringPool* pPool ) const
 {
-    FillMatrixHandler aFunc(rMat, nMatCol, nRow1, nCol, nTab, pDocument, pPool);
+    FillMatrixHandler aFunc(rMat, nMatCol, nRow1, nCol, nTab, GetDoc(), pPool);
     sc::ParseBlock(maCells.begin(), maCells, aFunc, nRow1, nRow2);
 }
 
@@ -2639,6 +2644,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
         return formula::VectorRefArray(formula::VectorRefArray::Invalid);
 
     // See if the requested range is already cached.
+    ScDocument* pDocument = GetDoc();
     sc::FormulaGroupContext& rCxt = *(pDocument->GetFormulaGroupContext());
     sc::FormulaGroupContext::ColArray* pColArray = rCxt.getCachedColArray(nTab, nCol, nRow2+1);
     if (pColArray)
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 156afa94e687..4374d47f66d2 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -72,7 +72,7 @@ using namespace formula;
 void ScColumn::Broadcast( SCROW nRow )
 {
     ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab));
-    pDocument->Broadcast(aHint);
+    GetDoc()->Broadcast(aHint);
 }
 
 void ScColumn::BroadcastCells( const std::vector<SCROW>& rRows, sal_uInt32 nHint )
@@ -81,6 +81,7 @@ void ScColumn::BroadcastCells( const std::vector<SCROW>& rRows, sal_uInt32 nHint
         return;
 
     // Broadcast the changes.
+    ScDocument* pDocument = GetDoc();
     ScHint aHint(nHint, ScAddress(nCol, 0, nTab));
     std::vector<SCROW>::const_iterator itRow = rRows.begin(), itRowEnd = rRows.end();
     for (; itRow != itRowEnd; ++itRow)
@@ -128,7 +129,7 @@ void ScColumn::DeleteContent( SCROW nRow, bool bBroadcast )
     if (it->type == sc::element_type_formula)
     {
         ScFormulaCell* p = sc::formula_block::at(*it->data, aPos.second);
-        p->EndListeningTo(pDocument);
+        p->EndListeningTo(GetDoc());
         sc::SharedFormulaUtil::unshareFormulaCell(aPos, *p);
     }
     maCells.set_empty(nRow, nRow);
@@ -239,7 +240,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize, std::vector<ScAddress>*
         aNonEmptySpans.scan(aBlockPos, *this, nEndRow+1, MAXROW);
     }
 
-    sc::AutoCalcSwitch aACSwitch(*pDocument, false);
+    sc::AutoCalcSwitch aACSwitch(*GetDoc(), false);
 
     // Remove the cells.
     maCells.erase(nStartRow, nEndRow);
@@ -291,9 +292,9 @@ void ScColumn::JoinNewFormulaCell(
 void ScColumn::DetachFormulaCell(
     const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell )
 {
-    if (!pDocument->IsClipOrUndo())
+    if (!GetDoc()->IsClipOrUndo())
         // Have the dying formula cell stop listening.
-        rCell.EndListeningTo(pDocument);
+        rCell.EndListeningTo(GetDoc());
 
     sc::SharedFormulaUtil::unshareFormulaCell(aPos, rCell);
 }
@@ -347,10 +348,10 @@ void ScColumn::DetachFormulaCells(
         sc::SharedFormulaUtil::splitFormulaCellGroup(aPos2, nullptr);
     }
 
-    if (pDocument->IsClipOrUndo())
+    if (GetDoc()->IsClipOrUndo())
         return;
 
-    DetachFormulaCellsHandler aFunc(pDocument, nullptr);
+    DetachFormulaCellsHandler aFunc(GetDoc(), nullptr);
     sc::ProcessFormula(aPos.first, maCells, nRow, nNextTopRow-1, aFunc);
 }
 
@@ -366,7 +367,7 @@ void ScColumn::AttachFormulaCells( sc::StartListeningContext& rCxt, SCROW nRow1,
         sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
     }
 
-    if (pDocument->IsClipOrUndo())
+    if (GetDoc()->IsClipOrUndo())
         return;
 
     AttachFormulaCellsHandler aFunc(rCxt);
@@ -386,10 +387,10 @@ void ScColumn::DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, S
         sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, &rCxt);
     }
 
-    if (pDocument->IsClipOrUndo())
+    if (GetDoc()->IsClipOrUndo())
         return;
 
-    DetachFormulaCellsHandler aFunc(pDocument, &rCxt);
+    DetachFormulaCellsHandler aFunc(GetDoc(), &rCxt);
     sc::ProcessFormula(it, maCells, nRow1, nRow2, aFunc);
 }
 
@@ -427,6 +428,7 @@ void ScColumn::AttachNewFormulaCell(
     // we call StartListeningFromClip and BroadcastFromClip.
     // If we insert into the Clipboard/andoDoc, we do not use a Broadcast.
     // After Import we call CalcAfterLoad and in there Listening.
+    ScDocument* pDocument = GetDoc();
     if (pDocument->IsClipOrUndo() || pDocument->IsInsertingFromOtherDoc())
         return;
 
@@ -473,6 +475,7 @@ void ScColumn::AttachNewFormulaCells( const sc::CellStoreType::position_type& aP
     pCell = sc::formula_block::at(*aPosLast.first->data, aPosLast.second);
     JoinNewFormulaCell(aPosLast, *pCell);
 
+    ScDocument* pDocument = GetDoc();
     if (!pDocument->IsClipOrUndo() && !pDocument->IsInsertingFromOtherDoc())
     {
         sc::StartListeningContext aCxt(*pDocument);
@@ -495,7 +498,7 @@ void ScColumn::BroadcastNewCell( SCROW nRow )
     // we call StartListeningFromClip and BroadcastFromClip.
     // If we insert into the Clipboard/andoDoc, we do not use a Broadcast.
     // After Import we call CalcAfterLoad and in there Listening.
-    if (pDocument->IsClipOrUndo() || pDocument->IsInsertingFromOtherDoc() || pDocument->IsCalcingAfterLoad())
+    if (GetDoc()->IsClipOrUndo() || GetDoc()->IsInsertingFromOtherDoc() || GetDoc()->IsCalcingAfterLoad())
         return;
 
     Broadcast(nRow);
@@ -519,6 +522,7 @@ bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, const sc::
     ScRefCellValue aCell = GetCellValue( itr2, nOffset );
     ScAddress aPos(nCol, nRow, nTab);
 
+    ScDocument* pDocument = GetDoc();
     const SfxItemSet* pCondSet = nullptr;
     ScConditionalFormatList* pCFList = pDocument->GetCondFormList(nTab);
     if (pCFList)
@@ -711,7 +715,7 @@ void ScColumn::DeleteCells(
     sc::SingleColumnSpanSet& rDeleted )
 {
     // Determine which cells to delete based on the deletion flags.
-    DeleteAreaHandler aFunc(*pDocument, nDelFlag, *this);
+    DeleteAreaHandler aFunc(*GetDoc(), nDelFlag, *this);
     sc::CellStoreType::iterator itPos = maCells.position(rBlockPos.miCellPos, nRow1).first;
     sc::ProcessBlock(itPos, maCells, aFunc, nRow1, nRow2);
     aFunc.endFormulas(); // Have the formula cells stop listening.
@@ -844,7 +848,7 @@ class CopyCellsFromClipHandler
         aArr.AddSingleReference(aRef);
 
         mrDestCol.SetFormulaCell(
-            maDestBlockPos, nDestRow, new ScFormulaCell(&mrDestCol.GetDoc(), aDestPos, aArr));
+            maDestBlockPos, nDestRow, new ScFormulaCell(mrDestCol.GetDoc(), aDestPos, aArr));
     }
 
     void duplicateNotes(SCROW nStartRow, size_t nDataSize, bool bCloneCaption )
@@ -1000,7 +1004,7 @@ public:
                         {
                             mrDestCol.SetFormulaCell(
                                 maDestBlockPos, nSrcRow + mnRowOffset,
-                                new ScFormulaCell(rSrcCell, mrDestCol.GetDoc(), aDestPos));
+                                new ScFormulaCell(rSrcCell, *mrDestCol.GetDoc(), aDestPos));
                         }
                     }
                     else if (bNumeric || bDateTime || bString)
@@ -1018,7 +1022,7 @@ public:
                                     insertRefCell(nSrcRow, nSrcRow + mnRowOffset);
                                 else
                                 {
-                                    ScFormulaCell* pErrCell = new ScFormulaCell(&mrDestCol.GetDoc(), aDestPos);
+                                    ScFormulaCell* pErrCell = new ScFormulaCell(mrDestCol.GetDoc(), aDestPos);
                                     pErrCell->SetErrCode(nErr);
                                     mrDestCol.SetFormulaCell(
                                         maDestBlockPos, nSrcRow + mnRowOffset, pErrCell);
@@ -1053,7 +1057,7 @@ public:
                             else if (rSrcCell.IsMultilineResult())
                             {
                                 // Clone as an edit text object.
-                                ScFieldEditEngine& rEngine = mrDestCol.GetDoc().GetEditEngine();
+                                ScFieldEditEngine& rEngine = mrDestCol.GetDoc()->GetEditEngine();
                                 rEngine.SetText(aStr.getString());
                                 mrDestCol.SetEditText(maDestBlockPos, nSrcRow + mnRowOffset, rEngine.CreateTextObject());
                             }
@@ -1134,6 +1138,7 @@ void ScColumn::CopyFromClip(
     if ((rCxt.getInsertFlag() & InsertDeleteFlags::CONTENTS) == InsertDeleteFlags::NONE)
         return;
 
+    ScDocument* pDocument = GetDoc();
     if (rCxt.isAsLink() && rCxt.getInsertFlag() == InsertDeleteFlags::ALL)
     {
         // We also reference empty cells for "ALL"
@@ -1168,7 +1173,7 @@ void ScColumn::CopyFromClip(
 
     // Compare the ScDocumentPool* to determine if we are copying within the
     // same document. If not, re-intern shared strings.
-    svl::SharedStringPool* pSharedStringPool = (rColumn.pDocument->GetPool() != pDocument->GetPool()) ?
+    svl::SharedStringPool* pSharedStringPool = (rColumn.GetDoc()->GetPool() != pDocument->GetPool()) ?
         &pDocument->GetSharedStringPool() : nullptr;
 
     // nRow1 to nRow2 is for destination (this) column. Subtract nDy to get the source range.
@@ -1266,7 +1271,7 @@ class MixDataHandler
         {
             ScAddress aPos(mrDestColumn.GetCol(), nDestRow, mrDestColumn.GetTab());
 
-            ScFormulaCell* pFC = new ScFormulaCell(&mrDestColumn.GetDoc(), aPos);
+            ScFormulaCell* pFC = new ScFormulaCell(mrDestColumn.GetDoc(), aPos);
             pFC->SetErrCode(FormulaError::NoValue);
 
             miNewCellsPos = maNewCells.set(miNewCellsPos, nDestRow-mnRowOffset, pFC);
@@ -1333,7 +1338,7 @@ public:
                 miNewCellsPos = maNewCells.set(
                     miNewCellsPos, nRow-mnRowOffset,
                     new ScFormulaCell(
-                        &mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab()), aArr));
+                        mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab()), aArr));
             }
             break;
             case sc::element_type_string:
@@ -1390,7 +1395,7 @@ public:
                 miNewCellsPos = maNewCells.set(
                     miNewCellsPos, nRow-mnRowOffset,
                     new ScFormulaCell(
-                        &mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab()), aArr));
+                        mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab()), aArr));
             }
             break;
             case sc::element_type_formula:
@@ -1420,7 +1425,7 @@ public:
                 miNewCellsPos = maNewCells.set(
                     miNewCellsPos, nRow-mnRowOffset,
                     new ScFormulaCell(
-                        &mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab()), aArr));
+                        mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab()), aArr));
             }
             break;
             case sc::element_type_string:
@@ -1430,7 +1435,7 @@ public:
                 // Destination cell is not a number. Just take the source cell.
                 ScAddress aDestPos(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab());
                 miNewCellsPos = maNewCells.set(
-                    miNewCellsPos, nRow-mnRowOffset, new ScFormulaCell(*p, mrDestColumn.GetDoc(), aDestPos));
+                    miNewCellsPos, nRow-mnRowOffset, new ScFormulaCell(*p, *mrDestColumn.GetDoc(), aDestPos));
             }
             break;
             default:
@@ -1500,7 +1505,7 @@ public:
                     miNewCellsPos = maNewCells.set(
                         miNewCellsPos, nDestRow-mnRowOffset,
                         new ScFormulaCell(
-                            &mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nDestRow, mrDestColumn.GetTab()), aArr));
+                            mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nDestRow, mrDestColumn.GetTab()), aArr));
                 }
                 break;
                 default:
@@ -1622,7 +1627,7 @@ void ScColumn::MixData(
 
 ScAttrIterator* ScColumn::CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const
 {
-    return new ScAttrIterator( pAttrArray, nStartRow, nEndRow, pDocument->GetDefPattern() );
+    return new ScAttrIterator( pAttrArray, nStartRow, nEndRow, GetDoc()->GetDefPattern() );
 }
 
 namespace {
@@ -1673,7 +1678,7 @@ namespace {
 void applyTextNumFormat( ScColumn& rCol, SCROW nRow, SvNumberFormatter* pFormatter )
 {
     sal_uInt32 nFormat = pFormatter->GetStandardFormat(css::util::NumberFormat::TEXT);
-    ScPatternAttr aNewAttrs(rCol.GetDoc().GetPool());
+    ScPatternAttr aNewAttrs(rCol.GetDoc()->GetPool());
     SfxItemSet& rSet = aNewAttrs.GetItemSet();
     rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
     rCol.ApplyPattern(nRow, aNewAttrs);
@@ -1700,7 +1705,7 @@ bool ScColumn::ParseString(
     sal_uInt32 nOldIndex = 0;
     sal_Unicode cFirstChar;
     if (!aParam.mpNumFormatter)
-        aParam.mpNumFormatter = pDocument->GetFormatTable();
+        aParam.mpNumFormatter = GetDoc()->GetFormatTable();
 
     nIndex = nOldIndex = GetNumberFormat( nRow );
     if ( rString.getLength() > 1
@@ -1709,7 +1714,7 @@ bool ScColumn::ParseString(
     else
         cFirstChar = 0; // Text
 
-    svl::SharedStringPool& rPool = pDocument->GetSharedStringPool();
+    svl::SharedStringPool& rPool = GetDoc()->GetSharedStringPool();
 
     if ( cFirstChar == '=' )
     {
@@ -1726,7 +1731,7 @@ bool ScColumn::ParseString(
         else // = Formula
             rCell.set(
                 new ScFormulaCell(
-                    pDocument, ScAddress(nCol, nRow, nTabP), rString,
+                    GetDoc(), ScAddress(nCol, nRow, nTabP), rString,
                     formula::FormulaGrammar::mergeToGrammar(formula::FormulaGrammar::GRAM_DEFAULT, eConv),
                     MM_NONE));
     }
@@ -1862,7 +1867,7 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const OUString& rString,
 
 void ScColumn::SetEditText( SCROW nRow, EditTextObject* pEditText )
 {
-    pEditText->NormalizeString(pDocument->GetSharedStringPool());
+    pEditText->NormalizeString(GetDoc()->GetSharedStringPool());
     sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
     maCells.set(it, nRow, pEditText);
     maCellTextAttrs.set(nRow, sc::CellTextAttr());
@@ -1873,7 +1878,7 @@ void ScColumn::SetEditText( SCROW nRow, EditTextObject* pEditText )
 
 void ScColumn::SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, EditTextObject* pEditText )
 {
-    pEditText->NormalizeString(pDocument->GetSharedStringPool());
+    pEditText->NormalizeString(GetDoc()->GetSharedStringPool());
     rBlockPos.miCellPos = GetPositionToInsert(rBlockPos.miCellPos, nRow);
     rBlockPos.miCellPos = maCells.set(rBlockPos.miCellPos, nRow, pEditText);
     rBlockPos.miCellTextAttrPos = maCellTextAttrs.set(
@@ -1886,7 +1891,7 @@ void ScColumn::SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, Edit
 
 void ScColumn::SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, const EditTextObject& rEditText )
 {
-    if (pDocument->GetEditPool() == rEditText.GetPool())
+    if (GetDoc()->GetEditPool() == rEditText.GetPool())
     {
         SetEditText(rBlockPos, nRow, rEditText.Clone());
         return;
@@ -1895,7 +1900,7 @@ void ScColumn::SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, cons
     // rats, yet another "spool"
     // Sadly there is no other way to change the Pool than to
     // "spool" the Object through a corresponding Engine
-    EditEngine& rEngine = pDocument->GetEditEngine();
+    EditEngine& rEngine = GetDoc()->GetEditEngine();
     rEngine.SetText(rEditText);
     SetEditText(rBlockPos, nRow, rEngine.CreateTextObject());
     return;
@@ -1903,7 +1908,7 @@ void ScColumn::SetEditText( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, cons
 
 void ScColumn::SetEditText( SCROW nRow, const EditTextObject& rEditText, const SfxItemPool* pEditPool )
 {
-    if (pEditPool && pDocument->GetEditPool() == pEditPool)
+    if (pEditPool && GetDoc()->GetEditPool() == pEditPool)
     {
         SetEditText(nRow, rEditText.Clone());
         return;
@@ -1912,7 +1917,7 @@ void ScColumn::SetEditText( SCROW nRow, const EditTextObject& rEditText, const S
     // rats, yet another "spool"
     // Sadly there is no other way to change the Pool than to
     // "spool" the Object through a corresponding Engine
-    EditEngine& rEngine = pDocument->GetEditEngine();
+    EditEngine& rEngine = GetDoc()->GetEditEngine();
     rEngine.SetText(rEditText);
     SetEditText(nRow, rEngine.CreateTextObject());
     return;
@@ -1923,7 +1928,7 @@ void ScColumn::SetFormula( SCROW nRow, const ScTokenArray& rArray, formula::Form
     ScAddress aPos(nCol, nRow, nTab);
 
     sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
-    ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, rArray, eGram);
+    ScFormulaCell* pCell = new ScFormulaCell(GetDoc(), aPos, rArray, eGram);
     sal_uInt32 nCellFormat = GetNumberFormat(nRow);
     if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
         pCell->SetNeedNumberFormat(true);
@@ -1940,7 +1945,7 @@ void ScColumn::SetFormula( SCROW nRow, const OUString& rFormula, formula::Formul
     ScAddress aPos(nCol, nRow, nTab);
 
     sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
-    ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, rFormula, eGram);
+    ScFormulaCell* pCell = new ScFormulaCell(GetDoc(), aPos, rFormula, eGram);
     sal_uInt32 nCellFormat = GetNumberFormat(nRow);
     if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
         pCell->SetNeedNumberFormat(true);
@@ -1999,7 +2004,7 @@ bool ScColumn::SetFormulaCells( SCROW nRow, std::vector<ScFormulaCell*>& rCells
     // Detach all formula cells that will be overwritten.
     DetachFormulaCells(aPos, rCells.size());
 
-    if (!pDocument->IsClipOrUndo())
+    if (!GetDoc()->IsClipOrUndo())
     {
         for (size_t i = 0, n = rCells.size(); i < n; ++i)
         {
@@ -2056,10 +2061,10 @@ class FilterEntriesHandler
 
     void processCell(SCROW nRow, ScRefCellValue& rCell)
     {
-        SvNumberFormatter* pFormatter = mrColumn.GetDoc().GetFormatTable();
+        SvNumberFormatter* pFormatter = mrColumn.GetDoc()->GetFormatTable();
         OUString aStr;
         sal_uLong nFormat = mrColumn.GetNumberFormat(nRow);
-        ScCellFormat::GetInputString(rCell, nFormat, aStr, *pFormatter, &mrColumn.GetDoc());
+        ScCellFormat::GetInputString(rCell, nFormat, aStr, *pFormatter, mrColumn.GetDoc());
 
         if (rCell.hasString())
         {
@@ -2307,8 +2312,8 @@ bool ScColumn::GetDataEntries(
     // going upward and downward directions in parallel. The start position
     // cell must be skipped.
 
-    StrCellIterator aItrUp(maCells, nStartRow, pDocument);
-    StrCellIterator aItrDown(maCells, nStartRow+1, pDocument);
+    StrCellIterator aItrUp(maCells, nStartRow, GetDoc());
+    StrCellIterator aItrDown(maCells, nStartRow+1, GetDoc());
 
     bool bMoveUp = aItrUp.valid();
     if (!bMoveUp)
@@ -2424,7 +2429,7 @@ void ScColumn::RemoveProtected( SCROW nStartRow, SCROW nEndRow )
     FormulaToValueHandler aFunc;
     sc::CellStoreType::const_iterator itPos = maCells.begin();
 
-    ScAttrIterator aAttrIter( pAttrArray, nStartRow, nEndRow, pDocument->GetDefPattern() );
+    ScAttrIterator aAttrIter( pAttrArray, nStartRow, nEndRow, GetDoc()->GetDefPattern() );
     SCROW nTop = -1;
     SCROW nBottom = -1;
     const ScPatternAttr* pPattern = aAttrIter.Next( nTop, nBottom );
@@ -2450,7 +2455,7 @@ void ScColumn::SetError( SCROW nRow, const FormulaError nError)
     if (!ValidRow(nRow))
         return;
 
-    ScFormulaCell* pCell = new ScFormulaCell(pDocument, ScAddress(nCol, nRow, nTab));
+    ScFormulaCell* pCell = new ScFormulaCell(GetDoc(), ScAddress(nCol, nRow, nTab));
     pCell->SetErrCode(nError);
 
     sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
@@ -2467,7 +2472,7 @@ void ScColumn::SetRawString( SCROW nRow, const OUString& rStr )
     if (!ValidRow(nRow))
         return;
 
-    svl::SharedString aSS = pDocument->GetSharedStringPool().intern(rStr);
+    svl::SharedString aSS = GetDoc()->GetSharedStringPool().intern(rStr);
     if (!aSS.getData())
         return;
 
@@ -2546,7 +2551,7 @@ void ScColumn::GetString( SCROW nRow, OUString& rString ) const
 
     sal_uLong nFormat = GetNumberFormat(nRow);
     Color* pColor = nullptr;
-    ScCellFormat::GetString(aCell, nFormat, rString, &pColor, *(pDocument->GetFormatTable()), pDocument);
+    ScCellFormat::GetString(aCell, nFormat, rString, &pColor, *(GetDoc()->GetFormatTable()), GetDoc());
 }
 
 double* ScColumn::GetValueCell( SCROW nRow )
@@ -2566,7 +2571,7 @@ void ScColumn::GetInputString( SCROW nRow, OUString& rString ) const
 {
     ScRefCellValue aCell = GetCellValue(nRow);
     sal_uLong nFormat = GetNumberFormat(nRow);
-    ScCellFormat::GetInputString(aCell, nFormat, rString, *(pDocument->GetFormatTable()), pDocument);
+    ScCellFormat::GetInputString(aCell, nFormat, rString, *(GetDoc()->GetFormatTable()), GetDoc());
 }
 
 double ScColumn::GetValue( SCROW nRow ) const
@@ -2774,7 +2779,7 @@ class MaxStringLenHandler
         Color* pColor;
         OUString aString;
         sal_uInt32 nFormat = static_cast<const SfxUInt32Item&>(mrColumn.GetAttr(nRow, ATTR_VALUE_FORMAT)).GetValue();
-        ScCellFormat::GetString(rCell, nFormat, aString, &pColor, *mpFormatter, &mrColumn.GetDoc());
+        ScCellFormat::GetString(rCell, nFormat, aString, &pColor, *mpFormatter, mrColumn.GetDoc());
         sal_Int32 nLen = 0;
         if (mbOctetEncoding)
         {
@@ -2801,7 +2806,7 @@ public:
     MaxStringLenHandler(const ScColumn& rColumn, rtl_TextEncoding eCharSet) :
         mnMaxLen(0),
         mrColumn(rColumn),
-        mpFormatter(rColumn.GetDoc().GetFormatTable()),
+        mpFormatter(rColumn.GetDoc()->GetFormatTable()),
         meCharSet(eCharSet),
         mbOctetEncoding(rtl_isOctetTextEncoding(eCharSet))
     {
@@ -2884,7 +2889,7 @@ class MaxNumStringLenHandler
         if (nFormat % SV_COUNTRY_LANGUAGE_OFFSET)
         {
             aSep = mpFormatter->GetFormatDecimalSep(nFormat);
-            ScCellFormat::GetInputString(rCell, nFormat, aString, *mpFormatter, &mrColumn.GetDoc());
+            ScCellFormat::GetInputString(rCell, nFormat, aString, *mpFormatter, mrColumn.GetDoc());
             const SvNumberformat* pEntry = mpFormatter->GetEntry(nFormat);
             if (pEntry)
             {
@@ -2968,7 +2973,7 @@ class MaxNumStringLenHandler
 
 public:
     MaxNumStringLenHandler(const ScColumn& rColumn, sal_uInt16 nMaxGeneralPrecision) :
-        mrColumn(rColumn), mpFormatter(rColumn.GetDoc().GetFormatTable()),
+        mrColumn(rColumn), mpFormatter(rColumn.GetDoc()->GetFormatTable()),
         mnMaxLen(0), mnPrecision(0), mnMaxGeneralPrecision(nMaxGeneralPrecision),
         mbHaveSigned(false)
     {
@@ -3000,7 +3005,7 @@ public:
 sal_Int32 ScColumn::GetMaxNumberStringLen(
     sal_uInt16& nPrecision, SCROW nRowStart, SCROW nRowEnd ) const
 {
-    sal_uInt16 nMaxGeneralPrecision = pDocument->GetDocOptions().GetStdPrecision();
+    sal_uInt16 nMaxGeneralPrecision = GetDoc()->GetDocOptions().GetStdPrecision();
     MaxNumStringLenHandler aFunc(*this, nMaxGeneralPrecision);
     sc::ParseFormulaNumeric(maCells.begin(), maCells, nRowStart, nRowEnd, aFunc);
     nPrecision = aFunc.getPrecision();
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index a50092c0ea9b..b08d0f27049c 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -112,6 +112,7 @@ void ScColumn::DeleteBeforeCopyFromClip(
         return;
 
     // Translate the clip column spans into the destination column, and repeat as needed.
+    ScDocument* pDocument = GetDoc();
     std::vector<sc::RowSpan> aDestSpans;
     SCROW nDestOffset = aRange.mnRow1 - nClipRow1;
     bool bContinue = true;
@@ -197,6 +198,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
     if (!pBlockPos)
         return;
 
+    ScDocument* pDocument = GetDoc();
     bool bSameDocPool = (rCxt.getClipDoc()->GetPool() == pDocument->GetPool());
 
     ScCellValue& rSrcCell = rCxt.getSingleCell(nColOffset);
@@ -549,6 +551,7 @@ void ScColumn::CloneFormulaCell(
                 "ScColumn::CloneFormulaCell - cloning array/matrix with not exactly one column or row as single cell");
     }
 
+    ScDocument* pDocument = GetDoc();
     std::vector<ScFormulaCell*> aFormulas;
     std::vector<sc::RowSpan>::const_iterator itSpan = rRanges.begin(), itSpanEnd = rRanges.end();
     for (; itSpan != itSpanEnd; ++itSpan)
@@ -913,7 +916,7 @@ void ScColumn::PreprocessRangeNameUpdate(
     aOps.insert(ocBad);
     aOps.insert(ocColRowName);
     aOps.insert(ocName);
-    RecompileByOpcodeHandler aFunc(pDocument, aOps, rEndListenCxt, rCompileCxt);
+    RecompileByOpcodeHandler aFunc(GetDoc(), aOps, rEndListenCxt, rCompileCxt);
     std::for_each(aGroups.begin(), aGroups.end(), aFunc);
 }
 
@@ -928,7 +931,7 @@ void ScColumn::PreprocessDBDataUpdate(
     aOps.insert(ocColRowName);
     aOps.insert(ocDBArea);
     aOps.insert(ocTableRef);
-    RecompileByOpcodeHandler aFunc(pDocument, aOps, rEndListenCxt, rCompileCxt);
+    RecompileByOpcodeHandler aFunc(GetDoc(), aOps, rEndListenCxt, rCompileCxt);
     std::for_each(aGroups.begin(), aGroups.end(), aFunc);
 }
 
@@ -938,7 +941,7 @@ void ScColumn::CompileHybridFormula(
     // Collect all formula groups.
     std::vector<sc::FormulaGroupEntry> aGroups = GetFormulaGroupEntries();
 
-    CompileHybridFormulaHandler aFunc(pDocument, rStartListenCxt, rCompileCxt);
+    CompileHybridFormulaHandler aFunc(GetDoc(), rStartListenCxt, rCompileCxt);
     std::for_each(aGroups.begin(), aGroups.end(), aFunc);
 }
 
@@ -980,15 +983,15 @@ private:
             const ScCondFormatItem& rItem =
                 static_cast<const ScCondFormatItem&>(pPat->GetItem(ATTR_CONDITIONAL));
             const std::vector<sal_uInt32>& rData = rItem.GetCondFormatData();
-            pCondSet = mrCol.GetDoc().GetCondResult(rCell, maPos, *mpCFList, rData);
+            pCondSet = mrCol.GetDoc()->GetCondResult(rCell, maPos, *mpCFList, rData);
         }
 
         OUString aStr;
         Color* pColor;
         sal_uLong nFormat = pPat->GetNumberFormat(mpFormatter, pCondSet);
-        ScCellFormat::GetString(rCell, nFormat, aStr, &pColor, *mpFormatter, &mrCol.GetDoc());
+        ScCellFormat::GetString(rCell, nFormat, aStr, &pColor, *mpFormatter, mrCol.GetDoc());
 
-        rAttr.mnScriptType = mrCol.GetDoc().GetStringScriptType(aStr);
+        rAttr.mnScriptType = mrCol.GetDoc()->GetStringScriptType(aStr);
         mbUpdated = true;
     }
 
@@ -997,8 +1000,8 @@ public:
         mrCol(rCol),
         mrTextAttrs(rCol.GetCellAttrStore()),
         miPosAttr(mrTextAttrs.begin()),
-        mpCFList(rCol.GetDoc().GetCondFormList(rCol.GetTab())),
-        mpFormatter(rCol.GetDoc().GetFormatTable()),
+        mpCFList(rCol.GetDoc()->GetCondFormList(rCol.GetTab())),
+        mpFormatter(rCol.GetDoc()->GetFormatTable()),
         maPos(rCol.GetCol(), 0, rCol.GetTab()),
         mbUpdated(false)
     {}
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index b02004948ac9..90b2aced24af 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -945,9 +945,9 @@ bool ScCellIterator::getCurrent()
         SCROW nLastRow;
         // Skip all filtered or hidden rows, depending on mSubTotalFlags
         if ( ( ( mnSubTotalFlags & SubtotalFlags::IgnoreFiltered ) &&
-               pCol->GetDoc().RowFiltered(maCurPos.Row(), maCurPos.Tab(), nullptr, &nLastRow) ) ||
+               pCol->GetDoc()->RowFiltered(maCurPos.Row(), maCurPos.Tab(), nullptr, &nLastRow) ) ||
              ( ( mnSubTotalFlags & SubtotalFlags::IgnoreHidden ) &&
-               pCol->GetDoc().RowHidden(maCurPos.Row(), maCurPos.Tab(), nullptr, &nLastRow) ) )
+               pCol->GetDoc()->RowHidden(maCurPos.Row(), maCurPos.Tab(), nullptr, &nLastRow) ) )
         {
             setPos(nLastRow+1);
             continue;
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 81cfd9c277b0..1b2b77e42f07 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -151,7 +151,7 @@ void setSuffixCell(
     ScColumn& rColumn, SCROW nRow, sal_Int32 nValue, sal_uInt16 nDigits, const OUString& rSuffix,
     CellType eCellType, bool bIsOrdinalSuffix )
 {
-    ScDocument& rDoc = rColumn.GetDoc();
+    ScDocument& rDoc = *rColumn.GetDoc();
     OUString aValue = lcl_ValueString(nValue, nDigits);
     if (!bIsOrdinalSuffix)
     {
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index fe37938210b0..aefdbdde7af4 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2855,7 +2855,7 @@ public:
                 case CELLTYPE_STRING:
                 case CELLTYPE_EDIT:
                 {
-                    OUString aStr = aCell.getString(&mpCurCol->GetDoc());
+                    OUString aStr = aCell.getString(mpCurCol->GetDoc());
                     svl::SharedString aSS = mrStrPool.intern(aStr);
                     pTok.reset(new formula::FormulaStringToken(aSS));
                 }
commit f9e04f91d5a12b5c395a3b23176c81d809713e4f
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Sat Dec 2 12:20:18 2017 -0500

    Initialize more for sharing during pre-init
    
    And remove dictionary pre-loading as
    it's not needed in this branch.
    
    Change-Id: Ieec3570393315bdc33f52467a826ca9ecfe8cb8a

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f717b3b4d894..3b10d583409e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -54,6 +54,7 @@
 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <com/sun/star/document/XRedlinesSupplier.hpp>
+#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
 
 #include <com/sun/star/linguistic2/LinguServiceManager.hpp>
 #include <com/sun/star/linguistic2/XSpellChecker.hpp>
@@ -76,11 +77,13 @@
 #include <tools/resmgr.hxx>
 #include <tools/fract.hxx>
 #include <svtools/ctrltool.hxx>
+#include <svtools/langtab.hxx>
 #include <vcl/fontcharmap.hxx>
 #include <vcl/graphicfilter.hxx>
 #include <vcl/ptrstyle.hxx>
 #include <vcl/sysdata.hxx>
 #include <vcl/virdev.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/ITiledRenderable.hxx>
 #include <unicode/uchar.h>
 #include <unotools/configmgr.hxx>
@@ -91,6 +94,7 @@
 #include <sfx2/sfxbasemodel.hxx>
 #include <svl/undo.hxx>
 #include <unotools/datetime.hxx>
+#include <i18nlangtag/languagetag.hxx>
 
 #include <app.hxx>
 
@@ -3187,21 +3191,19 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
 /// Used only by LibreOfficeKit when used by Online to pre-initialize
 static void preloadData()
 {
-    // First: sit down and read all dictionaries: yum.
-    css::uno::Reference<css::linguistic2::XLinguServiceManager> xLngSvcMgr =
-        css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext());
-    css::uno::Reference<linguistic2::XSpellChecker> xSpellChecker(xLngSvcMgr->getSpellChecker());
+    css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg;
+    xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create(
+        comphelper::getProcessComponentContext());
+    xGlobalCfg->getAllKeyEvents();
 
-    css::uno::Reference<linguistic2::XSupportedLocales> xLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
-    uno::Sequence< css::lang::Locale > aLocales = xLocales->getLocales();
-    std::cerr << "Preloading dictionaries: ";
-    for (auto &it : aLocales)
-    {
-        std::cerr << it.Language << "_" << it.Country << " ";
-        css::beans::PropertyValues aNone;
-        xSpellChecker->isValid("forcefed", it, aNone);
-    }
-    std::cerr << "\n";
+    std::cerr << "Preload icons\n";
+    ImageTree &images = ImageTree::get();
+    images.getImageUrl("forcefed.png", "style", "FO_oo");
+
+    std::cerr << "Preload languages\n";
+    // force load language singleton
+    SvtLanguageTable::HasLanguageType(LANGUAGE_SYSTEM);
+    LanguageTag::isValidBcp47("foo");
 }
 
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)
diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx
index 5104c242c791..6db06f656edf 100644
--- a/framework/source/accelerators/globalacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx
@@ -19,6 +19,7 @@
 
 #include <accelerators/acceleratorconfiguration.hxx>
 #include <accelerators/presethandler.hxx>
+#include <accelerators/keymapping.hxx>
 #include <helper/mischelper.hxx>
 
 #include <acceleratorconst.h>
@@ -90,6 +91,8 @@ private:
 GlobalAcceleratorConfiguration::GlobalAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
     : GlobalAcceleratorConfiguration_BASE(xContext)
 {
+    // force keyboard string registration.
+    KeyMapping::get();
 }
 
 void GlobalAcceleratorConfiguration::fillCache()
commit 354bcbd17e9fe09fa2c1ad5803123c8f7b4acc53
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Nov 24 17:05:26 2017 +0000

    LOK: provide user feedback while preloading.
    
    Problems are hard enough to debug in a jailed kit process inside
    a docker image; provide some visual feedback via stderr.
    
    Change-Id: I54b0a21c1375be2acc9da0bbacf959a419471b08
    Reviewed-on: https://gerrit.libreoffice.org/45256
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 1aedb6c4345719a963a883b13fa983db3ab4b9a8)

diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 22411286a2b7..0b2e5c0f668f 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -10,6 +10,7 @@
 #include <sal/config.h>
 
 #include <algorithm>
+#include <iostream>
 #include <cassert>
 #include <vector>
 
@@ -40,6 +41,7 @@
 #include <rtl/uri.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
 #include <uno/environment.hxx>
 
@@ -1906,6 +1908,33 @@ cppuhelper::ServiceManager::findServiceImplementation(
     return impl;
 }
 
+/// Make a simpler unique name for preload / progress reporting.
+static rtl::OUString simplifyModule(const rtl::OUString &uri)
+{
+    sal_Int32 nIdx;
+    OUStringBuffer edit(uri);
+    if ((nIdx = edit.lastIndexOf('/')) > 0)
+        edit.remove(0,nIdx+1);
+    if ((nIdx = edit.lastIndexOf(':')) > 0)
+        edit.remove(0,nIdx+1);
+    if ((nIdx = edit.lastIndexOf("lo.so")) > 0)
+        edit.truncate(nIdx);
+    if ((nIdx = edit.lastIndexOf(".3")) > 0)
+        edit.truncate(nIdx);
+    if ((nIdx = edit.lastIndexOf("gcc3.so")) > 0)
+        edit.truncate(nIdx);
+    if ((nIdx = edit.lastIndexOf(".so")) > 0)
+        edit.truncate(nIdx);
+    if ((nIdx = edit.lastIndexOf("_uno")) > 0)
+        edit.truncate(nIdx);
+    if ((nIdx = edit.lastIndexOf(".jar")) > 0)
+        edit.truncate(nIdx);
+    if (edit.indexOf("lib") == 0)
+        edit.remove(0,3);
+    return edit.makeStringAndClear();
+}
+
+/// Used only by LibreOfficeKit when used by Online to pre-initialize
 void cppuhelper::ServiceManager::preloadImplementations() {
 #ifdef DISABLE_DYNLOADING
     abort();
@@ -1914,6 +1943,9 @@ void cppuhelper::ServiceManager::preloadImplementations() {
     osl::MutexGuard g(rBHelper.rMutex);
     css::uno::Environment aSourceEnv(css::uno::Environment::getCurrent());
 
+    std::cerr << "preload: ";
+    std::vector<OUString> aReported;
+
     // loop all implementations
     for (Data::NamedImplementations::const_iterator iterator(
             data_.namedImplementations.begin());
@@ -1921,8 +1953,15 @@ void cppuhelper::ServiceManager::preloadImplementations() {
     {
         try
         {
+            const rtl::OUString &aLibrary = iterator->second->info->uri;
+            if (std::find(aReported.begin(), aReported.end(), aLibrary) == aReported.end())
+            {
+                std::cerr << simplifyModule(aLibrary) << " ";
+                aReported.push_back(aLibrary);
+            }
+
             // expand absolute URI implementation component library
-            aUri = cppu::bootstrap_expandUri(iterator->second->info->uri);
+            aUri = cppu::bootstrap_expandUri(aLibrary);
         }
         catch (css::lang::IllegalArgumentException& aError)
         {
@@ -2014,6 +2053,7 @@ void cppuhelper::ServiceManager::preloadImplementations() {
             aModule.release();
         }
     }
+    std::cerr << std::endl;
 #endif
 }
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e91a84e9142a..f717b3b4d894 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -14,6 +14,7 @@
 #include <stdlib.h>
 
 #include <memory>
+#include <iostream>
 #include <boost/property_tree/json_parser.hpp>
 
 #include <LibreOfficeKit/LibreOfficeKit.h>
@@ -3183,6 +3184,7 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
     }
 }
 
+/// Used only by LibreOfficeKit when used by Online to pre-initialize
 static void preloadData()
 {
     // First: sit down and read all dictionaries: yum.
@@ -3192,14 +3194,14 @@ static void preloadData()
 
     css::uno::Reference<linguistic2::XSupportedLocales> xLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
     uno::Sequence< css::lang::Locale > aLocales = xLocales->getLocales();
-    SAL_INFO("lok", "Preloading #" << aLocales.getLength() << " dictionaries");
+    std::cerr << "Preloading dictionaries: ";
     for (auto &it : aLocales)
     {
-        SAL_INFO("lok", "    load " << it.Language << "_" << it.Country);
+        std::cerr << it.Language << "_" << it.Country << " ";
         css::beans::PropertyValues aNone;
         xSpellChecker->isValid("forcefed", it, aNone);
     }
-    SAL_INFO("lok", "Preloading done");
+    std::cerr << "\n";
 }
 
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)
@@ -3294,6 +3296,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
 
             if (eStage == PRE_INIT)
             {
+                std::cerr << "Init vcl\n";
                 InitVCL();
 
                 // pre-load all component libraries.
commit 3866a5a8cb5335736791ceb806ba1b0401fe50e8
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Wed Sep 13 16:16:11 2017 +0100

    Pre-load dictionaries for online.
    
    Change-Id: Ied81f20900060ff6a78704fa9195320b8fb86e45
    Reviewed-on: https://gerrit.libreoffice.org/42269
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 91cf85936aff8bcc3b837584a834a0f2d9f3ed3a)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0ac96864044f..e91a84e9142a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -54,6 +54,9 @@
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <com/sun/star/document/XRedlinesSupplier.hpp>
 
+#include <com/sun/star/linguistic2/LinguServiceManager.hpp>
+#include <com/sun/star/linguistic2/XSpellChecker.hpp>
+
 #include <editeng/fontitem.hxx>
 #include <editeng/flstitem.hxx>
 #include <sfx2/objsh.hxx>
@@ -3180,6 +3183,25 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
     }
 }
 
+static void preloadData()
+{
+    // First: sit down and read all dictionaries: yum.
+    css::uno::Reference<css::linguistic2::XLinguServiceManager> xLngSvcMgr =
+        css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext());
+    css::uno::Reference<linguistic2::XSpellChecker> xSpellChecker(xLngSvcMgr->getSpellChecker());
+
+    css::uno::Reference<linguistic2::XSupportedLocales> xLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
+    uno::Sequence< css::lang::Locale > aLocales = xLocales->getLocales();
+    SAL_INFO("lok", "Preloading #" << aLocales.getLength() << " dictionaries");
+    for (auto &it : aLocales)
+    {
+        SAL_INFO("lok", "    load " << it.Language << "_" << it.Country);
+        css::beans::PropertyValues aNone;
+        xSpellChecker->isValid("forcefed", it, aNone);
+    }
+    SAL_INFO("lok", "Preloading done");
+}
+
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)
 {
     enum {
@@ -3294,6 +3316,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
                 // 3) InitVCL()
                 aService->initialize({css::uno::makeAny<OUString>("preload")});
 
+                preloadData();
+
                 // Release Solar Mutex, lo_startmain thread should acquire it.
                 Application::ReleaseSolarMutex();
             }
commit 48302044cfa53755fd3413aa5386ffc9eb6a6ffb
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Nov 30 18:59:30 2017 +0000

    sal: add pre-initialization scheme for allocations.
    
    This saves several megabytes of dirtied pages for each LOK
    client of Online.
    
    Change-Id: I425a2e7896879f0a64d71fcc0655e9e1fa1256aa

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2a7101b69609..0ac96864044f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3204,6 +3204,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
     if (bInitialized)
         return 1;
 
+    if (eStage == PRE_INIT)
+        rtl_alloc_preInit(sal_True);
+
     if (eStage != SECOND_INIT)
         comphelper::LibreOfficeKit::setActive();
 
@@ -3341,6 +3344,10 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
         fprintf(stderr, "Bootstrapping exception '%s'\n",
                  OUStringToOString(exception.Message, RTL_TEXTENCODING_UTF8).getStr());
     }
+
+    if (eStage == PRE_INIT)
+        rtl_alloc_preInit(sal_False);
+
     return bInitialized;
 }
 
diff --git a/include/rtl/alloc.h b/include/rtl/alloc.h
index ccb8d4183b20..4d8ff69d45a8 100644
--- a/include/rtl/alloc.h
+++ b/include/rtl/alloc.h
@@ -294,6 +294,23 @@ SAL_DLLPUBLIC void SAL_CALL rtl_cache_free (
 ) SAL_THROW_EXTERN_C();
 
 
+#ifdef LIBO_INTERNAL_ONLY
+
+/** rtl_alloc_preInit
+ *
+ * This function, is called at the beginning and again
+ * at the end of LibreOfficeKit pre-initialization to enable
+ * various optimizations. It is almost certainly not the method
+ * that you want.
+ *
+ * @since LibreOffice 6.1
+ */
+SAL_DLLPUBLIC void SAL_CALL rtl_alloc_preInit (
+    sal_Bool start
+) SAL_THROW_EXTERN_C();
+
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx
index ed0a9def1dbe..9ea21456ca94 100644
--- a/sal/qa/rtl/alloc/rtl_alloc.cxx
+++ b/sal/qa/rtl/alloc/rtl_alloc.cxx
@@ -18,11 +18,14 @@
  */
 
 #include <rtl/alloc.h>
+#include <rtl/ustrbuf.hxx>
 #include <sal/types.h>
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
 
+#define SAL_STRING_STATIC_FLAG 0x40000000
+
 #include <memory.h>
 
 namespace rtl_alloc
@@ -132,8 +135,75 @@ public:
     CPPUNIT_TEST_SUITE_END();
 };
 
+class TestPreinit : public CppUnit::TestFixture
+{
+public:
+    TestPreinit()
+    {
+    }
+
+    // initialise your test code values here.
+    void setUp() override
+    {
+    }
+
+    void tearDown() override
+    {
+    }
+
+    // insert your test code here.
+
+    void test()
+    {
+        const char *sample = "Hello World";
+        std::vector<OUString> aStrings;
+
+        rtl_alloc_preInit(true);
+
+        OUString aFoo("foo");
+
+        // fill some cache bits
+        for (int iter = 0; iter < 4; iter++)
+        {
+            for (int i = 1; i < 4096; i += 8)
+            {
+                OUStringBuffer aBuf(i);
+                aBuf.appendAscii(sample, (i/8) % (sizeof(sample)-1));
+                OUString aStr = aBuf.makeStringAndClear();
+                aStrings.push_back(aStr);
+            }
+            // free some pieces to make holes
+            for (size_t i = iter; i < aStrings.size(); i += 17)
+                aStrings[i] = aFoo;
+        }
+
+        for (size_t i = 0; i < aStrings.size(); ++i)
+        {
+            CPPUNIT_ASSERT_MESSAGE( "not static before.", !(aStrings[i].pData->refCount & SAL_STRING_STATIC_FLAG) );
+        }
+
+        // should static-ize all the strings.
+        rtl_alloc_preInit(false);
+
+        for (size_t i = 0; i < aStrings.size(); ++i)
+            CPPUNIT_ASSERT_MESSAGE( "static after.", (aStrings[i].pData->refCount & SAL_STRING_STATIC_FLAG) );
+    }
+
+    void test2()
+    {
+        // should never happen but lets try it again.
+        test();
+    }
+
+    CPPUNIT_TEST_SUITE(TestPreinit);
+    CPPUNIT_TEST(test);
+    CPPUNIT_TEST(test2);
+    CPPUNIT_TEST_SUITE_END();
+};
+
 CPPUNIT_TEST_SUITE_REGISTRATION(rtl_alloc::Memory);
 CPPUNIT_TEST_SUITE_REGISTRATION(rtl_alloc::TestZeroMemory);
+CPPUNIT_TEST_SUITE_REGISTRATION(rtl_alloc::TestPreinit);
 } // namespace rtl_alloc
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index 234a3d5c6755..6e0a55dbb886 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
+
 #include "alloc_arena.hxx"
 
 #include "alloc_impl.hxx"
@@ -728,6 +730,35 @@ rtl_arena_activate (
     return arena;
 }
 
+extern "C" {
+void rtl_arena_foreach(rtl_arena_type *arena, ArenaForeachFn foreachFn, void *user_data) SAL_THROW_EXTERN_C()
+{
+    // quantum caches
+    if ((arena->m_qcache_max > 0) && (arena->m_qcache_ptr != nullptr))
+    {
+        int i, n = (arena->m_qcache_max >> arena->m_quantum_shift);
+        for (i = 1; i <= n; i++)
+        {
+            if (arena->m_qcache_ptr[i - 1] != nullptr)
+                rtl_cache_foreach (arena->m_qcache_ptr[i - 1],
+                                   foreachFn, user_data);
+        }
+    }
+
+    /* used segments */
+    for (int i = 0, n = arena->m_hash_size; i < n; i++)
+    {
+        for (rtl_arena_segment_type *segment = arena->m_hash_table[i];
+             segment != nullptr; segment = segment->m_fnext)
+        {
+            foreachFn(reinterpret_cast<void *>(segment->m_addr),
+                      segment->m_size, user_data);
+        }
+    }
+}
+} // extern "C"
+
+
 /** rtl_arena_deactivate()
  */
 void
diff --git a/sal/rtl/alloc_arena.hxx b/sal/rtl/alloc_arena.hxx
index da2ebeacc683..85a0b4b8c0b3 100644
--- a/sal/rtl/alloc_arena.hxx
+++ b/sal/rtl/alloc_arena.hxx
@@ -112,6 +112,14 @@ struct rtl_arena_st
  */
 extern rtl_arena_type * gp_default_arena;
 
+extern "C" {
+
+typedef void (*ArenaForeachFn)(void *addr, sal_Size size, void *user_data);
+void SAL_CALL rtl_arena_foreach(rtl_arena_type *arena, ArenaForeachFn fn, void *user_data) SAL_THROW_EXTERN_C();
+void SAL_CALL rtl_cache_foreach(rtl_cache_type *arena, ArenaForeachFn foreachFn, void *user_data) SAL_THROW_EXTERN_C();
+
+}
+
 #endif // INCLUDED_SAL_RTL_ALLOC_ARENA_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
index d91908879c70..e6c7ddad24c7 100644
--- a/sal/rtl/alloc_cache.cxx
+++ b/sal/rtl/alloc_cache.cxx
@@ -1290,6 +1290,26 @@ SAL_CALL rtl_cache_free (
     }
 }
 
+// FIXME: foreachFn called for free'd blocks and will break free-chains.
+extern "C" {
+void SAL_CALL rtl_cache_foreach(rtl_cache_type *cache, ArenaForeachFn foreachFn, void *user_data) SAL_THROW_EXTERN_C()
+{
+    for (rtl_cache_slab_type *cur = &(cache->m_used_head);
+         cur && cur->m_slab_next != &(cache->m_used_head);
+         cur = cur->m_slab_next)
+    {
+        for (char *item = reinterpret_cast<char *>(cur->m_data);
+             item < reinterpret_cast<char *>(cur->m_bp);
+             item += cache->m_type_size)
+        {
+            foreachFn(item, cache->m_type_size, user_data);
+        }
+    }
+
+    RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock));
+}
+} // extern "C"
+
 #if defined(SAL_UNX)
 
 void SAL_CALL
diff --git a/sal/rtl/alloc_global.cxx b/sal/rtl/alloc_global.cxx
index 703a42b0902a..3f0ad42d928c 100644
--- a/sal/rtl/alloc_global.cxx
+++ b/sal/rtl/alloc_global.cxx
@@ -381,6 +381,8 @@ void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
     }
 }
 
+/* ================================================================= */
+
 void* SAL_CALL rtl_allocateAlignedMemory (sal_Size Alignment, sal_Size Bytes) SAL_THROW_EXTERN_C()
 {
     return osl_aligned_alloc(Alignment, Bytes);
@@ -391,6 +393,4 @@ void SAL_CALL rtl_freeAlignedMemory (void* Ptr) SAL_THROW_EXTERN_C()
     osl_aligned_free(Ptr);
 }
 
-/* ================================================================= */
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/strimp.cxx b/sal/rtl/strimp.cxx
index db554644f6a9..39b08a4ff2c3 100644
--- a/sal/rtl/strimp.cxx
+++ b/sal/rtl/strimp.cxx
@@ -16,8 +16,15 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+#include "sal/config.h"
+
+#include <assert.h>
+#include <rtl/alloc.h>
+#include <rtl/ustring.h>
 
 #include "strimp.hxx"
+#include "alloc_impl.hxx"
+#include "alloc_arena.hxx"
 
 sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix )
 {
@@ -49,4 +56,65 @@ bool rtl_ImplIsWhitespace( sal_Unicode c )
     return false;
 }
 
+/*
+ * TODO: add a slower, more awful, but more space efficient
+ * custom allocator for the pre-init phase. Existing slab
+ * allocator's minimum alloc size is 24bytes, and by default
+ * is 32bits.
+ */
+static rtl_arena_type *pre_arena = nullptr;
+
+rtl_allocateStringFn rtl_allocateString = rtl_allocateMemory;
+rtl_freeStringFn rtl_freeString = rtl_freeMemory;
+
+extern "C" {
+static void *pre_allocateStringFn(sal_Size n)
+{
+    sal_Size size = RTL_MEMORY_ALIGN(n + 4, 4);
+    char *addr = static_cast<char*>(rtl_arena_alloc(pre_arena, &size));
+    assert(size>= 12);
+    reinterpret_cast<sal_uInt32*>(addr)[0] = size - 12;
+    return addr + 4;
+}
+
+static void pre_freeStringFn(void *data)
+{
+    char    *addr = static_cast<char*>(data) - 4;
+    sal_Size size = reinterpret_cast<sal_uInt32*>(addr)[0] + 12;
+
+    rtl_arena_free(pre_arena, addr, size);
+}
+
+static void mark_static(void *addr, sal_Size /* size */, void *)
+{
+    char *inner = static_cast<char*>(addr) + 4;
+    rtl_uString *str = reinterpret_cast<rtl_uString *>(inner);
+    str->refCount |= SAL_STRING_STATIC_FLAG;
+}
+} // extern "C"
+
+void SAL_CALL rtl_alloc_preInit (sal_Bool start) SAL_THROW_EXTERN_C()
+{
+    if (getenv("SAL_DISABLE_PREINIT"))
+        return;
+
+    if (start)
+    {
+        rtl_allocateString = pre_allocateStringFn;
+        rtl_freeString = pre_freeStringFn;
+        pre_arena = rtl_arena_create("pre-init strings", 4, 0,
+                                     nullptr, rtl_arena_alloc,
+                                     rtl_arena_free, 0);
+    }
+    else // back to normal
+    {
+        rtl_arena_foreach(pre_arena, mark_static, nullptr);
+        rtl_allocateString = rtl_allocateMemory;
+        rtl_freeString = rtl_freeMemory;
+
+        // TODO: also re-intialize main allocator as well.
+    }
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/strimp.hxx b/sal/rtl/strimp.hxx
index 5583a82f2249..3089a516ad97 100644
--- a/sal/rtl/strimp.hxx
+++ b/sal/rtl/strimp.hxx
@@ -49,6 +49,12 @@ sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix );
 
 bool rtl_ImplIsWhitespace( sal_Unicode c );
 
+typedef void *(*rtl_allocateStringFn)(sal_Size size);
+typedef void  (*rtl_freeStringFn)(void *);
+
+extern rtl_allocateStringFn rtl_allocateString;
+extern rtl_freeStringFn rtl_freeString;
+
 // string lifetime instrumentation / diagnostics
 #if USE_SDT_PROBES
 #  define PROBE_SNAME(n,b) n ## _ ## b
diff --git a/sal/rtl/string.cxx b/sal/rtl/string.cxx
index 863d6b870b3e..3678865c07f6 100644
--- a/sal/rtl/string.cxx
+++ b/sal/rtl/string.cxx
@@ -274,7 +274,7 @@ bool SAL_CALL rtl_impl_convertUStringToString(rtl_String ** pTarget,
                                                    &nInfo, &nSrcChars );
             if (bCheckErrors && (nInfo & RTL_UNICODETOTEXT_INFO_ERROR) != 0)
             {
-                rtl_freeMemory(pTemp);
+                rtl_freeString(pTemp);
                 rtl_destroyUnicodeToTextConverter(hConverter);
                 return false;
             }
@@ -283,7 +283,7 @@ bool SAL_CALL rtl_impl_convertUStringToString(rtl_String ** pTarget,
                 break;
 
             /* Buffer not big enough, try again with enough space */
-            rtl_freeMemory( pTemp );
+            rtl_freeString( pTemp );
 
             /* Try with the max. count of characters with
                additional overhead for replacing functionality */
@@ -298,7 +298,7 @@ bool SAL_CALL rtl_impl_convertUStringToString(rtl_String ** pTarget,
             rtl_String* pTemp2 = rtl_string_ImplAlloc( nDestBytes );
             OSL_ASSERT(pTemp2 != nullptr);
             rtl_str_ImplCopy( pTemp2->buffer, pTemp->buffer, nDestBytes );
-            rtl_freeMemory( pTemp );
+            rtl_freeString( pTemp );
             pTemp = pTemp2;
         }
         else
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx
index 6748209fb50f..2bc1a71d5372 100644
--- a/sal/rtl/strtmpl.cxx
+++ b/sal/rtl/strtmpl.cxx
@@ -1149,7 +1149,7 @@ static IMPL_RTL_STRINGDATA* IMPL_RTL_STRINGNAME( ImplAlloc )( sal_Int32 nLen )
         = (sal::static_int_cast< sal_uInt32 >(nLen)
            <= ((SAL_MAX_UINT32 - sizeof (IMPL_RTL_STRINGDATA))
                / sizeof (IMPL_RTL_STRCODE)))
-        ? static_cast<IMPL_RTL_STRINGDATA *>(rtl_allocateMemory(
+        ? static_cast<IMPL_RTL_STRINGDATA *>(rtl_allocateString(
             sizeof (IMPL_RTL_STRINGDATA) + nLen * sizeof (IMPL_RTL_STRCODE)))
         : nullptr;
     if (pData != nullptr) {
@@ -1230,7 +1230,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis )
     if ( !osl_atomic_decrement( &(pThis->refCount) ) )
     {
         RTL_LOG_STRING_DELETE( pThis );
-        rtl_freeMemory( pThis );
+        rtl_freeString( pThis );
     }
 }
 
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx
index 3d157270ef3c..a518bffc2f58 100644
--- a/sal/rtl/ustring.cxx
+++ b/sal/rtl/ustring.cxx
@@ -819,7 +819,7 @@ retry:
                code here. Could be the case for apple encodings */
             while ( nInfo & RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL )
             {
-                rtl_freeMemory( pTemp );
+                rtl_freeString( pTemp );
                 nNewLen += 8;
                 pTemp = rtl_uString_ImplAlloc( nNewLen );
                 if (pTemp == nullptr) {
@@ -848,7 +848,7 @@ retry:
             if (pTemp2 != nullptr)
             {
                 rtl_str_ImplCopy(pTemp2->buffer, pTemp->buffer, nDestChars);
-                rtl_freeMemory(pTemp);
+                rtl_freeString(pTemp);
                 pTemp = pTemp2;
             }
             else
@@ -932,7 +932,7 @@ static void rtl_ustring_intern_internal( rtl_uString ** newStr,
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list