summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-03 12:04:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-03 12:18:26 +0100
commit333282478a956709e648427b412d90f90fc1437b (patch)
treed62f22f1060332f6197206d1d1317392b9b2df82
parent15471dd79200eb828b4a4ed98d32a82f51a6f44f (diff)
Related: fdo#75307 use the unique auto help id to identify tabpages
and dialogs that are loaded from the .ui format Change-Id: I37aea52a3973d8d8f6a2ce8dabf80bb1e64db43f
-rw-r--r--include/svx/dialogs.hrc1
-rw-r--r--sfx2/source/dialog/basedlgs.cxx45
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx4
3 files changed, 42 insertions, 8 deletions
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 7687f94abeae..c5c57c7ea280 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -81,7 +81,6 @@
#define RID_SVXPAGE_PICK_BULLET (RID_SVX_START + 216)
#define RID_SVXPAGE_PICK_NUM (RID_SVX_START + 217)
#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_HATCH (RID_SVX_START + 57)
#define RID_SVXPAGE_BITMAP (RID_SVX_START + 58)
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 15cde96e43c9..51e70ce8bce6 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -98,7 +98,16 @@ void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
void SfxModalDialog::SetDialogData_Impl()
{
// 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(
GetWindowState(WINDOWSTATE_MASK_POS), RTL_TEXTENCODING_ASCII_US));
if ( !aExtraData.isEmpty() )
@@ -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() )
{
// load settings
@@ -155,7 +173,7 @@ SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId )
SfxModalDialog::SfxModalDialog(Window *pParent, const OString& rID, const OUString& rUIXMLDescription )
: ModalDialog(pParent, rID, rUIXMLDescription),
- nUniqId(0), //todo
+ nUniqId(0), //todo: remove this member when the ResId using ctor is removed
pInputSet(0),
pOutputSet(0)
{
@@ -669,7 +687,16 @@ IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl)
// Save user data in IniManager.
pImpl->m_pSfxPage->FillUserData();
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 ) ) );
EndDialog( RET_OK );
}
@@ -731,7 +758,15 @@ void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage,
if ( pImpl->m_pSfxPage )
{
// 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 );
OUString sUserData;
aUserItem >>= sUserData;
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 0b9543d0614d..32df2b10c3f7 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -479,7 +479,7 @@ IMPL_LINK( PosSizePropertyPanel, ClickAutoHdl, void *, EMPTYARG )
}
// 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()) ) ) );
return 0;
@@ -881,7 +881,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
DisableControls();
// 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;
::com::sun::star::uno::Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
::rtl::OUString aTemp;