Kaydet (Commit) 2ce6828b authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Miklos Vajna

fix awt::UnoControlModelDialog crash

...in commit 6c61b20a,
    "Convert awt::UnoControlDialogModel to new style"
I added an attribute "ResourceResolver" because some of the client
code was setting it using the property interface.

It turns out that this was a bad idea because the "ResourceResolver"
property is doing some very interesting stuff, so revert that part
of the change.

Change-Id: I62b890e60164e005867ced49c3e407a49ed09441
Reviewed-on: https://gerrit.libreoffice.org/4013Reviewed-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
Tested-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
üst 9413f212
......@@ -166,9 +166,6 @@ public:
{ return getPropertyString("ImageURL"); }
virtual void SAL_CALL setImageURL(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException)
{ setPropertyString("ImageURL", p1); }
virtual com::sun::star::uno::Reference<com::sun::star::resource::XStringResourceManager> SAL_CALL getResourceResolver() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setResourceResolver(const com::sun::star::uno::Reference<com::sun::star::resource::XStringResourceManager>& p1) throw(::com::sun::star::uno::RuntimeException)
{ setPropertyValue( "ResourceResolver", css::uno::Any(p1) ); }
virtual com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setFontDescriptor(const com::sun::star::awt::FontDescriptor& p1) throw(::com::sun::star::uno::RuntimeException)
{ setPropertyValue( "FontDescriptor", css::uno::Any(p1) ); }
......
......@@ -28,7 +28,6 @@
#include <com/sun/star/lang/XMultiServiceFactory.idl>
#include <com/sun/star/util/Color.idl>
#include <com/sun/star/graphic/XGraphic.idl>
#include <com/sun/star/resource/XStringResourceManager.idl>
module com { module sun { module star { module awt {
......@@ -67,8 +66,6 @@ published interface XUnoControlDialogModel
[attribute] string DialogSourceURL;
[attribute] com::sun::star::resource::XStringResourceManager ResourceResolver;
/** specifies the text that is displayed in the caption bar of the dialog.
*/
[attribute] string Title;
......
......@@ -44,7 +44,7 @@ module com { module sun { module star { module resource {
localized dialogs.
*/
published interface XStringResourceManager: com::sun::star::resource::XStringResourceResolver
interface XStringResourceManager: com::sun::star::resource::XStringResourceResolver
{
/**
Returns the resource's read only state
......
......@@ -42,7 +42,7 @@ module com { module sun { module star { module resource {
But also changing the locale at runtime can be supported in this way.
*/
published interface XStringResourceResolver: com::sun::star::util::XModifyBroadcaster
interface XStringResourceResolver: com::sun::star::util::XModifyBroadcaster
{
/**
Resolves the passed ResoureID for the current locale. This
......
......@@ -88,6 +88,8 @@ namespace dlgprov
{
//.........................................................................
static OUString aResourceResolverPropName("ResourceResolver");
Reference< resource::XStringResourceManager > lcl_getStringResourceManager(const Reference< XComponentContext >& i_xContext,const OUString& i_sURL)
{
INetURLObject aInetObj( i_sURL );
......@@ -147,7 +149,9 @@ namespace dlgprov
// Set resource property
if( xStringResourceManager.is() )
{
xDialogModel->setResourceResolver( xStringResourceManager );
Any aStringResourceManagerAny;
aStringResourceManagerAny <<= xStringResourceManager;
xDialogModel->setPropertyValue( aResourceResolverPropName, aStringResourceManagerAny );
}
return xDialogModel;
......
......@@ -307,14 +307,6 @@ sal_Int32 UnoControlDialogModel::getPropertyInt32(const OUString& aPropertyName)
return b;
}
Reference<css::resource::XStringResourceManager> UnoControlDialogModel::getResourceResolver() throw(css::uno::RuntimeException)
{
uno::Any any = getPropertyValue("ResourceResolver");
Reference<css::resource::XStringResourceManager> b;
any >>= b;
return b;
}
css::awt::FontDescriptor UnoControlDialogModel::getFontDescriptor() throw(css::uno::RuntimeException)
{
uno::Any any = getPropertyValue("FontDescriptor");
......
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