Kaydet (Commit) 35d548e4 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld writer numbering styles dialog

Change-Id: I697fa74a21acec550fcacd2a8d8468dfb21afcac
Reviewed-on: https://gerrit.libreoffice.org/63495
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 5197e658
......@@ -112,6 +112,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/columndialog \
sw/uiconfig/swriter/ui/columnpage \
sw/uiconfig/swriter/ui/columnwidth \
sw/uiconfig/swriter/ui/comboboxfragment \
sw/uiconfig/swriter/ui/conditionpage \
sw/uiconfig/swriter/ui/converttexttable \
sw/uiconfig/swriter/ui/createaddresslist \
......
......@@ -1008,7 +1008,7 @@ VclPtr<SfxAbstractApplyTabDialog> SwAbstractDialogFactory_Impl::CreateTemplateDi
SwWrtShell* pActShell,
bool bNew )
{
if (nRegion == SfxStyleFamily::Page)
if (nRegion == SfxStyleFamily::Page || nRegion == SfxStyleFamily::Pseudo)
{
return VclPtr<AbstractApplyTabController_Impl>::Create(o3tl::make_unique<SwTemplateDlgController>(pParent ? pParent->GetFrameWeld() : nullptr, rBase, nRegion, sPage, pActShell, bNew));
}
......
......@@ -100,10 +100,6 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent,
, m_nHeaderId(0)
, m_nFooterId(0)
, m_nPageId(0)
, m_nBulletId(0)
, m_nNumId(0)
, m_nNumOptId(0)
, m_nNumPosId(0)
{
nHtmlMode = ::GetHtmlMode(pWrtShell->GetView().GetDocShell());
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
......@@ -250,54 +246,6 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent,
break;
}
// page styles
case SfxStyleFamily::Page:
{
// add Area and Transparence TabPages
m_nAreaId = AddTabPage("area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA ));
m_nTransparenceId = AddTabPage("transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) );
m_nHeaderId = AddTabPage("header", SvxHeaderPage::Create, SvxHeaderPage::GetRanges);
m_nFooterId = AddTabPage("footer", SvxFooterPage::Create, SvxFooterPage::GetRanges);
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
m_nPageId = AddTabPage("page",
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ),
pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ) );
if (0 == ::GetHtmlMode(pWrtShell->GetView().GetDocShell()))
{
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
m_nBorderId = AddTabPage("borders",
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
m_nColumnId = AddTabPage("columns", SwColumnPage::Create, SwColumnPage::GetRanges );
AddTabPage("footnotes", SwFootNotePage::Create, SwFootNotePage::GetRanges );
AddTabPage("textgrid", SwTextGridPage::Create, SwTextGridPage::GetRanges );
SvtCJKOptions aCJKOptions;
if(!aCJKOptions.IsAsianTypographyEnabled())
RemoveTabPage("textgrid");
}
else
{
RemoveTabPage("borders");
RemoveTabPage("columns");
RemoveTabPage("footnotes");
RemoveTabPage("textgrid");
}
}
break;
// numbering styles
case SfxStyleFamily::Pseudo:
{
AddTabPage("numbering", RID_SVXPAGE_PICK_SINGLE_NUM);
m_nBulletId = AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET);
m_nNumId = AddTabPage("outline", RID_SVXPAGE_PICK_NUM);
AddTabPage("graphics", RID_SVXPAGE_PICK_BMP);
m_nNumOptId = AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS );
m_nNumPosId = AddTabPage("position", RID_SVXPAGE_NUM_POSITION );
}
break;
default:
OSL_ENSURE(false, "wrong family");
......@@ -494,47 +442,6 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
rPage.SetFrame( pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() );
rPage.PageCreated(aNewSet);
}
else if (nId == m_nNumId)
{
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFormat));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFormat));
rPage.PageCreated(aSet);
}
else if (nId == m_nNumOptId)
{
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFormat));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFormat));
// collect character styles
ScopedVclPtrInstance< ListBox > rCharFormatLB(this);
rCharFormatLB->Clear();
rCharFormatLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone );
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
::FillCharStyleListBox(*rCharFormatLB.get(), pDocShell);
std::vector<OUString> aList;
aList.reserve(rCharFormatLB->GetEntryCount());
for (sal_Int32 j = 0; j < rCharFormatLB->GetEntryCount(); j++)
aList.push_back(rCharFormatLB->GetEntry(j));
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
FieldUnit eMetric = ::GetDfltMetric(dynamic_cast< const SwWebDocShell *>( pDocShell ) != nullptr);
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
}
else if (nId == m_nNumPosId)
{
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( pDocShell) != nullptr );
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
}
else if (nId == m_nBulletId)
{
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFormat));
rPage.PageCreated(aSet);
}
else if (nId == m_nHeaderId)
{
if(0 == (nHtmlMode & HTMLMODE_ON ))
......@@ -638,6 +545,17 @@ SwTemplateDlgController::SwTemplateDlgController(weld::Window* pParent,
}
}
break;
// numbering styles
case SfxStyleFamily::Pseudo:
{
AddTabPage("numbering", RID_SVXPAGE_PICK_SINGLE_NUM);
AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET);
AddTabPage("outline", RID_SVXPAGE_PICK_NUM);
AddTabPage("graphics", RID_SVXPAGE_PICK_BMP);
AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS );
AddTabPage("position", RID_SVXPAGE_NUM_POSITION );
}
break;
default:
OSL_ENSURE(false, "wrong family");
}
......@@ -784,6 +702,54 @@ void SwTemplateDlgController::PageCreated(const OString& rId, SfxTabPage &rPage
{
rPage.PageCreated(GetStyleSheet().GetItemSet());
}
else if (rId == "bullets")
{
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFormat));
rPage.PageCreated(aSet);
}
else if (rId == "outline")
{
if (SfxStyleFamily::Pseudo == nType)
{
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFormat));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFormat));
rPage.PageCreated(aSet);
}
}
else if (rId == "customize")
{
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFormat));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFormat));
// collect character styles
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "modules/swriter/ui/comboboxfragment.ui"));
std::unique_ptr<weld::ComboBox> xCharFormatLB(xBuilder->weld_combo_box("combobox"));
xCharFormatLB->clear();
xCharFormatLB->append_text(SwViewShell::GetShellRes()->aStrNone);
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
::FillCharStyleListBox(*xCharFormatLB, pDocShell);
std::vector<OUString> aList;
aList.reserve(xCharFormatLB->get_count());
for (sal_Int32 j = 0; j < xCharFormatLB->get_count(); j++)
aList.push_back(xCharFormatLB->get_text(j));
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
FieldUnit eMetric = ::GetDfltMetric(dynamic_cast< const SwWebDocShell *>( pDocShell ) != nullptr);
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
}
else if (rId == "position")
{
if (SfxStyleFamily::Pseudo == nType)
{
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( pDocShell) != nullptr );
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -53,10 +53,6 @@ class SwTemplateDlg: public SfxStyleDialog
sal_uInt16 m_nHeaderId;
sal_uInt16 m_nFooterId;
sal_uInt16 m_nPageId;
sal_uInt16 m_nBulletId;
sal_uInt16 m_nNumId;
sal_uInt16 m_nNumOptId;
sal_uInt16 m_nNumPosId;
public:
/// @param sPage
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkComboBoxText" id="combobox">
<property name="can_focus">False</property>
</object>
</interface>
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