include/sfx2/basedlgs.hxx | 5 ---- sc/source/ui/pagedlg/tphf.cxx | 9 +++----- sfx2/source/dialog/basedlgs.cxx | 41 +++------------------------------------- 3 files changed, 9 insertions(+), 46 deletions(-)
New commits: commit 75a271fdc40aab116c1468683e64f843d292dc48 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Apr 2 14:20:14 2018 +0100 can now remove ResId based config id scheme Change-Id: Id1ad413dacc7eb07269debba65426236bef28610 Reviewed-on: https://gerrit.libreoffice.org/52259 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 670fc10f7238..f5f40b8d6748 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -45,7 +45,6 @@ class FixedLine; class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog { - sal_uInt32 nUniqId; OUString aExtraData; const SfxItemSet* pInputSet; SfxItemSet* pOutputSet; @@ -61,8 +60,6 @@ protected: SfxModalDialog(vcl::Window *pParent, const OUString& rID, const OUString& rUIXMLDescription); OUString& GetExtraData() { return aExtraData; } - sal_uInt32 GetUniqId() const { return nUniqId; } - void SetUniqId(sal_uInt32 nSettingsId) { nUniqId = nSettingsId; } void CreateOutputItemSet( SfxItemPool& rPool ); void CreateOutputItemSet( const SfxItemSet& rInput ); void SetInputSet( const SfxItemSet* pInSet ) { pInputSet = pInSet; } @@ -177,7 +174,7 @@ public: virtual ~SfxSingleTabDialog() override; virtual void dispose() override; - void SetTabPage(SfxTabPage* pTabPage, sal_uInt32 nSettingsId = 0); + void SetTabPage(SfxTabPage* pTabPage); SfxTabPage* GetTabPage() const { return pImpl->m_pSfxPage; } OKButton* GetOKButton() const { return pOKBtn; } diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 41983ea64c32..6b7b5f4bae03 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -201,7 +201,6 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void) { OUString aText; VclPtrInstance< SfxSingleTabDialog > pDlg(this, aDataSet); - const int nSettingsId = 42; bool bRightPage = m_pCntSharedBox->IsChecked() || ( SvxPageUsage::Left != nPageUsage ); @@ -209,17 +208,17 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void) { aText = ScGlobal::GetRscString( STR_PAGEHEADER ); if ( bRightPage ) - pDlg->SetTabPage( ScRightHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ), nSettingsId ); + pDlg->SetTabPage( ScRightHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ) ); else - pDlg->SetTabPage( ScLeftHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ), nSettingsId ); + pDlg->SetTabPage( ScLeftHeaderEditPage::Create( pDlg->get_content_area(), &aDataSet ) ); } else { aText = ScGlobal::GetRscString( STR_PAGEFOOTER ); if ( bRightPage ) - pDlg->SetTabPage( ScRightFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ), nSettingsId ); + pDlg->SetTabPage( ScRightFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ) ); else - pDlg->SetTabPage( ScLeftFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ), nSettingsId ); + pDlg->SetTabPage( ScLeftFooterEditPage::Create( pDlg->get_content_area(), &aDataSet ) ); } SvxNumType eNumType = aDataSet.Get(ATTR_PAGE).GetNumType(); diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index e671d8e6dfbe..126d2f9bf511 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -93,15 +93,7 @@ void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) void SfxModalDialog::SetDialogData_Impl() { // save settings (position and user data) - OUString sConfigId; - if (isLayoutEnabled()) - sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); - else - { - SAL_WARN("sfx.config", "Dialog needs to be converted to .ui format"); - sConfigId = OUString::number(nUniqId); - } - + OUString sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); SvtViewOptions aDlgOpt(EViewType::Dialog, sConfigId); aDlgOpt.SetWindowState(OStringToOUString( GetWindowState(WindowStateMask::Pos), RTL_TEXTENCODING_ASCII_US)); @@ -119,15 +111,7 @@ void SfxModalDialog::GetDialogData_Impl() */ { - OUString sConfigId; - if (isLayoutEnabled()) - sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); - else - { - SAL_WARN("sfx.config", "Dialog needs to be converted to .ui format"); - sConfigId = OUString::number(nUniqId); - } - + OUString sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); SvtViewOptions aDlgOpt(EViewType::Dialog, sConfigId); if ( aDlgOpt.Exists() ) { @@ -142,7 +126,6 @@ void SfxModalDialog::GetDialogData_Impl() SfxModalDialog::SfxModalDialog(vcl::Window *pParent, const OUString& rID, const OUString& rUIXMLDescription ) : ModalDialog(pParent, rID, rUIXMLDescription), - nUniqId(0), //todo: remove this member when the ResId using ctor is removed pInputSet(nullptr), pOutputSet(nullptr) { @@ -682,12 +665,6 @@ IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl, Button*, void) OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), RTL_TEXTENCODING_UTF8); - if (sConfigId.isEmpty()) - { - SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); - sConfigId = OUString::number(GetUniqId()); - } - SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId); aPageOpt.SetUserItem( USERITEM_NAME, makeAny( sData ) ); EndDialog( RET_OK ); @@ -737,31 +714,21 @@ void SfxSingleTabDialog::dispose() SfxModalDialog::dispose(); } -void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage, - sal_uInt32 nSettingsId) /* [Description] Insert a (new) TabPage; an existing page is deleted. The passed on page is initialized with the initially given Itemset through calling Reset(). */ - +void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage) { - SetUniqId(nSettingsId); pImpl->m_pSfxPage.disposeAndClear(); pImpl->m_pSfxPage = pTabPage; if ( pImpl->m_pSfxPage ) { // First obtain the user data, only then Reset() - OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), - RTL_TEXTENCODING_UTF8); - if (sConfigId.isEmpty()) - { - SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); - sConfigId = OUString::number(GetUniqId()); - } - + OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), RTL_TEXTENCODING_UTF8); SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId); Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); OUString sUserData; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits