diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-21 08:54:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-21 10:35:18 +0100 |
commit | c5d4d41dff2f8c810fd000284a1aec8eabfdb4a7 (patch) | |
tree | d7e9640bf1c4e650effea21d3c33d8494c1378a7 | |
parent | 45cb92953bde8df8369101637225469bd1883758 (diff) |
convert field ref page to .ui
Change-Id: I49b4ee1dd058ac4d2451ff8cfe8f801cee0ba5fa
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 3 | ||||
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/source/ui/fldui/FldRefTreeListBox.cxx | 14 | ||||
-rw-r--r-- | sw/source/ui/fldui/FldRefTreeListBox.hxx | 5 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddinf.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddok.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldfunc.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldref.cxx | 369 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldref.hxx | 30 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldref.src | 144 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldtdlg.hrc | 24 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/fldrefpage.ui | 325 |
14 files changed, 563 insertions, 372 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 864bdca4e9bc..4ba8b0cda374 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -365,6 +365,9 @@ <glade-widget-class title="Tab List" name="svtlo-SvTabListBox" generic-name="Tab List" parent="svtlo-SvTreeListBox" icon-name="widget-gtk-treeview"/> + <glade-widget-class title="Tooltip Tree List" name="swuilo-SwFldRefTreeListBox" + generic-name="Tooltip Tree List" parent="svtlo-SvTreeListBox" + icon-name="widget-gtk-treeview"/> <glade-widget-class title="Checked Tree List" name="svxlo-SvxCheckListBox" generic-name="Checked Tree List" parent="GtkTreeView" icon-name="widget-gtk-treeview"/> diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 633ae43556d2..aa162806b551 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -102,7 +102,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/envelp/labfmt.src \ sw/source/ui/envelp/mailmrge.src \ sw/source/ui/fldui/flddb.src \ - sw/source/ui/fldui/fldref.src \ sw/source/ui/fldui/fldtdlg.src \ sw/source/ui/fldui/fldui.src \ sw/source/ui/fldui/fldvar.src \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 9389f3a7e9c9..fe4edbda93a3 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -93,6 +93,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/flddocinfopage \ sw/uiconfig/swriter/ui/flddocumentpage \ sw/uiconfig/swriter/ui/fldfuncpage \ + sw/uiconfig/swriter/ui/fldrefpage \ sw/uiconfig/swriter/ui/formatsectiondialog \ sw/uiconfig/swriter/ui/formattablepage \ sw/uiconfig/swriter/ui/footendnotedialog \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 168da9af8829..91ab2504edc6 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -136,7 +136,6 @@ #define HID_MULTI_TOX_DLG "SW_HID_MULTI_TOX_DLG" #define HID_GLBLTREE_EDIT_LINK "SW_HID_GLBLTREE_EDIT_LINK" #define HID_FORMAT_NAME_OBJECT_NAME "SW_HID_FORMAT_NAME_OBJECT_NAME" -#define HID_REFSELECTION_TOOLTIP "SW_HID_REFSELECTION_TOOLTIP" // #i83479# // TabPage Help-IDs diff --git a/sw/source/ui/fldui/FldRefTreeListBox.cxx b/sw/source/ui/fldui/FldRefTreeListBox.cxx index 3b120faaa761..f96131f3c46a 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.cxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.cxx @@ -21,17 +21,21 @@ #include <FldRefTreeListBox.hxx> #include <helpid.h> +#include <vcl/builder.hxx> #include <vcl/help.hxx> -SwFldRefTreeListBox::SwFldRefTreeListBox( Window* pParent, - const ResId& rResId) - : SvTreeListBox( pParent, rResId ) +SwFldRefTreeListBox::SwFldRefTreeListBox(Window* pParent, WinBits nStyle) + : SvTreeListBox(pParent, nStyle) { - SetHelpId( HID_REFSELECTION_TOOLTIP ); } -SwFldRefTreeListBox::~SwFldRefTreeListBox() +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwFldRefTreeListBox(Window *pParent, VclBuilder::stringmap &rMap) { + WinBits nWinStyle = WB_TABSTOP; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + return new SwFldRefTreeListBox(pParent, nWinStyle); } void SwFldRefTreeListBox::RequestHelp( const HelpEvent& rHEvt ) diff --git a/sw/source/ui/fldui/FldRefTreeListBox.hxx b/sw/source/ui/fldui/FldRefTreeListBox.hxx index b924f87c9dfb..7cb80be1c6ba 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.hxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.hxx @@ -27,10 +27,7 @@ protected: virtual void RequestHelp( const HelpEvent& rHEvt ); public: - SwFldRefTreeListBox(Window* pParent, const ResId& rResId); - virtual ~SwFldRefTreeListBox(); - -// virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* ); + SwFldRefTreeListBox(Window* pParent, WinBits nStyle); }; #endif diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index a5e7e62b36cf..3eb33c5c41f3 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -65,6 +65,11 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pParent, const SfxItemSet& rCoreSet) m_pSelectionLB->set_height_request(nHeight); m_pFormatLB->set_height_request(nHeight); + long nWidth = m_pTypeTLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width(); + m_pTypeTLB->set_width_request(nWidth); + m_pFormatLB->set_width_request(nWidth); + m_pSelectionLB->set_width_request(nWidth); + m_pTypeTLB->SetSelectionMode(SINGLE_SELECTION); m_pTypeTLB->SetStyle(m_pTypeTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); m_pTypeTLB->SetIndent(10); diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index c0bceb808bb6..3b39d4aef8c8 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -61,6 +61,11 @@ SwFldDokPage::SwFldDokPage(Window* pParent, const SfxItemSet& rCoreSet ) m_pSelectionLB->set_height_request(nHeight); m_pFormatLB->set_height_request(nHeight); + long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width(); + m_pTypeLB->set_width_request(nWidth); + m_pSelectionLB->set_width_request(nWidth); + m_pFormatLB->set_width_request(nWidth); + m_pSelectionLB->SetDoubleClickHdl(LINK(this, SwFldDokPage, InsertHdl)); m_pFormatLB->SetDoubleClickHdl(LINK(this, SwFldDokPage, InsertHdl)); m_pNumFormatLB->SetDoubleClickHdl(LINK(this, SwFldDokPage, NumFormatHdl)); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 713ad42c05d6..455f1df6dfe3 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -73,6 +73,14 @@ SwFldFuncPage::SwFldFuncPage(Window* pParent, const SfxItemSet& rCoreSet) get(m_pListNameFT, "listnameft"); get(m_pListNameED, "listname"); + long nHeight = m_pTypeLB->GetTextHeight() * 20; + m_pTypeLB->set_height_request(nHeight); + m_pFormatLB->set_height_request(nHeight); + + long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width(); + m_pTypeLB->set_width_request(nWidth); + m_pFormatLB->set_width_request(nWidth); + m_pNameED->SetModifyHdl(LINK(this, SwFldFuncPage, ModifyHdl)); m_sOldValueFT = m_pValueFT->GetText(); diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 1f9d3549ad07..8ed6ae3cd549 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -49,49 +49,62 @@ sal_uInt16 nFldDlgFmtSel = 0; #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 -SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) : - SwFldPage( pParent, SW_RES( TP_FLD_REF ), rCoreSet ), - - aTypeFT (this, SW_RES(FT_REFTYPE)), - aTypeLB (this, SW_RES(LB_REFTYPE)), - aSelectionFT (this, SW_RES(FT_REFSELECTION)), - aSelectionLB (this, SW_RES(LB_REFSELECTION)), +SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) + : SwFldPage(pParent, "FldRefPage", + "modules/swriter/ui/fldrefpage.ui", rCoreSet) + , maOutlineNodes() + , maNumItems() + , mpSavedSelectedTxtNode(0) + , mnSavedSelectedPos(0) +{ + get(m_pTypeLB, "type"); + get(m_pSelection, "selectframe"); + get(m_pSelectionLB, "select"); + m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() | WB_SORT); // #i83479# - aSelectionToolTipLB( this, SW_RES(LB_REFSELECTION_TOOLTIP) ), - aFormatFT (this, SW_RES(FT_REFFORMAT)), - aFormatLB (this, SW_RES(LB_REFFORMAT)), - aNameFT (this, SW_RES(FT_REFNAME)), - aNameED (this, SW_RES(ED_REFNAME)), - aValueFT (this, SW_RES(FT_REFVALUE)), - aValueED (this, SW_RES(ED_REFVALUE)), - - sBookmarkTxt (SW_RES(STR_REFBOOKMARK)), - sFootnoteTxt (SW_RES(STR_REFFOOTNOTE)), - sEndnoteTxt (SW_RES(STR_REFENDNOTE)), + get(m_pSelectionToolTipLB, "selecttip"); + get(m_pFormat, "formatframe"); + get(m_pFormatLB, "format"); + get(m_pNameFT, "nameft"); + get(m_pNameED, "name"); + get(m_pValueED, "value"); + + sBookmarkTxt = m_pTypeLB->GetEntry(0); + sFootnoteTxt = m_pTypeLB->GetEntry(1); + sEndnoteTxt = m_pTypeLB->GetEntry(2); // #i83479# - sHeadingTxt (SW_RES(STR_REFHEADING)), - sNumItemTxt (SW_RES(STR_REFNUMITEM)), - maOutlineNodes(), - maNumItems(), - mpSavedSelectedTxtNode( 0 ), - mnSavedSelectedPos( 0 ) -{ - FreeResource(); + sHeadingTxt = m_pTypeLB->GetEntry(3); + sNumItemTxt = m_pTypeLB->GetEntry(4); + m_pTypeLB->Clear(); + + long nHeight = m_pTypeLB->GetTextHeight() * 20; + m_pSelection->set_height_request(nHeight); + m_pSelectionToolTipLB->set_height_request(nHeight); + + nHeight = m_pTypeLB->GetTextHeight() * 8; + m_pTypeLB->set_height_request(nHeight); + m_pFormatLB->set_height_request(nHeight); + + long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width(); + m_pTypeLB->set_width_request(nWidth); + m_pFormatLB->set_width_request(nWidth); + m_pSelection->set_width_request(nWidth*2); + m_pSelectionToolTipLB->set_width_request(nWidth*2); - aNameED.SetModifyHdl(LINK(this, SwFldRefPage, ModifyHdl)); + m_pNameED->SetModifyHdl(LINK(this, SwFldRefPage, ModifyHdl)); - aTypeLB.SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl)); - aTypeLB.SetSelectHdl (LINK(this, SwFldRefPage, TypeHdl)); - aSelectionLB.SetSelectHdl (LINK(this, SwFldRefPage, SubTypeHdl)); - aSelectionLB.SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl)); - aFormatLB.SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl)); + m_pTypeLB->SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl)); + m_pTypeLB->SetSelectHdl (LINK(this, SwFldRefPage, TypeHdl)); + m_pSelectionLB->SetSelectHdl (LINK(this, SwFldRefPage, SubTypeHdl)); + m_pSelectionLB->SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl)); + m_pFormatLB->SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl)); // #i83479# - aSelectionToolTipLB.SetSelectHdl( LINK(this, SwFldRefPage, SubTypeHdl) ); - aSelectionToolTipLB.SetDoubleClickHdl( LINK(this, SwFldRefPage, InsertHdl) ); - aSelectionToolTipLB.SetStyle( aSelectionToolTipLB.GetStyle() | WB_HSCROLL ); - aSelectionToolTipLB.SetSpaceBetweenEntries(1); - aSelectionToolTipLB.SetHighlightRange(); + m_pSelectionToolTipLB->SetSelectHdl( LINK(this, SwFldRefPage, SubTypeHdl) ); + m_pSelectionToolTipLB->SetDoubleClickHdl( LINK(this, SwFldRefPage, InsertHdl) ); + m_pSelectionToolTipLB->SetStyle( m_pSelectionToolTipLB->GetStyle() | WB_HSCROLL ); + m_pSelectionToolTipLB->SetSpaceBetweenEntries(1); + m_pSelectionToolTipLB->SetHighlightRange(); } SwFldRefPage::~SwFldRefPage() @@ -103,12 +116,12 @@ void SwFldRefPage::SaveSelectedTxtNode() { mpSavedSelectedTxtNode = 0; mnSavedSelectedPos = 0; - if ( aSelectionToolTipLB.IsVisible() ) + if ( m_pSelectionToolTipLB->IsVisible() ) { - SvTreeListEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); + SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry(); if ( pEntry ) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); if ( nTypeId == REFFLDFLAG_HEADING ) { @@ -145,7 +158,7 @@ void SwFldRefPage::Reset(const SfxItemSet& ) { if (!IsFldEdit()) { - SavePos(&aTypeLB); + SavePos(m_pTypeLB); // #i83479# SaveSelectedTxtNode(); } @@ -154,8 +167,8 @@ void SwFldRefPage::Reset(const SfxItemSet& ) Init(); // general initialisation // initialise TypeListBox - aTypeLB.SetUpdateMode(sal_False); - aTypeLB.Clear(); + m_pTypeLB->SetUpdateMode(sal_False); + m_pTypeLB->Clear(); // fill Type-Listbox @@ -169,17 +182,17 @@ void SwFldRefPage::Reset(const SfxItemSet& ) if (!IsFldEdit() || nTypeId != TYP_SETREFFLD) { - nPos = aTypeLB.InsertEntry(GetFldMgr().GetTypeStr(i), i - rRg.nStart); - aTypeLB.SetEntryData(nPos, reinterpret_cast<void*>(nTypeId)); + nPos = m_pTypeLB->InsertEntry(GetFldMgr().GetTypeStr(i), i - rRg.nStart); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(nTypeId)); } } // #i83479# // entries for headings and numbered items - nPos = aTypeLB.InsertEntry(sHeadingTxt); - aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_HEADING); - nPos = aTypeLB.InsertEntry(sNumItemTxt); - aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_NUMITEM); + nPos = m_pTypeLB->InsertEntry(sHeadingTxt); + m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_HEADING); + nPos = m_pTypeLB->InsertEntry(sNumItemTxt); + m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_NUMITEM); // fill up with the sequence types SwWrtShell *pSh = GetWrtShell(); @@ -194,34 +207,34 @@ void SwFldRefPage::Reset(const SfxItemSet& ) if ((nsSwGetSetExpType::GSE_SEQ & pType->GetType()) && pType->GetDepends() && pSh->IsUsed(*pType)) { - nPos = aTypeLB.InsertEntry(pType->GetName()); - aTypeLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(REFFLDFLAG | n)); + nPos = m_pTypeLB->InsertEntry(pType->GetName()); + m_pTypeLB->SetEntryData(nPos, (void*)(sal_uIntPtr)(REFFLDFLAG | n)); } } // text marks - now always (because of globaldocuments) - nPos = aTypeLB.InsertEntry(sBookmarkTxt); - aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_BOOKMARK); + nPos = m_pTypeLB->InsertEntry(sBookmarkTxt); + m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_BOOKMARK); // footnotes: if( pSh->HasFtns() ) { - nPos = aTypeLB.InsertEntry(sFootnoteTxt); - aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_FOOTNOTE); + nPos = m_pTypeLB->InsertEntry(sFootnoteTxt); + m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_FOOTNOTE); } // endnotes: if ( pSh->HasFtns(true) ) { - nPos = aTypeLB.InsertEntry(sEndnoteTxt); - aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_ENDNOTE); + nPos = m_pTypeLB->InsertEntry(sEndnoteTxt); + m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_ENDNOTE); } // select old Pos if (!IsFldEdit()) - RestorePos(&aTypeLB); + RestorePos(m_pTypeLB); - aTypeLB.SetUpdateMode(sal_True); + m_pTypeLB->SetUpdateMode(sal_True); nFldDlgFmtSel = 0; @@ -235,10 +248,10 @@ void SwFldRefPage::Reset(const SfxItemSet& ) sal_uInt16 nVal = static_cast< sal_uInt16 >(sVal.ToInt32()); if(nVal != USHRT_MAX) { - for(sal_uInt16 i = 0; i < aTypeLB.GetEntryCount(); i++) - if(nVal == (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(i)) + for(sal_uInt16 i = 0; i < m_pTypeLB->GetEntryCount(); i++) + if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) { - aTypeLB.SelectEntryPos(i); + m_pTypeLB->SelectEntryPos(i); break; } } @@ -248,11 +261,11 @@ void SwFldRefPage::Reset(const SfxItemSet& ) if (IsFldEdit()) { - aTypeLB.SaveValue(); - aSelectionLB.SaveValue(); - aFormatLB.SaveValue(); - aNameED.SaveValue(); - aValueED.SaveValue(); + m_pTypeLB->SaveValue(); + m_pSelectionLB->SaveValue(); + m_pFormatLB->SaveValue(); + m_pNameED->SaveValue(); + m_pValueED->SaveValue(); } } @@ -262,7 +275,7 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) const sal_uInt16 nOld = GetTypeSel(); // current ListBoxPos - SetTypeSel(aTypeLB.GetSelectEntryPos()); + SetTypeSel(m_pTypeLB->GetSelectEntryPos()); if(GetTypeSel() == LISTBOX_ENTRY_NOTFOUND) { @@ -319,44 +332,44 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) break; } - if (aTypeLB.GetEntryPos(sName) == LISTBOX_ENTRY_NOTFOUND) // reference to deleted mark + if (m_pTypeLB->GetEntryPos(sName) == LISTBOX_ENTRY_NOTFOUND) // reference to deleted mark { - sal_uInt16 nPos = aTypeLB.InsertEntry(sName); - aTypeLB.SetEntryData(nPos, reinterpret_cast<void*>(nFlag)); + sal_uInt16 nPos = m_pTypeLB->InsertEntry(sName); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(nFlag)); } - aTypeLB.SelectEntry(sName); - SetTypeSel(aTypeLB.GetSelectEntryPos()); + m_pTypeLB->SelectEntry(sName); + SetTypeSel(m_pTypeLB->GetSelectEntryPos()); } else { SetTypeSel(0); - aTypeLB.SelectEntryPos(0); + m_pTypeLB->SelectEntryPos(0); } } if (nOld != GetTypeSel()) { - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); // fill selection-ListBox UpdateSubType(); sal_Bool bName = sal_False; nFldDlgFmtSel = 0; - if ( ( !IsFldEdit() || aSelectionLB.GetEntryCount() ) && + if ( ( !IsFldEdit() || m_pSelectionLB->GetEntryCount() ) && nOld != LISTBOX_ENTRY_NOTFOUND ) { - aNameED.SetText(aEmptyStr); - aValueED.SetText(aEmptyStr); + m_pNameED->SetText(aEmptyStr); + m_pValueED->SetText(aEmptyStr); } switch (nTypeId) { case TYP_GETREFFLD: - if (REFFLDFLAG & (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(nOld)) + if (REFFLDFLAG & (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(nOld)) // the old one stays - nFldDlgFmtSel = aFormatLB.GetSelectEntryPos(); + nFldDlgFmtSel = m_pFormatLB->GetSelectEntryPos(); bName = sal_True; break; @@ -370,22 +383,21 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) default: if( REFFLDFLAG & nTypeId ) { - sal_uInt16 nOldId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(nOld); + sal_uInt16 nOldId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(nOld); if( nOldId & REFFLDFLAG || nOldId == TYP_GETREFFLD ) // then the old one stays - nFldDlgFmtSel = aFormatLB.GetSelectEntryPos(); + nFldDlgFmtSel = m_pFormatLB->GetSelectEntryPos(); } break; } - aNameED.Enable(bName); - aNameFT.Enable(bName); + m_pNameED->Enable(bName); + m_pNameFT->Enable(bName); // fill Format-Listbox sal_uInt16 nSize = FillFormatLB(nTypeId); - sal_Bool bFormat = nSize != 0; - aFormatLB.Enable(bFormat); - aFormatFT.Enable(bFormat); + bool bFormat = nSize != 0; + m_pFormat->Enable(bFormat); SubTypeHdl(); ModifyHdl(); @@ -396,15 +408,15 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) IMPL_LINK_NOARG(SwFldRefPage, SubTypeHdl) { - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); switch(nTypeId) { case TYP_GETREFFLD: - if (!IsFldEdit() || aSelectionLB.GetSelectEntryCount()) + if (!IsFldEdit() || m_pSelectionLB->GetSelectEntryCount()) { - aNameED.SetText(aSelectionLB.GetSelectEntry()); - ModifyHdl(&aNameED); + m_pNameED->SetText(m_pSelectionLB->GetSelectEntry()); + ModifyHdl(m_pNameED); } break; @@ -415,7 +427,7 @@ IMPL_LINK_NOARG(SwFldRefPage, SubTypeHdl) pSh = ::GetActiveWrtShell(); if(pSh) { - aValueED.SetText(pSh->GetSelTxt()); + m_pValueED->SetText(pSh->GetSelTxt()); } } @@ -424,17 +436,17 @@ IMPL_LINK_NOARG(SwFldRefPage, SubTypeHdl) case REFFLDFLAG_HEADING: case REFFLDFLAG_NUMITEM: { - if ( aSelectionToolTipLB.GetCurEntry() ) + if ( m_pSelectionToolTipLB->GetCurEntry() ) { - aNameED.SetText( aSelectionToolTipLB.GetEntryText( - aSelectionToolTipLB.GetCurEntry() ) ); + m_pNameED->SetText( m_pSelectionToolTipLB->GetEntryText( + m_pSelectionToolTipLB->GetCurEntry() ) ); } } break; default: - if (!IsFldEdit() || aSelectionLB.GetSelectEntryCount()) - aNameED.SetText(aSelectionLB.GetSelectEntry()); + if (!IsFldEdit() || m_pSelectionLB->GetSelectEntryCount()) + m_pNameED->SetText(m_pSelectionLB->GetSelectEntry()); break; } @@ -451,33 +463,33 @@ void SwFldRefPage::UpdateSubType() if(!pSh) pSh = ::GetActiveWrtShell(); SwGetRefField* pRefFld = (SwGetRefField*)GetCurField(); - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); String sOldSel; // #i83479# - if ( aSelectionLB.IsVisible() ) + if ( m_pSelectionLB->IsVisible() ) { - const sal_uInt16 nSelectionSel = aSelectionLB.GetSelectEntryPos(); + const sal_uInt16 nSelectionSel = m_pSelectionLB->GetSelectEntryPos(); if (nSelectionSel != LISTBOX_ENTRY_NOTFOUND) { - sOldSel = aSelectionLB.GetEntry(nSelectionSel); + sOldSel = m_pSelectionLB->GetEntry(nSelectionSel); } } if (IsFldEdit() && !sOldSel.Len()) sOldSel = OUString::number( pRefFld->GetSeqNo() + 1 ); - aSelectionLB.SetUpdateMode(sal_False); - aSelectionLB.Clear(); + m_pSelectionLB->SetUpdateMode(sal_False); + m_pSelectionLB->Clear(); // #i83479# - aSelectionToolTipLB.SetUpdateMode(sal_False); - aSelectionToolTipLB.Clear(); + m_pSelectionToolTipLB->SetUpdateMode(sal_False); + m_pSelectionToolTipLB->Clear(); bool bShowSelectionToolTipLB( false ); if( REFFLDFLAG & nTypeId ) { if (nTypeId == REFFLDFLAG_BOOKMARK) // text marks! { - aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_SORT); + m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle()|WB_SORT); // get all text marks IDocumentMarkAccess* const pMarkAccess = pSh->getIDocumentMarkAccess(); for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin(); @@ -486,33 +498,33 @@ void SwFldRefPage::UpdateSubType() { const ::sw::mark::IMark* pBkmk = ppMark->get(); if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk)) - aSelectionLB.InsertEntry( pBkmk->GetName() ); + m_pSelectionLB->InsertEntry( pBkmk->GetName() ); } if (IsFldEdit()) sOldSel = pRefFld->GetSetRefName(); } else if (nTypeId == REFFLDFLAG_FOOTNOTE) { - aSelectionLB.SetStyle(aSelectionLB.GetStyle() & ~WB_SORT); + m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() & ~WB_SORT); SwSeqFldList aArr; sal_uInt16 nCnt = pSh->GetSeqFtnList( aArr ); for( sal_uInt16 n = 0; n < nCnt; ++n ) { - aSelectionLB.InsertEntry( aArr[ n ]->sDlgEntry ); + m_pSelectionLB->InsertEntry( aArr[ n ]->sDlgEntry ); if (IsFldEdit() && pRefFld->GetSeqNo() == aArr[ n ]->nSeqNo) sOldSel = aArr[n]->sDlgEntry; } } else if (nTypeId == REFFLDFLAG_ENDNOTE) { - aSelectionLB.SetStyle(aSelectionLB.GetStyle() & ~WB_SORT); + m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() & ~WB_SORT); SwSeqFldList aArr; sal_uInt16 nCnt = pSh->GetSeqFtnList( aArr, true ); for( sal_uInt16 n = 0; n < nCnt; ++n ) { - aSelectionLB.InsertEntry( aArr[ n ]->sDlgEntry ); + m_pSelectionLB->InsertEntry( aArr[ n ]->sDlgEntry ); if (IsFldEdit() && pRefFld->GetSeqNo() == aArr[ n ]->nSeqNo) sOldSel = aArr[n]->sDlgEntry; } @@ -529,21 +541,21 @@ void SwFldRefPage::UpdateSubType() sal_uInt16 nOutlIdx = 0; for ( nOutlIdx = 0; nOutlIdx < maOutlineNodes.size(); ++nOutlIdx ) { - pEntry = aSelectionToolTipLB.InsertEntry( + pEntry = m_pSelectionToolTipLB->InsertEntry( pIDoc->getOutlineText( nOutlIdx, true, true ) ); pEntry->SetUserData( reinterpret_cast<void*>(nOutlIdx) ); if ( ( IsFldEdit() && pRefFld->GetReferencedTxtNode() == maOutlineNodes[nOutlIdx] ) || GetSavedSelectedTxtNode() == maOutlineNodes[nOutlIdx] ) { - aSelectionToolTipLB.Select( pEntry ); + m_pSelectionToolTipLB->Select( pEntry ); sOldSel.Erase(); bCertainTxtNodeSelected = true; } else if ( !bCertainTxtNodeSelected && GetSavedSelectedPos() == nOutlIdx ) { - aSelectionToolTipLB.Select( pEntry ); + m_pSelectionToolTipLB->Select( pEntry ); sOldSel.Erase(); } } @@ -559,28 +571,28 @@ void SwFldRefPage::UpdateSubType() sal_uInt16 nNumItemIdx = 0; for ( nNumItemIdx = 0; nNumItemIdx < maNumItems.size(); ++nNumItemIdx ) { - pEntry = aSelectionToolTipLB.InsertEntry( + pEntry = m_pSelectionToolTipLB->InsertEntry( pIDoc->getListItemText( *maNumItems[nNumItemIdx], true, true ) ); pEntry->SetUserData( reinterpret_cast<void*>(nNumItemIdx) ); if ( ( IsFldEdit() && pRefFld->GetReferencedTxtNode() == maNumItems[nNumItemIdx]->GetTxtNode() ) || GetSavedSelectedTxtNode() == maNumItems[nNumItemIdx]->GetTxtNode() ) { - aSelectionToolTipLB.Select( pEntry ); + m_pSelectionToolTipLB->Select( pEntry ); sOldSel.Erase(); bCertainTxtNodeSelected = true; } else if ( !bCertainTxtNodeSelected && GetSavedSelectedPos() == nNumItemIdx ) { - aSelectionToolTipLB.Select( pEntry ); + m_pSelectionToolTipLB->Select( pEntry ); sOldSel.Erase(); } } } else { - aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_SORT); + m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle()|WB_SORT); // get the fields to Seq-FieldType: SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType( @@ -595,7 +607,7 @@ void SwFldRefPage::UpdateSubType() sal_uInt16 nCnt = pType->GetSeqFldList( aArr ); for( sal_uInt16 n = 0; n < nCnt; ++n ) { - aSelectionLB.InsertEntry( aArr[ n ]->sDlgEntry ); + m_pSelectionLB->InsertEntry( aArr[ n ]->sDlgEntry ); if (IsFldEdit() && !sOldSel.Len() && aArr[ n ]->nSeqNo == pRefFld->GetSeqNo()) sOldSel = aArr[ n ]->sDlgEntry; @@ -611,51 +623,49 @@ void SwFldRefPage::UpdateSubType() std::vector<OUString> aLst; GetFldMgr().GetSubTypes(nTypeId, aLst); for(size_t i = 0; i < aLst.size(); ++i) - aSelectionLB.InsertEntry(aLst[i]); + m_pSelectionLB->InsertEntry(aLst[i]); if (IsFldEdit()) sOldSel = pRefFld->GetSetRefName(); } // #i83479# - aSelectionToolTipLB.Show( bShowSelectionToolTipLB ); - aSelectionLB.Show( !bShowSelectionToolTipLB ); + m_pSelectionToolTipLB->Show( bShowSelectionToolTipLB ); + m_pSelectionLB->Show( !bShowSelectionToolTipLB ); if ( bShowSelectionToolTipLB ) { - aSelectionToolTipLB.SetUpdateMode(sal_True); + m_pSelectionToolTipLB->SetUpdateMode(sal_True); - sal_Bool bEnable = aSelectionToolTipLB.GetEntryCount() != 0; - aSelectionToolTipLB.Enable( bEnable ); - aSelectionFT.Enable( bEnable ); + bool bEnable = m_pSelectionToolTipLB->GetEntryCount() != 0; + m_pSelection->Enable( bEnable ); - if ( aSelectionToolTipLB.GetCurEntry() != 0 ) + if ( m_pSelectionToolTipLB->GetCurEntry() != 0 ) { - aSelectionToolTipLB.MakeVisible( aSelectionToolTipLB.GetCurEntry() ); + m_pSelectionToolTipLB->MakeVisible( m_pSelectionToolTipLB->GetCurEntry() ); } - if ( IsFldEdit() && aSelectionToolTipLB.GetCurEntry() == 0 ) + if ( IsFldEdit() && m_pSelectionToolTipLB->GetCurEntry() == 0 ) { - aNameED.SetText(sOldSel); + m_pNameED->SetText(sOldSel); } } else { - aSelectionLB.SetUpdateMode(sal_True); + m_pSelectionLB->SetUpdateMode(sal_True); // enable or disable - sal_Bool bEnable = aSelectionLB.GetEntryCount() != 0; - aSelectionLB.Enable( bEnable ); - aSelectionFT.Enable( bEnable ); + bool bEnable = m_pSelectionLB->GetEntryCount() != 0; + m_pSelection->Enable( bEnable ); if ( bEnable ) { - aSelectionLB.SelectEntry(sOldSel); - if (!aSelectionLB.GetSelectEntryCount() && !IsFldEdit()) - aSelectionLB.SelectEntryPos(0); + m_pSelectionLB->SelectEntry(sOldSel); + if (!m_pSelectionLB->GetSelectEntryCount() && !IsFldEdit()) + m_pSelectionLB->SelectEntryPos(0); } - if (IsFldEdit() && !aSelectionLB.GetSelectEntryCount()) // in case the reference was already deleted... - aNameED.SetText(sOldSel); + if (IsFldEdit() && !m_pSelectionLB->GetSelectEntryCount()) // in case the reference was already deleted... + m_pNameED->SetText(sOldSel); } } @@ -663,12 +673,12 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) { String sOldSel; - sal_uInt16 nFormatSel = aFormatLB.GetSelectEntryPos(); + sal_uInt16 nFormatSel = m_pFormatLB->GetSelectEntryPos(); if (nFormatSel != LISTBOX_ENTRY_NOTFOUND) - sOldSel = aFormatLB.GetEntry(nFormatSel); + sOldSel = m_pFormatLB->GetEntry(nFormatSel); // fill Format-Listbox - aFormatLB.Clear(); + m_pFormatLB->Clear(); // refernce has less that the annotation sal_uInt16 nSize( 0 ); @@ -707,21 +717,21 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) for (sal_uInt16 i = 0; i < nSize; i++) { - sal_uInt16 nPos = aFormatLB.InsertEntry(GetFldMgr().GetFormatStr( nTypeId, i )); - aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, i ))); + sal_uInt16 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, i )); + m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, i ))); } // #i83479# if ( bAddCrossRefFormats ) { sal_uInt16 nFormat = FMT_REF_NUMBER - FMT_REF_BEGIN; - sal_uInt16 nPos = aFormatLB.InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); - aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat ))); + sal_uInt16 nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); + m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat ))); nFormat = FMT_REF_NUMBER_NO_CONTEXT - FMT_REF_BEGIN; - nPos = aFormatLB.InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); - aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat ))); + nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); + m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat ))); nFormat = FMT_REF_NUMBER_FULL_CONTEXT - FMT_REF_BEGIN; - nPos = aFormatLB.InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); - aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat ))); + nPos = m_pFormatLB->InsertEntry(GetFldMgr().GetFormatStr( nTypeId, nFormat )); + m_pFormatLB->SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat ))); nSize += 3; } @@ -729,15 +739,15 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) if (nSize) { if (!IsFldEdit()) - aFormatLB.SelectEntry(sOldSel); + m_pFormatLB->SelectEntry(sOldSel); else - aFormatLB.SelectEntry(SW_RESSTR(FMT_REF_BEGIN + (sal_uInt16)GetCurField()->GetFormat())); + m_pFormatLB->SelectEntry(SW_RESSTR(FMT_REF_BEGIN + (sal_uInt16)GetCurField()->GetFormat())); - if (!aFormatLB.GetSelectEntryCount()) + if (!m_pFormatLB->GetSelectEntryCount()) { - aFormatLB.SelectEntryPos(nFldDlgFmtSel); - if (!aFormatLB.GetSelectEntryCount()) - aFormatLB.SelectEntryPos(0); + m_pFormatLB->SelectEntryPos(nFldDlgFmtSel); + if (!m_pFormatLB->GetSelectEntryCount()) + m_pFormatLB->SelectEntryPos(0); } } @@ -750,11 +760,11 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) IMPL_LINK_NOARG(SwFldRefPage, ModifyHdl) { - String aName(aNameED.GetText()); + String aName(m_pNameED->GetText()); const sal_uInt16 nLen = aName.Len(); sal_Bool bEnable = sal_True; - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); if ((nTypeId == TYP_SETREFFLD && !GetFldMgr().CanInsertRefMark(aName)) || (nLen == 0 && (nTypeId == TYP_GETREFFLD || nTypeId == TYP_SETREFFLD || @@ -763,7 +773,7 @@ IMPL_LINK_NOARG(SwFldRefPage, ModifyHdl) EnableInsert(bEnable); - aSelectionLB.SelectEntry(aName); + m_pSelectionLB->SelectEntry(aName); return 0; } @@ -771,20 +781,20 @@ IMPL_LINK_NOARG(SwFldRefPage, ModifyHdl) sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) { sal_Bool bModified = sal_False; - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); sal_uInt16 nSubType = 0; sal_uLong nFormat; - nFormat = aFormatLB.GetSelectEntryPos(); + nFormat = m_pFormatLB->GetSelectEntryPos(); if(nFormat == LISTBOX_ENTRY_NOTFOUND) nFormat = 0; else - nFormat = (sal_uLong)aFormatLB.GetEntryData((sal_uInt16)nFormat); + nFormat = (sal_uLong)m_pFormatLB->GetEntryData((sal_uInt16)nFormat); - String aVal(aValueED.GetText()); - String aName(aNameED.GetText()); + String aVal(m_pValueED->GetText()); + String aName(m_pNameED->GetText()); switch(nTypeId) { @@ -798,9 +808,8 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) if(!pType) // Only insert when the name doesn't exist yet { - aSelectionLB.InsertEntry(aName); - aSelectionLB.Enable(); - aSelectionFT.Enable(); + m_pSelectionLB->InsertEntry(aName); + m_pSelection->Enable(); } break; } @@ -817,14 +826,14 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) } if (nTypeId == REFFLDFLAG_BOOKMARK) // text marks! { - aName = aNameED.GetText(); + aName = m_pNameED->GetText(); nTypeId = TYP_GETREFFLD; nSubType = REF_BOOKMARK; } else if (REFFLDFLAG_FOOTNOTE == nTypeId) // footnotes { SwSeqFldList aArr; - _SeqFldLstElem aElem( aSelectionLB.GetSelectEntry(), 0 ); + _SeqFldLstElem aElem( m_pSelectionLB->GetSelectEntry(), 0 ); sal_uInt16 nPos; @@ -845,7 +854,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) else if (REFFLDFLAG_ENDNOTE == nTypeId) // endnotes { SwSeqFldList aArr; - _SeqFldLstElem aElem( aSelectionLB.GetSelectEntry(), 0 ); + _SeqFldLstElem aElem( m_pSelectionLB->GetSelectEntry(), 0 ); sal_uInt16 nPos; @@ -866,7 +875,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) // #i83479# else if ( nTypeId == REFFLDFLAG_HEADING ) { - SvTreeListEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); + SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry(); OSL_ENSURE( pEntry, "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" ); if ( pEntry ) @@ -886,7 +895,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) } else if ( nTypeId == REFFLDFLAG_NUMITEM ) { - SvTreeListEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); + SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry(); OSL_ENSURE( pEntry, "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" ); if ( pEntry ) @@ -912,7 +921,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) if( pType ) { SwSeqFldList aArr; - _SeqFldLstElem aElem( aSelectionLB.GetSelectEntry(), 0 ); + _SeqFldLstElem aElem( m_pSelectionLB->GetSelectEntry(), 0 ); sal_uInt16 nPos; @@ -940,11 +949,11 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) } if (!IsFldEdit() || bModified || - aNameED.GetSavedValue() != aNameED.GetText() || - aValueED.GetSavedValue() != aValueED.GetText() || - aTypeLB.GetSavedValue() != aTypeLB.GetSelectEntryPos() || - aSelectionLB.GetSavedValue() != aSelectionLB.GetSelectEntryPos() || - aFormatLB.GetSavedValue() != aFormatLB.GetSelectEntryPos()) + m_pNameED->GetSavedValue() != m_pNameED->GetText() || + m_pValueED->GetSavedValue() != m_pValueED->GetText() || + m_pTypeLB->GetSavedValue() != m_pTypeLB->GetSelectEntryPos() || + m_pSelectionLB->GetSavedValue() != m_pSelectionLB->GetSelectEntryPos() || + m_pFormatLB->GetSavedValue() != m_pFormatLB->GetSelectEntryPos()) { InsertFld( nTypeId, nSubType, aName, aVal, nFormat ); } @@ -969,11 +978,11 @@ void SwFldRefPage::FillUserData() { String sData(OUString(USER_DATA_VERSION)); sData += ';'; - sal_uInt16 nTypeSel = aTypeLB.GetSelectEntryPos(); + sal_uInt16 nTypeSel = m_pTypeLB->GetSelectEntryPos(); if( LISTBOX_ENTRY_NOTFOUND == nTypeSel ) nTypeSel = USHRT_MAX; else - nTypeSel = sal::static_int_cast< sal_uInt16 >(reinterpret_cast< sal_uIntPtr >(aTypeLB.GetEntryData( nTypeSel ))); + nTypeSel = sal::static_int_cast< sal_uInt16 >(reinterpret_cast< sal_uIntPtr >(m_pTypeLB->GetEntryData( nTypeSel ))); sData += OUString::number( nTypeSel ); SetUserData(sData); } diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index a62fb3914a3c..99dbd964d7b2 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -35,24 +35,22 @@ class SwTxtNode; class SwFldRefPage : public SwFldPage { - FixedText aTypeFT; - ListBox aTypeLB; - FixedText aSelectionFT; - ListBox aSelectionLB; + ListBox* m_pTypeLB; + VclContainer* m_pSelection; + ListBox* m_pSelectionLB; // #i83479# - SwFldRefTreeListBox aSelectionToolTipLB; - FixedText aFormatFT; - ListBox aFormatLB; - FixedText aNameFT; - Edit aNameED; - FixedText aValueFT; - Edit aValueED; - const String sBookmarkTxt; - const String sFootnoteTxt; - const String sEndnoteTxt; + SwFldRefTreeListBox* m_pSelectionToolTipLB; + VclContainer* m_pFormat; + ListBox* m_pFormatLB; + FixedText* m_pNameFT; + Edit* m_pNameED; + Edit* m_pValueED; + OUString sBookmarkTxt; + OUString sFootnoteTxt; + OUString sEndnoteTxt; // #i83479# - const String sHeadingTxt; - const String sNumItemTxt; + OUString sHeadingTxt; + OUString sNumItemTxt; IDocumentOutlineNodes::tSortedOutlineNodeList maOutlineNodes; IDocumentListItems::tSortedNodeNumList maNumItems; diff --git a/sw/source/ui/fldui/fldref.src b/sw/source/ui/fldui/fldref.src deleted file mode 100644 index 3771c5bc995b..000000000000 --- a/sw/source/ui/fldui/fldref.src +++ /dev/null @@ -1,144 +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 . - */ - -#include "globals.hrc" -#include "fldtdlg.hrc" -#include "helpid.h" -TabPage TP_FLD_REF -{ - HelpID = HID_FLD_REF ; - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - FixedText FT_REFTYPE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 76 , 8 ) ; - Text [ en-US ] = "~Type" ; - Left = TRUE ; - }; - ListBox LB_REFTYPE - { - HelpID = "sw:ListBox:TP_FLD_REF:LB_REFTYPE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 14 ) ; - Size = MAP_APPFONT ( 76 , 73 ) ; - TabStop = TRUE ; - AutoHScroll = TRUE ; - }; - FixedText FT_REFSELECTION - { - Pos = MAP_APPFONT ( 88 , 3 ) ; - Size = MAP_APPFONT ( 76 , 8 ) ; - Text [ en-US ] = "S~election" ; - Left = TRUE ; - }; - ListBox LB_REFSELECTION - { - HelpID = "sw:ListBox:TP_FLD_REF:LB_REFSELECTION"; - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 14 ) ; - Size = MAP_APPFONT ( 166 , 136 ) ; - TabStop = TRUE ; - Sort = TRUE ; - }; - /* TreeListBox in order to have tool tips - shares window position and size with LB_REFSELECTION */ - Control LB_REFSELECTION_TOOLTIP - { - HelpID = HID_REFSELECTION_TOOLTIP ; - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 14 ) ; - Size = MAP_APPFONT ( 166 , 136 ) ; - TabStop = TRUE ; - }; - FixedText FT_REFFORMAT - { - Pos = MAP_APPFONT ( 6 , 93 ) ; - Size = MAP_APPFONT ( 76 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Insert ~reference to" ; - }; - ListBox LB_REFFORMAT - { - HelpID = "sw:ListBox:TP_FLD_REF:LB_REFFORMAT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 104 ) ; - Size = MAP_APPFONT ( 76 , 75 ) ; - TabStop = TRUE ; - DropDown = FALSE ; - // Sort = TRUE; - }; - FixedText FT_REFNAME - { - Pos = MAP_APPFONT ( 88 , 155 ) ; - Size = MAP_APPFONT ( 80 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "Na~me" ; - }; - Edit ED_REFNAME - { - HelpID = "sw:Edit:TP_FLD_REF:ED_REFNAME"; - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 167 ) ; - Size = MAP_APPFONT ( 80 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - }; - FixedText FT_REFVALUE - { - Pos = MAP_APPFONT ( 174 , 155 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "~Value" ; - Disable = TRUE ; - Left = TRUE ; - }; - Edit ED_REFVALUE - { - HelpID = "sw:Edit:TP_FLD_REF:ED_REFVALUE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 174 , 167 ) ; - Size = MAP_APPFONT ( 80 , 12 ) ; - TabStop = TRUE ; - Disable = TRUE ; - Left = TRUE ; - }; - String STR_REFBOOKMARK - { - Text [ en-US ] = "Bookmarks" ; - }; - String STR_REFFOOTNOTE - { - Text [ en-US ] = "Footnotes" ; - }; - String STR_REFENDNOTE - { - Text [ en-US ] = "Endnotes" ; - }; - String STR_REFHEADING - { - Text [ en-US ] = "Headings" ; - }; - String STR_REFNUMITEM - { - Text [ en-US ] = "Numbered Paragraphs" ; - }; - Text [ en-US ] = "Cross-references" ; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldtdlg.hrc b/sw/source/ui/fldui/fldtdlg.hrc index 0cc653a6afb4..0120acb7cca4 100644 --- a/sw/source/ui/fldui/fldtdlg.hrc +++ b/sw/source/ui/fldui/fldtdlg.hrc @@ -20,6 +20,8 @@ #ifndef _FLDTDLG_HRC #define _FLDTDLG_HRC +#define FIELD_COLUMN_WIDTH 76 + #define RC_FLDTDLG_BEGIN 0 // database field TabPage: @@ -66,27 +68,7 @@ #define BT_VARDELETE (RC_TP_VAR_START + 20) #define RC_TP_VAR_END (RC_TP_VAR_START + 21) -// Reference-TabPage: -#define RC_TP_REF_START (RC_TP_VAR_END) -#define FT_REFTYPE (RC_TP_REF_START + 1) -#define LB_REFTYPE (RC_TP_REF_START + 2) -#define FT_REFSELECTION (RC_TP_REF_START + 3) -#define LB_REFSELECTION (RC_TP_REF_START + 4) -#define LB_REFSELECTION_TOOLTIP (RC_TP_REF_START + 5) -#define LB_REFFORMAT (RC_TP_REF_START + 6) -#define FT_REFFORMAT (RC_TP_REF_START + 7) -#define FT_REFNAME (RC_TP_REF_START + 8) -#define ED_REFNAME (RC_TP_REF_START + 9) -#define FT_REFVALUE (RC_TP_REF_START + 10) -#define ED_REFVALUE (RC_TP_REF_START + 11) -#define STR_REFBOOKMARK (RC_TP_REF_START + 12) -#define STR_REFFOOTNOTE (RC_TP_REF_START + 13) -#define STR_REFENDNOTE (RC_TP_REF_START + 14) -#define STR_REFHEADING (RC_TP_REF_START + 15) -#define STR_REFNUMITEM (RC_TP_REF_START + 16) -#define RC_TP_REF_END (RC_TP_REF_START + 17) - -#define RC_TP_END (RC_TP_REF_END) +#define RC_TP_END (RC_TP_VAR_END) // Strings ------------------------------------------------------------------ diff --git a/sw/uiconfig/swriter/ui/fldrefpage.ui b/sw/uiconfig/swriter/ui/fldrefpage.ui new file mode 100644 index 000000000000..b99ec1a6a625 --- /dev/null +++ b/sw/uiconfig/swriter/ui/fldrefpage.ui @@ -0,0 +1,325 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkBox" id="FldRefPage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="spacing">12</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="column_spacing">12</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkFrame" id="typeframe"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="top_padding">6</property> + <child> + <object class="GtkTreeView" id="type:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="model">liststore1</property> + <property name="search_column">0</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection"/> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Type</property> + <property name="use_underline">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="formatframe"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="top_padding">6</property> + <child> + <object class="GtkTreeView" id="format:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="model">liststore1</property> + <property name="search_column">0</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection2"/> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Insert _reference to</property> + <property name="use_underline">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame" id="selectframe"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="top_padding">6</property> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="swuilo-SwFldRefTreeListBox" id="selecttip:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="Tooltip Tree List-selection"/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkTreeView" id="select:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection4"/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">S_election</property> + <property name="use_underline">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="nameft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Na_me</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">name</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="valueft"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Value</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">value</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="value"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <object class="GtkListStore" id="liststore1"> + <columns> + <!-- column-name gchararray1 --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">Bookmarks</col> + </row> + <row> + <col id="0" translatable="yes">Footnotes</col> + </row> + <row> + <col id="0" translatable="yes">Endnotes</col> + </row> + <row> + <col id="0" translatable="yes">Headings</col> + </row> + <row> + <col id="0" translatable="yes">Numbered Paragraphs</col> + </row> + </data> + </object> + <object class="GtkSizeGroup" id="sizegroup1"> + <property name="mode">both</property> + <property name="ignore_hidden">True</property> + </object> +</interface> |