xref: /trunk/main/sd/source/ui/view/drtxtob.cxx (revision 9ec87cd3)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 
27 #include "TextObjectBar.hxx"
28 
29 #include <svx/svxids.hrc>
30 
31 #include <i18npool/mslangid.hxx>
32 #include <editeng/ulspitem.hxx>
33 #include <editeng/lspcitem.hxx>
34 #include <editeng/adjitem.hxx>
35 #include <editeng/editview.hxx>
36 #include <editeng/editeng.hxx>
37 #include <editeng/outliner.hxx>
38 #include <editeng/unolingu.hxx>
39 #include <editeng/ulspitem.hxx>
40 #include <editeng/lspcitem.hxx>
41 #include <editeng/adjitem.hxx>
42 #include <editeng/kernitem.hxx>
43 #include <vcl/vclenum.hxx>
44 #include <sfx2/app.hxx>
45 #include <svl/whiter.hxx>
46 #include <svl/itempool.hxx>
47 #include <svl/stritem.hxx>
48 #include <svl/style.hxx>
49 #include <svl/languageoptions.hxx>
50 #include <sfx2/tplpitem.hxx>
51 #include <editeng/escpitem.hxx>
52 #include <svx/svdoutl.hxx>
53 #include <svl/intitem.hxx>
54 #include <editeng/scripttypeitem.hxx>
55 #include <editeng/outlobj.hxx>
56 #include <editeng/writingmodeitem.hxx>
57 #include <editeng/frmdiritem.hxx>
58 
59 
60 #include <sfx2/objface.hxx>
61 
62 #include "app.hrc"
63 #include "glob.hrc"
64 #include "res_bmp.hrc"
65 
66 #include "eetext.hxx"
67 
68 #include "drawdoc.hxx"
69 #include "DrawViewShell.hxx"
70 #include "OutlineViewShell.hxx"
71 #include "ViewShellBase.hxx"
72 #include "ToolBarManager.hxx"
73 #include "futempl.hxx"
74 #include "sdresid.hxx"
75 #include "Window.hxx"
76 #include "OutlineView.hxx"
77 
78 
79 using namespace sd;
80 using namespace ::com::sun::star;
81 
82 #define TextObjectBar
83 #include "sdslots.hxx"
84 
85 namespace sd {
86 
87 /*************************************************************************
88 |*
89 |* Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also
90 |* tragen wir etwas ein, was hier (hoffentlich) nie vorkommt).
91 |*
92 \************************************************************************/
93 
94 
95 SFX_IMPL_INTERFACE( TextObjectBar, SfxShell, SdResId(STR_TEXTOBJECTBARSHELL) )
96 {
97 }
98 
99 TYPEINIT1( TextObjectBar, SfxShell );
100 
101 /*************************************************************************
102 |*
103 |* Standard-Konstruktor
104 |*
105 \************************************************************************/
106 
107 TextObjectBar::TextObjectBar (
108     ViewShell* pSdViewSh,
109     SfxItemPool& rItemPool,
110     ::sd::View* pSdView )
111     : SfxShell(pSdViewSh->GetViewShell()),
112       mpViewShell( pSdViewSh ),
113       mpView( pSdView )
114 {
115 	SetPool(&rItemPool);
116 
117 	if( mpView )
118 	{
119 		OutlineView* pOutlinerView = dynamic_cast< OutlineView* >( mpView );
120 		if( pOutlinerView )
121 		{
122 			SetUndoManager(&pOutlinerView->GetOutliner()->GetUndoManager());
123 		}
124 		else
125 		{
126 			SdDrawDocument* pDoc = mpView->GetDoc();
127 			if( pDoc )
128 			{
129 				DrawDocShell* pDocShell = pDoc->GetDocSh();
130 				if( pDocShell )
131 				{
132 					SetUndoManager(pDocShell->GetUndoManager());
133 					DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( pSdViewSh );
134 					if ( pDrawViewShell )
135 						SetRepeatTarget(pSdView);
136 				}
137 			}
138 		}
139 	}
140 
141 	SetName( String( RTL_CONSTASCII_USTRINGPARAM( "TextObjectBar" )));
142 
143 	// SetHelpId( SD_IF_SDDRAWTEXTOBJECTBAR );
144 }
145 
146 /*************************************************************************
147 |*
148 |* Destruktor
149 |*
150 \************************************************************************/
151 
152 TextObjectBar::~TextObjectBar()
153 {
154 	SetRepeatTarget(NULL);
155 }
156 
157 void TextObjectBar::GetCharState( SfxItemSet& rSet )
158 {
159 	SfxItemSet  aCharAttrSet( mpView->GetDoc()->GetPool() );
160 	mpView->GetAttributes( aCharAttrSet );
161 
162 	SfxItemSet aNewAttr( mpViewShell->GetPool(),EE_ITEMS_START,EE_ITEMS_END);
163 
164 	aNewAttr.Put(aCharAttrSet, sal_False);
165 	rSet.Put(aNewAttr, sal_False);
166 
167 	SvxKerningItem aKern = ( (const SvxKerningItem&) aCharAttrSet.Get( EE_CHAR_KERNING ) );
168 	//aKern.SetWhich(SID_ATTR_CHAR_KERNING);
169 	rSet.Put(aKern);
170 
171 	SfxItemState eState = aCharAttrSet.GetItemState( EE_CHAR_KERNING, sal_True );
172 	if ( eState == SFX_ITEM_DONTCARE )
173 	{
174 		rSet.InvalidateItem(EE_CHAR_KERNING);
175 	}
176 }
177 
178 /*************************************************************************
179 |*
180 |* Status der Attribut-Items
181 |*
182 \************************************************************************/
183 
184 void TextObjectBar::GetAttrState( SfxItemSet& rSet )
185 {
186 	SfxWhichIter	    aIter( rSet );
187 	sal_uInt16			    nWhich = aIter.FirstWhich();
188 	sal_Bool			    bTemplate = sal_False;
189 	SfxItemSet 		    aAttrSet( mpView->GetDoc()->GetPool() );
190     SvtLanguageOptions  aLangOpt;
191     sal_Bool            bDisableParagraphTextDirection = !aLangOpt.IsCTLFontEnabled();
192     sal_Bool			bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled();
193 
194 	mpView->GetAttributes( aAttrSet );
195 
196 	while ( nWhich )
197 	{
198 		sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
199 			? GetPool().GetSlotId(nWhich)
200 			: nWhich;
201 
202 		switch ( nSlotId )
203 		{
204 			case SID_ATTR_CHAR_FONT:
205             case SID_ATTR_CHAR_FONTHEIGHT:
206             case SID_ATTR_CHAR_WEIGHT:
207             case SID_ATTR_CHAR_POSTURE:
208 		case SID_ATTR_CHAR_SHADOWED:
209             case SID_ATTR_CHAR_STRIKEOUT:
210             {
211                 SvxScriptSetItem aSetItem( nSlotId, GetPool() );
212                 aSetItem.GetItemSet().Put( aAttrSet, sal_False );
213 
214 				sal_uInt16 nScriptType = mpView->GetScriptType();
215 
216 				if( (nSlotId == SID_ATTR_CHAR_FONT) || (nSlotId == SID_ATTR_CHAR_FONTHEIGHT) )
217 				{
218 					// #42732# input language should be preferred over
219 					// current cursor position to detect script type
220 					OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
221 
222 					if (mpView->ISA(OutlineView))
223 					{
224 						pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
225 							mpViewShell->GetActiveWindow());
226 					}
227 
228 					if(pOLV && !pOLV->GetSelection().HasRange())
229 					{
230 						if( mpViewShell && mpViewShell->GetViewShell() && mpViewShell->GetViewShell()->GetWindow() )
231 						{
232 							LanguageType nInputLang = mpViewShell->GetViewShell()->GetWindow()->GetInputLanguage();
233 							if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
234 								nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
235 						}
236 					}
237 				}
238 
239                 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
240                 if( pI )
241                 	aAttrSet.Put( *pI, nWhich );
242                 else
243                     aAttrSet.InvalidateItem( nWhich );
244             }
245             break;
246 
247 
248 			case SID_STYLE_APPLY:
249 			case SID_STYLE_FAMILY2:
250 			{
251 				SfxStyleSheet* pStyleSheet = mpView->GetStyleSheetFromMarked();
252 				if( pStyleSheet )
253 					rSet.Put( SfxTemplateItem( nWhich, pStyleSheet->GetName() ) );
254 				else
255 				{
256 					rSet.Put( SfxTemplateItem( nWhich, String() ) );
257 				}
258 				bTemplate = sal_True;
259 			}
260 			break;
261 
262 			case SID_OUTLINE_LEFT:
263 			case SID_OUTLINE_RIGHT:
264 			case SID_OUTLINE_UP:
265 			case SID_OUTLINE_DOWN:
266 			{
267 				sal_Bool bDisableLeft     = sal_True;
268 				sal_Bool bDisableRight    = sal_True;
269 				sal_Bool bDisableUp       = sal_True;
270 				sal_Bool bDisableDown     = sal_True;
271 				OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
272 
273 				if (mpView->ISA(OutlineView))
274 				{
275 					pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
276                         mpViewShell->GetActiveWindow());
277 				}
278 
279 				sal_Bool bOutlineViewSh = mpViewShell->ISA(OutlineViewShell);
280 
281 				if (pOLV &&
282 					( pOLV->GetOutliner()->GetMode() == OUTLINERMODE_OUTLINEOBJECT || bOutlineViewSh ) )
283 				{
284 					// Outliner im Gliederungsmodus
285 					::Outliner* pOutl = pOLV->GetOutliner();
286 					List* pList = pOLV->CreateSelectionList();
287 					Paragraph* pPara = (Paragraph*) pList->First();
288 
289 					// #96539# find out if we are a OutlineView
290 					sal_Bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == pOLV->GetOutliner()->GetMode());
291 
292 					// #96539# This is ONLY for OutlineViews
293 					if(bIsOutlineView)
294 					{
295 						// #96250# and #78665#
296 						// allow move up if position is 2 or greater OR it
297 						// is a title object (and thus depth==1)
298 						if(pOutl->GetAbsPos(pPara) > 1 || ( pOutl->HasParaFlag(pPara,PARAFLAG_ISPAGE) && pOutl->GetAbsPos(pPara) > 0 ) )
299 						{
300 							// Nicht ganz oben
301 							bDisableUp = sal_False;
302 						}
303 					}
304 					else
305 					{
306 						// #96539# old behaviour for OUTLINERMODE_OUTLINEOBJECT
307 						if(pOutl->GetAbsPos(pPara) > 0)
308 						{
309 							// Nicht ganz oben
310 							bDisableUp = sal_False;
311 						}
312 					}
313 
314 					while (pPara)
315 					{
316 						sal_Int16 nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) );
317 
318 						if (nDepth > 0 || (bOutlineViewSh && (nDepth <= 0) && !pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) )
319 						{
320 							// Nicht minimale Tiefe
321 							bDisableLeft = sal_False;
322 						}
323 
324 						if( (nDepth < pOLV->GetOutliner()->GetMaxDepth() && ( !bOutlineViewSh || pOutl->GetAbsPos(pPara) != 0 )) ||
325                             (bOutlineViewSh && (nDepth <= 0) && pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) && pOutl->GetAbsPos(pPara) != 0) )
326 						{
327 							// Nicht maximale Tiefe und nicht ganz oben
328 							bDisableRight = sal_False;
329 						}
330 
331 						pPara = static_cast<Paragraph*>( pList->Next() );
332 					}
333 
334 					if ( ( pOutl->GetAbsPos((Paragraph*) pList->Last()) < pOutl->GetParagraphCount() - 1 ) &&
335 						 ( pOutl->GetParagraphCount() > 1 || !bOutlineViewSh) )
336 					{
337 						// Nicht letzter Absatz
338 						bDisableDown = sal_False;
339 					}
340 
341 					// #96250# and #78665#
342 					// disable when first para and 2nd is not a title
343 					pPara = static_cast< Paragraph* >( pList->First() );
344 					if(!bDisableDown && bIsOutlineView
345 						&& pPara
346 						&& 0 == pOutl->GetAbsPos(pPara)
347 						&& pOutl->GetParagraphCount() > 1
348 						&& !pOutl->HasParaFlag( pOutl->GetParagraph(1), PARAFLAG_ISPAGE ) )
349 					{
350 						// Needs to be disabled
351 						bDisableDown = sal_True;
352 					}
353 
354 					delete pList;
355 				}
356 
357 				if (bDisableLeft)
358 					rSet.DisableItem(SID_OUTLINE_LEFT);
359 				if (bDisableRight)
360 					rSet.DisableItem(SID_OUTLINE_RIGHT);
361 				if (bDisableUp)
362 					rSet.DisableItem(SID_OUTLINE_UP);
363 				if (bDisableDown)
364 					rSet.DisableItem(SID_OUTLINE_DOWN);
365 			}
366 			break;
367 
368 			case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
369 			case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
370 			{
371 				if ( bDisableVerticalText )
372 				{
373 					rSet.DisableItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
374 					rSet.DisableItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
375 				}
376 				else
377 				{
378 					sal_Bool bLeftToRight = sal_True;
379 
380 					SdrOutliner* pOutl = mpView->GetTextEditOutliner();
381 					if( pOutl )
382 					{
383 						if( pOutl->IsVertical() )
384 							bLeftToRight = sal_False;
385 					}
386 					else
387 						bLeftToRight = ( (const SvxWritingModeItem&) aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB;
388 
389 					rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT, bLeftToRight ) );
390                     rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM, !bLeftToRight ) );
391 
392 					if( !bLeftToRight )
393 						bDisableParagraphTextDirection = sal_True;
394 				}
395 			}
396 			break;
397 
398             case SID_GROW_FONT_SIZE:
399             case SID_SHRINK_FONT_SIZE:
400             {
401                 // todo
402             }
403             break;
404 
405             case SID_THES:
406             {
407 				if( mpView && mpView->GetTextEditOutlinerView() )
408 				{
409 					EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();;
410 					String          aStatusVal;
411 					LanguageType    nLang = LANGUAGE_NONE;
412 					bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView );
413 					rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
414 
415 					// disable "Thesaurus" context menu entry if there is nothing to look up
416 					lang::Locale aLocale( SvxCreateLocale( nLang ) );
417 					uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
418 					if (!bIsLookUpWord ||
419 						!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
420 						rSet.DisableItem( SID_THES );
421 				}
422 				else
423 				{
424 					rSet.DisableItem( SID_THES );
425 				}
426                 //! avoid putting the same item as SfxBoolItem at the end of this function
427                 nSlotId = 0;
428             }
429             break;
430 
431 			default:
432 			break;
433 		}
434 
435 		nWhich = aIter.NextWhich();
436 	}
437 
438 	rSet.Put( aAttrSet, sal_False ); // <- sal_False, damit DontCare-Status uebernommen wird
439 
440 
441 	// die sind im Gliederungsmodus disabled
442 	if (!mpViewShell->ISA(DrawViewShell))
443 	{
444 		rSet.DisableItem( SID_ATTR_PARA_ADJUST_LEFT );
445 		rSet.DisableItem( SID_ATTR_PARA_ADJUST_RIGHT );
446 		rSet.DisableItem( SID_ATTR_PARA_ADJUST_CENTER );
447 		rSet.DisableItem( SID_ATTR_PARA_ADJUST_BLOCK );
448 		rSet.DisableItem( SID_ATTR_PARA_LINESPACE_10 );
449 		rSet.DisableItem( SID_ATTR_PARA_LINESPACE_15 );
450 		rSet.DisableItem( SID_ATTR_PARA_LINESPACE_20 );
451 		rSet.DisableItem( SID_PARASPACE_INCREASE );
452 		rSet.DisableItem( SID_PARASPACE_DECREASE );
453 		rSet.DisableItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
454 		rSet.DisableItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
455         rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT );
456         rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT );
457 	}
458 	else
459 	{
460 		// Absatzabstand
461 		OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
462 		if( pOLV )
463 		{
464 			ESelection aSel = pOLV->GetSelection();
465 			aSel.Adjust();
466 			sal_uLong nStartPara = aSel.nStartPara;
467 			sal_uLong nEndPara = aSel.nEndPara;
468 			if( !aSel.HasRange() )
469 			{
470 				nStartPara = 0;
471 				nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1;
472 			}
473 			long nUpper = 0L;
474 			for( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
475 			{
476 				const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( nPara );
477                 const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) rItems.Get( EE_PARA_ULSPACE );
478 				nUpper = Max( nUpper, (long)rItem.GetUpper() );
479 			}
480 			if( nUpper == 0L )
481 				rSet.DisableItem( SID_PARASPACE_DECREASE );
482 		}
483 		else
484 		{
485 			// Wird zur Zeit nie disabled !
486 			//rSet.DisableItem( SID_PARASPACE_INCREASE );
487 			//rSet.DisableItem( SID_PARASPACE_DECREASE );
488 		}
489 
490 		// Absatzausrichtung
491 		SvxLRSpaceItem aLR = ( (const SvxLRSpaceItem&) aAttrSet.Get( EE_PARA_LRSPACE ) );
492 		rSet.Put(aLR);
493 		SvxAdjust eAdj = ( (const SvxAdjustItem&) aAttrSet.Get( EE_PARA_JUST ) ).GetAdjust();
494 		switch( eAdj )
495 		{
496 			case SVX_ADJUST_LEFT:
497 				rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_LEFT, sal_True ) );
498 			break;
499 			case SVX_ADJUST_CENTER:
500 				rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_CENTER, sal_True ) );
501 			break;
502 			case SVX_ADJUST_RIGHT:
503 				rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, sal_True ) );
504 			break;
505 			case SVX_ADJUST_BLOCK:
506 				rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, sal_True ) );
507 			break;
508 			default:
509 			break;
510 		}
511 
512 		Invalidate(SID_ATTR_PARA_ADJUST_LEFT);
513 		Invalidate(SID_ATTR_PARA_ADJUST_CENTER);
514 		Invalidate(SID_ATTR_PARA_ADJUST_RIGHT);
515 		Invalidate(SID_ATTR_PARA_ADJUST_BLOCK);
516 		Invalidate(SID_ATTR_PARA_LINESPACE);
517 		Invalidate(SID_ATTR_PARA_ULSPACE);
518 
519         // paragraph text direction
520         if( bDisableParagraphTextDirection )
521         {
522             rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT );
523             rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT );
524         }
525         else
526         {
527             switch( ( ( (SvxFrameDirectionItem&) aAttrSet.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() )
528             {
529                 case FRMDIR_VERT_TOP_LEFT:
530                 case FRMDIR_VERT_TOP_RIGHT:
531                 {
532                     rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT );
533                     rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT );
534                 }
535                 break;
536 
537                 case FRMDIR_HORI_LEFT_TOP:
538 				    rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, sal_True ) );
539 				    rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, sal_False ) );
540                 break;
541 
542                 case FRMDIR_HORI_RIGHT_TOP:
543 				    rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, sal_False ) );
544 				    rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, sal_True ) );
545                 break;
546 
547 				// #107865#
548 				// The case for the superordinate object is missing.
549 				case FRMDIR_ENVIRONMENT:
550 				{
551 					SdDrawDocument* pDoc = mpView->GetDoc();
552 					::com::sun::star::text::WritingMode eMode = pDoc->GetDefaultWritingMode();
553 					sal_Bool bIsLeftToRight(sal_False);
554 
555 					if(::com::sun::star::text::WritingMode_LR_TB == eMode
556 						|| ::com::sun::star::text::WritingMode_TB_RL == eMode)
557 					{
558 						bIsLeftToRight = sal_True;
559 					}
560 
561 					rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, bIsLeftToRight ) );
562 					rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, !bIsLeftToRight ) );
563 				}
564 				break;
565             }
566         }
567 
568 /* #i35937#
569 		if (aAttrSet.GetItemState(EE_PARA_BULLETSTATE) == SFX_ITEM_ON)
570 		{
571 			SfxUInt16Item aBulletState((const SfxUInt16Item&) aAttrSet.Get(EE_PARA_BULLETSTATE));
572 
573 			if (aBulletState.GetValue() != 0)
574 			{
575 				rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, sal_True));
576 			}
577 			else
578 			{
579 				rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, sal_False));
580 			}
581 		}
582 */
583 		SvxLRSpaceItem aLRSpace = ( (const SvxLRSpaceItem&) aAttrSet.Get( EE_PARA_LRSPACE ) );
584 		aLRSpace.SetWhich(SID_ATTR_PARA_LRSPACE);
585 		rSet.Put(aLRSpace);
586 		Invalidate(SID_ATTR_PARA_LRSPACE);
587 		//Added by xuxu
588 		SfxItemState eState = aAttrSet.GetItemState( EE_PARA_LRSPACE );
589 		if ( eState == SFX_ITEM_DONTCARE )
590 		{
591 			rSet.InvalidateItem(EE_PARA_LRSPACE);
592 			rSet.InvalidateItem(SID_ATTR_PARA_LRSPACE);
593 		}
594 		sal_uInt16 nLineSpace = (sal_uInt16) ( (const SvxLineSpacingItem&) aAttrSet.
595                             Get( EE_PARA_SBL ) ).GetPropLineSpace();
596 		switch( nLineSpace )
597 		{
598 			case 100:
599 				rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_10, sal_True ) );
600 			break;
601 			case 150:
602 				rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_15, sal_True ) );
603 			break;
604 			case 200:
605 				rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_20, sal_True ) );
606 			break;
607 		}
608 	}
609 
610 	// Ausrichtung (hoch/tief) wird auch im Gliederungsmodus gebraucht
611 	SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
612                     aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
613 
614 	if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
615 		rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, sal_True ) );
616 	else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
617 		rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, sal_True ) );
618 }
619 
620 /*************************************************************************
621 |*
622 |* Command event
623 |*
624 \************************************************************************/
625 
626 void TextObjectBar::Command( const CommandEvent& )
627 {
628 }
629 
630 
631 } // end of namespace sd
632