Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "TextObjectBar.hxx"
31 : :
32 : :
33 : : #include <svx/svxids.hrc>
34 : :
35 : : #include <editeng/editview.hxx>
36 : : #include <editeng/editeng.hxx>
37 : : #include <editeng/unolingu.hxx>
38 : : #include <editeng/outliner.hxx>
39 : : #include <editeng/ulspitem.hxx>
40 : : #include <editeng/lspcitem.hxx>
41 : : #include <editeng/adjitem.hxx>
42 : : #include <vcl/vclenum.hxx>
43 : : #include <sfx2/app.hxx>
44 : : #include <svl/whiter.hxx>
45 : : #include <svl/itempool.hxx>
46 : : #include <svl/style.hxx>
47 : : #include <sfx2/tplpitem.hxx>
48 : : #include <sfx2/request.hxx>
49 : : #include <sfx2/viewfrm.hxx>
50 : : #include <sfx2/dispatch.hxx>
51 : : #include <editeng/escpitem.hxx>
52 : : #include <editeng/wghtitem.hxx>
53 : : #include <editeng/postitem.hxx>
54 : : #include <editeng/udlnitem.hxx>
55 : : #include <editeng/crsditem.hxx>
56 : : #include <editeng/cntritem.hxx>
57 : : #include <editeng/shdditem.hxx>
58 : : #include <svx/xtable.hxx>
59 : : #include <svx/svdobj.hxx>
60 : : #include <editeng/outlobj.hxx>
61 : : #include <editeng/flstitem.hxx>
62 : : #include <svl/intitem.hxx>
63 : : #include <editeng/scripttypeitem.hxx>
64 : : #include <svx/svdoutl.hxx>
65 : : #include <editeng/writingmodeitem.hxx>
66 : : #include <editeng/frmdiritem.hxx>
67 : : #include <svl/itemiter.hxx>
68 : :
69 : :
70 : : #include "app.hrc"
71 : :
72 : : #include "eetext.hxx"
73 : : #include "ViewShell.hxx"
74 : : #include "drawview.hxx"
75 : : #include "drawdoc.hxx"
76 : : #include "OutlineView.hxx"
77 : : #include "Window.hxx"
78 : : #include "futempl.hxx"
79 : : #include "DrawDocShell.hxx"
80 : : #include "Outliner.hxx"
81 : : #include "futext.hxx"
82 : :
83 : : namespace sd {
84 : :
85 : : /*************************************************************************
86 : : |*
87 : : |* Bearbeitung der SfxRequests
88 : : |*
89 : : \************************************************************************/
90 : :
91 : 0 : void TextObjectBar::Execute( SfxRequest &rReq )
92 : : {
93 : 0 : const SfxItemSet* pArgs = rReq.GetArgs();
94 : 0 : const SfxPoolItem* pPoolItem = NULL;
95 : 0 : sal_uInt16 nSlot = rReq.GetSlot();
96 : 0 : OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
97 : :
98 : : SAL_WNODEPRECATED_DECLARATIONS_PUSH
99 : 0 : std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
100 : : SAL_WNODEPRECATED_DECLARATIONS_POP
101 : :
102 [ # # ][ # # ]: 0 : if (mpView->ISA(OutlineView))
[ # # ]
103 : : {
104 : : pOLV = static_cast<OutlineView*>(mpView)
105 [ # # ][ # # ]: 0 : ->GetViewByWindow(mpViewShell->GetActiveWindow());
106 : :
107 [ # # ][ # # ]: 0 : aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
108 : : }
109 : :
110 [ # # # # : 0 : switch (nSlot)
# # # # #
# # ]
111 : : {
112 : : case SID_STYLE_APPLY:
113 : : {
114 [ # # ]: 0 : if( pArgs )
115 : : {
116 : 0 : SdDrawDocument& rDoc = mpView->GetDoc();
117 : : OSL_ASSERT (mpViewShell->GetViewShell()!=NULL);
118 [ # # ][ # # ]: 0 : FunctionReference xFunc( FuTemplate::Create( mpViewShell, static_cast< ::sd::Window*>( mpViewShell->GetViewShell()->GetWindow()), mpView, &rDoc, rReq ) );
119 : :
120 [ # # ]: 0 : if(xFunc.is())
121 : : {
122 [ # # ]: 0 : xFunc->Activate();
123 [ # # ]: 0 : xFunc->Deactivate();
124 : :
125 [ # # ]: 0 : if( rReq.GetSlot() == SID_STYLE_APPLY )
126 : : {
127 [ # # ][ # # ]: 0 : if( mpViewShell && mpViewShell->GetViewFrame() )
[ # # ][ # # ]
128 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_APPLY );
129 : : }
130 [ # # ]: 0 : }
131 : : }
132 : : else
133 : : {
134 [ # # ][ # # ]: 0 : if( mpViewShell && mpViewShell->GetViewFrame() )
[ # # ][ # # ]
135 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SFX_CALLMODE_ASYNCHRON );
136 : : }
137 : :
138 [ # # ]: 0 : rReq.Done();
139 : : }
140 : 0 : break;
141 : :
142 : : case SID_PARASPACE_INCREASE:
143 : : case SID_PARASPACE_DECREASE:
144 : : {
145 [ # # ]: 0 : if( pOLV )
146 : : {
147 [ # # ]: 0 : ESelection aSel = pOLV->GetSelection();
148 : 0 : aSel.Adjust();
149 : 0 : sal_uLong nStartPara = aSel.nStartPara;
150 : 0 : sal_uLong nEndPara = aSel.nEndPara;
151 [ # # ]: 0 : if( !aSel.HasRange() )
152 : : {
153 : 0 : nStartPara = 0;
154 [ # # ]: 0 : nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1;
155 : : }
156 [ # # ]: 0 : for( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
157 : : {
158 : 0 : SfxStyleSheet* pStyleSheet = NULL;
159 [ # # ]: 0 : if (pOLV->GetOutliner() != NULL)
160 [ # # ]: 0 : pStyleSheet = pOLV->GetOutliner()->GetStyleSheet(nPara);
161 [ # # ]: 0 : if (pStyleSheet != NULL)
162 : : {
163 [ # # ][ # # ]: 0 : SfxItemSet aAttr( pStyleSheet->GetItemSet() );
164 [ # # ]: 0 : SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( (sal_uInt16) nPara ) );
165 [ # # ]: 0 : aAttr.Put( aTmpSet, sal_False ); // sal_False= InvalidItems nicht als Default, sondern als "Loecher" betrachten
166 [ # # ]: 0 : const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aAttr.Get( EE_PARA_ULSPACE );
167 [ # # ]: 0 : SvxULSpaceItem* pNewItem = (SvxULSpaceItem*) rItem.Clone();
168 : :
169 : 0 : long nUpper = pNewItem->GetUpper();
170 [ # # ]: 0 : if( nSlot == SID_PARASPACE_INCREASE )
171 : 0 : nUpper += 100;
172 : : else
173 : : {
174 : 0 : nUpper -= 100;
175 : 0 : nUpper = Max( (long) nUpper, 0L );
176 : : }
177 : 0 : pNewItem->SetUpper( (sal_uInt16) nUpper );
178 : :
179 : 0 : long nLower = pNewItem->GetLower();
180 [ # # ]: 0 : if( nSlot == SID_PARASPACE_INCREASE )
181 : 0 : nLower += 100;
182 : : else
183 : : {
184 : 0 : nLower -= 100;
185 : 0 : nLower = Max( (long) nLower, 0L );
186 : : }
187 : 0 : pNewItem->SetLower( (sal_uInt16) nLower );
188 : :
189 [ # # ]: 0 : SfxItemSet aNewAttrs( aAttr );
190 [ # # ]: 0 : aNewAttrs.Put( *pNewItem );
191 [ # # ][ # # ]: 0 : delete pNewItem;
192 [ # # ][ # # ]: 0 : pOLV->GetOutliner()->SetParaAttribs( (sal_uInt16)nPara, aNewAttrs );
[ # # ][ # # ]
193 : : }
194 : : }
195 : : }
196 : : else
197 : : {
198 : : // Der folgende Code kann enabled werden, wenn ich von
199 : : // JOE einen richtigen Status (DontCare) bekomme;
200 : :
201 : : // Wird enabled, obwohl es nicht richtig funktioniert (s.o.)
202 [ # # ]: 0 : SfxItemSet aEditAttr( mpView->GetDoc().GetPool() );
203 [ # # ]: 0 : mpView->GetAttributes( aEditAttr );
204 [ # # ][ # # ]: 0 : if( aEditAttr.GetItemState( EE_PARA_ULSPACE ) >= SFX_ITEM_AVAILABLE )
205 : : {
206 [ # # ]: 0 : SfxItemSet aNewAttrs(*(aEditAttr.GetPool()), aEditAttr.GetRanges());
207 [ # # ]: 0 : const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aEditAttr.Get( EE_PARA_ULSPACE );
208 [ # # ]: 0 : SvxULSpaceItem* pNewItem = (SvxULSpaceItem*) rItem.Clone();
209 : 0 : long nUpper = pNewItem->GetUpper();
210 : :
211 [ # # ]: 0 : if( nSlot == SID_PARASPACE_INCREASE )
212 : 0 : nUpper += 100;
213 : : else
214 : : {
215 : 0 : nUpper -= 100;
216 : 0 : nUpper = Max( (long) nUpper, 0L );
217 : : }
218 : 0 : pNewItem->SetUpper( (sal_uInt16) nUpper );
219 : :
220 : 0 : long nLower = pNewItem->GetLower();
221 [ # # ]: 0 : if( nSlot == SID_PARASPACE_INCREASE )
222 : 0 : nLower += 100;
223 : : else
224 : : {
225 : 0 : nLower -= 100;
226 : 0 : nLower = Max( (long) nLower, 0L );
227 : : }
228 : 0 : pNewItem->SetLower( (sal_uInt16) nLower );
229 : :
230 [ # # ]: 0 : aNewAttrs.Put( *pNewItem );
231 [ # # ][ # # ]: 0 : delete pNewItem;
232 : :
233 [ # # ][ # # ]: 0 : mpView->SetAttributes( aNewAttrs );
234 [ # # ]: 0 : }
235 : : }
236 [ # # ]: 0 : rReq.Done();
237 : :
238 [ # # ]: 0 : Invalidate();
239 : : // Um die Preview (im Gliederungsmodus) zu aktualisieren muss
240 : : // der Slot invalidiert werden:
241 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
242 : : }
243 : 0 : break;
244 : :
245 : : case SID_OUTLINE_LEFT:
246 : : {
247 [ # # ]: 0 : if (pOLV)
248 : : {
249 [ # # ]: 0 : pOLV->AdjustDepth( -1 );
250 : :
251 : : // Ensure bold/italic etc. icon state updates
252 [ # # ]: 0 : Invalidate();
253 : : // trigger preview refresh
254 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
255 : : }
256 [ # # ]: 0 : rReq.Done();
257 : : }
258 : 0 : break;
259 : :
260 : : case SID_OUTLINE_RIGHT:
261 : : {
262 [ # # ]: 0 : if (pOLV)
263 : : {
264 [ # # ]: 0 : pOLV->AdjustDepth( 1 );
265 : :
266 : : // Ensure bold/italic etc. icon state updates
267 [ # # ]: 0 : Invalidate();
268 : : // trigger preview refresh
269 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
270 : : }
271 [ # # ]: 0 : rReq.Done();
272 : : }
273 : 0 : break;
274 : :
275 : : case SID_OUTLINE_UP:
276 : : {
277 [ # # ]: 0 : if (pOLV)
278 : : {
279 [ # # ]: 0 : pOLV->AdjustHeight( -1 );
280 : :
281 : : // trigger preview refresh
282 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
283 : : }
284 [ # # ]: 0 : rReq.Done();
285 : : }
286 : 0 : break;
287 : :
288 : : case SID_OUTLINE_DOWN:
289 : : {
290 [ # # ]: 0 : if (pOLV)
291 : : {
292 [ # # ]: 0 : pOLV->AdjustHeight( 1 );
293 : :
294 : : // trigger preview refresh
295 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
296 : : }
297 [ # # ]: 0 : rReq.Done();
298 : : }
299 : 0 : break;
300 : :
301 : : case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
302 : : case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
303 : : {
304 [ # # ]: 0 : mpView->SdrEndTextEdit();
305 [ # # ]: 0 : SfxItemSet aAttr( mpView->GetDoc().GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
306 : : aAttr.Put( SvxWritingModeItem(
307 : : nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
308 : : com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
309 [ # # ][ # # ]: 0 : SDRATTR_TEXTDIRECTION ) );
[ # # ][ # # ]
310 [ # # ]: 0 : rReq.Done( aAttr );
311 [ # # ]: 0 : mpView->SetAttributes( aAttr );
312 [ # # ]: 0 : Invalidate();
313 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
[ # # ]
314 : : }
315 : 0 : break;
316 : :
317 : : case FN_NUM_BULLET_ON:
318 [ # # ]: 0 : if( pOLV )
319 [ # # ]: 0 : pOLV->ToggleBullets();
320 : 0 : break;
321 : :
322 : : case SID_GROW_FONT_SIZE:
323 : : case SID_SHRINK_FONT_SIZE:
324 : : {
325 [ # # ][ # # ]: 0 : const SvxFontListItem* pFonts = (const SvxFontListItem*)mpViewShell->GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST );
326 [ # # ]: 0 : const FontList* pFontList = pFonts ? pFonts->GetFontList(): 0;
327 [ # # ]: 0 : if( pFontList )
328 : : {
329 [ # # ]: 0 : FuText::ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pOLV, pFontList, mpView );
330 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
331 : : }
332 [ # # ]: 0 : rReq.Done();
333 : : }
334 : 0 : break;
335 : :
336 : : case SID_THES:
337 : : {
338 [ # # ]: 0 : String aReplaceText;
339 [ # # ][ # # ]: 0 : SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
340 [ # # ]: 0 : if (pItem2)
341 [ # # ]: 0 : aReplaceText = pItem2->GetValue();
342 [ # # ]: 0 : if (aReplaceText.Len() > 0)
343 [ # # ][ # # ]: 0 : ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
344 : : }
345 : 0 : break;
346 : :
347 : : default:
348 : : {
349 [ # # ]: 0 : SfxItemSet aEditAttr( mpView->GetDoc().GetPool() );
350 [ # # ]: 0 : mpView->GetAttributes( aEditAttr );
351 [ # # ]: 0 : SfxItemSet aNewAttr(*(aEditAttr.GetPool()), aEditAttr.GetRanges());
352 : :
353 [ # # ]: 0 : if( !pArgs )
354 : : {
355 : : //aNewAttr.InvalidateAllItems(); <- Macht Probleme (#35465#)
356 : :
357 [ # # # # : 0 : switch ( nSlot )
# # # # #
# # # # #
# # # # #
# ]
358 : : {
359 : : case SID_ATTR_CHAR_WEIGHT:
360 : : {
361 : : FontWeight eFW = ( (const SvxWeightItem&) aEditAttr.
362 [ # # ]: 0 : Get( EE_CHAR_WEIGHT ) ).GetWeight();
363 : : aNewAttr.Put( SvxWeightItem( eFW == WEIGHT_NORMAL ?
364 : : WEIGHT_BOLD : WEIGHT_NORMAL,
365 [ # # ][ # # ]: 0 : EE_CHAR_WEIGHT ) );
[ # # ][ # # ]
366 : : }
367 : 0 : break;
368 : : case SID_ATTR_CHAR_POSTURE:
369 : : {
370 : : FontItalic eFI = ( (const SvxPostureItem&) aEditAttr.
371 [ # # ]: 0 : Get( EE_CHAR_ITALIC ) ).GetPosture();
372 : : aNewAttr.Put( SvxPostureItem( eFI == ITALIC_NORMAL ?
373 : : ITALIC_NONE : ITALIC_NORMAL,
374 [ # # ][ # # ]: 0 : EE_CHAR_ITALIC ) );
[ # # ][ # # ]
375 : : }
376 : 0 : break;
377 : : case SID_ATTR_CHAR_UNDERLINE:
378 : : {
379 : : FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.
380 [ # # ]: 0 : Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
381 : : aNewAttr.Put( SvxUnderlineItem( eFU == UNDERLINE_SINGLE ?
382 : : UNDERLINE_NONE : UNDERLINE_SINGLE,
383 [ # # ][ # # ]: 0 : EE_CHAR_UNDERLINE ) );
[ # # ]
384 : : }
385 : 0 : break;
386 : : case SID_ATTR_CHAR_OVERLINE:
387 : : {
388 : : FontUnderline eFO = ( (const SvxOverlineItem&) aEditAttr.
389 [ # # ]: 0 : Get( EE_CHAR_OVERLINE ) ).GetLineStyle();
390 : : aNewAttr.Put( SvxOverlineItem( eFO == UNDERLINE_SINGLE ?
391 : : UNDERLINE_NONE : UNDERLINE_SINGLE,
392 [ # # ][ # # ]: 0 : EE_CHAR_OVERLINE ) );
[ # # ]
393 : : }
394 : 0 : break;
395 : : case SID_ATTR_CHAR_CONTOUR:
396 : : {
397 : : aNewAttr.Put( SvxContourItem( !( (const SvxContourItem&) aEditAttr.
398 [ # # ][ # # ]: 0 : Get( EE_CHAR_OUTLINE ) ).GetValue(), EE_CHAR_OUTLINE ) );
[ # # ][ # # ]
399 : : }
400 : 0 : break;
401 : : case SID_ATTR_CHAR_SHADOWED:
402 : : {
403 : : aNewAttr.Put( SvxShadowedItem( !( (const SvxShadowedItem&) aEditAttr.
404 [ # # ][ # # ]: 0 : Get( EE_CHAR_SHADOW ) ).GetValue(), EE_CHAR_SHADOW ) );
[ # # ][ # # ]
405 : : }
406 : 0 : break;
407 : : case SID_ATTR_CHAR_STRIKEOUT:
408 : : {
409 : : FontStrikeout eFSO = ( ( (const SvxCrossedOutItem&) aEditAttr.
410 [ # # ]: 0 : Get( EE_CHAR_STRIKEOUT ) ).GetStrikeout() );
411 : : aNewAttr.Put( SvxCrossedOutItem( eFSO == STRIKEOUT_SINGLE ?
412 [ # # ][ # # ]: 0 : STRIKEOUT_NONE : STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT ) );
[ # # ]
413 : : }
414 : 0 : break;
415 : :
416 : : case SID_ATTR_PARA_ADJUST_LEFT:
417 : : {
418 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
[ # # ]
419 : : }
420 : 0 : break;
421 : : case SID_ATTR_PARA_ADJUST_CENTER:
422 : : {
423 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
[ # # ]
424 : : }
425 : 0 : break;
426 : : case SID_ATTR_PARA_ADJUST_RIGHT:
427 : : {
428 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
[ # # ]
429 : : }
430 : 0 : break;
431 : : case SID_ATTR_PARA_ADJUST_BLOCK:
432 : : {
433 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, EE_PARA_JUST ) );
[ # # ]
434 : : }
435 : 0 : break;
436 : : case SID_ATTR_PARA_LINESPACE_10:
437 : : {
438 [ # # ]: 0 : SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_LINE, EE_PARA_SBL );
439 : 0 : aItem.SetPropLineSpace( 100 );
440 [ # # ][ # # ]: 0 : aNewAttr.Put( aItem );
441 : : }
442 : 0 : break;
443 : : case SID_ATTR_PARA_LINESPACE_15:
444 : : {
445 [ # # ]: 0 : SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL );
446 : 0 : aItem.SetPropLineSpace( 150 );
447 [ # # ][ # # ]: 0 : aNewAttr.Put( aItem );
448 : : }
449 : 0 : break;
450 : : case SID_ATTR_PARA_LINESPACE_20:
451 : : {
452 [ # # ]: 0 : SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL );
453 : 0 : aItem.SetPropLineSpace( 200 );
454 [ # # ][ # # ]: 0 : aNewAttr.Put( aItem );
455 : : }
456 : 0 : break;
457 : : case SID_SET_SUPER_SCRIPT:
458 : : {
459 [ # # ]: 0 : SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
460 : : SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
461 [ # # ][ # # ]: 0 : aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
462 : :
463 [ # # ]: 0 : if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
464 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
465 : : else
466 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
467 [ # # ][ # # ]: 0 : aNewAttr.Put( aItem );
468 : : }
469 : 0 : break;
470 : : case SID_SET_SUB_SCRIPT:
471 : : {
472 [ # # ]: 0 : SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
473 : : SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
474 [ # # ][ # # ]: 0 : aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
475 : :
476 [ # # ]: 0 : if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
477 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
478 : : else
479 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
480 [ # # ][ # # ]: 0 : aNewAttr.Put( aItem );
481 : : }
482 : 0 : break;
483 : :
484 : : // Attribute fuer die TextObjectBar
485 : : case SID_ATTR_CHAR_FONT:
486 : : {
487 [ # # ]: 0 : if( pArgs )
488 : : {
489 [ # # ][ # # ]: 0 : if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTINFO, sal_True, &pPoolItem ) )
490 [ # # ]: 0 : aNewAttr.Put( *pPoolItem );
491 : : }
492 : : else
493 : : mpViewShell->GetViewFrame()->GetDispatcher()->
494 [ # # ][ # # ]: 0 : Execute( SID_CHAR_DLG, SFX_CALLMODE_ASYNCHRON );
495 : : }
496 : 0 : break;
497 : : case SID_ATTR_CHAR_FONTHEIGHT:
498 : : {
499 [ # # ]: 0 : if( pArgs )
500 : : {
501 [ # # ][ # # ]: 0 : if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTHEIGHT, sal_True, &pPoolItem ) )
502 [ # # ]: 0 : aNewAttr.Put( *pPoolItem );
503 : : }
504 : : else
505 : : mpViewShell->GetViewFrame()->GetDispatcher()->
506 [ # # ][ # # ]: 0 : Execute( SID_CHAR_DLG, SFX_CALLMODE_ASYNCHRON );
507 : : }
508 : 0 : break;
509 : : case SID_ATTR_CHAR_COLOR:
510 : : {
511 [ # # ][ # # ]: 0 : if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_COLOR, sal_True, &pPoolItem ) )
[ # # ][ # # ]
512 [ # # ]: 0 : aNewAttr.Put( *pPoolItem );
513 : : }
514 : 0 : break;
515 : : // #i35937# removed need for FN_NUM_BULLET_ON handling
516 : : }
517 : :
518 [ # # ]: 0 : rReq.Done( aNewAttr );
519 : 0 : pArgs = rReq.GetArgs();
520 : : }
521 [ # # ][ # # ]: 0 : else if ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ||
522 : : nSlot == SID_ATTR_PARA_RIGHT_TO_LEFT )
523 : : {
524 : 0 : sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
525 : :
526 : 0 : sal_uInt16 nAdjust = SVX_ADJUST_LEFT;
527 [ # # ][ # # ]: 0 : if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, sal_True, &pPoolItem ) )
528 [ # # ]: 0 : nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue();
529 : :
530 [ # # ]: 0 : if( bLeftToRight )
531 : : {
532 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
[ # # ]
533 [ # # ]: 0 : if( nAdjust == SVX_ADJUST_RIGHT )
534 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
[ # # ]
535 : : }
536 : : else
537 : : {
538 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
[ # # ]
539 [ # # ]: 0 : if( nAdjust == SVX_ADJUST_LEFT )
540 [ # # ][ # # ]: 0 : aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
[ # # ]
541 : : }
542 : :
543 [ # # ]: 0 : rReq.Done( aNewAttr );
544 : 0 : pArgs = rReq.GetArgs();
545 : :
546 [ # # ]: 0 : Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT );
547 : : }
548 [ # # ][ # # ]: 0 : else if ( nSlot == SID_ATTR_CHAR_FONT ||
[ # # ][ # # ]
549 : : nSlot == SID_ATTR_CHAR_FONTHEIGHT ||
550 : : nSlot == SID_ATTR_CHAR_POSTURE ||
551 : : nSlot == SID_ATTR_CHAR_WEIGHT )
552 : : {
553 : : // #i78017 establish the same behaviour as in Writer
554 : 0 : sal_uInt16 nScriptType = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX;
555 [ # # ]: 0 : if (nSlot == SID_ATTR_CHAR_FONT)
556 [ # # ]: 0 : nScriptType = mpView->GetScriptType();
557 : :
558 : 0 : SfxItemPool& rPool = mpView->GetDoc().GetPool();
559 [ # # ]: 0 : SvxScriptSetItem aSvxScriptSetItem( nSlot, rPool );
560 [ # # ][ # # ]: 0 : aSvxScriptSetItem.PutItemForScriptType( nScriptType, pArgs->Get( rPool.GetWhich( nSlot ) ) );
[ # # ]
561 [ # # ]: 0 : aNewAttr.Put( aSvxScriptSetItem.GetItemSet() );
562 [ # # ]: 0 : rReq.Done( aNewAttr );
563 [ # # ]: 0 : pArgs = rReq.GetArgs();
564 : : }
565 : :
566 [ # # ]: 0 : mpView->SetAttributes(*pArgs);
567 : :
568 : : // Aus Performance- und Erweiterungsgruenden wird
569 : : // jetzt die komplette Shell invalidiert
570 [ # # ]: 0 : Invalidate();
571 : :
572 : : // Um die Preview (im Gliederungsmodus) zu aktualisieren muss
573 : : // der Slot invalidiert werden:
574 [ # # ][ # # ]: 0 : mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
[ # # ][ # # ]
575 : : }
576 : 0 : break;
577 : : }
578 : :
579 [ # # ]: 0 : Invalidate( SID_OUTLINE_LEFT );
580 [ # # ]: 0 : Invalidate( SID_OUTLINE_RIGHT );
581 [ # # ]: 0 : Invalidate( SID_OUTLINE_UP );
582 [ # # ][ # # ]: 0 : Invalidate( SID_OUTLINE_DOWN );
583 : 0 : }
584 : :
585 : : } // end of namespace sd
586 : :
587 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|