summaryrefslogtreecommitdiff
path: root/toolkit/source/awt/vclxwindow.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-10-09 18:56:58 +0200
committerMathias Bauer <mba@openoffice.org>2010-10-09 18:56:58 +0200
commitb41d62671ea124872aaec7be9c4bfd5b1d87904a (patch)
tree02571673fc42797bcab7300bb222b9e2eae33912 /toolkit/source/awt/vclxwindow.cxx
parent3645e96db1ef4aa0e781337b9c478ebf60369890 (diff)
parent525de6f8eeac6e357167467da0f9a9448433bb25 (diff)
CWS changehid: resync to m89
Diffstat (limited to 'toolkit/source/awt/vclxwindow.cxx')
-rw-r--r--toolkit/source/awt/vclxwindow.cxx46
1 files changed, 33 insertions, 13 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 73022aacedf2..808f3578ef97 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
+
#include <com/sun/star/awt/WindowEvent.hpp>
#include <com/sun/star/awt/KeyEvent.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
@@ -41,6 +42,7 @@
#include <com/sun/star/awt/EndPopupModeEvent.hpp>
#include <com/sun/star/awt/XWindowListener2.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxpointer.hxx>
@@ -64,7 +66,8 @@
#include <vcl/button.hxx>
#include <comphelper/asyncnotification.hxx>
#include <toolkit/helper/solarrelease.hxx>
-
+#include "stylesettings.hxx"
+#include <tools/urlobj.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <boost/bind.hpp>
@@ -73,10 +76,13 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::lang::EventObject;
using ::com::sun::star::awt::XWindowListener2;
using ::com::sun::star::awt::XDockableWindowListener;
using ::com::sun::star::awt::XDevice;
+using ::com::sun::star::awt::XStyleSettings;
+using ::com::sun::star::lang::DisposedException;
using ::com::sun::star::style::VerticalAlignment;
using ::com::sun::star::style::VerticalAlignment_TOP;
using ::com::sun::star::style::VerticalAlignment_MIDDLE;
@@ -86,6 +92,7 @@ using ::com::sun::star::style::VerticalAlignment_MAKE_FIXED_SIZE;
namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
+using ::toolkit::ReleaseSolarMutex;
//====================================================================
//= misc helpers
@@ -164,6 +171,8 @@ public:
mxAccessibleContext;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >
mxViewGraphics;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings >
+ mxWindowStyleSettings;
public:
bool& getDrawingOntoParent_ref() { return mbDrawingOntoParent; }
@@ -198,6 +207,8 @@ public:
return maAccFactory;
}
+ Reference< XStyleSettings > getStyleSettings();
+
/** returns the container of registered XWindowListener2 listeners
*/
inline ::cppu::OInterfaceContainerHelper& getWindow2Listeners() { return maWindow2Listeners; }
@@ -222,17 +233,6 @@ private:
DECL_LINK( OnProcessCallbacks, void* );
private:
-private:
- /** determines whether the instance is already disposed
- @precond
- m_aMutex must be acquired
- */
- inline bool impl_isDisposed()
- {
- return mbDisposed;
- }
-
-private:
VCLXWindowImpl(); // never implemented
VCLXWindowImpl( const VCLXWindowImpl& ); // never implemented
VCLXWindowImpl& operator=( const VCLXWindowImpl& ); // never implemented
@@ -298,6 +298,10 @@ void VCLXWindowImpl::disposing()
maContainerListeners.disposeAndClear( aEvent );
maTopWindowListeners.disposeAndClear( aEvent );
+ ::toolkit::WindowStyleSettings* pStyleSettings = static_cast< ::toolkit::WindowStyleSettings* >( mxWindowStyleSettings.get() );
+ if ( pStyleSettings != NULL )
+ pStyleSettings->dispose();
+ mxWindowStyleSettings.clear();
}
//--------------------------------------------------------------------
@@ -336,7 +340,7 @@ IMPL_LINK( VCLXWindowImpl, OnProcessCallbacks, void*, EMPTYARG )
}
{
- ::toolkit::ReleaseSolarMutex aReleaseSolar;
+ ReleaseSolarMutex aReleaseSolar( ReleaseSolarMutex::RescheduleDuringAcquire );
for ( CallbackArray::const_iterator loop = aCallbacksCopy.begin();
loop != aCallbacksCopy.end();
++loop
@@ -361,6 +365,17 @@ void SAL_CALL VCLXWindowImpl::release()
mrAntiImpl.release();
}
+//--------------------------------------------------------------------
+Reference< XStyleSettings > VCLXWindowImpl::getStyleSettings()
+{
+ ::vos::OGuard aGuard( mrMutex );
+ if ( mbDisposed )
+ throw DisposedException( ::rtl::OUString(), mrAntiImpl );
+ if ( !mxWindowStyleSettings.is() )
+ mxWindowStyleSettings = new ::toolkit::WindowStyleSettings( mrMutex, maListenerContainerMutex, mrAntiImpl );
+ return mxWindowStyleSettings;
+}
+
//====================================================================
//====================================================================
@@ -2634,3 +2649,8 @@ VCLXWindow::hasPropertyByName( const ::rtl::OUString& rName ) throw (::com::sun:
{
return GetPropHelper()->hasPropertyByName( rName );
}
+
+Reference< XStyleSettings > SAL_CALL VCLXWindow::getStyleSettings() throw (RuntimeException)
+{
+ return mpImpl->getStyleSettings();
+}