diff options
Diffstat (limited to 'sc/source/ui/drawfunc/drtxtob.cxx')
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index a5159d8a8043..7373142a9b1e 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.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 @@ -126,7 +126,7 @@ ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) : { SetPool( pViewData->GetScDrawView()->GetDefaultAttr().GetPool() ); - // UndoManager wird beim Umschalten in den Edit-Modus umgesetzt... + // UndoManager wird beim Umschalten in den Edit-Modus umgesetzt... SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager(); SetUndoManager( pMgr ); if ( !pViewData->GetDocument()->IsUndoEnabled() ) @@ -154,7 +154,7 @@ __EXPORT ScDrawTextObjectBar::~ScDrawTextObjectBar() //======================================================================== // -// Funktionen +// Funktionen // //======================================================================== @@ -166,7 +166,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) if (!pOutView || !pOutliner) { - ExecuteGlobal( rReq ); // auf ganze Objekte + ExecuteGlobal( rReq ); // auf ganze Objekte return; } @@ -249,14 +249,14 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) else aNewItem = rItem; } - else + else ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame(), aNewItem, aString ); if ( aString.Len() ) { SfxItemSet aSet( pOutliner->GetEmptyItemSet() ); aSet.Put( aNewItem ); - // SetAttribs an der View selektiert ein Wort, wenn nichts selektiert ist + // SetAttribs an der View selektiert ein Wort, wenn nichts selektiert ist pOutView->GetOutliner()->QuickSetAttribs( aSet, pOutView->GetSelection() ); pOutView->InsertText(aString); } @@ -272,21 +272,21 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) if ( pReqArgs->GetItemState( SID_HYPERLINK_SETLINK, TRUE, &pItem ) == SFX_ITEM_SET ) { const SvxHyperlinkItem* pHyper = (const SvxHyperlinkItem*) pItem; - const String& rName = pHyper->GetName(); - const String& rURL = pHyper->GetURL(); - const String& rTarget = pHyper->GetTargetFrame(); + const String& rName = pHyper->GetName(); + const String& rURL = pHyper->GetURL(); + const String& rTarget = pHyper->GetTargetFrame(); SvxLinkInsertMode eMode = pHyper->GetInsertMode(); BOOL bDone = FALSE; if ( pOutView && ( eMode == HLINK_DEFAULT || eMode == HLINK_FIELD ) ) { - const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection(); + const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection(); if (pFieldItem) { const SvxFieldData* pField = pFieldItem->GetField(); if ( pField && pField->ISA(SvxURLField) ) { - // altes Feld selektieren + // altes Feld selektieren ESelection aSel = pOutView->GetSelection(); aSel.Adjust(); @@ -296,19 +296,19 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) } } - // neues Feld einfuegen + // neues Feld einfuegen SvxURLField aURLField( rURL, rName, SVXURLFORMAT_REPR ); aURLField.SetTargetFrame( rTarget ); SvxFieldItem aURLItem( aURLField, EE_FEATURE_FIELD ); pOutView->InsertField( aURLItem ); - // select new field + // select new field ESelection aSel = pOutView->GetSelection(); if ( aSel.nStartPos == aSel.nEndPos && aSel.nStartPos > 0 ) { - // Cursor is behind the inserted field -> extend selection to the left + // Cursor is behind the inserted field -> extend selection to the left --aSel.nStartPos; pOutView->SetSelection( aSel ); @@ -318,9 +318,9 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) } if (!bDone) - ExecuteGlobal( rReq ); // normal an der View + ExecuteGlobal( rReq ); // normal an der View - // InsertURL an der ViewShell schaltet bei "Text" die DrawShell ab !!! + // InsertURL an der ViewShell schaltet bei "Text" die DrawShell ab !!! } } break; @@ -356,7 +356,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) else #endif { - pView->ScEndTextEdit(); // end text edit before switching direction + pView->ScEndTextEdit(); // end text edit before switching direction ExecuteGlobal( rReq ); // restore consistent state between shells and functions: pViewData->GetDispatcher().Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); @@ -372,7 +372,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) ExecuteGlobal( rReq ); break; #endif - + case SID_THES: { String aReplaceText; @@ -382,14 +382,14 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq ) if (aReplaceText.Len() > 0) ReplaceTextWithSynonym( pOutView->GetEditView(), aReplaceText ); } - break; - + break; + case SID_THESAURUS: { pOutView->StartThesaurus(); } - break; - + break; + } } @@ -406,7 +406,7 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) } if ( bDisableFontWork ) - rSet.DisableItem( SID_FONTWORK ); + rSet.DisableItem( SID_FONTWORK ); else rSet.Put(SfxBoolItem(SID_FONTWORK, bHasFontWork)); @@ -418,7 +418,7 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) if ( pOutView ) { BOOL bField = FALSE; - const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection(); + const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection(); if (pFieldItem) { const SvxFieldData* pField = pFieldItem->GetField(); @@ -482,12 +482,12 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) } } - if ( rSet.GetItemState( SID_THES ) != SFX_ITEM_UNKNOWN || + if ( rSet.GetItemState( SID_THES ) != SFX_ITEM_UNKNOWN || rSet.GetItemState( SID_THESAURUS ) != SFX_ITEM_UNKNOWN ) { SdrView * pView = pViewData->GetScDrawView(); OutlinerView* pOutView = pView->GetTextEditOutlinerView(); - + String aStatusVal; LanguageType nLang = LANGUAGE_NONE; bool bIsLookUpWord = false; @@ -504,7 +504,7 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) rSet.DisableItem( SID_THES ); if (!bCanDoThesaurus) rSet.DisableItem( SID_THESAURUS ); - } + } } IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pDataHelper ) @@ -578,13 +578,13 @@ void __EXPORT ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet ) //======================================================================== // -// Attribute +// Attribute // //======================================================================== void __EXPORT ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq ) { - // Unterstreichung + // Unterstreichung SdrView* pView = pViewData->GetScDrawView(); @@ -595,7 +595,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq ) SfxItemSet aViewAttr(pView->GetModel()->GetItemPool()); pView->GetAttributes(aViewAttr); - // Unterstreichung + // Unterstreichung FontUnderline eOld = ((const SvxUnderlineItem&) aViewAttr. Get(EE_CHAR_UNDERLINE)).GetLineStyle(); FontUnderline eNew = eOld; @@ -625,7 +625,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq ) void lcl_RemoveFields( OutlinerView& rOutView ) { - //! Outliner should have RemoveFields with a selection + //! Outliner should have RemoveFields with a selection Outliner* pOutliner = rOutView.GetOutliner(); if (!pOutliner) return; @@ -638,7 +638,7 @@ void lcl_RemoveFields( OutlinerView& rOutView ) BOOL bUpdate = pOutliner->GetUpdateMode(); BOOL bChanged = FALSE; - //! GetPortions and GetAttribs should be const! + //! GetPortions and GetAttribs should be const! EditEngine& rEditEng = (EditEngine&)pOutliner->GetEditEngine(); ULONG nParCount = pOutliner->GetParagraphCount(); @@ -647,7 +647,7 @@ void lcl_RemoveFields( OutlinerView& rOutView ) { SvUShorts aPortions; rEditEng.GetPortions( (USHORT)nPar, aPortions ); - //! GetPortions should use xub_StrLen instead of USHORT + //! GetPortions should use xub_StrLen instead of USHORT for ( USHORT nPos = aPortions.Count(); nPos; ) { @@ -690,30 +690,30 @@ void lcl_RemoveFields( OutlinerView& rOutView ) pOutliner->SetUpdateMode( TRUE ); } - if ( aOldSel.IsEqual( aSel ) ) // aSel is adjusted + if ( aOldSel.IsEqual( aSel ) ) // aSel is adjusted aOldSel.nEndPos = nNewEnd; else - aOldSel.nStartPos = nNewEnd; // if aOldSel is backwards + aOldSel.nStartPos = nNewEnd; // if aOldSel is backwards rOutView.SetSelection( aOldSel ); } void __EXPORT ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) { - SdrView* pView = pViewData->GetScDrawView(); - const SfxItemSet* pArgs = rReq.GetArgs(); - USHORT nSlot = rReq.GetSlot(); + SdrView* pView = pViewData->GetScDrawView(); + const SfxItemSet* pArgs = rReq.GetArgs(); + USHORT nSlot = rReq.GetSlot(); BOOL bArgsInReq = ( pArgs != NULL ); if ( !bArgsInReq ) { SfxItemSet aEditAttr(pView->GetModel()->GetItemPool()); pView->GetAttributes(aEditAttr); - SfxItemSet aNewAttr( *aEditAttr.GetPool(), aEditAttr.GetRanges() ); - BOOL bDone = TRUE; + SfxItemSet aNewAttr( *aEditAttr.GetPool(), aEditAttr.GetRanges() ); + BOOL bDone = TRUE; switch ( nSlot ) { - case SID_TEXT_STANDARD: // Harte Textattributierung loeschen + case SID_TEXT_STANDARD: // Harte Textattributierung loeschen { OutlinerView* pOutView = pView->IsTextEdit() ? pView->GetTextEditOutlinerView() : NULL; @@ -735,8 +735,8 @@ void __EXPORT ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) } break; - case SID_CHAR_DLG: // Dialog-Button - case SID_ATTR_CHAR_FONT: // Controller nicht angezeigt + case SID_CHAR_DLG: // Dialog-Button + case SID_ATTR_CHAR_FONT: // Controller nicht angezeigt case SID_ATTR_CHAR_FONTHEIGHT: bDone = ExecuteCharDlg( aEditAttr, aNewAttr ); break; @@ -903,7 +903,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) // issue 21255 - Notes now support rich text formatting. } - SvtLanguageOptions aLangOpt; + SvtLanguageOptions aLangOpt; BOOL bDisableCTLFont = !aLangOpt.IsCTLFontEnabled(); BOOL bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled(); @@ -911,11 +911,11 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) SfxItemSet aAttrSet(pView->GetModel()->GetItemPool()); pView->GetAttributes(aAttrSet); - // direkte Attribute + // direkte Attribute rDestSet.Put( aAttrSet ); - // choose font info according to selection script type + // choose font info according to selection script type USHORT nScript = pView->GetScriptType(); @@ -939,7 +939,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) if ( rDestSet.GetItemState( EE_CHAR_ITALIC ) != SFX_ITEM_UNKNOWN ) ScViewUtil::PutItemScript( rDestSet, aAttrSet, EE_CHAR_ITALIC, nScript ); - // Ausrichtung + // Ausrichtung SvxAdjust eAdj = ((const SvxAdjustItem&)aAttrSet.Get(EE_PARA_JUST)).GetAdjust(); switch( eAdj ) @@ -967,7 +967,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) rDestSet.Put( SfxBoolItem( SID_ALIGN_ANY_RIGHT, eAdj == SVX_ADJUST_RIGHT ) ); rDestSet.Put( SfxBoolItem( SID_ALIGN_ANY_JUSTIFIED, eAdj == SVX_ADJUST_BLOCK ) ); - // Zeilenabstand + // Zeilenabstand USHORT nLineSpace = (USHORT) ((const SvxLineSpacingItem&)aAttrSet. @@ -985,7 +985,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) break; } - // hoch-/tiefgestellt + // hoch-/tiefgestellt SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&) aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); @@ -994,7 +994,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT ) rDestSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, TRUE ) ); - // Unterstreichung + // Unterstreichung SfxItemState eState = aAttrSet.GetItemState( EE_CHAR_UNDERLINE, TRUE ); if ( eState == SFX_ITEM_DONTCARE ) @@ -1011,16 +1011,16 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) USHORT nId = SID_ULINE_VAL_NONE; switch (eUnderline) { - case UNDERLINE_SINGLE: nId = SID_ULINE_VAL_SINGLE; break; - case UNDERLINE_DOUBLE: nId = SID_ULINE_VAL_DOUBLE; break; - case UNDERLINE_DOTTED: nId = SID_ULINE_VAL_DOTTED; break; + case UNDERLINE_SINGLE: nId = SID_ULINE_VAL_SINGLE; break; + case UNDERLINE_DOUBLE: nId = SID_ULINE_VAL_DOUBLE; break; + case UNDERLINE_DOTTED: nId = SID_ULINE_VAL_DOTTED; break; default: break; } rDestSet.Put( SfxBoolItem( nId, TRUE ) ); } - // horizontal / vertical + // horizontal / vertical BOOL bLeftToRight = TRUE; @@ -1044,11 +1044,11 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) rDestSet.Put( SfxBoolItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM, !bLeftToRight ) ); } - // left-to-right or right-to-left + // left-to-right or right-to-left if ( !bLeftToRight || bDisableCTLFont ) { - // disabled if vertical + // disabled if vertical rDestSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT ); rDestSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT ); } @@ -1063,7 +1063,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) aAttrSet.Get( EE_PARA_WRITINGDIR )).GetValue(); if ( eAttrDir == FRMDIR_ENVIRONMENT ) { - // get "environment" direction from page style + // get "environment" direction from page style if ( pViewData->GetDocument()->GetEditTextDirection( pViewData->GetTabNo() ) == EE_HTEXTDIR_R2L ) eAttrDir = FRMDIR_HORI_RIGHT_TOP; else @@ -1083,12 +1083,12 @@ void ScDrawTextObjectBar::ExecuteTrans( SfxRequest& rReq ) OutlinerView* pOutView = pView->GetTextEditOutlinerView(); if ( pOutView ) { - // change selected text in object + // change selected text in object pOutView->TransliterateText( nType ); } else { - //! apply to whole objects? + //! apply to whole objects? } } } |