summaryrefslogtreecommitdiff
path: root/sd/source/ui/annotations/annotationmanager.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-10-26 17:41:29 +0100
committerMathias Bauer <mba@openoffice.org>2009-10-26 17:41:29 +0100
commit2598fbf8a9fe2c3d9825842c9369d836dd7f77e7 (patch)
treeecc1f43724012af168c6eaf2d388a4942e62d631 /sd/source/ui/annotations/annotationmanager.cxx
parent6301be9e1ad4b359edd3c900acd36f3552761579 (diff)
parent43936a879d1fef65802627939efae9da6ee2dab2 (diff)
merge commit for m62
Diffstat (limited to 'sd/source/ui/annotations/annotationmanager.cxx')
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx34
1 files changed, 23 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);
}
}