summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-17 21:37:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-21 22:08:04 +0100
commit47897fdd936d9b6e9ac8cb6110c79352ab080df7 (patch)
treec657b53080caa94590d1e9b1fd4383d6dc795728 /sw
parentcfa76f538a44d4396574ece59e8a3953c22c6eb7 (diff)
weld SwCondCollPage
and put back original SvTreeListBox a11y factory use Change-Id: I4ad8ce29d8fed6ec5d44e9a1d641919a89226b79 Reviewed-on: https://gerrit.libreoffice.org/63501 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/pch/precompiled_swui.hxx8
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx262
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx4
-rw-r--r--sw/source/ui/dbui/addresslistdialog.hxx4
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx2
-rw-r--r--sw/source/ui/inc/mmresultdialogs.hxx4
-rw-r--r--sw/source/ui/misc/bookmark.cxx2
-rw-r--r--sw/source/uibase/inc/glosbib.hxx2
-rw-r--r--sw/source/uibase/inc/swuiccoll.hxx43
-rw-r--r--sw/uiconfig/swriter/ui/conditionpage.ui124
10 files changed, 238 insertions, 217 deletions
diff --git a/sw/inc/pch/precompiled_swui.hxx b/sw/inc/pch/precompiled_swui.hxx
index 0f4f008a07e8..b303c9435318 100644
--- a/sw/inc/pch/precompiled_swui.hxx
+++ b/sw/inc/pch/precompiled_swui.hxx
@@ -584,19 +584,15 @@
#include <svl/urihelper.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
-#include <svtools/AccessibleBrowseBoxObjType.hxx>
#include <svtools/accessibleruler.hxx>
-#include <svtools/accessibletableprovider.hxx>
#include <svtools/colorcfg.hxx>
#include <svtools/ctrlbox.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/embedhlp.hxx>
#include <svtools/framestatuslistener.hxx>
-#include <svtools/headbar.hxx>
#include <svtools/htmlcfg.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/ruler.hxx>
-#include <svtools/svtabbx.hxx>
#include <svtools/svtdllapi.h>
#include <svtools/svtresid.hxx>
#include <svtools/toolboxcontroller.hxx>
@@ -677,6 +673,10 @@
#include <unotools/syslocale.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/unotoolsdllapi.h>
+#include <vcl/AccessibleBrowseBoxObjType.hxx>
+#include <vcl/accessibletableprovider.hxx>
+#include <vcl/headbar.hxx>
+#include <vcl/svtabbx.hxx>
#include <vcl/transfer.hxx>
#include <vcl/treelist.hxx>
#include <vcl/treelistbox.hxx>
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index 59c00d5622c1..66ba6f6d2f97 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -44,57 +44,46 @@ const sal_uInt16 SwCondCollPage::m_aPageRg[] = {
0
};
-// Warning! This table is indicated directly in code (0, 1, ...)
-static long nTabs[] =
- {
- 0, 100
- };
-
-SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet)
- : SfxTabPage(pParent, "ConditionPage",
- "modules/swriter/ui/conditionpage.ui", &rSet)
- ,
- m_rSh(::GetActiveView()->GetWrtShell()),
- m_pCmds( SwCondCollItem::GetCmds() ),
- m_pFormat(nullptr),
-
- m_bNewTemplate(false)
+SwCondCollPage::SwCondCollPage(TabPageParent pParent, const SfxItemSet &rSet)
+ : SfxTabPage(pParent, "modules/swriter/ui/conditionpage.ui", "ConditionPage", &rSet)
+ , m_rSh(::GetActiveView()->GetWrtShell())
+ , m_pCmds(SwCondCollItem::GetCmds())
+ , m_pFormat(nullptr)
+ , m_bNewTemplate(false)
+ , m_xConditionCB(m_xBuilder->weld_check_button("condstyle"))
+ , m_xContextFT(m_xBuilder->weld_label("contextft"))
+ , m_xUsedFT(m_xBuilder->weld_label("usedft"))
+ , m_xTbLinks(m_xBuilder->weld_tree_view("links"))
+ , m_xStyleFT(m_xBuilder->weld_label("styleft"))
+ , m_xStyleLB(m_xBuilder->weld_tree_view("styles"))
+ , m_xFilterLB(m_xBuilder->weld_combo_box("filter"))
+ , m_xRemovePB(m_xBuilder->weld_button("remove"))
+ , m_xAssignPB(m_xBuilder->weld_button("apply"))
{
- get(m_pConditionCB, "condstyle");
- get(m_pContextFT, "contextft");
- get(m_pUsedFT, "usedft");
- get(m_pStyleFT, "styleft");
- get(m_pTbLinks, "links");
- get(m_pStyleLB, "styles");
- m_pStyleLB->SetStyle(m_pStyleLB->GetStyle() | WB_SORT);
- m_pStyleLB->SetDropDownLineCount(12);
- m_pTbLinks->set_height_request(m_pStyleLB->GetOptimalSize().Height());
- get(m_pFilterLB, "filter");
- get(m_pRemovePB, "remove");
- get(m_pAssignPB, "apply");
-
- const sal_Int32 nStrCount = m_pFilterLB->GetEntryCount();
+ m_xStyleLB->make_sorted();
+ const auto nHeightRequest = m_xStyleLB->get_height_rows(12);
+ m_xStyleLB->set_size_request(-1, nHeightRequest);
+ m_xTbLinks->set_size_request(-1, nHeightRequest);
+ std::vector<int> aWidths;
+ aWidths.push_back(m_xTbLinks->get_approximate_digit_width() * 40);
+ m_xTbLinks->set_column_fixed_widths(aWidths);
+
+ const sal_Int32 nStrCount = m_xFilterLB->get_count();
for (sal_Int32 i = 0; i < nStrCount; ++i)
- m_aStrArr.push_back(m_pFilterLB->GetEntry(i));
- m_pFilterLB->Clear();
+ m_aStrArr.push_back(m_xFilterLB->get_text(i));
+ m_xFilterLB->clear();
SetExchangeSupport();
// Install handlers
- m_pConditionCB->SetClickHdl( LINK(this, SwCondCollPage, OnOffHdl));
- m_pTbLinks->SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveTreeListBoxHdl ));
- m_pStyleLB->SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveHdl ));
- m_pRemovePB->SetClickHdl( LINK(this, SwCondCollPage, AssignRemoveClickHdl ));
- m_pAssignPB->SetClickHdl( LINK(this, SwCondCollPage, AssignRemoveClickHdl ));
- m_pTbLinks->SetSelectHdl( LINK(this, SwCondCollPage, SelectTreeListBoxHdl));
- m_pStyleLB->SetSelectHdl( LINK(this, SwCondCollPage, SelectListBoxHdl));
- m_pFilterLB->SetSelectHdl( LINK(this, SwCondCollPage, SelectListBoxHdl));
-
- m_pTbLinks->SetStyle(m_pTbLinks->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
- m_pTbLinks->SetSelectionMode( SelectionMode::Single );
- m_pTbLinks->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
- m_pTbLinks->Resize(); // OS: Hack for the right selection
- m_pTbLinks->SetSpaceBetweenEntries( 0 );
+ m_xConditionCB->connect_toggled(LINK(this, SwCondCollPage, OnOffHdl));
+ m_xTbLinks->connect_row_activated(LINK(this, SwCondCollPage, AssignRemoveTreeListBoxHdl));
+ m_xStyleLB->connect_row_activated(LINK(this, SwCondCollPage, AssignRemoveTreeListBoxHdl));
+ m_xRemovePB->connect_clicked(LINK(this, SwCondCollPage, AssignRemoveClickHdl));
+ m_xAssignPB->connect_clicked(LINK(this, SwCondCollPage, AssignRemoveClickHdl));
+ m_xTbLinks->connect_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl));
+ m_xStyleLB->connect_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl));
+ m_xFilterLB->connect_changed(LINK(this, SwCondCollPage, SelectListBoxHdl));
std::unique_ptr<SfxStyleFamilies> xFamilies(SW_MOD()->CreateStyleFamilies());
size_t nCount = xFamilies->size();
@@ -105,18 +94,13 @@ SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet)
{
const SfxStyleFilter& rFilterList = rFamilyItem.GetFilterList();
for (size_t i = 0; i < rFilterList.size(); ++i)
- {
- m_pFilterLB->InsertEntry(rFilterList[i].aName);
- m_pFilterLB->SetEntryData(i, reinterpret_cast<void*>(sal_uInt16(rFilterList[i].nFlags)));
- }
+ m_xFilterLB->append(OUString::number(int(rFilterList[i].nFlags)), rFilterList[i].aName);
break;
}
}
- m_pFilterLB->SelectEntryPos(1);
-
- m_pTbLinks->Show();
-
+ m_xFilterLB->set_active(1);
+ m_xTbLinks->show();
}
SwCondCollPage::~SwCondCollPage()
@@ -124,21 +108,6 @@ SwCondCollPage::~SwCondCollPage()
disposeOnce();
}
-void SwCondCollPage::dispose()
-{
- m_pConditionCB.clear();
- m_pContextFT.clear();
- m_pUsedFT.clear();
- m_pTbLinks.clear();
- m_pStyleFT.clear();
- m_pStyleLB.clear();
- m_pFilterLB.clear();
- m_pRemovePB.clear();
- m_pAssignPB.clear();
-
- SfxTabPage::dispose();
-}
-
DeactivateRC SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
{
if( _pSet )
@@ -149,7 +118,7 @@ DeactivateRC SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
VclPtr<SfxTabPage> SwCondCollPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
- return VclPtr<SwCondCollPage>::Create(pParent.pParent, *rSet);
+ return VclPtr<SwCondCollPage>::Create(pParent, *rSet);
}
bool SwCondCollPage::FillItemSet(SfxItemSet *rSet)
@@ -157,7 +126,7 @@ bool SwCondCollPage::FillItemSet(SfxItemSet *rSet)
SwCondCollItem aCondItem;
for (size_t i = 0; i < m_aStrArr.size(); ++i)
{
- const OUString sEntry = m_pTbLinks->GetEntryText(i, 1);
+ const OUString sEntry = m_xTbLinks->get_text(i, 1);
aCondItem.SetStyle( &sEntry, i);
}
rSet->Put(aCondItem);
@@ -166,29 +135,29 @@ bool SwCondCollPage::FillItemSet(SfxItemSet *rSet)
void SwCondCollPage::Reset(const SfxItemSet *)
{
- if(m_bNewTemplate)
- m_pConditionCB->Enable();
- if(RES_CONDTXTFMTCOLL == m_pFormat->Which())
- m_pConditionCB->Check();
- OnOffHdl(m_pConditionCB);
+ if (m_bNewTemplate)
+ m_xConditionCB->set_sensitive(true);
+ if (RES_CONDTXTFMTCOLL == m_pFormat->Which())
+ m_xConditionCB->set_active(true);
+ OnOffHdl(*m_xConditionCB);
- m_pTbLinks->Clear();
+ m_xTbLinks->clear();
SfxStyleSheetBasePool* pPool = m_rSh.GetView().GetDocShell()->GetStyleSheetPool();
pPool->SetSearchMask(SfxStyleFamily::Para);
- m_pStyleLB->Clear();
+ m_xStyleLB->clear();
const SfxStyleSheetBase* pBase = pPool->First();
- while( pBase )
+ while (pBase)
{
- if(!m_pFormat || pBase->GetName() != m_pFormat->GetName())
- m_pStyleLB->InsertEntry(pBase->GetName());
+ if (!m_pFormat || pBase->GetName() != m_pFormat->GetName())
+ m_xStyleLB->append_text(pBase->GetName());
pBase = pPool->Next();
}
- m_pStyleLB->SelectEntryPos(0);
+ m_xStyleLB->select(0);
for (size_t n = 0; n < m_aStrArr.size(); ++n)
{
- OUString aEntry( m_aStrArr[n] + "\t" );
+ m_xTbLinks->append_text(m_aStrArr[n]);
const SwCollCondition* pCond = nullptr;
if( m_pFormat && RES_CONDTXTFMTCOLL == m_pFormat->Which() &&
@@ -196,115 +165,106 @@ void SwCondCollPage::Reset(const SfxItemSet *)
HasCondition( SwCollCondition( nullptr, m_pCmds[n].nCnd, m_pCmds[n].nSubCond ) ) )
&& pCond->GetTextFormatColl() )
{
- aEntry += pCond->GetTextFormatColl()->GetName();
+ m_xTbLinks->set_text(n, pCond->GetTextFormatColl()->GetName(), 1);
}
- SvTreeListEntry* pE = m_pTbLinks->InsertEntryToColumn( aEntry, n );
- if(0 == n)
- m_pTbLinks->Select(pE);
+ if (0 == n)
+ {
+ m_xTbLinks->select(0);
+ SelectTreeListBoxHdl(*m_xTbLinks);
+ }
}
-
}
-IMPL_LINK( SwCondCollPage, OnOffHdl, Button*, pBox, void )
+IMPL_LINK(SwCondCollPage, OnOffHdl, weld::ToggleButton&, rBox, void)
{
- const bool bEnable = static_cast<CheckBox*>(pBox)->IsChecked();
- m_pContextFT->Enable( bEnable );
- m_pUsedFT->Enable( bEnable );
- m_pTbLinks->EnableList( bEnable );
- m_pStyleFT->Enable( bEnable );
- m_pStyleLB->Enable( bEnable );
- m_pFilterLB->Enable( bEnable );
- m_pRemovePB->Enable( bEnable );
- m_pAssignPB->Enable( bEnable );
- if( bEnable )
+ const bool bEnable = rBox.get_active();
+ m_xContextFT->set_sensitive(bEnable);
+ m_xUsedFT->set_sensitive(bEnable);
+ m_xTbLinks->set_sensitive(bEnable);
+ m_xStyleFT->set_sensitive(bEnable);
+ m_xStyleLB->set_sensitive(bEnable);
+ m_xFilterLB->set_sensitive(bEnable);
+ m_xRemovePB->set_sensitive(bEnable);
+ m_xAssignPB->set_sensitive(bEnable);
+ if (bEnable)
SelectHdl(nullptr);
}
-IMPL_LINK( SwCondCollPage, AssignRemoveClickHdl, Button*, pBtn, void)
+IMPL_LINK(SwCondCollPage, AssignRemoveClickHdl, weld::Button&, rBtn, void)
{
- AssignRemove(pBtn);
+ AssignRemove(&rBtn);
}
-IMPL_LINK( SwCondCollPage, AssignRemoveTreeListBoxHdl, SvTreeListBox*, pBtn, bool)
-{
- AssignRemove(pBtn);
- return true; // signal more to be done
-}
-IMPL_LINK( SwCondCollPage, AssignRemoveHdl, ListBox&, rBox, void)
+
+IMPL_LINK(SwCondCollPage, AssignRemoveTreeListBoxHdl, weld::TreeView&, rBtn, void)
{
- AssignRemove(&rBox);
+ AssignRemove(&rBtn);
}
-void SwCondCollPage::AssignRemove(void const * pBtn)
+
+void SwCondCollPage::AssignRemove(const weld::Widget* pBtn)
{
- SvTreeListEntry* pE = m_pTbLinks->FirstSelected();
- if (!pE)
- {
- OSL_ENSURE(false, "where's the empty entry from?");
- return;
- }
- sal_uLong const nPos(m_pTbLinks->GetModel()->GetAbsPos(pE));
- if (LISTBOX_ENTRY_NOTFOUND == nPos)
+ int nPos = m_xTbLinks->get_selected_index();
+ if (nPos == -1)
{
return;
}
- OUString sSel = m_aStrArr[nPos] + "\t";
-
- const bool bAssEnabled = pBtn != m_pRemovePB && m_pAssignPB->IsEnabled();
- m_pAssignPB->Enable( !bAssEnabled );
- m_pRemovePB->Enable( bAssEnabled );
- if ( bAssEnabled )
- sSel += m_pStyleLB->GetSelectedEntry();
-
- m_pTbLinks->SetUpdateMode(false);
- m_pTbLinks->GetModel()->Remove(pE);
- pE = m_pTbLinks->InsertEntryToColumn(sSel, nPos);
- m_pTbLinks->Select(pE);
- m_pTbLinks->MakeVisible(pE);
- m_pTbLinks->SetUpdateMode(true);
+ const bool bAssEnabled = pBtn != m_xRemovePB.get() && m_xAssignPB->get_sensitive();
+ m_xAssignPB->set_sensitive(!bAssEnabled);
+ m_xRemovePB->set_sensitive(bAssEnabled);
+ if (bAssEnabled)
+ m_xTbLinks->set_text(nPos, m_xStyleLB->get_selected_text(), 1);
+ else
+ m_xTbLinks->set_text(nPos, "", 1);
}
-IMPL_LINK( SwCondCollPage, SelectTreeListBoxHdl, SvTreeListBox*, pBox, void)
+IMPL_LINK(SwCondCollPage, SelectTreeListBoxHdl, weld::TreeView&, rBox, void)
{
- SelectHdl(pBox);
+ SelectHdl(&rBox);
}
-IMPL_LINK( SwCondCollPage, SelectListBoxHdl, ListBox&, rBox, void)
+
+IMPL_LINK(SwCondCollPage, SelectListBoxHdl, weld::ComboBox&, rBox, void)
{
SelectHdl(&rBox);
}
-void SwCondCollPage::SelectHdl(void const * pBox)
+
+void SwCondCollPage::SelectHdl(const weld::Widget* pBox)
{
- if (pBox == m_pFilterLB)
+ if (pBox == m_xFilterLB.get())
{
- m_pStyleLB->Clear();
- const sal_Int32 nSelPos = static_cast<ListBox const *>(pBox)->GetSelectedEntryPos();
- const SfxStyleSearchBits nSearchFlags = static_cast<SfxStyleSearchBits>(reinterpret_cast<sal_IntPtr>(m_pFilterLB->GetEntryData(nSelPos)));
+ m_xStyleLB->clear();
+ const sal_Int32 nSelPos = m_xFilterLB->get_active();
+ const SfxStyleSearchBits nSearchFlags = static_cast<SfxStyleSearchBits>(m_xFilterLB->get_id(nSelPos).toInt32());
SfxStyleSheetBasePool* pPool = m_rSh.GetView().GetDocShell()->GetStyleSheetPool();
pPool->SetSearchMask(SfxStyleFamily::Para, nSearchFlags);
const SfxStyleSheetBase* pBase = pPool->First();
- while( pBase )
+ bool bEmpty = true;
+ while (pBase)
{
- if(!m_pFormat || pBase->GetName() != m_pFormat->GetName())
- m_pStyleLB->InsertEntry(pBase->GetName());
+ if (!m_pFormat || pBase->GetName() != m_pFormat->GetName())
+ {
+ m_xStyleLB->append_text(pBase->GetName());
+ bEmpty = false;
+ }
pBase = pPool->Next();
}
- m_pStyleLB->SelectEntryPos(0);
- SelectHdl(m_pStyleLB);
-
+ if (!bEmpty)
+ m_xStyleLB->select(bEmpty ? -1 : 0);
+ SelectHdl(m_xStyleLB.get());
}
else
{
- SvTreeListEntry* pE = m_pTbLinks->FirstSelected();
- const OUString sTbEntry = pE
- ? m_pTbLinks->GetEntryText(pE).getToken(1, '\t')
+ int nSelected = m_xTbLinks->get_selected_index();
+ const OUString sTbEntry = nSelected != -1
+ ? m_xTbLinks->get_text(nSelected, 1)
: OUString();
- const OUString sStyle = m_pStyleLB->GetSelectedEntry();
+ const OUString sStyle = m_xStyleLB->get_selected_text();
- m_pAssignPB->Enable( sStyle != sTbEntry && m_pConditionCB->IsChecked() );
+ m_xAssignPB->set_sensitive(sStyle != sTbEntry && m_xConditionCB->get_active());
- if(pBox != m_pStyleLB)
- m_pRemovePB->Enable( m_pConditionCB->IsChecked() && !sTbEntry.isEmpty() );
+ if (pBox != m_xStyleLB.get())
+ m_xRemovePB->set_sensitive(m_xConditionCB->get_active() && !sTbEntry.isEmpty());
}
}
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index ae4c5bcf1491..caf1759c83bb 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -21,8 +21,8 @@
#include <swtypes.hxx>
#include <mailconfigpage.hxx>
#include <svtools/svmedit.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/headbar.hxx>
+#include <vcl/svtabbx.hxx>
+#include <vcl/headbar.hxx>
#include <mmconfigitem.hxx>
#include <mailmergehelper.hxx>
#include <cmdid.h>
diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx
index 5344092e69cb..9e94c7f55457 100644
--- a/sw/source/ui/dbui/addresslistdialog.hxx
+++ b/sw/source/ui/dbui/addresslistdialog.hxx
@@ -21,8 +21,8 @@
#include <sfx2/basedlgs.hxx>
#include <vcl/button.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/headbar.hxx>
+#include <vcl/svtabbx.hxx>
+#include <vcl/headbar.hxx>
#include <swdbdata.hxx>
#include <sharedconnection.hxx>
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index d671a9083a50..3033f7ef6518 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -27,7 +27,7 @@
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <svtools/svmedit.hxx>
-#include <svtools/headbar.hxx>
+#include <vcl/headbar.hxx>
#include <vcl/treelistbox.hxx>
#include <vcl/combobox.hxx>
#include <svl/lstner.hxx>
diff --git a/sw/source/ui/inc/mmresultdialogs.hxx b/sw/source/ui/inc/mmresultdialogs.hxx
index a26ee9fa8b6f..01709ead04f2 100644
--- a/sw/source/ui/inc/mmresultdialogs.hxx
+++ b/sw/source/ui/inc/mmresultdialogs.hxx
@@ -29,8 +29,8 @@
#include <sfx2/objsh.hxx>
#include <sfx2/basedlgs.hxx>
#include <svtools/simptabl.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/headbar.hxx>
+#include <vcl/svtabbx.hxx>
+#include <vcl/headbar.hxx>
#include <mailmergehelper.hxx>
class SwMailMergeWizard;
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index cb54e8eee021..37eac609f416 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -21,7 +21,7 @@
#include <svl/stritem.hxx>
#include <vcl/weld.hxx>
#include <vcl/builderfactory.hxx>
-#include <svtools/headbar.hxx>
+#include <vcl/headbar.hxx>
#include <vcl/treelistentry.hxx>
#include <com/sun/star/text/XBookmarksSupplier.hpp>
diff --git a/sw/source/uibase/inc/glosbib.hxx b/sw/source/uibase/inc/glosbib.hxx
index 216bae4d6c45..12b9ca217148 100644
--- a/sw/source/uibase/inc/glosbib.hxx
+++ b/sw/source/uibase/inc/glosbib.hxx
@@ -24,7 +24,7 @@
#include <svx/stddlg.hxx>
#include <vcl/lstbox.hxx>
-#include <svtools/svtabbx.hxx>
+#include <vcl/svtabbx.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
diff --git a/sw/source/uibase/inc/swuiccoll.hxx b/sw/source/uibase/inc/swuiccoll.hxx
index e355c321cd5f..f8e2449c2577 100644
--- a/sw/source/uibase/inc/swuiccoll.hxx
+++ b/sw/source/uibase/inc/swuiccoll.hxx
@@ -20,26 +20,13 @@
#define INCLUDED_SW_SOURCE_UIBASE_INC_SWUICCOLL_HXX
#include <sfx2/tabdlg.hxx>
-#include <svtools/svtabbx.hxx>
+#include <vcl/svtabbx.hxx>
class SwWrtShell;
class SwFormat;
class SwCondCollPage : public SfxTabPage
{
- VclPtr<CheckBox> m_pConditionCB;
-
- VclPtr<FixedText> m_pContextFT;
- VclPtr<FixedText> m_pUsedFT;
- VclPtr<SvTabListBox> m_pTbLinks;
-
- VclPtr<FixedText> m_pStyleFT;
- VclPtr<ListBox> m_pStyleLB;
- VclPtr<ListBox> m_pFilterLB;
-
- VclPtr<PushButton> m_pRemovePB;
- VclPtr<PushButton> m_pAssignPB;
-
std::vector<OUString> m_aStrArr;
SwWrtShell &m_rSh;
@@ -48,19 +35,27 @@ class SwCondCollPage : public SfxTabPage
bool m_bNewTemplate;
+ std::unique_ptr<weld::CheckButton> m_xConditionCB;
+ std::unique_ptr<weld::Label> m_xContextFT;
+ std::unique_ptr<weld::Label> m_xUsedFT;
+ std::unique_ptr<weld::TreeView> m_xTbLinks;
+ std::unique_ptr<weld::Label> m_xStyleFT;
+ std::unique_ptr<weld::TreeView> m_xStyleLB;
+ std::unique_ptr<weld::ComboBox> m_xFilterLB;
+ std::unique_ptr<weld::Button> m_xRemovePB;
+ std::unique_ptr<weld::Button> m_xAssignPB;
+
virtual ~SwCondCollPage() override;
- virtual void dispose() override;
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
- DECL_LINK( OnOffHdl, Button*, void );
- DECL_LINK( AssignRemoveHdl, ListBox&, void);
- DECL_LINK( AssignRemoveTreeListBoxHdl, SvTreeListBox*, bool);
- DECL_LINK( AssignRemoveClickHdl, Button*, void);
- DECL_LINK( SelectTreeListBoxHdl, SvTreeListBox*, void );
- DECL_LINK( SelectListBoxHdl, ListBox&, void );
- void AssignRemove(void const *);
- void SelectHdl(void const *);
+ DECL_LINK(OnOffHdl, weld::ToggleButton&, void);
+ DECL_LINK(AssignRemoveTreeListBoxHdl, weld::TreeView&, void);
+ DECL_LINK(AssignRemoveClickHdl, weld::Button&, void);
+ DECL_LINK(SelectTreeListBoxHdl, weld::TreeView&, void);
+ DECL_LINK(SelectListBoxHdl, weld::ComboBox&, void);
+ void AssignRemove(const weld::Widget*);
+ void SelectHdl(const weld::Widget*);
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
@@ -68,7 +63,7 @@ class SwCondCollPage : public SfxTabPage
static const sal_uInt16 m_aPageRg[];
public:
- SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet);
+ SwCondCollPage(TabPageParent pParent, const SfxItemSet &rSet);
static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
static const sal_uInt16* GetRanges() { return m_aPageRg; }
diff --git a/sw/uiconfig/swriter/ui/conditionpage.ui b/sw/uiconfig/swriter/ui/conditionpage.ui
index fc1bc0d554d1..bce9a36205d8 100644
--- a/sw/uiconfig/swriter/ui/conditionpage.ui
+++ b/sw/uiconfig/swriter/ui/conditionpage.ui
@@ -1,7 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkTreeStore" id="liststore1">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name text2 -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkTreeStore" id="liststore2">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkGrid" id="ConditionPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -45,14 +63,13 @@
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<accessibility>
- <relation type="label-for" target="links:border"/>
+ <relation type="label-for" target="links"/>
</accessibility>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">3</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -66,8 +83,6 @@
<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>
@@ -80,8 +95,6 @@
<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>
<child>
@@ -91,33 +104,69 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="conditionpage|styleft">_Paragraph Styles</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">styles</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="svtlo-SvTabListBox" id="links:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <accessibility>
- <relation type="labelled-by" target="condstyle"/>
- </accessibility>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="Tab List-selection1"/>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="links">
+ <property name="width_request">-1</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore1</property>
+ <property name="headers_visible">False</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection1"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer2"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <accessibility>
+ <relation type="labelled-by" target="condstyle"/>
+ </accessibility>
+ </object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -162,7 +211,6 @@
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">3</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -172,15 +220,39 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkTreeView" id="styles:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="show_expanders">False</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection1"/>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="styles">
+ <property name="width_request">-1</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore2</property>
+ <property name="headers_visible">False</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection2"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer4"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
</child>
</object>
<packing>
@@ -194,8 +266,6 @@
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
- <property name="entry_text_column">0</property>
- <property name="id_column">1</property>
<items>
<item translatable="yes" context="conditionpage|filter">Table Header</item>
<item translatable="yes" context="conditionpage|filter">Table</item>
@@ -237,8 +307,6 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -259,8 +327,6 @@
<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>
</object>