summaryrefslogtreecommitdiff
path: root/sd/source/ui/annotations/annotationmanager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/annotations/annotationmanager.cxx')
-rwxr-xr-xsd/source/ui/annotations/annotationmanager.cxx264
1 files changed, 132 insertions, 132 deletions
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 1e64617edab8..465fc6f4eda0 100755
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -151,12 +151,12 @@ static SfxDispatcher* getDispatcher( ViewShellBase& rBase )
}
com::sun::star::util::DateTime getCurrentDateTime()
-{
+{
TimeValue osltime;
osl_getSystemTime( &osltime );
oslDateTime osldt;
osl_getDateTimeFromTimeValue( &osltime, &osldt );
- return com::sun::star::util::DateTime( 0, osldt.Seconds, osldt.Minutes, osldt.Hours, osldt.Day, osldt.Month, osldt.Year );
+ return com::sun::star::util::DateTime( 0, osldt.Seconds, osldt.Minutes, osldt.Hours, osldt.Day, osldt.Month, osldt.Year );
}
OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotation )
@@ -167,7 +167,7 @@ OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotatio
const LocaleDataWrapper& rLocalData = SvtSysLocale().GetLocaleData();
com::sun::star::util::DateTime aDateTime( xAnnotation->getDateTime() );
-
+
Date aDate = Date( aDateTime.Day, aDateTime.Month, aDateTime.Year );
if (aDate==Date())
sRet = sRet + String(SdResId(STR_ANNOTATION_TODAY));
@@ -177,8 +177,8 @@ OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotatio
else
if (aDate.IsValid() )
sRet = sRet + rLocalData.getDate(aDate);
-
- Time aTime( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds, aDateTime.HundredthSeconds );
+
+ Time aTime( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds, aDateTime.HundredthSeconds );
if(aTime.GetTime() != 0)
sRet = sRet + rtl::OUString::createFromAscii(" ") + rLocalData.getTime( aTime,false );
}
@@ -196,7 +196,7 @@ AnnotationManagerImpl::AnnotationManagerImpl( ViewShellBase& rViewShellBase )
{
SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType());
if( pOptions )
- mbShowAnnotations = pOptions->IsShowComments() == TRUE;
+ mbShowAnnotations = pOptions->IsShowComments() == TRUE;
}
// --------------------------------------------------------------------
@@ -206,7 +206,7 @@ void AnnotationManagerImpl::init()
// get current controller and initialize listeners
try
{
- addListener();
+ addListener();
mxView = Reference< XDrawView >::query(mrBase.GetController());
}
catch( Exception& e )
@@ -223,7 +223,7 @@ void AnnotationManagerImpl::init()
}
catch( Exception& )
{
- }
+ }
}
// --------------------------------------------------------------------
@@ -239,7 +239,7 @@ void SAL_CALL AnnotationManagerImpl::disposing ()
}
catch( Exception& )
{
- }
+ }
removeListener();
DisposeTags();
@@ -255,7 +255,7 @@ void SAL_CALL AnnotationManagerImpl::disposing ()
}
// --------------------------------------------------------------------
-
+
// XEventListener
void SAL_CALL AnnotationManagerImpl::notifyEvent( const ::com::sun::star::document::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException)
{
@@ -280,9 +280,9 @@ void AnnotationManagerImpl::ShowAnnotations( bool bShow )
SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType());
if( pOptions )
- pOptions->SetShowComments( mbShowAnnotations ? sal_True : sal_False );
-
- UpdateTags();
+ pOptions->SetShowComments( mbShowAnnotations ? sal_True : sal_False );
+
+ UpdateTags();
}
}
@@ -303,7 +303,7 @@ void AnnotationManagerImpl::ExecuteAnnotation(SfxRequest& rReq )
case SID_PREVIOUS_POSTIT:
case SID_NEXT_POSTIT:
SelectNextAnnotation( rReq.GetSlot() == SID_NEXT_POSTIT );
- break;
+ break;
case SID_REPLYTO_POSTIT:
ExecuteReplyToAnnotation( rReq );
break;
@@ -318,7 +318,7 @@ void AnnotationManagerImpl::ExecuteAnnotation(SfxRequest& rReq )
void AnnotationManagerImpl::ExecuteInsertAnnotation(SfxRequest& /*rReq*/)
{
ShowAnnotations(true);
- InsertAnnotation();
+ InsertAnnotation();
}
// --------------------------------------------------------------------
@@ -328,7 +328,7 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq)
ShowAnnotations( true );
const SfxItemSet* pArgs = rReq.GetArgs();
-
+
switch( rReq.GetSlot() )
{
case SID_DELETEALL_POSTIT:
@@ -345,12 +345,12 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq)
}
}
break;
- case SID_DELETE_POSTIT:
- {
+ case SID_DELETE_POSTIT:
+ {
Reference< XAnnotation > xAnnotation;
if( rReq.GetSlot() == SID_DELETE_POSTIT )
- {
+ {
if( pArgs )
{
const SfxPoolItem* pPoolItem = NULL;
@@ -358,10 +358,10 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq)
( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue() >>= xAnnotation;
}
}
-
- if( !xAnnotation.is() )
+
+ if( !xAnnotation.is() )
GetSelectedAnnotation( xAnnotation );
-
+
DeleteAnnotation( xAnnotation );
}
break;
@@ -379,23 +379,23 @@ void AnnotationManagerImpl::InsertAnnotation()
{
if( mpDoc->IsUndoEnabled() )
mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_INSERT ) ) );
-
+
// find free space for new annotation
int y = 0, x = 0;
-
+
AnnotationVector aAnnotations( pPage->getAnnotations() );
if( !aAnnotations.empty() )
- {
+ {
const int page_width = pPage->GetSize().Width();
const int width = 1000;
const int height = 800;
Rectangle aTagRect;
-
+
while( true )
- {
+ {
Rectangle aNewRect( x, y, x + width - 1, y + height - 1 );
bool bFree = true;
-
+
for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
{
RealPoint2D aPoint( (*iter)->getPosition() );
@@ -403,14 +403,14 @@ void AnnotationManagerImpl::InsertAnnotation()
aTagRect.nTop = sal::static_int_cast< long >( aPoint.Y * 100.0 );
aTagRect.nRight = aTagRect.nLeft + width - 1;
aTagRect.nBottom = aTagRect.nTop + height - 1;
-
+
if( aNewRect.IsOver( aTagRect ) )
{
bFree = false;
break;
}
}
-
+
if( bFree == false)
{
x += width;
@@ -418,32 +418,32 @@ void AnnotationManagerImpl::InsertAnnotation()
{
x = 0;
y += height;
- }
+ }
}
else
{
break;
}
}
- }
-
+ }
+
Reference< XAnnotation > xAnnotation;
pPage->createAnnotation( xAnnotation );
-
+
// set current author to new annotation
SvtUserOptions aUserOptions;
xAnnotation->setAuthor( aUserOptions.GetFullName() );
-
+
// set current time to new annotation
xAnnotation->setDateTime( getCurrentDateTime() );
-
+
// set position
RealPoint2D aPos( ((double)x) / 100.0, ((double)y) / 100.0 );
xAnnotation->setPosition( aPos );
if( mpDoc->IsUndoEnabled() )
mpDoc->EndUndo();
-
+
UpdateTags(true);
SelectAnnotation( xAnnotation, true );
}
@@ -467,7 +467,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
if( pTextApi )
{
std::auto_ptr< ::Outliner > pOutliner( new ::Outliner(GetAnnotationPool(),OUTLINERMODE_TEXTOBJECT) );
-
+
mpDoc->SetCalcFieldValueHdl( pOutliner.get() );
pOutliner->SetUpdateMode( TRUE );
@@ -475,7 +475,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
OUString sAuthor( xAnnotation->getAuthor() );
if( sAuthor.getLength() == 0 )
sAuthor = String( SdResId( STR_ANNOTATION_NOAUTHOR ) );
-
+
aStr.SearchAndReplaceAscii("%1", sAuthor);
aStr.Append( String(RTL_CONSTASCII_USTRINGPARAM(" (") ) );
@@ -488,32 +488,32 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
sQuote = String( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
aStr.Append( sQuote );
aStr.Append( String(RTL_CONSTASCII_USTRINGPARAM("\"\n") ) );
-
+
USHORT nParaCount = aStr.GetTokenCount( '\n' );
for( USHORT nPara = 0; nPara < nParaCount; nPara++ )
pOutliner->Insert( aStr.GetToken( nPara, '\n' ), LIST_APPEND, -1 );
-
+
if( pOutliner->GetParagraphCount() > 1 )
{
SfxItemSet aAnswerSet( pOutliner->GetEmptyItemSet() );
- aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC));
-
+ aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC));
+
ESelection aSel;
aSel.nEndPara = (USHORT)pOutliner->GetParagraphCount()-2;
aSel.nEndPos = pOutliner->GetText( pOutliner->GetParagraph( aSel.nEndPara ) ).Len();
-
+
pOutliner->QuickSetAttribs( aAnswerSet, aSel );
}
-
+
std::auto_ptr< OutlinerParaObject > pOPO( pOutliner->CreateParaObject() );
pTextApi->SetText( *pOPO.get() );
-
+
SvtUserOptions aUserOptions;
- xAnnotation->setAuthor( aUserOptions.GetFullName() );
+ xAnnotation->setAuthor( aUserOptions.GetFullName() );
// set current time to reply
xAnnotation->setDateTime( getCurrentDateTime() );
-
+
UpdateTags(true);
SelectAnnotation( xAnnotation, true );
}
@@ -522,7 +522,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
// --------------------------------------------------------------------
void AnnotationManagerImpl::DeleteAnnotation( Reference< XAnnotation > xAnnotation )
-{
+{
SdPage* pPage = GetCurrentPage();
if( xAnnotation.is() && pPage )
@@ -548,9 +548,9 @@ void AnnotationManagerImpl::DeleteAnnotationsByAuthor( const rtl::OUString& sAut
do
{
pPage = GetNextPage( pPage, true );
-
+
if( pPage && !pPage->getAnnotations().empty() )
- {
+ {
AnnotationVector aAnnotations( pPage->getAnnotations() );
for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
{
@@ -578,14 +578,14 @@ void AnnotationManagerImpl::DeleteAllAnnotations()
do
{
pPage = GetNextPage( pPage, true );
-
+
if( pPage && !pPage->getAnnotations().empty() )
- {
+ {
AnnotationVector aAnnotations( pPage->getAnnotations() );
for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
{
- pPage->removeAnnotation( (*iter) );
+ pPage->removeAnnotation( (*iter) );
}
}
}
@@ -602,31 +602,31 @@ void AnnotationManagerImpl::DeleteAllAnnotations()
void AnnotationManagerImpl::GetAnnotationState(SfxItemSet& rSet)
{
SdPage* pCurrentPage = GetCurrentPage();
-
+
const bool bReadOnly = mrBase.GetDocShell()->IsReadOnly();
const bool bWrongPageKind = (pCurrentPage == 0) || (pCurrentPage->GetPageKind() != PK_STANDARD);
-
+
const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
if( bReadOnly || bWrongPageKind || (nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST) )
- rSet.DisableItem( SID_INSERT_POSTIT );
+ rSet.DisableItem( SID_INSERT_POSTIT );
rSet.Put(SfxBoolItem(SID_SHOW_POSTIT, mbShowAnnotations));
-
+
Reference< XAnnotation > xAnnotation;
GetSelectedAnnotation( xAnnotation );
-
+
if( !xAnnotation.is() || bReadOnly )
- rSet.DisableItem( SID_DELETE_POSTIT );
+ rSet.DisableItem( SID_DELETE_POSTIT );
SdPage* pPage = 0;
-
+
bool bHasAnnotations = false;
do
{
pPage = GetNextPage( pPage, true );
-
- if( pPage && !pPage->getAnnotations().empty() )
+
+ if( pPage && !pPage->getAnnotations().empty() )
bHasAnnotations = true;
}
while( pPage && !bHasAnnotations );
@@ -634,7 +634,7 @@ void AnnotationManagerImpl::GetAnnotationState(SfxItemSet& rSet)
if( !bHasAnnotations || bReadOnly )
{
rSet.DisableItem( SID_DELETEALL_POSTIT );
- }
+ }
if( bWrongPageKind || !bHasAnnotations )
{
@@ -682,7 +682,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
}
}
else
- {
+ {
if( xCurrent.is() )
{
for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
@@ -701,7 +701,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
}
}
else if( !aAnnotations.empty() )
- {
+ {
AnnotationVector::iterator iter( aAnnotations.end() );
SelectAnnotation( *(--iter) );
return;
@@ -714,8 +714,8 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
do
{
pPage = GetNextPage( pPage, bForeward );
-
- if( pPage && !pPage->getAnnotations().empty() )
+
+ if( pPage && !pPage->getAnnotations().empty() )
{
// switch to next/previous slide with annotations
::boost::shared_ptr<DrawViewShell> pDrawViewShell(::boost::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
@@ -723,17 +723,17 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
{
pDrawViewShell->ChangeEditMode(pPage->IsMasterPage() ? EM_MASTERPAGE : EM_PAGE, FALSE);
pDrawViewShell->SwitchPage((pPage->GetPageNum() - 1) >> 1);
-
+
SfxDispatcher* pDispatcher = getDispatcher( mrBase );
if( pDispatcher )
pDispatcher->Execute( bForeward ? SID_NEXT_POSTIT : SID_PREVIOUS_POSTIT );
-
+
return;
- }
+ }
}
}
while( pPage );
-
+
// The question text depends on the search direction.
bool bImpress = mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS;
sal_uInt16 nStringId;
@@ -758,7 +758,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
// --------------------------------------------------------------------
-void AnnotationManagerImpl::onTagSelected( AnnotationTag& rTag )
+void AnnotationManagerImpl::onTagSelected( AnnotationTag& rTag )
{
mxSelectedAnnotation = rTag.GetAnnotation();
invalidateSlots();
@@ -778,14 +778,14 @@ void AnnotationManagerImpl::onTagDeselected( AnnotationTag& rTag )
// --------------------------------------------------------------------
void AnnotationManagerImpl::SelectAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, bool bEdit /* = FALSE */ )
-{
+{
mxSelectedAnnotation = xAnnotation;
-
+
for( AnnotationTagVector::iterator iter( maTagVector.begin() ); iter != maTagVector.end(); iter++ )
{
if( (*iter)->GetAnnotation() == xAnnotation )
{
- SmartTagReference xTag( (*iter).get() );
+ SmartTagReference xTag( (*iter).get() );
mrBase.GetMainViewShell()->GetView()->getSmartTags().select( xTag );
(*iter)->OpenPopup( bEdit );
break;
@@ -809,8 +809,8 @@ void AnnotationManagerImpl::invalidateSlots()
pBindings->Invalidate( SID_DELETE_POSTIT );
pBindings->Invalidate( SID_DELETEALL_POSTIT );
pBindings->Invalidate( SID_PREVIOUS_POSTIT );
- pBindings->Invalidate( SID_NEXT_POSTIT );
- pBindings->Invalidate( SID_UNDO );
+ pBindings->Invalidate( SID_NEXT_POSTIT );
+ pBindings->Invalidate( SID_UNDO );
pBindings->Invalidate( SID_REDO );
}
}
@@ -826,9 +826,9 @@ void AnnotationManagerImpl::onSelectionChanged()
if( xPage != mxCurrentPage )
{
mxCurrentPage = xPage;
-
+
UpdateTags(true);
- }
+ }
}
catch( Exception& )
{
@@ -842,7 +842,7 @@ void AnnotationManagerImpl::UpdateTags( bool bSynchron )
{
if( mnUpdateTagsEvent )
Application::RemoveUserEvent( mnUpdateTagsEvent );
-
+
UpdateTagsHdl(0);
}
else
@@ -856,15 +856,15 @@ IMPL_LINK(AnnotationManagerImpl,UpdateTagsHdl, void *, EMPTYARG)
{
mnUpdateTagsEvent = 0;
DisposeTags();
-
+
if( mbShowAnnotations )
CreateTags();
-
+
if( mrBase.GetDrawView() )
- static_cast< ::sd::View* >( mrBase.GetDrawView() )->updateHandles();
+ static_cast< ::sd::View* >( mrBase.GetDrawView() )->updateHandles();
invalidateSlots();
-
+
return 0;
}
@@ -877,7 +877,7 @@ void AnnotationManagerImpl::CreateTags()
maFont = Application::GetSettings().GetStyleSettings().GetAppFont();
rtl::Reference< AnnotationTag > xSelectedTag;
-
+
Reference< XAnnotationEnumeration > xEnum( mxCurrentPage->createAnnotationEnumeration() );
while( xEnum->hasMoreElements() )
{
@@ -885,16 +885,16 @@ void AnnotationManagerImpl::CreateTags()
Color aColor( GetColorLight( mpDoc->GetAnnotationAuthorIndex( xAnnotation->getAuthor() ) ) );
rtl::Reference< AnnotationTag > xTag( new AnnotationTag( *this, *mrBase.GetMainViewShell()->GetView(), xAnnotation, aColor, nIndex++, maFont ) );
maTagVector.push_back(xTag);
-
+
if( xAnnotation == mxSelectedAnnotation )
{
xSelectedTag = xTag;
}
}
-
+
if( xSelectedTag.is() )
{
- SmartTagReference xTag( xSelectedTag.get() );
+ SmartTagReference xTag( xSelectedTag.get() );
mrBase.GetMainViewShell()->GetView()->getSmartTags().select( xTag );
}
else
@@ -921,7 +921,7 @@ void AnnotationManagerImpl::DisposeTags()
(*iter++)->Dispose();
}
while( iter != maTagVector.end() );
-
+
maTagVector.clear();
}
}
@@ -979,19 +979,19 @@ OUString AnnotationManagerImpl::GetHelpText( ::com::sun::star::uno::Reference< :
{
OUString sAuthor( xAnnotation->getAuthor() );
if( sAuthor.getLength() != 0 )
- {
+ {
sRet += sAuthor;
}
sRet += OUString( RTL_CONSTASCII_USTRINGPARAM( " [" ) );
-
+
sRet += getAnnotationDateTimeString( xAnnotation );
sRet += OUString( RTL_CONSTASCII_USTRINGPARAM( "]\n" ) );
-
+
Reference< XText > xText( xAnnotation->getTextRange() );
if( xText.is() )
sRet += xText->getString();
}
-
+
return sRet;
}
#endif
@@ -1001,29 +1001,29 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
SfxDispatcher* pDispatcher( getDispatcher( mrBase ) );
if( !pDispatcher )
return;
-
+
const bool bReadOnly = mrBase.GetDocShell()->IsReadOnly();
-
+
AnnotationWindow* pAnnotationWindow = bButtonMenu ? 0 : dynamic_cast< AnnotationWindow* >( pParent );
-
+
if( bReadOnly && !pAnnotationWindow )
return;
-
+
std::auto_ptr< PopupMenu > pMenu( new PopupMenu( SdResId( pAnnotationWindow ? RID_ANNOTATION_CONTEXTMENU : RID_ANNOTATION_TAG_CONTEXTMENU ) ) );
SvtUserOptions aUserOptions;
- OUString sCurrentAuthor( aUserOptions.GetFullName() );
+ OUString sCurrentAuthor( aUserOptions.GetFullName() );
OUString sAuthor( xAnnotation->getAuthor() );
-
+
String aStr( pMenu->GetItemText( SID_DELETEALLBYAUTHOR_POSTIT ) ), aReplace( sAuthor );
if( aReplace.Len() == 0 )
aReplace = String( SdResId( STR_ANNOTATION_NOAUTHOR ) );
aStr.SearchAndReplaceAscii("%1", aReplace);
pMenu->SetItemText( SID_DELETEALLBYAUTHOR_POSTIT, aStr );
pMenu->EnableItem( SID_REPLYTO_POSTIT, (sAuthor != sCurrentAuthor) && !bReadOnly );
- pMenu->EnableItem( SID_DELETE_POSTIT, (xAnnotation.is() && !bReadOnly) ? TRUE : FALSE );
- pMenu->EnableItem( SID_DELETEALLBYAUTHOR_POSTIT, !bReadOnly );
- pMenu->EnableItem( SID_DELETEALL_POSTIT, !bReadOnly );
+ pMenu->EnableItem( SID_DELETE_POSTIT, (xAnnotation.is() && !bReadOnly) ? TRUE : FALSE );
+ pMenu->EnableItem( SID_DELETEALLBYAUTHOR_POSTIT, !bReadOnly );
+ pMenu->EnableItem( SID_DELETEALL_POSTIT, !bReadOnly );
if( pAnnotationWindow )
{
@@ -1038,18 +1038,18 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
else
{
SfxItemSet aSet(pAnnotationWindow->getView()->GetAttribs());
-
+
if ( aSet.GetItemState( EE_CHAR_WEIGHT ) == SFX_ITEM_ON )
{
if( ((const SvxWeightItem&)aSet.Get( EE_CHAR_WEIGHT )).GetWeight() == WEIGHT_BOLD )
pMenu->CheckItem( SID_ATTR_CHAR_WEIGHT );
}
-
+
if ( aSet.GetItemState( EE_CHAR_ITALIC ) == SFX_ITEM_ON )
{
if( ((const SvxPostureItem&)aSet.Get( EE_CHAR_ITALIC )).GetPosture() != ITALIC_NONE )
pMenu->CheckItem( SID_ATTR_CHAR_POSTURE );
-
+
}
if ( aSet.GetItemState( EE_CHAR_UNDERLINE ) == SFX_ITEM_ON )
{
@@ -1065,12 +1065,12 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pAnnotationWindow ) );
pMenu->EnableItem( SID_PASTE, aDataHelper.GetFormatCount() != 0 );
}
-
+
pMenu->EnableItem( SID_COPY, pAnnotationWindow->getView()->HasSelection() );
}
USHORT nId = 0;
-
+
// set slot images
Reference< ::com::sun::star::frame::XFrame > xFrame( mrBase.GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface() );
if( xFrame.is() )
@@ -1078,12 +1078,12 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
const bool bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
for( USHORT nPos = 0; nPos < pMenu->GetItemCount(); nPos++ )
{
- nId = pMenu->GetItemId( nPos );
+ nId = pMenu->GetItemId( nPos );
if( pMenu->IsItemEnabled( nId ) )
{
OUString sSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
sSlotURL += OUString::valueOf( sal_Int32( nId ));
-
+
Image aImage( GetImage( xFrame, sSlotURL, false, bHighContrast ) );
if( !!aImage )
pMenu->SetItemImage( nId, aImage );
@@ -1114,10 +1114,10 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
}
case SID_DELETEALL_POSTIT:
pDispatcher->Execute( SID_DELETEALL_POSTIT );
- break;
+ break;
case SID_COPY:
case SID_PASTE:
- case SID_ATTR_CHAR_WEIGHT:
+ case SID_ATTR_CHAR_WEIGHT:
case SID_ATTR_CHAR_POSTURE:
case SID_ATTR_CHAR_UNDERLINE:
case SID_ATTR_CHAR_STRIKEOUT:
@@ -1134,9 +1134,9 @@ Color AnnotationManagerImpl::GetColor(sal_uInt16 aAuthorIndex)
if (!Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
static const Color aArrayNormal[] = {
- COL_AUTHOR1_NORMAL, COL_AUTHOR2_NORMAL, COL_AUTHOR3_NORMAL,
- COL_AUTHOR4_NORMAL, COL_AUTHOR5_NORMAL, COL_AUTHOR6_NORMAL,
- COL_AUTHOR7_NORMAL, COL_AUTHOR8_NORMAL, COL_AUTHOR9_NORMAL };
+ COL_AUTHOR1_NORMAL, COL_AUTHOR2_NORMAL, COL_AUTHOR3_NORMAL,
+ COL_AUTHOR4_NORMAL, COL_AUTHOR5_NORMAL, COL_AUTHOR6_NORMAL,
+ COL_AUTHOR7_NORMAL, COL_AUTHOR8_NORMAL, COL_AUTHOR9_NORMAL };
return Color( aArrayNormal[ aAuthorIndex % (sizeof( aArrayNormal )/ sizeof( aArrayNormal[0] ))]);
}
@@ -1149,9 +1149,9 @@ Color AnnotationManagerImpl::GetColorLight(sal_uInt16 aAuthorIndex)
if (!Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
static const Color aArrayLight[] = {
- COL_AUTHOR1_LIGHT, COL_AUTHOR2_LIGHT, COL_AUTHOR3_LIGHT,
- COL_AUTHOR4_LIGHT, COL_AUTHOR5_LIGHT, COL_AUTHOR6_LIGHT,
- COL_AUTHOR7_LIGHT, COL_AUTHOR8_LIGHT, COL_AUTHOR9_LIGHT };
+ COL_AUTHOR1_LIGHT, COL_AUTHOR2_LIGHT, COL_AUTHOR3_LIGHT,
+ COL_AUTHOR4_LIGHT, COL_AUTHOR5_LIGHT, COL_AUTHOR6_LIGHT,
+ COL_AUTHOR7_LIGHT, COL_AUTHOR8_LIGHT, COL_AUTHOR9_LIGHT };
return Color( aArrayLight[ aAuthorIndex % (sizeof( aArrayLight )/ sizeof( aArrayLight[0] ))]);
}
@@ -1164,11 +1164,11 @@ Color AnnotationManagerImpl::GetColorDark(sal_uInt16 aAuthorIndex)
if (!Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
static const Color aArrayAnkor[] = {
- COL_AUTHOR1_DARK, COL_AUTHOR2_DARK, COL_AUTHOR3_DARK,
- COL_AUTHOR4_DARK, COL_AUTHOR5_DARK, COL_AUTHOR6_DARK,
- COL_AUTHOR7_DARK, COL_AUTHOR8_DARK, COL_AUTHOR9_DARK };
+ COL_AUTHOR1_DARK, COL_AUTHOR2_DARK, COL_AUTHOR3_DARK,
+ COL_AUTHOR4_DARK, COL_AUTHOR5_DARK, COL_AUTHOR6_DARK,
+ COL_AUTHOR7_DARK, COL_AUTHOR8_DARK, COL_AUTHOR9_DARK };
- return Color( aArrayAnkor[ aAuthorIndex % (sizeof( aArrayAnkor ) / sizeof( aArrayAnkor[0] ))]);
+ return Color( aArrayAnkor[ aAuthorIndex % (sizeof( aArrayAnkor ) / sizeof( aArrayAnkor[0] ))]);
}
else
return Color(COL_WHITE);
@@ -1178,14 +1178,14 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
{
if( pPage == 0 )
return bForeward ? GetFirstPage() : GetLastPage();
-
+
sal_uInt16 nPageNum = (pPage->GetPageNum() - 1) >> 1;
// first all non master pages
if( !pPage->IsMasterPage() )
{
if( bForeward )
- {
+ {
if( nPageNum >= mpDoc->GetSdPageCount(PK_STANDARD)-1 )
{
// we reached end of draw pages, start with master pages (skip handout master for draw)
@@ -1197,15 +1197,15 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
{
if( nPageNum == 0 )
return 0; // we are already on the first draw page, finished
-
- nPageNum--;
+
+ nPageNum--;
}
return mpDoc->GetSdPage(nPageNum, PK_STANDARD);
}
else
{
if( bForeward )
- {
+ {
if( nPageNum >= mpDoc->GetMasterSdPageCount(PK_STANDARD)-1 )
{
return 0; // we reached the end, there is nothing more to see here
@@ -1218,12 +1218,12 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
{
// we reached beginning of master pages, start with end if pages
return mpDoc->GetSdPage( mpDoc->GetSdPageCount(PK_STANDARD)-1, PK_STANDARD );
- }
-
- nPageNum--;
+ }
+
+ nPageNum--;
}
return mpDoc->GetMasterSdPage(nPageNum,PK_STANDARD);
- }
+ }
}
SdPage* AnnotationManagerImpl::GetFirstPage()