diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-02-12 11:11:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-02-12 18:32:07 +0100 |
commit | 5c8ff0eab1ac8199efd966a0fcb3352cdb8deaf6 (patch) | |
tree | 88bef19509020cd172b2ed051c27d9d038a6fc45 /sc/source/ui/inc | |
parent | 66cab03733f4fc91a2ebd37a799d940f5e787166 (diff) |
weld ScNamePasteDlg
Change-Id: I197a917458fdd75b08f888deac1926dc363202d5
Reviewed-on: https://gerrit.libreoffice.org/67735
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/inc')
-rw-r--r-- | sc/source/ui/inc/namemgrtable.hxx | 36 | ||||
-rw-r--r-- | sc/source/ui/inc/namepast.hxx | 20 |
2 files changed, 44 insertions, 12 deletions
diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx index adf2175428e9..4bf8b879c840 100644 --- a/sc/source/ui/inc/namemgrtable.hxx +++ b/sc/source/ui/inc/namemgrtable.hxx @@ -86,6 +86,42 @@ public: DECL_LINK( HeaderEndDragHdl, HeaderBar*, void); }; +class SC_DLLPUBLIC RangeManagerTable +{ +private: + std::unique_ptr<weld::TreeView> m_xTreeView; + + OUString const maGlobalString; + + // should be const because we should not modify it here + const std::map<OUString, std::unique_ptr<ScRangeName>>& m_RangeMap; + // for performance, save which entries already have the formula entry + // otherwise opening the dialog with a lot of range names is extremely slow because + // we would calculate all formula strings during opening + std::map<OUString, bool> maCalculatedFormulaEntries; + const ScAddress maPos; + + int m_nId; + + void GetLine(ScRangeNameLine& aLine, weld::TreeIter& rEntry); + void Init(); + void CheckForFormulaString(); + const ScRangeData* findRangeData(const ScRangeNameLine& rLine); + + DECL_LINK(SizeAllocHdl, const Size&, void); + DECL_LINK(VisRowsScrolledHdl, weld::TreeView&, void); + +public: + RangeManagerTable(std::unique_ptr<weld::TreeView>, + const std::map<OUString, std::unique_ptr<ScRangeName>>& rTabRangeNames, + const ScAddress& rPos); + + int n_children() const { return m_xTreeView->n_children(); } + + void addEntry(const ScRangeNameLine& rLine, bool bSetCurEntry); + std::vector<ScRangeNameLine> GetSelectedEntries(); +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx index bf07a076d68d..8cec55594351 100644 --- a/sc/source/ui/inc/namepast.hxx +++ b/sc/source/ui/inc/namepast.hxx @@ -20,10 +20,8 @@ #ifndef INCLUDED_SC_SOURCE_UI_INC_NAMEPAST_HXX #define INCLUDED_SC_SOURCE_UI_INC_NAMEPAST_HXX -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> +#include <vcl/weld.hxx> #include "namemgrtable.hxx" - #include <memory> #include <vector> #include <map> @@ -31,25 +29,23 @@ class ScRangeName; class ScDocShell; -class ScNamePasteDlg : public ModalDialog +class ScNamePasteDlg : public weld::GenericDialogController { - DECL_LINK( ButtonHdl, Button *, void ); + DECL_LINK(ButtonHdl, weld::Button&, void); private: - VclPtr<PushButton> m_pBtnPasteAll; - VclPtr<PushButton> m_pBtnPaste; - VclPtr<PushButton> m_pBtnClose; - - VclPtr<ScRangeManagerTable> mpTable; + std::unique_ptr<weld::Button> m_xBtnPasteAll; + std::unique_ptr<weld::Button> m_xBtnPaste; + std::unique_ptr<weld::Button> m_xBtnClose; + std::unique_ptr<RangeManagerTable> m_xTable; std::vector<OUString> maSelectedNames; std::map<OUString, std::unique_ptr<ScRangeName>> m_RangeMap; public: - ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell ); + ScNamePasteDlg(weld::Window * pParent, ScDocShell* pShell); virtual ~ScNamePasteDlg() override; - virtual void dispose() override; const std::vector<OUString>& GetSelectedNames() const; }; |