From 1c39485653d97e26aa3d5b51bf2fd0a1f4e14f0c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 2 Nov 2018 22:58:16 +0200 Subject: Start of work in progress on making dialogs work in the iOS app Build the swui library for non-DESKTOP platforms, too. Handle fallout for !HAVE_FEATURE_DBCONNECTIVITY and !HAVE_FEATURE_AVMEDIA (both of which features we for now don't want to bother with in the iOS app). Make VclAbstractDialogFactory::Create() do its thing also on non-DESKTOP. This commit just causes more code to be compiled for the non-DESKTOP case, dialogs in general surely don't actually work yet in the iOS app. For instance: vcl/source/window/builder.cxx:2060: probably need to implement sfxlo-CustomPropertiesControl or add a makesfxlo-CustomPropertiesControl function Change-Id: I579efba605f519dcbf407b675be88c7c6ee0f19b Reviewed-on: https://gerrit.libreoffice.org/62794 Tested-by: Jenkins Reviewed-by: Tor Lillqvist --- sw/Module_sw.mk | 2 +- sw/source/ui/dialog/swdlgfact.cxx | 40 +++++++++++++++++++++++++++++++++++ sw/source/ui/fldui/fldedt.cxx | 4 ++++ sw/source/ui/fldui/fldtdlg.cxx | 11 ++++++++++ sw/source/uibase/dialog/swabstdlg.cxx | 5 +---- sw/source/uibase/shells/basesh.cxx | 4 ++++ 6 files changed, 61 insertions(+), 5 deletions(-) (limited to 'sw') diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 308b4474c5dc..b89b839c7aa0 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -26,7 +26,7 @@ $(eval $(call gb_Module_add_targets,sw,\ Library_msword \ Library_sw \ Library_swd \ - $(call gb_Helper_optional,DESKTOP,Library_swui) \ + Library_swui \ UIConfig_sglobal \ UIConfig_sweb \ UIConfig_swform \ diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index c30b671d3b29..6badd0175224 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include "swdlgfact.hxx" #include #include @@ -377,7 +379,14 @@ void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::A uno::Reference< sdbc::XConnection> xConnection, uno::Reference< sdbc::XResultSet > xResultSet) { +#if HAVE_FEATURE_DBCONNECTIVITY pDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet); +#else + (void) rSelection; + (void) rxSource; + (void) xConnection; + (void) xResultSet; +#endif } bool AbstractDropDownFieldDialog_Impl::PrevButtonPressed() const @@ -800,8 +809,13 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwBreakDlg(weld:: VclPtr SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw) { +#if HAVE_FEATURE_DBCONNECTIVITY VclPtr pDlg = VclPtr::Create(rVw); return VclPtr::Create(pDlg); +#else + (void) rVw; + return nullptr; +#endif } VclPtr SwAbstractDialogFactory_Impl::CreateSwCharDlg(weld::Window* pParent, SwView& pVw, @@ -826,8 +840,16 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwIns uno::Reference xColSupp, const SwDBData& rData) { +#if HAVE_FEATURE_DBCONNECTIVITY VclPtr pDlg = VclPtr::Create( rView, rxSource, xColSupp, rData ); return VclPtr::Create( pDlg ); +#else + (void) rView; + (void) rxSource; + (void) xColSupp; + (void) rData; + return nullptr; +#endif } VclPtr SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg(weld::Window *pParent, SwWrtShell &rSh) @@ -1126,7 +1148,13 @@ VclPtr SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( VclPtr SwAbstractDialogFactory_Impl::CreateMailMergeWizard( SwView& rView, std::shared_ptr& rConfigItem) { +#if HAVE_FEATURE_DBCONNECTIVITY return VclPtr::Create( VclPtr::Create(rView, rConfigItem)); +#else + (void) rView; + (void) rConfigItem; + return nullptr; +#endif } GlossaryGetCurrGroup SwAbstractDialogFactory_Impl::GetGlossaryCurrGroupFunc() @@ -1199,20 +1227,32 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI void SwAbstractDialogFactory_Impl::ExecuteMMResultSaveDialog(weld::Window* pParent) { +#if HAVE_FEATURE_DBCONNECTIVITY SwMMResultSaveDialog aDialog(pParent); aDialog.run(); +#else + (void) pParent; +#endif } void SwAbstractDialogFactory_Impl::ExecuteMMResultPrintDialog(weld::Window* pParent) { +#if HAVE_FEATURE_DBCONNECTIVITY SwMMResultPrintDialog aDialog(pParent); aDialog.run(); +#else + (void) pParent; +#endif } void SwAbstractDialogFactory_Impl::ExecuteMMResultEmailDialog(weld::Window* pParent) { +#if HAVE_FEATURE_DBCONNECTIVITY SwMMResultEmailDialog aDialog(pParent); aDialog.run(); +#else + (void) pParent; +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 353f634bbff8..2f4dfe8020bb 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include #include @@ -190,10 +192,12 @@ VclPtr SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) pTabPage = SwFieldDokInfPage::Create(get_content_area(), pSet); break; } +#if HAVE_FEATURE_DBCONNECTIVITY case GRP_DB: pTabPage = SwFieldDBPage::Create(get_content_area(), nullptr); static_cast(pTabPage.get())->SetWrtShell(*pSh); break; +#endif case GRP_VAR: pTabPage = SwFieldVarPage::Create(get_content_area(), nullptr); break; diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index cfaa6e23f91b..045252a575e8 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include #include @@ -79,6 +81,7 @@ SwFieldDlg::SwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pPa -1, utl::OConfigurationTreeRoot::CM_READONLY); +#if HAVE_FEATURE_DBCONNECTIVITY bool bDatabaseFields = true; aCfgRoot.getNodeValue( OUString("DatabaseFields")) >>= bDatabaseFields; @@ -86,6 +89,7 @@ SwFieldDlg::SwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pPa if (bDatabaseFields) m_nDbId = AddTabPage("database", SwFieldDBPage::Create, nullptr); else +#endif RemoveTabPage("database"); } else @@ -276,6 +280,7 @@ void SwFieldDlg::InsertHdl() void SwFieldDlg::ActivateDatabasePage() { +#if HAVE_FEATURE_DBCONNECTIVITY m_bDataBaseMode = true; ShowPage(m_nDbId); SfxTabPage* pDBPage = GetTabPage(m_nDbId); @@ -289,6 +294,7 @@ void SwFieldDlg::ActivateDatabasePage() RemoveTabPage("docinfo"); RemoveTabPage("ref"); RemoveTabPage("functions"); +#endif } void SwFieldDlg::ShowReferencePage() @@ -298,6 +304,7 @@ void SwFieldDlg::ShowReferencePage() void SwFieldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) { +#if HAVE_FEATURE_DBCONNECTIVITY if (nId == m_nDbId) { SfxDispatcher* pDispatch = m_pBindings->GetDispatcher(); @@ -313,6 +320,10 @@ void SwFieldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) static_cast(rPage).SetWrtShell(static_cast(pViewShell)->GetWrtShell()); } } +#else + (void) nId; + (void) rPage; +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/dialog/swabstdlg.cxx b/sw/source/uibase/dialog/swabstdlg.cxx index 78e8272c897d..f726a8274cb7 100644 --- a/sw/source/uibase/dialog/swabstdlg.cxx +++ b/sw/source/uibase/dialog/swabstdlg.cxx @@ -17,8 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include - #include #include @@ -38,7 +36,6 @@ extern "C" SwAbstractDialogFactory* SwCreateDialogFactory(); SwAbstractDialogFactory* SwAbstractDialogFactory::Create() { SwFuncPtrCreateDialogFactory fp = nullptr; -#if HAVE_FEATURE_DESKTOP #ifndef DISABLE_DYNLOADING static ::osl::Module aDialogLibrary; static const OUString sLibName(SWUI_DLL_NAME); @@ -49,7 +46,7 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create() #else fp = SwCreateDialogFactory; #endif -#endif + if ( fp ) return fp(); return nullptr; diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 5e2ee8a5e808..84cce3758271 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include @@ -2868,6 +2870,7 @@ void SwBaseShell::ExecField( SfxRequest const & rReq ) sal_uInt16 nSlot = rReq.GetSlot(); switch( nSlot ) { +#if HAVE_FEATURE_DBCONNECTIVITY case FN_CHANGE_DBFIELD: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); @@ -2875,6 +2878,7 @@ void SwBaseShell::ExecField( SfxRequest const & rReq ) pDlg->Execute(); } break; +#endif default: OSL_FAIL("wrong dispatcher"); } -- cgit