summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-06-05 20:15:16 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-06-06 18:01:31 +0200
commit4df278b4a98637aa5050abfd752eae0a9081b752 (patch)
tree6e5baa87f2e49daccc7e40403ca9df4733df1267 /include
parent9b03f778adfb87a10d781860930ed4d09410af9c (diff)
perf: cache the generated json for an iconview image
before: |--13.95%--JSDialogNotifyIdle::Invoke | | | |--13.01%--JSDialogNotifyIdle::generateWidgetUpdate | | | | | |--11.03%--IconView::DumpAsPropertyTree | | | lcl_DumpEntryAndSiblings (inlined) | | | | | | | |--10.94%--extractPngString (inlined) after: |--4.86%--JSDialogNotifyIdle::Invoke ... | |--2.90%--JSDialogNotifyIdle::generateWidgetUpdate | | | | | |--0.76%--IconView::DumpAsPropertyTree | | | IconView::DumpEntryAndSiblings | | | Link<std::tuple<tools::JsonWriter&, rtl::OUString const&, std::basic_string_view<char, std::char_traits<char> > > const&, bool>::Call (inlined) | | | StylesPreviewWindow_Base::DoJsonProperty | | | | | | | |--0.55%--StylesPreviewWindow_Base::GetCachedPreviewJson Change-Id: Id234a84e36710794822945584be3adf028808625 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152630 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/json_writer.hxx4
-rw-r--r--include/vcl/weld.hxx6
2 files changed, 9 insertions, 1 deletions
diff --git a/include/tools/json_writer.hxx b/include/tools/json_writer.hxx
index 47418c87cb40..7c9b5b96a4b4 100644
--- a/include/tools/json_writer.hxx
+++ b/include/tools/json_writer.hxx
@@ -166,5 +166,7 @@ class ScopedJsonWriterStruct
public:
~ScopedJsonWriterStruct() { mrWriter.endStruct(); }
};
-};
+
+typedef std::tuple<JsonWriter&, const OUString&, std::string_view> json_prop_query;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 69e95ce7ad01..38df3cb5ea19 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -70,6 +70,7 @@ typedef OutputDevice RenderContext;
namespace tools
{
class JsonWriter;
+typedef std::tuple<tools::JsonWriter&, const OUString&, std::string_view> json_prop_query;
}
class LOKTrigger;
@@ -1448,6 +1449,11 @@ public:
m_aQueryTooltipHdl = rLink;
}
+ // 0: json writer, 1: id, 2: property. returns true if supported
+ virtual void
+ connect_get_property_tree_elem(const Link<const tools::json_prop_query&, bool>& rLink)
+ = 0;
+
virtual OUString get_selected_id() const = 0;
virtual void clear() = 0;