diff options
Diffstat (limited to 'dbaccess/source/ui/inc')
123 files changed, 1243 insertions, 2006 deletions
diff --git a/dbaccess/source/ui/inc/AppElementType.hxx b/dbaccess/source/ui/inc/AppElementType.hxx index bcc0d3052fc2..b7265e5af663 100644 --- a/dbaccess/source/ui/inc/AppElementType.hxx +++ b/dbaccess/source/ui/inc/AppElementType.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_APPELEMENTTYPE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_APPELEMENTTYPE_HXX +#pragma once #include <com/sun/star/sdb/application/DatabaseObject.hpp> @@ -35,21 +34,20 @@ namespace dbaui E_ELEMENT_TYPE_COUNT = E_NONE }; - enum PreviewMode + enum class PreviewMode { - E_PREVIEWNONE = 0, - E_DOCUMENT = 1, - E_DOCUMENTINFO = 2 + NONE = 0, + Document = 1, + DocumentInfo = 2 }; - enum ElementOpenMode + enum class ElementOpenMode { - E_OPEN_NORMAL, - E_OPEN_DESIGN, - E_OPEN_FOR_MAIL + Normal, + Design, + Mail }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_APPELEMENTTYPE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/ChildWindow.hxx b/dbaccess/source/ui/inc/ChildWindow.hxx new file mode 100644 index 000000000000..c2f68ac46f78 --- /dev/null +++ b/dbaccess/source/ui/inc/ChildWindow.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 <vcl/weld.hxx> + +namespace dbaui +{ +class OChildWindow +{ +protected: + OChildWindow(weld::Container* pParent, const OUString& rUIXMLDescription, const OUString& rID); + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xContainer; + +public: + virtual ~OChildWindow(); + + virtual void GrabFocus() = 0; + + virtual bool HasChildPathFocus() const = 0; + + void Enable(bool bEnable) { m_xContainer->set_sensitive(bEnable); } + + void SetHelpId(const OUString& rHelpId) { m_xContainer->set_help_id(rHelpId); } + + void Show() { m_xContainer->show(); } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/dbaccess/source/ui/inc/CollectionView.hxx b/dbaccess/source/ui/inc/CollectionView.hxx index 7d693329fefc..8162dcd2d676 100644 --- a/dbaccess/source/ui/inc/CollectionView.hxx +++ b/dbaccess/source/ui/inc/CollectionView.hxx @@ -17,14 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_COLLECTIONVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_COLLECTIONVIEW_HXX +#pragma once #include <vcl/weld.hxx> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +namespace ucbhelper { class CommandEnvironment; } + namespace dbaui { /* this class allows to browse through the collection of forms and reports @@ -33,7 +34,7 @@ namespace dbaui { css::uno::Reference< css::ucb::XContent> m_xContent; css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::Reference< css::ucb::XCommandEnvironment > m_xCmdEnv; + rtl::Reference< ::ucbhelper::CommandEnvironment > m_xCmdEnv; bool m_bCreateForm; std::unique_ptr<weld::Label> m_xFTCurrentPath; @@ -56,13 +57,11 @@ namespace dbaui OCollectionView(weld::Window * pParent, const css::uno::Reference< css::ucb::XContent>& _xContent, const OUString& _sDefaultName, - const css::uno::Reference< css::uno::XComponentContext >& _rxContext); + css::uno::Reference< css::uno::XComponentContext > _xContext); virtual ~OCollectionView() override; const css::uno::Reference< css::ucb::XContent>& getSelectedFolder() const { return m_xContent;} OUString getName() const; }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_COLLECTIONVIEW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index 1b6d4a5fd8a8..e68b99067e8c 100644 --- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx +++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx @@ -16,13 +16,13 @@ * 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_DBACCESS_SOURCE_UI_INC_COLUMNCONTROLWINDOW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_COLUMNCONTROLWINDOW_HXX +#pragma once #include "FieldDescControl.hxx" #include "TypeInfo.hxx" #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XNumberFormatter.hpp> +#include <vcl/InterimItemWindow.hxx> namespace dbaui { @@ -50,11 +50,11 @@ namespace dbaui virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) override; virtual bool isAutoIncrementValueEnabled() const override; virtual OUString getAutoIncrementValue() const override; - virtual void CellModified(long nRow, sal_uInt16 nColId ) override; + virtual void CellModified(sal_Int32 nRow, sal_uInt16 nColId ) override; public: - OColumnControlWindow(vcl::Window* pParent - ,const css::uno::Reference< css::uno::XComponentContext>& _rxContext); + OColumnControlWindow(weld::Container* pParent, + const css::uno::Reference< css::uno::XComponentContext>& _rxContext); void setConnection(const css::uno::Reference< css::sdbc::XConnection>& _xCon); @@ -63,7 +63,20 @@ namespace dbaui virtual const OTypeInfoMap* getTypeInfo() const override; TOTypeInfoSP const & getDefaultTyp() const; }; + + class OColumnControlTopLevel final : public InterimItemWindow + { + std::unique_ptr<OColumnControlWindow> m_xControl; + public: + OColumnControlTopLevel(vcl::Window* pParent, + const css::uno::Reference< css::uno::XComponentContext>& _rxContext); + virtual void dispose() override; + + OColumnControlWindow& GetControl() { return *m_xControl; } + + virtual void GetFocus() override; + }; + } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_COLUMNCONTROLWINDOW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx index 89dd1dff21e0..360395f94b6e 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_CONNECTIONLINE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINE_HXX +#pragma once #include <tools/gen.hxx> #include "ConnectionLineData.hxx" @@ -46,7 +45,7 @@ namespace dbaui Point m_aSourceDescrLinePos, m_aDestDescrLinePos; public: - OConnectionLine( OTableConnection* pConn, OConnectionLineDataRef const & pLineData ); + OConnectionLine( OTableConnection* pConn, OConnectionLineDataRef pLineData ); OConnectionLine( const OConnectionLine& rLine ); ~OConnectionLine(); @@ -68,6 +67,5 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx index 4365e7134053..ad1f4cc7c616 100644 --- a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx +++ b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx @@ -16,26 +16,24 @@ * 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_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEACCESS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEACCESS_HXX +#pragma once #include "TableConnection.hxx" +#include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> -#include <cppuhelper/implbase2.hxx> -#include <toolkit/awt/vclxaccessiblecomponent.hxx> +#include <cppuhelper/implbase.hxx> +#include <vcl/accessibility/vclxaccessiblecomponent.hxx> #include <vcl/vclptr.hxx> +using css::accessibility::AccessibleRelationType; + namespace dbaui { - typedef ::cppu::ImplHelper2< css::accessibility::XAccessibleRelationSet, - css::accessibility::XAccessible - > OConnectionLineAccess_BASE; - class OTableConnection; /** the class OConnectionLineAccess represents the accessible object for the connection between two table windows like they are used in the QueryDesign and the RelationDesign */ - class OConnectionLineAccess : public VCLXAccessibleComponent - , public OConnectionLineAccess_BASE + class OConnectionLineAccess : public cppu::ImplInheritanceHelper<VCLXAccessibleComponent, + css::accessibility::XAccessibleRelationSet> { VclPtr<const OTableConnection> m_pLine; // the window which I should give accessibility to protected: @@ -46,48 +44,29 @@ namespace dbaui public: OConnectionLineAccess(OTableConnection* _pLine); - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual void SAL_CALL acquire( ) throw () override - { // here inline is allowed because we do not use this class outside this dll - VCLXAccessibleComponent::acquire( ); - } - virtual void SAL_CALL release( ) throw () override - { // here inline is allowed because we do not use this class outside this dll - VCLXAccessibleComponent::release( ); - } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; - // XAccessible - 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_Int32 SAL_CALL getAccessibleIndexInParent( ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; + // OAccessible + virtual css::awt::Rectangle implGetBounds() override; + // XAccessibleComponent virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; - virtual css::awt::Rectangle SAL_CALL getBounds( ) override; - virtual css::awt::Point SAL_CALL getLocation( ) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override; - virtual css::awt::Size SAL_CALL getSize( ) override; // XAccessibleRelationSet virtual sal_Int32 SAL_CALL getRelationCount( ) override; virtual css::accessibility::AccessibleRelation SAL_CALL getRelation( sal_Int32 nIndex ) override; - virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) override; - virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType( sal_Int16 aRelationType ) override; + virtual sal_Bool SAL_CALL containsRelation(AccessibleRelationType eRelationType) override; + virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType(AccessibleRelationType eRelationType) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEACCESS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/ConnectionLineData.hxx b/dbaccess/source/ui/inc/ConnectionLineData.hxx index 4a3f16c86c77..2a41c93d9aab 100644 --- a/dbaccess/source/ui/inc/ConnectionLineData.hxx +++ b/dbaccess/source/ui/inc/ConnectionLineData.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEDATA_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEDATA_HXX +#pragma once #include "QEnumTypes.hxx" #include <vector> @@ -49,7 +48,7 @@ namespace dbaui virtual ~OConnectionLineData() override; public: OConnectionLineData(); - OConnectionLineData( const OUString& rSourceFieldName, const OUString& rDestFieldName ); + OConnectionLineData( OUString sSourceFieldName, OUString sDestFieldName ); OConnectionLineData( const OConnectionLineData& rConnLineData ); // provide a copy of own instance (this is somehow more acceptable for me compared to a virtual assignment operator void CopyFrom(const OConnectionLineData& rSource); @@ -77,6 +76,5 @@ namespace dbaui typedef ::rtl::Reference< OConnectionLineData > OConnectionLineDataRef; typedef std::vector< OConnectionLineDataRef > OConnectionLineDataVec; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEDATA_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx index fca471a84265..a79999647077 100644 --- a/dbaccess/source/ui/inc/DExport.hxx +++ b/dbaccess/source/ui/inc/DExport.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_DEXPORT_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DEXPORT_HXX +#pragma once #include <sal/config.h> @@ -138,7 +137,7 @@ namespace dbaui // required for automatic type recognition ODatabaseExport( sal_Int32 nRows, - const TPositions& _rColumnPositions, + TPositions&& _rColumnPositions, const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const TColumnVector* rList, @@ -154,12 +153,10 @@ namespace dbaui void enableCheckOnly() { m_bCheckOnly = true; } bool isCheckEnabled() const { return m_bCheckOnly; } - static css::uno::Reference< css::sdbc::XPreparedStatement > createPreparedStatment( const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData + static css::uno::Reference< css::sdbc::XPreparedStatement > createPreparedStatement( const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData ,const css::uno::Reference< css::beans::XPropertySet>& _xDestTable ,const TPositions& _rvColumnPositions); }; } -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/FieldControls.hxx b/dbaccess/source/ui/inc/FieldControls.hxx index 98c1a7cfcbae..7eb88ec4e077 100644 --- a/dbaccess/source/ui/inc/FieldControls.hxx +++ b/dbaccess/source/ui/inc/FieldControls.hxx @@ -16,10 +16,10 @@ * 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_DBACCESS_SOURCE_UI_INC_FIELDCONTROLS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDCONTROLS_HXX +#pragma once #include "SqlNameEdit.hxx" +#include <unotools/resmgr.hxx> namespace dbaui { @@ -29,7 +29,7 @@ namespace dbaui short m_nPos; OUString m_strHelpText; public: - OPropColumnEditCtrl(std::unique_ptr<weld::Entry> xEntry, OUString const & _rAllowedChars, const char* pHelpId, short nPosition); + OPropColumnEditCtrl(std::unique_ptr<weld::Entry> xEntry, OUString const & _rAllowedChars, TranslateId pHelpId, short nPosition); short GetPos() const { return m_nPos; } const OUString& GetHelp() const { return m_strHelpText; } @@ -42,7 +42,7 @@ namespace dbaui OUString m_strHelpText; public: - OPropEditCtrl(std::unique_ptr<weld::Entry> xEntry, const char* pHelpId, short nPosition); + OPropEditCtrl(std::unique_ptr<weld::Entry> xEntry, TranslateId pHelpId, short nPosition); void set_text(const OUString& rText) { m_xEntry->set_text(rText); } OUString get_text() const { return m_xEntry->get_text(); } @@ -62,7 +62,7 @@ namespace dbaui OUString m_strHelpText; public: - OPropNumericEditCtrl(std::unique_ptr<weld::SpinButton> xSpinButton, const char* pHelpId, short nPosition); + OPropNumericEditCtrl(std::unique_ptr<weld::SpinButton> xSpinButton, TranslateId pHelpId, short nPosition); void set_text(const OUString& rText) { m_xSpinButton->set_text(rText); } OUString get_text() const { return m_xSpinButton->get_text(); } @@ -88,7 +88,7 @@ namespace dbaui OUString m_strHelpText; public: - OPropListBoxCtrl(std::unique_ptr<weld::ComboBox> xComboBox, const char* pHelpId, short nPosition); + OPropListBoxCtrl(std::unique_ptr<weld::ComboBox> xComboBox, TranslateId pHelpId, short nPosition); virtual ~OPropListBoxCtrl() override { m_xComboBox->clear(); @@ -116,6 +116,5 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDCONTROLS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index 0de625a646a3..410e086116fe 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -16,17 +16,15 @@ * 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_DBACCESS_SOURCE_UI_INC_FIELDDESCCONTROL_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDDESCCONTROL_HXX +#pragma once -#include <vcl/idle.hxx> -#include <vcl/layout.hxx> -#include <vcl/tabpage.hxx> #include <vcl/weld.hxx> +#include "IClipBoardTest.hxx" #include "QEnumTypes.hxx" #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <com/sun/star/util/XNumberFormatter.hpp> #include "TypeInfo.hxx" +#include <unotools/resmgr.hxx> // field description columns of a table #define FIELD_NAME 1 @@ -49,13 +47,6 @@ #define FIELD_PROPERTY_TYPE 15 #define FIELD_PROPERTY_AUTOINCREMENT 16 -class FixedText; -class PushButton; -class ScrollBar; -class Button; -class ListBox; -class Control; - namespace dbaui { class OTableDesignHelpBar; @@ -65,15 +56,13 @@ namespace dbaui class OFieldDescription; class OPropColumnEditCtrl; - class OFieldDescControl : public TabPage + class OFieldDescControl : public IClipboardTest { private: - Idle m_aLayoutIdle; - VclPtr<VclVBox> m_xVclContentArea; std::unique_ptr<weld::Builder> m_xBuilder; std::unique_ptr<weld::Container> m_xContainer; - VclPtr<OTableDesignHelpBar> pHelp; + OTableDesignHelpBar* m_pHelp; weld::Widget* m_pLastFocusWindow; weld::Widget* m_pActFocusWindow; @@ -105,6 +94,8 @@ namespace dbaui std::unique_ptr<weld::Button> m_xFormat; + Link<weld::Widget&, void> m_aControlFocusIn; + TOTypeInfoSP m_pPreviousType; short m_nPos; OUString aYes; @@ -112,27 +103,27 @@ namespace dbaui sal_Int32 m_nEditWidth; - bool m_bAdded; - OFieldDescription* pActFieldDescr; DECL_LINK(FormatClickHdl, weld::Button&, void); DECL_LINK(ChangeHdl, weld::ComboBox&, void); - DECL_LINK(ImplHandleLayoutTimerHdl, Timer*, void); // used by ActivatePropertyField DECL_LINK( OnControlFocusLost, weld::Widget&, void ); DECL_LINK( OnControlFocusGot, weld::Widget&, void ); + DECL_LINK( HelpFocusOut, weld::Widget&, void ); + void UpdateFormatSample(OFieldDescription const * pFieldDescr); bool isTextFormat(const OFieldDescription* _pFieldDescr,sal_uInt32& _nFormatKey) const; - std::unique_ptr<OPropNumericEditCtrl> CreateNumericControl(const OString& rId, const char* pHelpId, short _nProperty, const OString& _sHelpId); - void InitializeControl(weld::Widget* _pControl,const OString& _sHelpId); - void InitializeControl(OPropListBoxCtrl* _pControl,const OString& _sHelpId,bool _bAddChangeHandler); + std::unique_ptr<OPropNumericEditCtrl> CreateNumericControl(const OUString& rId, TranslateId pHelpId, short _nProperty, const OUString& _sHelpId); + void InitializeControl(weld::Widget* _pControl,const OUString& _sHelpId); + void InitializeControl(OPropListBoxCtrl* _pControl,const OUString& _sHelpId,bool _bAddChangeHandler); bool IsFocusInEditableWidget() const; + void dispose(); protected: void saveCurrentFieldDescData() { SaveData( pActFieldDescr ); } OFieldDescription* getCurrentFieldDescData() { return pActFieldDescr; } @@ -146,7 +137,7 @@ namespace dbaui virtual css::lang::Locale GetLocale() const = 0; - virtual void CellModified(long nRow, sal_uInt16 nColId ) = 0; + virtual void CellModified(sal_Int32 nRow, sal_uInt16 nColId ) = 0; virtual void SetModified(bool bModified); // base implementation is empty virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) = 0; @@ -155,7 +146,7 @@ namespace dbaui virtual bool isAutoIncrementValueEnabled() const = 0; virtual OUString getAutoIncrementValue() const = 0; - OUString BoolStringPersistent(const OUString& rUIString) const; + OUString BoolStringPersistent(std::u16string_view rUIString) const; OUString BoolStringUI(const OUString& rPersistentString) const; const OPropColumnEditCtrl* getColumnCtrl() const { return m_xColumnName.get(); } @@ -163,9 +154,8 @@ namespace dbaui void implFocusLost(weld::Widget* _pWhich); public: - OFieldDescControl(weld::Container* pPage, vcl::Window* pParent, OTableDesignHelpBar* pHelpBar); - virtual ~OFieldDescControl() override; - virtual void dispose() override; + OFieldDescControl(weld::Container* pPage, OTableDesignHelpBar* pHelpBar); + virtual ~OFieldDescControl(); void DisplayData(OFieldDescription* pFieldDescr ); @@ -174,30 +164,38 @@ namespace dbaui void SetControlText( sal_uInt16 nControlId, const OUString& rText ); void SetReadOnly( bool bReadOnly ); - // when resize is called - bool isCutAllowed() const; - bool isCopyAllowed() const; - bool isPasteAllowed() const; + void Enable(bool bEnable) { m_xContainer->set_sensitive(bEnable); } + void SetHelpId(const OUString& rId) { m_xContainer->set_help_id(rId); } + + virtual bool isCutAllowed() override; + virtual bool isCopyAllowed() override; + virtual bool isPasteAllowed() override; + + virtual void cut() override; + virtual void copy() override; + virtual void paste() override; + + void connect_focus_in(const Link<weld::Widget&, void>& rLink) + { + m_aControlFocusIn = rLink; + } - void cut(); - void copy(); - void paste(); + void Init(); - void Init(); - virtual void GetFocus() override; - virtual void LoseFocus() override; - virtual void Resize() override; + void GrabFocus(); - virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; + bool HasChildPathFocus() const; virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() = 0; virtual css::uno::Reference< css::sdbc::XConnection> getConnection() = 0; - OUString getControlDefault( const OFieldDescription* _pFieldDescr, bool _bCheck = true) const; + OUString getControlDefault( const OFieldDescription* pFieldDescr, bool _bCheck = true) const; + // tdf#138409 take the control default in the UI Locale format, e.g. 12,34 and return a string + // suitable as the database default, e.g. 12.34 + OUString CanonicalizeToControlDefault(const OFieldDescription* pFieldDescr, const OUString& rUserText) const; void setEditWidth(sal_Int32 _nWidth) { m_nEditWidth = _nWidth; } }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/FieldDescriptions.hxx b/dbaccess/source/ui/inc/FieldDescriptions.hxx index 576a4016b267..5eccd7430979 100644 --- a/dbaccess/source/ui/inc/FieldDescriptions.hxx +++ b/dbaccess/source/ui/inc/FieldDescriptions.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_FIELDDESCRIPTIONS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDDESCRIPTIONS_HXX +#pragma once #include <editeng/svxenum.hxx> #include "TypeInfo.hxx" @@ -107,7 +106,6 @@ namespace dbaui bool IsNullable() const; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDDESCRIPTIONS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx index 3a7365c1da9c..1bbb593e333d 100644 --- a/dbaccess/source/ui/inc/GeneralUndo.hxx +++ b/dbaccess/source/ui/inc/GeneralUndo.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_GENERALUNDO_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_GENERALUNDO_HXX +#pragma once #include <svl/undo.hxx> #include <core_resource.hxx> @@ -32,11 +31,10 @@ namespace dbaui OUString m_strComment; // undo, redo comment public: - OCommentUndoAction(const char* pCommentID) { m_strComment = DBA_RES(pCommentID); } + OCommentUndoAction(TranslateId pCommentID) { m_strComment = DBA_RES(pCommentID); } virtual OUString GetComment() const override { return m_strComment; } }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_GENERALUNDO_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx index 89c142ae230c..5c4ddde13f4e 100644 --- a/dbaccess/source/ui/inc/HtmlReader.hxx +++ b/dbaccess/source/ui/inc/HtmlReader.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_HTMLREADER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_HTMLREADER_HXX +#pragma once #include "DExport.hxx" #include <svtools/parhtml.hxx> @@ -55,7 +54,7 @@ namespace dbaui // required for automatic type recognition OHTMLReader(SvStream& rIn, sal_Int32 nRows, - const TPositions &_rColumnPositions, + TPositions&& _rColumnPositions, const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const TColumnVector* rList, @@ -65,6 +64,5 @@ namespace dbaui virtual SvParserState CallParser() override;// base class }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/IClipBoardTest.hxx b/dbaccess/source/ui/inc/IClipBoardTest.hxx index 428116704717..e3eb0496272c 100644 --- a/dbaccess/source/ui/inc/IClipBoardTest.hxx +++ b/dbaccess/source/ui/inc/IClipBoardTest.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_ICLIPBOARDTEST_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_ICLIPBOARDTEST_HXX +#pragma once #include <sal/types.h> namespace dbaui @@ -37,6 +36,5 @@ namespace dbaui ~IClipboardTest() {} }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_ICLIPBOARDTEST_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/IItemSetHelper.hxx b/dbaccess/source/ui/inc/IItemSetHelper.hxx index 8b0fe5f88278..b581c5a55e69 100644 --- a/dbaccess/source/ui/inc/IItemSetHelper.hxx +++ b/dbaccess/source/ui/inc/IItemSetHelper.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_IITEMSETHELPER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_IITEMSETHELPER_HXX +#pragma once #include <sal/types.h> #include <com/sun/star/uno/Reference.hxx> @@ -29,9 +28,6 @@ namespace com::sun::star { class XConnection; class XDriver; } - namespace lang { - class XMultiServiceFactory; - } } class SfxItemSet; @@ -69,6 +65,5 @@ namespace dbaui ~IDatabaseSettingsDialog() {} }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_IITEMSETHELPER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/IUpdateHelper.hxx b/dbaccess/source/ui/inc/IUpdateHelper.hxx index 975eef75c442..e6ef24a96760 100644 --- a/dbaccess/source/ui/inc/IUpdateHelper.hxx +++ b/dbaccess/source/ui/inc/IUpdateHelper.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_IUPDATEHELPER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_IUPDATEHELPER_HXX +#pragma once #include <com/sun/star/util/Date.hpp> #include <com/sun/star/util/DateTime.hpp> @@ -42,6 +41,4 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_IUPDATEHELPER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/JAccess.hxx b/dbaccess/source/ui/inc/JAccess.hxx index f5410bef975c..8377a076779c 100644 --- a/dbaccess/source/ui/inc/JAccess.hxx +++ b/dbaccess/source/ui/inc/JAccess.hxx @@ -16,23 +16,19 @@ * 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_DBACCESS_SOURCE_UI_INC_JACCESS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_JACCESS_HXX +#pragma once #include "JoinTableView.hxx" -#include <toolkit/awt/vclxaccessiblecomponent.hxx> -#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase.hxx> +#include <vcl/accessibility/vclxaccessiblecomponent.hxx> #include <vcl/vclptr.hxx> namespace dbaui { - class OJoinTableView; - typedef ::cppu::ImplHelper1< css::accessibility::XAccessible - > OJoinDesignViewAccess_BASE; /** the class OJoinDesignViewAccess represents the accessible object for join views like the QueryDesign and the RelationDesign */ - class OJoinDesignViewAccess : public VCLXAccessibleComponent, public OJoinDesignViewAccess_BASE + class OJoinDesignViewAccess : public VCLXAccessibleComponent { VclPtr<OJoinTableView> m_pTableView; // the window which I should give accessibility to @@ -41,18 +37,11 @@ namespace dbaui */ OJoinDesignViewAccess( OJoinTableView* _pTableView); - // XInterface - DECLARE_XINTERFACE( ) - DECLARE_XTYPEPROVIDER( ) - virtual OUString SAL_CALL getImplementationName() override; - // XAccessible - 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 sal_Int16 SAL_CALL getAccessibleRole( ) override; void notifyAccessibleEvent( @@ -67,6 +56,5 @@ namespace dbaui void clearTableView(); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_JACCESS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index 94638e638bea..9410823222e4 100644 --- a/dbaccess/source/ui/inc/JoinController.hxx +++ b/dbaccess/source/ui/inc/JoinController.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_JOINCONTROLLER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_JOINCONTROLLER_HXX +#pragma once #include "singledoccontroller.hxx" #include "JoinTableView.hxx" @@ -106,9 +105,9 @@ namespace dbaui */ void removeConnectionData(const TTableConnectionData::value_type& _pData); - void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY ); + void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, tools::Long nOffsetX, tools::Long nOffsetY ); - static void SaveTabWinPosSize(OTableWindow const * pTabWin, long nOffsetX, long nOffsetY); + static void SaveTabWinPosSize(OTableWindow const * pTabWin, tools::Long nOffsetX, tools::Long nOffsetY); // UNO interface overridables // XEventListener @@ -151,6 +150,5 @@ namespace dbaui AddTableDialogContext& impl_getDialogContext() const; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_JOINCONTROLLER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/JoinDesignView.hxx b/dbaccess/source/ui/inc/JoinDesignView.hxx index c1153e3463e7..0883e424f790 100644 --- a/dbaccess/source/ui/inc/JoinDesignView.hxx +++ b/dbaccess/source/ui/inc/JoinDesignView.hxx @@ -17,13 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_JOINDESIGNVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_JOINDESIGNVIEW_HXX +#pragma once #include <dbaccess/dataview.hxx> -class Splitter; - namespace dbaui { class OJoinController; @@ -64,7 +61,6 @@ namespace dbaui virtual void resizeDocumentView(tools::Rectangle& rRect) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_JOINDESIGNVIEW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/JoinExchange.hxx b/dbaccess/source/ui/inc/JoinExchange.hxx index a1a73595ae5c..7401ec886e44 100644 --- a/dbaccess/source/ui/inc/JoinExchange.hxx +++ b/dbaccess/source/ui/inc/JoinExchange.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_JOINEXCHANGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_JOINEXCHANGE_HXX +#pragma once #include "TableWindowListBox.hxx" @@ -30,41 +29,34 @@ namespace dbaui // OJoinExchObj: Additional data to create Joins in the JoinShell typedef ::cppu::ImplHelper1< css::lang::XUnoTunnel > OJoinExchObj_Base; - class OJoinExchObj final : public TransferableHelper, public OJoinExchObj_Base + class OJoinExchObj final : public TransferDataContainer, public OJoinExchObj_Base { bool m_bFirstEntry; OJoinExchangeData m_jxdSourceDescription; - IDragTransferableListener* m_pDragListener; virtual ~OJoinExchObj() override; public: - OJoinExchObj(const OJoinExchangeData& jxdSource, bool _bFirstEntry); - + OJoinExchObj(); + void setDescriptors(const OJoinExchangeData& jxdSource, bool _bFirstEntry); // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) 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; // XUnoTunnel - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); + static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& _rIdentifier ) override; - void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions, IDragTransferableListener* _pListener ); - static OJoinExchangeData GetSourceDescription(const css::uno::Reference< css::datatransfer::XTransferable >& _rxObject); static bool isFormatAvailable( const DataFlavorExVector& _rFormats ,SotClipboardFormatId _nSlotID=SotClipboardFormatId::SBA_JOIN); private: virtual void AddSupportedFormats() override; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; - virtual void DragFinished( sal_Int8 nDropAction ) override; - - using TransferableHelper::StartDrag; }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 413cccf32e7d..138de4106070 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -16,13 +16,12 @@ * 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_DBACCESS_SOURCE_UI_INC_JOINTABLEVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_JOINTABLEVIEW_HXX +#pragma once +#include <svtools/scrolladaptor.hxx> #include <vcl/window.hxx> #include <vcl/timer.hxx> #include <vcl/idle.hxx> -#include <vcl/scrbar.hxx> #include <vcl/vclptr.hxx> #include <vcl/transfer.hxx> @@ -33,8 +32,6 @@ #include <map> #include <vector> -struct AcceptDropEvent; -struct ExecuteDropEvent; class SfxUndoAction; namespace dbaui @@ -43,7 +40,6 @@ namespace dbaui class OTableWindow; struct OJoinExchangeData; class OJoinDesignView; - class OTableWindowData; class OJoinDesignViewAccess; // this class contains only the scrollbars to avoid that @@ -51,9 +47,8 @@ namespace dbaui class OJoinTableView; class OScrollWindowHelper : public vcl::Window { - VclPtr<ScrollBar> m_aHScrollBar; - VclPtr<ScrollBar> m_aVScrollBar; - VclPtr<vcl::Window> m_pCornerWindow; + VclPtr<ScrollAdaptor> m_aHScrollBar; + VclPtr<ScrollAdaptor> m_aVScrollBar; VclPtr<OJoinTableView> m_pTableView; protected: @@ -69,8 +64,8 @@ namespace dbaui void resetRange(const Point& _aSize); // own methods - ScrollBar& GetHScrollBar() { return *m_aHScrollBar; } - ScrollBar& GetVScrollBar() { return *m_aVScrollBar; } + ScrollAdaptor& GetHScrollBar() { return *m_aHScrollBar; } + ScrollAdaptor& GetVScrollBar() { return *m_aVScrollBar; } }; @@ -106,7 +101,7 @@ namespace dbaui protected: VclPtr<OTableWindow> m_pLastFocusTabWin; VclPtr<OJoinDesignView> m_pView; - OJoinDesignViewAccess* m_pAccessible; + rtl::Reference<OJoinDesignViewAccess> m_pAccessible; public: OJoinTableView( vcl::Window* pParent, OJoinDesignView* pView ); @@ -122,9 +117,10 @@ namespace dbaui virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; // own methods - ScrollBar& GetHScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetHScrollBar(); } - ScrollBar& GetVScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetVScrollBar(); } - DECL_LINK( ScrollHdl, ScrollBar*, void ); + ScrollAdaptor& GetHScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetHScrollBar(); } + ScrollAdaptor& GetVScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetVScrollBar(); } + DECL_LINK(VertScrollHdl, weld::Scrollbar&, void); + DECL_LINK(HorzScrollHdl, weld::Scrollbar&, void); void DrawConnections(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect); void InvalidateConnections(); @@ -163,8 +159,8 @@ namespace dbaui */ void addConnection(OTableConnection* _pConnection,bool _bAddData = true); - bool ScrollPane( long nDelta, bool bHoriz, bool bPaintScrollBars ); - sal_uLong GetTabWinCount() const; + bool ScrollPane( tools::Long nDelta, bool bHoriz, bool bPaintScrollBars ); + sal_Int64 GetTabWinCount() const; const Point& GetScrollOffset() const { return m_aScrollOffset; } OJoinDesignView* getDesignView() const { return m_pView; } @@ -197,7 +193,7 @@ namespace dbaui */ sal_Int32 getConnectionCount(const OTableWindow* _pFromWin) const; - OTableConnection* GetTabConn(const OTableWindow* pLhs,const OTableWindow* pRhs,bool _bSupressCrossOrNaturalJoin = false) const; + OTableConnection* GetTabConn(const OTableWindow* pLhs,const OTableWindow* pRhs,bool _bSuppressCrossOrNaturalJoin = false) const; /** clear the window map and connection vector without destroying it @@ -300,7 +296,7 @@ namespace dbaui Expected to throw. */ virtual void onNoColumns_throw(); - virtual bool supressCrossNaturalJoin(const TTableConnectionData::value_type& _pData) const; + virtual bool suppressCrossNaturalJoin(const TTableConnectionData::value_type& _pData) const; private: void InitColors(); @@ -322,6 +318,5 @@ namespace dbaui using Window::Scroll; }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/QEnumTypes.hxx b/dbaccess/source/ui/inc/QEnumTypes.hxx index d88a7f4d6fa8..b889870c9b91 100644 --- a/dbaccess/source/ui/inc/QEnumTypes.hxx +++ b/dbaccess/source/ui/inc/QEnumTypes.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_QENUMTYPES_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QENUMTYPES_HXX +#pragma once namespace dbaui { @@ -76,6 +75,5 @@ namespace dbaui tpAutoIncrementValue }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index 4f057178669c..efef444e8670 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_QUERYDESIGNVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYDESIGNVIEW_HXX +#pragma once #include "JoinDesignView.hxx" #include <vcl/split.hxx> @@ -100,18 +99,18 @@ namespace dbaui bool isSlotEnabled(sal_Int32 _nSlotId); void setSlotEnabled(sal_Int32 _nSlotId, bool _bEnable); - void setNoneVisbleRow(sal_Int32 _nRows); + void setNoneVisibleRow(sal_Int32 _nRows); const css::lang::Locale& getLocale() const { return m_aLocale;} const OUString& getDecimalSeparator() const { return m_sDecimalSep;} SqlParseError InsertField( const OTableFieldDescRef& rInfo, bool bActivate = true); - bool HasFieldByAliasName(const OUString& rFieldName, OTableFieldDescRef const & rInfo) const; + bool HasFieldByAliasName(std::u16string_view rFieldName, OTableFieldDescRef const & rInfo) const; // called when a table from tabview was deleted void TableDeleted(const OUString& rAliasName); sal_Int32 getColWidth( sal_uInt16 _nColPos) const; - void fillValidFields(const OUString& strTableName, weld::ComboBox& rFieldList); + void fillValidFields(std::u16string_view strTableName, weld::ComboBox& rFieldList); void SaveUIConfig(); void stopTimer(); @@ -151,6 +150,5 @@ namespace dbaui using OJoinDesignView::SaveTabWinUIConfig; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYDESIGNVIEW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx index 901427c056b5..2d8bb80dcf49 100644 --- a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx +++ b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYPROPERTIESDIALOG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYPROPERTIESDIALOG_HXX +#pragma once #include <vcl/weld.hxx> @@ -43,6 +42,4 @@ private: } ///dbaui namespace -#endif /// INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYPROPERTIESDIALOG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx index e1c442704040..26133d2cca42 100644 --- a/dbaccess/source/ui/inc/QueryTableView.hxx +++ b/dbaccess/source/ui/inc/QueryTableView.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_QUERYTABLEVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYTABLEVIEW_HXX +#pragma once #include "JoinTableView.hxx" #include "TableFieldDescription.hxx" @@ -41,7 +40,7 @@ namespace dbaui Expected to throw. */ virtual void onNoColumns_throw() override; - virtual bool supressCrossNaturalJoin(const TTableConnectionData::value_type& _pData) const override; + virtual bool suppressCrossNaturalJoin(const TTableConnectionData::value_type& _pData) const override; public: OQueryTableView(vcl::Window* pParent,OQueryDesignView* pView); @@ -113,6 +112,5 @@ namespace dbaui using OJoinTableView::EnsureVisible; }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/QueryTextView.hxx b/dbaccess/source/ui/inc/QueryTextView.hxx index c41a7cea7bc9..33f66342b25d 100644 --- a/dbaccess/source/ui/inc/QueryTextView.hxx +++ b/dbaccess/source/ui/inc/QueryTextView.hxx @@ -16,23 +16,39 @@ * 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_DBACCESS_SOURCE_UI_INC_QUERYTEXTVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYTEXTVIEW_HXX +#pragma once +#include <vcl/InterimItemWindow.hxx> #include "querycontainerwindow.hxx" +#include "sqledit.hxx" namespace dbaui { - class OSqlEdit; - class OQueryTextView : public vcl::Window + class OQueryTextView final : public InterimItemWindow { friend class OQueryViewSwitch; - VclPtr<OSqlEdit> m_pEdit; + + OQueryController& m_rController; + std::unique_ptr<SQLEditView> m_xSQL; + std::unique_ptr<weld::CustomWeld> m_xSQLEd; + + Timer m_timerUndoActionCreation; + OUString m_strOrigText; // is restored on undo + Timer m_timerInvalidate; + bool m_bStopTimer; + + DECL_LINK(OnUndoActionTimer, Timer*, void); + DECL_LINK(OnInvalidateTimer, Timer*, void); + DECL_LINK(ModifyHdl, LinkParamNone*, void); + public: - OQueryTextView( OQueryContainerWindow* pParent ); + OQueryTextView(OQueryContainerWindow* pParent, OQueryController& rController); virtual ~OQueryTextView() override; virtual void dispose() override; + void SetSQLText(const OUString& rNewText); + OUString GetSQLText() const; + virtual void GetFocus() override; bool isCutAllowed() const; @@ -44,15 +60,10 @@ namespace dbaui // set the statement for representation void setStatement(const OUString& _rsStatement); OUString getStatement() const; - // allow access to our edit - OSqlEdit* getSqlEdit() const { return m_pEdit; } - OQueryContainerWindow* getContainerWindow() { return static_cast< OQueryContainerWindow* >( GetParent() ); } - protected: - virtual void Resize() override; + void stopTimer(); + void startTimer(); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYTEXTVIEW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/QueryViewSwitch.hxx b/dbaccess/source/ui/inc/QueryViewSwitch.hxx index 879c29b01d42..0f17d40bdcbf 100644 --- a/dbaccess/source/ui/inc/QueryViewSwitch.hxx +++ b/dbaccess/source/ui/inc/QueryViewSwitch.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX +#pragma once #include <com/sun/star/uno/XComponentContext.hpp> #include <tools/gen.hxx> @@ -72,7 +71,7 @@ namespace dbaui void forceInitialView(); bool isSlotEnabled(sal_Int32 _nSlotId); void setSlotEnabled(sal_Int32 _nSlotId, bool _bEnable); - void setNoneVisbleRow(sal_Int32 _nRows); + void setNoneVisibleRow(sal_Int32 _nRows); void SaveUIConfig(); void reset(); void GrabFocus(); @@ -91,6 +90,5 @@ namespace dbaui bool impl_postViewSwitch( const bool i_bGraphicalDesign, const bool i_bSuccess ); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RTableConnectionData.hxx b/dbaccess/source/ui/inc/RTableConnectionData.hxx index bfff5fc9a25e..ad6f0d376ccc 100644 --- a/dbaccess/source/ui/inc/RTableConnectionData.hxx +++ b/dbaccess/source/ui/inc/RTableConnectionData.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_RTABLECONNECTIONDATA_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RTABLECONNECTIONDATA_HXX +#pragma once #include "TableConnectionData.hxx" #include <com/sun/star/beans/XPropertySet.hpp> @@ -29,7 +28,6 @@ namespace dbaui Undefined, OneMany, ManyOne, OneOne }; - class OConnectionLineData; class ORelationTableConnectionData final : public OTableConnectionData { friend bool operator==(const ORelationTableConnectionData& lhs, const ORelationTableConnectionData& rhs); @@ -77,6 +75,4 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RTABLECONNECTIONDATA_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RelControliFace.hxx b/dbaccess/source/ui/inc/RelControliFace.hxx index a6bfa0ec956d..65ef79db0d07 100644 --- a/dbaccess/source/ui/inc/RelControliFace.hxx +++ b/dbaccess/source/ui/inc/RelControliFace.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_RELCONTROLIFACE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RELCONTROLIFACE_HXX +#pragma once namespace dbaui { @@ -37,6 +36,5 @@ namespace dbaui virtual void notifyConnectionChange() = 0; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELCONTROLIFACE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx index a2d3a0e35d93..2067242bf7ab 100644 --- a/dbaccess/source/ui/inc/RelationControl.hxx +++ b/dbaccess/source/ui/inc/RelationControl.hxx @@ -16,15 +16,13 @@ * 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_DBACCESS_SOURCE_UI_INC_RELATIONCONTROL_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONCONTROL_HXX +#pragma once #include <vcl/weld.hxx> #include "JoinTableView.hxx" namespace dbaui { - class OTableListBoxControl; class IRelationControlInterface; class ORelationControl; @@ -88,6 +86,5 @@ namespace dbaui IRelationControlInterface* getContainer() const { return m_pParentDialog; } }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONCONTROL_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx index b358da57541c..d4aa52faf080 100644 --- a/dbaccess/source/ui/inc/RelationController.hxx +++ b/dbaccess/source/ui/inc/RelationController.hxx @@ -16,12 +16,12 @@ * 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_DBACCESS_SOURCE_UI_INC_RELATIONCONTROLLER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONCONTROLLER_HXX +#pragma once #include <memory> +#include <string_view> + #include "JoinController.hxx" -#include <com/sun/star/lang/XMultiServiceFactory.hpp> namespace weld { @@ -34,7 +34,7 @@ namespace dbaui { css::uno::Reference< css::container::XNameAccess > m_xTables; std::unique_ptr<weld::WaitObject> m_xWaitObject; - sal_uLong m_nThreadEvent; + sal_Int32 m_nThreadEvent; bool m_bRelationsPossible; protected: // all the features which should be handled by this class @@ -45,7 +45,7 @@ namespace dbaui virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) override; void loadData(); - TTableWindowData::value_type existsTable(const OUString& _rComposedTableName) const; + TTableWindowData::value_type existsTable(std::u16string_view _rComposedTableName) const; // load the window positions out of the datasource void loadLayoutInformation(); @@ -70,11 +70,10 @@ namespace dbaui // ask the user if the design should be saved when it is modified virtual short saveModified() override; virtual void reset() override; - virtual void impl_initialize() override; + virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override; virtual OUString getPrivateTitle( ) const override; DECL_LINK( OnThreadFinished, void*, void ); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONCONTROLLER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RelationDesignView.hxx b/dbaccess/source/ui/inc/RelationDesignView.hxx index bc69359c82ce..2fba88be08d3 100644 --- a/dbaccess/source/ui/inc/RelationDesignView.hxx +++ b/dbaccess/source/ui/inc/RelationDesignView.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDESIGNVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDESIGNVIEW_HXX +#pragma once #include "JoinDesignView.hxx" @@ -41,7 +40,6 @@ namespace dbaui virtual void GetFocus() override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDESIGNVIEW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx index e3fe49f1335c..c4285f04aae5 100644 --- a/dbaccess/source/ui/inc/RelationDlg.hxx +++ b/dbaccess/source/ui/inc/RelationDlg.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX +#pragma once #include <memory> #include <vcl/weld.hxx> @@ -71,6 +70,5 @@ namespace dbaui DECL_LINK(OKClickHdl, weld::Button&, void); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx b/dbaccess/source/ui/inc/RelationTableView.hxx index 0bc8c86275bb..6c178a3de937 100644 --- a/dbaccess/source/ui/inc/RelationTableView.hxx +++ b/dbaccess/source/ui/inc/RelationTableView.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_RELATIONTABLEVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONTABLEVIEW_HXX +#pragma once #include "JoinTableView.hxx" #include <comphelper/containermultiplexer.hxx> @@ -71,6 +70,5 @@ namespace dbaui virtual void lookForUiActivities() override; }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/RtfReader.hxx b/dbaccess/source/ui/inc/RtfReader.hxx index c24ca3817c9a..58f6aa26ba2b 100644 --- a/dbaccess/source/ui/inc/RtfReader.hxx +++ b/dbaccess/source/ui/inc/RtfReader.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_RTFREADER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_RTFREADER_HXX +#pragma once #include <vector> #include <svtools/parrtf.hxx> @@ -46,7 +45,7 @@ namespace dbaui // required for automatic type recognition ORTFReader( SvStream& rIn, sal_Int32 nRows, - const TPositions &_rColumnPositions, + TPositions&& _rColumnPositions, const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const TColumnVector* rList, @@ -56,6 +55,5 @@ namespace dbaui virtual SvParserState CallParser() override;// base class }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/ScrollHelper.hxx b/dbaccess/source/ui/inc/ScrollHelper.hxx deleted file mode 100644 index 87e50018aa2d..000000000000 --- a/dbaccess/source/ui/inc/ScrollHelper.hxx +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- 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_DBACCESS_SOURCE_UI_INC_SCROLLHELPER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_SCROLLHELPER_HXX - -#include <tools/link.hxx> -#include <tools/gen.hxx> - -namespace dbaui -{ - class OScrollHelper - { - Link<LinkParamNone*,void> m_aUpScroll; - Link<LinkParamNone*,void> m_aDownScroll; - public: - /** default constructor - */ - OScrollHelper(); - - ~OScrollHelper(); - - /** set the memthod which should be called when scrolling up - @param _rUpScroll - the method to set - */ - void setUpScrollMethod( const Link<LinkParamNone*,void>& _rUpScroll ) - { - m_aUpScroll = _rUpScroll; - } - - /** set the memthod which should be called when scrolling down - @param _rDownScroll - the method to set - */ - void setDownScrollMethod( const Link<LinkParamNone*,void>& _rDownScroll ) - { - m_aDownScroll = _rDownScroll; - } - - /** check if a scroll method has to be called - @param _rPoint - the current selection point - @param _rOutputSize - the output size of the window - */ - void scroll(const Point& _rPoint, const Size& _rOutputSize); - }; -} -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_SCROLLHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/SqlNameEdit.hxx b/dbaccess/source/ui/inc/SqlNameEdit.hxx index 7a6e43c15b32..14d845b4b17c 100644 --- a/dbaccess/source/ui/inc/SqlNameEdit.hxx +++ b/dbaccess/source/ui/inc/SqlNameEdit.hxx @@ -16,10 +16,10 @@ * 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_DBACCESS_SOURCE_UI_INC_SQLNAMEEDIT_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_SQLNAMEEDIT_HXX +#pragma once -#include <vcl/edit.hxx> +#include <svtools/editbrowsebox.hxx> +#include <utility> #include <vcl/weld.hxx> namespace dbaui @@ -29,8 +29,8 @@ namespace dbaui OUString m_sAllowedChars; bool m_bCheck; // true when we should check for invalid chars public: - OSQLNameChecker(const OUString& _rAllowedChars) - :m_sAllowedChars(_rAllowedChars) + OSQLNameChecker(OUString _sAllowedChars) + :m_sAllowedChars(std::move(_sAllowedChars)) ,m_bCheck(true) { } @@ -43,21 +43,29 @@ namespace dbaui { m_bCheck = _bCheck; } - bool checkString(const OUString& _sToCheck,OUString& _rsCorrected); + bool checkString(std::u16string_view _sToCheck,OUString& _rsCorrected); }; - class OSQLNameEdit : public Edit - ,public OSQLNameChecker + class OSQLNameEditControl : public svt::EditControl + , public OSQLNameChecker { public: - OSQLNameEdit(vcl::Window* _pParent,WinBits nStyle = WB_BORDER, const OUString& _rAllowedChars = OUString()) - : Edit(_pParent,nStyle) - , OSQLNameChecker(_rAllowedChars) + OSQLNameEditControl(BrowserDataWin* pParent, const OUString& rAllowedChars) + : svt::EditControl(pParent) + , OSQLNameChecker(rAllowedChars) + { + m_xWidget->connect_changed(LINK(this, OSQLNameEditControl, ModifyHdl)); + } + + virtual void connect_changed(const Link<weld::Entry&, void>& rLink) override { + m_ChainChangedHdl = rLink; } - // Edit overrides - virtual void Modify() override; + private: + DECL_LINK(ModifyHdl, weld::Entry&, void); + + Link<weld::Entry&,void> m_ChainChangedHdl; }; class OWidgetBase @@ -102,7 +110,6 @@ namespace dbaui OUString get_text() const { return m_xEntry->get_text(); } void set_text(const OUString& rText) { m_xEntry->set_text(rText); } void set_max_length(int nLen) { m_xEntry->set_max_length(nLen); } - void set_sensitive(bool bSensitive) { m_xEntry->set_sensitive(bSensitive); } virtual void save_value() override { m_xEntry->save_value(); } virtual bool get_value_changed_from_saved() const override { @@ -111,6 +118,5 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_SQLNAMEEDIT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx index 73aa51d50749..ac4f27eabcb3 100644 --- a/dbaccess/source/ui/inc/TableConnection.hxx +++ b/dbaccess/source/ui/inc/TableConnection.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLECONNECTION_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECONNECTION_HXX +#pragma once #include <vector> #include <vcl/window.hxx> @@ -29,7 +28,6 @@ namespace tools { class Rectangle; } namespace dbaui { - class OTableConnectionData; class OTableWindow; class OJoinTableView; class OConnectionLine; @@ -48,7 +46,7 @@ namespace dbaui void clearLineData(); public: - OTableConnection( OJoinTableView* pContainer, const TTableConnectionData::value_type& pTabConnData ); + OTableConnection( OJoinTableView* pContainer, TTableConnectionData::value_type aTabConnData ); OTableConnection( const OTableConnection& rConn ); /** destructor @@ -95,6 +93,5 @@ namespace dbaui virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx index c55bce40d463..096a6de70ad3 100644 --- a/dbaccess/source/ui/inc/TableConnectionData.hxx +++ b/dbaccess/source/ui/inc/TableConnectionData.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLECONNECTIONDATA_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECONNECTIONDATA_HXX +#pragma once #include "ConnectionLineData.hxx" #include "TableWindowData.hxx" @@ -48,8 +47,8 @@ namespace dbaui OTableConnectionData& operator=( const OTableConnectionData& rConnData ); public: OTableConnectionData(); - OTableConnectionData( const TTableWindowData::value_type& _pReferencingTable, - const TTableWindowData::value_type& _pReferencedTable ); + OTableConnectionData( TTableWindowData::value_type _aReferencingTable, + TTableWindowData::value_type _aReferencedTable ); OTableConnectionData( const OTableConnectionData& rConnData ); virtual ~OTableConnectionData(); @@ -98,6 +97,5 @@ namespace dbaui typedef std::vector< std::shared_ptr<OTableConnectionData> > TTableConnectionData; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx index 41643d95b240..13af9cf51c48 100644 --- a/dbaccess/source/ui/inc/TableController.hxx +++ b/dbaccess/source/ui/inc/TableController.hxx @@ -16,12 +16,10 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLECONTROLLER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECONTROLLER_HXX +#pragma once #include "singledoccontroller.hxx" #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include "TypeInfo.hxx" #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbcx/XKeysSupplier.hpp> @@ -123,10 +121,9 @@ namespace dbaui private: void startTableListening(); void stopTableListening(); - virtual void impl_initialize() override; + virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECONTROLLER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableCopyHelper.hxx b/dbaccess/source/ui/inc/TableCopyHelper.hxx index 670920028ece..636ca85c7752 100644 --- a/dbaccess/source/ui/inc/TableCopyHelper.hxx +++ b/dbaccess/source/ui/inc/TableCopyHelper.hxx @@ -16,18 +16,17 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLECOPYHELPER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECOPYHELPER_HXX +#pragma once #include "AppElementType.hxx" #include "commontypes.hxx" #include <svx/dataaccessdescriptor.hxx> #include <sot/storage.hxx> #include <vcl/transfer.hxx> +#include <vcl/weld.hxx> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> -class SvTreeListEntry; namespace dbaui { class OGenericUnoController; @@ -73,23 +72,22 @@ namespace dbaui OUString sDefaultTableName; OUString aUrl; - tools::SvRef<SotStorageStream> aHtmlRtfStorage; + std::unique_ptr<SvStream> aHtmlRtfStorage; ElementType nType; - SvTreeListEntry* pDroppedAt; + std::unique_ptr<weld::TreeIter> xDroppedAt; sal_Int8 nAction; bool bHtml; bool bError; DropDescriptor() : nType(E_TABLE) - , pDroppedAt(nullptr) , nAction(DND_ACTION_NONE) , bHtml(false) , bError(false) { } }; - OTableCopyHelper(OGenericUnoController* _pControler); + OTableCopyHelper(OGenericUnoController* _pController); /** pastes a table into the data source @param _rPasteData @@ -98,7 +96,7 @@ namespace dbaui The name of the dest data source. */ void pasteTable( const TransferableDataHelper& _rTransData - ,const OUString& _sDestDataSourceName + ,std::u16string_view _sDestDataSourceName ,const SharedConnection& _xConnection); /** pastes a table into the data source @@ -111,7 +109,7 @@ namespace dbaui */ void pasteTable( SotClipboardFormatId _nFormatId ,const TransferableDataHelper& _rTransData - ,const OUString& _sDestDataSourceName + ,std::u16string_view _sDestDataSourceName ,const SharedConnection& _xConnection); /** copies a table which was constructed by tags like HTML or RTF @@ -135,7 +133,7 @@ namespace dbaui The connection */ void asyncCopyTagTable( DropDescriptor& _rDesc - ,const OUString& _sDestDataSourceName + ,std::u16string_view _sDestDataSourceName ,const SharedConnection& _xConnection); /** copies a table which was constructed by tags like HTML or RTF @@ -166,26 +164,25 @@ namespace dbaui */ void pasteTable( const svx::ODataAccessDescriptor& _rPasteData, - const OUString& _sDestDataSourceName, + std::u16string_view _sDestDataSourceName, const SharedConnection& _xDestConnection ); /** insert a table into the data source. The source can either be a table or a query */ void insertTable( - const OUString& i_rSourceDataSource, + std::u16string_view i_rSourceDataSource, const css::uno::Reference< css::sdbc::XConnection>& i_rSourceConnection, const OUString& i_rCommand, const sal_Int32 i_nCommandType, const css::uno::Reference< css::sdbc::XResultSet >& i_rSourceRows, const css::uno::Sequence< css::uno::Any >& i_rSelection, const bool i_bBookmarkSelection, - const OUString& i_rDestDataSource, + std::u16string_view i_rDestDataSource, const css::uno::Reference< css::sdbc::XConnection>& i_rDestConnection ); }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECOPYHELPER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx index 9d933b3e6245..89debc9e1125 100644 --- a/dbaccess/source/ui/inc/TableDesignControl.hxx +++ b/dbaccess/source/ui/inc/TableDesignControl.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEDESIGNCONTROL_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNCONTROL_HXX +#pragma once #include <svtools/editbrowsebox.hxx> @@ -33,8 +32,8 @@ namespace dbaui friend class OTableDesignUndoAct; protected: - long m_nDataPos; ///< currently needed row - long m_nCurrentPos; ///< current position of selected column + tools::Long m_nDataPos; ///< currently needed row + tools::Long m_nCurrentPos; ///< current position of selected column private: sal_uInt16 m_nCurUndoActId; @@ -42,10 +41,10 @@ namespace dbaui public: OTableRowView(vcl::Window* pParent); - virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; - virtual void SetCellData( long nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) = 0; - virtual css::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0; - virtual void SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) = 0; + virtual void SetCellData( sal_Int32 nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; + virtual void SetCellData( sal_Int32 nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) = 0; + virtual css::uno::Any GetCellData( sal_Int32 nRow, sal_uInt16 nColId ) = 0; + virtual void SetControlText( sal_Int32 nRow, sal_uInt16 nColId, const OUString& rText ) = 0; virtual OTableDesignView* GetView() const = 0; @@ -57,24 +56,23 @@ namespace dbaui virtual void paste() override; protected: - void Paste( long nRow ); + void Paste( sal_Int32 nRow ); virtual void CopyRows() = 0; virtual void DeleteRows() = 0; - virtual void InsertRows( long nRow ) = 0; - virtual void InsertNewRows( long nRow ) = 0; + virtual void InsertRows( sal_Int32 nRow ) = 0; + virtual void InsertNewRows( sal_Int32 nRow ) = 0; virtual bool IsPrimaryKeyAllowed() = 0; - virtual bool IsInsertNewAllowed( long nRow ) = 0; + virtual bool IsInsertNewAllowed( sal_Int32 nRow ) = 0; virtual bool IsDeleteAllowed() = 0; - virtual RowStatus GetRowStatus(long nRow) const override; + virtual RowStatus GetRowStatus(sal_Int32 nRow) const override; virtual void KeyInput(const KeyEvent& rEvt) override; virtual void Command( const CommandEvent& rEvt ) override; virtual void Init() override; }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx index 87118362511b..db4023d36cc0 100644 --- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx +++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx @@ -16,34 +16,34 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEDESIGNHELPBAR_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNHELPBAR_HXX +#pragma once -#include <vcl/tabpage.hxx> +#include <vcl/weld.hxx> #include "IClipBoardTest.hxx" -class VclMultiLineEdit; - namespace dbaui { - // Deriving from TabPage is a trick to notice changes - // of the system colors - class OTableDesignHelpBar : public TabPage, public IClipboardTest + class OTableDesignHelpBar final : public IClipboardTest { private: - VclPtr<VclMultiLineEdit> m_pTextWin; - - protected: - virtual void Resize() override; + std::unique_ptr<weld::TextView> m_xTextWin; public: - OTableDesignHelpBar( vcl::Window* pParent ); - virtual ~OTableDesignHelpBar() override; - virtual void dispose() override; + OTableDesignHelpBar(std::unique_ptr<weld::TextView> xTextWin); void SetHelpText( const OUString& rText ); - virtual bool PreNotify( NotifyEvent& rNEvt ) override; + bool HasFocus() const { return m_xTextWin->has_focus(); } + + void connect_focus_in(const Link<weld::Widget&, void>& rLink) + { + m_xTextWin->connect_focus_in(rLink); + } + + void connect_focus_out(const Link<weld::Widget&, void>& rLink) + { + m_xTextWin->connect_focus_out(rLink); + } // IClipboardTest virtual bool isCutAllowed() override; @@ -55,6 +55,5 @@ namespace dbaui virtual void paste() override; }; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index 262e04933959..077eb211e3b4 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -16,42 +16,45 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEDESIGNVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNVIEW_HXX +#pragma once #include <dbaccess/dataview.hxx> #include <com/sun/star/lang/Locale.hpp> -#include <vcl/split.hxx> +#include <vcl/InterimItemWindow.hxx> +#include <vcl/weld.hxx> #include "IClipBoardTest.hxx" namespace dbaui { class OTableController; + class OTableDesignView; class OTableFieldDescWin; class OTableEditorCtrl; - class OTableBorderWindow : public vcl::Window + + class OTableBorderWindow final : public InterimItemWindow { - VclPtr<Splitter> m_aHorzSplitter; - VclPtr<OTableFieldDescWin> m_pFieldDescWin; - VclPtr<OTableEditorCtrl> m_pEditorCtrl; + std::unique_ptr<weld::Paned> m_xHorzSplitter; + std::unique_ptr<weld::Container> m_xEditorParent; + css::uno::Reference<css::awt::XWindow> m_xEditorParentWin; + VclPtr<OTableEditorCtrl> m_xEditorCtrl; + std::unique_ptr<weld::Container> m_xFieldDescParent; + std::unique_ptr<OTableFieldDescWin> m_xFieldDescWin; - void ImplInitSettings(); - DECL_LINK( SplitHdl, Splitter*, void ); - protected: - virtual void DataChanged(const DataChangedEvent& rDCEvt) override; public: - OTableBorderWindow(vcl::Window* pParent); + OTableBorderWindow(OTableDesignView* pParent); virtual ~OTableBorderWindow() override; // Window overrides virtual void dispose() override; - virtual void Resize() override; + virtual void GetFocus() override; + virtual void Layout() override; - OTableEditorCtrl* GetEditorCtrl() const { return m_pEditorCtrl; } - OTableFieldDescWin* GetDescWin() const { return m_pFieldDescWin; } + OTableEditorCtrl* GetEditorCtrl() const { return m_xEditorCtrl.get(); } + OTableFieldDescWin* GetDescWin() const { return m_xFieldDescWin.get(); } }; + class OTableDesignView : public ODataView - ,public IClipboardTest + , public IClipboardTest { enum ChildFocusState { @@ -66,6 +69,8 @@ namespace dbaui ChildFocusState m_eChildFocus; IClipboardTest* getActiveChild() const; + + DECL_LINK( FieldDescFocusIn, weld::Widget&, void ); protected: // return the Rectangle where I can paint myself @@ -103,6 +108,5 @@ namespace dbaui void reSync(); // resync window data with realdata }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNVIEW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableFieldDescription.hxx b/dbaccess/source/ui/inc/TableFieldDescription.hxx index 1834f409f84d..8c3c9b1cd82a 100644 --- a/dbaccess/source/ui/inc/TableFieldDescription.hxx +++ b/dbaccess/source/ui/inc/TableFieldDescription.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEFIELDDESCRIPTION_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEFIELDDESCRIPTION_HXX +#pragma once #include <vector> @@ -35,8 +34,6 @@ namespace comphelper class NamedValueCollection; } -namespace vcl { class Window; } - namespace dbaui { class OTableFieldDesc : public ::salhelper::SimpleReferenceObject @@ -147,6 +144,5 @@ namespace dbaui typedef ::rtl::Reference< OTableFieldDesc> OTableFieldDescRef; typedef std::vector<OTableFieldDescRef> OTableFields; } -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx index e15e08e902aa..d27766913ffe 100644 --- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx +++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEGRANTCTRL_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEGRANTCTRL_HXX +#pragma once #include <sal/config.h> @@ -29,7 +28,6 @@ #include <com/sun/star/sdbcx/XAuthorizable.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -class Edit; namespace dbaui { @@ -53,7 +51,7 @@ class OTableGrantControl : public ::svt::EditBrowseBox OUString m_sUserName; VclPtr<::svt::CheckBoxControl> m_pCheckCell; VclPtr<::svt::EditControl> m_pEdit; - long m_nDataPos; + tools::Long m_nDataPos; ImplSVEvent * m_nDeactivateEvent; public: @@ -82,12 +80,12 @@ protected: virtual bool PreNotify(NotifyEvent& rNEvt ) override; virtual bool IsTabAllowed(bool bForward) const override; - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ) override; - virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ) override; + virtual void InitController( ::svt::CellControllerRef& rController, sal_Int32 nRow, sal_uInt16 nCol ) override; + virtual ::svt::CellController* GetController( sal_Int32 nRow, sal_uInt16 nCol ) override; virtual void PaintCell( OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId ) const override; - virtual bool SeekRow( long nRow ) override; + virtual bool SeekRow( sal_Int32 nRow ) override; virtual bool SaveModified() override; - virtual OUString GetCellText( long nRow, sal_uInt16 nColId ) const override; + virtual OUString GetCellText( sal_Int32 nRow, sal_uInt16 nColId ) const override; virtual void CellModified() override; @@ -102,6 +100,4 @@ private: } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEGRANTCTRL_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableRow.hxx b/dbaccess/source/ui/inc/TableRow.hxx index c7bf3a783fe2..4f34a94bf58e 100644 --- a/dbaccess/source/ui/inc/TableRow.hxx +++ b/dbaccess/source/ui/inc/TableRow.hxx @@ -16,10 +16,9 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEROW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEROW_HXX +#pragma once -#include <com/sun/star/beans/XPropertySet.hpp> +#include <tools/long.hxx> #include "TypeInfo.hxx" class SvStream; @@ -38,8 +37,7 @@ namespace dbaui protected: public: OTableRow(); - OTableRow(const css::uno::Reference< css::beans::XPropertySet >& xAffectedCol); - OTableRow( const OTableRow& rRow, long nPosition = -1 ); + OTableRow( const OTableRow& rRow, tools::Long nPosition = -1 ); ~OTableRow(); OFieldDescription* GetActFieldDescr() const { return m_pActFieldDescr; } @@ -75,6 +73,4 @@ namespace dbaui } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEROW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableRowExchange.hxx b/dbaccess/source/ui/inc/TableRowExchange.hxx index 6d3668f6d0ec..9450ab2ff827 100644 --- a/dbaccess/source/ui/inc/TableRowExchange.hxx +++ b/dbaccess/source/ui/inc/TableRowExchange.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEROWEXCHANGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEROWEXCHANGE_HXX +#pragma once #include <vcl/transfer.hxx> #include <memory> @@ -29,14 +28,13 @@ namespace dbaui { std::vector< std::shared_ptr<OTableRow> > m_vTableRow; public: - OTableRowExchange(const std::vector< std::shared_ptr<OTableRow> >& _rvTableRow); + OTableRowExchange(std::vector< std::shared_ptr<OTableRow> >&& _rvTableRow); protected: virtual void AddSupportedFormats() override; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; - virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; + virtual bool WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; virtual void ObjectReleased() override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEROWEXCHANGE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx index e356a5a265f7..fb6220291558 100644 --- a/dbaccess/source/ui/inc/TableWindow.hxx +++ b/dbaccess/source/ui/inc/TableWindow.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEWINDOW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOW_HXX +#pragma once #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -32,8 +31,6 @@ #include <cppuhelper/basemutex.hxx> #include <o3tl/typed_flags_set.hxx> -class SvTreeListEntry; - // Flags for the size adjustment of SbaJoinTabWins enum class SizingFlags { NONE = 0x0000, @@ -51,7 +48,6 @@ namespace dbaui { class OJoinDesignView; class OJoinTableView; - class OTableWindowAccess; class OTableWindow : public ::cppu::BaseMutex ,public ::comphelper::OContainerListener @@ -61,7 +57,6 @@ namespace dbaui friend class OTableWindowListBox; protected: // and the table itself (needed for me as I want to lock it as long as the window is alive) - VclPtr<FixedImage> m_aTypeImage; VclPtr<OTableWindowTitle> m_xTitle; VclPtr<OTableWindowListBox> m_xListBox; @@ -90,17 +85,9 @@ namespace dbaui void FillListBox(); // called at EACH Init - virtual void OnEntryDoubleClicked(SvTreeListEntry* /*pEntry*/) { } + virtual void OnEntryDoubleClicked(weld::TreeIter& /*rEntry*/) { } // called from the DoubleClickHdl of the ListBox - /** HandleKeyInput tries to handle the KeyEvent. Movement or deletion - @param rEvt - The KeyEvent - @return - <TRUE/> when the table could handle the KeyEvent. - */ - bool HandleKeyInput( const KeyEvent& rEvt ); - /** delete the user data with the equal type as created within createUserData @param _pUserData The user data store in the listbox entries. Created with a call to createUserData. @@ -120,11 +107,11 @@ namespace dbaui css::beans::XPropertySet>& _xColumn, bool _bPrimaryKey); - /** updates m_aTypeImage + /** updates image */ void impl_updateImage(); - OTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData ); + OTableWindow( vcl::Window* pParent, TTableWindowData::value_type aTabWinData ); public: virtual ~OTableWindow() override; @@ -191,6 +178,5 @@ namespace dbaui void clearListBox(); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableWindowAccess.hxx b/dbaccess/source/ui/inc/TableWindowAccess.hxx index 4ee3539a25bb..3adb4d5ed0a5 100644 --- a/dbaccess/source/ui/inc/TableWindowAccess.hxx +++ b/dbaccess/source/ui/inc/TableWindowAccess.hxx @@ -16,30 +16,29 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEWINDOWACCESS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWACCESS_HXX +#pragma once #include "TableWindow.hxx" +#include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> -#include <cppuhelper/implbase2.hxx> -#include <toolkit/awt/vclxaccessiblecomponent.hxx> +#include <cppuhelper/implbase.hxx> +#include <vcl/accessibility/vclxaccessiblecomponent.hxx> #include <vcl/vclptr.hxx> +using css::accessibility::AccessibleRelationType; + namespace dbaui { - typedef ::cppu::ImplHelper2< css::accessibility::XAccessibleRelationSet, - css::accessibility::XAccessible - > OTableWindowAccess_BASE; - class OTableWindow; /** the class OTableWindowAccess represents the accessible object for table windows like they are used in the QueryDesign and the RelationDesign */ - class OTableWindowAccess : public VCLXAccessibleComponent - , public OTableWindowAccess_BASE + class OTableWindowAccess : public cppu::ImplInheritanceHelper< + VCLXAccessibleComponent, + css::accessibility::XAccessibleRelationSet> { VclPtr<OTableWindow> m_pTable; // the window which I should give accessibility to - css::uno::Reference< css::accessibility::XAccessible > getParentChild(sal_Int32 _nIndex); + css::uno::Reference< css::accessibility::XAccessible > getParentChild(sal_Int64 _nIndex); protected: /** this function is called upon disposing the component */ @@ -49,31 +48,14 @@ namespace dbaui public: OTableWindowAccess( OTableWindow* _pTable); - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual void SAL_CALL acquire( ) throw () override - { // here inline is allowed because we do not use this class outside this dll - VCLXAccessibleComponent::acquire( ); - } - virtual void SAL_CALL release( ) throw () override - { // here inline is allowed because we do not use this class outside this dll - VCLXAccessibleComponent::release( ); - } - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XAccessible - 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_Int32 SAL_CALL getAccessibleIndexInParent( ) override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; @@ -87,10 +69,9 @@ namespace dbaui // XAccessibleRelationSet virtual sal_Int32 SAL_CALL getRelationCount( ) override; virtual css::accessibility::AccessibleRelation SAL_CALL getRelation( sal_Int32 nIndex ) override; - virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) override; - virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType( sal_Int16 aRelationType ) override; + virtual sal_Bool SAL_CALL containsRelation(AccessibleRelationType eRelationType) override; + virtual css::accessibility::AccessibleRelation SAL_CALL getRelationByType(AccessibleRelationType eRelationType) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWACCESS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableWindowData.hxx b/dbaccess/source/ui/inc/TableWindowData.hxx index 863d4ab45b9f..0160ea723316 100644 --- a/dbaccess/source/ui/inc/TableWindowData.hxx +++ b/dbaccess/source/ui/inc/TableWindowData.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEWINDOWDATA_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWDATA_HXX +#pragma once #include <tools/gen.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -35,7 +34,7 @@ namespace dbaui mutable ::osl::Mutex m_aMutex; void listen(); - protected: + // the columns of the table css::uno::Reference< css::beans::XPropertySet > m_xTable; // can either be a table or a query css::uno::Reference< css::container::XIndexAccess> m_xKeys; @@ -52,9 +51,9 @@ namespace dbaui public: explicit OTableWindowData( const css::uno::Reference< css::beans::XPropertySet>& _xTable - ,const OUString& _rComposedName - ,const OUString& strTableName - ,const OUString& rWinName ); + ,OUString _sComposedName + ,OUString strTableName + ,OUString sWinName ); virtual ~OTableWindowData() override; /** late constructor @@ -92,6 +91,5 @@ namespace dbaui typedef std::vector< std::shared_ptr<OTableWindowData> > TTableWindowData; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWDATA_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index 1e0f8bd61037..ab1f84d52703 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -16,14 +16,12 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEWINDOWLISTBOX_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWLISTBOX_HXX +#pragma once -#include <vcl/treelistbox.hxx> +#include <vcl/transfer.hxx> +#include <vcl/InterimItemWindow.hxx> #include "callbacks.hxx" -struct AcceptDropEvent; -struct ExecuteDropEvent; namespace dbaui { class OTableWindowListBox; @@ -31,70 +29,91 @@ namespace dbaui { public: VclPtr<OTableWindowListBox> pListBox; // the ListBox inside the same (you can get the TabWin and the WinName out of it) - SvTreeListEntry* pEntry; // the entry, which was dragged or to which was dropped on + int nEntry; // the entry, which was dragged or to which was dropped on OJoinExchangeData(OTableWindowListBox* pBox); - OJoinExchangeData() : pListBox(nullptr), pEntry(nullptr) { } + OJoinExchangeData() : pListBox(nullptr), nEntry(-1) { } }; + struct OJoinDropData { OJoinExchangeData aSource; OJoinExchangeData aDest; }; + class OJoinExchObj; class OTableWindow; + class TableWindowListBoxHelper; + class OTableWindowListBox - :public SvTreeListBox - ,public IDragTransferableListener + : public InterimItemWindow + , public IDragTransferableListener { - DECL_LINK( OnDoubleClick, SvTreeListBox*, bool ); - DECL_LINK( ScrollUpHdl, Timer*, void ); - DECL_LINK( ScrollDownHdl, Timer*, void ); + std::unique_ptr<weld::TreeView> m_xTreeView; + std::unique_ptr<TableWindowListBoxHelper> m_xDragDropTargetHelper; + + DECL_LINK( OnDoubleClick, weld::TreeView&, bool ); + DECL_LINK(CommandHdl, const CommandEvent&, bool); DECL_LINK( DropHdl, void*, void ); DECL_LINK( LookForUiHdl, void*, void ); + DECL_LINK( DragBeginHdl, bool&, bool ); + DECL_LINK( ScrollHdl, weld::TreeView&, void ); - Timer m_aScrollTimer; - Point m_aMousePos; + rtl::Reference<OJoinExchObj> m_xHelper; VclPtr<OTableWindow> m_pTabWin; ImplSVEvent * m_nDropEvent; ImplSVEvent * m_nUiEvent; OJoinDropData m_aDropInfo; - bool m_bReallyScrolled : 1; - protected: virtual void LoseFocus() override; virtual void GetFocus() override; - virtual void NotifyScrolled() override; - virtual void NotifyEndScroll() override; - - virtual bool PreNotify(NotifyEvent& rNEvt) override; virtual void dragFinished( ) override; - public: OTableWindowListBox(OTableWindow* pParent); virtual ~OTableWindowListBox() override; virtual void dispose() override; + const weld::TreeView& get_widget() const { return *m_xTreeView; } + weld::TreeView& get_widget() { return *m_xTreeView; } + // DnD stuff - virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override; - virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; - virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; + sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt); + sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt); // window virtual void Command(const CommandEvent& rEvt) override; OTableWindow* GetTabWin(){ return m_pTabWin; } - SvTreeListEntry* GetEntryFromText( const OUString& rEntryText ); + int GetEntryFromText( std::u16string_view rEntryText ); + }; + class TableWindowListBoxHelper final : public DropTargetHelper + { private: - using SvTreeListBox::ExecuteDrop; + OTableWindowListBox& m_rParent; + + virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt) override + { + return m_rParent.AcceptDrop(rEvt); + } + + virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt) override + { + return m_rParent.ExecuteDrop(rEvt); + } + + public: + TableWindowListBoxHelper(OTableWindowListBox& rParent, const css::uno::Reference<css::datatransfer::dnd::XDropTarget>& rDropTarget) + : DropTargetHelper(rDropTarget) + , m_rParent(rParent) + { + } }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWLISTBOX_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TableWindowTitle.hxx b/dbaccess/source/ui/inc/TableWindowTitle.hxx index 50f5dda8a8b2..0a3779bd8873 100644 --- a/dbaccess/source/ui/inc/TableWindowTitle.hxx +++ b/dbaccess/source/ui/inc/TableWindowTitle.hxx @@ -16,36 +16,29 @@ * 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_DBACCESS_SOURCE_UI_INC_TABLEWINDOWTITLE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWTITLE_HXX +#pragma once -#include <vcl/fixed.hxx> +#include <vcl/InterimItemWindow.hxx> namespace dbaui { class OTableWindow; - class OTableWindowTitle : public FixedText + class OTableWindowTitle final : public InterimItemWindow { VclPtr<OTableWindow> m_pTabWin; + std::unique_ptr<weld::Label> m_xLabel; + std::unique_ptr<weld::Image> m_xImage; - protected: - virtual void Command(const CommandEvent& rEvt) override; - // virtual void Paint( const Rectangle& rRect ); - virtual void MouseButtonDown( const MouseEvent& rEvt ) override; - virtual void KeyInput( const KeyEvent& rEvt ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + DECL_LINK(MousePressHdl, const MouseEvent&, bool); public: OTableWindowTitle( OTableWindow* pParent ); virtual ~OTableWindowTitle() override; virtual void dispose() override; - virtual void LoseFocus() override; - virtual void GetFocus() override; - virtual void RequestHelp( const HelpEvent& rHEvt ) override; - // window override - virtual void StateChanged( StateChangedType nStateChange ) override; + + weld::Label& GetLabel() { return *m_xLabel; } + weld::Image& GetImage() { return *m_xImage; } }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOWTITLE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TablesSingleDlg.hxx b/dbaccess/source/ui/inc/TablesSingleDlg.hxx index 6e73555b6892..c75fa1eb3da2 100644 --- a/dbaccess/source/ui/inc/TablesSingleDlg.hxx +++ b/dbaccess/source/ui/inc/TablesSingleDlg.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TABLESSINGLEDLG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLESSINGLEDLG_HXX +#pragma once #include <sfx2/basedlgs.hxx> #include "IItemSetHelper.hxx" @@ -69,6 +68,4 @@ class ODbDataSourceAdministrationHelper; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLESSINGLEDLG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index ecf8f9442e58..3a4bfc359f0b 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TOKENWRITER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TOKENWRITER_HXX +#pragma once #include "commontypes.hxx" @@ -47,7 +46,6 @@ class SvStream; namespace dbaui { // ODatabaseImportExport base class for import/export - class ODatabaseExport; class ODatabaseImportExport : public ::cppu::WeakImplHelper< css::lang::XEventListener> { protected: @@ -84,7 +82,7 @@ namespace dbaui const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF); // import data - ODatabaseImportExport( const SharedConnection& _rxConnection, + ODatabaseImportExport( SharedConnection _xConnection, const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF, const css::uno::Reference< css::uno::XComponentContext >& _rM); @@ -138,10 +136,6 @@ namespace dbaui const sal_Int16 nIndentMax = 23; class OHTMLImportExport : public ODatabaseImportExport { - // default HtmlFontSz[1-7] - static const sal_Int16 nDefaultFontSize[SBA_HTML_FONTSIZES]; - // HtmlFontSz[1-7] in s*3.ini [user] - static sal_Int16 nFontSize[SBA_HTML_FONTSIZES]; static const sal_Int16 nCellSpacing; static const char sIndentSource[]; char sIndent[nIndentMax+1]; @@ -207,6 +201,5 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TOKENWRITER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/TypeInfo.hxx b/dbaccess/source/ui/inc/TypeInfo.hxx index 36cf41e9228d..e9958e8e8dda 100644 --- a/dbaccess/source/ui/inc/TypeInfo.hxx +++ b/dbaccess/source/ui/inc/TypeInfo.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_TYPEINFO_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TYPEINFO_HXX +#pragma once #include <rtl/ustring.hxx> #include <com/sun/star/sdbc/DataType.hpp> @@ -119,6 +118,4 @@ const sal_uInt16 TYPE_BIT = 31; bool& _brForceToType); } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TYPEINFO_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 0ea5b03c93c3..f45213a28b49 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_UITOOLS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_UITOOLS_HXX +#pragma once #include <connectivity/dbexception.hxx> #include <comphelper/stl_types.hxx> @@ -25,8 +24,10 @@ #include <editeng/svxenum.hxx> #include <vcl/taskpanelist.hxx> #include <connectivity/dbtools.hxx> +#include <unotools/resmgr.hxx> #include <memory> +#include <string_view> #define RET_ALL 100 @@ -43,11 +44,6 @@ namespace com::sun::star { { class XEventListener; } - namespace awt - { - struct FontDescriptor; - class XWindow; - } namespace sdbc { class XDatabaseMetaData; @@ -55,7 +51,6 @@ namespace com::sun::star { } namespace util { - struct URL; class XNumberFormatter; } namespace ucb { class XContent; } @@ -68,9 +63,10 @@ namespace svt } namespace vcl { class Window; } -namespace weld {class Window; } -class ToolBox; -namespace vcl { class Font; } +namespace weld { + class Widget; + class Window; +} class SvNumberFormatter; class SfxFilter; @@ -111,7 +107,7 @@ namespace dbaui @param _rTypeInfoIters the vector filled with map iterators */ void fillTypeInfo( const css::uno::Reference< css::sdbc::XConnection>& _rxConnection, - const OUString& _rsTypeNames, + std::u16string_view _rsTypeNames, OTypeInfoMap& _rTypeInfoMap, std::vector<OTypeInfoMap::iterator>& _rTypeInfoIters); @@ -136,7 +132,7 @@ namespace dbaui @param SvxCellHorJustify& _eAlignment @return the corresponding css::awt::TextAlign */ - sal_Int32 mapTextAllign(const SvxCellHorJustify& _eAlignment); + sal_Int32 mapTextAlign(const SvxCellHorJustify& _eAlignment); /** retrieves a data source given by name or URL, and displays an error if this fails @@ -181,11 +177,11 @@ namespace dbaui void callColumnFormatDialog(const css::uno::Reference< css::beans::XPropertySet>& _xAffectedCol, const css::uno::Reference< css::beans::XPropertySet>& _xField, SvNumberFormatter* _pFormatter, - const vcl::Window* _pParent); + weld::Widget* _pParent); /** second variant of the function before */ - bool callColumnFormatDialog(const vcl::Window* _pParent, + bool callColumnFormatDialog(weld::Widget* _pParent, SvNumberFormatter* _pFormatter, sal_Int32 _nDataType, sal_Int32& _nFormatKey, @@ -307,7 +303,7 @@ namespace dbaui @return RET_YES, RET_NO, RET_ALL */ - sal_Int32 askForUserAction(weld::Window* pParent, const char* pTitle, const char* pText, bool bAll, const OUString& rName); + sal_Int32 askForUserAction(weld::Window* pParent, TranslateId pTitle, TranslateId pText, bool bAll, std::u16string_view rName); /** creates a new view from a query or table @param _sName @@ -368,7 +364,7 @@ namespace dbaui @return <TRUE/> if the insert operation was successful, otherwise <FALSE/>. */ - bool insertHierachyElement( + bool insertHierarchyElement( weld::Window* pParent, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const css::uno::Reference< css::container::XHierarchicalNameContainer>& _xNames, @@ -388,6 +384,5 @@ namespace dbaui css::uno::Reference< css::util::XNumberFormatter > getNumberFormatter(const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_UITOOLS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx index b30f2cd95d91..8787e10f39e5 100644 --- a/dbaccess/source/ui/inc/UserAdminDlg.hxx +++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_USERADMINDLG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_USERADMINDLG_HXX +#pragma once #include <sfx2/tabdlg.hxx> #include "IItemSetHelper.hxx" @@ -28,9 +27,6 @@ namespace com::sun::star { namespace sdbc { class XConnection; } - namespace lang { - class XMultiServiceFactory; - } } namespace dbaui @@ -48,7 +44,7 @@ namespace dbaui css::uno::Reference< css::sdbc::XConnection> m_xConnection; bool m_bOwnConnection; protected: - virtual void PageCreated(const OString& rId, SfxTabPage& _rPage) override; + virtual void PageCreated(const OUString& rId, SfxTabPage& _rPage) override; public: OUserAdminDlg(weld::Window* pParent, SfxItemSet* pItems, const css::uno::Reference< css::uno::XComponentContext >& rxORB, @@ -74,6 +70,4 @@ namespace dbaui }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_USERADMINDLG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx deleted file mode 100644 index 25a0a6442e81..000000000000 --- a/dbaccess/source/ui/inc/VertSplitView.hxx +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- 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_DBACCESS_SOURCE_UI_INC_VERTSPLITVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_VERTSPLITVIEW_HXX - -#include <vcl/window.hxx> - -class Splitter; - -namespace dbaui -{ - class OSplitterView : public vcl::Window - { - VclPtr<Splitter> m_pSplitter; - VclPtr<vcl::Window> m_pLeft; - VclPtr<vcl::Window> m_pRight; - ImplSVEvent *m_pResizeId; - - void ImplInitSettings(); - DECL_LINK(SplitHdl, Splitter*, void); - DECL_LINK(ResizeHdl, void*, void); - protected: - virtual void DataChanged(const DataChangedEvent& rDCEvt) override; - public: - OSplitterView(vcl::Window* _pParent); - virtual ~OSplitterView() override; - // Window overrides - virtual void dispose() override; - virtual void GetFocus() override; - - void setSplitter(Splitter* _pSplitter); - void set(vcl::Window* _pRight,Window* _pLeft = nullptr); - virtual void Resize() override; - }; -} -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_VERTSPLITVIEW_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx index 617f723c78fa..e23d64f59940 100644 --- a/dbaccess/source/ui/inc/WCPage.hxx +++ b/dbaccess/source/ui/inc/WCPage.hxx @@ -16,15 +16,12 @@ * 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_DBACCESS_SOURCE_UI_INC_WCPAGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_WCPAGE_HXX +#pragma once #include "WTabPage.hxx" namespace dbaui { - class OWizColumnSelect; - class OWizNormalExtend; class OCopyTable final : public OWizardPage { bool m_bPKeyAllowed; @@ -41,9 +38,8 @@ namespace dbaui std::unique_ptr<weld::Label> m_xFT_KeyName; std::unique_ptr<weld::Entry> m_xEdKeyName; - DECL_LINK( AppendDataClickHdl, weld::Button&, void ); - DECL_LINK( RadioChangeHdl, weld::Button&, void ); - DECL_LINK( KeyClickHdl, weld::Button&, void ); + DECL_LINK( RadioChangeHdl, weld::Toggleable&, void ); + DECL_LINK( KeyClickHdl, weld::Toggleable&, void ); bool checkAppendData(); void SetAppendDataRadio(); @@ -76,6 +72,5 @@ namespace dbaui void setCreatePrimaryKey( bool _bDoCreate, const OUString& _rSuggestedName ); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WCPAGE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx index 59ebc0ae81a4..38b1317fd507 100644 --- a/dbaccess/source/ui/inc/WColumnSelect.hxx +++ b/dbaccess/source/ui/inc/WColumnSelect.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_WCOLUMNSELECT_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_WCOLUMNSELECT_HXX +#pragma once #include "WTabPage.hxx" #include "WCopyTable.hxx" @@ -50,7 +49,7 @@ namespace dbaui OFieldDescription const * _pSrcField, std::vector< OUString>& _rRightColumns, const OUString& _sColumnName, - const OUString& _sExtraChars, + std::u16string_view _sExtraChars, sal_Int32 _nMaxNameLen, const ::comphelper::UStringMixEqual& _aCase); @@ -58,14 +57,14 @@ namespace dbaui weld::TreeView const * _pLeft, std::vector< OUString>& _rRightColumns, const OUString& _sColumnName, - const OUString& _sExtraChars, + std::u16string_view _sExtraChars, sal_Int32 _nMaxNameLen, const ::comphelper::UStringMixEqual& _aCase); void enableButtons(); sal_Int32 adjustColumnPosition(weld::TreeView const * _pLeft, - const OUString& _sColumnName, + std::u16string_view _sColumnName, ODatabaseExport::TColumnVector::size_type nCurrentPos, const ::comphelper::UStringMixEqual& _aCase); @@ -79,6 +78,5 @@ namespace dbaui virtual ~OWizColumnSelect() override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WCOLUMNSELECT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index 0563232451f9..84b9182fe5f6 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_WCOPYTABLE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_WCOPYTABLE_HXX +#pragma once #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/sdbc/XConnection.hpp> @@ -27,7 +26,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/stl_types.hxx> #include "TypeInfo.hxx" -#include <vcl/roadmapwizard.hxx> +#include <vcl/roadmapwizardmachine.hxx> #include "DExport.hxx" #include "WTabPage.hxx" #include "FieldDescriptions.hxx" @@ -62,7 +61,7 @@ namespace dbaui bool operator()(const OUString& _sColumnName) const override { - return m_pColumns->find(_sColumnName) != m_pColumns->end(); + return m_pColumns->contains(_sColumnName); } }; @@ -184,7 +183,7 @@ namespace dbaui public: NamedTableCopySource( const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, - const OUString& _rTableName + OUString _sTableName ); // ICopyTableSourceObject overridables @@ -310,9 +309,9 @@ namespace dbaui // used for importing rtf/html sources OCopyTableWizard( weld::Window* pParent, - const OUString& _rDefaultName, + OUString _sDefaultName, sal_Int16 _nOperation, - const ODatabaseExport::TColumns& _rDestColumns, + ODatabaseExport::TColumns&& _rDestColumns, const ODatabaseExport::TColumnVector& _rSourceColVec, const css::uno::Reference< css::sdbc::XConnection >& _xConnection, const css::uno::Reference< css::util::XNumberFormatter >& _xFormatter, @@ -386,7 +385,7 @@ namespace dbaui void clearDestColumns(); css::uno::Reference< css::beans::XPropertySet > returnTable(); - css::uno::Reference< css::beans::XPropertySet > getTable(); + css::uno::Reference< css::beans::XPropertySet > getTable() const; css::uno::Reference< css::beans::XPropertySet > createTable(); css::uno::Reference< css::beans::XPropertySet > createView() const; sal_Int32 getMaxColumnNameLength() const; @@ -396,14 +395,14 @@ namespace dbaui OUString convertColumnName( const TColumnFindFunctor& _rCmpFunctor, const OUString& _sColumnName, - const OUString& _sExtraChars, + std::u16string_view _sExtraChars, sal_Int32 _nMaxNameLen); TOTypeInfoSP convertType(const TOTypeInfoSP&_pType, bool& _bNotConvert); OUString createUniqueName(const OUString& _sName); // displays an error message that a column type is not supported - void showColumnTypeNotSupported(const OUString& _rColumnName); + void showColumnTypeNotSupported(std::u16string_view _rColumnName); void removeColumnNameFromNameMap(const OUString& _sName); void showError(const OUString& _sErrorMessage); @@ -411,6 +410,4 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WCOPYTABLE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/WExtendPages.hxx b/dbaccess/source/ui/inc/WExtendPages.hxx index 05a251c0ee8b..7d75f2cc1abf 100644 --- a/dbaccess/source/ui/inc/WExtendPages.hxx +++ b/dbaccess/source/ui/inc/WExtendPages.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_WEXTENDPAGES_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_WEXTENDPAGES_HXX +#pragma once #include "WTypeSelect.hxx" @@ -66,6 +65,5 @@ namespace dbaui } }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WEXTENDPAGES_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/WNameMatch.hxx b/dbaccess/source/ui/inc/WNameMatch.hxx index 0b4b45617cad..d108c043c635 100644 --- a/dbaccess/source/ui/inc/WNameMatch.hxx +++ b/dbaccess/source/ui/inc/WNameMatch.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_WNAMEMATCH_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_WNAMEMATCH_HXX +#pragma once #include "WTabPage.hxx" #include "DExport.hxx" @@ -60,6 +59,5 @@ namespace dbaui virtual ~OWizNameMatching() override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WNAMEMATCH_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/WTabPage.hxx b/dbaccess/source/ui/inc/WTabPage.hxx index 0bcd04082dcd..ef3d7f23b20c 100644 --- a/dbaccess/source/ui/inc/WTabPage.hxx +++ b/dbaccess/source/ui/inc/WTabPage.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_WTABPAGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_WTABPAGE_HXX +#pragma once #include <vcl/wizardmachine.hxx> @@ -32,7 +31,7 @@ namespace dbaui OCopyTableWizard* m_pParent; bool m_bFirstTime; // Page is called the first time; should be set in the reset method - OWizardPage(weld::Container* pPage, OCopyTableWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID); + OWizardPage(weld::Container* pPage, OCopyTableWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID); public: virtual ~OWizardPage() override; @@ -43,6 +42,5 @@ namespace dbaui bool IsFirstTime() const { return m_bFirstTime; } }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WTABPAGE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index 4a0f240a788f..3c206d0fecb1 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_WTYPESELECT_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_WTYPESELECT_HXX +#pragma once #include "FieldDescControl.hxx" #include "TypeInfo.hxx" @@ -28,7 +27,6 @@ class SvStream; namespace dbaui { class OWizTypeSelect; - class OTableDesignHelpBar; // OWizTypeSelectControl class OWizTypeSelectControl final : public OFieldDescControl { @@ -36,7 +34,7 @@ namespace dbaui virtual void ActivateAggregate( EControlType eType ) override; virtual void DeactivateAggregate( EControlType eType ) override; - virtual void CellModified(long nRow, sal_uInt16 nColId ) override; + virtual void CellModified(sal_Int32 nRow, sal_uInt16 nColId ) override; virtual css::lang::Locale GetLocale() const override; virtual css::uno::Reference< css::util::XNumberFormatter > GetFormatter() const override; @@ -73,7 +71,6 @@ namespace dbaui void SetPKey(bool bPKey) { m_bPKey = bPKey; } weld::TreeView* GetWidget() { return m_xControl.get(); } OUString get_selected_id() const { return m_xControl->get_selected_id(); } - void show() { m_xControl->show(); } void clear() { m_xControl->clear(); } void append(const OUString& rId, const OUString& rStr) { @@ -89,7 +86,7 @@ namespace dbaui void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_aChangeHdl = rLink; - m_xControl->connect_changed(rLink); + m_xControl->connect_selection_changed(rLink); } }; @@ -105,9 +102,8 @@ namespace dbaui DECL_LINK( ButtonClickHdl, weld::Button&, void ); protected: std::unique_ptr<OWizTypeSelectList> m_xColumnNames; - std::unique_ptr<weld::Label> m_xColumns; std::unique_ptr<weld::Container> m_xControlContainer; - VclPtr<OWizTypeSelectControl> m_xTypeControl; + std::unique_ptr<OWizTypeSelectControl> m_xTypeControl; std::unique_ptr<weld::Label> m_xAutoType; std::unique_ptr<weld::Label> m_xAutoFt; std::unique_ptr<weld::SpinButton> m_xAutoEt; @@ -137,6 +133,5 @@ namespace dbaui typedef std::unique_ptr<OWizTypeSelect> (*TypeSelectionPageFactory)(weld::Container*, OCopyTableWizard*, SvStream&); } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WTYPESELECT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index bad72a5f6830..5fe1d7c1da42 100644 --- a/dbaccess/source/ui/inc/adtabdlg.hxx +++ b/dbaccess/source/ui/inc/adtabdlg.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_ADTABDLG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_ADTABDLG_HXX +#pragma once #include <memory> #include <com/sun/star/sdbc/XConnection.hpp> @@ -61,7 +60,7 @@ namespace dbaui std::unique_ptr<weld::RadioButton> m_xCaseTables; std::unique_ptr<weld::RadioButton> m_xCaseQueries; - std::unique_ptr<TableTreeListBox> m_xTableList; + std::unique_ptr<OTableTreeListBox> m_xTableList; std::unique_ptr<weld::TreeView> m_xQueryList; std::unique_ptr<weld::Button> m_xAddButton; @@ -71,7 +70,7 @@ namespace dbaui DECL_LINK( CloseClickHdl, weld::Button&, void); DECL_LINK( TableListDoubleClickHdl, weld::TreeView&, bool ); DECL_LINK( TableListSelectHdl, weld::TreeView&, void ); - DECL_LINK( OnTypeSelected, weld::Button&, void ); + DECL_LINK( OnTypeSelected, weld::Toggleable&, void ); public: OAddTableDlg(weld::Window* _pParent, @@ -95,6 +94,5 @@ namespace dbaui void impl_switchTo( ObjectList _eList ); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_ADTABDLG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx index f2d6e68cd60d..7c38562145a5 100644 --- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx +++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_ADVANCEDSETTINGSDLG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_ADVANCEDSETTINGSDLG_HXX +#pragma once #include "IItemSetHelper.hxx" #include <sfx2/tabdlg.hxx> @@ -38,7 +37,7 @@ namespace dbaui std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl; protected: - virtual void PageCreated(const OString& rId, SfxTabPage& _rPage) override; + virtual void PageCreated(const OUString& rId, SfxTabPage& _rPage) override; virtual short Ok() override; public: @@ -68,6 +67,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_ADVANCEDSETTINGSDLG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/asyncmodaldialog.hxx b/dbaccess/source/ui/inc/asyncmodaldialog.hxx index 3b6d2517a154..483dfb7c161b 100644 --- a/dbaccess/source/ui/inc/asyncmodaldialog.hxx +++ b/dbaccess/source/ui/inc/asyncmodaldialog.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_ASYNCMODALDIALOG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_ASYNCMODALDIALOG_HXX +#pragma once #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> @@ -45,6 +44,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_ASYNCMODALDIALOG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/browserids.hxx b/dbaccess/source/ui/inc/browserids.hxx index 44e96431fe82..0c510497dea1 100644 --- a/dbaccess/source/ui/inc/browserids.hxx +++ b/dbaccess/source/ui/inc/browserids.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_BROWSERIDS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_BROWSERIDS_HXX +#pragma once #include <svx/svxids.hrc> #include <dbaccess_slotid.hrc> @@ -51,7 +50,6 @@ #define ID_BROWSER_COLWIDTH 10021 // column width #define ID_BROWSER_TABLEATTR 10022 // table format attributes #define ID_BROWSER_ROWHEIGHT 10023 // row height -#define ID_BROWSER_COLUMNINFO 10024 // copies the column description to insert it into the table design #define ID_BROWSER_ADDTABLE SID_FM_ADDTABLE #define ID_BROWSER_EXPLORER SID_DSBROWSER_EXPLORER #define ID_BROWSER_DOCUMENT_DATASOURCE SID_DOCUMENT_DATA_SOURCE @@ -97,6 +95,4 @@ #define ID_BROWSER_INSERT_ROW (SID_SBA_START + 46) // insert row -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_BROWSERIDS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index 58a13cf17690..38c8ecc40f35 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_BRWCTRLR_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_BRWCTRLR_HXX +#pragma once #include <dbaccess/genericcontroller.hxx> #include "brwview.hxx" @@ -46,11 +45,6 @@ struct FmFoundRecordInformation; struct FmSearchContext; -namespace dbtools -{ - class SQLExceptionInfo; -} - namespace dbaui { @@ -80,7 +74,6 @@ namespace dbaui css::uno::Reference< css::form::XLoadable > m_xLoadable; // queried from the rowset member as well css::uno::Reference< css::form::XFormComponent > m_xGridModel; // the model of our grid css::uno::Reference< css::util::XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier - css::uno::Reference< css::uno::XAggregation > m_xFormControllerImpl; mutable css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xParser; // for sorting 'n filtering @@ -101,7 +94,7 @@ namespace dbaui OUString m_sModuleIdentifier; // members for asynchronous load operations - FormControllerImpl* m_pFormControllerImpl; // implementing the XFormController + rtl::Reference<FormControllerImpl> m_xFormControllerImpl; // implementing the XFormController sal_uInt16 m_nFormActionNestingLevel; // see enter-/leaveFormAction @@ -331,6 +324,4 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_BRWCTRLR_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/brwview.hxx b/dbaccess/source/ui/inc/brwview.hxx index 82a7129f6985..d7c83a4062f1 100644 --- a/dbaccess/source/ui/inc/brwview.hxx +++ b/dbaccess/source/ui/inc/brwview.hxx @@ -17,16 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX +#pragma once #include <vcl/window.hxx> #include <dbaccess/dataview.hxx> #include <unotools/eventlisteneradapter.hxx> +#include "dbtreelistbox.hxx" namespace com::sun::star::awt { - class XControl; class XControlContainer; class XControlModel; } @@ -35,22 +34,21 @@ class Splitter; namespace dbaui { - class DBTreeView; class SbaGridControl; + class SbaXGridControl; class UnoDataBrowserView final : public ODataView, public ::utl::OEventListenerAdapter { - css::uno::Reference< css::awt::XControl > m_xGrid; // our grid's UNO representation + rtl::Reference< SbaXGridControl > m_xGrid; // our grid's UNO representation css::uno::Reference< css::awt::XControlContainer > m_xMe; // our own UNO representation - VclPtr<DBTreeView> m_pTreeView; + VclPtr<InterimDBTreeListBox> m_pTreeView; VclPtr<Splitter> m_pSplitter; mutable VclPtr<SbaGridControl> m_pVclControl; // our grid's VCL representation - VclPtr<vcl::Window> m_pStatus; DECL_LINK( SplitHdl, Splitter*, void ); // attribute access public: - const css::uno::Reference< css::awt::XControl >& getGridControl() const { return m_xGrid; } + const rtl::Reference< SbaXGridControl >& getGridControl() const { return m_xGrid; } SbaGridControl* getVclControl() const; UnoDataBrowserView( vcl::Window* pParent, @@ -68,8 +66,8 @@ namespace dbaui sal_uInt16 View2ModelPos(sal_uInt16 nPos) const; /// for the same reason the view column count isn't the same as the model column count - void setSplitter(Splitter* _pSplitter); - void setTreeView(DBTreeView* _pTreeView); + void setSplitter(Splitter* pSplitter); + void setTreeView(InterimDBTreeListBox* pTreeView); void showStatus( const OUString& _rStatus ); void hideStatus(); @@ -94,6 +92,5 @@ namespace dbaui ~BrowserViewStatusDisplay( ); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_BRWVIEW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/callbacks.hxx b/dbaccess/source/ui/inc/callbacks.hxx index 8a607db34eff..e380b2671d6c 100644 --- a/dbaccess/source/ui/inc/callbacks.hxx +++ b/dbaccess/source/ui/inc/callbacks.hxx @@ -17,20 +17,27 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_CALLBACKS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_CALLBACKS_HXX +#pragma once #include <sot/exchange.hxx> -class SvTreeListEntry; class Point; -class PopupMenu; -class Control; struct AcceptDropEvent; struct ExecuteDropEvent; namespace comphelper { class OInterfaceContainerHelper2; } +namespace vcl +{ + class Window; +} + +namespace weld +{ + class TreeIter; + class TreeView; +} + namespace dbaui { @@ -42,12 +49,12 @@ namespace dbaui /** requests a quick help text to display @return <FALSE/> if the default quick help text should be used */ - virtual bool requestQuickHelp( const SvTreeListEntry* _pEntry, OUString& _rText ) const = 0; + virtual bool requestQuickHelp(const void* pUserData, OUString& rText) const = 0; /** handler for StartDrag requests @return <TRUE/> if a drag operation was started */ - virtual bool requestDrag( const Point& _rPosPixel ) = 0; + virtual bool requestDrag(const weld::TreeIter& rEntry) = 0; /** check whether or not a drop request should be accepted */ @@ -69,7 +76,7 @@ namespace dbaui Supposed to be a valid name from uiconfig/<module>/popupmenu folder. */ - virtual OUString getContextMenuResourceName( Control& _rControl ) const = 0; + virtual OUString getContextMenuResourceName() const = 0; /** returns the controller which is responsible for providing states of certain features, and executing them. @@ -87,7 +94,14 @@ namespace dbaui This selection is used for filling a ContextMenuExecuteEvent event for the given control. */ - virtual css::uno::Any getCurrentSelection( Control& _rControl ) const = 0; + virtual css::uno::Any getCurrentSelection(weld::TreeView& rControl) const = 0; + + virtual vcl::Window* getMenuParent() const = 0; + + /** adjust rPos which is initially relative to rControl to be relative to + the window of getMenuParent + */ + virtual void adjustMenuPosition(const weld::TreeView& rControl, ::Point& rPos) const = 0; protected: ~IContextMenuProvider() {} @@ -106,6 +120,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CALLBACKS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx index d58c1ca6531a..a12b425cd9c1 100644 --- a/dbaccess/source/ui/inc/charsetlistbox.hxx +++ b/dbaccess/source/ui/inc/charsetlistbox.hxx @@ -17,13 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETLISTBOX_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETLISTBOX_HXX +#pragma once +#include <svl/typedwhich.hxx> #include <vcl/weld.hxx> #include "charsets.hxx" class SfxItemSet; +class SfxStringItem; namespace dbaui { @@ -33,8 +34,8 @@ namespace dbaui public: CharSetListBox(std::unique_ptr<weld::ComboBox> xControl); - void SelectEntryByIanaName( const OUString& _rIanaName ); - bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ); + void SelectEntryByIanaName( std::u16string_view _rIanaName ); + bool StoreSelectedCharSet( SfxItemSet& _rSet, TypedWhichId<SfxStringItem> _nItemId ); weld::ComboBox* get_widget() { return m_xControl.get(); } void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); } @@ -46,6 +47,4 @@ namespace dbaui }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETLISTBOX_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/charsets.hxx b/dbaccess/source/ui/inc/charsets.hxx index b48e14f6e5a7..49977bd56262 100644 --- a/dbaccess/source/ui/inc/charsets.hxx +++ b/dbaccess/source/ui/inc/charsets.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETS_HXX +#pragma once #include <connectivity/dbcharset.hxx> #include <rtl/ustring.hxx> @@ -44,7 +43,7 @@ namespace dbaui // various find operations const_iterator findEncoding(const rtl_TextEncoding _eEncoding) const; - const_iterator findIanaName(const OUString& _rIanaName) const; + const_iterator findIanaName(std::u16string_view _rIanaName) const; const_iterator findDisplayName(const OUString& _rDisplayName) const; /// get access to the first element of the charset collection @@ -73,7 +72,7 @@ namespace dbaui const OUString& getDisplayName() const { return m_sDisplayName; } private: - CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, const OUString& _rDisplayName); + CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, OUString _sDisplayName); }; //- OCharsetDisplay::ExtendedCharsetIterator @@ -98,11 +97,9 @@ namespace dbaui const ExtendedCharsetIterator& operator++(); protected: - ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, const base_iterator& _rPosition ); + ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, base_iterator _aPosition ); }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/commontypes.hxx b/dbaccess/source/ui/inc/commontypes.hxx index 6562555e6f5c..50c5670104bd 100644 --- a/dbaccess/source/ui/inc/commontypes.hxx +++ b/dbaccess/source/ui/inc/commontypes.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_COMMONTYPES_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_COMMONTYPES_HXX +#pragma once #include <sal/config.h> @@ -37,6 +36,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_COMMONTYPES_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx index 1b53358c4f77..6042f761ce2f 100644 --- a/dbaccess/source/ui/inc/curledit.hxx +++ b/dbaccess/source/ui/inc/curledit.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_CURLEDIT_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_CURLEDIT_HXX +#pragma once #include <vcl/weld.hxx> #include <dsntypes.hxx> @@ -44,7 +43,7 @@ public: public: bool get_visible() const { return m_xEntry->get_visible(); } void connect_changed(const Link<weld::Entry&, void>& rLink) { m_xEntry->connect_changed(rLink); } - void set_help_id(const OString& rName) { m_xEntry->set_help_id(rName); } + void set_help_id(const OUString& rName) { m_xEntry->set_help_id(rName); } void hide() { m_xEntry->hide(); @@ -100,6 +99,4 @@ public: } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CURLEDIT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/databaseobjectview.hxx b/dbaccess/source/ui/inc/databaseobjectview.hxx index 9fa293c0e213..46df99181627 100644 --- a/dbaccess/source/ui/inc/databaseobjectview.hxx +++ b/dbaccess/source/ui/inc/databaseobjectview.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DATABASEOBJECTVIEW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DATABASEOBJECTVIEW_HXX +#pragma once #include <rtl/ustring.hxx> #include <com/sun/star/sdbc/XConnection.hpp> @@ -92,7 +91,7 @@ namespace dbaui const css::uno::Reference< css::uno::XComponentContext >& _rxORB, const css::uno::Reference< css::sdb::application::XDatabaseDocumentUI >& _rxApplication, const css::uno::Reference< css::frame::XFrame >& _rxParentFrame, - const OUString& _rComponentURL + OUString _sComponentURL ); virtual ~DatabaseObjectView(){} @@ -228,6 +227,4 @@ namespace dbaui }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DATABASEOBJECTVIEW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/datasourceconnector.hxx b/dbaccess/source/ui/inc/datasourceconnector.hxx index 30cc3cdfe730..56f7bf2f067b 100644 --- a/dbaccess/source/ui/inc/datasourceconnector.hxx +++ b/dbaccess/source/ui/inc/datasourceconnector.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DATASOURCECONNECTOR_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DATASOURCECONNECTOR_HXX +#pragma once #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/sdbc/XConnection.hpp> @@ -49,7 +48,7 @@ namespace dbaui ODatasourceConnector( const css::uno::Reference< css::uno::XComponentContext >& _rxContext, weld::Window* _pMessageParent, - const OUString& _rContextInformation + OUString _sContextInformation ); /// returns <TRUE/> if the object is able to create data source connections @@ -74,6 +73,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DATASOURCECONNECTOR_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx index f0c6ed6c7e71..3d1457793640 100644 --- a/dbaccess/source/ui/inc/dbadmin.hxx +++ b/dbaccess/source/ui/inc/dbadmin.hxx @@ -17,24 +17,18 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DBADMIN_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DBADMIN_HXX +#pragma once #include <sfx2/tabdlg.hxx> #include <dsntypes.hxx> #include "IItemSetHelper.hxx" +#include <unotools/resmgr.hxx> #include <memory> namespace com::sun::star { namespace beans { class XPropertySet; } - namespace sdbc { - class XConnection; - } - namespace lang { - class XMultiServiceFactory; - } } namespace dbaui @@ -49,7 +43,7 @@ class ODbAdminDialog final : public SfxTabDialogController, public IItemSetHelpe private: std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl; - OString m_sMainPageID; + OUString m_sMainPageID; public: /** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed @@ -63,10 +57,10 @@ public: @param _pTypeCollection pointer to an <type>ODatasourceMap</type>. May be NULL, in this case the pool will not contain a typecollection default. */ - static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults, ::dbaccess::ODsnTypeCollection* _pTypeCollection); + static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, ::dbaccess::ODsnTypeCollection* _pTypeCollection); /** destroy and item set / item pool / pool defaults previously created by <method>createItemSet</method> */ - static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults); + static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool); /** selects the DataSource @param _rName @@ -89,9 +83,9 @@ public: private: // adds a new detail page and remove all the old ones - void addDetailPage(const OString& rPageId, const char* pTextId, CreateTabPage pCreateFunc); + void addDetailPage(const OUString& rPageId, TranslateId pTextId, CreateTabPage pCreateFunc); - virtual void PageCreated(const OString& rId, SfxTabPage& _rPage) override; + virtual void PageCreated(const OUString& rId, SfxTabPage& _rPage) override; virtual short Ok() override; /// select a datasource with a given name, adjust the item set accordingly, and everything like that .. @@ -111,6 +105,4 @@ private: } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DBADMIN_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dbexchange.hxx b/dbaccess/source/ui/inc/dbexchange.hxx index 7ee0f5ca2cf2..050f5bd3b849 100644 --- a/dbaccess/source/ui/inc/dbexchange.hxx +++ b/dbaccess/source/ui/inc/dbexchange.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_DBEXCHANGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DBEXCHANGE_HXX +#pragma once #include "TokenWriter.hxx" #include <com/sun/star/util/XNumberFormatter.hpp> @@ -43,7 +42,16 @@ namespace dbaui ::rtl::Reference< ORTFImportExport > m_pRtf; public: + ODataClipboard(); + ODataClipboard( + const css::uno::Reference< css::beans::XPropertySet >& i_rAliveForm, + const css::uno::Sequence< css::uno::Any >& i_rSelectedRows, + const bool i_bBookmarkSelection, + const css::uno::Reference< css::uno::XComponentContext >& i_rORB + ); + + void Update( const OUString& _rDatasource, const sal_Int32 _nCommandType, const OUString& _rCommand, @@ -52,7 +60,7 @@ namespace dbaui const css::uno::Reference< css::uno::XComponentContext >& _rxORB ); - ODataClipboard( + void Update( const OUString& _rDatasource, const sal_Int32 _nCommandType, const OUString& _rCommand, @@ -60,13 +68,6 @@ namespace dbaui const css::uno::Reference< css::uno::XComponentContext >& _rxORB ); - ODataClipboard( - const css::uno::Reference< css::beans::XPropertySet >& i_rAliveForm, - const css::uno::Sequence< css::uno::Any >& i_rSelectedRows, - const bool i_bBookmarkSelection, - const css::uno::Reference< css::uno::XComponentContext >& i_rORB - ); - // XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; @@ -74,11 +75,9 @@ namespace dbaui virtual void AddSupportedFormats() override; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; virtual void ObjectReleased() override; - virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; + virtual bool WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DBEXCHANGE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index f79abe8f5df7..7682841a23ac 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -16,26 +16,17 @@ * 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_DBACCESS_SOURCE_UI_INC_DBTREELISTBOX_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DBTREELISTBOX_HXX +#pragma once -#include "ScrollHelper.hxx" - -#include <com/sun/star/frame/XPopupMenuController.hpp> - -#include <vcl/treelistbox.hxx> +#include <vcl/InterimItemWindow.hxx> +#include <vcl/transfer.hxx> #include <vcl/timer.hxx> +#include <vcl/weld.hxx> #include <memory> -#include <set> namespace dbaui { - struct DBTreeEditedEntry - { - OUString aNewText; - }; - class IEntryFilter { public: @@ -47,94 +38,127 @@ namespace dbaui class IControlActionListener; class IContextMenuProvider; - class DBTreeListBox :public SvTreeListBox + + class TreeListBox; + + class TreeListBoxDropTarget : public DropTargetHelper { - OScrollHelper m_aScrollHelper; - Timer m_aTimer; // is needed for table updates - Point m_aMousePos; - std::set<SvTreeListEntry*> m_aSelectedEntries; - SvTreeListEntry* m_pDragedEntry; + private: + TreeListBox& m_rTreeView; + + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; + + public: + TreeListBoxDropTarget(TreeListBox& rTreeView); + }; + + class TreeListBox + { + protected: + std::unique_ptr<weld::TreeView> m_xTreeView; + TreeListBoxDropTarget m_aDropTargetHelper; + + std::unique_ptr<weld::TreeIter> m_xDragedEntry; IControlActionListener* m_pActionListener; IContextMenuProvider* m_pContextMenuProvider; - ImplSVEvent* m_pResetEvent; - css::uno::Reference<css::frame::XPopupMenuController> m_xMenuController; - Link<SvTreeListEntry*,bool> m_aPreExpandHandler; // handler to be called before a node is expanded + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + DECL_LINK(SelectHdl, weld::TreeView&, void); + DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString); + DECL_LINK(CommandHdl, const CommandEvent&, bool); + DECL_LINK(DragBeginHdl, bool&, bool); + + private: + Timer m_aTimer; // is needed for table updates + rtl::Reference<TransferDataContainer> m_xHelper; + Link<LinkParamNone*,void> m_aSelChangeHdl; // handler to be called (asynchronously) when the selection changes in any way Link<LinkParamNone*,void> m_aCopyHandler; // called when someone press CTRL+C Link<LinkParamNone*,void> m_aPasteHandler; // called when someone press CTRL+V Link<LinkParamNone*,void> m_aDeleteHandler; // called when someone press DELETE Key - Link<DBTreeListBox*,void> m_aEnterKeyHdl; - private: - void init(); - DECL_LINK( OnTimeOut, Timer*, void ); - DECL_LINK( OnResetEntryHdl, void*, void ); - DECL_LINK( ScrollUpHdl, LinkParamNone*, void ); - DECL_LINK( ScrollDownHdl, LinkParamNone*, void ); - DECL_LINK( MenuEventListener, VclMenuEvent&, void ); + DECL_LINK(OnTimeOut, Timer*, void); - public: - DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle); - virtual ~DBTreeListBox() override; - virtual void dispose() override; + protected: + void implStopSelectionTimer(); + void implStartSelectionTimer(); - void setControlActionListener( IControlActionListener* _pListener ) { m_pActionListener = _pListener; } - void setContextMenuProvider( IContextMenuProvider* _pContextMenuProvider ) { m_pContextMenuProvider = _pContextMenuProvider; } + virtual bool DoChildKeyInput(const KeyEvent& rKEvt); - void SetPreExpandHandler(const Link<SvTreeListEntry*,bool>& _rHdl) { m_aPreExpandHandler = _rHdl; } - void SetSelChangeHdl( const Link<LinkParamNone*,void>& _rHdl ) { m_aSelChangeHdl = _rHdl; } - void setCopyHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aCopyHandler = _rHdl; } - void setPasteHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aPasteHandler = _rHdl; } - void setDeleteHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aDeleteHandler = _rHdl; } + public: + TreeListBox(std::unique_ptr<weld::TreeView> xTreeView, bool bSQLType); + virtual ~TreeListBox(); - // modified the given entry so that the expand handler is called whenever the entry is expanded - // (normally, the expand handler is called only once) - void EnableExpandHandler(SvTreeListEntry* _pEntry); + std::unique_ptr<weld::TreeIter> GetEntryPosByName(std::u16string_view rName, + const weld::TreeIter* pStart = nullptr, + const IEntryFilter* pFilter = nullptr) const; - SvTreeListEntry* GetEntryPosByName( const OUString& aName, SvTreeListEntry* pStart = nullptr, const IEntryFilter* _pFilter = nullptr ) const; - virtual void RequestingChildren( SvTreeListEntry* pParent ) override; - virtual void SelectHdl() override; - virtual void DeselectHdl() override; - // Window - virtual void KeyInput( const KeyEvent& rKEvt ) override; + std::unique_ptr<weld::TreeIter> GetRootLevelParent(const weld::TreeIter* pEntry) const; - virtual void StateChanged( StateChangedType nStateChange ) override; - virtual void InitEntry(SvTreeListEntry* pEntry, const OUString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp) override; + void setControlActionListener(IControlActionListener* pListener) { m_pActionListener = pListener; } + void setContextMenuProvider(IContextMenuProvider* pContextMenuProvider) { m_pContextMenuProvider = pContextMenuProvider; } - // enable editing for tables/views and queries - virtual bool EditingEntry( SvTreeListEntry* pEntry, Selection& ) override; - virtual bool EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText ) override; + weld::TreeView& GetWidget() { return *m_xTreeView; } + const weld::TreeView& GetWidget() const { return *m_xTreeView; } - virtual bool DoubleClickHdl() override; + TransferDataContainer& GetDataTransfer() { return *m_xHelper; } - virtual VclPtr<PopupMenu> CreateContextMenu() override; + sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt); + sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt); - void SetEnterKeyHdl(const Link<DBTreeListBox*,void>& rNewHdl) {m_aEnterKeyHdl = rNewHdl;} + void SetSelChangeHdl( const Link<LinkParamNone*,void>& _rHdl ) { m_aSelChangeHdl = _rHdl; } + void setCopyHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aCopyHandler = _rHdl; } + void setPasteHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aPasteHandler = _rHdl; } + void setDeleteHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aDeleteHandler = _rHdl; } + }; - void clearCurrentSelection() { m_aSelectedEntries.clear(); } + class InterimDBTreeListBox : public InterimItemWindow + , public TreeListBox + { + private: + std::unique_ptr<weld::Label> m_xStatusBar; + public: + InterimDBTreeListBox(vcl::Window* pParent); + virtual void dispose() override; + weld::Label& GetStatusBar() { return *m_xStatusBar; } + virtual ~InterimDBTreeListBox() override; + void show_container() { m_xContainer->show(); } + protected: + virtual bool DoChildKeyInput(const KeyEvent& rKEvt) override; + }; + class DBTreeViewBase + { protected: - virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; - virtual void RequestHelp( const HelpEvent& rHEvt ) override; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xContainer; + std::unique_ptr<TreeListBox> m_xTreeListBox; + public: + DBTreeViewBase(weld::Container* pContainer); + virtual ~DBTreeViewBase(); - // DragSourceHelper overridables - virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override; - // DropTargetHelper overridables - virtual sal_Int8 AcceptDrop( const AcceptDropEvent& _rEvt ) override; - virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& _rEvt ) override; + weld::TreeView& GetWidget() { return m_xTreeListBox->GetWidget(); } + const weld::TreeView& GetWidget() const { return m_xTreeListBox->GetWidget(); } - virtual void ModelHasRemoved( SvTreeListEntry* pEntry ) override; - virtual void ModelHasEntryInvalidated( SvTreeListEntry* pEntry ) override; + TreeListBox& getListBox() const { return *m_xTreeListBox; } - void implStopSelectionTimer(); - void implStartSelectionTimer(); + void hide() { m_xContainer->hide(); } + void show() { m_xContainer->show(); } + bool get_visible() const { return m_xContainer->get_visible(); } + }; - protected: - using SvTreeListBox::ExecuteDrop; + class DBTreeView final : public DBTreeViewBase + { + public: + DBTreeView(weld::Container* pContainer, bool bSQLType); }; -} -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DBTREELISTBOX_HXX + class DBTableTreeView final : public DBTreeViewBase + { + public: + DBTableTreeView(weld::Container* pContainer); + }; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dbu_dlg.hxx b/dbaccess/source/ui/inc/dbu_dlg.hxx index 02e7034b251c..ed97c4c937b5 100644 --- a/dbaccess/source/ui/inc/dbu_dlg.hxx +++ b/dbaccess/source/ui/inc/dbu_dlg.hxx @@ -16,12 +16,9 @@ * 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_DBACCESS_SOURCE_UI_INC_DBU_DLG_HRC -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DBU_DLG_HRC +#pragma once -#define WIZARD_PAGE_X 56 -#define WIZARD_PAGE_Y 30 - -#endif +#define WIZARD_PAGE_X 56 +#define WIZARD_PAGE_Y 30 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx index 776d19b52ba8..985735ce3e0c 100644 --- a/dbaccess/source/ui/inc/dbwiz.hxx +++ b/dbaccess/source/ui/inc/dbwiz.hxx @@ -17,28 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX +#pragma once #include <dsntypes.hxx> #include "IItemSetHelper.hxx" #include <vcl/wizardmachine.hxx> #include <memory> -namespace com::sun::star { - namespace beans { - class XPropertySet; - } - namespace sdbc { - class XConnection; - } - namespace lang { - class XMultiServiceFactory; - } -} - using vcl::WizardTypes::WizardState; -using vcl::WizardTypes::CommitPageReason; namespace dbaccess { @@ -99,6 +85,4 @@ private: } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZ_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index e204dc1f49ba..abad4671bf42 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -17,29 +17,21 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZSETUP_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZSETUP_HXX +#pragma once #include <dsntypes.hxx> #include "IItemSetHelper.hxx" #include <tools/urlobj.hxx> #include <memory> -#include <vcl/roadmapwizard.hxx> +#include <vcl/roadmapwizardmachine.hxx> namespace com::sun::star { namespace beans { class XPropertySet; } - namespace sdbc { - class XConnection; - } - namespace lang { - class XMultiServiceFactory; - } } using vcl::WizardTypes::WizardState; -using vcl::WizardTypes::CommitPageReason; using vcl::RoadmapWizardTypes::PathId; namespace dbaui @@ -73,6 +65,7 @@ private: OUString m_sRM_JDBCText; OUString m_sRM_MySQLNativePageTitle; OUString m_sRM_OracleText; + OUString m_sRM_PostgresText; OUString m_sRM_MySQLText; OUString m_sRM_ODBCText; OUString m_sRM_DocumentOrSpreadSheetText; @@ -148,7 +141,7 @@ private: */ void declareAuthDepPath( const OUString& _sURL, PathId _nPathId, const vcl::RoadmapWizardTypes::WizardPath& _rPaths); - void RegisterDataSourceByLocation(const OUString& sPath); + void RegisterDataSourceByLocation(std::u16string_view sPath); bool SaveDatabaseDocument(); void activateDatabasePath(); OUString createUniqueFileName(const INetURLObject& rURL); @@ -168,6 +161,4 @@ private: } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DBWIZSETUP_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx b/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx index e86f2575cf8c..c75528940e15 100644 --- a/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx +++ b/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx @@ -17,13 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DEFAULTOBJECTNAMECHECK_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DEFAULTOBJECTNAMECHECK_HXX +#pragma once #include "objectnamecheck.hxx" #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/sdb/tools/XConnectionTools.hpp> #include <memory> @@ -31,14 +31,14 @@ namespace dbaui { // HierarchicalNameCheck - struct HierarchicalNameCheck_Impl; /** class implementing the IObjectNameCheck interface, and checking given object names against a hierarchical name container */ class HierarchicalNameCheck :public IObjectNameCheck { private: - std::unique_ptr< HierarchicalNameCheck_Impl > m_pImpl; + css::uno::Reference< css::container::XHierarchicalNameAccess > mxHierarchicalNames; + OUString msRelativeRoot; public: /** constructs a HierarchicalNameCheck instance @@ -68,7 +68,6 @@ namespace dbaui }; // DynamicTableOrQueryNameCheck - struct DynamicTableOrQueryNameCheck_Impl; /** class implementing the IObjectNameCheck interface, and checking a given name for being valid as either a query or a table name. @@ -85,7 +84,8 @@ namespace dbaui class DynamicTableOrQueryNameCheck :public IObjectNameCheck { private: - std::unique_ptr< DynamicTableOrQueryNameCheck_Impl > m_pImpl; + sal_Int32 mnCommandType; + css::uno::Reference< css::sdb::tools::XObjectNames > mxObjectNames; public: /** constructs a DynamicTableOrQueryNameCheck instance @@ -118,6 +118,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DEFAULTOBJECTNAMECHECK_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index a58cfde7836a..4d141d8a2f02 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -17,37 +17,24 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DIRECTSQL_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DIRECTSQL_HXX +#pragma once #include <sal/config.h> -#include <comphelper/syntaxhighlight.hxx> -#include <sal/log.hxx> -#include <svtools/colorcfg.hxx> -#include <vcl/timer.hxx> #include <vcl/weld.hxx> #include <deque> +#include <string_view> #include <com/sun/star/sdbc/XConnection.hpp> #include <unotools/eventlisteneradapter.hxx> #include <osl/mutex.hxx> -#include <svx/weldeditview.hxx> +#include "sqledit.hxx" struct ImplSVEvent; namespace dbaui { - class SQLEditView : public WeldEditView - { - private: - void DoBracketHilight(sal_uInt16 nKey); - public: - SQLEditView(); - virtual bool KeyInput(const KeyEvent& rKEvt) override; - }; - // DirectSQLDialog class DirectSQLDialog final : public weld::GenericDialogController @@ -58,22 +45,18 @@ namespace dbaui std::unique_ptr<weld::Button> m_xExecute; std::unique_ptr<weld::ComboBox> m_xSQLHistory; std::unique_ptr<weld::TextView> m_xStatus; + std::unique_ptr<weld::CheckButton> m_xDirectSQL; std::unique_ptr<weld::CheckButton> m_xShowOutput; std::unique_ptr<weld::TextView> m_xOutput; std::unique_ptr<weld::Button> m_xClose; std::unique_ptr<SQLEditView> m_xSQL; std::unique_ptr<weld::CustomWeld> m_xSQLEd; - Timer m_aUpdateDataTimer; - const SyntaxHighlighter m_aHighlighter; - const svtools::ColorConfig m_aColorConfig; - typedef std::deque< OUString > StringQueue; StringQueue m_aStatementHistory; // previous statements StringQueue m_aNormalizedHistory; // previous statements, normalized to be used in the list box sal_Int32 m_nStatusCount; - bool m_bInUpdate; css::uno::Reference< css::sdbc::XConnection > m_xConnection; @@ -93,10 +76,6 @@ namespace dbaui void executeCurrent(); void switchToHistory(sal_Int32 _nHistoryPos); - Color GetColorValue(TokenType aToken); - - void UpdateData(); - // OEventListenerAdapter virtual void _disposing( const css::lang::EventObject& _rSource ) override; @@ -105,10 +84,9 @@ namespace dbaui DECL_LINK( OnCloseClick, weld::Button&, void ); DECL_LINK( OnListEntrySelected, weld::ComboBox&, void ); DECL_LINK( OnStatementModified, LinkParamNone*, void ); - DECL_LINK( ImplUpdateDataHdl, Timer*, void ); /// adds a statement to the statement history - void implAddToStatementHistory(const OUString& _rStatement); + void implAddToStatementHistory(const OUString& _rStatement, const bool bFromMemory = false); /// ensures that our history has at most m_nHistoryLimit entries void implEnsureHistoryLimit(); @@ -117,10 +95,10 @@ namespace dbaui void implExecuteStatement(const OUString& _rStatement); /// adds a status text to the status list - void addStatusText(const OUString& _rMessage); + void addStatusText(std::u16string_view _rMessage); /// adds a status text to the output list - void addOutputText(const OUString& _rMessage); + void addOutputText(std::u16string_view _rMessage); /// displays resultset void display(const css::uno::Reference< css::sdbc::XResultSet >& xRS); @@ -130,19 +108,6 @@ namespace dbaui #endif }; -#ifdef DBG_UTIL -#define CHECK_INVARIANTS(methodname) \ - { \ - const char* pError = impl_CheckInvariants(); \ - if (pError) \ - SAL_WARN("dbaccess.ui", methodname ": " << pError); \ - } -#else -#define CHECK_INVARIANTS(methodname) -#endif - } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DIRECTSQL_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index 6be420776208..83fe0466e4f8 100644 --- a/dbaccess/source/ui/inc/dlgattr.hxx +++ b/dbaccess/source/ui/inc/dlgattr.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_DLGATTR_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DLGATTR_HXX +#pragma once #include <sfx2/tabdlg.hxx> @@ -32,13 +31,11 @@ namespace dbaui std::unique_ptr<SvxNumberInfoItem> pNumberInfoItem; public: - SbaSbAttrDlg(weld::Window * pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat); + SbaSbAttrDlg(weld::Widget* pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat); virtual ~SbaSbAttrDlg() override; - virtual void PageCreated(const OString& rPageId, SfxTabPage& rTabPage) override; + virtual void PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) override; }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DLGATTR_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx index 598cbfb7cc7f..f3b33a278500 100644 --- a/dbaccess/source/ui/inc/dlgsave.hxx +++ b/dbaccess/source/ui/inc/dlgsave.hxx @@ -17,9 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DLGSAVE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DLGSAVE_HXX +#pragma once +#include "SqlNameEdit.hxx" +#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <o3tl/typed_flags_set.hxx> #include <vcl/weld.hxx> @@ -43,13 +44,30 @@ namespace o3tl { namespace dbaui { - class OSaveAsDlgImpl; class IObjectNameCheck; class OSaveAsDlg : public weld::GenericDialogController { private: - std::unique_ptr<OSaveAsDlgImpl> m_pImpl; css::uno::Reference< css::uno::XComponentContext > m_xContext; + OUString m_aName; + const IObjectNameCheck& m_rObjectNameCheck; + css::uno::Reference< css::sdbc::XDatabaseMetaData> m_xMetaData; + sal_Int32 m_nType; + SADFlags m_nFlags; + + OSQLNameChecker m_aChecker; + + std::unique_ptr<weld::Label> m_xDescription; + std::unique_ptr<weld::Label> m_xCatalogLbl; + std::unique_ptr<weld::ComboBox> m_xCatalog; + std::unique_ptr<weld::Label> m_xSchemaLbl; + std::unique_ptr<weld::ComboBox> m_xSchema; + std::unique_ptr<weld::Label> m_xLabel; + std::unique_ptr<weld::Entry> m_xTitle; + std::unique_ptr<weld::Button> m_xPB_OK; + + DECL_LINK(TextFilterHdl, OUString&, bool); + public: OSaveAsDlg( weld::Window * pParent, sal_Int32 _rType, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, @@ -78,7 +96,5 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DLGSAVE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dlgsize.hxx b/dbaccess/source/ui/inc/dlgsize.hxx index 0d27ba5439ee..5a673d7122b3 100644 --- a/dbaccess/source/ui/inc/dlgsize.hxx +++ b/dbaccess/source/ui/inc/dlgsize.hxx @@ -16,8 +16,7 @@ * 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_DBACCESS_SOURCE_UI_INC_DLGSIZE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DLGSIZE_HXX +#pragma once #include <vcl/weld.hxx> @@ -30,7 +29,7 @@ namespace dbaui sal_Int32 m_nPrevValue; void SetValue( sal_Int32 nVal ); - DECL_LINK(CbClickHdl, weld::ToggleButton&, void); + DECL_LINK(CbClickHdl, weld::Toggleable&, void); std::unique_ptr<weld::MetricSpinButton> m_xMF_VALUE; std::unique_ptr<weld::CheckButton> m_xCB_STANDARD; @@ -42,6 +41,4 @@ namespace dbaui }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DLGSIZE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx index 9d05d0adf728..9d2d3544325c 100644 --- a/dbaccess/source/ui/inc/dsitems.hxx +++ b/dbaccess/source/ui/inc/dsitems.hxx @@ -17,82 +17,86 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DSITEMS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DSITEMS_HXX +#pragma once #include <sal/types.h> +#include <svl/typedwhich.hxx> + +class OptionalBoolItem; +class SfxBoolItem; +class SfxInt32Item; +class SfxStringItem; typedef sal_Int32 ItemID; // item ids for the data source administration dialog -#define DSID_NAME 1 // name of a data source, SfxStringItem -#define DSID_ORIGINALNAME 2 // original name, internal, SfxStringItem -#define DSID_CONNECTURL 3 // connection URL, SfxStringItem +#define DSID_NAME TypedWhichId<SfxStringItem>(1) // name of a data source, SfxStringItem +#define DSID_ORIGINALNAME TypedWhichId<SfxStringItem>(2) // original name, internal, SfxStringItem +#define DSID_CONNECTURL TypedWhichId<SfxStringItem>(3) // connection URL, SfxStringItem #define DSID_TABLEFILTER 4 // table filter, OStringListItem #define DSID_TYPECOLLECTION 5 // collection of data source types, ODsnTypeCollection -#define DSID_INVALID_SELECTION 6 // is the selection (thus the set data) invalid?, SfxBoolItem -#define DSID_READONLY 7 // is the selection (thus the set data) readonly?, SfxBoolItem -#define DSID_USER 8 // the user name used for logon, SfxStringItem -#define DSID_PASSWORD 9 // the password used for logon, SfxStringItem -#define DSID_ADDITIONALOPTIONS 10 // additional options used for connecting, SfxStringItem -#define DSID_CHARSET 11 // character set to use, SfxStringItem by now -#define DSID_PASSWORDREQUIRED 12 // is the password required to connect?, SfxBoolItem -#define DSID_SHOWDELETEDROWS 13 // show deleted rows?, SfxBoolItem -#define DSID_ALLOWLONGTABLENAMES 14 // allow tables names longer than 8.3?, SfxBoolItem -#define DSID_JDBCDRIVERCLASS 15 // JDBC driver class, SfxStringItem -#define DSID_FIELDDELIMITER 16 // field delimiter, SfxUInt16Item -#define DSID_TEXTDELIMITER 17 // text delimiter, SfxUInt16Item -#define DSID_DECIMALDELIMITER 18 // decimal delimiter, SfxUInt16Item -#define DSID_THOUSANDSDELIMITER 19 // thousands delimiter, SfxUInt16Item -#define DSID_TEXTFILEEXTENSION 20 // extension for text files, SfxStringItem -#define DSID_TEXTFILEHEADER 21 // the text file contains a header?, SfxBoolItem -#define DSID_PARAMETERNAMESUBST 22 -#define DSID_CONN_PORTNUMBER 23 -#define DSID_SUPPRESSVERSIONCL 24 // meta data: sal_True if the data source described by the set is to-be-deleted -#define DSID_CONN_SHUTSERVICE 25 -#define DSID_CONN_DATAINC 26 -#define DSID_CONN_CACHESIZE 27 -#define DSID_CONN_CTRLUSER 28 -#define DSID_CONN_CTRLPWD 29 -#define DSID_USECATALOG 30 // should the driver use the catalog name when the database is filebased -#define DSID_CONN_HOSTNAME 31 -#define DSID_CONN_LDAP_BASEDN 32 -#define DSID_CONN_LDAP_PORTNUMBER 33 -#define DSID_CONN_LDAP_ROWCOUNT 34 -#define DSID_SQL92CHECK 35 -#define DSID_AUTOINCREMENTVALUE 36 -#define DSID_AUTORETRIEVEVALUE 37 -#define DSID_AUTORETRIEVEENABLED 38 -#define DSID_APPEND_TABLE_ALIAS 39 -#define DSID_MYSQL_PORTNUMBER 40 -#define DSID_IGNOREDRIVER_PRIV 41 -#define DSID_BOOLEANCOMPARISON 42 -#define DSID_ORACLE_PORTNUMBER 43 -#define DSID_ENABLEOUTERJOIN 44 -#define DSID_CATALOG 45 -#define DSID_SCHEMA 46 -#define DSID_INDEXAPPENDIX 47 -#define DSID_CONN_LDAP_USESSL 48 -#define DSID_DOCUMENT_URL 49 -#define DSID_DOSLINEENDS 50 -#define DSID_DATABASENAME 51 -#define DSID_AS_BEFORE_CORRNAME 52 -#define DSID_CHECK_REQUIRED_FIELDS 53 -#define DSID_IGNORECURRENCY 54 -#define DSID_CONN_SOCKET 55 -#define DSID_ESCAPE_DATETIME 56 -#define DSID_NAMED_PIPE 57 -#define DSID_PRIMARY_KEY_SUPPORT 58 -#define DSID_MAX_ROW_SCAN 59 -#define DSID_RESPECTRESULTSETTYPE 60 +#define DSID_INVALID_SELECTION TypedWhichId<SfxBoolItem>(6) // is the selection (thus the set data) invalid?, SfxBoolItem +#define DSID_READONLY TypedWhichId<SfxBoolItem>(7) // is the selection (thus the set data) readonly?, SfxBoolItem +#define DSID_USER TypedWhichId<SfxStringItem>(8) // the user name used for logon, SfxStringItem +#define DSID_PASSWORD TypedWhichId<SfxStringItem>(9) // the password used for logon, SfxStringItem +#define DSID_ADDITIONALOPTIONS TypedWhichId<SfxStringItem>(10) // additional options used for connecting, SfxStringItem +#define DSID_CHARSET TypedWhichId<SfxStringItem>(11) // character set to use, SfxStringItem by now +#define DSID_PASSWORDREQUIRED TypedWhichId<SfxBoolItem>(12) // is the password required to connect?, SfxBoolItem +#define DSID_SHOWDELETEDROWS TypedWhichId<SfxBoolItem>(13) // show deleted rows?, SfxBoolItem +#define DSID_ALLOWLONGTABLENAMES TypedWhichId<SfxBoolItem>(14) // allow tables names longer than 8.3?, SfxBoolItem +#define DSID_JDBCDRIVERCLASS TypedWhichId<SfxStringItem>(15) // JDBC driver class, SfxStringItem +#define DSID_FIELDDELIMITER TypedWhichId<SfxStringItem>(16) // field delimiter, SfxUInt16Item +#define DSID_TEXTDELIMITER TypedWhichId<SfxStringItem>(17) // text delimiter, SfxUInt16Item +#define DSID_DECIMALDELIMITER TypedWhichId<SfxStringItem>(18) // decimal delimiter, SfxUInt16Item +#define DSID_THOUSANDSDELIMITER TypedWhichId<SfxStringItem>(19) // thousands delimiter, SfxUInt16Item +#define DSID_TEXTFILEEXTENSION TypedWhichId<SfxStringItem>(20) // extension for text files, SfxStringItem +#define DSID_TEXTFILEHEADER TypedWhichId<SfxBoolItem>(21) // the text file contains a header?, SfxBoolItem +#define DSID_PARAMETERNAMESUBST TypedWhichId<SfxBoolItem>(22) +#define DSID_CONN_PORTNUMBER TypedWhichId<SfxInt32Item>(23) +#define DSID_SUPPRESSVERSIONCL TypedWhichId<SfxBoolItem>(24) // meta data: sal_True if the data source described by the set is to-be-deleted +#define DSID_CONN_SHUTSERVICE TypedWhichId<SfxBoolItem>(25) +#define DSID_CONN_DATAINC TypedWhichId<SfxInt32Item>(26) +#define DSID_CONN_CACHESIZE TypedWhichId<SfxInt32Item>(27) +#define DSID_CONN_CTRLUSER TypedWhichId<SfxStringItem>(28) +#define DSID_CONN_CTRLPWD TypedWhichId<SfxStringItem>(29) +#define DSID_USECATALOG TypedWhichId<SfxBoolItem>(30) // should the driver use the catalog name when the database is filebased +#define DSID_CONN_HOSTNAME TypedWhichId<SfxStringItem>(31) +#define DSID_CONN_LDAP_BASEDN TypedWhichId<SfxStringItem>(32) +#define DSID_CONN_LDAP_PORTNUMBER TypedWhichId<SfxInt32Item>(33) +#define DSID_CONN_LDAP_ROWCOUNT TypedWhichId<SfxInt32Item>(34) +#define DSID_SQL92CHECK TypedWhichId<SfxBoolItem>(35) +#define DSID_AUTOINCREMENTVALUE TypedWhichId<SfxStringItem>(36) +#define DSID_AUTORETRIEVEVALUE TypedWhichId<SfxStringItem>(37) +#define DSID_AUTORETRIEVEENABLED TypedWhichId<SfxBoolItem>(38) +#define DSID_APPEND_TABLE_ALIAS TypedWhichId<SfxBoolItem>(39) +#define DSID_MYSQL_PORTNUMBER TypedWhichId<SfxInt32Item>(40) +#define DSID_IGNOREDRIVER_PRIV TypedWhichId<SfxBoolItem>(41) +#define DSID_BOOLEANCOMPARISON TypedWhichId<SfxInt32Item>(42) +#define DSID_ORACLE_PORTNUMBER TypedWhichId<SfxInt32Item>(43) +#define DSID_ENABLEOUTERJOIN TypedWhichId<SfxBoolItem>(44) +#define DSID_CATALOG TypedWhichId<SfxBoolItem>(45) +#define DSID_SCHEMA TypedWhichId<SfxBoolItem>(46) +#define DSID_INDEXAPPENDIX TypedWhichId<SfxBoolItem>(47) +#define DSID_CONN_LDAP_USESSL TypedWhichId<SfxBoolItem>(48) +#define DSID_DOCUMENT_URL TypedWhichId<SfxStringItem>(49) +#define DSID_DOSLINEENDS TypedWhichId<SfxBoolItem>(50) +#define DSID_DATABASENAME TypedWhichId<SfxStringItem>(51) +#define DSID_AS_BEFORE_CORRNAME TypedWhichId<SfxBoolItem>(52) +#define DSID_CHECK_REQUIRED_FIELDS TypedWhichId<SfxBoolItem>(53) +#define DSID_IGNORECURRENCY TypedWhichId<SfxBoolItem>(54) +#define DSID_CONN_SOCKET TypedWhichId<SfxStringItem>(55) +#define DSID_ESCAPE_DATETIME TypedWhichId<SfxBoolItem>(56) +#define DSID_NAMED_PIPE TypedWhichId<SfxStringItem>(57) +#define DSID_PRIMARY_KEY_SUPPORT TypedWhichId<OptionalBoolItem>(58) +#define DSID_MAX_ROW_SCAN TypedWhichId<SfxInt32Item>(59) +#define DSID_RESPECTRESULTSETTYPE TypedWhichId<SfxBoolItem>(60) +#define DSID_POSTGRES_PORTNUMBER TypedWhichId<SfxInt32Item>(61) // don't forget to adjust DSID_LAST_ITEM_ID below! // item range. Adjust this if you introduce new items above #define DSID_FIRST_ITEM_ID DSID_NAME -#define DSID_LAST_ITEM_ID DSID_RESPECTRESULTSETTYPE - -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DSITEMS_HXX +#define DSID_LAST_ITEM_ID DSID_POSTGRES_PORTNUMBER /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx index b6b7ab997e74..091426809e86 100644 --- a/dbaccess/source/ui/inc/dsmeta.hxx +++ b/dbaccess/source/ui/inc/dsmeta.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DSMETA_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_DSMETA_HXX +#pragma once #include <sal/config.h> @@ -43,7 +42,6 @@ namespace dbaui // DataSourceMetaData class FeatureSet; - class DataSourceMetaData_Impl; /** encapsulates meta data for a data source On the long run, this class should a) encapsulate *all* meta data which @@ -66,7 +64,7 @@ namespace dbaui static AuthenticationMode getAuthentication( const OUString& _sURL ); private: - std::shared_ptr< DataSourceMetaData_Impl > m_pImpl; + OUString m_sURL; }; // FeatureSet @@ -81,7 +79,7 @@ namespace dbaui FeatureSet() { } void put( const ItemID _id ) { m_aContent.insert( _id ); } - bool has( const ItemID _id ) const { return m_aContent.find( _id ) != m_aContent.end(); } + bool has( const ItemID _id ) const { return m_aContent.contains( _id ); } inline bool supportsAnySpecialSetting() const; inline bool supportsGeneratedValues() const; @@ -123,6 +121,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_DSMETA_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx index 6a480d7238b1..0ecda1ed647e 100644 --- a/dbaccess/source/ui/inc/exsrcbrw.hxx +++ b/dbaccess/source/ui/inc/exsrcbrw.hxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_EXSRCBRW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_EXSRCBRW_HXX +#pragma once #include "brwctrlr.hxx" +#include <comphelper/interfacecontainer3.hxx> #include <comphelper/uno3.hxx> // SbaExternalSourceBrowser @@ -33,9 +33,9 @@ namespace dbaui :public SbaXDataBrowserController ,public css::util::XModifyBroadcaster { - ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; + ::comphelper::OInterfaceContainerHelper3<css::util::XModifyListener> m_aModifyListeners; // for multiplexing the modify events - SbaXFormAdapter* m_pDataSourceImpl; + rtl::Reference<SbaXFormAdapter> m_pDataSourceImpl; bool m_bInQueryDispatch; // our queryDispatch will ask our frame, which first will ask our queryDispatch, so we need to protect against // recursion @@ -93,6 +93,4 @@ namespace dbaui }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_EXSRCBRW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/formadapter.hxx b/dbaccess/source/ui/inc/formadapter.hxx index 3394aa2fe2a1..c6d565896215 100644 --- a/dbaccess/source/ui/inc/formadapter.hxx +++ b/dbaccess/source/ui/inc/formadapter.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_FORMADAPTER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_FORMADAPTER_HXX +#pragma once #include "sbamultiplex.hxx" @@ -54,6 +53,7 @@ #include <com/sun/star/io/XPersistObject.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/util/XCancellable.hpp> +#include <comphelper/interfacecontainer3.hxx> #include <comphelper/uno3.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase12.hxx> @@ -134,8 +134,8 @@ namespace dbaui SbaXVetoableChangeMultiplexer m_aVetoablePropertyChangeListeners; SbaXPropertiesChangeMultiplexer m_aPropertiesChangeListeners; - ::comphelper::OInterfaceContainerHelper2 m_aDisposeListeners; - ::comphelper::OInterfaceContainerHelper2 m_aContainerListeners; + ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_aDisposeListeners; + ::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> m_aContainerListeners; // hierarchy administration css::uno::Reference< css::uno::XInterface > m_xParent; @@ -432,6 +432,5 @@ namespace dbaui void StartListening(); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_FORMADAPTER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/imageprovider.hxx b/dbaccess/source/ui/inc/imageprovider.hxx index 1f267818a592..5249fb0091fe 100644 --- a/dbaccess/source/ui/inc/imageprovider.hxx +++ b/dbaccess/source/ui/inc/imageprovider.hxx @@ -17,20 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_IMAGEPROVIDER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_IMAGEPROVIDER_HXX - -#include <vcl/image.hxx> +#pragma once #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/sdbc/XConnection.hpp> -#include <memory> +namespace com::sun::star::sdb::application { class XTableUIProvider; } namespace dbaui { - // ImageProvider - struct ImageProvider_Data; /** provides images for database objects such as tables, queries, forms, reports ... At the moment, this class cares for small icons only, that is, icons which can be used @@ -39,9 +34,6 @@ namespace dbaui */ class ImageProvider { - private: - std::shared_ptr< ImageProvider_Data > m_pData; - public: /** creates a semi-functional ImageProvider instance @@ -66,17 +58,9 @@ namespace dbaui constants. @param _rName the name of the object - @param _out_rImage - the normal image to use for the object @return - the image to be used for the object. + the name of the image to be used for the object. */ - void getImages( - const OUString& _rName, - const sal_Int32 _nDatabaseObjectType, - Image& _out_rImage - ); - OUString getImageId( const OUString& _rName, const sal_Int32 _nDatabaseObjectType @@ -86,25 +70,9 @@ namespace dbaui css::uno::Reference<css::graphic::XGraphic> getXGraphic(const OUString& _rName, const sal_Int32 _nDatabaseObjectType); - /** returns the default image to be used for a database object - - In opposite to getImages, this method does not check the concrete object - for its image, but returns a default image to be used for all objects of the given - type. - - @param _nDatabaseObjectType - the type of the object. Must be one of the css.sdb.application.DatabaseObject - constants. - @return - the image to be used for the object type. - */ - static Image getDefaultImage( - sal_Int32 _nDatabaseObjectType - ); - /** returns the resource ID for the default image to be used for a database object - In opposite to getImages, this method does not check the concrete object + In opposite to getImageId, this method does not check the concrete object for its image, but returns a default image to be used for all objects of the given type. @@ -116,18 +84,6 @@ namespace dbaui */ static OUString getDefaultImageResourceID(sal_Int32 _nDatabaseObjectType); - /** retrieves the image to be used for folders of database objects - @param _nDatabaseObjectType - the type of the object. Must be one of the css.sdb.application.DatabaseObject - constants. - @param _rName - the name of the object - @return - the image to be used for folders of the given type - */ - static Image getFolderImage( - sal_Int32 _nDatabaseObjectType - ); static OUString getFolderImageId( sal_Int32 _nDatabaseObjectType ); @@ -136,11 +92,16 @@ namespace dbaui @return the image to be used for folders of this type */ - static Image getDatabaseImage(); + static const OUString & getDatabaseImage(); + private: + /// the connection we work with + css::uno::Reference< css::sdbc::XConnection > mxConnection; + /// the views of the connection, if the DB supports views + css::uno::Reference< css::container::XNameAccess > mxViews; + /// interface for providing table's UI + css::uno::Reference< css::sdb::application::XTableUIProvider > mxTableUI; }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_IMAGEPROVIDER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/indexcollection.hxx b/dbaccess/source/ui/inc/indexcollection.hxx index d58a4c180cef..3d227b0b3869 100644 --- a/dbaccess/source/ui/inc/indexcollection.hxx +++ b/dbaccess/source/ui/inc/indexcollection.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXCOLLECTION_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXCOLLECTION_HXX +#pragma once #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -30,7 +29,6 @@ namespace dbaui // OIndexCollection class OIndexCollection { - protected: css::uno::Reference< css::container::XNameAccess > m_xIndexes; @@ -92,6 +90,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXCOLLECTION_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx index 00357f903a76..b3ba37936e79 100644 --- a/dbaccess/source/ui/inc/indexdialog.hxx +++ b/dbaccess/source/ui/inc/indexdialog.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXDIALOG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXDIALOG_HXX +#pragma once #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/sdbc/XConnection.hpp> @@ -75,10 +74,10 @@ namespace dbaui void IndexSelected(); DECL_LINK( OnIndexSelected, weld::TreeView&, void ); - DECL_LINK( OnIndexAction, const OString&, void ); + DECL_LINK( OnIndexAction, const OUString&, void ); DECL_LINK( OnEntryEditing, const weld::TreeIter&, bool ); DECL_LINK( OnEntryEdited, const IterString&, bool ); - DECL_LINK( OnModifiedClick, weld::Button&, void ); + DECL_LINK( OnModifiedClick, weld::Toggleable&, void ); DECL_LINK( OnModified, IndexFieldsControl&, void ); DECL_LINK( OnCloseDialog, weld::Button&, void ); @@ -101,6 +100,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXDIALOG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/indexes.hxx b/dbaccess/source/ui/inc/indexes.hxx index 0a54aff7ec17..068a5dec5026 100644 --- a/dbaccess/source/ui/inc/indexes.hxx +++ b/dbaccess/source/ui/inc/indexes.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXES_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXES_HXX +#pragma once #include <sal/config.h> @@ -32,9 +31,7 @@ namespace dbaui struct OIndexField { OUString sFieldName; - bool bSortAscending; - - OIndexField() : bSortAscending(true) { } + bool bSortAscending = true; }; typedef std::vector<OIndexField> IndexFields; @@ -79,6 +76,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXES_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx index b09723d570f5..90ae7172e3df 100644 --- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx +++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXFIELDSCONTROL_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXFIELDSCONTROL_HXX +#pragma once #include <svtools/editbrowsebox.hxx> #include <com/sun/star/awt/XWindow.hpp> @@ -55,7 +54,7 @@ namespace dbaui void Init(const css::uno::Sequence< OUString >& _rAvailableFields, bool _bAddIndexAppendix); - void initializeFrom(const IndexFields& _rFields); + void initializeFrom(IndexFields&& _rFields); void commitTo(IndexFields& _rFields); bool SaveModified() override; @@ -65,20 +64,20 @@ namespace dbaui void SaveValue() { m_aSavedValue = m_aFields; } void SetModifyHdl(const Link<IndexFieldsControl&,void>& _rHdl) { m_aModifyHdl = _rHdl; } - virtual OUString GetCellText(long _nRow,sal_uInt16 nColId) const override; + virtual OUString GetCellText(sal_Int32 _nRow,sal_uInt16 nColId) const override; private: // EditBrowseBox overridables virtual void PaintCell( OutputDevice& _rDev, const tools::Rectangle& _rRect, sal_uInt16 _nColumnId ) const override; - virtual bool SeekRow(long nRow) override; - virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) override; + virtual bool SeekRow(sal_Int32 nRow) override; + virtual sal_uInt32 GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId) override; virtual bool IsTabAllowed(bool bForward) const override; - ::svt::CellController* GetController(long _nRow, sal_uInt16 _nColumnId) override; - void InitController(::svt::CellControllerRef&, long _nRow, sal_uInt16 _nColumnId) override; + ::svt::CellController* GetController(sal_Int32 _nRow, sal_uInt16 _nColumnId) override; + void InitController(::svt::CellControllerRef&, sal_Int32 _nRow, sal_uInt16 _nColumnId) override; OUString GetRowCellText(const IndexFields::const_iterator& _rRow,sal_uInt16 nColId) const; - bool implGetFieldDesc(long _nRow, IndexFields::const_iterator& _rPos); + bool implGetFieldDesc(sal_Int32 _nRow, IndexFields::const_iterator& _rPos); bool isNewField() const { return GetCurRow() >= static_cast<sal_Int32>(m_aFields.size()); } @@ -89,6 +88,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXFIELDSCONTROL_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/linkeddocuments.hxx b/dbaccess/source/ui/inc/linkeddocuments.hxx index 0a18bdcd2fa8..c20f3a87ae51 100644 --- a/dbaccess/source/ui/inc/linkeddocuments.hxx +++ b/dbaccess/source/ui/inc/linkeddocuments.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_LINKEDDOCUMENTS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_LINKEDDOCUMENTS_HXX +#pragma once #include "AppElementType.hxx" @@ -54,7 +53,7 @@ namespace dbaui const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const css::uno::Reference< css::container::XNameAccess >& _rxContainer, const css::uno::Reference< css::sdbc::XConnection>& _xConnection, - const OUString& _sDataSourceName + OUString _sDataSourceName ); ~OLinkedDocumentsAccess(); @@ -106,6 +105,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_LINKEDDOCUMENTS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx deleted file mode 100644 index 47b231272804..000000000000 --- a/dbaccess/source/ui/inc/listviewitems.hxx +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- 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_DBACCESS_SOURCE_UI_INC_LISTVIEWITEMS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_LISTVIEWITEMS_HXX - -#include <vcl/svlbitm.hxx> - -namespace dbaui -{ - - // OBoldListboxString - class OBoldListboxString : public SvLBoxString - { - bool m_bEmphasized; - - public: - OBoldListboxString(const OUString& _rStr) - :SvLBoxString(_rStr) - ,m_bEmphasized(false) - { - } - - virtual SvLBoxItemType GetType() const override; - - virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override; - virtual void InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, SvViewDataItem* _pViewData = nullptr) override; - - bool isEmphasized() const { return m_bEmphasized; } - void emphasize(bool _bEmphasize) { m_bEmphasized = _bEmphasize; } - }; - -} // namespace dbaui - -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_LISTVIEWITEMS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/marktree.hxx b/dbaccess/source/ui/inc/marktree.hxx deleted file mode 100644 index 5eeece39d7ae..000000000000 --- a/dbaccess/source/ui/inc/marktree.hxx +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- 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_DBACCESS_SOURCE_UI_INC_MARKTREE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_MARKTREE_HXX - -#include "dbtreelistbox.hxx" - -#include <vcl/svlbitm.hxx> - -namespace dbaui -{ - -// OMarkableTreeListBox -/** a tree list box where all entries can be marked (with a checkbox) and - unmarked. In addition, inner nodes know a third state which applies - if some, but not all of their descendants are marked. -*/ -class OMarkableTreeListBox : public DBTreeListBox -{ - std::unique_ptr<SvLBoxButtonData> m_pCheckButton; - -public: - OMarkableTreeListBox( vcl::Window* pParent, WinBits nWinStyle ); - virtual ~OMarkableTreeListBox() override; - virtual void dispose() override; - - virtual void KeyInput( const KeyEvent& rKEvt ) override; - virtual void CheckButtonHdl() override; - void CheckButtons(); // make the button states consistent (bottom-up) - -protected: - virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& _rRect) override; - virtual void checkedButton_noBroadcast(SvTreeListEntry* _pEntry); - - SvButtonState implDetermineState(SvTreeListEntry* _pEntry); - // determines the check state of the given entry, by analyzing the states of all descendants - -private: - void InitButtonData(); -}; - -} // namespace dbaui - -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_MARKTREE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/objectnamecheck.hxx b/dbaccess/source/ui/inc/objectnamecheck.hxx index 602b822c476a..52f639e534a1 100644 --- a/dbaccess/source/ui/inc/objectnamecheck.hxx +++ b/dbaccess/source/ui/inc/objectnamecheck.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_OBJECTNAMECHECK_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_OBJECTNAMECHECK_HXX +#pragma once #include <rtl/ustring.hxx> @@ -55,6 +54,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_OBJECTNAMECHECK_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/opendoccontrols.hxx b/dbaccess/source/ui/inc/opendoccontrols.hxx index 9ab29b624dee..d2cca5281111 100644 --- a/dbaccess/source/ui/inc/opendoccontrols.hxx +++ b/dbaccess/source/ui/inc/opendoccontrols.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX +#pragma once #include <vcl/weld.hxx> #include <rtl/ustring.hxx> @@ -35,18 +34,12 @@ namespace dbaui class OpenDocumentButton { private: - OUString m_sModule; - std::unique_ptr<weld::Button> m_xControl; public: - OpenDocumentButton(std::unique_ptr<weld::Button> xControl, const char* _pAsciiModuleName); + OpenDocumentButton(std::unique_ptr<weld::Button> xControl, const OUString& _rAsciiModuleName); void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } - bool get_sensitive() const { return m_xControl->get_sensitive(); } void connect_clicked(const Link<weld::Button&, void>& rLink) { m_xControl->connect_clicked(rLink); } - - private: - void impl_init( const char* _pAsciiModuleName ); }; // OpenDocumentListBox @@ -65,20 +58,16 @@ namespace dbaui OUString GetSelectedDocumentURL() const; void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } - bool get_sensitive() const { return m_xControl->get_sensitive(); } - void grab_focus() { m_xControl->grab_focus(); } int get_count() const { return m_xControl->get_count(); } void set_active(int nPos) { m_xControl->set_active(nPos); } void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); } private: - StringPair impl_getDocumentAtIndex( sal_uInt16 _nListIndex ) const; + const StringPair & impl_getDocumentAtIndex( sal_uInt16 _nListIndex ) const; void impl_init( const char* _pAsciiModuleName ); }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index 201aabe29d25..5c7044ebbd60 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_PARAMDIALOG_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_PARAMDIALOG_HXX +#pragma once #include <vcl/weld.hxx> #include <vcl/timer.hxx> @@ -31,11 +30,6 @@ #include <svx/ParseContext.hxx> #include <o3tl/typed_flags_set.hxx> -namespace connectivity -{ - class OSQLParseNode; -} - enum class VisitFlags { NONE = 0x00, Visited = 0x01, @@ -101,6 +95,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_PARAMDIALOG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/propertystorage.hxx b/dbaccess/source/ui/inc/propertystorage.hxx index 51732053adf9..35d9f24d6e34 100644 --- a/dbaccess/source/ui/inc/propertystorage.hxx +++ b/dbaccess/source/ui/inc/propertystorage.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_PROPERTYSTORAGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_PROPERTYSTORAGE_HXX +#pragma once #include <com/sun/star/uno/Any.hxx> #include <map> @@ -52,6 +51,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_PROPERTYSTORAGE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/querycontainerwindow.hxx b/dbaccess/source/ui/inc/querycontainerwindow.hxx index 607a38c82920..12583ec0c065 100644 --- a/dbaccess/source/ui/inc/querycontainerwindow.hxx +++ b/dbaccess/source/ui/inc/querycontainerwindow.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTAINERWINDOW_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTAINERWINDOW_HXX +#pragma once #include <vcl/window.hxx> #include <vcl/split.hxx> @@ -76,7 +75,7 @@ namespace dbaui void clear() { m_pViewSwitch->clear(); } bool isSlotEnabled( sal_Int32 _nSlotId ) { return m_pViewSwitch->isSlotEnabled( _nSlotId ); } void setSlotEnabled( sal_Int32 _nSlotId, bool _bEnable ) { m_pViewSwitch->setSlotEnabled( _nSlotId, _bEnable ); } - void setNoneVisbleRow(sal_Int32 _nRows) { m_pViewSwitch->setNoneVisbleRow( _nRows); } + void setNoneVisibleRow(sal_Int32 _nRows) { m_pViewSwitch->setNoneVisibleRow( _nRows); } bool checkStatement() { return m_pViewSwitch->checkStatement( ); } OUString getStatement() { return m_pViewSwitch->getStatement( ); } @@ -102,6 +101,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTAINERWINDOW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx index dae1bffe9013..d4347e47d58d 100644 --- a/dbaccess/source/ui/inc/querycontroller.hxx +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -17,15 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTROLLER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTROLLER_HXX +#pragma once #include "JoinController.hxx" #include "querycontainerwindow.hxx" #include <svx/ParseContext.hxx> #include "TableFieldDescription.hxx" -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/XSQLQueryComposer.hpp> #include <com/sun/star/sdbcx/XAlterView.hpp> @@ -43,8 +41,6 @@ namespace comphelper namespace dbaui { - class OQueryContainerWindow; - typedef ::comphelper::OPropertyContainer OQueryController_PBase; typedef ::comphelper::OPropertyArrayUsageHelper< OQueryController > OQueryController_PABase; class OQueryController :public OJoinController @@ -189,7 +185,7 @@ namespace dbaui // ask the user if the design should be saved when it is modified virtual short saveModified() override; virtual void reset() override; - virtual void impl_initialize() override; + virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override; void impl_reset( const bool i_bIgnoreQuerySettings = false ); /// tells the user that we needed to switch to SQL view automatically @@ -215,6 +211,5 @@ namespace dbaui using OQueryController_PBase::getFastPropertyValue; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTROLLER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx index b7917fdeb526..396778f22997 100644 --- a/dbaccess/source/ui/inc/queryfilter.hxx +++ b/dbaccess/source/ui/inc/queryfilter.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYFILTER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYFILTER_HXX +#pragma once #include <vcl/weld.hxx> #include <connectivity/sqliterator.hxx> @@ -26,32 +25,26 @@ #include <connectivity/predicateinput.hxx> #include <svx/ParseContext.hxx> -namespace com -{ - namespace sun +namespace com::sun::star { + namespace sdb + { + class XSingleSelectQueryComposer; + } + namespace sdbc + { + class XConnection; + class XDatabaseMetaData; + } + namespace container { - namespace star - { - namespace sdb - { - class XSingleSelectQueryComposer; - } - namespace sdbc - { - class XConnection; - class XDatabaseMetaData; - } - namespace container - { - class XNameAccess; - } - namespace beans - { - struct PropertyValue; - } - } + class XNameAccess; + } + namespace beans + { + struct PropertyValue; } } + // DlgFilterCrit namespace dbaui { @@ -82,13 +75,13 @@ namespace dbaui std::unique_ptr<weld::ComboBox> m_xLB_WHERECOMP3; std::unique_ptr<weld::Entry> m_xET_WHEREVALUE3; - static void SelectField(weld::ComboBox& rBox, const OUString& rField); + static void SelectField(weld::ComboBox& rBox, std::u16string_view rField); DECL_LINK(ListSelectHdl, weld::ComboBox&, void); DECL_LINK(ListSelectCompHdl, weld::ComboBox&, void); void SetLine( int nIdx, const css::beans::PropertyValue& _rItem, bool _bOr ); void EnableLines(); - sal_Int32 GetOSQLPredicateType( const OUString& _rSelectedPredicate ) const; + sal_Int32 GetOSQLPredicateType( std::u16string_view _rSelectedPredicate ) const; static sal_Int32 GetSelectionPos(sal_Int32 eType, const weld::ComboBox& rListBox); bool getCondition(const weld::ComboBox& _rField, const weld::ComboBox& _rComp, const weld::Entry& _rValue, css::beans::PropertyValue& _rFilter) const; void fillLines(int &i, const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& _aValues); @@ -113,6 +106,4 @@ namespace dbaui } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYFILTER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/queryorder.hxx b/dbaccess/source/ui/inc/queryorder.hxx index 2207be16a051..523d84f31fe7 100644 --- a/dbaccess/source/ui/inc/queryorder.hxx +++ b/dbaccess/source/ui/inc/queryorder.hxx @@ -16,32 +16,24 @@ * 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_DBACCESS_SOURCE_UI_INC_QUERYORDER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYORDER_HXX +#pragma once #include <vcl/weld.hxx> #define DOG_ROWS 3 -namespace com -{ - namespace sun +namespace com::sun::star{ + namespace sdb + { + class XSingleSelectQueryComposer; + } + namespace sdbc + { + class XConnection; + } + namespace container { - namespace star - { - namespace sdb - { - class XSingleSelectQueryComposer; - } - namespace sdbc - { - class XConnection; - } - namespace container - { - class XNameAccess; - } - } + class XNameAccess; } } @@ -85,6 +77,5 @@ namespace dbaui void impl_initializeOrderList_nothrow(); }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYORDER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/sbagrid.hrc b/dbaccess/source/ui/inc/sbagrid.hrc index c84dbccead66..921faa6a9bd2 100644 --- a/dbaccess/source/ui/inc/sbagrid.hrc +++ b/dbaccess/source/ui/inc/sbagrid.hrc @@ -26,8 +26,8 @@ // Columns // Formatting -#define SBA_DEF_RANGEFORMAT (SBA_WHICHID_START+143) // RangeItem -#define SBA_DEF_FMTVALUE (SBA_WHICHID_START+144) // SfxULONG, Format +#define SBA_DEF_RANGEFORMAT TypedWhichId<SfxRangeItem>(SBA_WHICHID_START+143) // RangeItem +#define SBA_DEF_FMTVALUE TypedWhichId<SfxUInt32Item>(SBA_WHICHID_START+144) // SfxULONG, Format // Justification #define SBA_ATTR_ALIGN_HOR_JUSTIFY (SBA_WHICHID_START + 145) // SvxHorJustifyItem diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index 4e6e30e3cfef..682c570c7093 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_SBAGRID_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_SBAGRID_HXX +#pragma once #include <svx/fmgridcl.hxx> @@ -26,6 +25,7 @@ #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/util/URL.hpp> +#include <comphelper/multiinterfacecontainer4.hxx> #include <comphelper/servicehelper.hxx> #include <comphelper/uno3.hxx> #include "sbamultiplex.hxx" @@ -36,12 +36,6 @@ class SvNumberFormatter; -namespace com::sun::star { - namespace lang { - class XMultiServiceFactory; - } -} - namespace dbaui { struct SbaURLCompare @@ -49,7 +43,6 @@ namespace dbaui bool operator() (const css::util::URL& x, const css::util::URL& y) const { return x.Complete == y.Complete; } }; - class SbaXStatusMultiplexer; class SbaXGridControl :public FmXGridControl ,public css::frame::XDispatch @@ -62,8 +55,8 @@ namespace dbaui virtual ~SbaXGridControl() override; // UNO - DECLARE_UNO3_DEFAULTS(SbaXGridControl, FmXGridControl) - virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + DECLARE_UNO3_AGG_DEFAULTS(SbaXGridControl, FmXGridControl) + virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type& _rType) override; // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; @@ -84,7 +77,7 @@ namespace dbaui virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > & rToolkit, const css::uno::Reference< css::awt::XWindowPeer > & rParentPeer) override; protected: - virtual FmXGridPeer* imp_CreatePeer(vcl::Window* pParent) override; + virtual rtl::Reference<FmXGridPeer> imp_CreatePeer(vcl::Window* pParent) override; }; // SbaXGridPeer @@ -93,22 +86,20 @@ namespace dbaui :public FmXGridPeer ,public css::frame::XDispatch { - cppu::OMultiTypeInterfaceContainerHelperVar< - css::util::URL, void, SbaURLCompare> m_aStatusListeners; + comphelper::OMultiTypeInterfaceContainerHelperVar4< css::util::URL, css::frame::XStatusListener, + SbaURLCompare> m_aStatusListeners; public: SbaXGridPeer(const css::uno::Reference< css::uno::XComponentContext >&); virtual ~SbaXGridPeer() override; // UNO - virtual void SAL_CALL acquire() throw() override { FmXGridPeer::acquire(); } - virtual void SAL_CALL release() throw() override { FmXGridPeer::release(); } + virtual void SAL_CALL acquire() noexcept override { FmXGridPeer::acquire(); } + virtual void SAL_CALL release() noexcept override { FmXGridPeer::release(); } virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - UNO3_GETIMPLEMENTATION_DECL(SbaXGridPeer) - // css::frame::XDispatch virtual void SAL_CALL dispatch(const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs) override; virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) override; @@ -162,8 +153,10 @@ namespace dbaui protected: // FmGridHeader overridables - virtual void PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMenu) override; - virtual void PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMenu& rMenu, sal_uInt16 nExecutionResult) override; + virtual void PreExecuteColumnContextMenu(sal_uInt16 nColId, weld::Menu& rMenu, + weld::Menu& rInsertMenu, weld::Menu& rChangeMenu, + weld::Menu& rShowMenu) override; + virtual void PostExecuteColumnContextMenu(sal_uInt16 nColId, const weld::Menu& rMenu, const OUString& rExecutionResult) override; private: // DragSourceHelper overridables @@ -214,7 +207,7 @@ namespace dbaui void SetMasterListener(SbaGridListener* pListener) { m_pMasterListener = pListener; } - virtual void ActivateCell(long nRow, sal_uInt16 nCol, bool bSetCellFocus = true) override; + virtual void ActivateCell(sal_Int32 nRow, sal_uInt16 nCol, bool bSetCellFocus = true) override; virtual void DeactivateCell(bool bUpdate = true) override; using FmGridControl::ActivateCell; @@ -230,7 +223,7 @@ namespace dbaui @return The description of the specified object. */ - virtual OUString GetAccessibleObjectDescription( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; + virtual OUString GetAccessibleObjectDescription( AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; using FmGridControl::DeleteSelectedRows; /** copies the currently selected rows to the clipboard @@ -250,11 +243,11 @@ namespace dbaui // EditBrowseBox overridables virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) override; - virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) override; + virtual ::svt::CellController* GetController(sal_Int32 nRow, sal_uInt16 nCol) override; // DbGridControl overridables - virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) override; - virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu& rMenu, sal_uInt16 nExecutionResult) override; + virtual void PreExecuteRowContextMenu(weld::Menu& rMenu) override; + virtual void PostExecuteRowContextMenu(const OUString& rExecutionResult) override; // DbGridControl overridables virtual void onRowChange() override; @@ -287,6 +280,5 @@ namespace dbaui using FmGridControl::MouseButtonDown; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_SBAGRID_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx b/dbaccess/source/ui/inc/sbamultiplex.hxx index c71c9cbbeea5..47fd753d4af6 100644 --- a/dbaccess/source/ui/inc/sbamultiplex.hxx +++ b/dbaccess/source/ui/inc/sbamultiplex.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_SBAMULTIPLEX_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_SBAMULTIPLEX_HXX +#pragma once #include <com/sun/star/beans/XVetoableChangeListener.hpp> #include <com/sun/star/form/XDatabaseParameterListener.hpp> @@ -32,9 +31,8 @@ #include <com/sun/star/sdbc/XRowSetListener.hpp> #include <com/sun/star/frame/XStatusListener.hpp> #include <comphelper/uno3.hxx> -#include <cppuhelper/interfacecontainer.hxx> -#include <comphelper/interfacecontainer2.hxx> -#include <cppuhelper/queryinterface.hxx> +#include <comphelper/interfacecontainer3.hxx> +#include <comphelper/multiinterfacecontainer3.hxx> #include <cppuhelper/weak.hxx> namespace dbaui @@ -48,350 +46,260 @@ namespace dbaui public: OSbaWeakSubObject(::cppu::OWeakObject& rParent) : m_rParent(rParent) { } - virtual void SAL_CALL acquire() throw() override { m_rParent.acquire(); } - virtual void SAL_CALL release() throw() override { m_rParent.release(); } + virtual void SAL_CALL acquire() noexcept override { m_rParent.acquire(); } + virtual void SAL_CALL release() noexcept override { m_rParent.release(); } }; - // declaration of a listener multiplexer class - #define BEGIN_DECLARE_LISTENER_MULTIPLEXER(classname, listenerclass) \ - class classname \ - :public OSbaWeakSubObject \ - ,public listenerclass \ - ,public ::comphelper::OInterfaceContainerHelper2 \ - { \ - public: \ - classname( ::cppu::OWeakObject& rSource, \ - ::osl::Mutex& rMutex); \ - DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject) \ - virtual css::uno::Any SAL_CALL queryInterface( \ - const css::uno::Type& _rType) override; \ - \ - /* css::lang::XEventListener */ \ - virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; \ - - #define DECLARE_MULTIPLEXER_VOID_METHOD(methodname, eventtype) \ - virtual void SAL_CALL methodname(const eventtype& e) override; \ - - #define DECLARE_MULTIPLEXER_BOOL_METHOD(methodname, eventtype) \ - virtual sal_Bool SAL_CALL methodname(const eventtype& e) override; \ - - #define END_DECLARE_LISTENER_MULTIPLEXER() \ - /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ \ - using OSbaWeakSubObject::operator new; \ - using OSbaWeakSubObject::operator delete; \ - }; \ - - // implementation of a listener multiplexer class - - #define IMPLEMENT_LISTENER_MULTIPLEXER_CORE(classname, listenerclass) \ - \ - classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex) \ - :OSbaWeakSubObject(rSource) \ - ,OInterfaceContainerHelper2(_rMutex) \ - { \ - } \ - \ - css::uno::Any SAL_CALL classname::queryInterface( \ - const css::uno::Type& _rType) \ - { \ - css::uno::Any aReturn = \ - OSbaWeakSubObject::queryInterface(_rType); \ - if (!aReturn.hasValue()) \ - aReturn = ::cppu::queryInterface(_rType, \ - static_cast< listenerclass* >(this), \ - static_cast< css::lang::XEventListener* >(static_cast< listenerclass* >(this)) \ - ); \ - \ - return aReturn; \ - } \ - void SAL_CALL classname::disposing(const css::lang::EventObject& )\ - { \ - } \ - - #define IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(classname, listenerclass, methodname, eventtype) \ - void SAL_CALL classname::methodname(const eventtype& e) \ - { \ - eventtype aMulti(e); \ - aMulti.Source = &m_rParent; \ - ::comphelper::OInterfaceIteratorHelper2 aIt(*this); \ - while (aIt.hasMoreElements()) \ - static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ - } \ - - #define IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(classname, listenerclass, methodname, eventtype) \ - sal_Bool SAL_CALL classname::methodname(const eventtype& e) \ - { \ - eventtype aMulti(e); \ - aMulti.Source = &m_rParent; \ - ::comphelper::OInterfaceIteratorHelper2 aIt(*this); \ - bool bResult = true; \ - while (bResult && aIt.hasMoreElements()) \ - bResult = static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ - return bResult; \ - } \ - - // helper for classes which do event multiplexing - #define IMPLEMENT_LISTENER_ADMINISTRATION(classname, listenernamespace, listenerdesc, multiplexer, broadcasterclass, broadcaster) \ - void SAL_CALL classname::add##listenerdesc(const css::uno::Reference< css::listenernamespace::X##listenerdesc >& l)\ - { \ - multiplexer.addInterface(l); \ - if (multiplexer.getLength() == 1) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(&multiplexer); \ - } \ - } \ - void SAL_CALL classname::remove##listenerdesc(const css::uno::Reference< css::listenernamespace::X##listenerdesc >& l)\ - { \ - if (multiplexer.getLength() == 1) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(&multiplexer); \ - } \ - multiplexer.removeInterface(l); \ - } \ - - #define STOP_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \ - if (multiplexer.getLength()) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(&multiplexer); \ - } \ - - #define START_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \ - if (multiplexer.getLength()) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(&multiplexer); \ - } \ - - // declaration of property listener multiplexers - // (with support for specialized and unspecialized property listeners) - - #define DECLARE_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype) \ - class classname final \ - :public OSbaWeakSubObject \ - ,public listenerclass \ - { \ - typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< \ - OUString > ListenerContainerMap; \ - ListenerContainerMap m_aListeners; \ - \ - public: \ - classname( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); \ - DECLARE_UNO3_DEFAULTS(classname, OSbaWeakSubObject) \ - virtual css::uno::Any SAL_CALL queryInterface( \ - const css::uno::Type& _rType) override; \ - \ - /* css::lang::XEventListener */ \ - virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; \ - \ - virtual void SAL_CALL methodname(const eventtype& e) override; \ - \ - void addInterface(const OUString& rName, const css::uno::Reference< css::uno::XInterface >& rListener); \ - void removeInterface(const OUString& rName, const css::uno::Reference< css::uno::XInterface >& rListener); \ - \ - void disposeAndClear(); \ - \ - sal_Int32 getOverallLen() const; \ - \ - ::cppu::OInterfaceContainerHelper* getContainer(const OUString& rName) \ - { return m_aListeners.getContainer(rName); } \ - \ - private: \ - void Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e); \ - }; \ - - // implementation of property listener multiplexers - #define IMPLEMENT_PROPERTY_MULTIPLEXER(classname, listenerclass, methodname, eventtype) \ - classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex) \ - :OSbaWeakSubObject(rSource) \ - ,m_aListeners(rMutex) \ - { \ - } \ - \ - css::uno::Any SAL_CALL classname::queryInterface( \ - const css::uno::Type& _rType) \ - { \ - css::uno::Any aReturn = \ - OSbaWeakSubObject::queryInterface(_rType); \ - if (!aReturn.hasValue()) \ - aReturn = ::cppu::queryInterface(_rType, \ - static_cast< listenerclass* >(this), \ - static_cast< css::lang::XEventListener* >(static_cast< listenerclass* >(this)) \ - ); \ - \ - return aReturn; \ - } \ - void SAL_CALL classname::disposing(const css::lang::EventObject& )\ - { \ - } \ - \ - void SAL_CALL classname::methodname(const eventtype& e) \ - { \ - ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(e.PropertyName); \ - if (pListeners) \ - Notify(*pListeners, e); \ - \ - /* do the notification for the unspecialized listeners, too */ \ - pListeners = m_aListeners.getContainer(OUString()); \ - if (pListeners) \ - Notify(*pListeners, e); \ - } \ - \ - void classname::addInterface(const OUString& rName, \ - const css::uno::Reference< css::uno::XInterface > & rListener) \ - { \ - m_aListeners.addInterface(rName, rListener); \ - } \ - \ - void classname::removeInterface(const OUString& rName, \ - const css::uno::Reference< css::uno::XInterface > & rListener) \ - { \ - m_aListeners.removeInterface(rName, rListener); \ - } \ - \ - void classname::disposeAndClear() \ - { \ - css::lang::EventObject aEvt(m_rParent); \ - m_aListeners.disposeAndClear(aEvt); \ - } \ - \ - sal_Int32 classname::getOverallLen() const \ - { \ - sal_Int32 nLen = 0; \ - const css::uno::Sequence< OUString > aContained = m_aListeners.getContainedTypes(); \ - for ( OUString const & s : aContained) \ - { \ - ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(s); \ - if (!pListeners) \ - continue; \ - nLen += pListeners->getLength(); \ - } \ - return nLen; \ - } \ - \ - void classname::Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e) \ - { \ - eventtype aMulti(e); \ - aMulti.Source = &m_rParent; \ - ::cppu::OInterfaceIteratorHelper aIt(rListeners); \ - while (aIt.hasMoreElements()) \ - static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \ - } \ - - // helper for classes which do property event multiplexing - #define IMPLEMENT_PROPERTY_LISTENER_ADMINISTRATION(classname, listenerdesc, multiplexer, broadcasterclass, broadcaster) \ - void SAL_CALL classname::add##listenerdesc(const OUString& rName, const css::uno::Reference< css::beans::X##listenerdesc >& l )\ - { \ - multiplexer.addInterface(rName, l); \ - if (multiplexer.getOverallLen() == 1) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(OUString(), &multiplexer); \ - } \ - } \ - void SAL_CALL classname::remove##listenerdesc(const OUString& rName, const css::uno::Reference< css::beans::X##listenerdesc >& l )\ - { \ - if (multiplexer.getOverallLen() == 1) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(OUString(), &multiplexer); \ - } \ - multiplexer.removeInterface(rName, l); \ - } \ - - #define STOP_PROPERTY_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \ - if (multiplexer.getOverallLen()) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->remove##listenerdesc(OUString(), &multiplexer); \ - } \ - - #define START_PROPERTY_MULTIPLEXER_LISTENING(listenerdesc, multiplexer, broadcasterclass, broadcaster) \ - if (multiplexer.getOverallLen()) \ - { \ - css::uno::Reference< broadcasterclass > xBroadcaster(broadcaster, css::uno::UNO_QUERY); \ - if (xBroadcaster.is()) \ - xBroadcaster->add##listenerdesc(OUString(), &multiplexer); \ - } \ - // some listener multiplexers // css::frame::XStatusListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXStatusMultiplexer, css::frame::XStatusListener) - DECLARE_MULTIPLEXER_VOID_METHOD(statusChanged, css::frame::FeatureStateEvent) + class SbaXStatusMultiplexer + :public OSbaWeakSubObject + ,public css::frame::XStatusListener + ,public ::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener> + { + public: + SbaXStatusMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXStatusMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& e) override; private: css::frame::FeatureStateEvent m_aLastKnownStatus; - public: \ + public: const css::frame::FeatureStateEvent& getLastEvent( ) const { return m_aLastKnownStatus; } - END_DECLARE_LISTENER_MULTIPLEXER() + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::form::XLoadListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXLoadMultiplexer, css::form::XLoadListener) - DECLARE_MULTIPLEXER_VOID_METHOD(loaded, css::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(unloaded, css::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(unloading, css::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(reloading, css::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(reloaded, css::lang::EventObject) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXLoadMultiplexer + :public OSbaWeakSubObject + ,public css::form::XLoadListener + ,public ::comphelper::OInterfaceContainerHelper3<css::form::XLoadListener> + { + public: + SbaXLoadMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXLoadMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + virtual void SAL_CALL loaded(const css::lang::EventObject& e) override; + virtual void SAL_CALL unloaded(const css::lang::EventObject& e) override; + virtual void SAL_CALL unloading(const css::lang::EventObject& e) override; + virtual void SAL_CALL reloading(const css::lang::EventObject& e) override; + virtual void SAL_CALL reloaded(const css::lang::EventObject& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::form::XDatabaseParameterListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXParameterMultiplexer, css::form::XDatabaseParameterListener) - DECLARE_MULTIPLEXER_BOOL_METHOD(approveParameter, css::form::DatabaseParameterEvent) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXParameterMultiplexer + :public OSbaWeakSubObject + ,public css::form::XDatabaseParameterListener + ,public ::comphelper::OInterfaceContainerHelper3<css::form::XDatabaseParameterListener> + { + public: + SbaXParameterMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXParameterMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + virtual sal_Bool SAL_CALL approveParameter(const css::form::DatabaseParameterEvent& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::form::XSubmitListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXSubmitMultiplexer, css::form::XSubmitListener) - DECLARE_MULTIPLEXER_BOOL_METHOD(approveSubmit, css::lang::EventObject) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXSubmitMultiplexer + :public OSbaWeakSubObject + ,public css::form::XSubmitListener + ,public ::comphelper::OInterfaceContainerHelper3<css::form::XSubmitListener> + { + public: + SbaXSubmitMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXSubmitMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + virtual sal_Bool SAL_CALL approveSubmit(const css::lang::EventObject& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::form::XResetListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXResetMultiplexer, css::form::XResetListener) - DECLARE_MULTIPLEXER_BOOL_METHOD(approveReset, css::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(resetted, css::lang::EventObject) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXResetMultiplexer + :public OSbaWeakSubObject + ,public css::form::XResetListener + ,public ::comphelper::OInterfaceContainerHelper3<css::form::XResetListener> + { + public: + SbaXResetMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXResetMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject& e) override; + virtual void SAL_CALL resetted(const css::lang::EventObject& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::sdbc::XRowSetListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXRowSetMultiplexer, css::sdbc::XRowSetListener) - DECLARE_MULTIPLEXER_VOID_METHOD(cursorMoved, css::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(rowChanged, css::lang::EventObject) - DECLARE_MULTIPLEXER_VOID_METHOD(rowSetChanged, css::lang::EventObject) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXRowSetMultiplexer + :public OSbaWeakSubObject + ,public css::sdbc::XRowSetListener + ,public ::comphelper::OInterfaceContainerHelper3<css::sdbc::XRowSetListener> + { + public: + SbaXRowSetMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXRowSetMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + virtual void SAL_CALL cursorMoved(const css::lang::EventObject& e) override; + virtual void SAL_CALL rowChanged(const css::lang::EventObject& e) override; + virtual void SAL_CALL rowSetChanged(const css::lang::EventObject& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::sdb::XRowSetApproveListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXRowSetApproveMultiplexer, css::sdb::XRowSetApproveListener) - DECLARE_MULTIPLEXER_BOOL_METHOD(approveCursorMove, css::lang::EventObject) - DECLARE_MULTIPLEXER_BOOL_METHOD(approveRowChange, css::sdb::RowChangeEvent) - DECLARE_MULTIPLEXER_BOOL_METHOD(approveRowSetChange, css::lang::EventObject) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXRowSetApproveMultiplexer + :public OSbaWeakSubObject + ,public css::sdb::XRowSetApproveListener + ,public ::comphelper::OInterfaceContainerHelper3<css::sdb::XRowSetApproveListener> + { + public: + SbaXRowSetApproveMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXRowSetApproveMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + virtual sal_Bool SAL_CALL approveCursorMove(const css::lang::EventObject& e) override; + virtual sal_Bool SAL_CALL approveRowChange(const css::sdb::RowChangeEvent& e) override; + virtual sal_Bool SAL_CALL approveRowSetChange(const css::lang::EventObject& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::sdb::XSQLErrorListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXSQLErrorMultiplexer, css::sdb::XSQLErrorListener) - DECLARE_MULTIPLEXER_VOID_METHOD(errorOccured, css::sdb::SQLErrorEvent) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXSQLErrorMultiplexer + :public OSbaWeakSubObject + ,public css::sdb::XSQLErrorListener + ,public ::comphelper::OInterfaceContainerHelper3<css::sdb::XSQLErrorListener> + { + public: + SbaXSQLErrorMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXSQLErrorMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + virtual void SAL_CALL errorOccured(const css::sdb::SQLErrorEvent& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // css::beans::XPropertyChangeListener - DECLARE_PROPERTY_MULTIPLEXER(SbaXPropertyChangeMultiplexer, css::beans::XPropertyChangeListener, propertyChange, css::beans::PropertyChangeEvent) + class SbaXPropertyChangeMultiplexer final + :public OSbaWeakSubObject + ,public css::beans::XPropertyChangeListener + { + typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertyChangeListener, OUString> ListenerContainerMap; + ListenerContainerMap m_aListeners; + + public: + SbaXPropertyChangeMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); + DECLARE_UNO3_DEFAULTS(SbaXPropertyChangeMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& e) override; + + void addInterface(const OUString& rName, const css::uno::Reference< css::beans::XPropertyChangeListener >& rListener); + void removeInterface(const OUString& rName, const css::uno::Reference< css::beans::XPropertyChangeListener >& rListener); + + void disposeAndClear(); + + sal_Int32 getOverallLen() const; + + ::comphelper::OInterfaceContainerHelper3<css::beans::XPropertyChangeListener>* getContainer(const OUString& rName) + { return m_aListeners.getContainer(rName); } + + private: + void Notify(::comphelper::OInterfaceContainerHelper3<css::beans::XPropertyChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e); + }; // css::beans::XVetoableChangeListener - DECLARE_PROPERTY_MULTIPLEXER(SbaXVetoableChangeMultiplexer, css::beans::XVetoableChangeListener, vetoableChange, css::beans::PropertyChangeEvent) + class SbaXVetoableChangeMultiplexer final + :public OSbaWeakSubObject + ,public css::beans::XVetoableChangeListener + { + typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XVetoableChangeListener, OUString > ListenerContainerMap; + ListenerContainerMap m_aListeners; + + public: + SbaXVetoableChangeMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); + DECLARE_UNO3_DEFAULTS(SbaXVetoableChangeMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + virtual void SAL_CALL vetoableChange(const css::beans::PropertyChangeEvent& e) override; + + void addInterface(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rListener); + void removeInterface(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rListener); + + void disposeAndClear(); + + sal_Int32 getOverallLen() const; + + private: + void Notify(::comphelper::OInterfaceContainerHelper3<css::beans::XVetoableChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e); + }; // css::beans::XPropertiesChangeListener - BEGIN_DECLARE_LISTENER_MULTIPLEXER(SbaXPropertiesChangeMultiplexer, css::beans::XPropertiesChangeListener) - DECLARE_MULTIPLEXER_VOID_METHOD(propertiesChange, css::uno::Sequence< css::beans::PropertyChangeEvent >) - END_DECLARE_LISTENER_MULTIPLEXER() + class SbaXPropertiesChangeMultiplexer + :public OSbaWeakSubObject + ,public css::beans::XPropertiesChangeListener + ,public ::comphelper::OInterfaceContainerHelper3<css::beans::XPropertiesChangeListener> + { + public: + SbaXPropertiesChangeMultiplexer(::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(SbaXPropertiesChangeMultiplexer, OSbaWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + /* css::lang::XEventListener */ + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + virtual void SAL_CALL propertiesChange(const css::uno::Sequence< css::beans::PropertyChangeEvent >& e) override; + /* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ + using OSbaWeakSubObject::operator new; + using OSbaWeakSubObject::operator delete; + }; // the SbaXPropertiesChangeMultiplexer doesn't care about the property names a listener logs on for, it simply // forwards _all_ changes to _all_ listeners } -#endif // _SBA_MULTIPLEXER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/singledoccontroller.hxx b/dbaccess/source/ui/inc/singledoccontroller.hxx index 37cc6740063e..6b535882bc80 100644 --- a/dbaccess/source/ui/inc/singledoccontroller.hxx +++ b/dbaccess/source/ui/inc/singledoccontroller.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_SINGLEDOCCONTROLLER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_SINGLEDOCCONTROLLER_HXX +#pragma once #include <memory> #include <dbaccess/dbsubcomponentcontroller.hxx> @@ -32,9 +31,8 @@ class SfxUndoManager; namespace dbaui { +class UndoManager; - // OSingleDocumentController - struct OSingleDocumentController_Data; typedef ::cppu::ImplInheritanceHelper< DBSubComponentController , css::document::XUndoManagerSupplier > OSingleDocumentController_Base; @@ -71,11 +69,10 @@ namespace dbaui using OSingleDocumentController_Base::disposing; private: - std::unique_ptr< OSingleDocumentController_Data > m_pData; + // no Reference! see UndoManager::acquire + std::unique_ptr<UndoManager> m_pUndoManager; }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_SINGLEDOCCONTROLLER_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 8337ae398c64..d0f8672cc698 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -16,71 +16,85 @@ * 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_DBACCESS_SOURCE_UI_INC_SQLEDIT_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_SQLEDIT_HXX +#pragma once #include <sal/config.h> +#include <comphelper/syntaxhighlight.hxx> #include <rtl/ref.hxx> -#include <svtools/editsyntaxhighlighter.hxx> #include <svtools/colorcfg.hxx> +#include <svx/weldeditview.hxx> +#include <vcl/timer.hxx> +#include <mutex> namespace com::sun::star::beans { class XMultiPropertySet; } namespace dbaui { - class OQueryTextView; - class OSqlEdit final : public MultiLineEditSyntaxHighlight, public utl::ConfigurationListener + class SQLEditView final : public WeldEditView, public utl::ConfigurationListener { private: class ChangesListener; friend class ChangesListener; - Timer m_timerInvalidate; - Timer m_timerUndoActionCreation; - OUString m_strOrigText; // is restored on undo - VclPtr<OQueryTextView> m_pView; - bool m_bAccelAction; // is set on cut, copy, paste - bool m_bStopTimer; - svtools::ColorConfig m_ColorConfig; + std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow; + Link<LinkParamNone*,void> m_aModifyLink; + const svtools::ColorConfig m_aColorConfig; + Timer m_aUpdateDataTimer; + const SyntaxHighlighter m_aHighlighter; + svtools::ColorConfig m_ColorConfig; + rtl::Reference<SfxItemPool> m_pItemPool; - rtl::Reference< ChangesListener > m_listener; - osl::Mutex m_mutex; - css::uno::Reference< css::beans::XMultiPropertySet > m_notifier; + rtl::Reference<ChangesListener> m_listener; + std::mutex m_mutex; + css::uno::Reference<css::beans::XMultiPropertySet> m_notifier; - DECL_LINK(OnUndoActionTimer, Timer*, void); - DECL_LINK(OnInvalidateTimer, Timer*, void); + bool m_bInUpdate; + bool m_bDisableInternalUndo; - void ImplSetFont(); + DECL_LINK(ModifyHdl, LinkParamNone*, void); + DECL_LINK(ImplUpdateDataHdl, Timer*, void); + DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void); + DECL_LINK(EditStatusHdl, EditStatus&, void); - virtual void KeyInput( const KeyEvent& rKEvt ) override; - virtual void GetFocus() override; + Color GetColorValue(TokenType aToken); - DECL_LINK(ModifyHdl, Edit&, void); + void ImplSetFont(); + + void DoBracketHilight(sal_uInt16 nKey); + + static void SetItemPoolFont(SfxItemPool* pItemPool); + + void UpdateData(); + + void SetScrollBarRange(); + void DoScroll(); + + virtual void EditViewScrollStateChange() override; public: - OSqlEdit( OQueryTextView* pParent); - virtual ~OSqlEdit() override; - virtual void dispose() override; + SQLEditView(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow); + virtual void makeEditEngine() override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SQLEditView() override; + + virtual bool KeyInput(const KeyEvent& rKEvt) override; + virtual bool Command(const CommandEvent& rCEvt) override; - // Edit overridables - virtual void SetText(const OUString& rNewText) override; - using MultiLineEditSyntaxHighlight::SetText; + void SetTextAndUpdate(const OUString& rNewText); - // own functionality - // Cut, Copy, Paste by Accel. runs the action in the Edit but also the - // corresponding slot in the View. Therefore, the action occurs twice. - // To prevent this, SlotExec in View can call this function. - bool IsInAccelAct() const { return m_bAccelAction; } + void SetModifyHdl(const Link<LinkParamNone*,void>& rLink) + { + m_aModifyLink = rLink; + } - void stopTimer(); - void startTimer(); + void DisableInternalUndo(); - virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override; + static Color GetSyntaxHighlightColor(const svtools::ColorConfig& rColorConfig, HighlighterLanguage eLanguage, TokenType aToken); + + virtual void ConfigurationChanged(utl::ConfigurationBroadcaster*, ConfigurationHints) override; }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_SQLEDIT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/sqlmessage.hxx b/dbaccess/source/ui/inc/sqlmessage.hxx index ff80b962f52e..ab827c5dec23 100644 --- a/dbaccess/source/ui/inc/sqlmessage.hxx +++ b/dbaccess/source/ui/inc/sqlmessage.hxx @@ -17,23 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_SQLMESSAGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_SQLMESSAGE_HXX +#pragma once #include <connectivity/dbexception.hxx> #include <vcl/weld.hxx> #include <memory> -// some forwards -namespace com::sun::star { - namespace sdb { - class SQLContext; - } - namespace sdbc { - class SQLException; - } -} - namespace dbaui { @@ -90,7 +79,7 @@ public: weld::Window* pParent, const dbtools::SQLExceptionInfo& _rException, MessBoxStyle _nStyle = MessBoxStyle::Ok | MessBoxStyle::DefaultOk, - const OUString& _rHelpURL = OUString() + OUString _sHelpURL = OUString() ); /** display a database related error message @@ -107,7 +96,7 @@ public: const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = nullptr ); void set_title(const OUString& rTitle) { m_xDialog->set_title(rTitle); } - void add_button(const OUString& rText, int nResponse, const OString& rHelpId = OString()) { m_xDialog->add_button(rText, nResponse, rHelpId); } + void add_button(const OUString& rText, int nResponse, const OUString& rHelpId = {}) { m_xDialog->add_button(rText, nResponse, rHelpId); } void set_default_response(int nResponse) { m_xDialog->set_default_response(nResponse); } virtual ~OSQLMessageBox() override; @@ -143,6 +132,4 @@ public: } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_SQLMESSAGE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/stringlistitem.hxx b/dbaccess/source/ui/inc/stringlistitem.hxx index 7601f3030cb9..18156cc2385e 100644 --- a/dbaccess/source/ui/inc/stringlistitem.hxx +++ b/dbaccess/source/ui/inc/stringlistitem.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_STRINGLISTITEM_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_STRINGLISTITEM_HXX +#pragma once #include <svl/poolitem.hxx> @@ -27,26 +26,24 @@ namespace dbaui { - // OStringListItem /** <type>SfxPoolItem</type> which transports a sequence of <type scope="rtl">OUString</type>'s */ class OStringListItem : public SfxPoolItem { - css::uno::Sequence< OUString > m_aList; + css::uno::Sequence<OUString> m_aList; public: - OStringListItem(sal_Int16 nWhich, const css::uno::Sequence< OUString >& _rList); + DECLARE_ITEM_TYPE_FUNCTION(OStringListItem) + OStringListItem(sal_Int16 nWhich, const css::uno::Sequence<OUString>& _rList); OStringListItem(const OStringListItem& _rSource); - virtual bool operator==(const SfxPoolItem& _rItem) const override; + virtual bool operator==(const SfxPoolItem& _rItem) const override; virtual OStringListItem* Clone(SfxItemPool* _pPool = nullptr) const override; - const css::uno::Sequence< OUString >& getList() const { return m_aList; } + const css::uno::Sequence<OUString>& getList() const { return m_aList; } }; -} // namespace dbaui - -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_STRINGLISTITEM_HXX +} // namespace dbaui /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/tabletree.hxx b/dbaccess/source/ui/inc/tabletree.hxx index 30b3f742f591..ebfbf7d29c4a 100644 --- a/dbaccess/source/ui/inc/tabletree.hxx +++ b/dbaccess/source/ui/inc/tabletree.hxx @@ -17,42 +17,43 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TABLETREE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLETREE_HXX +#pragma once #include "imageprovider.hxx" -#include "marktree.hxx" +#include "dbtreelistbox.hxx" #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdb/application/NamedDatabaseObject.hpp> -#include <vcl/weld.hxx> #include <memory> namespace dbaui { // OTableTreeListBox -class OTableTreeListBox final : public OMarkableTreeListBox +class OTableTreeListBox : public TreeListBox { css::uno::Reference< css::sdbc::XConnection > m_xConnection; // the connection we're working for, set in implOnNewConnection, called by UpdateTableList std::unique_ptr< ImageProvider > m_xImageProvider; // provider for our images + bool m_bVirtualRoot; // should the first entry be visible + bool m_bNoEmptyFolders; // should empty catalogs/schematas be prevented from being displayed? + bool m_bShowToggles; // show toggle buttons public: - OTableTreeListBox(vcl::Window* pParent, WinBits nWinStyle); + OTableTreeListBox(std::unique_ptr<weld::TreeView> xTreeView, bool bShowToggles); + + void init() { m_bVirtualRoot = true; } typedef std::pair< OUString, bool > TTableViewName; typedef std::vector< TTableViewName > TNames; - /** call when HiContrast change. - */ - void notifyHiContrastChanged(); + void SuppressEmptyFolders() { m_bNoEmptyFolders = true; } /** determines whether the given entry denotes a tables folder */ - static bool isFolderEntry( const SvTreeListEntry* _pEntry ); + bool isFolderEntry(const weld::TreeIter& rEntry) const; /** fill the table list with the tables belonging to the connection described by the parameters @param _rxConnection @@ -77,110 +78,14 @@ public: const css::uno::Sequence< OUString>& _rViews ); - /** returns a NamedDatabaseObject record which describes the given entry - */ - css::sdb::application::NamedDatabaseObject - describeObject( SvTreeListEntry* _pEntry ); - /** to be used if a foreign instance added a table */ - SvTreeListEntry* addedTable( const OUString& _rName ); + std::unique_ptr<weld::TreeIter> addedTable( const OUString& _rName ); /** to be used if a foreign instance removed a table */ void removedTable( const OUString& _rName ); - /** returns the fully qualified name of a table entry - @param _pEntry - the entry whose name is to be obtained. Must not denote a folder entry. - */ - OUString getQualifiedTableName( SvTreeListEntry* _pEntry ) const; - - SvTreeListEntry* getEntryByQualifiedName( const OUString& _rName ); - -private: - virtual void InitEntry(SvTreeListEntry* _pEntry, const OUString& _rString, const Image& _rCollapsedBitmap, const Image& _rExpandedBitmap) override; - - virtual void checkedButton_noBroadcast(SvTreeListEntry* _pEntry) override; - - void implEmphasize(SvTreeListEntry* _pEntry, bool _bChecked, bool _bUpdateDescendants = true, bool _bUpdateAncestors = true); - - /** adds the given entry to our list - @precond - our image provider must already have been reset to the connection to which the meta data - belong. - */ - SvTreeListEntry* implAddEntry( - const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxMeta, - const OUString& _rTableName, - bool _bCheckName = true - ); - - void implSetDefaultImages(); - - void implOnNewConnection( const css::uno::Reference< css::sdbc::XConnection >& _rxConnection ); - - bool impl_getAndAssertMetaData( css::uno::Reference< css::sdbc::XDatabaseMetaData >& _out_rMetaData ) const; - - /** fill the table list with the tables and views determined by the two given containers - @param _rxConnection the connection where you got the object names from. Must not be NULL. - Used to split the full qualified names into its parts. - @param _rTables table/view sequence, the second argument is <TRUE/> if it is a table, otherwise it is a view. - */ - void UpdateTableList( - const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, - const TNames& _rTables - ); - -}; - -class TableTreeListBox -{ - css::uno::Reference< css::sdbc::XConnection > - m_xConnection; // the connection we're working for, set in implOnNewConnection, called by UpdateTableList - std::unique_ptr< ImageProvider > - m_xImageProvider; // provider for our images - bool m_bVirtualRoot; // should the first entry be visible - bool m_bNoEmptyFolders; // should empty catalogs/schematas be prevented from being displayed? - bool m_bShowToggles; // show toggle buttons - std::unique_ptr<weld::TreeView> m_xTreeView; - -public: - TableTreeListBox(std::unique_ptr<weld::TreeView> xTreeView); - - weld::TreeView& GetWidget() { return *m_xTreeView; } - - void init() { m_bVirtualRoot = true; } - - typedef std::pair< OUString, bool > TTableViewName; - typedef std::vector< TTableViewName > TNames; - - void SuppressEmptyFolders() { m_bNoEmptyFolders = true; } - void DisableCheckButtons(); - - /** fill the table list with the tables belonging to the connection described by the parameters - @param _rxConnection - the connection, which must support the service com.sun.star.sdb.Connection - @throws - <type scope="css::sdbc">SQLException</type> if no connection could be created - */ - void UpdateTableList( - const css::uno::Reference< css::sdbc::XConnection >& _rxConnection - ); - - /** fill the table list with the tables and views determined by the two given containers. - The views sequence is used to determine which table is of type view. - @param _rxConnection the connection where you got the object names from. Must not be NULL. - Used to split the full qualified names into its parts. - @param _rTables table/view sequence - @param _rViews view sequence - */ - void UpdateTableList( - const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, - const css::uno::Sequence< OUString>& _rTables, - const css::uno::Sequence< OUString>& _rViews - ); - std::unique_ptr<weld::TreeIter> getAllObjectsEntry() const; /** does a wildcard check of the given entry @@ -188,20 +93,18 @@ public: from checking the entry itself. The second is called 'wildcard' checking, 'cause in the resulting table filter it's represented by a wildcard.</p> */ - void checkWildcard(weld::TreeIter& rEntry); + void checkWildcard(const weld::TreeIter& rEntry); /** determine if the given entry is 'wildcard checked' @see checkWildcard */ bool isWildcardChecked(const weld::TreeIter& rEntry); - std::unique_ptr<weld::TreeIter> GetEntryPosByName(const OUString& aName, const weld::TreeIter* pStart = nullptr, const IEntryFilter* _pFilter = nullptr) const; - void CheckButtons(); // make the button states consistent (bottom-up) void checkedButton_noBroadcast(const weld::TreeIter& rEntry); private: - TriState implDetermineState(weld::TreeIter& rEntry); + TriState implDetermineState(const weld::TreeIter& rEntry); void implEmphasize(const weld::TreeIter& rEntry, bool _bChecked, bool _bUpdateDescendants = true, bool _bUpdateAncestors = true); @@ -210,15 +113,19 @@ private: our image provider must already have been reset to the connection to which the meta data belong. */ - void implAddEntry( + std::unique_ptr<weld::TreeIter> implAddEntry( const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxMeta, - const OUString& _rTableName + const OUString& _rTableName, + bool _bCheckName = true ); void implOnNewConnection( const css::uno::Reference< css::sdbc::XConnection >& _rxConnection ); + bool impl_getAndAssertMetaData( css::uno::Reference< css::sdbc::XDatabaseMetaData >& _out_rMetaData ) const; + bool haveVirtualRoot() const { return m_bVirtualRoot; } +public: /** fill the table list with the tables and views determined by the two given containers @param _rxConnection the connection where you got the object names from. Must not be NULL. Used to split the full qualified names into its parts. @@ -228,10 +135,21 @@ private: const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, const TNames& _rTables ); + + /** returns a NamedDatabaseObject record which describes the given entry + */ + css::sdb::application::NamedDatabaseObject + describeObject(const weld::TreeIter& rEntry); + + /** returns the fully qualified name of a table entry + @param _pEntry + the entry whose name is to be obtained. Must not denote a folder entry. + */ + OUString getQualifiedTableName(const weld::TreeIter& rEntry) const; + + std::unique_ptr<weld::TreeIter> getEntryByQualifiedName(const OUString& rName); }; } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLETREE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/textconnectionsettings.hxx b/dbaccess/source/ui/inc/textconnectionsettings.hxx index 4f2a8662034c..9d21c879568c 100644 --- a/dbaccess/source/ui/inc/textconnectionsettings.hxx +++ b/dbaccess/source/ui/inc/textconnectionsettings.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TEXTCONNECTIONSETTINGS_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_TEXTCONNECTIONSETTINGS_HXX +#pragma once #include "propertystorage.hxx" #include <vcl/weld.hxx> @@ -57,6 +56,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TEXTCONNECTIONSETTINGS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/undosqledit.hxx b/dbaccess/source/ui/inc/undosqledit.hxx index 8d7f1d9ba56f..2b760bbada73 100644 --- a/dbaccess/source/ui/inc/undosqledit.hxx +++ b/dbaccess/source/ui/inc/undosqledit.hxx @@ -16,21 +16,19 @@ * 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_DBACCESS_SOURCE_UI_INC_UNDOSQLEDIT_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_UNDOSQLEDIT_HXX +#pragma once #include "GeneralUndo.hxx" -#include "sqledit.hxx" -#include <vcl/vclptr.hxx> #include <strings.hrc> namespace dbaui { - class OSqlEdit; + class OQueryTextView; + // OSqlEditUndoAct - Undo-class for changing sql text class OSqlEditUndoAct final : public OCommentUndoAction { - VclPtr<OSqlEdit> m_pOwner; + OQueryTextView& m_rOwner; OUString m_strNextText; virtual void Undo() override { ToggleText(); } @@ -38,11 +36,10 @@ namespace dbaui void ToggleText(); public: - OSqlEditUndoAct(OSqlEdit* pEdit) : OCommentUndoAction(STR_QUERY_UNDO_MODIFYSQLEDIT), m_pOwner(pEdit) { } + OSqlEditUndoAct(OQueryTextView& rEdit) : OCommentUndoAction(STR_QUERY_UNDO_MODIFYSQLEDIT), m_rOwner(rEdit) { } - void SetOriginalText(const OUString& strText) { m_strNextText =strText; } + void SetOriginalText(const OUString& strText) { m_strNextText = strText; } }; } -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_UNDOSQLEDIT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/unoadmin.hxx b/dbaccess/source/ui/inc/unoadmin.hxx index 8f9013d4d27b..a1d6de4e8a0f 100644 --- a/dbaccess/source/ui/inc/unoadmin.hxx +++ b/dbaccess/source/ui/inc/unoadmin.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_UNOADMIN_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_UNOADMIN_HXX +#pragma once #include <svtools/genericunodialog.hxx> #include <com/sun/star/sdbc/XConnection.hpp> @@ -26,7 +25,6 @@ class SfxItemSet; class SfxItemPool; -class SfxPoolItem; namespace dbaui { @@ -38,9 +36,7 @@ class ODatabaseAdministrationDialog { protected: std::unique_ptr<SfxItemSet> m_pDatasourceItems; // item set for the dialog - SfxItemPool* m_pItemPool; // item pool for the item set for the dialog - std::vector<SfxPoolItem*>* - m_pItemPoolDefaults; // pool defaults + rtl::Reference<SfxItemPool> m_pItemPool; // item pool for the item set for the dialog std::unique_ptr<::dbaccess::ODsnTypeCollection> m_pCollection; // datasource type collection @@ -57,6 +53,4 @@ protected: } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_UNOADMIN_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index 498b634f2575..abdb75372539 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_UNODATBR_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_UNODATBR_HXX +#pragma once #include <memory> #include "brwctrlr.hxx" @@ -32,25 +31,23 @@ #include <com/sun/star/sdb/application/DatabaseObject.hpp> #include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp> #include <com/sun/star/sdb/XDatabaseRegistrationsListener.hpp> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/implbase5.hxx> #include "callbacks.hxx" +#include <utility> #include <vcl/transfer.hxx> #include <svx/dataaccessdescriptor.hxx> #include "TableCopyHelper.hxx" #include "commontypes.hxx" -class SvTreeListEntry; class Splitter; -struct SvSortData; +class ODataClipboard; namespace com::sun::star::container { class XNameContainer; } -class SvTreeList; namespace dbaui { - - class DBTreeView; - struct DBTreeEditedEntry; + struct DBTreeListUserData; class ImageProvider; typedef ::cppu::ImplHelper5 < css::frame::XStatusListener @@ -77,7 +74,7 @@ namespace dbaui bool bEnabled; ExternalFeature() : bEnabled( false ) { } - ExternalFeature( const css::util::URL& _rURL ) : aURL( _rURL ), bEnabled( false ) { } + ExternalFeature( css::util::URL _aURL ) : aURL(std::move( _aURL )), bEnabled( false ) { } }; typedef std::map< sal_uInt16, ExternalFeature > ExternalFeaturesMap; @@ -95,9 +92,9 @@ namespace dbaui OUString m_sQueryCommand; // the command of the query currently loaded (if any) //OUString m_sToBeLoaded; // contains the element name which should be loaded if any - VclPtr<DBTreeView> m_pTreeView; // contains the datasources of the registry + VclPtr<InterimDBTreeListBox> m_pTreeView; // contains the datasources of the registry VclPtr<Splitter> m_pSplitter; - SvTreeListEntry* m_pCurrentlyDisplayed; + std::unique_ptr<weld::TreeIter> m_xCurrentlyDisplayed; ImplSVEvent * m_nAsyncDrop; bool m_bQueryEscapeProcessing : 1; // the escape processing flag of the query currently loaded (if any) @@ -174,9 +171,6 @@ namespace dbaui // css::frame::XFrameActionListener virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent& aEvent) override; - //IController - virtual void notifyHiContrastChanged() override; - // XScriptInvocationContext virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override; @@ -213,19 +207,21 @@ namespace dbaui virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) override; // IControlActionListener overridables - virtual bool requestQuickHelp( const SvTreeListEntry* _pEntry, OUString& _rText ) const override; - virtual bool requestDrag( const Point& _rPosPixel ) override; + virtual bool requestQuickHelp(const void* pUserData, OUString& rText) const override; + virtual bool requestDrag(const weld::TreeIter& rEntry) override; virtual sal_Int8 queryDrop( const AcceptDropEvent& _rEvt, const DataFlavorExVector& _rFlavors ) override; virtual sal_Int8 executeDrop( const ExecuteDropEvent& _rEvt ) override; // IContextMenuProvider - virtual OUString getContextMenuResourceName( Control& _rControl ) const override; + virtual OUString getContextMenuResourceName() const override; virtual IController& getCommandController() override; virtual ::comphelper::OInterfaceContainerHelper2* getContextMenuInterceptors() override; - virtual css::uno::Any getCurrentSelection( Control& _rControl ) const override; + virtual css::uno::Any getCurrentSelection(weld::TreeView& rControl) const override; + virtual vcl::Window* getMenuParent() const override; + virtual void adjustMenuPosition(const weld::TreeView& rControl, ::Point& rPos) const override; - virtual void impl_initialize() override; + virtual void impl_initialize(const ::comphelper::NamedValueCollection& rArguments) override; // SbaGridListener overridables virtual void RowChanged() override; @@ -240,11 +236,11 @@ namespace dbaui // methods for handling the 'selection' (painting them bold) of SvLBoxEntries // returns <TRUE/> if the entry is selected (which means it's part of the selected path) - static bool isSelected(SvTreeListEntry* _pEntry); + bool isSelected(const weld::TreeIter& rEntry) const; // select the entry (and only the entry, not the whole path) - void select(SvTreeListEntry* _pEntry, bool _bSelect); + void select(const weld::TreeIter* pEntry, bool bSelect); // select the path of the entry (which must be an entry without children) - void selectPath(SvTreeListEntry* _pEntry, bool _bSelect = true); + void selectPath(const weld::TreeIter* pEntry, bool bSelect = true); virtual void loadMenu(const css::uno::Reference< css::frame::XFrame >& _xFrame) override; @@ -265,16 +261,16 @@ namespace dbaui <p>The given names and images may be empty, in this case they're filled with the correct values. This way they may be reused for the next call, which saves some resource manager calls.</p> */ - void implAddDatasource(const OUString& _rDbName, Image& _rDbImage, - OUString& _rQueryName, Image& _rQueryImage, - OUString& _rTableName, Image& _rTableImage, + void implAddDatasource(const OUString& _rDbName, OUString& _rDbImage, + OUString& _rQueryName, OUString& _rQueryImage, + OUString& _rTableName, OUString& _rTableImage, const SharedConnection& _rxConnection ); void implAddDatasource( const OUString& _rDataSourceName, const SharedConnection& _rxConnection ); /// removes (and cleans up) the entry for the given data source - void impl_cleanupDataSourceEntry( const OUString& _rDataSourceName ); + void impl_cleanupDataSourceEntry( std::u16string_view _rDataSourceName ); /// clears the tree list box void clearTreeModel(); @@ -288,63 +284,62 @@ namespace dbaui void unloadAndCleanup( bool _bDisposeConnection = true ); // disposes the connection associated with the given entry (which must represent a data source) - void disposeConnection( SvTreeListEntry* _pDSEntry ); + void disposeConnection(const weld::TreeIter* xpDSEntry); /// flushes and disposes the given connection, and de-registers as listener void impl_releaseConnection( SharedConnection& _rxConnection ); /** close the connection (and collapse the list entries) of the given list entries */ - void closeConnection(SvTreeListEntry* _pEntry, bool _bDisposeConnection = true); + void closeConnection(const weld::TreeIter& rEntry, bool bDisposeConnection = true); - void populateTree(const css::uno::Reference< css::container::XNameAccess>& _xNameAccess, SvTreeListEntry* _pParent, EntryType _eEntryType); + void populateTree(const css::uno::Reference< css::container::XNameAccess>& xNameAccess, const weld::TreeIter& rParent, EntryType eEntryType); void initializeTreeModel(); /** search in the tree for query- or tablecontainer equal to this interface and return this container entry */ - SvTreeListEntry* getEntryFromContainer(const css::uno::Reference< css::container::XNameAccess>& _rxNameAccess); + std::unique_ptr<weld::TreeIter> getEntryFromContainer(const css::uno::Reference<css::container::XNameAccess>& rxNameAccess); + // return true when there is connection available - bool ensureConnection(SvTreeListEntry* _pDSEntry, void * pDSData, SharedConnection& _rConnection ); - bool ensureConnection(SvTreeListEntry* _pAnyEntry, SharedConnection& _rConnection ); + bool ensureConnection(const weld::TreeIter* pDSEntry, void * pDSData, SharedConnection& rConnection); + bool ensureConnection(const weld::TreeIter* pAnyEntry, SharedConnection& rConnection); - bool getExistentConnectionFor( SvTreeListEntry* _pDSEntry, SharedConnection& _rConnection ); + bool getExistentConnectionFor(const weld::TreeIter* pDSEntry, SharedConnection& rConnection); /** returns an image provider which works with the connection belonging to the given entry */ - std::unique_ptr< ImageProvider > - getImageProviderFor( SvTreeListEntry* _pAnyEntry ); + std::unique_ptr<ImageProvider> getImageProviderFor(const weld::TreeIter* pAnyEntry); - void implAdministrate( SvTreeListEntry* _pApplyTo ); + void implAdministrate(const weld::TreeIter& rApplyTo); - TransferableHelper* - implCopyObject( SvTreeListEntry* _pApplyTo, sal_Int32 _nCommandType ); + bool implCopyObject(ODataClipboard& rExchange, const weld::TreeIter& rApplyTo, sal_Int32 nCommandType); - EntryType getEntryType( const SvTreeListEntry* _pEntry ) const; - EntryType getChildType( SvTreeListEntry const * _pEntry ) const; + EntryType getEntryType(const weld::TreeIter& rEntry) const; + EntryType getChildType(const weld::TreeIter& rEntry) const; static bool isObject( EntryType _eType ) { return ( etTableOrView== _eType ) || ( etQuery == _eType ); } static bool isContainer( EntryType _eType ) { return (etTableContainer == _eType) || (etQueryContainer == _eType); } - bool isContainer( const SvTreeListEntry* _pEntry ) const { return isContainer( getEntryType( _pEntry ) ); } + bool isContainer(const weld::TreeIter& rEntry) const { return isContainer(getEntryType(rEntry)); } // ensure that the xObject for the given entry is set on the user data - bool ensureEntryObject( SvTreeListEntry* _pEntry ); + bool ensureEntryObject(const weld::TreeIter& rEntry); // get the display text of the entry given - OUString GetEntryText( SvTreeListEntry* _pEntry ) const; + OUString GetEntryText(const weld::TreeIter& rEntry) const; // is called when a table or a query was selected DECL_LINK( OnSelectionChange, LinkParamNone*, void ); - DECL_LINK( OnExpandEntry, SvTreeListEntry*, bool ); + DECL_LINK( OnExpandEntry, const weld::TreeIter&, bool ); DECL_LINK( OnCopyEntry, LinkParamNone*, void ); - DECL_LINK( OnTreeEntryCompare, const SvSortData&, sal_Int32 ); + int OnTreeEntryCompare(const weld::TreeIter& rLHS, const weld::TreeIter& rRHS); DECL_LINK( OnAsyncDrop, void*, void ); void implRemoveStatusListeners(); bool implSelect(const svx::ODataAccessDescriptor& _rDescriptor, bool _bSelectDirect = false); - bool implSelect( SvTreeListEntry* _pEntry ); + bool implSelect(const weld::TreeIter* pEntry); /// selects the entry given and loads the grid control with the object's data bool implSelect( @@ -356,51 +351,49 @@ namespace dbaui bool _bSelectDirect ); - SvTreeListEntry* implGetConnectionEntry(SvTreeListEntry* _pEntry) const; + std::unique_ptr<weld::TreeIter> implGetConnectionEntry(const weld::TreeIter& rEntry) const; /// inserts an entry into the tree - SvTreeListEntry* implAppendEntry( - SvTreeListEntry* _pParent, - const OUString& _rName, - void* _pUserData, - EntryType _eEntryType - ); + std::unique_ptr<weld::TreeIter> implAppendEntry( + const weld::TreeIter* pParent, + const OUString& rName, + const DBTreeListUserData* pUserData); /// loads the grid control with the data object specified (which may be a table, a query or a command) bool implLoadAnything(const OUString& _rDataSourceName, const OUString& _rCommand, const sal_Int32 _nCommandType, const bool _bEscapeProcessing, const SharedConnection& _rxConnection ); /** retrieves the tree entry for the object described by <arg>_rDescriptor</arg> - @param _rDescriptor + @param rDescriptor the object descriptor - @param _ppDataSourceEntry + @param ppDataSourceEntry If not <NULL/>, the data source tree entry will be returned here - @param _ppContainerEntry + @param ppContainerEntry If not <NULL/>, the object container tree entry will be returned here */ - SvTreeListEntry* getObjectEntry(const svx::ODataAccessDescriptor& _rDescriptor, - SvTreeListEntry** _ppDataSourceEntry, SvTreeListEntry** _ppContainerEntry + std::unique_ptr<weld::TreeIter> getObjectEntry(const svx::ODataAccessDescriptor& rDescriptor, + std::unique_ptr<weld::TreeIter>* ppDataSourceEntry, std::unique_ptr<weld::TreeIter>* ppContainerEntry ); /** retrieves the tree entry for the object described by data source name, command and command type - @param _rDataSource + @param rDataSource the data source name - @param _rCommand + @param rCommand the command - @param _nCommandType + @param nCommandType the command type - @param _rDescriptor + @param rDescriptor the object descriptor - @param _ppDataSourceEntry + @param ppDataSourceEntry If not <NULL/>, the data source tree entry will be returned here - @param _ppContainerEntry + @param ppContainerEntry If not <NULL/>, the object container tree entry will be returned here - @param _bExpandAncestors + @param bExpandAncestors If <TRUE/>, all ancestor on the way to the entry will be expanded */ - SvTreeListEntry* getObjectEntry( - const OUString& _rDataSource, const OUString& _rCommand, sal_Int32 _nCommandType, - SvTreeListEntry** _ppDataSourceEntry, SvTreeListEntry** _ppContainerEntry, + std::unique_ptr<weld::TreeIter> getObjectEntry( + const OUString& rDataSource, const OUString& rCommand, sal_Int32 nCommandType, + std::unique_ptr<weld::TreeIter>* ppDataSourceEntry, std::unique_ptr<weld::TreeIter>* ppContainerEntry, bool _bExpandAncestors = true, - const SharedConnection& _rxConnection = SharedConnection() + const SharedConnection& rxConnection = SharedConnection() ); /// checks if m_aDocumentDataSource describes a known object @@ -412,32 +405,32 @@ namespace dbaui void transferChangedControlProperty(const OUString& _rProperty, const css::uno::Any& _rNewValue); // checks whether the given tree entry denotes a data source - bool impl_isDataSourceEntry( SvTreeListEntry* _pEntry ) const; + bool impl_isDataSourceEntry(const weld::TreeIter* pEntry) const; /// retrieves the data source URL/name for the given entry representing a data source - OUString getDataSourceAccessor( SvTreeListEntry* _pDataSourceEntry ) const; + OUString getDataSourceAccessor(const weld::TreeIter& rDataSourceEntry) const; /** get the signature (command/escape processing) of the query the form is based on <p>If the for is not based on a query or not even loaded, nothing happens and <FALSE/> is returned.</p> */ bool implGetQuerySignature( OUString& _rCommand, bool& _bEscapeProcessing ); - bool isEntryCopyAllowed(SvTreeListEntry const * _pEntry) const; + bool isEntryCopyAllowed(const weld::TreeIter& rEntry) const; - void copyEntry(SvTreeListEntry* _pEntry); + void copyEntry(const weld::TreeIter& rEntry); // remove all grid columns and dispose them static void clearGridColumns(const css::uno::Reference< css::container::XNameContainer >& _xColContainer); /** checks if the currently displayed entry changed - @param _sName + @param rName Name of the changed entry - @param _pContainer + @param rContainer The container of the displayed entry @return <TRUE/> if it is the currently displayed otherwise <FALSE/> */ - bool isCurrentlyDisplayedChanged(const OUString& _sName, SvTreeListEntry const * _pContainer); + bool isCurrentlyDisplayedChanged(std::u16string_view rName, const weld::TreeIter& rContainer); /** called whenever the content of the browser is used for preview, as the very last action of the load process @@ -451,6 +444,4 @@ namespace dbaui } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_UNODATBR_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/unosqlmessage.hxx b/dbaccess/source/ui/inc/unosqlmessage.hxx index bda4cbf23b90..c084ef240b7d 100644 --- a/dbaccess/source/ui/inc/unosqlmessage.hxx +++ b/dbaccess/source/ui/inc/unosqlmessage.hxx @@ -17,11 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_UNOSQLMESSAGE_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_INC_UNOSQLMESSAGE_HXX +#pragma once #include <svtools/genericunodialog.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/proparrhlp.hxx> namespace dbaui @@ -67,6 +65,4 @@ private: } // namespace dbaui -#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_UNOSQLMESSAGE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |