/* -*- 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_VCL_MENU_HXX #define INCLUDED_VCL_MENU_HXX #include #include #include #include #include #include #include #include #include #include #include #include class OutputDevice; struct ImplSVEvent; struct MenuItemData; class Point; class Size; namespace tools { class Rectangle; } class Menu; class MenuItemList; class Image; class PopupMenu; class KeyEvent; class MenuFloatingWindow; class SalMenu; class MenuBarWindow; class VclMenuEvent; struct SystemMenuData; enum class FloatWinPopupFlags; enum class VclEventId; namespace com::sun::star::awt { class XPopupMenu; } namespace com::sun::star::accessibility { class XAccessible; } namespace vcl { class Window; struct MenuLayoutData; typedef OutputDevice RenderContext; // same as in include/vcl/outdev.hxx class ILibreOfficeKitNotifier; } constexpr sal_uInt16 MENU_APPEND = 0xFFFF; constexpr sal_uInt16 MENU_ITEM_NOTFOUND = 0xFFFF; // Must match the definitions in css::awt::PopupMenuDirection.idl enum class PopupMenuFlags { NONE = 0x0000, ExecuteDown = 0x0001, ExecuteUp = 0x0002, ExecuteRight = 0x0008, NoMouseUpClose = 0x0010, }; namespace o3tl { template<> struct typed_flags : is_typed_flags {}; } enum class MenuFlags { NONE = 0x0000, NoAutoMnemonics = 0x0001, HideDisabledEntries = 0x0002, // overrides default hiding of disabled entries in popup menus AlwaysShowDisabledEntries = 0x0004, }; namespace o3tl { template<> struct typed_flags : is_typed_flags {}; } /// Invalid menu item id constexpr auto ITEMPOS_INVALID = 0xFFFF; struct ImplMenuDelData { ImplMenuDelData* mpNext; VclPtr mpMenu; explicit ImplMenuDelData( const Menu* ); ~ImplMenuDelData(); bool isDeleted() const { return mpMenu == nullptr; } }; typedef void (*MenuUserDataReleaseFunction)(void*); class VCL_DLLPUBLIC Menu : public VclReferenceBase { friend class MenuBar; friend class MenuBarWindow; friend class MenuButton; friend class MenuFloatingWindow; friend class PopupMenu; friend class SystemWindow; friend struct ImplMenuDelData; private: ImplMenuDelData* mpFirstDel; std::unique_ptr pItemList; // list with MenuItems VclPtr pStartedFrom; VclPtr pWindow; Link aActivateHdl; // Active-Handler Link aDeactivateHdl; // Deactivate-Handler Link aSelectHdl; // Select-Handler std::list > maEventListeners; OUString maID; OUString aTitleText; // PopupMenu text sal_uInt16 nTitleHeight; ImplSVEvent* nEventId; sal_uInt16 mnHighlightedItemPos; // for native menus: keeps track of the highlighted item MenuFlags nMenuFlags; sal_uInt16 nSelectedId; OUString sSelectedIdent; // for output: sal_uInt16 nImgOrChkPos; sal_uInt16 nTextPos; bool bCanceled : 1; ///< Terminated during a callback bool bInCallback : 1; ///< In Activate/Deactivate bool bKilled : 1; ///< Killed css::uno::Reference mxAccessible; mutable std::unique_ptr mpLayoutData; std::unique_ptr mpSalMenu; protected: SAL_DLLPRIVATE Menu* ImplGetStartMenu(); SAL_DLLPRIVATE Menu* ImplFindSelectMenu(); SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId ); SAL_DLLPRIVATE Size ImplCalcSize( vcl::Window* pWin ); SAL_DLLPRIVATE bool ImplIsVisible( sal_uInt16 nPos ) const; SAL_DLLPRIVATE bool ImplCurrentlyHiddenOnGUI(sal_uInt16 nPos) const; SAL_DLLPRIVATE bool ImplIsSelectable( sal_uInt16 nPos ) const; SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const; SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const; SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const; SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const; SAL_DLLPRIVATE void ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, sal_uInt16 nBorder, tools::Long nOffY = 0, MenuItemData const * pThisDataOnly = nullptr, bool bHighlighted = false, bool bLayout = false, bool bRollover = false ) const; SAL_DLLPRIVATE void ImplPaintMenuTitle(vcl::RenderContext&, const tools::Rectangle& rRect) const; SAL_DLLPRIVATE void ImplSelect(); SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem ); SAL_DLLPRIVATE void ImplCallEventListeners( VclEventId nEvent, sal_uInt16 nPos ); DECL_DLLPRIVATE_LINK(ImplCallSelect, void*, void ); SAL_DLLPRIVATE void ImplFillLayoutData() const; SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu.get(); } SAL_DLLPRIVATE OUString ImplGetHelpText( sal_uInt16 nItemId ) const; // returns native check and option menu symbol height in rCheckHeight and rRadioHeight // return value is maximum width and height of checkboxes and radiobuttons SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize(vcl::RenderContext const & rRenderContext, tools::Long& rCheckHeight, tools::Long& rRadioHeight) const; // returns native submenu arrow size and spacing from right border // return value is whether it's supported natively SAL_DLLPRIVATE static bool ImplGetNativeSubmenuArrowSize(vcl::RenderContext const & rRenderContext, Size& rArrowSize, tools::Long& rArrowSpacing); SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel ); SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel ); SAL_DLLPRIVATE MenuItemData* NbcInsertItem(sal_uInt16 nId, MenuItemBits nBits, const OUString& rStr, Menu* pMenu, size_t nPos, const OUString &rIdent); /// Close the 'pStartedFrom' menu window. virtual void ClosePopup(Menu* pMenu) = 0; /// Forward the KeyInput call to the MenuBar. virtual void MenuBarKeyInput(const KeyEvent& rEvent); public: SAL_DLLPRIVATE void ImplKillLayoutData() const; SAL_DLLPRIVATE vcl::Window* ImplGetWindow() const { return pWindow; } #if defined(MACOSX) void ImplSelectWithStart( Menu* pStartMenu = nullptr ); #endif protected: /** The Menu constructor is protected. The callers are supposed to instantiate either PopupMenu or MenuBar, but not a Menu directly. */ Menu(); public: virtual ~Menu() override; virtual void dispose() override; void Activate(); void Deactivate(); void Select(); void InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nItemBits = MenuItemBits::NONE, const OUString &rIdent = {}, sal_uInt16 nPos = MENU_APPEND); void InsertItem(sal_uInt16 nItemId, const Image& rImage, MenuItemBits nItemBits = MenuItemBits::NONE, const OUString &rIdent = {}, sal_uInt16 nPos = MENU_APPEND); void InsertItem(sal_uInt16 nItemId, const OUString& rString, const Image& rImage, MenuItemBits nItemBits = MenuItemBits::NONE, const OUString &rIdent = {}, sal_uInt16 nPos = MENU_APPEND); void InsertSeparator(const OUString &rIdent = {}, sal_uInt16 nPos = MENU_APPEND); void RemoveItem( sal_uInt16 nPos ); void Clear(); void CreateAutoMnemonics(); void SetMenuFlags( MenuFlags nFlags ) { nMenuFlags = nFlags; } MenuFlags GetMenuFlags() const { return nMenuFlags; } sal_uInt16 GetItemCount() const; sal_uInt16 GetItemId(sal_uInt16 nPos) const; sal_uInt16 GetItemId(std::u16string_view rIdent) const; sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const; OUString GetItemIdent(sal_uInt16 nItemId) const; MenuItemType GetItemType( sal_uInt16 nPos ) const; sal_uInt16 GetCurItemId() const { return nSelectedId;} OUString const & GetCurItemIdent() const { return sSelectedIdent; } void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits ); MenuItemBits GetItemBits( sal_uInt16 nItemId ) const; void SetUserValue(sal_uInt16 nItemId, void* nUserValue, MenuUserDataReleaseFunction aFunc=nullptr); void* GetUserValue(sal_uInt16 nItemId) const; void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ); PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const; void SetAccelKey( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode ); vcl::KeyCode GetAccelKey( sal_uInt16 nItemId ) const; void CheckItem( sal_uInt16 nItemId, bool bCheck = true ); void CheckItem( std::u16string_view rIdent, bool bCheck = true ); bool IsItemChecked( sal_uInt16 nItemId ) const; virtual void SelectItem(sal_uInt16 nItemId) = 0; void EnableItem( sal_uInt16 nItemId, bool bEnable = true ); void EnableItem(std::u16string_view rIdent, bool bEnable = true) { EnableItem(GetItemId(rIdent), bEnable); } bool IsItemEnabled( sal_uInt16 nItemId ) const; void ShowItem( sal_uInt16 nItemId, bool bVisible = true ); void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, false ); } bool IsItemPosVisible( sal_uInt16 nItemPos ) const; bool IsMenuVisible() const; virtual bool IsMenuBar() const = 0; void RemoveDisabledEntries( bool bRemoveEmptyPopups = false ); void UpdateNativeMenu(); void SetItemText( sal_uInt16 nItemId, const OUString& rStr ); OUString GetItemText( sal_uInt16 nItemId ) const; void SetItemImage( sal_uInt16 nItemId, const Image& rImage ); Image GetItemImage( sal_uInt16 nItemId ) const; void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand ); OUString GetItemCommand( sal_uInt16 nItemId ) const; void SetHelpText( sal_uInt16 nItemId, const OUString& rString ); OUString GetHelpText( sal_uInt16 nItemId ) const; void SetTipHelpText( sal_uInt16 nItemId, const OUString& rString ); OUString GetTipHelpText( sal_uInt16 nItemId ) const; void SetHelpCommand( sal_uInt16 nItemId, const OUString& rString ); OUString GetHelpCommand( sal_uInt16 nItemId ) const; void SetHelpId( sal_uInt16 nItemId, const OUString& rHelpId ); OUString GetHelpId( sal_uInt16 nItemId ) const; void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; } void SetDeactivateHdl( const Link& rLink ) { aDeactivateHdl = rLink; } void SetSelectHdl( const Link& rLink ) { aSelectHdl = rLink; } sal_uInt16 GetTitleHeight() const { return nTitleHeight; } void AddEventListener( const Link& rEventListener ); void RemoveEventListener( const Link& rEventListener ); Menu& operator =( const Menu& rMenu ); // for menu functions MenuItemList* GetItemList() const { return pItemList.get(); } // returns the system's menu handle if native menus are supported // pData must point to a SystemMenuData structure void GetSystemMenuData( SystemMenuData* pData ) const; // accessibility helpers // returns the bounding box for the character at index nIndex // where nIndex is relative to the starting index of the item // with id nItemId (in coordinates of the displaying window) tools::Rectangle GetCharacterBounds( sal_uInt16 nItemId, tools::Long nIndex ) const; // -1 is returned if no character is at that point // if an index is found the corresponding item id is filled in (else 0) tools::Long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const; // returns the bounding rectangle for an item at pos nItemPos tools::Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const; css::uno::Reference GetAccessible(); void SetAccessible(const css::uno::Reference& rxAccessible); // gets the activation key of the specified item KeyEvent GetActivationKey( sal_uInt16 nItemId ) const; vcl::Window* GetWindow() const { return pWindow; } void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr ); OUString GetAccessibleName( sal_uInt16 nItemId ) const; void SetAccessibleDescription( sal_uInt16 nItemId, const OUString& rStr ); OUString GetAccessibleDescription( sal_uInt16 nItemId ) const; // returns whether the item a position nItemPos is highlighted or not. bool IsHighlighted( sal_uInt16 nItemPos ) const; void HighlightItem( sal_uInt16 nItemPos ); void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const; bool HandleMenuActivateEvent(Menu *pMenu) const; bool HandleMenuDeActivateEvent(Menu *pMenu) const; /** * Sets an ID. */ void set_id(const OUString& rID) { maID = rID; } /** * Get the ID of the window. */ const OUString& get_id() const { return maID; } }; struct MenuBarButtonCallbackArg { sal_uInt16 nId; // Id of the button bool bHighlight; // highlight on/off }; class VCL_DLLPUBLIC MenuBar final : public Menu { Link maCloseHdl; bool mbCloseBtnVisible : 1; bool mbFloatBtnVisible : 1; bool mbHideBtnVisible : 1; bool mbDisplayable : 1; friend class Application; friend class Menu; friend class MenuBarWindow; friend class MenuFloatingWindow; friend class SystemWindow; SAL_DLLPRIVATE static VclPtr ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu); SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete); SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent); /// Return the MenuBarWindow. MenuBarWindow* getMenuBarWindow(); public: MenuBar(); MenuBar( const MenuBar& rMenu ); virtual ~MenuBar() override; virtual void dispose() override; MenuBar& operator =( const MenuBar& rMenu ); virtual bool IsMenuBar() const override { return true; } /// Close the 'pStartedFrom' menu window. virtual void ClosePopup(Menu* pMenu) override; /// Forward the KeyInput call to the MenuBar. virtual void MenuBarKeyInput(const KeyEvent& rEvent) override; void ShowCloseButton( bool bShow ); bool HasCloseButton() const { return mbCloseBtnVisible; } bool HasFloatButton() const { return mbFloatBtnVisible; } bool HasHideButton() const { return mbHideBtnVisible; } void ShowButtons( bool bClose, bool bFloat, bool bHide ); virtual void SelectItem(sal_uInt16 nId) override; bool HandleMenuHighlightEvent(Menu *pMenu, sal_uInt16 nEventId) const; bool HandleMenuButtonEvent(sal_uInt16 nEventId); void SetCloseButtonClickHdl( const Link& rLink ) { maCloseHdl = rLink; } const Link& GetCloseButtonClickHdl() const { return maCloseHdl; } // - by default a menubar is displayable // - if a menubar is not displayable, its MenuBarWindow will never be shown // and it will be hidden if it was visible before // - note: if a menubar is displayable, this does not necessarily mean that it is currently visible void SetDisplayable( bool bDisplayable ); bool IsDisplayable() const { return mbDisplayable; } // add an arbitrary button to the menubar (will appear next to closer) // passed link will be call with a MenuBarButtonCallbackArg on press // passed string will be set as tooltip sal_uInt16 AddMenuBarButton( const Image&, const Link&, const OUString& ); // set the highlight link for additional button with ID nId // highlight link will be called with a MenuBarButtonHighlightArg // the bHighlight member of that struct shall contain the new state void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& ); // returns the rectangle occupied by the additional button named nId // coordinates are relative to the systemwindow the menubar is attached to // if the menubar is unattached an empty rectangle is returned tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId ); void RemoveMenuBarButton( sal_uInt16 nId ); void LayoutChanged(); // get the height of the menubar, return the native menubar height if that is active or the vcl // one if not int GetMenuBarHeight() const; }; inline MenuBar& MenuBar::operator=( const MenuBar& rMenu ) { Menu::operator=(rMenu); return *this; } class VCL_DLLPUBLIC PopupMenu final : public Menu { friend class Menu; friend class MenuFloatingWindow; friend class MenuBarWindow; friend struct MenuItemData; private: SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const; SAL_DLLPRIVATE bool PrepareRun(const VclPtr& pParentWin, tools::Rectangle& rRect, FloatWinPopupFlags& nPopupModeFlags, Menu* pSFrom, bool& bRealExecute, VclPtr&); SAL_DLLPRIVATE bool Run(const VclPtr&, bool bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, const tools::Rectangle& rRect); SAL_DLLPRIVATE void FinishRun(const VclPtr&, const VclPtr& pParentWin, bool bRealExecute, bool bIsNativeMenu); SAL_DLLPRIVATE sal_uInt16 ImplExecute(const VclPtr& pParentWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst); SAL_DLLPRIVATE void ImplFlushPendingSelect(); SAL_DLLPRIVATE tools::Long ImplCalcHeight( sal_uInt16 nEntries ) const; SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( tools::Long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const; public: PopupMenu(); PopupMenu( const PopupMenu& rMenu ); virtual ~PopupMenu() override; virtual bool IsMenuBar() const override { return false; } /// Close the 'pStartedFrom' menu window. virtual void ClosePopup(Menu* pMenu) override; void SetText( const OUString& rTitle ) { aTitleText = rTitle; } sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos ); sal_uInt16 Execute( vcl::Window* pWindow, const tools::Rectangle& rRect, PopupMenuFlags nFlags = PopupMenuFlags::NONE ); // for the TestTool void EndExecute(); virtual void SelectItem(sal_uInt16 nId) override; void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only css::uno::Reference CreateMenuInterface(); static PopupMenu* GetActivePopupMenu(); PopupMenu& operator=( const PopupMenu& rMenu ); }; inline PopupMenu& PopupMenu::operator=( const PopupMenu& rMenu ) { Menu::operator=( rMenu ); return *this; } #endif // INCLUDED_VCL_MENU_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ option value='feature/mar-updater'>feature/mar-updater LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
th>Collapse) 2017-05-04
AgeCommit message (Expand)Author
Author
2019-04-08tdf#42949 Fix IWYU warnings in include/sfx2/[t-z]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib3252828385d1dc8faf48a428b1593199647a679 Reviewed-on: https://gerrit.libreoffice.org/70383 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-10Removed executable permission on source filesAndrea Gelmini
Change-Id: I1853e7a82078c9bc7149098bf9acc0ddf65109c8 Reviewed-on: https://gerrit.libreoffice.org/66040 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-01-09tdf#120086: Patch for TAB-ing order of Gallery sidebar panelAditya
The current TAB-ing order of Gallery sidebar panel is not sequential and the order needed to be changed. This patch fixes the TAB-ing order of the gallery sidebar panel to a more sequential and convenient one. It also fixes the reverse TAB-ing order (Shift+TAB). Change-Id: Ib0b22ccef1fa4676e535f42a794fb7c836741d0b Reviewed-on: https://gerrit.libreoffice.org/65907 Reviewed-by: Jim Raykowski <raykowj@gmail.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-17Resolve deprecated implicit capture of *this by reference in C++20Stephan Bergmann
...as flagged with -Werror=deprecated by trunk GCC in -std=c++2a mode. But C++17 forbids "this" in combination with a capture-default of "=", so in such cases list any entities explicitly that shall be captured by value. Change-Id: Ic228cd20682277a0f93e3e75798356d0fbbb80d4 Reviewed-on: https://gerrit.libreoffice.org/65241 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-29weld ActualizeProgressCaolán McNamara
Change-Id: I35c486ac2dcf9818e331816f554a5c414bdb2386 Reviewed-on: https://gerrit.libreoffice.org/64214 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-29weld GalleryThemePropertiesCaolán McNamara
Change-Id: I88fbb9ab03f0026ffe0c5fe79ab0a386160738a1 Reviewed-on: https://gerrit.libreoffice.org/64198 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-01replace VclAbstractDialog2 with VclAbstractDialogCaolán McNamara
and drop Dialog::GetResult as a consequence Change-Id: Id80a9dc1eab1a23daf4489719b3bafec976bb048 Reviewed-on: https://gerrit.libreoffice.org/62700 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-13tdf#42949 Fix IWYU warnings in include/ucbhelper/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7bfeef47abaf94cfb355db95c0fdb928ce36c0a6 Reviewed-on: https://gerrit.libreoffice.org/60232 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-11loplugin:simplifyconstruct in svtools..svxNoel Grandin
Change-Id: Ia20fac7cec01ac658a903f8b001807b2e72dbf3e Reviewed-on: https://gerrit.libreoffice.org/60316 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30loplugin:stringloop in sfx2..svxNoel Grandin
Change-Id: Ie4ca2421f00259f974b6d94f883adfa11600b1fe Reviewed-on: https://gerrit.libreoffice.org/58251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-12simplify calls to *DialogFactory::Create methodsNoel Grandin
we don't need to check for nullptr here, it's never null. Change-Id: I3cc5337a8f4dec6747821679e39ccba3cec20f56 Reviewed-on: https://gerrit.libreoffice.org/55114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-09remove cargo cult OSL_ENSURE(pFact, "ScAbstractFactory create fail!"(Noel Grandin
Possibly this was useful once upon a time, but now it's just noise. If it failed, we're going to crash on the next line when we call a method on that pointer anyway. Change-Id: Ic601f0c3344f6895f8a6ffb3bc6f8bcb45d00a92 Reviewed-on: https://gerrit.libreoffice.org/55082 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-14weld GalleryIdDialogCaolán McNamara
Change-Id: I214afef7668eaf5082683f1c77b08aa0c5107619 Reviewed-on: https://gerrit.libreoffice.org/54317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-05-14weld TitleDialogCaolán McNamara
Change-Id: I009da829e2b866844e67f976582e2a9d99bd22c0 Reviewed-on: https://gerrit.libreoffice.org/54316 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-05-02loplugin:useuniqueptr in GalleryBrowser1Noel Grandin
Change-Id: I0b95beed2c056e10cb40d09bf1040143778724ca Reviewed-on: https://gerrit.libreoffice.org/53710 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-27convert remaining WarningBox to weld::MessageDialogCaolán McNamara
Change-Id: I7e3c156a6ad47ac232636ae274280c1cb7556d4a
2018-02-22weld native message dialogsCaolán McNamara
just the straight-forward MessageDialog cases first a) remove border_width from message dialog .ui so as to take the default border width b) retain 12 as default message dialog border for vcl widget case c) remove layour_style from message dialog button boxes so as to take the default mode (a no-op for vcl widget case) d) use gtk response ids (vcl builder will converts to vcl ones) Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154 Reviewed-on: https://gerrit.libreoffice.org/50143 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-21loplugin:changetoolsgen in svxNoel Grandin
and fix the regex in the plugin for matching += operator Change-Id: I26b3e3fac1d4ef3e756cc9431b983b5f27ee76d6 Reviewed-on: https://gerrit.libreoffice.org/50037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Number formatter: handle negative signed year date as BCEEike Rathke
Accept input -YYYY-MM-DD or -Y/M/D or M/D/-Y or D.M.-Y ... and display likewise if no era word is to be displayed. Change-Id: I199d34354d5b91dbe2a6a6ac3ae4b50d5dbde670
2017-04-13convert DateFormat to scoped enum and rename to DateOrderNoel Grandin
Change-Id: I71d7a7755a5c20d5146d1ad7e96ca22b7823173a Reviewed-on: https://gerrit.libreoffice.org/36517 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-03-22Use rtl::isAscii* instead of ctype.h is* with sal_Unicode argStephan Bergmann
Change-Id: I744f774e6e43866f1c6ef9ff8de2d9f2e183f0be
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-08-11Fix comments to match new reality: these are no longer optional parametersTor Lillqvist
Change-Id: Idf054aa4ef095ce37f05a01adf59cb450a6906c6
2016-08-11loplugin:countusersofdefaultparams in svl..unodevtoolsNoel Grandin
Change-Id: Ie3d2cf29e99b8a51b80246aafa23a92e6c3404b2 Reviewed-on: https://gerrit.libreoffice.org/28017 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-29loplugin:countusersofdefaultparams in store..svtoolsNoel Grandin
Change-Id: I15b4400bddc5a4d0e3de5dfffe18b7e493f97df6 Reviewed-on: https://gerrit.libreoffice.org/27580 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-08Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendarEike Rathke
... implementing signed years with year 0 gap. Date(31,12,-1) last day BCE Date(1,1,1) first day CE New class Date member functions: * AddYears(sal_Int16) to be used instead of aDate.SetYear(aDate.GetYear()+sal_Int16) to handle year 0 gap. * convenience GetNextYear() to be used insted of GetYear()+1 * convenience GetPrevYear() to be used insted of GetYear()-1 * AddMonths(sal_Int32) * operator=(const css::util::Date&) New class DateTime member functions: * operator=(const css::util::DateTime&) Made some conversion ctors explicit, specifically Date(sal_Int32) Adapted hopefully all places that used a sal_uInt16 year to use sal_Int16 where appropriate. Eliminated some quirks in date handling found on the fly. Added era handling to i18npool icu calendar setting interface, which missing was responsible for 0001-01-01 entered in Calc being set as -0001-01-01, hence subtracting one day resulted in -0002-12-31. Change-Id: I77b39fba9599ebd5067d7864f6c9ebe01f6f578f Reviewed-on: https://gerrit.libreoffice.org/27049 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-28loplugin:singlevalfields in variousNoel Grandin
Change-Id: Ia0d8f463a4dba9ec63aa0159441e3e607dd3bf5e Reviewed-on: https://gerrit.libreoffice.org/26738 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>