diff options
Diffstat (limited to 'basctl/source/inc')
24 files changed, 383 insertions, 167 deletions
diff --git a/basctl/source/inc/BasicColorConfig.hxx b/basctl/source/inc/BasicColorConfig.hxx new file mode 100644 index 000000000000..a393f5aedb6a --- /dev/null +++ b/basctl/source/inc/BasicColorConfig.hxx @@ -0,0 +1,99 @@ +/* -*- 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 <rtl/ustring.hxx> +#include <strings.hrc> +#include <com/sun/star/uno/Sequence.hxx> +#include <comphelper/sequence.hxx> +#include <unotools/configitem.hxx> +#include <svtools/colorcfg.hxx> +#include "colorscheme.hxx" +#include "iderid.hxx" +#include <map> + +namespace basctl +{ +// Name used to refer to the application color scheme (the one defined in Application Colors) +inline constexpr OUString DEFAULT_SCHEME = u"COLORSCHEME_DEFAULT"_ustr; + +typedef std::map<OUString, TranslateId> SchemeTranslateIdMap; + +class BasicColorConfig : public utl::ConfigItem +{ +private: + // Name of the color scheme that is currently active + OUString m_sCurrentColorScheme; + + // Names of all available scheme names + css::uno::Sequence<OUString> m_aSchemeNames; + + // Names of default color schemes shipped with LibreOffice + css::uno::Sequence<OUString> m_aDefaultSchemes + = { "COLORSCHEME_LIBREOFFICE_LIGHT", "COLORSCHEME_LIBREOFFICE_DARK", + "COLORSCHEME_BREEZE_LIGHT", "COLORSCHEME_BREEZE_DARK", + "COLORSCHEME_SOLARIZED_LIGHT", "COLORSCHEME_SOLARIZED_DARK" }; + + // Maps the scheme names to their TranslateId + SchemeTranslateIdMap m_aTranslateIdsMap = { + { "COLORSCHEME_LIBREOFFICE_LIGHT", RID_STR_COLORSCHEME_LIGHT }, + { "COLORSCHEME_LIBREOFFICE_DARK", RID_STR_COLORSCHEME_DARK }, + { "COLORSCHEME_BREEZE_LIGHT", RID_STR_COLORSCHEME_BREEZE_LIGHT }, + { "COLORSCHEME_BREEZE_DARK", RID_STR_COLORSCHEME_BREEZE_DARK }, + { "COLORSCHEME_SOLARIZED_LIGHT", RID_STR_COLORSCHEME_SOLARIZED_LIGHT }, + { "COLORSCHEME_SOLARIZED_DARK", RID_STR_COLORSCHEME_SOLARIZED_DARK }, + }; + + // Used to get colors defined in the Application Colors dialog + const svtools::ColorConfig aColorConfig; + + virtual void ImplCommit() override; + +public: + BasicColorConfig(); + virtual ~BasicColorConfig() override; + + virtual void Notify(const css::uno::Sequence<OUString>& aPropertyNames) override; + + ColorScheme GetColorScheme(const OUString& rScheme); + css::uno::Sequence<OUString> GetColorSchemeNames() { return m_aSchemeNames; } + + // Returns the color scheme defined by the current Application Colors + ColorScheme GetAutomaticColorScheme(); + + // Returns the name of the currently active color scheme + OUString& GetCurrentColorSchemeName(); + + // Returns the current color scheme + ColorScheme GetCurrentColorScheme() { return GetColorScheme(GetCurrentColorSchemeName()); } + + // Returns true if the scheme is a scheme preinstalled with LO + bool IsDefaultScheme(const OUString& rScheme) + { + return comphelper::findValue(m_aDefaultSchemes, rScheme) != -1; + } + + // Returns the TranslateId of the scheme name + TranslateId GetSchemeTranslateId(const OUString& rScheme); +}; + +} // namespace basctl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basctl/source/inc/ColorSchemeDialog.hxx b/basctl/source/inc/ColorSchemeDialog.hxx new file mode 100644 index 000000000000..617121206e9c --- /dev/null +++ b/basctl/source/inc/ColorSchemeDialog.hxx @@ -0,0 +1,57 @@ +/* -*- 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 <utility> +#include <vcl/weld.hxx> + +namespace basctl +{ +class ModulWindowLayout; +class BasicColorConfig; + +class ColorSchemeDialog : public weld::GenericDialogController +{ +private: + VclPtr<ModulWindowLayout> m_pModulWinLayout; + OUString m_sSelectedSchemeId; + + std::unique_ptr<weld::TreeView> m_xSchemeList; + std::unique_ptr<weld::RadioButton> m_xUseAppCollors; + std::unique_ptr<weld::RadioButton> m_xUseScheme; + std::unique_ptr<weld::Button> m_xOk; + std::shared_ptr<BasicColorConfig> m_pColorConfig; + + void Init(); + + DECL_LINK(BtnOkHdl, weld::Button&, void); + DECL_LINK(OptionHdl, weld::Toggleable&, void); + DECL_LINK(SelectHdl, weld::TreeView&, void); + +public: + ColorSchemeDialog(weld::Window* pParent, VclPtr<ModulWindowLayout> pModulWinLayout); + virtual ~ColorSchemeDialog() override; + + const OUString& GetColorSchemeId() { return m_sSelectedSchemeId; } +}; + +} // namespace basctl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basctl/source/inc/IDEComboBox.hxx b/basctl/source/inc/IDEComboBox.hxx index 76d73cdf8eec..a5e7008a42e9 100644 --- a/basctl/source/inc/IDEComboBox.hxx +++ b/basctl/source/inc/IDEComboBox.hxx @@ -52,7 +52,7 @@ public: * @param nId -- this item's unique id in ToolBox * @param rTbx -- the ToolBox which contains this ComboBox */ - LibBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + LibBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx); /*! * Triggered if state was changed @@ -61,8 +61,8 @@ public: * @param eState -- enum value which contains ComboBox state * @param pState -- */ - virtual void StateChanged(sal_uInt16 nSlotID, SfxItemState eState, - const SfxPoolItem* pState) override; + virtual void StateChangedAtToolBoxControl(sal_uInt16 nSlotID, SfxItemState eState, + const SfxPoolItem* pState) override; /*! * Create combobox of Macro and Dialog Library * @@ -140,14 +140,6 @@ protected: /// Called for setting language when user selects a language in ComboBox virtual void Select() override; - /*! - * Handle keystrokes and mouse - * - * @param rNEvt represents mouse event - * @return a bool value: true if was handled, and false if there was nothing handled - */ - //TODO virtual bool PreNotify(NotifyEvent& rNEvt) override; - private: static void ReleaseFocus(); @@ -165,6 +157,12 @@ private: /// Fill up the combobox virtual void FillBox() override; + /*! + * Handle keystrokes + * + * @param rKEvt represents key event + * @return a bool value: true if was handled, and false if there was nothing handled + */ virtual bool HandleKeyInput(const KeyEvent& rKEvt) override; DECL_LINK(FocusInHdl, weld::Widget&, void); @@ -198,7 +196,7 @@ public: * @param nId -- this item's unique id in ToolBox * @param rTbx -- the ToolBox which contains this ComboBox */ - LanguageBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + LanguageBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx); /*! * Triggered if state was changed @@ -207,8 +205,8 @@ public: * @param eState -- enum value which contains ComboBox state * @param pState -- */ - virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) override; + virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState) override; /*! * Create ComboBox of Language * @@ -244,15 +242,13 @@ protected: /// Called for setting language when user selects a language in ComboBox virtual void Select() override; - virtual bool HandleKeyInput(const KeyEvent& rKEvt) override; - /*! - * Handle keystrokes and mouse + * Handle keystrokes * - * @param rNEvt represents mouse event + * @param rKEvt represents key event * @return a bool value: true if was handled, and false if there was nothing handled */ - //TODO virtual bool PreNotify(NotifyEvent& rNEvt) override; + virtual bool HandleKeyInput(const KeyEvent& rKEvt) override; private: /// Delete all languages from ComboBox diff --git a/basctl/source/inc/LineStatusControl.hxx b/basctl/source/inc/LineStatusControl.hxx new file mode 100644 index 000000000000..268738f821d3 --- /dev/null +++ b/basctl/source/inc/LineStatusControl.hxx @@ -0,0 +1,30 @@ +/* -*- 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/. + */ + +#pragma once + +#include <sfx2/stbitem.hxx> + +namespace basctl +{ +class LineStatusControl final : public SfxStatusBarControl +{ +public: + SFX_DECL_STATUSBAR_CONTROL(); + + LineStatusControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb); + virtual ~LineStatusControl() override; + + virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState) override; +}; + +} // namespace basctl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basctl/source/inc/accessibledialogcontrolshape.hxx b/basctl/source/inc/accessibledialogcontrolshape.hxx index 2fbf73aa4e83..3af6e3da90ee 100644 --- a/basctl/source/inc/accessibledialogcontrolshape.hxx +++ b/basctl/source/inc/accessibledialogcontrolshape.hxx @@ -22,15 +22,11 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <comphelper/accessiblecomponenthelper.hxx> -#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase.hxx> #include <vcl/vclptr.hxx> namespace vcl { class Window; } -namespace utl { - class AccessibleStateSetHelper; -} - namespace basctl { @@ -39,13 +35,11 @@ class DialogWindow; -typedef ::cppu::ImplHelper3< - css::accessibility::XAccessible, - css::lang::XServiceInfo, - css::beans::XPropertyChangeListener > AccessibleDialogControlShape_BASE; - -class AccessibleDialogControlShape final : public comphelper::OAccessibleExtendedComponentHelper, - public AccessibleDialogControlShape_BASE +class AccessibleDialogControlShape final : public cppu::ImplInheritanceHelper< + comphelper::OAccessibleExtendedComponentHelper, + css::accessibility::XAccessible, + css::lang::XServiceInfo, + css::beans::XPropertyChangeListener> { friend class AccessibleDialogWindow; @@ -71,7 +65,7 @@ private: OUString GetModelStringProperty( OUString const & pPropertyName ); - void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + void FillAccessibleStateSet( sal_Int64& rStateSet ); // OCommonAccessibleComponent virtual css::awt::Rectangle implGetBounds() override; @@ -83,12 +77,6 @@ public: AccessibleDialogControlShape (DialogWindow*, DlgEdObj*); virtual ~AccessibleDialogControlShape() override; - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - // XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& rSource ) override; @@ -104,15 +92,15 @@ public: virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; + virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override; virtual css::lang::Locale SAL_CALL getLocale( ) override; // XAccessibleComponent diff --git a/basctl/source/inc/accessibledialogwindow.hxx b/basctl/source/inc/accessibledialogwindow.hxx index 2c3a065247ac..0332b98a4175 100644 --- a/basctl/source/inc/accessibledialogwindow.hxx +++ b/basctl/source/inc/accessibledialogwindow.hxx @@ -22,7 +22,7 @@ #include <com/sun/star/accessibility/XAccessibleSelection.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <comphelper/accessiblecomponenthelper.hxx> -#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase.hxx> #include <svl/lstner.hxx> #include <tools/link.hxx> #include <vcl/vclptr.hxx> @@ -30,10 +30,6 @@ class VclSimpleEvent; class VclWindowEvent; -namespace utl { - class AccessibleStateSetHelper; -} - namespace basctl { @@ -41,16 +37,14 @@ class DialogWindow; class DlgEditor; class DlgEdModel; class DlgEdObj; +class AccessibleDialogControlShape; - -typedef ::cppu::ImplHelper3 < - css::accessibility::XAccessible, - css::accessibility::XAccessibleSelection, - css::lang::XServiceInfo > AccessibleDialogWindow_BASE; - -class AccessibleDialogWindow final : public comphelper::OAccessibleExtendedComponentHelper, - public AccessibleDialogWindow_BASE, +class AccessibleDialogWindow final : public cppu::ImplInheritanceHelper< + comphelper::OAccessibleExtendedComponentHelper, + css::accessibility::XAccessible, + css::accessibility::XAccessibleSelection, + css::lang::XServiceInfo>, public SfxListener { private: @@ -58,8 +52,8 @@ private: class ChildDescriptor { public: - DlgEdObj* pDlgEdObj; - css::uno::Reference< css::accessibility::XAccessible > rxAccessible; + DlgEdObj* pDlgEdObj; + rtl::Reference< AccessibleDialogControlShape > mxAccessible; ChildDescriptor( DlgEdObj* _pDlgEdObj ); @@ -88,7 +82,7 @@ private: DECL_LINK( WindowEventListener, VclWindowEvent&, void ); void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); - void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + void FillAccessibleStateSet( sal_Int64& rStateSet ); // OCommonAccessibleComponent virtual css::awt::Rectangle implGetBounds( ) override; @@ -103,12 +97,6 @@ public: // SfxListener virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override; @@ -118,15 +106,15 @@ public: virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; + virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override; virtual css::lang::Locale SAL_CALL getLocale( ) override; // XAccessibleComponent @@ -141,13 +129,13 @@ public: virtual OUString SAL_CALL getToolTipText( ) override; // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) override; + virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override; virtual void SAL_CALL clearAccessibleSelection() override; virtual void SAL_CALL selectAllAccessibleChildren( ) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) override; + virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nChildIndex ) override; }; } // namespace basctl diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx index 15f157565fb2..14fc68f07951 100644 --- a/basctl/source/inc/baside3.hxx +++ b/basctl/source/inc/baside3.hxx @@ -43,7 +43,7 @@ class DlgEdView; class DialogWindowLayout; class ObjectCatalog; -bool implImportDialog(weld::Window* pWin, const OUString& rCurPath, const ScriptDocument& rDocument, const OUString& rLibName); +bool implImportDialog(weld::Window* pWin, const ScriptDocument& rDocument, const OUString& rLibName); class DialogWindow: public BaseWindow { @@ -51,7 +51,6 @@ private: DialogWindowLayout& m_rLayout; std::unique_ptr<DlgEditor> m_pEditor; std::unique_ptr<SfxUndoManager> m_pUndoMgr; // never nullptr - OUString m_sCurPath; sal_uInt16 m_nControlSlotId; protected: @@ -68,7 +67,7 @@ protected: static void NotifyUndoActionHdl( std::unique_ptr<SdrUndoAction> ); virtual void DoInit() override; - virtual void DoScroll( ScrollBar* pCurScrollBar ) override; + virtual void DoScroll( Scrollable* pCurScrollBar ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; void InitSettings(); @@ -108,7 +107,7 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; - virtual char const* GetHid () const override; + virtual OUString GetHid () const override; virtual ItemType GetType () const override; }; diff --git a/basctl/source/inc/basidectrlr.hxx b/basctl/source/inc/basidectrlr.hxx index 7db0824df744..a32e1ffd94af 100644 --- a/basctl/source/inc/basidectrlr.hxx +++ b/basctl/source/inc/basidectrlr.hxx @@ -45,8 +45,8 @@ public: // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // XTypeProvider ( ::SfxBaseController ) virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index f3127186ce93..afaa47c88ff4 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -26,7 +26,7 @@ #include <sfx2/viewsh.hxx> #include <svx/ifaceids.hxx> #include <svl/srchitem.hxx> -#include <vcl/scrbar.hxx> +#include <svtools/scrolladaptor.hxx> #include <map> #include <memory> #include <string_view> @@ -40,6 +40,12 @@ class StarBASIC; namespace basctl { + +// Used to control zoom level +constexpr sal_uInt16 MIN_ZOOM_LEVEL = 50; +constexpr sal_uInt16 DEFAULT_ZOOM_LEVEL = 100; +constexpr sal_uInt16 MAX_ZOOM_LEVEL = 400; + class Layout; class ModulWindow; class ModulWindowLayout; @@ -48,6 +54,7 @@ class DialogWindowLayout; class TabBar; class BaseWindow; class LocalizationMgr; +class BasicColorConfig; class Shell : public SfxViewShell, @@ -59,7 +66,7 @@ public: private: friend class JavaDebuggingListenerImpl; friend class LocalizationMgr; - friend bool implImportDialog(weld::Window* pWin, const OUString& rCurPath, const ScriptDocument& rDocument, const OUString& rLibName); // defined in baside3.cxx + friend bool implImportDialog(weld::Window* pWin, const ScriptDocument& rDocument, const OUString& rLibName); // defined in baside3.cxx WindowTable aWindowTable; sal_uInt16 nCurKey; @@ -68,12 +75,16 @@ private: OUString m_aCurLibName; std::shared_ptr<LocalizationMgr> m_pCurLocalizationMgr; - VclPtr<ScrollBar> aHScrollBar; - VclPtr<ScrollBar> aVScrollBar; - VclPtr<ScrollBarBox> aScrollBarBox; + // Current value of the zoom slider + sal_uInt16 m_nCurrentZoomSliderValue; + VclPtr<ScrollAdaptor> aHScrollBar; + VclPtr<ScrollAdaptor> aVScrollBar; VclPtr<TabBar> pTabBar; // basctl::TabBar bool bCreatingWindow; + // Basic editor color configuration + std::shared_ptr<BasicColorConfig> m_aColorConfig; + // layout windows VclPtr<ModulWindowLayout> pModulLayout; VclPtr<DialogWindowLayout> pDialogLayout; @@ -93,13 +104,13 @@ private: void Init(); void InitTabBar(); void InitScrollBars(); + void InitZoomLevel(); void CheckWindows(); void RemoveWindows( const ScriptDocument& rDocument, std::u16string_view rLibName ); void UpdateWindows(); static void InvalidateBasicIDESlots(); void StoreAllWindowData( bool bPersistent = true ); void SetMDITitle(); - void EnableScrollbars( bool bEnable ); void SetCurLib( const ScriptDocument& rDocument, const OUString& aLibName, bool bUpdateWindows = true , bool bCheck = true ); void SetCurLibForLocalization( const ScriptDocument& rDocument, const OUString& aLibName ); @@ -149,7 +160,7 @@ private: static void InitInterface_Impl(); public: - Shell( SfxViewFrame *pFrame, SfxViewShell *pOldSh ); + Shell(SfxViewFrame& rFrame, SfxViewShell *pOldSh); virtual ~Shell() override; BaseWindow* GetCurWindow() const { return pCurWin; } @@ -164,12 +175,17 @@ public: SfxUndoManager* GetUndoManager() override; + void SetGlobalEditorZoomLevel(sal_uInt16 nNewZoomLevel); + sal_uInt16 GetCurrentZoomSliderValue() { return m_nCurrentZoomSliderValue; } + static sal_uInt16 GetMinZoom() { return MIN_ZOOM_LEVEL; } + static sal_uInt16 GetMaxZoom() { return MAX_ZOOM_LEVEL; } + virtual css::uno::Reference< css::view::XRenderable > GetRenderable() override; // virtual sal_uInt16 Print( SfxProgress &rProgress, sal_Bool bIsAPI, PrintDialog *pPrintDialog = 0 ); virtual SfxPrinter* GetPrinter( bool bCreate = false ) override; virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override; - virtual OUString GetSelectionText( bool bCompleteWords = false ) override; + virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ) override; virtual bool HasSelection( bool bText = true ) const override; void GetState( SfxItemSet& ); @@ -208,6 +224,8 @@ public: void UpdateObjectCatalog () { aObjectCatalog->UpdateEntries(); } void RemoveWindow (BaseWindow* pWindow, bool bDestroy, bool bAllowChangeCurWindow = true); + + const std::shared_ptr<BasicColorConfig>& GetColorConfig() const { return m_aColorConfig; } }; } // namespace basctl diff --git a/basctl/source/inc/basobj.hxx b/basctl/source/inc/basobj.hxx index 46d0f9392896..70c603d4548a 100644 --- a/basctl/source/inc/basobj.hxx +++ b/basctl/source/inc/basobj.hxx @@ -32,8 +32,7 @@ namespace weld { class Widget; class Window; } namespace basctl { - void Organize(weld::Window* pParent, sal_Int16 tabId); - + void Organize(weld::Window* pParent, const css::uno::Reference<css::frame::XFrame>& xDocFrame, sal_Int16 tabId); // help methods for the general use: SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName ); @@ -45,7 +44,7 @@ namespace basctl void BasicStopped( bool* pbAppWindowDisabled = nullptr, bool* pbDispatcherLocked = nullptr, sal_uInt16* pnWaitCount = nullptr, SfxUInt16Item** ppSWActionCount = nullptr, SfxUInt16Item** ppSWLockViewCount = nullptr ); - bool IsValidSbxName( const OUString& rName ); + bool IsValidSbxName( std::u16string_view rName ); BasicManager* FindBasicManager( StarBASIC const * pLib ); diff --git a/basctl/source/inc/bastype2.hxx b/basctl/source/inc/bastype2.hxx index 3eb4de6beec9..22321b309757 100644 --- a/basctl/source/inc/bastype2.hxx +++ b/basctl/source/inc/bastype2.hxx @@ -45,7 +45,6 @@ namespace o3tl { namespace basctl { -using namespace ::com::sun::star::uno; enum EntryType { @@ -90,7 +89,7 @@ private: public: DocumentEntry ( - ScriptDocument const& rDocument, + ScriptDocument aDocument, LibraryLocation eLocation, EntryType eType = OBJ_TYPE_DOCUMENT ); @@ -109,7 +108,7 @@ public: LibEntry ( ScriptDocument const& rDocument, LibraryLocation eLocation, - OUString const& rLibName + OUString aLibName ); virtual ~LibEntry () override; @@ -129,20 +128,20 @@ class EntryDescriptor public: EntryDescriptor (); EntryDescriptor ( - ScriptDocument const& rDocument, + ScriptDocument aDocument, LibraryLocation eLocation, - OUString const& rLibName, - OUString const& rLibSubName, - OUString const& rName, + OUString aLibName, + OUString aLibSubName, + OUString aName, EntryType eType ); EntryDescriptor ( - ScriptDocument const& rDocument, + ScriptDocument aDocument, LibraryLocation eLocation, - OUString const& rLibName, - OUString const& rLibSubName, - OUString const& rName, - OUString const& rMethodName, + OUString aLibName, + OUString aLibSubName, + OUString aName, + OUString aMethodName, EntryType eType ); @@ -222,7 +221,7 @@ public: EntryDescriptor GetEntryDescriptor(const weld::TreeIter* pEntry); static ItemType ConvertType (EntryType eType); - bool IsValidEntry(weld::TreeIter& rEntry); + bool IsValidEntry(const weld::TreeIter& rEntry); void AddEntry(const OUString& rText, const OUString& rImage, const weld::TreeIter* pParent, bool bChildrenOnDemand, std::unique_ptr<Entry>&& rUserData, diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx index fecebced52ee..513fbce3a41c 100644 --- a/basctl/source/inc/bastypes.hxx +++ b/basctl/source/inc/bastypes.hxx @@ -21,6 +21,7 @@ #include "scriptdocument.hxx" #include "sbxitem.hxx" +#include <svtools/scrolladaptor.hxx> #include <svtools/tabbar.hxx> #include <basic/sbdef.hxx> #include <vcl/dockwin.hxx> @@ -49,11 +50,11 @@ class Layout; class ModulWindow; class DialogWindow; -#define LINE_SEP_CR 0x0D -#define LINE_SEP 0x0A +constexpr auto LINE_SEP_CR = 0x0D; +constexpr auto LINE_SEP = 0x0A; // Implementation: baside2b.cxx -sal_Int32 searchEOL( const OUString& rStr, sal_Int32 fromIndex ); +sal_Int32 searchEOL( std::u16string_view rStr, sal_Int32 fromIndex ); // Meaning of bToBeKilled: // While being in a reschedule-loop, I may not destroy the window. @@ -78,10 +79,10 @@ struct BasicStatus // basctl::DockingWindow -- special docking window for the Basic IDE // Not to be confused with ::DockingWindow from vcl. -class DockingWindow : public ::DockingWindow +class DockingWindow : public ResizableDockingWindow { public: - DockingWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OString& rID); + DockingWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OUString& rID); DockingWindow(Layout* pParent); virtual ~DockingWindow() override; virtual void dispose() override; @@ -102,7 +103,6 @@ protected: protected: std::unique_ptr<weld::Builder> m_xBuilder; - VclPtr<vcl::Window> m_xVclContentArea; std::unique_ptr<weld::Container> m_xContainer; private: @@ -156,10 +156,11 @@ class EntryDescriptor; class BaseWindow : public vcl::Window { private: - VclPtr<ScrollBar> pShellHScrollBar; - VclPtr<ScrollBar> pShellVScrollBar; + VclPtr<ScrollAdaptor> pShellHScrollBar; + VclPtr<ScrollAdaptor> pShellVScrollBar; - DECL_LINK( ScrollHdl, ScrollBar*, void ); + DECL_LINK( VertScrollHdl, weld::Scrollbar&, void ); + DECL_LINK( HorzScrollHdl, weld::Scrollbar&, void ); int nStatus; ScriptDocument m_aDocument; @@ -170,10 +171,10 @@ private: friend class DialogWindow; protected: - virtual void DoScroll( ScrollBar* pCurScrollBar ); + virtual void DoScroll(Scrollable* pCurScrollBar); public: - BaseWindow( vcl::Window* pParent, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName ); + BaseWindow( vcl::Window* pParent, ScriptDocument aDocument, OUString aLibName, OUString aName ); virtual ~BaseWindow() override; virtual void dispose() override; @@ -181,10 +182,11 @@ public: virtual void DoInit(); virtual void Activating () = 0; virtual void Deactivating () = 0; - void GrabScrollBars( ScrollBar* pHScroll, ScrollBar* pVScroll ); + void GrabScrollBars(ScrollAdaptor* pHScroll, ScrollAdaptor* pVScroll); - ScrollBar* GetHScrollBar() const { return pShellHScrollBar; } - ScrollBar* GetVScrollBar() const { return pShellVScrollBar; } + ScrollAdaptor* GetHScrollBar() const { return pShellHScrollBar.get(); } + ScrollAdaptor* GetVScrollBar() const { return pShellVScrollBar.get(); } + void ShowShellScrollBars(bool bVisible = true); virtual void ExecuteCommand (SfxRequest&); virtual void ExecuteGlobal (SfxRequest&); @@ -209,6 +211,7 @@ public: virtual void SetReadOnly (bool bReadOnly); virtual bool IsReadOnly(); + void ShowReadOnlyInfoBar(); int GetStatus() const { return nStatus; } void SetStatus(int n) { nStatus = n; } @@ -234,7 +237,7 @@ public: void SetName( const OUString& aName ) { m_aName = aName; } virtual void OnNewDocument (); - virtual char const* GetHid () const = 0; + virtual OUString GetHid () const = 0; virtual ItemType GetType () const = 0; void InsertLibInfo () const; bool Is (ScriptDocument const&, std::u16string_view, std::u16string_view, ItemType, bool bFindSuspended); @@ -261,7 +264,7 @@ private: OUString m_aLibName; public: - Key (ScriptDocument const&, OUString const& rLibName); + Key (ScriptDocument , OUString aLibName); public: bool operator == (Key const&) const; struct Hash @@ -279,7 +282,7 @@ public: ItemType m_eCurrentType; public: - Item (OUString const& rCurrentName, ItemType eCurrentType); + Item (OUString aCurrentName, ItemType eCurrentType); const OUString& GetCurrentName() const { return m_aCurrentName; } ItemType GetCurrentType() const { return m_eCurrentType; } }; diff --git a/basctl/source/inc/colorscheme.hxx b/basctl/source/inc/colorscheme.hxx new file mode 100644 index 000000000000..96567f79f7ff --- /dev/null +++ b/basctl/source/inc/colorscheme.hxx @@ -0,0 +1,45 @@ +/* -*- 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 <tools/color.hxx> + +namespace basctl +{ +// Defines a single color scheme +typedef struct +{ + OUString m_sSchemeName; + bool m_bIsDefault; + Color m_aGenericFontColor; + Color m_aIdentifierColor; + Color m_aNumberColor; + Color m_aStringColor; + Color m_aCommentColor; + Color m_aErrorColor; + Color m_aOperatorColor; + Color m_aKeywordColor; + Color m_aBackgroundColor; + Color m_aLineHighlightColor; +} ColorScheme; + +} // namespace basctl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx index 82d3a14f605d..c50faf51b36c 100644 --- a/basctl/source/inc/dlged.hxx +++ b/basctl/source/inc/dlged.hxx @@ -36,7 +36,7 @@ #include <memory> -class ScrollBar; +class ScrollAdaptor; class Printer; class KeyEvent; class MouseEvent; @@ -48,9 +48,8 @@ namespace basctl class DialogWindowLayout; -#define DLGED_PAGE_WIDTH_MIN 1280 -#define DLGED_PAGE_HEIGHT_MIN 1024 - +constexpr auto DLGED_PAGE_WIDTH_MIN = 1280; +constexpr auto DLGED_PAGE_HEIGHT_MIN = 1024; // DlgEdHint @@ -108,12 +107,12 @@ private: static void Print( Printer* pPrinter, const OUString& rTitle ); private: - VclPtr<ScrollBar> pHScroll; - VclPtr<ScrollBar> pVScroll; + VclPtr<ScrollAdaptor> pHScroll; + VclPtr<ScrollAdaptor> pVScroll; std::unique_ptr<DlgEdModel> pDlgEdModel; // never nullptr DlgEdPage* pDlgEdPage; // never nullptr std::unique_ptr<DlgEdView> pDlgEdView; // never nullptr - DlgEdForm* pDlgEdForm; // never nullptr + rtl::Reference<DlgEdForm> pDlgEdForm; // never nullptr css::uno::Reference< css::container::XNameContainer > m_xUnoControlDialogModel; css::uno::Reference< css::awt::XControlContainer > m_xControlContainer; css::uno::Sequence< css::datatransfer::DataFlavor > m_ClipboardDataFlavors; @@ -150,10 +149,10 @@ public: css::uno::Reference< css::awt::XControlContainer > const & GetWindowControlContainer(); - void SetScrollBars( ScrollBar* pHScroll, ScrollBar* pVScroll ); + void SetScrollBars(ScrollAdaptor* pHScroll, ScrollAdaptor* pVScroll); void InitScrollBars(); - ScrollBar* GetHScroll() const { return pHScroll; } - ScrollBar* GetVScroll() const { return pVScroll; } + ScrollAdaptor* GetHScroll() const { return pHScroll; } + ScrollAdaptor* GetVScroll() const { return pVScroll; } void DoScroll(); void UpdateScrollBars(); diff --git a/basctl/source/inc/dlgeddef.hxx b/basctl/source/inc/dlgeddef.hxx index 0cb0a6dc8573..c10ef16cd8d3 100644 --- a/basctl/source/inc/dlgeddef.hxx +++ b/basctl/source/inc/dlgeddef.hxx @@ -19,27 +19,27 @@ #pragma once -#include <svx/svdobjkind.hxx> +#include <rtl/ustring.hxx> namespace basctl { // control properties #define DLGED_PROP_BACKGROUNDCOLOR "BackgroundColor" -#define DLGED_PROP_DROPDOWN "Dropdown" -#define DLGED_PROP_FORMATSSUPPLIER "FormatsSupplier" -#define DLGED_PROP_HEIGHT "Height" -#define DLGED_PROP_LABEL "Label" -#define DLGED_PROP_NAME "Name" -#define DLGED_PROP_ORIENTATION "Orientation" -#define DLGED_PROP_POSITIONX "PositionX" -#define DLGED_PROP_POSITIONY "PositionY" -#define DLGED_PROP_STEP "Step" -#define DLGED_PROP_TABINDEX "TabIndex" +inline constexpr OUString DLGED_PROP_DROPDOWN = u"Dropdown"_ustr; +inline constexpr OUString DLGED_PROP_FORMATSSUPPLIER = u"FormatsSupplier"_ustr; +inline constexpr OUString DLGED_PROP_HEIGHT = u"Height"_ustr; +inline constexpr OUString DLGED_PROP_LABEL = u"Label"_ustr; +inline constexpr OUString DLGED_PROP_NAME = u"Name"_ustr; +inline constexpr OUString DLGED_PROP_ORIENTATION = u"Orientation"_ustr; +inline constexpr OUString DLGED_PROP_POSITIONX = u"PositionX"_ustr; +inline constexpr OUString DLGED_PROP_POSITIONY = u"PositionY"_ustr; +inline constexpr OUString DLGED_PROP_STEP = u"Step"_ustr; +inline constexpr OUString DLGED_PROP_TABINDEX = u"TabIndex"_ustr; #define DLGED_PROP_TEXTCOLOR "TextColor" #define DLGED_PROP_TEXTLINECOLOR "TextLineColor" -#define DLGED_PROP_WIDTH "Width" -#define DLGED_PROP_DECORATION "Decoration" +inline constexpr OUString DLGED_PROP_WIDTH = u"Width"_ustr; +inline constexpr OUString DLGED_PROP_DECORATION = u"Decoration"_ustr; } // namespace basctl diff --git a/basctl/source/inc/dlgedfac.hxx b/basctl/source/inc/dlgedfac.hxx index f780bc22bb95..5e583ada1729 100644 --- a/basctl/source/inc/dlgedfac.hxx +++ b/basctl/source/inc/dlgedfac.hxx @@ -32,10 +32,10 @@ class DlgEdFactory const css::uno::Reference<css::frame::XModel> mxModel; public: - DlgEdFactory(const css::uno::Reference<css::frame::XModel>& xModel); + DlgEdFactory(css::uno::Reference<css::frame::XModel> xModel); ~DlgEdFactory() COVERITY_NOEXCEPT_FALSE; - DECL_LINK(MakeObject, SdrObjCreatorParams, SdrObject*); + DECL_LINK(MakeObject, SdrObjCreatorParams, rtl::Reference<SdrObject>); }; } // namespace basctl diff --git a/basctl/source/inc/dlgedmod.hxx b/basctl/source/inc/dlgedmod.hxx index 2960135e0d3d..24a97905b1d3 100644 --- a/basctl/source/inc/dlgedmod.hxx +++ b/basctl/source/inc/dlgedmod.hxx @@ -37,7 +37,7 @@ public: DlgEdModel(); virtual ~DlgEdModel() override; - virtual SdrPage* AllocPage(bool bMasterPage) override; + virtual rtl::Reference<SdrPage> AllocPage(bool bMasterPage) override; }; } // namespace basctl diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx index 8ae88ef5c80a..a8c249adec16 100644 --- a/basctl/source/inc/dlgedobj.hxx +++ b/basctl/source/inc/dlgedobj.hxx @@ -50,7 +50,7 @@ class DlgEdObj: public SdrUnoObj private: bool bIsListening; - DlgEdForm* pDlgEdForm; + rtl::Reference<DlgEdForm> pDlgEdForm; css::uno::Reference< css::beans::XPropertyChangeListener> m_xPropertyChangeListener; css::uno::Reference< css::container::XContainerListener> m_xContainerListener; @@ -59,6 +59,8 @@ private: protected: DlgEdObj(SdrModel& rSdrModel); + // copy constructor + DlgEdObj(SdrModel& rSdrModel, DlgEdObj const & rSource); DlgEdObj( SdrModel& rSdrModel, const OUString& rModelName, @@ -91,22 +93,16 @@ protected: sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut ); public: - DlgEdObj(DlgEdObj const &) = delete; // due to SdrUnoObj - DlgEdObj(DlgEdObj &&) = delete; // due to SdrUnoObj - DlgEdObj & operator =(DlgEdObj const &) = default; - DlgEdObj & operator =(DlgEdObj &&) = default; - void SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; } - DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; } + DlgEdForm* GetDlgEdForm() const { return pDlgEdForm.get(); } virtual SdrInventor GetObjInventor() const override; virtual SdrObjKind GetObjIdentifier() const override; - virtual DlgEdObj* CloneSdrObject(SdrModel& rTargetModel) const override; // not working yet - void clonedFrom(const DlgEdObj* _pSource); // not working yet + virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override; // not working yet // FullDrag support - virtual SdrObjectUniquePtr getFullDragClone() const override; + virtual rtl::Reference<SdrObject> getFullDragClone() const override; bool supportsService( OUString const & serviceName ) const; OUString GetDefaultName() const; diff --git a/basctl/source/inc/dlgedpage.hxx b/basctl/source/inc/dlgedpage.hxx index 7b8d48faa331..91efc12edd70 100644 --- a/basctl/source/inc/dlgedpage.hxx +++ b/basctl/source/inc/dlgedpage.hxx @@ -39,7 +39,7 @@ public: explicit DlgEdPage(DlgEdModel& rModel, bool bMasterPage = false); virtual ~DlgEdPage() override; - virtual SdrPage* CloneSdrPage(SdrModel& rTargetModel) const override; + virtual rtl::Reference<SdrPage> CloneSdrPage(SdrModel& rTargetModel) const override; void SetDlgEdForm(DlgEdForm* pForm) { pDlgEdForm = pForm; } DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; } diff --git a/basctl/source/inc/docsignature.hxx b/basctl/source/inc/docsignature.hxx index 94e7db2224dd..1681807d390e 100644 --- a/basctl/source/inc/docsignature.hxx +++ b/basctl/source/inc/docsignature.hxx @@ -20,7 +20,6 @@ #include <sfx2/signaturestate.hxx> #include <vcl/weld.hxx> -#include <memory> class SfxObjectShell; @@ -40,7 +39,6 @@ namespace basctl which does not support being signed, the DocumentSignature instance is invalid afterwards. */ explicit DocumentSignature (ScriptDocument const&); - ~DocumentSignature(); /** determines whether the instance is valid diff --git a/basctl/source/inc/iderid.hxx b/basctl/source/inc/iderid.hxx index 5d18586079e5..83cbc3d0c4aa 100644 --- a/basctl/source/inc/iderid.hxx +++ b/basctl/source/inc/iderid.hxx @@ -20,10 +20,11 @@ #pragma once #include <rtl/ustring.hxx> +#include <unotools/resmgr.hxx> namespace basctl { -OUString IDEResId(const char* pId); +OUString IDEResId(TranslateId aId); } // namespace basctl diff --git a/basctl/source/inc/localizationmgr.hxx b/basctl/source/inc/localizationmgr.hxx index 847ef0f75729..3e2ff0fc58a8 100644 --- a/basctl/source/inc/localizationmgr.hxx +++ b/basctl/source/inc/localizationmgr.hxx @@ -72,7 +72,7 @@ class LocalizationMgr void implEnableDisableResourceForAllLibraryDialogs( HandleResourceMode eMode ); public: - LocalizationMgr(Shell*, ScriptDocument const&, OUString const& aLibName, + LocalizationMgr(Shell*, ScriptDocument , OUString aLibName, const css::uno::Reference < css::resource::XStringResourceManager >& xStringResourceManager ); const css::uno::Reference< css::resource::XStringResourceManager >& getStringResourceManager() const diff --git a/basctl/source/inc/managelang.hxx b/basctl/source/inc/managelang.hxx index 722ec60c46ac..58dd4189057a 100644 --- a/basctl/source/inc/managelang.hxx +++ b/basctl/source/inc/managelang.hxx @@ -19,6 +19,7 @@ #pragma once +#include <utility> #include <vcl/weld.hxx> class SvxLanguageBox; @@ -33,9 +34,9 @@ struct LanguageEntry css::lang::Locale m_aLocale; bool m_bIsDefault; - LanguageEntry( const css::lang::Locale& _rLocale, + LanguageEntry( css::lang::Locale _aLocale, bool _bIsDefault ) : - m_aLocale( _rLocale ), + m_aLocale(std::move( _aLocale )), m_bIsDefault( _bIsDefault ) {} }; @@ -65,7 +66,7 @@ private: DECL_LINK(SelectHdl, weld::TreeView&, void); public: - ManageLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> const & _pLMgr); + ManageLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> _pLMgr); virtual ~ManageLanguageDialog() override; }; @@ -86,7 +87,7 @@ private: std::unique_ptr<SvxLanguageBox> m_xLanguageCB; public: - SetDefaultLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> const & xLMgr); + SetDefaultLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> xLMgr); virtual ~SetDefaultLanguageDialog() override; css::uno::Sequence< css::lang::Locale > GetLocales() const; diff --git a/basctl/source/inc/sbxitem.hxx b/basctl/source/inc/sbxitem.hxx index e5f8d65d900f..941ffd3e0ee9 100644 --- a/basctl/source/inc/sbxitem.hxx +++ b/basctl/source/inc/sbxitem.hxx @@ -44,8 +44,8 @@ class SbxItem : public SfxPoolItem public: static SfxPoolItem* CreateDefault(); - SbxItem(sal_uInt16 nWhich, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, ItemType); - SbxItem(sal_uInt16 nWhich, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, const OUString& aMethodName, ItemType eType); + SbxItem(sal_uInt16 nWhich, ScriptDocument aDocument, OUString aLibName, OUString aName, ItemType); + SbxItem(sal_uInt16 nWhich, ScriptDocument aDocument, OUString aLibName, OUString aName, OUString aMethodName, ItemType eType); virtual SbxItem* Clone(SfxItemPool *pPool = nullptr) const override; virtual bool operator==(const SfxPoolItem&) const override; |