summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-05 16:24:14 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-05 16:24:14 +0000
commite9222454143dd878a283a0f38bd4de6c680105ab (patch)
tree7a931da8bfa42f29282ad9cf8072dbf995161694 /framework/source
parenta020c8a2f9e357dc2911a74a92184a604f9d7b22 (diff)
INTEGRATION: CWS aquavcl05_DEV300 (1.5.14); FILE MERGED
2008/02/05 15:35:48 as 1.5.14.1: #i85727# tag frame window if model was modified
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/services/taskcreatorsrv.cxx37
1 files changed, 33 insertions, 4 deletions
diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index 0d360a7e2d3f..04ebeca290a3 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: taskcreatorsrv.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: ihi $ $Date: 2008-01-14 17:24:24 $
+ * last change: $Author: kz $ $Date: 2008-03-05 17:24:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -47,6 +47,10 @@
#include <helper/persistentwindowstate.hxx>
#endif
+#ifndef __FRAMEWORK_HELPER_TAGWINDOWASMODIFIED_HXX_
+#include <helper/tagwindowasmodified.hxx>
+#endif
+
#ifndef __FRAMEWORK_THREADHELP_READGUARD_HXX_
#include <threadhelp/readguard.hxx>
#endif
@@ -257,6 +261,13 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI
if (bSupportPersistentWindowState)
implts_establishWindowStateListener(xFrame);
+ // special feature: On Mac we need tagging the window in case
+ // the underlying model was modified.
+ // VCL will ignore our calls in case different platform then Mac
+ // is used ...
+ if (bTopLevelDocumentWindow)
+ implts_establishDocModifyListener (xFrame);
+
// Make it visible directly here ...
// if its required from outside.
if (bVisible)
@@ -391,8 +402,26 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re
PersistentWindowState* pPersistentStateHandler = new PersistentWindowState(xSMGR);
css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pPersistentStateHandler), css::uno::UNO_QUERY_THROW);
- // This will start listening at this frame ... and then these two objects hold herself alive!
- // We can forget xInit without any problems.
+ css::uno::Sequence< css::uno::Any > lInitData(1);
+ lInitData[0] <<= xFrame;
+ xInit->initialize(lInitData);
+}
+
+//-----------------------------------------------
+void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame >& xFrame )
+{
+ // SAFE ->
+ ReadGuard aReadLock( m_aLock );
+ css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
+ aReadLock.unlock();
+ // <- SAFE
+
+ // Special feature: It's allowed for frames using a top level window only!
+ // We must create a special listener service and couple it with the new created task frame.
+ // It will tag the window as modified if the underlying model was modified ...
+ TagWindowAsModified* pTag = new TagWindowAsModified(xSMGR);
+ css::uno::Reference< css::lang::XInitialization > xInit(static_cast< ::cppu::OWeakObject* >(pTag), css::uno::UNO_QUERY_THROW);
+
css::uno::Sequence< css::uno::Any > lInitData(1);
lInitData[0] <<= xFrame;
xInit->initialize(lInitData);