summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-20 11:06:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-22 21:29:36 +0200
commit60f3e4b843da89678e022eed837ee66e726b1920 (patch)
tree4cffea5d364e3ed9bd3e68c7b471f313c237a98e /sfx2
parent4a7ebfea57094b914c4b1c3e46936dbf67dec499 (diff)
place an intermediate class as parent for SfxTabPages
so a SfxTabPage can be parented by a vcl::Window or a welded native notebook tabpage. That ways the same SfxTabPage can be used at the same time in both a native dialog or a vcl dialog. The impl can be changed to the weld api, and when hosted in a native dialog the vcl impl of that will be instantiated, while native otherwise. e.g. print options appearing in print options dialog and general options. This allows incremental changeover. Change-Id: I6f1fed1e8d0898b01853bb878757bad41cbf9bba Reviewed-on: https://gerrit.libreoffice.org/53193 Tested-by: Jenkins <ci@libreoffice.org> 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/appl/module.cxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx16
-rw-r--r--sfx2/source/dialog/documentfontsdialog.cxx4
-rw-r--r--sfx2/source/dialog/mgetempl.cxx4
-rw-r--r--sfx2/source/dialog/printopt.cxx4
-rw-r--r--sfx2/source/dialog/securitypage.cxx4
-rw-r--r--sfx2/source/dialog/tabdlg.cxx15
-rw-r--r--sfx2/source/inc/documentfontsdialog.hxx2
-rw-r--r--sfx2/source/view/viewprn.cxx2
9 files changed, 33 insertions, 20 deletions
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 060cc8b7e68e..39274e31b8c6 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -188,7 +188,7 @@ SfxChildWinFactArr_Impl* SfxModule::GetChildWinFactories_Impl() const
return pImpl->pFactArr.get();
}
-VclPtr<SfxTabPage> SfxModule::CreateTabPage( sal_uInt16, vcl::Window*, const SfxItemSet& )
+VclPtr<SfxTabPage> SfxModule::CreateTabPage(sal_uInt16, TabPageParent, const SfxItemSet&)
{
return VclPtr<SfxTabPage>();
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 86977473f966..017ca402dd89 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -634,9 +634,9 @@ void SfxDocumentDescPage::dispose()
SfxTabPage::dispose();
}
-VclPtr<SfxTabPage> SfxDocumentDescPage::Create(vcl::Window *pParent, const SfxItemSet *rItemSet)
+VclPtr<SfxTabPage> SfxDocumentDescPage::Create(TabPageParent pParent, const SfxItemSet *rItemSet)
{
- return VclPtr<SfxDocumentDescPage>::Create(pParent, *rItemSet);
+ return VclPtr<SfxDocumentDescPage>::Create(pParent.pParent, *rItemSet);
}
bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet)
@@ -930,9 +930,9 @@ void SfxDocumentPage::ImplCheckPasswordState()
m_pChangePassBtn->Disable();
}
-VclPtr<SfxTabPage> SfxDocumentPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
+VclPtr<SfxTabPage> SfxDocumentPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
{
- return VclPtr<SfxDocumentPage>::Create( pParent, *rItemSet );
+ return VclPtr<SfxDocumentPage>::Create( pParent.pParent, *rItemSet );
}
void SfxDocumentPage::EnableUseUserData()
@@ -2221,9 +2221,9 @@ DeactivateRC SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
return nRet;
}
-VclPtr<SfxTabPage> SfxCustomPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
+VclPtr<SfxTabPage> SfxCustomPropertiesPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
{
- return VclPtr<SfxCustomPropertiesPage>::Create( pParent, *rItemSet );
+ return VclPtr<SfxCustomPropertiesPage>::Create( pParent.pParent, *rItemSet );
}
CmisValue::CmisValue( vcl::Window* pParent, const OUString& aStr )
@@ -2717,9 +2717,9 @@ DeactivateRC SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
return DeactivateRC::LeavePage;
}
-VclPtr<SfxTabPage> SfxCmisPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
+VclPtr<SfxTabPage> SfxCmisPropertiesPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
{
- return VclPtr<SfxCmisPropertiesPage>::Create( pParent, *rItemSet );
+ return VclPtr<SfxCmisPropertiesPage>::Create( pParent.pParent, *rItemSet );
}
void SfxCmisPropertiesPage::SetPosSizePixel(const Point& rAllocPos, const Size& rAllocation)
diff --git a/sfx2/source/dialog/documentfontsdialog.cxx b/sfx2/source/dialog/documentfontsdialog.cxx
index abf8af73a747..77177c7f3eeb 100644
--- a/sfx2/source/dialog/documentfontsdialog.cxx
+++ b/sfx2/source/dialog/documentfontsdialog.cxx
@@ -23,9 +23,9 @@
using namespace ::com::sun::star;
-VclPtr<SfxTabPage> SfxDocumentFontsPage::Create( vcl::Window* parent, const SfxItemSet* set )
+VclPtr<SfxTabPage> SfxDocumentFontsPage::Create(TabPageParent parent, const SfxItemSet* set)
{
- return VclPtr<SfxDocumentFontsPage>::Create( parent, *set );
+ return VclPtr<SfxDocumentFontsPage>::Create( parent.pParent, *set );
}
SfxDocumentFontsPage::SfxDocumentFontsPage( vcl::Window* parent, const SfxItemSet& set )
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 77eed3e403e7..611a7359b9f9 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -534,10 +534,10 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ )
}
-VclPtr<SfxTabPage> SfxManageStyleSheetPage::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> SfxManageStyleSheetPage::Create( TabPageParent pParent,
const SfxItemSet *rAttrSet )
{
- return VclPtr<SfxManageStyleSheetPage>::Create( pParent, *rAttrSet );
+ return VclPtr<SfxManageStyleSheetPage>::Create( pParent.pParent, *rAttrSet );
}
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 65f9ea8e1e9a..c50da65acdbc 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -113,9 +113,9 @@ void SfxCommonPrintOptionsTabPage::dispose()
SfxTabPage::dispose();
}
-VclPtr<SfxTabPage> SfxCommonPrintOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SfxCommonPrintOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxCommonPrintOptionsTabPage>::Create( pParent, *rAttrSet );
+ return VclPtr<SfxCommonPrintOptionsTabPage>::Create( pParent.pParent, *rAttrSet );
}
vcl::Window* SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const vcl::Window* pWindow ) const
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index 8633a5e0eff9..cea3583a98cc 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -415,9 +415,9 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl, Button*, void)
}
-VclPtr<SfxTabPage> SfxSecurityPage::Create( vcl::Window * pParent, const SfxItemSet * rItemSet )
+VclPtr<SfxTabPage> SfxSecurityPage::Create( TabPageParent pParent, const SfxItemSet * rItemSet )
{
- return VclPtr<SfxSecurityPage>::Create( pParent, *rItemSet );
+ return VclPtr<SfxSecurityPage>::Create( pParent.pParent, *rItemSet );
}
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index d4db8a054e4a..c63a62e3fdc5 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -164,6 +164,17 @@ SfxTabPage::SfxTabPage(vcl::Window *pParent, const OString& rID, const OUString&
{
}
+SfxTabPage::SfxTabPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet *rAttrSet)
+ : TabPage(Application::GetDefDialogParent()) //just drag this along hidden in this scenario
+ , pSet ( rAttrSet )
+ , bHasExchangeSupport ( false )
+ , pImpl ( new TabPageImpl )
+ , m_xBuilder(pParent.pPage ? Application::CreateBuilder(pParent.pPage, rUIXMLDescription)
+ : Application::CreateInterimBuilder(pParent.pParent, rUIXMLDescription))
+ , m_xContainer(m_xBuilder->weld_container(rID))
+{
+}
+
SfxTabPage::~SfxTabPage()
{
disposeOnce();
@@ -172,6 +183,8 @@ SfxTabPage::~SfxTabPage()
void SfxTabPage::dispose()
{
pImpl.reset();
+ m_xContainer.reset();
+ m_xBuilder.reset();
TabPage::dispose();
}
@@ -1107,7 +1120,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl, void )
if ( !pTabPage )
{
if ( m_pSet )
- pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, m_pSet );
+ pTabPage = (pDataObject->fnCreatePage)( static_cast<vcl::Window*>(pTabCtrl), m_pSet );
else
pTabPage = (pDataObject->fnCreatePage)
( pTabCtrl, CreateInputItemSet( nId ) );
diff --git a/sfx2/source/inc/documentfontsdialog.hxx b/sfx2/source/inc/documentfontsdialog.hxx
index 4e1b12d6648e..486055954ab1 100644
--- a/sfx2/source/inc/documentfontsdialog.hxx
+++ b/sfx2/source/inc/documentfontsdialog.hxx
@@ -31,7 +31,7 @@ public:
SfxDocumentFontsPage( vcl::Window* parent, const SfxItemSet& set );
virtual ~SfxDocumentFontsPage() override;
virtual void dispose() override;
- static VclPtr<SfxTabPage> Create( vcl::Window* parent, const SfxItemSet* set );
+ static VclPtr<SfxTabPage> Create(TabPageParent parent, const SfxItemSet* set);
protected:
virtual bool FillItemSet( SfxItemSet* set ) override;
virtual void Reset( const SfxItemSet* set ) override;
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 580a4b4295dd..44cc9d509045 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -897,7 +897,7 @@ sal_uInt16 SfxViewShell::SetPrinter( SfxPrinter* /*pNewPrinter*/, SfxPrinterChan
VclPtr<SfxTabPage> SfxViewShell::CreatePrintOptionsPage
(
- vcl::Window* /*pParent*/,
+ TabPageParent /*pParent*/,
const SfxItemSet& /*rOptions*/
)
{