/* -*- 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 . */ #ifndef INCLUDED_COMPHELPER_NUMBEREDCOLLECTION_HXX #define INCLUDED_COMPHELPER_NUMBEREDCOLLECTION_HXX #include #include #include #include #include #include #include #include #include namespace com::sun::star::uno { class XInterface; } namespace comphelper{ /** @short defines a collection of UNO components, where every component will get its own unique number. @descr Such number will be unique at runtime only... but it supports fragmentation. Note: This collection uses weak references only to know her components. So lifetime of these components must be controlled outside. @threadsafe */ class UNLESS_MERGELIBS_MORE(COMPHELPER_DLLPUBLIC) NumberedCollection final : public ::cppu::WeakImplHelper< css::frame::XUntitledNumbers > { // types, const private: struct TNumberedItem { css::uno::WeakReference< css::uno::XInterface > xItem; ::sal_Int32 nNumber; }; typedef std::unordered_map< sal_IntPtr, TNumberedItem > TNumberedItemHash; typedef ::std::vector< sal_IntPtr > TDeadItemList; // interface public: /** @short lightweight constructor. */ NumberedCollection(); /** @short free all internally used resources. */ virtual ~NumberedCollection() override; /** set an outside component which uses this container and must be set as source of all broadcasted messages, exceptions. It's holded weak only so we do not need any complex dispose sessions. Note: Passing NULL as parameter will be allowed. It will reset the internal member reference only. @param xOwner the new owner of this collection. */ void setOwner (const css::uno::Reference< css::uno::XInterface >& xOwner); /** set the localized prefix to be used for untitled components. Localization has to be done outside. This container will return those value then. There are no further checks. Its up to you to define a suitable string here :-) @param sPrefix the new prefix for untitled components. */ void setUntitledPrefix(const OUString& sPrefix); /** @see css.frame.XUntitledNumbers */ virtual ::sal_Int32 SAL_CALL leaseNumber(const css::uno::Reference< css::uno::XInterface >& xComponent) override; /** @see css.frame.XUntitledNumbers */ virtual void SAL_CALL releaseNumber(::sal_Int32 nNumber) override; /** @see css.frame.XUntitledNumbers */ virtual void SAL_CALL releaseNumberForComponent(const css::uno::Reference< css::uno::XInterface >& xComponent) override; /** @see css.frame.XUntitledNumbers */ virtual OUString SAL_CALL getUntitledPrefix() override; // internal private: /** @short tries to find a unique number not already used within this collection. @descr It reuses the smallest number which isn't used by any component of this collection. (fragmentation!) If collection is full (means there is no free number) the special value INVALID_NUMBER will be returned. @note Those method can't be called within a multithreaded environment. Because such number won't be "reserved" for the call of these method it can happen that two calls returns the same number (reasoned by the fact that first call doesn't used the returned number already. So the outside code has to make sure that retrieving and using of those numbers will be an atomic operation. @return a unique number or special value INVALID_NUMBER if collection is full. */ ::sal_Int32 impl_searchFreeNumber (); static void impl_cleanUpDeadItems ( TNumberedItemHash& lItems , const TDeadItemList& lDeadItems); // member private: /// localized string to be used for untitled components OUString m_sUntitledPrefix; /// cache of all "leased numbers" and its bound components TNumberedItemHash m_lComponents; /// used as source of broadcasted messages or exceptions (can be null !) css::uno::WeakReference< css::uno::XInterface > m_xOwner; std::mutex m_aMutex; }; } // namespace comphelper #endif // INCLUDED_COMPHELPER_NUMBEREDCOLLECTION_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-10-25tdf#130857 exportepub.ui Define frames in orderMichael Weghorn
Move the definition of the "customize" frame above the "metadata" one in the .ui file so that it matches the visual appearance, which makes sure that tab focus order with the Qt-based VCL plugins is correct as well for Writer's "File" -> "Export As" -> "Export as EPUB" dialog. See commit 02692566ad9fc7c3484f8581ffa0004cd4e43987 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu Oct 24 17:43:35 2024 +0200 tdf#130857 optnewdictionarydialog.ui: Define focusable widgets in order for more background. Change-Id: I1db418d4c6394fd8dd0db5127dbcd8e3f0dc09c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175627 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-06-28Resave with newer Glade versionBogdan Buzea
Change-Id: Ic951f42f5a6dd7ab2d972a5ccc2d6e7fd3b5fa91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169596 Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp> Tested-by: Jenkins
2021-01-16drop unwanted stray yalignCaolán McNamara
Change-Id: Ic397aae6e9a9cd2258b0e65cd66c72c4218c6946 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109415 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-15replace stock button labelsCaolán McNamara
Change-Id: I726ba7846322863d9f38314b6c6ccc7f71124a0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109197 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-15tdf#138848 add truncate-multiline to all GtkEntries and GtkSpinButtonsCaolán McNamara
except for extensions/uiconfig/spropctrlr/ui/multiline.ui Change-Id: Ia2eca14332ffd4ac6e277c7529f17eca3ba29c0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109310 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-23drop deprecated GtkAlignment, move left/top-padding into child margin-start/topCaolán McNamara
for writerperfect Change-Id: Ia401f8e92f1ef16df646c1adc9e6ad05a0f9af0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108205 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-15add <!-- n-columns=1 n-rows=1 --> before every GtkGridCaolán McNamara
for a in `git ls-files '*.ui'`; do sed -i 's/^\( *\)\(<object class="GtkGrid".*\)/\1<!-- n-columns=1 n-rows=1 -->\n\1\2/' $a; done so we get the same behavior in glade as before 3.38 in that the grid preview don't show any unoccupied grid squares replace all existing n-columns=X n-rows=Y lines because they are all wrong, except for cui/uiconfig/ui/additionsfragment.ui sw/uiconfig/swriter/ui/pageheaderpanel.ui sw/uiconfig/swriter/ui/pagefooterpanel.ui which are correct. Change-Id: I401bbe8e098c26e7f57d6a872d3b70fc1ce85a00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105846 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-22set all .ui min require version of gtk to 3.20Caolán McNamara
and update the version mentioned in our min req in the readme.xrm follow up to commit 0c9ccc7dbf6deb4d012e0d1e6eb934e54e0f19bc Author: Caolán McNamara <caolanm@redhat.com> Date: Fri Oct 2 21:21:45 2020 +0100 raise min version of gtk to 3.20.0 Change-Id: Ibae55c97e1ee577f4b7435d124cda6a21005ad0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104692 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-05lint-ui: validate has_default and can_defaultNoel
check that if a widget has has_default=='True', then it also has can_default=='True' Change-Id: Ie51d9d8fff6d7cc0cc42a09331f59e7ef6d559be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103834 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2019-10-25tdf#128251 EPUB Export Dialog updateandreas kainz
Change-Id: Ib72cab83673c531fed0002395c373cb946cfb028 Reviewed-on: https://gerrit.libreoffice.org/81131 Tested-by: Jenkins Reviewed-by: andreas_kainz <kainz.a@gmail.com>