Kaydet (Commit) 389491ae authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SwMultiTOXTabDialog

Change-Id: Ic1ae4cfe43bdf31d511e9ac0f65a821c53ab59eb
Reviewed-on: https://gerrit.libreoffice.org/65432
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6bd751f9
......@@ -1649,6 +1649,7 @@ class VCL_DLLPUBLIC Menu
public:
virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) = 0;
virtual void set_sensitive(const OString& rIdent, bool bSensitive) = 0;
virtual void set_label(const OString& rIdent, const OUString& rLabel) = 0;
virtual void set_active(const OString& rIdent, bool bActive) = 0;
virtual bool get_active(const OString& rIdent) const = 0;
virtual void set_visible(const OString& rIdent, bool bVisible) = 0;
......
......@@ -3,3 +3,8 @@ sw/uiconfig/swriter/ui/pageformatpanel.ui://GtkLabel[@id='customlabel'] orphan-l
sw/uiconfig/swriter/ui/pagestylespanel.ui://GtkLabel[@id='customlabel'] orphan-label
sw/uiconfig/swriter/ui/pagefooterpanel.ui://GtkLabel[@id='customlabel'] orphan-label
sw/uiconfig/swriter/ui/pageheaderpanel.ui://GtkLabel[@id='customlabel'] orphan-label
sw/uiconfig/swriter/ui/previewmenu.ui://GtkRadioMenuItem[@id='zoom20'] button-no-label
sw/uiconfig/swriter/ui/previewmenu.ui://GtkRadioMenuItem[@id='zoom40'] button-no-label
sw/uiconfig/swriter/ui/previewmenu.ui://GtkRadioMenuItem[@id='zoom50'] button-no-label
sw/uiconfig/swriter/ui/previewmenu.ui://GtkRadioMenuItem[@id='zoom75'] button-no-label
sw/uiconfig/swriter/ui/previewmenu.ui://GtkRadioMenuItem[@id='zoom100'] button-no-label
......@@ -229,6 +229,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/paradialog \
sw/uiconfig/swriter/ui/picturedialog \
sw/uiconfig/swriter/ui/picturepage \
sw/uiconfig/swriter/ui/previewmenu \
sw/uiconfig/swriter/ui/previewzoomdialog \
sw/uiconfig/swriter/ui/printeroptions \
sw/uiconfig/swriter/ui/printmergedialog \
......
......@@ -472,7 +472,7 @@ public:
const SfxItemSet* pSwItemSet,
SwWrtShell &) = 0;
virtual VclPtr<AbstractMultiTOXTabDialog> CreateMultiTOXTabDialog(
vcl::Window* pParent, const SfxItemSet& rSet,
weld::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
SwTOXBase* pCurTOX,
bool bGlobal) = 0;
......
......@@ -245,7 +245,15 @@ short AbstractMailMergeFieldConnectionsDlg_Impl::Execute()
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl);
short AbstractMultiTOXTabDialog_Impl::Execute()
{
return m_xDlg->run();
}
bool AbstractMultiTOXTabDialog_Impl::StartExecuteAsync(AsyncContext &rCtx)
{
return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
}
short AbstractEditRegionDlg_Impl::Execute()
{
......@@ -657,17 +665,17 @@ bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const
CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const
{
return pDlg->GetCurrentTOXType();
return m_xDlg->GetCurrentTOXType();
}
SwTOXDescription& AbstractMultiTOXTabDialog_Impl::GetTOXDescription(CurTOXType eTOXTypes)
{
return pDlg->GetTOXDescription(eTOXTypes);
return m_xDlg->GetTOXDescription(eTOXTypes);
}
const SfxItemSet* AbstractMultiTOXTabDialog_Impl::GetOutputItemSet() const
{
return pDlg->GetOutputItemSet();
return m_xDlg->GetOutputItemSet();
}
void AbstractEditRegionDlg_Impl::SelectSection(const OUString& rSectionName)
......@@ -1071,14 +1079,10 @@ VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateOutlineTabDialo
return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwOutlineTabDialog>(pParent, pSwItemSet, rWrtSh));
}
VclPtr<AbstractMultiTOXTabDialog> SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialog(
vcl::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
SwTOXBase* pCurTOX,
bool bGlobal)
VclPtr<AbstractMultiTOXTabDialog> SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialog(weld::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell, SwTOXBase* pCurTOX, bool bGlobal)
{
VclPtr<SwMultiTOXTabDialog> pDlg = VclPtr<SwMultiTOXTabDialog>::Create( pParent, rSet, rShell, pCurTOX, USHRT_MAX, bGlobal );
return VclPtr<AbstractMultiTOXTabDialog_Impl>::Create( pDlg );
return VclPtr<AbstractMultiTOXTabDialog_Impl>::Create(std::make_unique<SwMultiTOXTabDialog>(pParent, rSet, rShell, pCurTOX, USHRT_MAX, bGlobal));
}
VclPtr<AbstractEditRegionDlg> SwAbstractDialogFactory_Impl::CreateEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh)
......
......@@ -513,7 +513,15 @@ public:
class SwMultiTOXTabDialog;
class AbstractMultiTOXTabDialog_Impl : public AbstractMultiTOXTabDialog
{
DECL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl,SwMultiTOXTabDialog)
protected:
std::shared_ptr<SwMultiTOXTabDialog> m_xDlg;
public:
explicit AbstractMultiTOXTabDialog_Impl(std::unique_ptr<SwMultiTOXTabDialog> p)
: m_xDlg(std::move(p))
{
}
virtual short Execute() override;
virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override;
virtual CurTOXType GetCurrentTOXType() const override ;
virtual SwTOXDescription& GetTOXDescription(CurTOXType eTOXTypes) override;
//from SfxTabDialog
......@@ -700,7 +708,7 @@ public:
const SfxItemSet* pSwItemSet,
SwWrtShell &) override;
virtual VclPtr<AbstractMultiTOXTabDialog> CreateMultiTOXTabDialog(
vcl::Window* pParent, const SfxItemSet& rSet,
weld::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
SwTOXBase* pCurTOX,
bool bGlobal) override;
......
......@@ -94,11 +94,11 @@ static void lcl_SetBOOLProp(
}
}
IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, SwOneExampleFrame&, void)
IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, OneExampleFrame&, void)
{
try
{
uno::Reference< frame::XModel > & xModel = m_pExampleFrame->GetModel();
uno::Reference< frame::XModel > & xModel = m_xExampleFrame->GetModel();
uno::Reference< lang::XUnoTunnel > xDocTunnel(xModel, uno::UNO_QUERY);
SwXTextDocument* pDoc = reinterpret_cast<SwXTextDocument*>(xDocTunnel->getSomething(SwXTextDocument::getUnoTunnelId()));
......@@ -138,7 +138,7 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, SwOneExampleFrame&, void
void SwMultiTOXTabDialog::CreateOrUpdateExample(
TOXTypes nTOXIndex, sal_uInt16 nPage, sal_uInt16 nCurrentLevel)
{
if(!m_pExampleFrame || !m_pExampleFrame->IsInitialized())
if(!m_xExampleFrame || !m_xExampleFrame->IsInitialized())
return;
try
......@@ -157,7 +157,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
OSL_ENSURE(m_vTypeData[nTOXIndex].m_pxIndexSections &&
m_vTypeData[nTOXIndex].m_pxIndexSections->xContainerSection.is(),
"Section not created");
uno::Reference< frame::XModel > & xModel = m_pExampleFrame->GetModel();
uno::Reference< frame::XModel > & xModel = m_xExampleFrame->GetModel();
bool bInitialCreate = true;
if(!m_vTypeData[nTOXIndex].m_pxIndexSections->xDocumentIndex.is())
{
......@@ -401,6 +401,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
{
OSL_FAIL("::CreateExample() - exception caught");
}
m_xExampleFrame->Invalidate();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -208,12 +208,10 @@ sal_uInt16 CurTOXType::GetFlatIndex() const
? TOX_AUTHORITIES + nIndex : eType );
}
SwMultiTOXTabDialog::SwMultiTOXTabDialog(vcl::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
SwTOXBase* pCurTOX,
sal_uInt16 nToxType, bool bGlobal)
: SfxTabDialog(pParent, "TocDialog",
"modules/swriter/ui/tocdialog.ui", &rSet)
SwMultiTOXTabDialog::SwMultiTOXTabDialog(weld::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell, SwTOXBase* pCurTOX,
sal_uInt16 nToxType, bool bGlobal)
: SfxTabDialogController(pParent, "modules/swriter/ui/tocdialog.ui", "TocDialog", &rSet)
, m_pMgr( new SwTOXMgr( &rShell ) )
, m_rWrtShell(rShell)
, m_pParamTOXBase(pCurTOX)
......@@ -222,14 +220,8 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(vcl::Window* pParent, const SfxItemSet&
, m_bEditTOX(false)
, m_bExampleCreated(false)
, m_bGlobalFlag(bGlobal)
, m_xShowExampleCB(m_xBuilder->weld_check_button("showexample"))
{
get(m_pShowExampleCB, "showexample");
get(m_pExampleContainerWIN, "example");
Size aWinSize(LogicToPixel(Size(150, 188), MapMode(MapUnit::MapAppFont)));
m_pExampleContainerWIN->set_width_request(aWinSize.Width());
m_pExampleContainerWIN->set_height_request(aWinSize.Height());
m_pExampleContainerWIN->SetSizePixel(aWinSize);
m_eCurrentTOXType.eType = TOX_CONTENT;
m_eCurrentTOXType.nIndex = 0;
......@@ -286,64 +278,42 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(vcl::Window* pParent, const SfxItemSet&
}
}
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
m_nSelectId = AddTabPage("index", SwTOXSelectTabPage::Create);
AddTabPage("styles", SwTOXStylesTabPage::Create);
m_nColumnId = AddTabPage("columns", SwColumnPage::Create);
m_nBackGroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ));
m_nEntriesId = AddTabPage("entries", SwTOXEntryTabPage::Create);
if(!pCurTOX)
SetCurPageId(m_nSelectId);
m_pShowExampleCB->SetClickHdl(LINK(this, SwMultiTOXTabDialog, ShowPreviewHdl));
m_pShowExampleCB->Check( SW_MOD()->GetModuleConfig()->IsShowIndexPreview());
AddTabPage("index", SwTOXSelectTabPage::Create, nullptr);
AddTabPage("styles", SwTOXStylesTabPage::Create, nullptr);
AddTabPage("columns", SwColumnPage::Create, nullptr);
AddTabPage("background", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BKG), nullptr);
AddTabPage("entries", SwTOXEntryTabPage::Create, nullptr);
if (!pCurTOX)
SetCurPageId("index");
SetViewAlign( WindowAlign::Left );
// SetViewWindow does not work if the dialog is visible!
m_xShowExampleCB->connect_toggled(LINK(this, SwMultiTOXTabDialog, ShowPreviewHdl));
m_xShowExampleCB->set_active(SW_MOD()->GetModuleConfig()->IsShowIndexPreview());
if(!m_pShowExampleCB->IsChecked())
SetViewWindow(m_pExampleContainerWIN);
ShowPreviewHdl(nullptr);
ShowPreviewHdl(*m_xShowExampleCB);
}
SwMultiTOXTabDialog::~SwMultiTOXTabDialog()
{
disposeOnce();
}
void SwMultiTOXTabDialog::dispose()
{
SW_MOD()->GetModuleConfig()->SetShowIndexPreview(m_pShowExampleCB->IsChecked());
// fdo#38515 Avoid setting focus on deleted controls in the destructors
EnableInput( false );
m_vTypeData.clear();
m_pMgr.reset();
m_pExampleFrame.reset();
m_pExampleContainerWIN.clear();
m_pShowExampleCB.clear();
SfxTabDialog::dispose();
SW_MOD()->GetModuleConfig()->SetShowIndexPreview(m_xShowExampleCB->get_active());
}
void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
void SwMultiTOXTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
{
if (nId == m_nBackGroundId)
if (rId == "background")
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
rPage.PageCreated(aSet);
}
else if(nId == m_nColumnId)
else if (rId == "columns")
{
const SwFormatFrameSize& rSize = GetInputSetImpl()->Get(RES_FRM_SIZE);
static_cast<SwColumnPage&>(rPage).SetPageWidth(rSize.GetWidth());
}
else if (nId == m_nEntriesId)
else if (rId == "entries")
static_cast<SwTOXEntryTabPage&>(rPage).SetWrtShell(m_rWrtShell);
else if (nId == m_nSelectId)
else if (rId == "index")
{
static_cast<SwTOXSelectTabPage&>(rPage).SetWrtShell(m_rWrtShell);
if(USHRT_MAX != m_nInitialTOXType)
......@@ -353,7 +323,7 @@ void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
short SwMultiTOXTabDialog::Ok()
{
short nRet = SfxTabDialog::Ok();
short nRet = SfxTabDialogController::Ok();
SwTOXDescription& rDesc = GetTOXDescription(m_eCurrentTOXType);
SwTOXBase aNewDef(*m_rWrtShell.GetDefaultTOXBase( m_eCurrentTOXType.eType, true ));
......@@ -451,11 +421,11 @@ std::unique_ptr<SwTOXDescription> SwMultiTOXTabDialog::CreateTOXDescFromTOXBase(
return pDesc;
}
IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl, Button*, void )
IMPL_LINK_NOARG(SwMultiTOXTabDialog, ShowPreviewHdl, weld::ToggleButton&, void)
{
if(m_pShowExampleCB->IsChecked())
if (m_xShowExampleCB->get_active())
{
if(!m_pExampleFrame && !m_bExampleCreated)
if(!m_xExampleFrame && !m_bExampleCreated)
{
m_bExampleCreated = true;
OUString sTemplate("internal/idxexample.odt");
......@@ -468,32 +438,31 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl, Button*, void )
OUString sInfo(SwResId(STR_FILE_NOT_FOUND));
sInfo = sInfo.replaceFirst( "%1", sTemplate );
sInfo = sInfo.replaceFirst( "%2", aOpt.GetTemplatePath() );
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_xDialog.get(),
VclMessageType::Info, VclButtonsType::Ok,
sInfo));
xInfoBox->run();
}
else
{
Link<SwOneExampleFrame&,void> aLink(LINK(this, SwMultiTOXTabDialog, CreateExample_Hdl));
m_pExampleFrame.reset(new SwOneExampleFrame(
*m_pExampleContainerWIN, EX_SHOW_ONLINE_LAYOUT, &aLink, &sTemplate));
if(!m_pExampleFrame->IsServiceAvailable())
{
SwOneExampleFrame::CreateErrorMessage();
}
Link<OneExampleFrame&,void> aLink(LINK(this, SwMultiTOXTabDialog, CreateExample_Hdl));
m_xExampleFrame.reset(new OneExampleFrame(EX_SHOW_ONLINE_LAYOUT, &aLink, &sTemplate));
m_xExampleFrameWin.reset(new weld::CustomWeld(*m_xBuilder, "example", *m_xExampleFrame));
}
m_pShowExampleCB->Show(m_pExampleFrame && m_pExampleFrame->IsServiceAvailable());
m_xShowExampleCB->set_visible(m_xExampleFrame != nullptr);
}
}
bool bSetViewWindow = m_pShowExampleCB->IsChecked()
&& m_pExampleFrame && m_pExampleFrame->IsServiceAvailable();
m_pExampleContainerWIN->Show( bSetViewWindow );
SetViewWindow( bSetViewWindow ? m_pExampleContainerWIN.get() : nullptr );
if (m_xExampleFrame)
{
const bool bSetViewWindow = m_xShowExampleCB->get_active();
if (bSetViewWindow)
m_xExampleFrame->Show();
else
m_xExampleFrame->Hide();
}
setOptimalLayoutSize();
m_xDialog->resize_to_request();
}
bool SwMultiTOXTabDialog::IsNoNum(SwWrtShell& rSh, const OUString& rName)
......@@ -783,10 +752,10 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(TabPageParent pParent, const SfxItemSet&
false );
//Default mode is arranged to be the tallest mode
//of alphabetical index, lock that height in now
//of alphabetical index, lock that size in now
LanguageHdl(nullptr); //fill sort algorithm list
Size aPrefSize(get_preferred_size());
set_height_request(aPrefSize.Height());
Size aPrefSize(m_xContainer->get_preferred_size());
m_xContainer->set_size_request(aPrefSize.Width(), aPrefSize.Height());
sAddStyleContent = m_xAddStylesCB->get_label();
......@@ -826,7 +795,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(TabPageParent pParent, const SfxItemSet&
m_xLevelNF->connect_value_changed(LINK(this, SwTOXSelectTabPage, ModifySpinHdl));
m_xSortAlgorithmLB->connect_changed(LINK(this, SwTOXSelectTabPage, ModifyListBoxHdl));
aLk = LINK(this, SwTOXSelectTabPage, RadioButtonHdl);
aLk = LINK(this, SwTOXSelectTabPage, RadioButtonHdl);
m_xFromCaptionsRB->connect_toggled(aLk);
m_xFromObjectNamesRB->connect_toggled(aLk);
RadioButtonHdl(*m_xFromCaptionsRB);
......@@ -932,7 +901,7 @@ static CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData)
void SwTOXSelectTabPage::ApplyTOXDescription()
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
SwTOXDescription& rDesc = pTOXDlg->GetTOXDescription(aCurType);
m_xReadOnlyCB->set_active(rDesc.IsReadonly());
......@@ -1048,7 +1017,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
void SwTOXSelectTabPage::FillTOXDescription()
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
SwTOXDescription& rDesc = pTOXDlg->GetTOXDescription(aCurType);
rDesc.SetTitle(m_xTitleED->get_text());
......@@ -1159,7 +1128,7 @@ void SwTOXSelectTabPage::FillTOXDescription()
void SwTOXSelectTabPage::Reset( const SfxItemSet* )
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
SwWrtShell& rSh = pTOXDlg->GetWrtShell();
const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
sal_uInt32 nData = lcl_TOXTypesToUserData(aCurType);
......@@ -1216,7 +1185,7 @@ VclPtr<SfxTabPage> SwTOXSelectTabPage::Create(TabPageParent pParent, const SfxIt
IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, weld::ComboBox&, rBox, void)
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
const sal_uInt16 nType = rBox.get_active_id().toUInt32();
CurTOXType eCurType = lcl_UserData2TOXTypes(nType);
pTOXDlg->SetCurrentTOXType(eCurType);
......@@ -1284,7 +1253,7 @@ void SwTOXSelectTabPage::ModifyHdl()
if(!m_bWaitingInitialSettings)
{
FillTOXDescription();
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
pTOXDlg->CreateOrUpdateExample(pTOXDlg->GetCurrentTOXType().eType, TOX_PAGE_SELECT);
}
}
......@@ -1306,7 +1275,7 @@ IMPL_LINK_NOARG(SwTOXSelectTabPage, ModifySpinHdl, weld::SpinButton&, void)
IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, weld::ToggleButton&, rButton, void)
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
if(TOX_CONTENT == aCurType.eType)
{
......@@ -1377,7 +1346,7 @@ void SwTOXSelectTabPage::LanguageHdl(const weld::ComboBox* pBox)
IMPL_LINK_NOARG(SwTOXSelectTabPage, AddStylesHdl, weld::Button&, void)
{
SwAddStylesDlg_Impl aDlg(GetDialogFrameWeld(), static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell(),
SwAddStylesDlg_Impl aDlg(GetDialogFrameWeld(), static_cast<SwMultiTOXTabDialog*>(GetDialogController())->GetWrtShell(),
aStyleArr);
aDlg.run();
ModifyHdl();
......@@ -1408,8 +1377,7 @@ IMPL_LINK(SwTOXSelectTabPage, MenuExecuteHdl, const OString&, rIdent, void)
return;
}
VclPtrInstance<SwAutoMarkDlg_Impl> pAutoMarkDlg(
GetTabDialog(), sAutoMarkURL, bNew);
VclPtrInstance<SwAutoMarkDlg_Impl> pAutoMarkDlg(nullptr, sAutoMarkURL, bNew);
if( RET_OK != pAutoMarkDlg->Execute() && bNew )
sAutoMarkURL = sSaveAutoMarkURL;
......@@ -1447,7 +1415,7 @@ public:
, aFormToken(rToken)
, bNextControl(false)
, m_pParent(pTokenWin)
, m_xEntry(m_xBuilder->weld_entry("entry"))
, m_xEntry(m_xBuilder->weld_entry("entry", true))
{
m_xEntry->connect_changed(LINK(this, SwTOXEdit, ModifyHdl));
m_xEntry->connect_key_press(LINK(this, SwTOXEdit, KeyInputHdl));
......@@ -1603,7 +1571,7 @@ public:
, aFormToken(rToken)
, bNextControl(false)
, m_pParent(pTokenWin)
, m_xButton(m_xBuilder->weld_toggle_button("button"))
, m_xButton(m_xBuilder->weld_toggle_button("button", true))
{
m_xButton->connect_key_press(LINK(this, SwTOXButton, KeyInputHdl));
m_xButton->connect_focus_in(LINK(this, SwTOXButton, FocusInHdl));
......@@ -1938,6 +1906,10 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(TabPageParent pParent, const SfxItemSet& rA
m_xFirstKeyLB->set_active(0);
m_xSecondKeyLB->set_active(0);
m_xThirdKeyLB->set_active(0);
//lock size
Size aPrefSize(m_xContainer->get_preferred_size());
m_xContainer->set_size_request(aPrefSize.Width(), aPrefSize.Height());
}
SwTOXEntryTabPage::~SwTOXEntryTabPage()
......@@ -1966,7 +1938,7 @@ void SwTOXEntryTabPage::OnModify(bool bAllLevels)
{
UpdateDescriptor();
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
if (pTOXDlg)
{
sal_uInt16 nCurLevel = m_xLevelLB->get_selected_index() + 1;
......@@ -1985,7 +1957,7 @@ bool SwTOXEntryTabPage::FillItemSet( SfxItemSet* )
void SwTOXEntryTabPage::Reset( const SfxItemSet* )
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
m_pCurrentForm = pTOXDlg->GetForm(aCurType);
if(TOX_INDEX == aCurType.eType)
......@@ -2008,7 +1980,7 @@ void SwTOXEntryTabPage::Reset( const SfxItemSet* )
void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
m_pCurrentForm = pTOXDlg->GetForm(aCurType);
......@@ -2114,7 +2086,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/)
void SwTOXEntryTabPage::UpdateDescriptor()
{
WriteBackLevel();
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
SwTOXDescription& rDesc = pTOXDlg->GetTOXDescription(aLastTOXType);
if(TOX_INDEX == aLastTOXType.eType)
{
......@@ -2162,7 +2134,7 @@ IMPL_LINK_NOARG(SwTOXEntryTabPage, EditStyleHdl, weld::Button&, void)
{
SfxStringItem aStyle(SID_STYLE_EDIT, m_xCharStyleLB->get_active_text());
SfxUInt16Item aFamily(SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Char));
static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell().
static_cast<SwMultiTOXTabDialog*>(GetDialogController())->GetWrtShell().
GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_STYLE_EDIT,
SfxCallMode::SYNCHRON,
{ &aStyle, &aFamily });
......@@ -2628,8 +2600,9 @@ SwTokenWindow::SwTokenWindow(std::unique_ptr<weld::Container> xParent)
, m_sCharStyle(SwResId(STR_CHARSTYLE))
, m_pActiveCtrl(nullptr)
, m_pParent(nullptr)
, m_xBuilder(Application::CreateBuilder(xParent.get(), "modules/swriter/ui/tokenwidget.ui"))
, m_xContainer(std::move(xParent))
, m_xParentWidget(std::move(xParent))
, m_xBuilder(Application::CreateBuilder(m_xParentWidget.get(), "modules/swriter/ui/tokenwidget.ui"))
, m_xContainer(m_xBuilder->weld_container("TokenWidget"))
, m_xLeftScrollWin(m_xBuilder->weld_button("left"))
, m_xCtrlParentWin(m_xBuilder->weld_container("ctrl"))
, m_xScrollWin(m_xBuilder->weld_scrolled_window("scrollwin"))
......@@ -2637,6 +2610,7 @@ SwTokenWindow::SwTokenWindow(std::unique_ptr<weld::Container> xParent)
{
m_xScrollWin->connect_hadjustment_changed(LINK(this, SwTokenWindow, ScrollHdl));
m_xCtrlParentWin->set_size_request(-1, Edit::GetMinimumEditSize().Height());
m_xCtrlParentWin->connect_size_allocate(LINK(this, SwTokenWindow, AdjustPositionsHdl));
for (sal_uInt32 i = 0; i < TOKEN_END; ++i)
{
......@@ -3062,11 +3036,15 @@ void SwTokenWindow::RemoveControl(const SwTOXButton* pDel, bool bInternalCall)
m_aModifyHdl.Call(nullptr);
}
IMPL_LINK_NOARG(SwTokenWindow, AdjustPositionsHdl, const Size&, void)
{
AdjustScrolling();
}
void SwTokenWindow::AdjustPositions()
{
for (size_t i = 0; i < m_aControlList.size(); ++i)
m_aControlList[i]->set_grid_left_attach(i);
AdjustScrolling();
}
......@@ -3089,6 +3067,7 @@ void SwTokenWindow::AdjustScrolling()
auto nLeft = m_xScrollWin->hadjustment_get_value();
auto nSpace = m_xScrollWin->hadjustment_get_page_size();
auto nWidth = m_xScrollWin->hadjustment_get_upper();
bool bEnable = nWidth > nSpace;
//the active control must be visible
......@@ -3480,7 +3459,7 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
m_xLevelLB->thaw();
// initialise templates
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell();
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetDialogController())->GetWrtShell();
const sal_uInt16 nSz = rSh.GetTextFormatCollCount();
m_xParaLayLB->freeze();
......@@ -3522,7 +3501,7 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, EditStyleHdl, weld::Button&, void)
{
SfxStringItem aStyle(SID_STYLE_EDIT, m_xParaLayLB->get_selected_text());
SfxUInt16Item aFamily(SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Para));
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell();
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetDialogController())->GetWrtShell();
rSh.GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_STYLE_EDIT,
SfxCallMode::SYNCHRON,
{ &aStyle, &aFamily });
......@@ -3567,7 +3546,7 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, StdHdl, weld::Button&, void)
IMPL_LINK_NOARG(SwTOXStylesTabPage, DoubleClickHdl, weld::TreeView&, void)
{
const OUString aTmpName(m_xParaLayLB->get_selected_text());
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell();
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetDialogController())->GetWrtShell();
if(m_xParaLayLB->get_selected_index() != -1 &&
(m_xLevelLB->get_selected_index() == 0 || SwMultiTOXTabDialog::IsNoNum(rSh, aTmpName)))
......@@ -3579,7 +3558,7 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, EnableSelectHdl, weld::TreeView&, void)
{
m_xStdBT->set_sensitive(m_xLevelLB->get_selected_index() != -1);
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell();
SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetDialogController())->GetWrtShell();
const OUString aTmpName(m_xParaLayLB->get_selected_text());
m_xAssignBT->set_sensitive(m_xParaLayLB->get_selected_index() != -1 &&
m_xLevelLB->get_selected_index() != -1 &&
......@@ -3589,7 +3568,7 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, EnableSelectHdl, weld::TreeView&, void)
void SwTOXStylesTabPage::Modify()
{
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
if (pTOXDlg)
{
GetForm() = *m_pCurrentForm;
......
......@@ -43,7 +43,7 @@ class SwTOXWidget;
class SwTOXEdit;
class SwTOXButton;
class SwTOXEntryTabPage;
class SwOneExampleFrame;
class OneExampleFrame;
class SwWrtShell;
namespace com{namespace sun{namespace star{
......@@ -59,20 +59,11 @@ struct SwIndexSections_Impl
css::uno::Reference< css::text::XDocumentIndex > xDocumentIndex;
};
class SwMultiTOXTabDialog : public SfxTabDialog
class SwMultiTOXTabDialog : public SfxTabDialogController
{
VclPtr<vcl::Window> m_pExampleContainerWIN;
VclPtr<CheckBox> m_pShowExampleCB;
std::unique_ptr<SwTOXMgr> m_pMgr;
SwWrtShell& m_rWrtShell;
sal_uInt16 m_nSelectId;
sal_uInt16 m_nColumnId;
sal_uInt16 m_nBackGroundId;
sal_uInt16 m_nEntriesId;
std::unique_ptr<SwOneExampleFrame> m_pExampleFrame;
struct TypeData
{
std::unique_ptr<SwForm> m_pForm;
......@@ -92,21 +83,24 @@ class SwMultiTOXTabDialog : public SfxTabDialog
bool m_bExampleCreated;
bool const m_bGlobalFlag;
std::unique_ptr<OneExampleFrame> m_xExampleFrame;
std::unique_ptr<weld::CheckButton> m_xShowExampleCB;
std::unique_ptr<weld::CustomWeld> m_xExampleFrameWin;
virtual short Ok() override;
std::unique_ptr<SwTOXDescription> CreateTOXDescFromTOXBase(const SwTOXBase*pCurTOX);
DECL_LINK(CreateExample_Hdl, SwOneExampleFrame&, void);
DECL_LINK(ShowPreviewHdl, Button*, void);
DECL_LINK(CreateExample_Hdl, OneExampleFrame&, void);
DECL_LINK(ShowPreviewHdl, weld::ToggleButton&, void);
public:
SwMultiTOXTabDialog(vcl::Window* pParent, const SfxItemSet& rSet,
SwMultiTOXTabDialog(weld::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell,
SwTOXBase* pCurTOX, sal_uInt16 nToxType,
bool bGlobal);
virtual ~SwMultiTOXTabDialog() override;
virtual void dispose() override;
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
SwForm* GetForm(CurTOXType eType);
......@@ -254,7 +248,10 @@ class SwTokenWindow
OUString m_sAdditionalAccnameString2;
OUString m_sAdditionalAccnameString3;
Idle m_aAdjustPositionsIdle;
VclPtr<SwTOXEntryTabPage> m_pParent;
std::unique_ptr<weld::Container> m_xParentWidget;
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Container> m_xContainer;
std::unique_ptr<weld::Button> m_xLeftScrollWin;
......@@ -270,6 +267,7 @@ class SwTokenWindow
DECL_LINK(TbxFocusBtnHdl, SwTOXWidget&, void);
DECL_LINK(ScrollBtnHdl, weld::Button&, void);
DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
DECL_LINK(AdjustPositionsHdl, const Size&, void);
void SetActiveControl(SwTOXWidget* pSet);
......@@ -436,7 +434,7 @@ class SwTOXStylesTabPage : public SfxTabPage
SwForm& GetForm()
{
SwMultiTOXTabDialog* pDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog());
SwMultiTOXTabDialog* pDlg = static_cast<SwMultiTOXTabDialog*>(GetDialogController());
return *pDlg->GetForm(pDlg->GetCurrentTOXType());
}
......
......@@ -24,6 +24,8 @@
#include <vcl/fixed.hxx>
#include <vcl/layout.hxx>
#include <vcl/idle.hxx>
#include <vcl/weld.hxx>
#include <vcl/customweld.hxx>
#include "actctrl.hxx"
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
......@@ -101,6 +103,50 @@ public:
static void CreateErrorMessage();
};
class SW_DLLPUBLIC OneExampleFrame : public weld::CustomWidgetController
{
ScopedVclPtr<VirtualDevice> m_xVirDev;
css::uno::Reference< css::frame::XModel > m_xModel;
css::uno::Reference< css::frame::XController > m_xController;
css::uno::Reference< css::text::XTextCursor > m_xCursor;
Idle m_aLoadedIdle;
Link<OneExampleFrame&,void> m_aInitializedLink;
OUString m_sArgumentURL;
SwView* const m_pModuleView;
sal_uInt32 const m_nStyleFlags;
bool m_bIsInitialized;
DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
void PopupHdl(const OString& rId);
SAL_DLLPRIVATE void CreateControl();
SAL_DLLPRIVATE void DisposeControl();
public:
OneExampleFrame(sal_uInt32 nStyleFlags,
const Link<OneExampleFrame&,void>* pInitalizedLink,
const OUString* pURL = nullptr);
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
virtual bool ContextMenu(const CommandEvent& rCEvt) override;
virtual ~OneExampleFrame() override;
css::uno::Reference< css::frame::XModel > & GetModel() {return m_xModel;}
css::uno::Reference< css::frame::XController > & GetController() {return m_xController;}
css::uno::Reference< css::text::XTextCursor > & GetTextCursor() {return m_xCursor;}
void ClearDocument();
bool IsInitialized() const {return m_bIsInitialized;}
bool CreatePopup(const Point& rPt);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -49,7 +49,6 @@ void SwTextShell::ExecIdx(SfxRequest const &rReq)
pArgs->GetItemState(nSlot, false, &pItem );
SfxViewFrame* pVFrame = GetView().GetViewFrame();
vcl::Window *pMDI = &pVFrame->GetWindow();
switch( nSlot )
{
......@@ -133,9 +132,11 @@ void SwTextShell::ExecIdx(SfxRequest const &rReq)
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
VclPtr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog(
pMDI, aSet, rSh, const_cast<SwTOXBase*>(pCurTOX),
GetView().GetFrameWeld(), aSet, rSh, const_cast<SwTOXBase*>(pCurTOX),
bGlobal));
pDlg->StartExecuteAsync(nullptr);
pDlg->StartExecuteAsync([pDlg](sal_Int32 /*nResult*/){
pDlg->disposeOnce();
});
}
break;
case FN_REMOVE_CUR_TOX:
......
......@@ -906,7 +906,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
ScopedVclPtr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog(
this, aSet,
GetFrameWeld(), aSet,
*m_pActiveShell,
nullptr,
true));
......
......@@ -24,9 +24,13 @@
#include <unotools.hxx>
#include <unoprnms.hxx>
#include <i18nutil/unicode.hxx>
#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <svtools/colorcfg.hxx>
#include <vcl/jobset.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
#include <vcl/weld.hxx>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XScreenCursor.hpp>
#include <com/sun/star/view/DocumentZoomType.hpp>
......@@ -281,7 +285,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void )
//From here, a cursor is defined, which goes through the template,
//and overwrites the template words where it is necessary.
uno::Reference< lang::XUnoTunnel> xTunnel( m_xCursor, uno::UNO_QUERY);
uno::Reference< lang::XUnoTunnel> xTunnel(m_xCursor, uno::UNO_QUERY);
if( xTunnel.is() )
{
OTextCursorHelper* pCursor = reinterpret_cast<OTextCursorHelper*>( xTunnel->getSomething(
......@@ -507,6 +511,412 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu, bool )
return false;
};
OneExampleFrame::OneExampleFrame(sal_uInt32 nFlags,
const Link<OneExampleFrame&,void>* pInitializedLink,
const OUString* pURL)
: m_aLoadedIdle("sw uibase OneExampleFrame Loaded")
, m_pModuleView(SW_MOD()->GetView())
, m_nStyleFlags(nFlags)
, m_bIsInitialized(false)
{
if (pURL && !pURL->isEmpty())
m_sArgumentURL = *pURL;
if( pInitializedLink )
m_aInitializedLink = *pInitializedLink;
// the controller is asynchronously set
m_aLoadedIdle.SetInvokeHandler(LINK(this, OneExampleFrame, TimeoutHdl));
m_aLoadedIdle.SetPriority(TaskPriority::HIGH_IDLE);
}
void OneExampleFrame::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
CustomWidgetController::SetDrawingArea(pDrawingArea);
m_xVirDev = VclPtr<VirtualDevice>::Create();
Size aSize(m_xVirDev->LogicToPixel(Size(150, 188), MapMode(MapUnit::MapAppFont)));
pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
SetOutputSizePixel(aSize);
CreateControl();
}
bool OneExampleFrame::ContextMenu(const CommandEvent& rCEvt)
{
switch (rCEvt.GetCommand())
{
case CommandEventId::ContextMenu:
{
//#125881# quickly clicking crashes because the control is not fully initialized
if (GetController().is())
return CreatePopup(rCEvt.GetMousePosPixel());
}
break;
default:;
break;
}
return false;
}
void OneExampleFrame::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
Size aSize(GetOutputSizePixel());
// m_xVirDev instead of rRenderContext just to avoid overlays in writer re-triggering
// invalidate on rRenderContext if it is a vcl::Window, which is the "classic" gen mode
m_xVirDev->SetOutputSizePixel(aSize);
Color aBgColor = SW_MOD()->GetColorConfig().GetColorValue(::svtools::DOCCOLOR).nColor;
m_xVirDev->DrawWallpaper(tools::Rectangle(Point(), aSize), aBgColor);
OTextCursorHelper* pCursor = nullptr;
uno::Reference<lang::XUnoTunnel> xTunnel(m_xCursor, uno::UNO_QUERY);
if (xTunnel.is())
{
pCursor = reinterpret_cast<OTextCursorHelper*>(xTunnel->getSomething(
OTextCursorHelper::getUnoTunnelId()));
}
if (pCursor)
{
uno::Reference<view::XViewSettingsSupplier> xSettings(m_xController, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xViewProps = xSettings->getViewSettings();
uno::Any aZoom = xViewProps->getPropertyValue(UNO_NAME_ZOOM_VALUE);
sal_Int16 nZoom = 100;
aZoom >>= nZoom;
double fZoom = 100.0 / nZoom;
m_xVirDev->Push(PushFlags::ALL);
m_xVirDev->SetMapMode(MapMode(MapUnit::MapTwip));
SwDoc *pDoc = pCursor->GetDoc();
SwDocShell* pShell = pDoc->GetDocShell();
tools::Rectangle aRect(Point(), m_xVirDev->PixelToLogic(aSize));
pShell->SetVisArea(tools::Rectangle(Point(), Size(aRect.GetWidth() * fZoom,
aRect.GetHeight() * fZoom)));
pShell->DoDraw(m_xVirDev.get(), aRect.TopLeft(), aRect.GetSize(), JobSetup(), ASPECT_CONTENT);
m_xVirDev->Pop();
}
rRenderContext.DrawOutDev(Point(), aSize, Point(), aSize, *m_xVirDev);
}
OneExampleFrame::~OneExampleFrame()
{
DisposeControl();
}
void OneExampleFrame::CreateControl()
{
// create new doc
OUString sTempURL(cFactory);
if(!m_sArgumentURL.isEmpty())
sTempURL = m_sArgumentURL;
uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(::comphelper::getProcessComponentContext());
uno::Reference<frame::XComponentLoader> xLoader(xDesktop, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> args( comphelper::InitPropertySequence({
{ "DocumentService", uno::Any(OUString("com.sun.star.text.TextDocument")) },
{ "OpenFlags", uno::Any(OUString("-RB")) },
{ "Referer", uno::Any(OUString("private:user")) },
{ "ReadOnly", uno::Any(true) },
{ "Hidden", uno::Any(true) }
}));
m_xModel.set(xLoader->loadComponentFromURL(sTempURL, "_blank", 0, args), uno::UNO_QUERY);
m_aLoadedIdle.Start();
}
void OneExampleFrame::DisposeControl()
{
m_aLoadedIdle.Stop();
m_xCursor = nullptr;
if (m_xModel)
{
m_xModel->dispose();
m_xModel = nullptr;
}
m_xController = nullptr;
}
IMPL_LINK( OneExampleFrame, TimeoutHdl, Timer*, pTimer, void )
{
if (!m_xModel.is())
return;
m_xController = m_xModel->getCurrentController();
if (m_xController.is())
{
uno::Reference<frame::XFrame> xFrame(m_xController->getFrame(), uno::UNO_QUERY);
uno::Reference< beans::XPropertySet > xPropSet( xFrame, uno::UNO_QUERY );
if ( xPropSet.is() )
{
try
{
uno::Reference< frame::XLayoutManager > xLayoutManager;
uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
aValue >>= xLayoutManager;
if ( xLayoutManager.is() )
xLayoutManager->setVisible( false );
}
catch (const uno::Exception&)
{
}
}
//now the ViewOptions should be set properly
uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY);
uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
const uno::Any aTrueSet( true );
const uno::Any aFalseSet( false );
if( !m_bIsInitialized )
{
xViewProps->setPropertyValue(UNO_NAME_SHOW_BREAKS, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_DRAWINGS, aTrueSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_FIELD_COMMANDS, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_GRAPHICS, aTrueSet);
xViewProps->setPropertyValue(UNO_NAME_HIDE_WHITESPACE, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_HIDDEN_TEXT, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_HORI_RULER, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_PARA_BREAKS, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_PROTECTED_SPACES, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_SOFT_HYPHENS, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_SPACES, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_TABLES, aTrueSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_TABSTOPS, aFalseSet);
xViewProps->setPropertyValue(UNO_NAME_SHOW_VERT_RULER, aFalseSet);
if(0 ==(m_nStyleFlags&EX_SHOW_ONLINE_LAYOUT))
{
uno::Any aZoom;
aZoom <<= sal_Int16(view::DocumentZoomType::PAGE_WIDTH_EXACT);
xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
}
else
{
uno::Any aZoom;
aZoom <<= sal_Int16(view::DocumentZoomType::BY_VALUE);
xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
sal_Int16 nZoomValue = 75;
if(EX_SHOW_BUSINESS_CARDS == m_nStyleFlags)
{
nZoomValue = 80;
}
aZoom <<= nZoomValue;
xViewProps->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom);
}
// set onlinelayout property after setting the zoom
disableScrollBars(xViewProps, (m_nStyleFlags&EX_SHOW_ONLINE_LAYOUT) != 0);
m_bIsInitialized = true;
}
uno::Reference< text::XTextDocument > xDoc(m_xModel, uno::UNO_QUERY);
uno::Reference< text::XText > xText = xDoc->getText();
m_xCursor = xText->createTextCursor();
//From here, a cursor is defined, which goes through the template,
//and overwrites the template words where it is necessary.
OTextCursorHelper* pCursor = nullptr;
uno::Reference< lang::XUnoTunnel> xTunnel( m_xCursor, uno::UNO_QUERY);
if (xTunnel.is())
{
pCursor = reinterpret_cast<OTextCursorHelper*>(xTunnel->getSomething(
OTextCursorHelper::getUnoTunnelId()));
}
SwDoc *pDoc = pCursor ? pCursor->GetDoc() : nullptr;
if (pDoc)
{
SwEditShell* pSh = pDoc->GetEditShell();
do
{
if (pSh->GetCurWord() == "HEADING1")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_HEADING1));
}
else if (pSh->GetCurWord() == "ENTRY1")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_ENTRY1));
}
else if (pSh->GetCurWord() == "HEADING11")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_HEADING11));
}
else if (pSh->GetCurWord() == "ENTRY11")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_ENTRY11));
}
else if (pSh->GetCurWord() == "HEADING12")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_HEADING12));
}
else if (pSh->GetCurWord() == "ENTRY12")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_ENTRY12));
}
else if (pSh->GetCurWord() == "TABLE1")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_TABLE1));
}
else if (pSh->GetCurWord() == "IMAGE1")
{
pSh->Overwrite(SwResId(STR_IDXEXAMPLE_IDXTXT_IMAGE1));
}
}
while(pSh->Right(sal_uInt16(1), sal_uInt16(1), true));
}
uno::Reference< beans::XPropertySet > xCursorProp(m_xCursor, uno::UNO_QUERY);
uno::Any aPageStyle = xCursorProp->getPropertyValue(UNO_NAME_PAGE_STYLE_NAME);
OUString sPageStyle;
aPageStyle >>= sPageStyle;
uno::Reference< style::XStyleFamiliesSupplier > xSSupp( xDoc, uno::UNO_QUERY);
uno::Reference< container::XNameAccess > xStyles = xSSupp->getStyleFamilies();
uno::Any aPFamily = xStyles->getByName( "PageStyles" );
uno::Reference< container::XNameContainer > xPFamily;
if( EX_SHOW_DEFAULT_PAGE != m_nStyleFlags
&& (aPFamily >>= xPFamily) && !sPageStyle.isEmpty() )
{
uno::Any aPStyle = xPFamily->getByName( sPageStyle );
uno::Reference< style::XStyle > xPStyle;
aPStyle >>= xPStyle;
uno::Reference< beans::XPropertySet > xPProp(xPStyle, uno::UNO_QUERY);
uno::Any aSize = xPProp->getPropertyValue(UNO_NAME_SIZE);
awt::Size aPSize;
aSize >>= aPSize;
//TODO: set page width to card width
aPSize.Width = 10000;
aSize <<= aPSize;
xPProp->setPropertyValue(UNO_NAME_SIZE, aSize);
uno::Any aZero; aZero <<= sal_Int32(0);
xPProp->setPropertyValue(UNO_NAME_LEFT_MARGIN, aZero);
xPProp->setPropertyValue(UNO_NAME_RIGHT_MARGIN, aZero);
}
uno::Reference<awt::XWindow> xWin = xFrame->getContainerWindow();
Size aWinSize(GetOutputSizePixel());
xWin->setPosSize(0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE);
// can only be done here - the SFX changes the ScrollBar values
disableScrollBars(xViewProps, (m_nStyleFlags&EX_SHOW_ONLINE_LAYOUT) != 0);
m_aInitializedLink.Call(*this);
uno::Reference< text::XTextViewCursorSupplier > xCursorSupp(m_xController, uno::UNO_QUERY);
uno::Reference< view::XScreenCursor > xScrCursor(xCursorSupp->getViewCursor(), uno::UNO_QUERY);
if(xScrCursor.is())
xScrCursor->screenUp();
if (pDoc)
{
SwEditShell* pSh = pDoc->GetEditShell();
if( pSh->ActionCount() )
{
pSh->EndAllAction();
pSh->UnlockPaint();
}
}
SW_MOD()->SetView(m_pModuleView);
Invalidate();
}
else
pTimer->Start();
}
void OneExampleFrame::ClearDocument()
{
uno::Reference< lang::XUnoTunnel> xTunnel( m_xCursor, uno::UNO_QUERY);
if( xTunnel.is() )
{
OTextCursorHelper* pCursor = reinterpret_cast<OTextCursorHelper*>(xTunnel->getSomething(
OTextCursorHelper::getUnoTunnelId()) );
if( pCursor )
{
SwDoc* pDoc = pCursor->GetDoc();
SwEditShell* pSh = pDoc->GetEditShell();
pSh->LockPaint();
pSh->StartAllAction();
pSh->KillPams();
pSh->ClearMark();
pDoc->ClearDoc();
pSh->ClearUpCursors();
if( m_aLoadedIdle.IsActive())
{
pSh->EndAllAction();
pSh->UnlockPaint();
}
m_aLoadedIdle.Start();
}
else
{
m_xCursor->gotoStart(false);
m_xCursor->gotoEnd(true);
m_xCursor->setString(OUString());
}
}
}
bool OneExampleFrame::CreatePopup(const Point& rPt)
{
if (EX_SHOW_ONLINE_LAYOUT != m_nStyleFlags)
return false;
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "modules/swriter/ui/previewmenu.ui"));
std::unique_ptr<weld::Menu> xPop(xBuilder->weld_menu("previewmenu"));
uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY);
uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
uno::Any aZoom = xViewProps->getPropertyValue(UNO_NAME_ZOOM_VALUE);
sal_Int16 nZoom = 0;
aZoom >>= nZoom;
for (size_t i = 0; i < SAL_N_ELEMENTS(nZoomValues); ++i)
{
OUString sTemp = unicode::formatPercent(nZoomValues[i],
Application::GetSettings().GetUILanguageTag());
OString sIdent = "zoom" + OString::number(nZoomValues[i]);
xPop->set_label(sIdent, sTemp);
if (nZoom == nZoomValues[i])
xPop->set_active(sIdent, true);
}
PopupHdl(xPop->popup_at_rect(GetDrawingArea(), tools::Rectangle(rPt, Size(1, 1))));
return true;
}
void OneExampleFrame::PopupHdl(const OString& rId)
{
OString sZoomValue;
if (rId.startsWith("zoom", &sZoomValue))
{
sal_Int16 nZoom = sZoomValue.toInt32();
uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY);
uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
uno::Any aZoom;
aZoom <<= nZoom;
xViewProps->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom);
aZoom <<= sal_Int16(view::DocumentZoomType::BY_VALUE);
xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
}
Invalidate();
}
SwFrameCtrlWindow::SwFrameCtrlWindow(vcl::Window* pParent, SwOneExampleFrame* pFrame)
: VclEventBox(pParent)
, pExampleFrame(pFrame)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkMenu" id="previewmenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkRadioMenuItem" id="zoom20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="zoom40">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="zoom50">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="zoom75">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="zoom100">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="TocDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="tocdialog|TocDialog">Table of Contents, Index or Bibliography</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
......@@ -18,14 +23,11 @@
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
<packing>
......@@ -35,11 +37,14 @@
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-close</property>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
<packing>
......@@ -49,8 +54,8 @@
</packing>
</child>
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<object class="GtkButton" id="cancel">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......@@ -60,12 +65,11 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</property>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......@@ -75,6 +79,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
......@@ -110,22 +115,6 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkDrawingArea" id="example">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child internal-child="accessible">
<object class="AtkObject" id="example-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="tocdialog|example-atkobject">Preview</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
......@@ -141,6 +130,30 @@
<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">
......@@ -160,6 +173,30 @@
<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>
<packing>
<property name="position">1</property>
......@@ -183,6 +220,30 @@
<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>
<packing>
<property name="position">2</property>
......@@ -206,6 +267,30 @@
<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>
<packing>
<property name="position">3</property>
......@@ -229,6 +314,30 @@
<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>
<packing>
<property name="position">4</property>
......@@ -252,6 +361,23 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkDrawingArea" id="example">
<property name="can_focus">False</property>
<property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<property name="no_show_all">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="example-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="tocdialog|example-atkobject">Preview</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -262,10 +388,10 @@
</object>
</child>
<action-widgets>
<action-widget response="101">reset</action-widget>
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
<action-widget response="101">reset</action-widget>
</action-widgets>
</object>
</interface>
......@@ -2,15 +2,6 @@
<!-- 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 id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">19.989999999999998</property>
<property name="step_increment">0.050000000000000003</property>
......@@ -26,32 +17,40 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc10712.png</property>
<property name="icon_name">res/sc10712.png</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc10713.png</property>
<property name="icon_name">res/sc10713.png</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc10712.png</property>
<property name="icon_name">res/sc10712.png</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc10712.png</property>
<property name="icon_name">res/sc10712.png</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc10713.png</property>
<property name="icon_name">res/sc10713.png</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc10713.png</property>
<property name="icon_name">res/sc10713.png</property>
</object>
<object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkBox" id="TocEntriesPage">
<property name="visible">True</property>
......@@ -162,6 +161,7 @@
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="row_spacing">12</property>
<child>
......@@ -473,8 +473,8 @@
<property name="hexpand">True</property>
<child>
<object class="GtkComboBoxText" id="authfield">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -492,9 +492,9 @@
<child>
<object class="GtkButton" id="insert">
<property name="label" translatable="yes" context="tocentriespage|insert">_Insert</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="use_underline">True</property>
</object>
<packing>
......@@ -506,9 +506,9 @@
<child>
<object class="GtkButton" id="remove">
<property name="label" translatable="yes" context="tocentriespage|remove">_Remove</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="use_underline">True</property>
</object>
<packing>
......@@ -520,9 +520,9 @@
<child>
<object class="GtkButton" id="chapterno">
<property name="label" translatable="yes" context="tocentriespage|chapterno">Chapter No.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="use_underline">True</property>
</object>
<packing>
......@@ -748,8 +748,8 @@
</child>
<child>
<object class="GtkFrame" id="sortingframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
......@@ -821,8 +821,8 @@
</child>
<child>
<object class="GtkFrame" id="sortkeyframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -26,6 +26,8 @@
<object class="GtkBox" id="TocStylesPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
......
......@@ -45,12 +45,49 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkGrid" id="ctrl">
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<placeholder/>
<object class="GtkGrid" id="ctrl">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="vexpand">True</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>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
</child>
......
......@@ -843,6 +843,10 @@ public:
{
return m_xMenu->IsItemChecked(m_xMenu->GetItemId(rIdent));
}
virtual void set_label(const OString& rIdent, const OUString& rLabel) override
{
m_xMenu->SetItemText(m_xMenu->GetItemId(rIdent), rLabel);
}
virtual void set_visible(const OString& rIdent, bool bShow) override
{
m_xMenu->ShowItem(m_xMenu->GetItemId(rIdent), bShow);
......
......@@ -5295,6 +5295,11 @@ public:
set_item_visible(rIdent, bShow);
}
virtual void set_label(const OString& rIdent, const OUString& rLabel) override
{
set_item_label(rIdent, rLabel);
}
virtual void insert_separator(int pos, const OUString& rId) override
{
MenuHelper::insert_separator(pos, rId);
......
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