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 : : #include <svx/svxids.hrc>
33 : :
34 : : #include <i18npool/mslangid.hxx>
35 : : #include <editeng/ulspitem.hxx>
36 : : #include <editeng/lspcitem.hxx>
37 : : #include <editeng/adjitem.hxx>
38 : : #include <editeng/editview.hxx>
39 : : #include <editeng/editeng.hxx>
40 : : #include <editeng/outliner.hxx>
41 : : #include <editeng/unolingu.hxx>
42 : : #include <vcl/vclenum.hxx>
43 : : #include <sfx2/app.hxx>
44 : : #include <svl/whiter.hxx>
45 : : #include <svl/itempool.hxx>
46 : : #include <svl/stritem.hxx>
47 : : #include <svl/style.hxx>
48 : : #include <svl/languageoptions.hxx>
49 : : #include <sfx2/tplpitem.hxx>
50 : : #include <editeng/escpitem.hxx>
51 : : #include <svx/svdoutl.hxx>
52 : : #include <svl/intitem.hxx>
53 : : #include <editeng/scripttypeitem.hxx>
54 : : #include <editeng/outlobj.hxx>
55 : : #include <editeng/writingmodeitem.hxx>
56 : : #include <editeng/frmdiritem.hxx>
57 : :
58 : :
59 : : #include <sfx2/objface.hxx>
60 : :
61 : : #include "app.hrc"
62 : : #include "glob.hrc"
63 : : #include "res_bmp.hrc"
64 : :
65 : : #include "eetext.hxx"
66 : :
67 : : #include "drawdoc.hxx"
68 : : #include "DrawViewShell.hxx"
69 : : #include "OutlineViewShell.hxx"
70 : : #include "ViewShellBase.hxx"
71 : : #include "ToolBarManager.hxx"
72 : : #include "futempl.hxx"
73 : : #include "sdresid.hxx"
74 : : #include "Window.hxx"
75 : : #include "OutlineView.hxx"
76 : :
77 : :
78 : : using namespace sd;
79 : : using namespace ::com::sun::star;
80 : :
81 : : #define TextObjectBar
82 : : #include "sdslots.hxx"
83 : :
84 : : namespace sd {
85 : :
86 : : /*************************************************************************
87 : : |*
88 : : |* Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also
89 : : |* tragen wir etwas ein, was hier (hoffentlich) nie vorkommt).
90 : : |*
91 : : \************************************************************************/
92 : :
93 : :
94 [ + - ][ + - ]: 50 : SFX_IMPL_INTERFACE( TextObjectBar, SfxShell, SdResId(STR_TEXTOBJECTBARSHELL) )
[ + - ]
95 : : {
96 : 25 : }
97 : :
98 [ # # ][ # # ]: 0 : TYPEINIT1( TextObjectBar, SfxShell );
99 : :
100 : : /*************************************************************************
101 : : |*
102 : : |* Standard-Konstruktor
103 : : |*
104 : : \************************************************************************/
105 : :
106 : 0 : TextObjectBar::TextObjectBar (
107 : : ViewShell* pSdViewSh,
108 : : SfxItemPool& rItemPool,
109 : : ::sd::View* pSdView )
110 : : : SfxShell(pSdViewSh->GetViewShell()),
111 : : mpViewShell( pSdViewSh ),
112 : 0 : mpView( pSdView )
113 : : {
114 : 0 : SetPool(&rItemPool);
115 : :
116 [ # # ]: 0 : if( mpView )
117 : : {
118 [ # # ]: 0 : OutlineView* pOutlinerView = dynamic_cast< OutlineView* >( mpView );
119 [ # # ]: 0 : if( pOutlinerView )
120 : : {
121 [ # # ][ # # ]: 0 : SetUndoManager(&pOutlinerView->GetOutliner()->GetUndoManager());
122 : : }
123 : : else
124 : : {
125 : 0 : DrawDocShell* pDocShell = mpView->GetDoc().GetDocSh();
126 [ # # ]: 0 : if( pDocShell )
127 : : {
128 [ # # ][ # # ]: 0 : SetUndoManager(pDocShell->GetUndoManager());
129 [ # # ]: 0 : DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( pSdViewSh );
130 [ # # ]: 0 : if ( pDrawViewShell )
131 [ # # ][ # # ]: 0 : SetRepeatTarget(pSdView);
132 : : }
133 : : }
134 : : }
135 : :
136 [ # # ][ # # ]: 0 : SetName( rtl::OUString( "TextObjectBar" ));
[ # # ]
137 : :
138 : : // SetHelpId( SD_IF_SDDRAWTEXTOBJECTBAR );
139 : 0 : }
140 : :
141 : : /*************************************************************************
142 : : |*
143 : : |* Destruktor
144 : : |*
145 : : \************************************************************************/
146 : :
147 : 0 : TextObjectBar::~TextObjectBar()
148 : : {
149 [ # # ]: 0 : SetRepeatTarget(NULL);
150 [ # # ]: 0 : }
151 : :
152 : : /*************************************************************************
153 : : |*
154 : : |* Status der Attribut-Items
155 : : |*
156 : : \************************************************************************/
157 : :
158 : 0 : void TextObjectBar::GetAttrState( SfxItemSet& rSet )
159 : : {
160 [ # # ]: 0 : SfxWhichIter aIter( rSet );
161 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
162 [ # # ]: 0 : SfxItemSet aAttrSet( mpView->GetDoc().GetPool() );
163 [ # # ]: 0 : SvtLanguageOptions aLangOpt;
164 [ # # ]: 0 : sal_Bool bDisableParagraphTextDirection = !aLangOpt.IsCTLFontEnabled();
165 [ # # ]: 0 : sal_Bool bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled();
166 : :
167 [ # # ]: 0 : mpView->GetAttributes( aAttrSet );
168 : :
169 [ # # ]: 0 : while ( nWhich )
170 : : {
171 : 0 : sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
172 : 0 : ? GetPool().GetSlotId(nWhich)
173 [ # # # # ]: 0 : : nWhich;
174 : :
175 [ # # # # : 0 : switch ( nSlotId )
# # # ]
176 : : {
177 : : case SID_ATTR_CHAR_FONT:
178 : : case SID_ATTR_CHAR_FONTHEIGHT:
179 : : case SID_ATTR_CHAR_WEIGHT:
180 : : case SID_ATTR_CHAR_POSTURE:
181 : : {
182 [ # # ]: 0 : SvxScriptSetItem aSetItem( nSlotId, GetPool() );
183 [ # # ]: 0 : aSetItem.GetItemSet().Put( aAttrSet, sal_False );
184 : :
185 [ # # ]: 0 : sal_uInt16 nScriptType = mpView->GetScriptType();
186 : :
187 [ # # ][ # # ]: 0 : if( (nSlotId == SID_ATTR_CHAR_FONT) || (nSlotId == SID_ATTR_CHAR_FONTHEIGHT) )
188 : : {
189 : : // input language should be preferred over
190 : : // current cursor position to detect script type
191 : 0 : OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
192 : :
193 [ # # ][ # # ]: 0 : if (mpView->ISA(OutlineView))
[ # # ]
194 : : {
195 : : pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
196 [ # # ][ # # ]: 0 : mpViewShell->GetActiveWindow());
197 : : }
198 : :
199 [ # # ][ # # ]: 0 : if(pOLV && !pOLV->GetSelection().HasRange())
[ # # ][ # # ]
[ # # # # ]
200 : : {
201 [ # # ][ # # ]: 0 : if( mpViewShell && mpViewShell->GetViewShell() && mpViewShell->GetViewShell()->GetWindow() )
[ # # ][ # # ]
[ # # ][ # # ]
202 : : {
203 [ # # ][ # # ]: 0 : LanguageType nInputLang = mpViewShell->GetViewShell()->GetWindow()->GetInputLanguage();
204 [ # # ][ # # ]: 0 : if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
205 [ # # ]: 0 : nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
206 : : }
207 : : }
208 : : }
209 : :
210 [ # # ]: 0 : const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
211 [ # # ]: 0 : if( pI )
212 [ # # ]: 0 : aAttrSet.Put( *pI, nWhich );
213 : : else
214 [ # # ][ # # ]: 0 : aAttrSet.InvalidateItem( nWhich );
215 : : }
216 : 0 : break;
217 : :
218 : :
219 : : case SID_STYLE_APPLY:
220 : : case SID_STYLE_FAMILY2:
221 : : {
222 [ # # ]: 0 : SfxStyleSheet* pStyleSheet = mpView->GetStyleSheetFromMarked();
223 [ # # ]: 0 : if( pStyleSheet )
224 [ # # ][ # # ]: 0 : rSet.Put( SfxTemplateItem( nWhich, pStyleSheet->GetName() ) );
[ # # ][ # # ]
225 : : else
226 : : {
227 [ # # ][ # # ]: 0 : rSet.Put( SfxTemplateItem( nWhich, String() ) );
[ # # ][ # # ]
[ # # ]
228 : : }
229 : : }
230 : 0 : break;
231 : :
232 : : case SID_OUTLINE_LEFT:
233 : : case SID_OUTLINE_RIGHT:
234 : : case SID_OUTLINE_UP:
235 : : case SID_OUTLINE_DOWN:
236 : : {
237 : 0 : sal_Bool bDisableLeft = sal_True;
238 : 0 : sal_Bool bDisableRight = sal_True;
239 : 0 : sal_Bool bDisableUp = sal_True;
240 : 0 : sal_Bool bDisableDown = sal_True;
241 : 0 : OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
242 : :
243 [ # # ][ # # ]: 0 : if (mpView->ISA(OutlineView))
[ # # ]
244 : : {
245 : : pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
246 [ # # ][ # # ]: 0 : mpViewShell->GetActiveWindow());
247 : : }
248 : :
249 [ # # ][ # # ]: 0 : sal_Bool bOutlineViewSh = mpViewShell->ISA(OutlineViewShell);
250 : :
251 [ # # # # ]: 0 : if (pOLV &&
[ # # ][ # # ]
252 : 0 : ( pOLV->GetOutliner()->GetMode() == OUTLINERMODE_OUTLINEOBJECT || bOutlineViewSh ) )
253 : : {
254 : : // Outliner im Gliederungsmodus
255 : 0 : ::Outliner* pOutl = pOLV->GetOutliner();
256 : :
257 [ # # ]: 0 : std::vector<Paragraph*> aSelList;
258 [ # # ]: 0 : pOLV->CreateSelectionList(aSelList);
259 [ # # ][ # # ]: 0 : Paragraph* pPara = aSelList.empty() ? NULL : *(aSelList.begin());
260 : :
261 : : // find out if we are a OutlineView
262 : 0 : sal_Bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == pOLV->GetOutliner()->GetMode());
263 : :
264 : : // This is ONLY for OutlineViews
265 [ # # ]: 0 : if(bIsOutlineView)
266 : : {
267 : : // allow move up if position is 2 or greater OR it
268 : : // is a title object (and thus depth==1)
269 [ # # ][ # # ]: 0 : if(pOutl->GetAbsPos(pPara) > 1 || ( pOutl->HasParaFlag(pPara,PARAFLAG_ISPAGE) && pOutl->GetAbsPos(pPara) > 0 ) )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
270 : : {
271 : : // Nicht ganz oben
272 : 0 : bDisableUp = sal_False;
273 : : }
274 : : }
275 : : else
276 : : {
277 : : // old behaviour for OUTLINERMODE_OUTLINEOBJECT
278 [ # # ][ # # ]: 0 : if(pOutl->GetAbsPos(pPara) > 0)
279 : : {
280 : : // Nicht ganz oben
281 : 0 : bDisableUp = sal_False;
282 : : }
283 : : }
284 : :
285 [ # # ][ # # ]: 0 : for (std::vector<Paragraph*>::const_iterator iter = aSelList.begin(); iter != aSelList.end(); ++iter)
[ # # ]
286 : : {
287 : 0 : pPara = *iter;
288 : :
289 [ # # ][ # # ]: 0 : sal_Int16 nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) );
290 : :
291 [ # # ][ # # ]: 0 : if (nDepth > 0 || (bOutlineViewSh && (nDepth <= 0) && !pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) )
[ # # ][ # # ]
[ # # ][ # # ]
292 : : {
293 : : // Nicht minimale Tiefe
294 : 0 : bDisableLeft = sal_False;
295 : : }
296 : :
297 [ # # ][ # # ]: 0 : if( (nDepth < pOLV->GetOutliner()->GetMaxDepth() && ( !bOutlineViewSh || pOutl->GetAbsPos(pPara) != 0 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
298 [ # # ][ # # ]: 0 : (bOutlineViewSh && (nDepth <= 0) && pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) && pOutl->GetAbsPos(pPara) != 0) )
299 : : {
300 : : // Nicht maximale Tiefe und nicht ganz oben
301 : 0 : bDisableRight = sal_False;
302 : : }
303 : : }
304 : :
305 [ # # ][ # # ]: 0 : if ( ( pOutl->GetAbsPos(pPara) < pOutl->GetParagraphCount() - 1 ) &&
[ # # ][ # # ]
[ # # ][ # # ]
306 [ # # ]: 0 : ( pOutl->GetParagraphCount() > 1 || !bOutlineViewSh) )
307 : : {
308 : : // Nicht letzter Absatz
309 : 0 : bDisableDown = sal_False;
310 : : }
311 : :
312 : : // disable when first para and 2nd is not a title
313 [ # # ][ # # ]: 0 : pPara = aSelList.empty() ? NULL : *(aSelList.begin());
314 : :
315 [ # # ][ # # ]: 0 : if(!bDisableDown && bIsOutlineView
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
316 : : && pPara
317 [ # # ]: 0 : && 0 == pOutl->GetAbsPos(pPara)
318 [ # # ]: 0 : && pOutl->GetParagraphCount() > 1
319 [ # # ][ # # ]: 0 : && !pOutl->HasParaFlag( pOutl->GetParagraph(1), PARAFLAG_ISPAGE ) )
320 : : {
321 : : // Needs to be disabled
322 : 0 : bDisableDown = sal_True;
323 : 0 : }
324 : : }
325 : :
326 [ # # ]: 0 : if (bDisableLeft)
327 [ # # ]: 0 : rSet.DisableItem(SID_OUTLINE_LEFT);
328 [ # # ]: 0 : if (bDisableRight)
329 [ # # ]: 0 : rSet.DisableItem(SID_OUTLINE_RIGHT);
330 [ # # ]: 0 : if (bDisableUp)
331 [ # # ]: 0 : rSet.DisableItem(SID_OUTLINE_UP);
332 [ # # ]: 0 : if (bDisableDown)
333 [ # # ]: 0 : rSet.DisableItem(SID_OUTLINE_DOWN);
334 : : }
335 : 0 : break;
336 : :
337 : : case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
338 : : case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
339 : : {
340 [ # # ]: 0 : if ( bDisableVerticalText )
341 : : {
342 [ # # ]: 0 : rSet.DisableItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
343 [ # # ]: 0 : rSet.DisableItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
344 : : }
345 : : else
346 : : {
347 : 0 : sal_Bool bLeftToRight = sal_True;
348 : :
349 : 0 : SdrOutliner* pOutl = mpView->GetTextEditOutliner();
350 [ # # ]: 0 : if( pOutl )
351 : : {
352 [ # # ][ # # ]: 0 : if( pOutl->IsVertical() )
353 : 0 : bLeftToRight = sal_False;
354 : : }
355 : : else
356 [ # # ]: 0 : bLeftToRight = ( (const SvxWritingModeItem&) aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB;
357 : :
358 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT, bLeftToRight ) );
[ # # ]
359 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM, !bLeftToRight ) );
[ # # ]
360 : :
361 [ # # ]: 0 : if( !bLeftToRight )
362 : 0 : bDisableParagraphTextDirection = sal_True;
363 : : }
364 : : }
365 : 0 : break;
366 : :
367 : : case SID_GROW_FONT_SIZE:
368 : : case SID_SHRINK_FONT_SIZE:
369 : : {
370 : : // todo
371 : : }
372 : 0 : break;
373 : :
374 : : case SID_THES:
375 : : {
376 [ # # ][ # # ]: 0 : if( mpView && mpView->GetTextEditOutlinerView() )
[ # # ]
377 : : {
378 : 0 : EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();
379 [ # # ]: 0 : String aStatusVal;
380 : 0 : LanguageType nLang = LANGUAGE_NONE;
381 [ # # ]: 0 : bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView );
382 [ # # ][ # # ]: 0 : rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
[ # # ]
383 : :
384 : : // disable "Thesaurus" context menu entry if there is nothing to look up
385 [ # # ]: 0 : lang::Locale aLocale( SvxCreateLocale( nLang ) );
386 [ # # ]: 0 : uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
387 [ # # # # ]: 0 : if (!bIsLookUpWord ||
[ # # ][ # # ]
[ # # ]
388 [ # # ][ # # ]: 0 : !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
389 [ # # ][ # # ]: 0 : rSet.DisableItem( SID_THES );
390 : : }
391 : : else
392 : : {
393 [ # # ]: 0 : rSet.DisableItem( SID_THES );
394 : : }
395 : : //! avoid puting the same item as SfxBoolItem at the end of this function
396 : 0 : nSlotId = 0;
397 : : }
398 : 0 : break;
399 : :
400 : : default:
401 : 0 : break;
402 : : }
403 : :
404 [ # # ]: 0 : nWhich = aIter.NextWhich();
405 : : }
406 : :
407 [ # # ]: 0 : rSet.Put( aAttrSet, sal_False ); // <- sal_False, damit DontCare-Status uebernommen wird
408 : :
409 : :
410 : : // die sind im Gliederungsmodus disabled
411 [ # # ][ # # ]: 0 : if (!mpViewShell->ISA(DrawViewShell))
[ # # ]
412 : : {
413 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_ADJUST_LEFT );
414 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_ADJUST_RIGHT );
415 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_ADJUST_CENTER );
416 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_ADJUST_BLOCK );
417 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_LINESPACE_10 );
418 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_LINESPACE_15 );
419 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_LINESPACE_20 );
420 [ # # ]: 0 : rSet.DisableItem( SID_PARASPACE_INCREASE );
421 [ # # ]: 0 : rSet.DisableItem( SID_PARASPACE_DECREASE );
422 [ # # ]: 0 : rSet.DisableItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
423 [ # # ]: 0 : rSet.DisableItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
424 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT );
425 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT );
426 : : }
427 : : else
428 : : {
429 : : // Absatzabstand
430 : 0 : OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
431 [ # # ]: 0 : if( pOLV )
432 : : {
433 [ # # ]: 0 : ESelection aSel = pOLV->GetSelection();
434 : 0 : aSel.Adjust();
435 : 0 : sal_uLong nStartPara = aSel.nStartPara;
436 : 0 : sal_uLong nEndPara = aSel.nEndPara;
437 [ # # ]: 0 : if( !aSel.HasRange() )
438 : : {
439 : 0 : nStartPara = 0;
440 [ # # ]: 0 : nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1;
441 : : }
442 : 0 : long nUpper = 0L;
443 [ # # ]: 0 : for( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
444 : : {
445 [ # # ]: 0 : const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( (sal_uInt16)nPara );
446 [ # # ]: 0 : const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) rItems.Get( EE_PARA_ULSPACE );
447 : 0 : nUpper = Max( nUpper, (long)rItem.GetUpper() );
448 [ # # ]: 0 : }
449 [ # # ]: 0 : if( nUpper == 0L )
450 [ # # ]: 0 : rSet.DisableItem( SID_PARASPACE_DECREASE );
451 : : }
452 : : else
453 : : {
454 : : // Wird zur Zeit nie disabled !
455 : : //rSet.DisableItem( SID_PARASPACE_INCREASE );
456 : : //rSet.DisableItem( SID_PARASPACE_DECREASE );
457 : : }
458 : :
459 : : // Absatzausrichtung
460 [ # # ]: 0 : SvxAdjust eAdj = ( (const SvxAdjustItem&) aAttrSet.Get( EE_PARA_JUST ) ).GetAdjust();
461 [ # # # # : 0 : switch( eAdj )
# ]
462 : : {
463 : : case SVX_ADJUST_LEFT:
464 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_LEFT, sal_True ) );
[ # # ]
465 : 0 : break;
466 : : case SVX_ADJUST_CENTER:
467 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_CENTER, sal_True ) );
[ # # ]
468 : 0 : break;
469 : : case SVX_ADJUST_RIGHT:
470 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, sal_True ) );
[ # # ]
471 : 0 : break;
472 : : case SVX_ADJUST_BLOCK:
473 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, sal_True ) );
[ # # ]
474 : 0 : break;
475 : : default:
476 : 0 : break;
477 : : }
478 : :
479 : : // paragraph text direction
480 [ # # ]: 0 : if( bDisableParagraphTextDirection )
481 : : {
482 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT );
483 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT );
484 : : }
485 : : else
486 : : {
487 [ # # ][ # # : 0 : switch( ( ( (SvxFrameDirectionItem&) aAttrSet.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() )
# # # ]
488 : : {
489 : : case FRMDIR_VERT_TOP_LEFT:
490 : : case FRMDIR_VERT_TOP_RIGHT:
491 : : {
492 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT );
493 [ # # ]: 0 : rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT );
494 : : }
495 : 0 : break;
496 : :
497 : : case FRMDIR_HORI_LEFT_TOP:
498 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, sal_True ) );
[ # # ]
499 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, sal_False ) );
[ # # ]
500 : 0 : break;
501 : :
502 : : case FRMDIR_HORI_RIGHT_TOP:
503 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, sal_False ) );
[ # # ]
504 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, sal_True ) );
[ # # ]
505 : 0 : break;
506 : :
507 : : // The case for the superordinate object is missing.
508 : : case FRMDIR_ENVIRONMENT:
509 : : {
510 : 0 : SdDrawDocument& rDoc = mpView->GetDoc();
511 [ # # ]: 0 : ::com::sun::star::text::WritingMode eMode = rDoc.GetDefaultWritingMode();
512 : 0 : sal_Bool bIsLeftToRight(sal_False);
513 : :
514 [ # # ][ # # ]: 0 : if(::com::sun::star::text::WritingMode_LR_TB == eMode
515 : : || ::com::sun::star::text::WritingMode_TB_RL == eMode)
516 : : {
517 : 0 : bIsLeftToRight = sal_True;
518 : : }
519 : :
520 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, bIsLeftToRight ) );
[ # # ]
521 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, !bIsLeftToRight ) );
[ # # ]
522 : : }
523 : 0 : break;
524 : : }
525 : : }
526 : :
527 : : sal_uInt16 nLineSpace = (sal_uInt16) ( (const SvxLineSpacingItem&) aAttrSet.
528 [ # # ]: 0 : Get( EE_PARA_SBL ) ).GetPropLineSpace();
529 [ # # # # ]: 0 : switch( nLineSpace )
530 : : {
531 : : case 100:
532 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_10, sal_True ) );
[ # # ]
533 : 0 : break;
534 : : case 150:
535 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_15, sal_True ) );
[ # # ]
536 : 0 : break;
537 : : case 200:
538 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_20, sal_True ) );
[ # # ]
539 : 0 : break;
540 : : }
541 : : }
542 : :
543 : : // Ausrichtung (hoch/tief) wird auch im Gliederungsmodus gebraucht
544 : : SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
545 [ # # ][ # # ]: 0 : aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
546 : :
547 [ # # ]: 0 : if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
548 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, sal_True ) );
[ # # ]
549 [ # # ]: 0 : else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
550 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, sal_True ) );
[ # # ][ # # ]
[ # # ][ # # ]
551 : 0 : }
552 : :
553 : : /*************************************************************************
554 : : |*
555 : : |* Command event
556 : : |*
557 : : \************************************************************************/
558 : :
559 : 0 : void TextObjectBar::Command( const CommandEvent& )
560 : : {
561 : 0 : }
562 : :
563 : :
564 : : } // end of namespace sd
565 : :
566 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|