Kaydet (Commit) 08da15ca authored tarafından Jakub Trzebiatowski's avatar Jakub Trzebiatowski Kaydeden (comit) Miklos Vajna

tdf#90855 Improve the 'Insert Bookmark' dialog

implemented:
- display page number
- displaying bookmark text
- goto (button and table doubleclick)
- help
- rename
- selecting multiple bookmarks in TableView or in EditField by ";"
- sorting by any column

Change-Id: I7523dc066380bc360bd484c88a6f4ba45e867320
Reviewed-on: https://gerrit.libreoffice.org/23156Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst d1b8dcd5
This diff is collapsed.
...@@ -21,47 +21,68 @@ ...@@ -21,47 +21,68 @@
#include <svx/stddlg.hxx> #include <svx/stddlg.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include <ndtxt.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <svtools/simptabl.hxx>
#include <pam.hxx>
#include "swlbox.hxx" #include "swlbox.hxx"
#include "IMark.hxx"
class SwWrtShell; class SwWrtShell;
class SfxRequest; class SfxRequest;
class BookmarkCombo : public SwComboBox class BookmarkTable : public SvSimpleTable
{ {
sal_Int32 GetFirstSelEntryPos() const; SvTreeListEntry* GetRowByBookmarkName(const OUString& sName);
sal_Int32 GetNextSelEntryPos(sal_Int32 nPos) const;
sal_Int32 GetSelEntryPos(sal_Int32 nPos) const;
virtual bool PreNotify(NotifyEvent& rNEvt) override;
public: public:
BookmarkCombo(vcl::Window* pWin, WinBits nStyle); BookmarkTable(SvSimpleTableContainer& rParent);
void InsertBookmark(sw::mark::IMark* pMark);
sal_Int32 GetSelectEntryCount() const; void SelectByName(const OUString& sName);
sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const; sw::mark::IMark* GetBookmarkByName(const OUString& sName);
OUString GetNameProposal();
static const OUString aForbiddenChars; static const OUString aForbiddenChars;
static const OUString sDefaultBookmarkName;
static const char cSeparator;
}; };
class SwInsertBookmarkDlg: public SvxStandardDialog class SwInsertBookmarkDlg: public SvxStandardDialog
{ {
VclPtr<BookmarkCombo> m_pBookmarkBox; VclPtr<SvSimpleTableContainer> m_pBookmarksContainer;
VclPtr<OKButton> m_pOkBtn; VclPtr<BookmarkTable> m_pBookmarksBox;
VclPtr<PushButton> m_pDeleteBtn; VclPtr<Edit> m_pEditBox;
VclPtr<PushButton> m_pInsertBtn;
OUString sRemoveWarning; VclPtr<PushButton> m_pDeleteBtn;
SwWrtShell &rSh; VclPtr<PushButton> m_pGotoBtn;
SfxRequest& rReq; VclPtr<PushButton> m_pRenameBtn;
OUString sRemoveWarning;
SwWrtShell& rSh;
SfxRequest& rReq;
std::vector<std::pair<sw::mark::IMark*, OUString>> aTableBookmarks;
DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED(ModifyHdl, Edit&, void);
DECL_LINK_TYPED(InsertHdl, Button*, void);
DECL_LINK_TYPED(DeleteHdl, Button*, void); DECL_LINK_TYPED(DeleteHdl, Button*, void);
DECL_LINK_TYPED(RenameHdl, Button*, void);
DECL_LINK_TYPED(GotoHdl, Button*, void);
DECL_LINK_TYPED(SelectionChangedHdl, SvTreeListBox*, void);
DECL_LINK_TYPED(DoubleClickHdl, SvTreeListBox*, bool);
// Fill table with bookmarks
void PopulateTable();
/**
* Check if displayed bookmarks are up-to date, if not update them.
* @return True if no update was needed.
*/
bool ValidateBookmarks();
bool HaveBookmarksChanged();
void GotoSelectedBookmark();
virtual void Apply() override; virtual void Apply() override;
public: public:
SwInsertBookmarkDlg(vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq); SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rSh, SfxRequest& rReq);
virtual ~SwInsertBookmarkDlg(); virtual ~SwInsertBookmarkDlg();
virtual void dispose() override; virtual void dispose() override;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment