summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-30 09:43:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-07 14:42:31 +0200
commita2304f62e963b413b7575bedfb8d34e5f2d3ea58 (patch)
treee92b8fce9d381deb02a9823ca24cd20a272c08d0 /sfx2
parent1a86f5643f3c36ead2f9aee42571664c2454ccf7 (diff)
weld writer page style dialog and SvxBorderBackgroundDlg
writer, format page is complete Change-Id: I09f6e4354461c4374cdb0d0e0754dfee35415b45 Reviewed-on: https://gerrit.libreoffice.org/60058 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/charwin.cxx2
-rw-r--r--sfx2/source/dialog/mgetempl.cxx2
-rw-r--r--sfx2/source/dialog/tabdlg.cxx43
-rw-r--r--sfx2/source/view/printer.cxx2
-rw-r--r--sfx2/source/view/viewprn.cxx2
-rw-r--r--sfx2/uiconfig/ui/managestylepage.ui2
6 files changed, 46 insertions, 7 deletions
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index a585361a3296..1a1fac096ac2 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -38,6 +38,7 @@ SvxCharView::SvxCharView(const VclPtr<VirtualDevice>& rVirDev)
void SvxCharView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
vcl::Font aFont = rStyleSettings.GetLabelFont();
const Size aFontSize = aFont.GetFontSize();
@@ -47,7 +48,6 @@ void SvxCharView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
pDrawingArea->set_size_request(mxVirDev->approximate_digit_width() * 2,
mxVirDev->GetTextHeight());
mxVirDev->Pop();
- CustomWidgetController::SetDrawingArea(pDrawingArea);
}
void SvxCharView::GetFocus()
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 663a26295453..86cbaef7b9f5 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -47,7 +47,7 @@
*/
SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const SfxItemSet& rAttrSet)
: SfxTabPage(pParent, "sfx/ui/managestylepage.ui", "ManageStylePage", &rAttrSet)
- , pStyle(&static_cast<SfxStyleDialog*>(GetParentDialog())->GetStyleSheet())
+ , pStyle(pParent.pPage ? &static_cast<SfxStyleDialogController*>(pParent.pController)->GetStyleSheet() : &static_cast<SfxStyleDialog*>(GetParentDialog())->GetStyleSheet())
, pItem(nullptr)
, bModified(false)
, aName(pStyle->GetName())
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 57c3f291084e..7f763e306532 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -196,13 +196,19 @@ SfxTabPage::SfxTabPage(TabPageParent pParent, const OUString& rUIXMLDescription,
SfxTabPage::~SfxTabPage()
{
+ if (m_xContainer)
+ {
+ std::unique_ptr<weld::Container> xParent(m_xContainer->weld_parent());
+ if (xParent)
+ xParent->move(m_xContainer.get(), nullptr);
+ }
+ m_xContainer.reset();
disposeOnce();
}
void SfxTabPage::dispose()
{
pImpl.reset();
- m_xContainer.reset();
m_xBuilder.reset();
TabPage::dispose();
}
@@ -356,6 +362,13 @@ OString SfxTabPage::GetConfigId() const
return sId;
}
+weld::Window* SfxTabPage::GetDialogFrameWeld() const
+{
+ if (pImpl->mpDialogController)
+ return pImpl->mpDialogController->getDialog();
+ return GetFrameWeld();
+}
+
SfxTabDialog::SfxTabDialog
/* [Description]
@@ -2003,7 +2016,8 @@ void SfxTabDialogController::CreatePages()
if (pDataObject->pTabPage)
continue;
weld::Container* pPage = m_xTabCtrl->get_page(pDataObject->sId);
- pDataObject->pTabPage = (pDataObject->fnCreatePage)(pPage, m_pSet.get());
+ // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent
+ pDataObject->pTabPage = (pDataObject->fnCreatePage)(TabPageParent(pPage, this), m_pSet.get());
pDataObject->pTabPage->SetDialogController(this);
OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8);
@@ -2189,4 +2203,29 @@ SfxTabPage* SfxTabDialogController::GetTabPage(const OString& rPageId) const
return nullptr;
}
+void SfxTabDialogController::SetApplyHandler(const Link<weld::Button&, void>& _rHdl)
+{
+ DBG_ASSERT( m_xApplyBtn, "SfxTabDialog::GetApplyHandler: no apply button enabled!" );
+ if (m_xApplyBtn)
+ m_xApplyBtn->connect_clicked(_rHdl);
+}
+
+bool SfxTabDialogController::Apply()
+{
+ bool bApplied = false;
+ if (PrepareLeaveCurrentPage())
+ {
+ bApplied = (Ok() == RET_OK);
+ //let the pages update their saved values
+ GetInputSetImpl()->Put(*GetOutputItemSet());
+ for (auto pDataObject : m_pImpl->aData)
+ {
+ if (!pDataObject->pTabPage)
+ continue;
+ pDataObject->pTabPage->ChangesApplied();
+ }
+ }
+ return bApplied;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index 7d04b54226aa..31139afaca0d 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -200,7 +200,7 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog(weld::Window *pParent,
, m_xContainer(m_xDialog->weld_content_area())
{
// Insert TabPage
- pPage.reset(pViewShell->CreatePrintOptionsPage(m_xContainer.get(), *pOptions));
+ pPage.reset(pViewShell->CreatePrintOptionsPage(TabPageParent(m_xContainer.get(), this), *pOptions));
DBG_ASSERT( pPage, "CreatePrintOptions != SFX_VIEW_HAS_PRINTOPTIONS" );
if( pPage )
{
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 2d29c7b378e6..1bbc296bf371 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -893,7 +893,7 @@ sal_uInt16 SfxViewShell::SetPrinter( SfxPrinter* /*pNewPrinter*/, SfxPrinterChan
VclPtr<SfxTabPage> SfxViewShell::CreatePrintOptionsPage
(
- weld::Container* /*pPage*/,
+ TabPageParent /*pParent*/,
const SfxItemSet& /*rOptions*/
)
{
diff --git a/sfx2/uiconfig/ui/managestylepage.ui b/sfx2/uiconfig/ui/managestylepage.ui
index fd0c855a99d6..30dbb6ddf707 100644
--- a/sfx2/uiconfig/ui/managestylepage.ui
+++ b/sfx2/uiconfig/ui/managestylepage.ui
@@ -165,7 +165,7 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow">
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>