diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-02 20:16:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-03 08:59:56 +0100 |
commit | e8fdd77a66fe92fae063394683c6d9f64c9f54e6 (patch) | |
tree | 9b004c85b49de1b0eb14f91a08d72a12c335bbc3 /sfx2 | |
parent | 61db96daa87754af24355d7ac94ee0305f22ff87 (diff) |
restore title on Format Number single tab dialogs
Allow a .ui to be given to the SingleTabDialog ctor. There are *three*
single-tab Format Number dialogs, we really should combine them together into
one dialog.
Change-Id: I1021c9b968764bd9ad35832958ef2bd067fca798
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 6b26bf3b0a8e..ff44f0159d94 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -749,8 +749,9 @@ SfxSingleTabDialogBase::SfxSingleTabDialogBase SetInputSet( pInSet ); } -SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rSet) - : SfxModalDialog(pParent, "SingleTabDialog", "sfx/ui/singletabdialog.ui") +SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rSet, + const OString& rID, const OUString& rUIXMLDescription) + : SfxModalDialog(pParent, rID, rUIXMLDescription) , pImpl(new SingleTabDlgImpl) { get(pOKBtn, "ok"); @@ -788,23 +789,27 @@ void SfxSingleTabDialog::setTabPage(SfxTabPage* pTabPage, { // First obtain the user data, only then Reset() SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) ); - String sUserData; Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); - OUString aTemp; - if ( aUserItem >>= aTemp ) - sUserData = String( aTemp ); - pImpl->m_pSfxPage->SetUserData( sUserData ); + OUString sUserData; + aUserItem >>= sUserData; + pImpl->m_pSfxPage->SetUserData(sUserData); pImpl->m_pSfxPage->Reset( *GetInputItemSet() ); pImpl->m_pSfxPage->Show(); pHelpBtn->Show(Help::IsContextHelpEnabled()); - // Set TabPage text in the Dialog - SetText( pImpl->m_pSfxPage->GetText() ); - - // Dialog recieves the HelpId of TabPage - SetHelpId( pImpl->m_pSfxPage->GetHelpId() ); - SetUniqueId( pImpl->m_pSfxPage->GetUniqueId() ); + // Set TabPage text in the Dialog if there is any + OUString sTitle(pImpl->m_pSfxPage->GetText()); + if (!sTitle.isEmpty()) + SetText(sTitle); + + // Dialog recieves the HelpId of TabPage if there is any + OString sHelpId(pImpl->m_pSfxPage->GetHelpId()); + if (!sHelpId.isEmpty()) + SetHelpId(sHelpId); + OString sUniqueId(pImpl->m_pSfxPage->GetUniqueId()); + if (!sUniqueId.isEmpty()) + SetUniqueId(sUniqueId); } } |