Kaydet (Commit) 75a271fd authored tarafından Caolán McNamara's avatar Caolán McNamara

can now remove ResId based config id scheme

Change-Id: Id1ad413dacc7eb07269debba65426236bef28610
Reviewed-on: https://gerrit.libreoffice.org/52259Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 840be9fd
......@@ -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; }
......
......@@ -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();
......
......@@ -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;
......
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