tdf#148978: Business Cards in Writer dont show database

+ remove "medium" tab since its goal is exactly what "label" tab does.
So now "label" tab is common for "File - New - Business Cards" and "File - New - Labels"

Change-Id: I9c7f4e74d7cbc0ffa8ee146a0ef39c87ff5261e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135566
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet 2022-06-09 21:40:57 +02:00
parent a8485d558f
commit 7a7afd3ae5
2 changed files with 4 additions and 55 deletions

View file

@ -76,12 +76,9 @@ void SwLabDlg::PageCreated(const OString &rId, SfxTabPage &rPage)
{
if (rId == "labels")
{
if (m_bLabel)
{
static_cast<SwLabPage*>(&rPage)->SetDBManager(pDBManager);
static_cast<SwLabPage*>(&rPage)->InitDatabaseBox();
}
else
static_cast<SwLabPage*>(&rPage)->SetDBManager(pDBManager);
static_cast<SwLabPage*>(&rPage)->InitDatabaseBox();
if (!m_bLabel)
static_cast<SwLabPage*>(&rPage)->SetToBusinessCard();
}
else if (rId == "options")
@ -137,19 +134,16 @@ SwLabDlg::SwLabDlg(weld::Window* pParent, const SfxItemSet& rSet,
AddTabPage("format", SwLabFormatPage::Create, nullptr);
AddTabPage("options", SwLabPrtPage::Create, nullptr);
AddTabPage("labels", SwLabPage::Create, nullptr);
m_sBusinessCardDlg = SwResId(STR_BUSINESS_CARDS);
if (m_bLabel)
{
RemoveTabPage("business");
RemoveTabPage("private");
RemoveTabPage("medium");
AddTabPage("labels", SwLabPage::Create, nullptr);
}
else
{
RemoveTabPage("labels");
AddTabPage("medium", SwLabPage::Create, nullptr);
AddTabPage("business", SwBusinessDataPage::Create, nullptr );
AddTabPage("private", SwPrivateDataPage::Create, nullptr);
m_xDialog->set_title(m_sBusinessCardDlg);
@ -275,7 +269,6 @@ void SwLabPage::SetToBusinessCard()
m_xSheetButton->set_help_id(HID_BUSINESS_FMT_PAGE_SHEET);
m_xMakeBox->set_help_id(HID_BUSINESS_FMT_PAGE_BRAND);
m_xTypeBox->set_help_id(HID_BUSINESS_FMT_PAGE_TYPE);
m_xAddressFrame->hide();
};
IMPL_LINK_NOARG(SwLabPage, AddrHdl, weld::Toggleable&, void)

View file

@ -100,50 +100,6 @@
<property name="vexpand">True</property>
<property name="scrollable">True</property>
<property name="enable_popup">True</property>
<child>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="medium">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="labeldialog|medium">Medium</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid">