/* -*- 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #pragma once #include #include // error codes #define SO_ERR(x) ErrCode(ErrCodeArea::So, ErrCodeClass::So, x) #define SO_WRN(x) ErrCode(WarningFlag::Yes, ErrCodeArea::So, ErrCodeClass::So, x) #define ERRCODE_SO_GENERALERROR SO_ERR(1) #define ERRCODE_SO_CANNOT_DOVERB_NOW SO_WRN(28) #define ERRCODE_SO_NOVERBS SO_ERR(30) #define ERRCODE_SO_NOTIMPL SO_ERR(33) // error contexts #define ERRCTX_SO_DOVERB 1 SVT_DLLPUBLIC extern const ErrMsgCode RID_SO_ERROR_HANDLER[]; SVT_DLLPUBLIC extern const ErrMsgCode RID_SO_ERRCTX[]; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ternate' type='text/html' href='https://go.suokunlong.cn:88/cgit/lo/core/commit/?id=4bcf6d9c905e7b5558ee8d9f7f616ce61eadb8f8'/> 4bcf6d9c905e7b5558ee8d9f7f616ce61eadb8f8 The bugdoc has a macro in it, and after closing the document -> start center -> opening it again, you could no longer trigger the macro by clicking on the URL field in the Calc cell. The problem is that we cache protocol handler instances since 3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4 (framework: avoid re-creating protocol handler instances all the time, 2022-05-02) in frames, but we failed to invalidate this cache when the component of the frame changes. Fix the problem by clearing the cache in XFrameImpl::setComponent(), which gets called in this somewhat rare case when a frame gets reused to host a different component. [ No testcase, I'm not sure how to close a document without disposing its XFrame from code. ] Change-Id: I73ee83ec017f476803010cbf9e514315fc797371 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143998 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
The bugdoc has a macro in it, and after closing the document -> start
center -> opening it again, you could no longer trigger the macro by
clicking on the URL field in the Calc cell.

The problem is that we cache protocol handler instances since
3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4 (framework: avoid re-creating
protocol handler instances all the time, 2022-05-02) in frames, but we
failed to invalidate this cache when the component of the frame changes.

Fix the problem by clearing the cache in XFrameImpl::setComponent(),
which gets called in this somewhat rare case when a frame gets reused to
host a different component.

[ No testcase, I'm not sure how to close a document without disposing
its XFrame from code. ]

Change-Id: I73ee83ec017f476803010cbf9e514315fc797371
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143998
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
clang-tidy modernize-pass-by-value in framework 2022-06-02T10:12:15+00:00 Noel Grandin noel.grandin@collabora.co.uk 2022-06-02T08:44:17+00:00 c60ad041e8f48759062d652ca20216c424768fa4 Change-Id: I024653154c51389bb27f3e94b422ff7fc1c9b46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135296 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Change-Id: I024653154c51389bb27f3e94b422ff7fc1c9b46b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135296
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
framework: avoid re-creating protocol handler instances all the time 2022-05-02T19:59:28+00:00 Miklos Vajna vmiklos@collabora.com 2022-05-02T14:25:31+00:00 3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4 Once you install an extension that adds its own protocol handlers (e.g. <https://github.com/niocs/ProtocolHandlerExtension>), DispatchProvider re-creates this protocol handler every time the custom menu gets opened or a command gets dispatched. This allows the dispatch provider to avoid managing the lifecycle of those protocol handler instances, but in case the constructor of those handlers is expensive, this leads to performance problems. Introduce a map of handler instances in DispatchProvider to avoid unnecessary re-creation and re-initialization: these instances get the same XFrame anyway (the DispatchProvider is owned by the frame), so this is meant to be safe. No testcase for this -- the problem is only visible if you have an UNO service registered in the global UNO service registry, but by the time our cppunit tests run, that is already a fixed list, so this would be hard to test from code. Change-Id: I6d69906a795a2d5a67706002d635b6cb3091b856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133706 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Once you install an extension that adds its own protocol handlers (e.g.
<https://github.com/niocs/ProtocolHandlerExtension>), DispatchProvider
re-creates this protocol handler every time the custom menu gets opened
or a command gets dispatched.

This allows the dispatch provider to avoid managing the lifecycle of
those protocol handler instances, but in case the constructor of those
handlers is expensive, this leads to performance problems.

Introduce a map of handler instances in DispatchProvider to avoid
unnecessary re-creation and re-initialization: these instances get the
same XFrame anyway (the DispatchProvider is owned by the frame), so this
is meant to be safe.

No testcase for this -- the problem is only visible if you have an UNO
service registered in the global UNO service registry, but by the time
our cppunit tests run, that is already a fixed list, so this would be
hard to test from code.

Change-Id: I6d69906a795a2d5a67706002d635b6cb3091b856
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133706
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
tdf#124176 Use pragma once in f* 2021-03-23T12:07:09+00:00 Vincent LE GARREC libreoffice@le-garrec.fr 2021-03-06T07:21:49+00:00 90c978f839e5029c69b4acb70f37909ee3016614 filter, forms, fpicker, framework Change-Id: I55a25ad2dc3749e63465e638e8eeea3c322eabbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112047 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
filter, forms, fpicker, framework

Change-Id: I55a25ad2dc3749e63465e638e8eeea3c322eabbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112047
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
loplugin:finalclasses in framework 2020-01-14T14:27:00+00:00 Noel Grandin noel.grandin@collabora.co.uk 2020-01-14T08:12:35+00:00 47c0d10b02f6f89ef11f5eb6ce86efb5edb69f30 Change-Id: I5405a123e887173fe4b90d66dab6225bf43883ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Change-Id: I5405a123e887173fe4b90d66dab6225bf43883ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86740
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
tdf#42949 Fix IWYU warnings in framework/*/*hxx 2019-11-11T08:48:23+00:00 Gabor Kelemen kelemen.gabor2@nisz.hu 2019-11-01T22:29:42+00:00 e4bf92ae344e0db16177de7fc9eed432339d8705 Also drop unused framework/inc/fwkdllapi.h Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9e79266f273b778f4a8bd3330b1b0353a2e01a61 Reviewed-on: https://gerrit.libreoffice.org/81927 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Also drop unused framework/inc/fwkdllapi.h

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I9e79266f273b778f4a8bd3330b1b0353a2e01a61
Reviewed-on: https://gerrit.libreoffice.org/81927
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
framework: cleanup xinterface.hxx includes 2017-06-07T23:10:13+00:00 Jochen Nitschke j.nitschke+logerrit@ok.de 2017-06-07T12:19:25+00:00 f95cb2841a373cd9665f0f0462cec0efd2b544aa Change-Id: I66b27e623e411c9ba9c5ba17c46c052336d031b8 Reviewed-on: https://gerrit.libreoffice.org/38503 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Change-Id: I66b27e623e411c9ba9c5ba17c46c052336d031b8
Reviewed-on: https://gerrit.libreoffice.org/38503
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
framework: cleanup xtypeprovider.hxx includes 2017-06-07T12:00:27+00:00 Jochen Nitschke j.nitschke+logerrit@ok.de 2017-06-07T10:26:12+00:00 a83740ebcf91649ff2611582b124bf2d0ce2e133 LayoutManager uses macro impl from comphelper, so use declarations from comphelper too. Change-Id: I638492849742782d48c3bb5439c2255e72f9f694 Reviewed-on: https://gerrit.libreoffice.org/38496 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
LayoutManager uses macro impl from comphelper, so use declarations
from comphelper too.

Change-Id: I638492849742782d48c3bb5439c2255e72f9f694
Reviewed-on: https://gerrit.libreoffice.org/38496
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>