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

Related: fdo#75307 use the unique auto help id to identify tabpages

and dialogs that are loaded from the .ui format

Change-Id: I37aea52a3973d8d8f6a2ce8dabf80bb1e64db43f
üst 15471dd7
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
#define RID_SVXPAGE_PICK_BULLET (RID_SVX_START + 216) #define RID_SVXPAGE_PICK_BULLET (RID_SVX_START + 216)
#define RID_SVXPAGE_PICK_NUM (RID_SVX_START + 217) #define RID_SVXPAGE_PICK_NUM (RID_SVX_START + 217)
#define RID_SVXPAGE_PICK_BMP (RID_SVX_START + 218) #define RID_SVXPAGE_PICK_BMP (RID_SVX_START + 218)
#define RID_SVXPAGE_POSITION_SIZE (RID_SVX_START + 87)
#define RID_SVXPAGE_EVENTASSIGN (RID_SVX_START + 303) #define RID_SVXPAGE_EVENTASSIGN (RID_SVX_START + 303)
#define RID_SVXPAGE_HATCH (RID_SVX_START + 57) #define RID_SVXPAGE_HATCH (RID_SVX_START + 57)
#define RID_SVXPAGE_BITMAP (RID_SVX_START + 58) #define RID_SVXPAGE_BITMAP (RID_SVX_START + 58)
......
...@@ -98,7 +98,16 @@ void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) ...@@ -98,7 +98,16 @@ void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
void SfxModalDialog::SetDialogData_Impl() void SfxModalDialog::SetDialogData_Impl()
{ {
// save settings (position and user data) // save settings (position and user data)
SvtViewOptions aDlgOpt( E_DIALOG, OUString::number( nUniqId ) ); 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);
}
SvtViewOptions aDlgOpt(E_DIALOG, sConfigId);
aDlgOpt.SetWindowState(OStringToOUString( aDlgOpt.SetWindowState(OStringToOUString(
GetWindowState(WINDOWSTATE_MASK_POS), RTL_TEXTENCODING_ASCII_US)); GetWindowState(WINDOWSTATE_MASK_POS), RTL_TEXTENCODING_ASCII_US));
if ( !aExtraData.isEmpty() ) if ( !aExtraData.isEmpty() )
...@@ -116,7 +125,16 @@ void SfxModalDialog::GetDialogData_Impl() ...@@ -116,7 +125,16 @@ void SfxModalDialog::GetDialogData_Impl()
*/ */
{ {
SvtViewOptions aDlgOpt( E_DIALOG, OUString::number( nUniqId ) ); 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);
}
SvtViewOptions aDlgOpt(E_DIALOG, sConfigId);
if ( aDlgOpt.Exists() ) if ( aDlgOpt.Exists() )
{ {
// load settings // load settings
...@@ -155,7 +173,7 @@ SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId ) ...@@ -155,7 +173,7 @@ SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId )
SfxModalDialog::SfxModalDialog(Window *pParent, const OString& rID, const OUString& rUIXMLDescription ) SfxModalDialog::SfxModalDialog(Window *pParent, const OString& rID, const OUString& rUIXMLDescription )
: ModalDialog(pParent, rID, rUIXMLDescription), : ModalDialog(pParent, rID, rUIXMLDescription),
nUniqId(0), //todo nUniqId(0), //todo: remove this member when the ResId using ctor is removed
pInputSet(0), pInputSet(0),
pOutputSet(0) pOutputSet(0)
{ {
...@@ -669,7 +687,16 @@ IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl) ...@@ -669,7 +687,16 @@ IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl)
// Save user data in IniManager. // Save user data in IniManager.
pImpl->m_pSfxPage->FillUserData(); pImpl->m_pSfxPage->FillUserData();
OUString sData( pImpl->m_pSfxPage->GetUserData() ); OUString sData( pImpl->m_pSfxPage->GetUserData() );
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) );
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(E_TABPAGE, sConfigId);
aPageOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( sData ) ) ); aPageOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( sData ) ) );
EndDialog( RET_OK ); EndDialog( RET_OK );
} }
...@@ -731,7 +758,15 @@ void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage, ...@@ -731,7 +758,15 @@ void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage,
if ( pImpl->m_pSfxPage ) if ( pImpl->m_pSfxPage )
{ {
// First obtain the user data, only then Reset() // First obtain the user data, only then Reset()
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) ); 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(E_TABPAGE, sConfigId);
Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
OUString sUserData; OUString sUserData;
aUserItem >>= sUserData; aUserItem >>= sUserData;
......
...@@ -479,7 +479,7 @@ IMPL_LINK( PosSizePropertyPanel, ClickAutoHdl, void *, EMPTYARG ) ...@@ -479,7 +479,7 @@ IMPL_LINK( PosSizePropertyPanel, ClickAutoHdl, void *, EMPTYARG )
} }
// mpCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog // mpCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( RID_SVXPAGE_POSITION_SIZE ) ); SvtViewOptions aPageOpt(E_TABPAGE, "cui/ui/possizetabpage/PositionAndSize");
aPageOpt.SetUserItem( USERITEM_NAME, ::com::sun::star::uno::makeAny( ::rtl::OUString::number( int(mpCbxScale->IsChecked()) ) ) ); aPageOpt.SetUserItem( USERITEM_NAME, ::com::sun::star::uno::makeAny( ::rtl::OUString::number( int(mpCbxScale->IsChecked()) ) ) );
return 0; return 0;
...@@ -881,7 +881,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( ...@@ -881,7 +881,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
DisableControls(); DisableControls();
// mpCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog // mpCbxScale must synchronized with that on Position and Size tabpage on Shape Properties dialog
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( RID_SVXPAGE_POSITION_SIZE ) ); SvtViewOptions aPageOpt(E_TABPAGE, "cui/ui/possizetabpage/PositionAndSize");
OUString sUserData; OUString sUserData;
::com::sun::star::uno::Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); ::com::sun::star::uno::Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
::rtl::OUString aTemp; ::rtl::OUString aTemp;
......
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