diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-08-21 17:36:33 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-08-22 12:48:32 +0200 |
commit | 62d5622540c7251bb870a837b5ca6a836fac6f01 (patch) | |
tree | f54751dcc96705d10358f3391255744620ee5c3c /vcl/source/window | |
parent | 68c13732a3518442f4cbd64330e692a66dad8515 (diff) |
DumpAsPropertyTree: use more efficient overloads of JsonWriter::put
Change-Id: I6fe3ff8138ed27a04a3a224c67492338cf23992c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit a909ed32274e202e9f7dc8ac0c1985e258cff1cc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138538
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 96cd04008148..8b9e11cc35d0 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1685,7 +1685,7 @@ void Dialog::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) if (vcl::Window* pActionArea = get_action_area()) { if (!pActionArea->IsVisible()) - rJsonWriter.put("collapsed", "true"); + rJsonWriter.put("collapsed", true); } OUString sDialogId = OStringToOUString(GetHelpId(), RTL_TEXTENCODING_ASCII_US); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 6b11d72eae17..f4479cc7c6ca 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2994,9 +2994,9 @@ void VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) if(GraphicConverter::Export(aOStm, aImage, ConvertDataFormat::PNG) == ERRCODE_NONE) { css::uno::Sequence<sal_Int8> aSeq( static_cast<sal_Int8 const *>(aOStm.GetData()), aOStm.Tell()); - OUStringBuffer aBuffer("data:image/png;base64,"); + OStringBuffer aBuffer("data:image/png;base64,"); ::comphelper::Base64::encode(aBuffer, aSeq); - rJsonWriter.put("image", aBuffer.makeStringAndClear()); + rJsonWriter.put("image", aBuffer); } rJsonWriter.put("text", GetQuickHelpText()); } diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 5a1112da5c6a..296053783d9f 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1769,9 +1769,9 @@ void ToolBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) if(GraphicConverter::Export(aOStm, aImage.GetBitmapEx(), ConvertDataFormat::PNG) == ERRCODE_NONE) { css::uno::Sequence<sal_Int8> aSeq( static_cast<sal_Int8 const *>(aOStm.GetData()), aOStm.Tell()); - OUStringBuffer aBuffer("data:image/png;base64,"); + OStringBuffer aBuffer("data:image/png;base64,"); ::comphelper::Base64::encode(aBuffer, aSeq); - rJsonWriter.put("image", aBuffer.makeStringAndClear()); + rJsonWriter.put("image", aBuffer); } } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 180aa4a78dd2..01462993fc8f 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3274,7 +3274,7 @@ VclPtr<vcl::Window> Window::GetParentWithLOKNotifier() namespace { -const char* windowTypeName(WindowType nWindowType) +std::string_view windowTypeName(WindowType nWindowType) { switch (nWindowType) { |