diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-04 11:37:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-05 22:20:13 +0200 |
commit | 417f881d20cafe88a02b64894ba4483875fb9460 (patch) | |
tree | a9c424768589bac04dabb5679ada7c7d1c67abd8 /tools | |
parent | 466d464a7f31f10475c14260c6b0f11f1cb5a931 (diff) |
improve LOK notifyInvalidation
(*) tweak buffer in SfxLokHelper::notifyInvalidation to be a bit larger,
so we avoid the cost of a resize©
(*) use our optimised OString concatentation instead of going via
std::stringstream
(*) pass down a pointer to rectangle, instead of a string. later we will
use this to avoid doing the stringify until later
Change-Id: Ia3e3042bc919d9b9cb80e47a93704eb236438605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119994
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120072
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/gen.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 34c9fbdfd649..1740f4b306f1 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -29,12 +29,10 @@ OString Pair::toString() const { - std::stringstream ss; // Note that this is not just used for debugging output but the // format is parsed by external code (passed in callbacks to // LibreOfficeKit clients). So don't change. - ss << A() << ", " << B(); - return ss.str().c_str(); + return OString::number(A()) + ", " + OString::number(B()); } tools::Rectangle tools::Rectangle::Justify( const Point& rLT, const Point& rRB ) @@ -192,12 +190,10 @@ bool tools::Rectangle::IsOver( const tools::Rectangle& rRect ) const OString tools::Rectangle::toString() const { - std::stringstream ss; // Note that this is not just used for debugging output but the // format is parsed by external code (passed in callbacks to // LibreOfficeKit clients). So don't change. - ss << getX() << ", " << getY() << ", " << getWidth() << ", " << getHeight(); - return ss.str().c_str(); + return OString::number(getX()) + ", " + OString::number(getY()) + ", " + OString::number(getWidth()) + ", " + OString::number(getHeight()); } void tools::Rectangle::expand(tools::Long nExpandBy) |