summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-01-25 13:23:20 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-01-25 13:23:20 +0000
commitbd8a6cfd15b4ee925e54885cd829ce833b31303c (patch)
tree860aa5f9a3fa440bf3a422ff7db51c04925d498c /svx
parent97015f5cd1f51aa69e4d7bee4ced458aef225d1b (diff)
INTEGRATION: CWS ka006 (1.37.134); FILE MERGED
2006/01/04 14:57:40 ka 1.37.134.1: #120142#: making theme locking safe
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/galtheme.cxx70
1 files changed, 38 insertions, 32 deletions
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index eb3e9db72458..99427579b757 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: galtheme.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: rt $ $Date: 2005-10-19 12:09:54 $
+ * last change: $Author: hr $ $Date: 2006-01-25 14:23:20 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -86,11 +86,12 @@ using namespace ::com::sun::star::ucb;
// ------------
GalleryTheme::GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry ) :
- pParent ( pGallery ),
- pThm ( pThemeEntry ),
- mnLockCount ( 0 ),
- nDragPos ( 0 ),
- bDragging ( FALSE )
+ pParent ( pGallery ),
+ pThm ( pThemeEntry ),
+ mnBroadcasterLockCount( 0 ),
+ mnThemeLockCount ( 0 ),
+ nDragPos ( 0 ),
+ bDragging ( FALSE )
{
ImplCreateSvDrawStorage();
@@ -404,11 +405,28 @@ void GalleryTheme::ImplBroadcast( ULONG nUpdatePos )
// ------------------------------------------------------------------------
+BOOL GalleryTheme::UnlockTheme()
+{
+ DBG_ASSERT( mnThemeLockCount, "Theme is not locked" );
+
+ BOOL bRet = FALSE;
+
+ if( mnThemeLockCount )
+ {
+ --mnThemeLockCount;
+ bRet = TRUE;
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
void GalleryTheme::UnlockBroadcaster( ULONG nUpdatePos )
{
- DBG_ASSERT( mnLockCount, "Broadcaster is not locked" );
+ DBG_ASSERT( mnBroadcasterLockCount, "Broadcaster is not locked" );
- if( mnLockCount && !--mnLockCount )
+ if( mnBroadcasterLockCount && !--mnBroadcasterLockCount )
ImplBroadcast( nUpdatePos );
}
@@ -1055,33 +1073,21 @@ BOOL GalleryTheme::GetModelStream( ULONG nPos, SotStorageStreamRef& rxModelStrea
if( GalleryCodec::IsCoded( *xIStm, nVersion ) )
{
- if( 1 == nVersion )
- {
- FmFormModel aModel;
-
- aModel.GetItemPool().FreezeIdRanges();
+ FmFormModel aModel;
- if( GallerySvDrawImport( *xIStm, aModel ) )
- {
- aModel.BurnInStyleSheetAttributes();
-//BFS04 aModel.SetStreamingSdrModel( TRUE );
-//BFS01 aModel.RemoveNotPersistentObjects( TRUE );
+ aModel.GetItemPool().FreezeIdRanges();
- {
- com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xDocOut( new utl::OOutputStreamWrapper( *rxModelStream ) );
+ if( GallerySvDrawImport( *xIStm, aModel ) )
+ {
+ aModel.BurnInStyleSheetAttributes();
- if( SvxDrawingLayerExport( &aModel, xDocOut ) )
- rxModelStream->Commit();
- }
+ {
+ com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xDocOut( new utl::OOutputStreamWrapper( *rxModelStream ) );
-//BFS04 aModel.SetStreamingSdrModel( FALSE );
+ if( SvxDrawingLayerExport( &aModel, xDocOut ) )
+ rxModelStream->Commit();
}
}
- else if( 2 == nVersion )
- {
- GalleryCodec aCodec( *xIStm );
- aCodec.Read( *rxModelStream );
- }
bRet = ( rxModelStream->GetError() == ERRCODE_NONE );
}
@@ -1342,7 +1348,7 @@ BOOL GalleryTheme::InsertTransferable( const ::com::sun::star::uno::Reference< :
void GalleryTheme::CopyToClipboard( Window* pWindow, ULONG nPos )
{
- GalleryTransferable* pTransferable = new GalleryTransferable( this, nPos );
+ GalleryTransferable* pTransferable = new GalleryTransferable( this, nPos, false );
pTransferable->CopyToClipboard( pWindow );
}
@@ -1350,7 +1356,7 @@ void GalleryTheme::CopyToClipboard( Window* pWindow, ULONG nPos )
void GalleryTheme::StartDrag( Window* pWindow, ULONG nPos )
{
- GalleryTransferable* pTransferable = new GalleryTransferable( this, nPos );
+ GalleryTransferable* pTransferable = new GalleryTransferable( this, nPos, true );
pTransferable->StartDrag( pWindow, DND_ACTION_COPY | DND_ACTION_LINK );
}