office-gobmx/sc/inc/rowheightcontext.hxx
Noel Grandin 68547fa268 tdf#88109 speed up calc autofill
switch from ScFlatUInt16RowSegments to ScCompressedArray

The problem with the underlying mdds::flat_segment_tree data structure
is that it is optimised for bulk-load and then frequent read.
But here we are interleaving reading and updating the data, which means
flat_segment_tree spends a lot of time in its build_tree code.

Change-Id: Ic0d46834a2449e4fa9f84343971417adb48ba2de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94694
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-25 15:55:15 +02:00

66 lines
1.7 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SC_INC_ROWHEIGHTCONTEXT_HXX
#define INCLUDED_SC_INC_ROWHEIGHTCONTEXT_HXX
#include "scdllapi.h"
#include <tools/fract.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/outdev.hxx>
#include "compressedarray.hxx"
#include "types.hxx"
using RowHeightsArray = ScCompressedArray<SCROW, sal_uInt16>;
namespace sc {
class SC_DLLPUBLIC RowHeightContext
{
RowHeightsArray maHeights;
double mfPPTX;
double mfPPTY;
Fraction maZoomX;
Fraction maZoomY;
VclPtr<OutputDevice> mpOutDev;
sal_uInt16 mnExtraHeight;
bool mbForceAutoSize; /// whether to set height to optimal even when the manual height flag is set.
public:
RowHeightContext(
SCROW nMaxRow, double fPPTX, double fPPTY, const Fraction& rZoomX, const Fraction& rZoomY,
OutputDevice* pOutDev );
~RowHeightContext();
double getPPTX() const { return mfPPTX;}
double getPPTY() const { return mfPPTY;}
const Fraction& getZoomX() const { return maZoomX;}
const Fraction& getZoomY() const { return maZoomY;}
OutputDevice* getOutputDevice() { return mpOutDev;}
void setExtraHeight( sal_uInt16 nH );
sal_uInt16 getExtraHeight() const { return mnExtraHeight;}
void setForceAutoSize( bool b );
bool isForceAutoSize() const { return mbForceAutoSize;}
RowHeightsArray& getHeightArray() { return maHeights; }
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */