summaryrefslogtreecommitdiff
path: root/sw/source/ui/fldui/fldpage.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/fldui/fldpage.cxx')
-rw-r--r--sw/source/ui/fldui/fldpage.cxx38
1 files changed, 38 insertions, 0 deletions
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 1cc166356c24..8c961cd6fe30 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -57,6 +57,21 @@ SwFieldPage::SwFieldPage(vcl::Window *pParent, const OString& rID,
{
}
+SwFieldPage::SwFieldPage(TabPageParent pParent, const OUString& rUIXMLDescription,
+ const OString& rID, const SfxItemSet *pAttrSet)
+ : SfxTabPage(pParent, rUIXMLDescription, rID, pAttrSet)
+ , m_pCurField(nullptr)
+ , m_pWrtShell(nullptr)
+ , m_nTypeSel(LISTBOX_ENTRY_NOTFOUND)
+ , m_nSelectionSel(LISTBOX_ENTRY_NOTFOUND)
+ , m_bFieldEdit(false)
+ , m_bInsert(true)
+ , m_bFieldDlgHtmlMode(false)
+ , m_bRefresh(false)
+ , m_bFirstHTMLInit(true)
+{
+}
+
SwFieldPage::~SwFieldPage()
{
}
@@ -291,6 +306,16 @@ void SwFieldPage::SavePos( const ListBox* pLst1 )
m_aLstStrArr[ 2 ].clear();
}
+void SwFieldPage::SavePos( const weld::TreeView& rLst1 )
+{
+ if (rLst1.n_children())
+ m_aLstStrArr[ 0 ] = rLst1.get_selected_text();
+ else
+ m_aLstStrArr[ 0 ].clear();
+ m_aLstStrArr[ 1 ].clear();
+ m_aLstStrArr[ 2 ].clear();
+}
+
void SwFieldPage::RestorePos(ListBox* pLst1)
{
sal_Int32 nPos = 0;
@@ -300,6 +325,14 @@ void SwFieldPage::RestorePos(ListBox* pLst1)
pLst1->SelectEntryPos( nPos );
}
+void SwFieldPage::RestorePos(weld::TreeView& rLst1)
+{
+ sal_Int32 nPos = 0;
+ if (rLst1.n_children() && !m_aLstStrArr[ 0 ].isEmpty() &&
+ -1 != ( nPos = rLst1.find_text(m_aLstStrArr[ 0 ] ) ) )
+ rLst1.select( nPos );
+}
+
// Insert new fields
IMPL_LINK( SwFieldPage, TreeListBoxInsertHdl, SvTreeListBox*, pBtn, bool )
{
@@ -312,6 +345,11 @@ IMPL_LINK( SwFieldPage, ListBoxInsertHdl, ListBox&, rBox, void )
InsertHdl(&rBox);
}
+IMPL_LINK( SwFieldPage, TreeViewInsertHdl, weld::TreeView&, rBox, void )
+{
+ InsertHdl(&rBox);
+}
+
void SwFieldPage::InsertHdl(void* pBtn)
{
SwFieldDlg *pDlg = static_cast<SwFieldDlg*>(GetTabDialog());