vcl::WindowData is used to manage/store various state
information for windows. It can be (de)serialized to/from string.
So far, both the weld::Window API to get/set window state
as well as the SvtViewOptions API were based on the string
representation.
Switch those and various related places to using vcl::WindowData
instead to use a stronger/more specific type than just OUString
in various places across the code base.
Do the string (de)serialization where necessary, but otherwise
prefer to use vcl::WindowData directly.
Calling weld::Window::set_window_state with a WindowData
param that doesn't indicate that anything should be set
(i.e. whose mask is vcl::WindowDataMask::NONE) should
have no effect, so drop extra checks that were previously
checking whether the string representation was empty
and skipping the call to weld::Window::set_window_state in
that case.
No change in user-observable behavior intended or
seen in a quick test.
Change-Id: I5bc4caeb49d0ab2bbc4fa597a5ef19d86d3aac2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208125
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
utl::MediaDescriptor was just a SequenceAsHashMap with a few added
methods. It made it more difficult to assign a SequenceAsHashMap to
MediaDescriptor, without real upsides. In many places, the class was
used not as media descriptor, but just as helper to create sequences.
This change puts the string constants and the former methods into a
namespace utl::MediaDescriptor.
It would be also good to drop comphelper::NamedValueCollection, which
is basically a twin of comphelper::SequenceAsHashMap (TODO).
Change-Id: Ia9b69c5a2ad153ecc654944c419c1880252ed86e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195163
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Regression after commit 9d6e1594a2
(Deduplicate and unify using vcl::GetBitmap, 2024-11-08).
An Any with an empty graphic is not itself empty; such an any caused
the outer check to succeed, and therefore its 'else' branch never
executed, when it ought to.
Change-Id: I97115c7f7dbab4ec54b5e999e4b47ecdc8874e47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193161
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-Extend ViewDataSupplier to work with window state for supported
applications like sw, sc, sd
-Extend sm DocumentPropertySupplier to work with window state
-Add OldWindowState string member to SfxViewShell inherited
classes for sw, sc and sd
-Add OldWindowState string member to SmDocShell class for sm
Imported window state is stored in the model shells
or the ViewShells if available. This data is accessed by services
like ViewDataSupplier and DocumentPropertySupplier used by
persistentwindowstate.cxx. It is needed to store the window state
data since frame is not available to get to resize
and reposition by the time importing document has finished.
-Add windowstatehelper header and source files in the framework
module for getting/exporting the size and position of
windows. Also add associated file and library to make files for
exporting/using these helper methods across different modules.
-Modify impl_searchRecycleTarget method in loadenv.cxx
New frames are created for saved documents when launched from
the start center. This is to apply their own window state
separately from the backing window.
New docs and templates still recycle the backing window frame.
-Make the backing window close afterwards after the new frame has
been created and the document gets loaded successfully
(modified in loadenv.cxx)
Change-Id: Ia5ad606e744621f267dae6cd468b0c430b2ebf1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185189
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
places where we are constructing a Graphic by first
converting to BitmapEx, which is unnecessary, rather pass a
Bitmap to Graphic.
Change-Id: I386f68e7f5bc6ef9509352187dbe9a0774defaac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190307
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
And drop unneeded solar mutex locks, that were used when the menu
implementation was accessed directly.
Change-Id: I06d3d872343fdd6204b4e8bbd8bcec67c17fdbe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176199
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Since commit 26c106a5ae "append '(Remote)'
in the titlebar when remote file is opened", 2015-08-14, the titlebar
shows "(remote)" for documents with non-empty URLs that are not file
scheme.
When recovering a non-existing document, the URL is a factory one like
"private:factory/swriter"; and INetURLObject::GetProtocol() call returns
PrivSoffice.
Indeed, recovery of a non-existing document doesn't make sense itself,
and is fixed by Justin elsewhere; but let's fix the general logic here.
Change-Id: Ibaf095981c37a2fd64f745ad0966465d98a4ed4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171027
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Some of the exclusions were too aggressive. Restrict them to only the
important classes, which exposes some more places this plugin applies.
Change-Id: I1b2d1fb24391adc71ed0984f94168f61a149479f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165154
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
To remove unneeded using declarations.
Via the simple script:
for i in $(find $dirname -name "*cxx" -o -name "*hxx" ); do
clang-tidy-12 --checks="-*,misc-unused-using-decls" "$i";
done
Change-Id: Idd8aa3d3cfec456c4babb65e89af712051b4deb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150609
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
JunitTest_sfx2_complex occasionally deadlocked when the main thread at
> framework::UndoManagerHelper::isUndoPossible
> chart::UndoCommandDispatch::fireStatusEvent
> chart::CommandDispatch::addStatusListener
> svt::ToolboxController::bindListener
> framework::ToolBarManager::UpdateControllers
> framework::ToolBarManager::AsyncUpdateControllersHdl
> Scheduler::CallbackTaskScheduling
> SalTimer::CallCallback
> SvpSalInstance::CheckTimeout
> SvpSalInstance::ImplYield
> SvpSalInstance::DoYield
> ImplYield
> Application::Execute
> desktop::Desktop::Main
has acquired the SolarMutex in
framework::ToolBarManager::AsyncUpdateControllersHdl and is now trying to
acquire framework::UndoManagerHelper_Impl::m_aMutex, while a cppu_threadpool at
> framework::UndoManagerHelper_Impl::impl_clear
> std::function<void ()>::operator()
> framework::(anonymous namespace)::UndoManagerRequest::execute
> framework::UndoManagerHelper_Impl::impl_processRequest
> framework::UndoManagerHelper_Impl::clear
> framework::UndoManagerHelper::clear
> gcc3::callVirtualMethod
first acquired framework::UndoManagerHelper_Impl::m_aMutex and then tries to
acquire the SolarMutex. That additional acquiring of the SolarMutex had been
added to framework::UndoManagerHelper_Impl::impl_clear in
8611f6e259 "ref-count SdrObject".
Change-Id: Ifcb8765b29b65f773be6bbe54092346c5ae3a33b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146371
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Which means we can get rid of the majestic hack of ScCaptionPtr
Previously, SdrObject was manually managed, and the ownership
passed around in very complicated fashion.
Notes:
(*) SvxShape has a strong reference to SdrObject, where
previously it had a weak reference. It is now strong
since otherwise the SdrObject will go away very eagerly.
(*) SdrObject still has a weak reference to SvxShape
(*) In the existing places that an SdrObject is being
deleted, we now just clear the reference
(*) instead of SwVirtFlyDrawObj removing itself from the
page that contains inside it's destructor, make the call site
do the removing from the page.
(*) Needed to take the SolarMutex in UndoManagerHelper_Impl::impl_clear
because this can be called from UNO (e.g. sfx2_complex JUnit test)
and the SdrObjects need the SolarMutex when destructing.
(*) handle a tricky situation with SwDrawVirtObj in the SwDrawModel
destructor because the existing code wants mpDrawObj in
SwAnchoredObject to be sometimes owning, sometimes not, which
results in a cycle with the new code.
Change-Id: I4d79df1660e386388e5d51030653755bca02a163
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138837
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now. Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)
Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
and using GetXGraphic will return a vcl unographic::XGraphic which
also supports XBitmap as well as XGraphic so we can check if
the XBitmap we're passing around supports XGraphic and use that
if it does and drop the imagewrapper in favor of doing that
Change-Id: I3bd7963b53c3f715fca4b5cfb2ddad650ca92e1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126691
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Every callsite (bar one) calls setOwner and connectWithUntitledNumbers after construction,
so just pass them in the constructor.
And for that lone callsite we can just nullptr as an argument.
Change-Id: If838e068bb59a407225d853a0f67983be400f2f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124426
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
- Revise uses of getSomething to use getFromUnoTunnel
Where that is impossible, use getSomething_cast to unify casting,
and minimize number of places doing low-level transformations.
The change keeps the existing tunnel references that last for the
duration of the pointers' life, because sometimes destroying such
reference may destroy the pointed object, and result in use after
free.
Change-Id: I291c33223582c34cd2c763aa8aacf0ae899ca4c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122101
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
- Change implementations of getSomething to use getSomethingImpl
Or where that's impossible, use getSomething_cast to unify this and
reduce number of places where we reinterpret_cast.
All static methods getting tunnel ids were renamed to getUnoTunnelId,
to comply with the convention used in <comphelper/servicehelper.hxx>.
TODO (in separate commits):
- Revise uses of getSomething to use getFromUnoTunnel
Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>