diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
commit | 2598fbf8a9fe2c3d9825842c9369d836dd7f77e7 (patch) | |
tree | ecc1f43724012af168c6eaf2d388a4942e62d631 /sd/source/ui | |
parent | 6301be9e1ad4b359edd3c900acd36f3552761579 (diff) | |
parent | 43936a879d1fef65802627939efae9da6ee2dab2 (diff) |
merge commit for m62
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/annotations/annotationmanager.cxx | 34 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationmanagerimpl.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationtag.cxx | 1 |
3 files changed, 27 insertions, 11 deletions
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 49ad473db0f0..e3076ec22bbe 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -274,6 +274,21 @@ void SAL_CALL AnnotationManagerImpl::disposing( const ::com::sun::star::lang::Ev { } +void AnnotationManagerImpl::ShowAnnotations( bool bShow ) +{ + // enforce show annotations if a new annotation is inserted + if( mbShowAnnotations != bShow ) + { + mbShowAnnotations = bShow; + + SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()); + if( pOptions ) + pOptions->SetShowComments( mbShowAnnotations ? sal_True : sal_False ); + + UpdateTags(); + } +} + // -------------------------------------------------------------------- void AnnotationManagerImpl::ExecuteAnnotation(SfxRequest& rReq ) @@ -296,16 +311,8 @@ void AnnotationManagerImpl::ExecuteAnnotation(SfxRequest& rReq ) ExecuteReplyToAnnotation( rReq ); break; case SID_SHOW_POSTIT: - { - mbShowAnnotations = !mbShowAnnotations; - - SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()); - if( pOptions ) - pOptions->SetShowComments( mbShowAnnotations ? sal_True : sal_False ); - - UpdateTags(); - break; - } + ShowAnnotations( !mbShowAnnotations ); + break; } } @@ -313,6 +320,7 @@ void AnnotationManagerImpl::ExecuteAnnotation(SfxRequest& rReq ) void AnnotationManagerImpl::ExecuteInsertAnnotation(SfxRequest& /*rReq*/) { + ShowAnnotations(true); InsertAnnotation(); } @@ -320,6 +328,8 @@ void AnnotationManagerImpl::ExecuteInsertAnnotation(SfxRequest& /*rReq*/) void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq) { + ShowAnnotations( true ); + const SfxItemSet* pArgs = rReq.GetArgs(); switch( rReq.GetSlot() ) @@ -640,6 +650,8 @@ void AnnotationManagerImpl::GetAnnotationState(SfxItemSet& rSet) void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward) { + ShowAnnotations( true ); + Reference< XAnnotation > xCurrent; GetSelectedAnnotation( xCurrent ); SdPage* pPage = GetCurrentPage(); @@ -1213,7 +1225,7 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward ) nPageNum--; } - return static_cast< SdPage* >( mpDoc->GetMasterPage(nPageNum) ); + return mpDoc->GetMasterSdPage(nPageNum,PK_STANDARD); } } diff --git a/sd/source/ui/annotations/annotationmanagerimpl.hxx b/sd/source/ui/annotations/annotationmanagerimpl.hxx index a64421c26262..9f2c48e875d3 100644 --- a/sd/source/ui/annotations/annotationmanagerimpl.hxx +++ b/sd/source/ui/annotations/annotationmanagerimpl.hxx @@ -124,6 +124,9 @@ public: SdPage* GetCurrentPage(); SdDrawDocument* GetDoc() { return mpDoc; } + + void ShowAnnotations(bool bShow); + private: ViewShellBase& mrBase; SdDrawDocument* mpDoc; diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index af219c3aadc3..d2b9b7b56b7d 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -717,6 +717,7 @@ void AnnotationTag::ClosePopup() if( mpAnnotationWindow.get() ) { mpAnnotationWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler)); + mpAnnotationWindow->Deactivate(); mpAnnotationWindow.reset(); } } |