Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / sidebar / AlignmentPropertyPanel.cxx
blob9c83b3b9775e2b3cc5ab4aba605585a553482950
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sfx2/sidebar/ResourceDefinitions.hrc>
21 #include <sfx2/sidebar/Theme.hxx>
22 #include <sfx2/sidebar/ControlFactory.hxx>
23 #include <AlignmentPropertyPanel.hxx>
24 #include <editeng/justifyitem.hxx>
25 #include <svx/dialmgr.hxx>
26 #include "sc.hrc"
27 #include "scresid.hxx"
28 #include <sfx2/bindings.hxx>
29 #include <sfx2/dispatch.hxx>
30 #include <svx/algitem.hxx>
31 #include <svx/dlgutil.hxx>
32 #include <vcl/toolbox.hxx>
33 #include <svx/sidebar/SidebarDialControl.hxx>
35 using namespace css;
36 using namespace cssu;
37 using ::sfx2::sidebar::ControlFactory;
39 const char UNO_ALIGNBLOCK[] = ".uno:AlignBlock";
40 const char UNO_ALIGNBOTTOM[] = ".uno:AlignBottom";
41 const char UNO_ALIGNLEFT[] = ".uno:AlignLeft";
42 const char UNO_ALIGNHORIZONTALCENTER[] = ".uno:AlignHorizontalCenter";
43 const char UNO_ALIGNRIGHT[] = ".uno:AlignRight";
44 const char UNO_ALIGNTOP[] = ".uno:AlignTop";
45 const char UNO_ALIGNVCENTER[] = ".uno:AlignVCenter";
47 //////////////////////////////////////////////////////////////////////////////
48 // namespace open
50 namespace sc { namespace sidebar {
52 //////////////////////////////////////////////////////////////////////////////
54 AlignmentPropertyPanel::AlignmentPropertyPanel(
55 Window* pParent,
56 const cssu::Reference<css::frame::XFrame>& rxFrame,
57 SfxBindings* pBindings)
58 : PanelLayout(pParent, "AlignmentPropertyPanel", "modules/scalc/ui/sidebaralignment.ui", rxFrame),
59 maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this),
60 maAlignVerControl(SID_V_ALIGNCELL, *pBindings, *this),
61 maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this),
62 maMergeCellControl(FID_MERGE_TOGGLE, *pBindings, *this),
63 maWrapTextControl(SID_ATTR_ALIGN_LINEBREAK, *pBindings, *this),
64 maAngleControl(SID_ATTR_ALIGN_DEGREES, *pBindings, *this),
65 maStackControl(SID_ATTR_ALIGN_STACKED, *pBindings, *this),
66 meHorAlignState(SVX_HOR_JUSTIFY_STANDARD),
67 meVerAlignState(SVX_VER_JUSTIFY_STANDARD),
68 mbMultiDisable(false),
69 mxFrame(rxFrame),
70 maContext(),
71 mpBindings(pBindings)
73 get(mpTBHorizontal, "horizontalalignment");
74 get(mpTBVertical, "verticalalignment");
75 get(mpFTLeftIndent, "leftindentlabel");
76 get(mpMFLeftIndent, "leftindent");
77 get(mpCBXWrapText, "wraptext");
78 get(mpCBXMergeCell, "mergecells");
79 get(mpFtRotate, "orientationlabel");
80 get(mpCtrlDial, "orientationcontrol");
81 get(mpMtrAngle, "orientationdegrees");
82 get(mpCbStacked, "verticallystacked");
84 Initialize();
86 mpFTLeftIndent->SetBackground(Wallpaper());
87 mpFtRotate->SetBackground(Wallpaper());
90 //////////////////////////////////////////////////////////////////////////////
92 AlignmentPropertyPanel::~AlignmentPropertyPanel()
96 //////////////////////////////////////////////////////////////////////////////
98 void AlignmentPropertyPanel::Initialize()
100 Link aLink = LINK(this, AlignmentPropertyPanel, TbxHorAlignSelectHdl);
101 mpTBHorizontal->SetSelectHdl ( aLink );
103 aLink = LINK(this, AlignmentPropertyPanel, TbxVerAlignSelectHdl);
104 mpTBVertical->SetSelectHdl ( aLink );
106 mpFTLeftIndent->Disable();
107 mpMFLeftIndent->Disable();
108 mpMFLeftIndent->SetAccessibleName(OUString( "Left Indent")); //wj acc
109 aLink = LINK(this, AlignmentPropertyPanel, MFLeftIndentMdyHdl);
110 mpMFLeftIndent->SetModifyHdl ( aLink );
112 aLink = LINK(this, AlignmentPropertyPanel, CBOXMergnCellClkHdl);
113 mpCBXMergeCell->SetClickHdl ( aLink );
115 aLink = LINK(this, AlignmentPropertyPanel, CBOXWrapTextClkHdl);
116 mpCBXWrapText->SetClickHdl ( aLink );
118 //rotation control
119 mpCtrlDial->SetAccessibleName(OUString( "Text Orientation")); //wj acc
120 mpCtrlDial->SetModifyHdl(LINK( this, AlignmentPropertyPanel, RotationHdl));
122 //rotation
123 mpMtrAngle->SetAccessibleName(OUString( "Text Orientation")); //wj acc
124 mpMtrAngle->SetModifyHdl(LINK( this, AlignmentPropertyPanel, AngleModifiedHdl));
125 mpMtrAngle->EnableAutocomplete( false );
127 //Vertical stacked
128 mpCbStacked->SetClickHdl( LINK( this, AlignmentPropertyPanel, ClickStackHdl ) );
130 mpMtrAngle->InsertValue(0, FUNIT_CUSTOM);
131 mpMtrAngle->InsertValue(45, FUNIT_CUSTOM);
132 mpMtrAngle->InsertValue(90, FUNIT_CUSTOM);
133 mpMtrAngle->InsertValue(135, FUNIT_CUSTOM);
134 mpMtrAngle->InsertValue(180, FUNIT_CUSTOM);
135 mpMtrAngle->InsertValue(225, FUNIT_CUSTOM);
136 mpMtrAngle->InsertValue(270, FUNIT_CUSTOM);
137 mpMtrAngle->InsertValue(315, FUNIT_CUSTOM);
138 mpMtrAngle->SetDropDownLineCount(mpMtrAngle->GetEntryCount());
140 mpTBHorizontal->SetAccessibleRelationLabeledBy(mpTBHorizontal);
141 mpTBVertical->SetAccessibleRelationLabeledBy(mpTBVertical);
142 mpMFLeftIndent->SetAccessibleRelationLabeledBy(mpFTLeftIndent);
143 mpMtrAngle->SetAccessibleRelationLabeledBy(mpFtRotate);
144 #ifdef HAS_IA2
145 mpMtrAngle->SetMpSubEditAccLableBy(mpFtRotate);
146 #endif
149 //////////////////////////////////////////////////////////////////////////////
151 IMPL_LINK( AlignmentPropertyPanel, AngleModifiedHdl, void *, EMPTYARG )
153 OUString sTmp = mpMtrAngle->GetText();
155 sal_Unicode nChar = sTmp.isEmpty() ? 0 : sTmp[0];
156 if((sTmp.getLength()== 1 && nChar == '-') ||
157 (nChar != '-' && ((nChar < '0') || (nChar > '9') ) )) ////modify
158 return 0;
160 double dTmp = sTmp.toDouble();
161 FormatDegrees(dTmp);
163 sal_Int64 nTmp = (sal_Int64)dTmp*100;
164 SfxInt32Item aAngleItem( SID_ATTR_ALIGN_DEGREES,(sal_uInt32) nTmp);
166 GetBindings()->GetDispatcher()->Execute(
167 SID_ATTR_ALIGN_DEGREES, SFX_CALLMODE_RECORD, &aAngleItem, 0L );
168 return 0;
171 //////////////////////////////////////////////////////////////////////////////
173 IMPL_LINK( AlignmentPropertyPanel, RotationHdl, void *, EMPTYARG )
175 sal_Int32 nTmp = mpCtrlDial->GetRotation();
176 SfxInt32Item aAngleItem( SID_ATTR_ALIGN_DEGREES,(sal_uInt32) nTmp);
178 GetBindings()->GetDispatcher()->Execute(
179 SID_ATTR_ALIGN_DEGREES, SFX_CALLMODE_RECORD, &aAngleItem, 0L );
181 return 0;
184 //////////////////////////////////////////////////////////////////////////////
186 IMPL_LINK( AlignmentPropertyPanel, ClickStackHdl, void *, EMPTYARG )
188 bool bVertical = mpCbStacked->IsChecked() ? true : false;
189 SfxBoolItem aStackItem( SID_ATTR_ALIGN_STACKED, bVertical );
190 GetBindings()->GetDispatcher()->Execute(
191 SID_ATTR_ALIGN_STACKED, SFX_CALLMODE_RECORD, &aStackItem, 0L );
192 return 0;
195 //////////////////////////////////////////////////////////////////////////////
197 IMPL_LINK(AlignmentPropertyPanel, TbxHorAlignSelectHdl, ToolBox*, pToolBox)
199 const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
201 if(aCommand == UNO_ALIGNLEFT)
203 if(meHorAlignState != SVX_HOR_JUSTIFY_LEFT)
204 meHorAlignState = SVX_HOR_JUSTIFY_LEFT;
205 else
206 meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
208 else if(aCommand == UNO_ALIGNHORIZONTALCENTER )
210 if(meHorAlignState != SVX_HOR_JUSTIFY_CENTER)
211 meHorAlignState = SVX_HOR_JUSTIFY_CENTER;
212 else
213 meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
215 else if(aCommand == UNO_ALIGNRIGHT )
217 if(meHorAlignState != SVX_HOR_JUSTIFY_RIGHT)
218 meHorAlignState = SVX_HOR_JUSTIFY_RIGHT;
219 else
220 meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
222 else if(aCommand == UNO_ALIGNBLOCK )
224 if(meHorAlignState != SVX_HOR_JUSTIFY_BLOCK)
225 meHorAlignState = SVX_HOR_JUSTIFY_BLOCK;
226 else
227 meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
229 SvxHorJustifyItem aHorItem(meHorAlignState, SID_H_ALIGNCELL);
230 GetBindings()->GetDispatcher()->Execute(SID_H_ALIGNCELL, SFX_CALLMODE_RECORD, &aHorItem, 0L);
231 UpdateHorAlign();
232 return 0;
235 //////////////////////////////////////////////////////////////////////////////
237 IMPL_LINK(AlignmentPropertyPanel, TbxVerAlignSelectHdl, ToolBox*, pToolBox)
239 const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
241 if(aCommand == UNO_ALIGNTOP)
243 if(meVerAlignState != SVX_VER_JUSTIFY_TOP)
244 meVerAlignState = SVX_VER_JUSTIFY_TOP;
245 else
246 meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
248 else if(aCommand == UNO_ALIGNVCENTER)
250 if(meVerAlignState != SVX_VER_JUSTIFY_CENTER)
251 meVerAlignState = SVX_VER_JUSTIFY_CENTER;
252 else
253 meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
255 else if(aCommand == UNO_ALIGNBOTTOM)
257 if(meVerAlignState != SVX_VER_JUSTIFY_BOTTOM)
258 meVerAlignState = SVX_VER_JUSTIFY_BOTTOM;
259 else
260 meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
262 SvxVerJustifyItem aVerItem(meVerAlignState, SID_V_ALIGNCELL);
263 GetBindings()->GetDispatcher()->Execute(SID_V_ALIGNCELL, SFX_CALLMODE_RECORD, &aVerItem, 0L);
264 UpdateVerAlign();
265 return 0;
268 //////////////////////////////////////////////////////////////////////////////
270 IMPL_LINK(AlignmentPropertyPanel, MFLeftIndentMdyHdl, void*, EMPTYARG)
272 mpCBXWrapText->EnableTriState(false);
273 sal_uInt16 nVal = (sal_uInt16)mpMFLeftIndent->GetValue();
274 SfxUInt16Item aItem( SID_ATTR_ALIGN_INDENT, (sal_uInt16)CalcToUnit( nVal, SFX_MAPUNIT_TWIP ) );
276 GetBindings()->GetDispatcher()->Execute(SID_ATTR_ALIGN_INDENT, SFX_CALLMODE_RECORD, &aItem, 0L);
277 return( 0L );
280 //////////////////////////////////////////////////////////////////////////////
282 IMPL_LINK(AlignmentPropertyPanel, CBOXMergnCellClkHdl, void*, EMPTYARG)
284 bool bState = mpCBXMergeCell->IsChecked();
286 //Modified
287 //SfxBoolItem aItem( FID_MERGE_TOGGLE , bState);
288 //GetBindings()->GetDispatcher()->Execute(FID_MERGE_TOGGLE, SFX_CALLMODE_RECORD, &aItem, false, 0L);
289 if(bState)
290 GetBindings()->GetDispatcher()->Execute(FID_MERGE_ON, SFX_CALLMODE_RECORD);
291 else
292 GetBindings()->GetDispatcher()->Execute(FID_MERGE_OFF, SFX_CALLMODE_RECORD);
293 GetBindings()->Invalidate(FID_MERGE_TOGGLE,true,false);
294 //modified end
296 return 0;
299 //////////////////////////////////////////////////////////////////////////////
301 IMPL_LINK(AlignmentPropertyPanel, CBOXWrapTextClkHdl, void*, EMPTYARG)
303 bool bState = mpCBXWrapText->IsChecked();
304 SfxBoolItem aItem( SID_ATTR_ALIGN_LINEBREAK , bState);
305 GetBindings()->GetDispatcher()->Execute(SID_ATTR_ALIGN_LINEBREAK, SFX_CALLMODE_RECORD, &aItem, 0L);
306 return 0;
309 //////////////////////////////////////////////////////////////////////////////
311 AlignmentPropertyPanel* AlignmentPropertyPanel::Create (
312 Window* pParent,
313 const cssu::Reference<css::frame::XFrame>& rxFrame,
314 SfxBindings* pBindings)
316 if (pParent == NULL)
317 throw lang::IllegalArgumentException("no parent Window given to AlignmentPropertyPanel::Create", NULL, 0);
318 if ( ! rxFrame.is())
319 throw lang::IllegalArgumentException("no XFrame given to AlignmentPropertyPanel::Create", NULL, 1);
320 if (pBindings == NULL)
321 throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", NULL, 2);
323 return new AlignmentPropertyPanel(
324 pParent,
325 rxFrame,
326 pBindings);
329 //////////////////////////////////////////////////////////////////////////////
331 void AlignmentPropertyPanel::DataChanged(
332 const DataChangedEvent& rEvent)
334 (void)rEvent;
337 //////////////////////////////////////////////////////////////////////////////
339 void AlignmentPropertyPanel::HandleContextChange(
340 const ::sfx2::sidebar::EnumContext aContext)
342 if(maContext == aContext)
344 // Nothing to do.
345 return;
348 maContext = aContext;
352 // todo
355 //////////////////////////////////////////////////////////////////////////////
357 void AlignmentPropertyPanel::NotifyItemUpdate(
358 sal_uInt16 nSID,
359 SfxItemState eState,
360 const SfxPoolItem* pState,
361 const bool bIsEnabled)
363 (void)bIsEnabled;
365 switch(nSID)
367 case SID_H_ALIGNCELL:
368 if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SvxHorJustifyItem) )
370 const SvxHorJustifyItem* pItem = (const SvxHorJustifyItem*)pState;
371 meHorAlignState = (SvxCellHorJustify)pItem->GetValue();
373 else
375 meHorAlignState = SVX_HOR_JUSTIFY_STANDARD;
377 UpdateHorAlign();
378 break;
379 case SID_V_ALIGNCELL:
380 if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SvxVerJustifyItem) )
382 const SvxVerJustifyItem* pItem = (const SvxVerJustifyItem*)pState;
383 meVerAlignState = (SvxCellVerJustify)pItem->GetValue();
385 else
387 meVerAlignState = SVX_VER_JUSTIFY_STANDARD;
389 UpdateVerAlign();
390 break;
391 case SID_ATTR_ALIGN_INDENT:
392 if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SfxUInt16Item) )
394 const SfxUInt16Item* pItem = (const SfxUInt16Item*)pState;
395 sal_uInt16 nVal = pItem->GetValue();
396 mpMFLeftIndent->SetValue( CalcToPoint(nVal, SFX_MAPUNIT_TWIP, 1) );
398 else
400 mpMFLeftIndent->SetValue(0);
401 mpMFLeftIndent->SetText(OUString());
403 break;
404 case FID_MERGE_TOGGLE:
405 if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SfxBoolItem) )
407 mpCBXMergeCell->Enable();
408 const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
409 bool bVal = pItem->GetValue();
410 if(bVal)
411 mpCBXMergeCell->Check(true);
412 else
413 mpCBXMergeCell->Check(false);
415 else
417 mpCBXMergeCell->Check(false);
418 mpCBXMergeCell->Disable();
420 break;
422 case SID_ATTR_ALIGN_LINEBREAK:
423 if(eState == SFX_ITEM_DISABLED)
425 mpCBXWrapText->EnableTriState(false);
426 mpCBXWrapText->Check(false);
427 mpCBXWrapText->Disable();
429 else
431 mpCBXWrapText->Enable();
432 if(eState >= SFX_ITEM_DEFAULT && pState && pState->ISA(SfxBoolItem) )
434 mpCBXWrapText->EnableTriState(false);
435 const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
436 bool bVal = pItem->GetValue();
437 if(bVal)
438 mpCBXWrapText->Check(true);
439 else
440 mpCBXWrapText->Check(false);
442 else if(eState == SFX_ITEM_DONTCARE)
444 mpCBXWrapText->EnableTriState(true);
445 mpCBXWrapText->SetState(STATE_DONTKNOW);
448 break;
449 case SID_ATTR_ALIGN_DEGREES:
450 if (eState >= SFX_ITEM_AVAILABLE)
452 long nTmp = ((const SfxInt32Item*)pState)->GetValue();
453 mpMtrAngle->SetValue( nTmp / 100); //wj
454 mpCtrlDial->SetRotation( nTmp );
455 switch(nTmp)
457 case 0:
458 mpMtrAngle->SelectEntryPos(0);
459 break;
460 case 4500:
461 mpMtrAngle->SelectEntryPos(1);
462 break;
463 case 9000:
464 mpMtrAngle->SelectEntryPos(2);
465 break;
466 case 13500:
467 mpMtrAngle->SelectEntryPos(3);
468 break;
469 case 18000:
470 mpMtrAngle->SelectEntryPos(4);
471 break;
472 case 22500:
473 mpMtrAngle->SelectEntryPos(5);
474 break;
475 case 27000:
476 mpMtrAngle->SelectEntryPos(6);
477 break;
478 case 31500:
479 mpMtrAngle->SelectEntryPos(7);
482 else
484 mpMtrAngle->SetText( OUString() );
485 mpCtrlDial->SetRotation( 0 );
487 break;
488 case SID_ATTR_ALIGN_STACKED:
489 if (eState >= SFX_ITEM_AVAILABLE)
491 mpCbStacked->EnableTriState(false);
492 const SfxBoolItem* aStackItem = (const SfxBoolItem*)pState;
493 bool IsChecked = (bool)aStackItem->GetValue();
494 if(IsChecked)
496 mpCbStacked->Check(IsChecked);
497 mpFtRotate->Disable();
498 mpMtrAngle->Disable();
499 mpCtrlDial->Disable();
500 mbMultiDisable = true;
502 else
504 mpCbStacked->Check(IsChecked);
505 mpFtRotate->Enable();
506 mpMtrAngle->Enable();
507 mpCtrlDial->Enable();
508 mbMultiDisable = false;
511 else
513 mbMultiDisable = true;
514 mpFtRotate->Disable();
515 mpMtrAngle->Disable();
516 mpCtrlDial->Disable();
517 mpCbStacked->EnableTriState(true);
518 mpCbStacked->SetState(STATE_DONTKNOW);
523 //////////////////////////////////////////////////////////////////////////////
525 SfxBindings* AlignmentPropertyPanel::GetBindings()
527 return mpBindings;
530 //////////////////////////////////////////////////////////////////////////////
532 void AlignmentPropertyPanel::FormatDegrees(double& dTmp)
534 while(dTmp<0)
535 dTmp += 360;
536 while (dTmp > 359) //modify
537 dTmp = 359;
540 //////////////////////////////////////////////////////////////////////////////
542 void AlignmentPropertyPanel::UpdateHorAlign()
544 const sal_uInt16 nIdLeft = mpTBHorizontal->GetItemId(UNO_ALIGNLEFT);
545 const sal_uInt16 nIdCenter = mpTBHorizontal->GetItemId(UNO_ALIGNHORIZONTALCENTER);
546 const sal_uInt16 nIdRight = mpTBHorizontal->GetItemId(UNO_ALIGNRIGHT);
547 const sal_uInt16 nIdBlock = mpTBHorizontal->GetItemId(UNO_ALIGNBLOCK);
549 mpTBHorizontal->SetItemState(nIdLeft, STATE_NOCHECK);
550 mpTBHorizontal->SetItemState(nIdCenter, STATE_NOCHECK);
551 mpTBHorizontal->SetItemState(nIdRight, STATE_NOCHECK);
552 mpTBHorizontal->SetItemState(nIdBlock, STATE_NOCHECK);
553 mpFTLeftIndent->Disable();
554 mpMFLeftIndent->Disable();
555 if(meHorAlignState==SVX_HOR_JUSTIFY_REPEAT)
557 mpFtRotate->Disable();
558 mpCtrlDial->Disable();
559 mpMtrAngle->Disable();
560 mpCbStacked->Disable();
562 else
564 if(!mbMultiDisable)
566 mpFtRotate->Enable();
567 mpCtrlDial->Enable();
568 mpMtrAngle->Enable();
570 else
572 mpFtRotate->Disable();
573 mpCtrlDial->Disable();
574 mpMtrAngle->Disable();
576 mpCbStacked->Enable();
578 switch(meHorAlignState)
580 case SVX_HOR_JUSTIFY_LEFT:
581 mpTBHorizontal->SetItemState(nIdLeft, STATE_CHECK);
582 mpFTLeftIndent->Enable();
583 mpMFLeftIndent->Enable();
584 break;
585 case SVX_HOR_JUSTIFY_CENTER:mpTBHorizontal->SetItemState(nIdCenter, STATE_CHECK);break;
586 case SVX_HOR_JUSTIFY_RIGHT: mpTBHorizontal->SetItemState(nIdRight, STATE_CHECK);break;
587 case SVX_HOR_JUSTIFY_BLOCK: mpTBHorizontal->SetItemState(nIdBlock, STATE_CHECK);break;
588 default:;
592 //////////////////////////////////////////////////////////////////////////////
594 void AlignmentPropertyPanel::UpdateVerAlign()
596 const sal_uInt16 nIdTop = mpTBVertical->GetItemId(UNO_ALIGNTOP);
597 const sal_uInt16 nIdVCenter = mpTBVertical->GetItemId(UNO_ALIGNVCENTER);
598 const sal_uInt16 nIdBottom = mpTBVertical->GetItemId(UNO_ALIGNBOTTOM);
600 mpTBVertical->SetItemState(nIdTop, STATE_NOCHECK);
601 mpTBVertical->SetItemState(nIdVCenter, STATE_NOCHECK);
602 mpTBVertical->SetItemState(nIdBottom, STATE_NOCHECK);
604 switch(meVerAlignState)
606 case SVX_VER_JUSTIFY_TOP: mpTBVertical->SetItemState(nIdTop, STATE_CHECK);break;
607 case SVX_VER_JUSTIFY_CENTER:mpTBVertical->SetItemState(nIdVCenter, STATE_CHECK);break;
608 case SVX_VER_JUSTIFY_BOTTOM:mpTBVertical->SetItemState(nIdBottom, STATE_CHECK);break;
609 default:;
613 //////////////////////////////////////////////////////////////////////////////
614 // namespace close
616 }} // end of namespace ::sc::sidebar
618 //////////////////////////////////////////////////////////////////////////////
619 // eof
621 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */