1766ce4d0SZheng Fan /************************************************************** 2766ce4d0SZheng Fan * 3766ce4d0SZheng Fan * Licensed to the Apache Software Foundation (ASF) under one 4766ce4d0SZheng Fan * or more contributor license agreements. See the NOTICE file 5766ce4d0SZheng Fan * distributed with this work for additional information 6766ce4d0SZheng Fan * regarding copyright ownership. The ASF licenses this file 7766ce4d0SZheng Fan * to you under the Apache License, Version 2.0 (the 8766ce4d0SZheng Fan * "License"); you may not use this file except in compliance 9766ce4d0SZheng Fan * with the License. You may obtain a copy of the License at 10766ce4d0SZheng Fan * 11766ce4d0SZheng Fan * http://www.apache.org/licenses/LICENSE-2.0 12766ce4d0SZheng Fan * 13766ce4d0SZheng Fan * Unless required by applicable law or agreed to in writing, 14766ce4d0SZheng Fan * software distributed under the License is distributed on an 15766ce4d0SZheng Fan * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16766ce4d0SZheng Fan * KIND, either express or implied. See the License for the 17766ce4d0SZheng Fan * specific language governing permissions and limitations 18766ce4d0SZheng Fan * under the License. 19766ce4d0SZheng Fan * 20766ce4d0SZheng Fan *************************************************************/ 21766ce4d0SZheng Fan 22766ce4d0SZheng Fan #include "precompiled_svx.hxx" 23766ce4d0SZheng Fan #include <svx/sidebar/ColorControl.hxx> 24766ce4d0SZheng Fan 25766ce4d0SZheng Fan #include "ParaPropertyPanel.hxx" 26766ce4d0SZheng Fan #include "ParaPropertyPanel.hrc" 27766ce4d0SZheng Fan 28766ce4d0SZheng Fan #include "ParaLineSpacingPopup.hxx" 29766ce4d0SZheng Fan #include "ParaLineSpacingControl.hxx" 30766ce4d0SZheng Fan #include "ParaBulletsPopup.hxx" 31766ce4d0SZheng Fan #include "ParaBulletsControl.hxx" 32766ce4d0SZheng Fan #include "ParaNumberingPopup.hxx" 33766ce4d0SZheng Fan #include "ParaNumberingControl.hxx" 34766ce4d0SZheng Fan #include <sfx2/sidebar/Theme.hxx> 35d29c2fc2SAndre Fischer #include <sfx2/sidebar/ResourceDefinitions.hrc> 36766ce4d0SZheng Fan #include <sfx2/sidebar/ControlFactory.hxx> 37766ce4d0SZheng Fan #include <svx/sidebar/PopupContainer.hxx> 38766ce4d0SZheng Fan #include <sfx2/dispatch.hxx> 39766ce4d0SZheng Fan #include <editeng/colritem.hxx> 40766ce4d0SZheng Fan #include <editeng/brshitem.hxx> 41766ce4d0SZheng Fan #include <editeng/lrspitem.hxx> 42766ce4d0SZheng Fan #include <editeng/ulspitem.hxx> 43766ce4d0SZheng Fan #include <vcl/toolbox.hxx> 44766ce4d0SZheng Fan #include <vcl/fixed.hxx> 45766ce4d0SZheng Fan #include <vcl/svapp.hxx> 46766ce4d0SZheng Fan #include <svx/svxids.hrc> 47766ce4d0SZheng Fan #include <svl/intitem.hxx> 48766ce4d0SZheng Fan #include "svx/dialmgr.hxx" 49766ce4d0SZheng Fan #include <sfx2/objsh.hxx> 50766ce4d0SZheng Fan #include <svtools/unitconv.hxx> 51766ce4d0SZheng Fan #include <boost/bind.hpp> 52766ce4d0SZheng Fan using namespace css; 53766ce4d0SZheng Fan using namespace cssu; 54766ce4d0SZheng Fan using ::sfx2::sidebar::Theme; 55766ce4d0SZheng Fan using ::sfx2::sidebar::ControlFactory; 56766ce4d0SZheng Fan 57766ce4d0SZheng Fan #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) 58766ce4d0SZheng Fan 59766ce4d0SZheng Fan 60766ce4d0SZheng Fan namespace svx {namespace sidebar { 61766ce4d0SZheng Fan #define DEFAULT_VALUE 0 62766ce4d0SZheng Fan #define TOOLBOX_ITEM1 1 63766ce4d0SZheng Fan #define TOOLBOX_ITEM2 2 64766ce4d0SZheng Fan #define TOOLBOX_ITEM3 3 65766ce4d0SZheng Fan #define TOOLBOX_ITEM4 4 66766ce4d0SZheng Fan 67766ce4d0SZheng Fan #define MAX_DURCH 5670 68766ce4d0SZheng Fan 69766ce4d0SZheng Fan #define INDENT_INCREMENT 1 70766ce4d0SZheng Fan #define INDENT_DECREMENT 2 71766ce4d0SZheng Fan #define INDENT_STEP 706 72766ce4d0SZheng Fan #define UL_STEP 58 73766ce4d0SZheng Fan #define UL_INCREMENT 1 74766ce4d0SZheng Fan #define UL_DECREMENT 2 75766ce4d0SZheng Fan 76766ce4d0SZheng Fan #define NEGATIVE_MAX_VALUE -9999 77766ce4d0SZheng Fan #define BEGIN_VALUE 28 78766ce4d0SZheng Fan #define MAX_SW 1709400 79766ce4d0SZheng Fan #define MAX_SC_SD 116220200 80766ce4d0SZheng Fan #define NEGA_MAXVALUE -10000000 81766ce4d0SZheng Fan 82766ce4d0SZheng Fan #define POS_FT_PARA_SPACE Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y), MAP_APPFONT)) 83766ce4d0SZheng Fan #define POS_FT_PARA_SPACE2 Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y2), MAP_APPFONT)) 84766ce4d0SZheng Fan #define POS_TBX_PARA_SPACE_INC_DEC Point(LogicToPixel(Point(TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y), MAP_APPFONT)) 85766ce4d0SZheng Fan #define POS_TBX_PARA_SPACE_INC_DEC2 Point(LogicToPixel(Point(TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y2), MAP_APPFONT)) 86766ce4d0SZheng Fan #define POS_FT_PARA_INDENT Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y), MAP_APPFONT)) 87766ce4d0SZheng Fan #define POS_FT_PARA_INDENT2 Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y2), MAP_APPFONT)) 88766ce4d0SZheng Fan #define POS_TBX_PARA_INDENT_INC_DEC Point(LogicToPixel(Point(TBX_PARA_INDENT_INC_DEC_X,TBX_PARA_INDENT_INC_DEC_Y), MAP_APPFONT)) 89766ce4d0SZheng Fan #define POS_TBX_PARA_INDENT_INC_DEC2 Point(LogicToPixel(Point(TBX_PARA_INDENT_INC_DEC_X,TBX_PARA_INDENT_INC_DEC_Y2), MAP_APPFONT)) 90766ce4d0SZheng Fan #define POS_MBX_TOP_DIST Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y), MAP_APPFONT)) 91766ce4d0SZheng Fan #define POS_MBX_TOP_DIST2 Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y2), MAP_APPFONT)) 92766ce4d0SZheng Fan #define POS_MBX_BOT_DIST Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y), MAP_APPFONT)) 93766ce4d0SZheng Fan #define POS_MBX_BOT_DIST2 Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y2), MAP_APPFONT)) 94766ce4d0SZheng Fan #define POS_MBX_LEFT_DIST Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y), MAP_APPFONT)) 95766ce4d0SZheng Fan #define POS_MBX_LEFT_DIST2 Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y2), MAP_APPFONT)) 96766ce4d0SZheng Fan #define POS_MBX_RIGHT_DIST Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y), MAP_APPFONT)) 97766ce4d0SZheng Fan #define POS_MBX_RIGHT_DIST2 Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y2), MAP_APPFONT)) 98766ce4d0SZheng Fan #define POS_MBX_FLINE_DIST Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y), MAP_APPFONT)) 99766ce4d0SZheng Fan #define POS_MBX_FLINE_DIST2 Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y2), MAP_APPFONT)) 100766ce4d0SZheng Fan #define POS_IMG_SPACE1 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y), MAP_APPFONT)) 101766ce4d0SZheng Fan #define POS_IMG_SPACE12 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y2), MAP_APPFONT)) 102766ce4d0SZheng Fan #define POS_IMG_SPACE2 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y), MAP_APPFONT)) 103766ce4d0SZheng Fan #define POS_IMG_SPACE22 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y2), MAP_APPFONT)) 104766ce4d0SZheng Fan #define POS_IMG_INDENT1 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y), MAP_APPFONT)) 105766ce4d0SZheng Fan #define POS_IMG_INDENT12 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y2), MAP_APPFONT)) 106766ce4d0SZheng Fan #define POS_IMG_INDENT2 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y), MAP_APPFONT)) 107766ce4d0SZheng Fan #define POS_IMG_INDENT22 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y2), MAP_APPFONT)) 108766ce4d0SZheng Fan #define POS_IMG_INDENT3 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y), MAP_APPFONT)) 109766ce4d0SZheng Fan #define POS_IMG_INDENT32 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y2), MAP_APPFONT)) 110766ce4d0SZheng Fan #define TBX_LINE_SPACE Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y), MAP_APPFONT)) 111766ce4d0SZheng Fan #define TBX_LINE_SPACE2 Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y2), MAP_APPFONT)) 112766ce4d0SZheng Fan 113766ce4d0SZheng Fan #define LINE_POINT1_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_TOP_Y), MAP_APPFONT)) 114766ce4d0SZheng Fan #define LINE_POINT2_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_BOT_Y), MAP_APPFONT)) 115766ce4d0SZheng Fan #define LINE_POINT3_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_TOP_Y2), MAP_APPFONT)) 116766ce4d0SZheng Fan #define LINE_POINT4_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_BOT_Y2), MAP_APPFONT)) 117766ce4d0SZheng Fan 118766ce4d0SZheng Fan ParaPropertyPanel* ParaPropertyPanel::Create ( 119766ce4d0SZheng Fan Window* pParent, 120766ce4d0SZheng Fan const cssu::Reference<css::frame::XFrame>& rxFrame, 12137fee4fdSAndre Fischer SfxBindings* pBindings, 12237fee4fdSAndre Fischer const cssu::Reference<css::ui::XSidebar>& rxSidebar) 123766ce4d0SZheng Fan { 124766ce4d0SZheng Fan if (pParent == NULL) 125766ce4d0SZheng Fan throw lang::IllegalArgumentException(A2S("no parent Window given to ParaPropertyPanel::Create"), NULL, 0); 126766ce4d0SZheng Fan if ( ! rxFrame.is()) 127766ce4d0SZheng Fan throw lang::IllegalArgumentException(A2S("no XFrame given to ParaPropertyPanel::Create"), NULL, 1); 128766ce4d0SZheng Fan if (pBindings == NULL) 129766ce4d0SZheng Fan throw lang::IllegalArgumentException(A2S("no SfxBindings given to ParaPropertyPanel::Create"), NULL, 2); 130766ce4d0SZheng Fan 131766ce4d0SZheng Fan return new ParaPropertyPanel( 132766ce4d0SZheng Fan pParent, 133766ce4d0SZheng Fan rxFrame, 13437fee4fdSAndre Fischer pBindings, 13537fee4fdSAndre Fischer rxSidebar); 136766ce4d0SZheng Fan } 137766ce4d0SZheng Fan 138766ce4d0SZheng Fan void ParaPropertyPanel::HandleContextChange ( 139766ce4d0SZheng Fan const ::sfx2::sidebar::EnumContext aContext) 140766ce4d0SZheng Fan { 141766ce4d0SZheng Fan if (maContext == aContext) 142766ce4d0SZheng Fan { 143766ce4d0SZheng Fan // Nothing to do. 144766ce4d0SZheng Fan return; 145766ce4d0SZheng Fan } 146766ce4d0SZheng Fan 147766ce4d0SZheng Fan maContext = aContext; 14837fee4fdSAndre Fischer switch (maContext.GetCombinedContext_DI()) 149766ce4d0SZheng Fan { 150766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_DrawText): 15137fee4fdSAndre Fischer maTBxVertAlign->Show(); 15237fee4fdSAndre Fischer maTBxVertAlignBackground->Show(); 15337fee4fdSAndre Fischer maTBxBackColor->Hide(); 15437fee4fdSAndre Fischer maTBxBackColorBackground->Hide(); 15537fee4fdSAndre Fischer maTBxNumBullet->Hide(); 15637fee4fdSAndre Fischer maTBxNumBulletBackground->Hide(); 15737fee4fdSAndre Fischer ReSize(false); 15837fee4fdSAndre Fischer maTbxIndent_IncDec->Show(); 15937fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Show(); 16037fee4fdSAndre Fischer maTbxProDemote->Hide(); 16137fee4fdSAndre Fischer maTbxProDemoteBackground->Hide(); 16237fee4fdSAndre Fischer break; 16337fee4fdSAndre Fischer 16437fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Draw): 16537fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_TextObject): 16637fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Graphic): 16737fee4fdSAndre Fischer maTBxVertAlign->Hide(); 16837fee4fdSAndre Fischer maTBxVertAlignBackground->Hide(); 16937fee4fdSAndre Fischer maTBxBackColor->Hide(); 17037fee4fdSAndre Fischer maTBxBackColorBackground->Hide(); 17137fee4fdSAndre Fischer maTBxNumBullet->Show(); 17237fee4fdSAndre Fischer maTBxNumBulletBackground->Show(); 17337fee4fdSAndre Fischer ReSize(true); 17437fee4fdSAndre Fischer maTbxIndent_IncDec->Hide(); 17537fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Hide(); 17637fee4fdSAndre Fischer maTbxProDemote->Show(); 17737fee4fdSAndre Fischer maTbxProDemoteBackground->Show(); 17837fee4fdSAndre Fischer break; 17937fee4fdSAndre Fischer 18037fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_DrawText): 18137fee4fdSAndre Fischer maTBxVertAlign->Show(); 18237fee4fdSAndre Fischer maTBxVertAlignBackground->Show(); 18337fee4fdSAndre Fischer maTBxBackColor->Hide(); 18437fee4fdSAndre Fischer maTBxBackColorBackground->Hide(); 18537fee4fdSAndre Fischer maTBxNumBullet->Show(); 18637fee4fdSAndre Fischer maTBxNumBulletBackground->Show(); 18737fee4fdSAndre Fischer ReSize(true); 18837fee4fdSAndre Fischer maTbxIndent_IncDec->Hide(); 18937fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Hide(); 19037fee4fdSAndre Fischer maTbxProDemote->Show(); 19137fee4fdSAndre Fischer maTbxProDemoteBackground->Show(); 19237fee4fdSAndre Fischer break; 19337fee4fdSAndre Fischer 19437fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Table): 19537fee4fdSAndre Fischer maTBxVertAlign->Show(); 19637fee4fdSAndre Fischer maTBxVertAlignBackground->Show(); 19737fee4fdSAndre Fischer maTBxBackColor->Hide(); 19837fee4fdSAndre Fischer maTBxBackColorBackground->Hide(); 19937fee4fdSAndre Fischer maTBxNumBullet->Show(); 20037fee4fdSAndre Fischer maTBxNumBulletBackground->Show(); 20137fee4fdSAndre Fischer ReSize(true); 20237fee4fdSAndre Fischer maTbxIndent_IncDec->Hide(); 20337fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Hide(); 20437fee4fdSAndre Fischer maTbxProDemote->Show(); 20537fee4fdSAndre Fischer maTbxProDemoteBackground->Show(); 20637fee4fdSAndre Fischer break; 20737fee4fdSAndre Fischer 20885f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Default): 20985f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Text): 21037fee4fdSAndre Fischer maTBxVertAlign->Hide(); 21137fee4fdSAndre Fischer maTBxVertAlignBackground->Hide(); 21237fee4fdSAndre Fischer maTBxBackColor->Show(); 21337fee4fdSAndre Fischer maTBxBackColorBackground->Show(); 21437fee4fdSAndre Fischer maTBxNumBullet->Show(); 215766ce4d0SZheng Fan 21637fee4fdSAndre Fischer maTBxNumBulletBackground->Show(); 21737fee4fdSAndre Fischer ReSize(true); 21837fee4fdSAndre Fischer maTbxIndent_IncDec->Show(); 21937fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Show(); 22037fee4fdSAndre Fischer maTbxProDemote->Hide(); 22137fee4fdSAndre Fischer maTbxProDemoteBackground->Hide(); 22237fee4fdSAndre Fischer break; 22337fee4fdSAndre Fischer 22485f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Table): 22537fee4fdSAndre Fischer maTBxVertAlign->Show(); 22637fee4fdSAndre Fischer maTBxVertAlignBackground->Show(); 22737fee4fdSAndre Fischer maTBxBackColor->Show(); 22837fee4fdSAndre Fischer maTBxBackColorBackground->Show(); 22937fee4fdSAndre Fischer maTBxNumBullet->Show(); 23037fee4fdSAndre Fischer maTBxNumBulletBackground->Show(); 23137fee4fdSAndre Fischer ReSize(true); 23237fee4fdSAndre Fischer maTbxIndent_IncDec->Show(); 23337fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Show(); 23437fee4fdSAndre Fischer maTbxProDemote->Hide(); 23537fee4fdSAndre Fischer maTbxProDemoteBackground->Hide(); 23637fee4fdSAndre Fischer break; 23737fee4fdSAndre Fischer 23885f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_DrawText): 23937fee4fdSAndre Fischer maTBxVertAlign->Show(); 24037fee4fdSAndre Fischer maTBxVertAlignBackground->Show(); 24137fee4fdSAndre Fischer maTBxBackColor->Hide(); 24237fee4fdSAndre Fischer maTBxBackColorBackground->Hide(); 24337fee4fdSAndre Fischer maTBxNumBullet->Hide(); 24437fee4fdSAndre Fischer maTBxNumBulletBackground->Hide(); 24537fee4fdSAndre Fischer ReSize(false); 24637fee4fdSAndre Fischer maTbxIndent_IncDec->Show(); 24737fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Show(); 24837fee4fdSAndre Fischer maTbxProDemote->Hide(); 24937fee4fdSAndre Fischer maTbxProDemoteBackground->Hide(); 25037fee4fdSAndre Fischer break; 25137fee4fdSAndre Fischer 25285f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Annotation): 25337fee4fdSAndre Fischer maTBxVertAlign->Hide(); 25437fee4fdSAndre Fischer maTBxVertAlignBackground->Hide(); 25537fee4fdSAndre Fischer maTBxBackColor->Hide(); 25637fee4fdSAndre Fischer maTBxBackColorBackground->Hide(); 25737fee4fdSAndre Fischer maTBxNumBullet->Hide(); 25837fee4fdSAndre Fischer maTBxNumBulletBackground->Hide(); 25937fee4fdSAndre Fischer ReSize(false); 26037fee4fdSAndre Fischer maTbxIndent_IncDec->Show(); 26137fee4fdSAndre Fischer maTbxIndent_IncDecBackground->Show(); 26237fee4fdSAndre Fischer maTbxProDemote->Hide(); 26337fee4fdSAndre Fischer maTbxProDemoteBackground->Hide(); 26437fee4fdSAndre Fischer break; 26537fee4fdSAndre Fischer 266766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_EditCell): 267766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_Cell): 268766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_Pivot): 26937fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Text): 27037fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_OutlineText): 271766ce4d0SZheng Fan /*{ 272766ce4d0SZheng Fan mpToolBoxScriptSw->Hide(); 273766ce4d0SZheng Fan mpToolBoxScript->Show(); 274766ce4d0SZheng Fan mpToolBoxSpacing->Show(); 275766ce4d0SZheng Fan mpToolBoxHighlight->Hide(); 276766ce4d0SZheng Fan 277766ce4d0SZheng Fan Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT); 278766ce4d0SZheng Fan aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) ); 279766ce4d0SZheng Fan aSize.setWidth(GetOutputSizePixel().Width()); 280766ce4d0SZheng Fan SetSizePixel(aSize); 281766ce4d0SZheng Fan }*/ 28237fee4fdSAndre Fischer break; 283766ce4d0SZheng Fan 284766ce4d0SZheng Fan default: 285766ce4d0SZheng Fan break; 286766ce4d0SZheng Fan } 287766ce4d0SZheng Fan } 288766ce4d0SZheng Fan 289766ce4d0SZheng Fan SfxBindings* ParaPropertyPanel::GetBindings() 290766ce4d0SZheng Fan { 291766ce4d0SZheng Fan return mpBindings; 292766ce4d0SZheng Fan } 293766ce4d0SZheng Fan 2943cac12cfSAndre Fischer 2953cac12cfSAndre Fischer 296766ce4d0SZheng Fan 297766ce4d0SZheng Fan void ParaPropertyPanel::DataChanged (const DataChangedEvent& rEvent) 298766ce4d0SZheng Fan { 299766ce4d0SZheng Fan (void)rEvent; 300766ce4d0SZheng Fan } 301766ce4d0SZheng Fan 302766ce4d0SZheng Fan ParaPropertyPanel::~ParaPropertyPanel() 303766ce4d0SZheng Fan { 304766ce4d0SZheng Fan delete mpLnSPItem; 305766ce4d0SZheng Fan } 306766ce4d0SZheng Fan 307766ce4d0SZheng Fan void ParaPropertyPanel::ReSize(bool bSize) 308766ce4d0SZheng Fan { 309766ce4d0SZheng Fan if(bSize) 310766ce4d0SZheng Fan { 311766ce4d0SZheng Fan //Paragraph spacing 312766ce4d0SZheng Fan maFTUL->SetPosPixel(POS_FT_PARA_SPACE); 313766ce4d0SZheng Fan maTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC); 314766ce4d0SZheng Fan maTopDist->SetPosPixel(POS_MBX_TOP_DIST); 315766ce4d0SZheng Fan maBottomDist->SetPosPixel(POS_MBX_BOT_DIST); 316766ce4d0SZheng Fan //Indent 317766ce4d0SZheng Fan maFTIndent->SetPosPixel(POS_FT_PARA_INDENT); 318766ce4d0SZheng Fan maTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC); 319766ce4d0SZheng Fan maTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC); 320766ce4d0SZheng Fan maLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST); 321766ce4d0SZheng Fan maRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST); 322766ce4d0SZheng Fan maFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST); 323766ce4d0SZheng Fan //Line spacing 324766ce4d0SZheng Fan maLineSPTbx->SetPosPixel(TBX_LINE_SPACE); 325766ce4d0SZheng Fan //image 326766ce4d0SZheng Fan maFISpace1.SetPosPixel(POS_IMG_SPACE1); 327766ce4d0SZheng Fan maFISpace2.SetPosPixel(POS_IMG_SPACE2); 328766ce4d0SZheng Fan maFIndent1.SetPosPixel(POS_IMG_INDENT1); 329766ce4d0SZheng Fan maFIndent2.SetPosPixel(POS_IMG_INDENT2); 330766ce4d0SZheng Fan maFIndent3.SetPosPixel(POS_IMG_INDENT3); 331766ce4d0SZheng Fan Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT); 332766ce4d0SZheng Fan aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 333766ce4d0SZheng Fan aSize.setWidth(GetOutputSizePixel().Width()); 334766ce4d0SZheng Fan SetSizePixel(aSize); 335766ce4d0SZheng Fan } 336766ce4d0SZheng Fan else 337766ce4d0SZheng Fan { 338766ce4d0SZheng Fan //Paragraph spacing 339766ce4d0SZheng Fan maFTUL->SetPosPixel(POS_FT_PARA_SPACE2); 340766ce4d0SZheng Fan maTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC2); 341766ce4d0SZheng Fan maTopDist->SetPosPixel(POS_MBX_TOP_DIST2); 342766ce4d0SZheng Fan maBottomDist->SetPosPixel(POS_MBX_BOT_DIST2); 343766ce4d0SZheng Fan //Indent 344766ce4d0SZheng Fan maFTIndent->SetPosPixel(POS_FT_PARA_INDENT2); 345766ce4d0SZheng Fan maTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2); 346766ce4d0SZheng Fan maTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2); 347766ce4d0SZheng Fan maLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST2); 348766ce4d0SZheng Fan maRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST2); 349766ce4d0SZheng Fan maFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST2); 350766ce4d0SZheng Fan //Line spacing 351766ce4d0SZheng Fan maLineSPTbx->SetPosPixel(TBX_LINE_SPACE2); 352766ce4d0SZheng Fan //image 353766ce4d0SZheng Fan maFISpace1.SetPosPixel(POS_IMG_SPACE12); 354766ce4d0SZheng Fan maFISpace2.SetPosPixel(POS_IMG_SPACE22); 355766ce4d0SZheng Fan maFIndent1.SetPosPixel(POS_IMG_INDENT12); 356766ce4d0SZheng Fan maFIndent2.SetPosPixel(POS_IMG_INDENT22); 357766ce4d0SZheng Fan maFIndent3.SetPosPixel(POS_IMG_INDENT32); 358766ce4d0SZheng Fan Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT_2); 359766ce4d0SZheng Fan aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 360766ce4d0SZheng Fan aSize.setWidth(GetOutputSizePixel().Width()); 361766ce4d0SZheng Fan SetSizePixel(aSize); 362766ce4d0SZheng Fan } 36337fee4fdSAndre Fischer 36437fee4fdSAndre Fischer if (mxSidebar.is()) 36537fee4fdSAndre Fischer mxSidebar->requestLayout(); 366766ce4d0SZheng Fan } 367766ce4d0SZheng Fan 368766ce4d0SZheng Fan void ParaPropertyPanel::EndSpacingPopupMode (void) 369766ce4d0SZheng Fan { 370766ce4d0SZheng Fan maLineSpacePopup.Hide(); 371766ce4d0SZheng Fan } 372766ce4d0SZheng Fan 373766ce4d0SZheng Fan void ParaPropertyPanel::EndBulletsPopupMode (void) 374766ce4d0SZheng Fan { 3758a9f1ce2SZheng Fan //i122054, Missed following line, for collapse the bullets popup 3768a9f1ce2SZheng Fan maBulletsPopup.Hide(); 377766ce4d0SZheng Fan } 378766ce4d0SZheng Fan 379766ce4d0SZheng Fan void ParaPropertyPanel::EndNumberingPopupMode (void) 380766ce4d0SZheng Fan { 3818a9f1ce2SZheng Fan //i122054, Missed following line, for collapse the numbering popup 3828a9f1ce2SZheng Fan maNumberingPopup.Hide(); 383766ce4d0SZheng Fan } 384766ce4d0SZheng Fan 385766ce4d0SZheng Fan 386766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxAlign() 387766ce4d0SZheng Fan { 3883cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 3893cac12cfSAndre Fischer maAlignToolBox->SetItemImage(TOOLBOX_ITEM1, maLeftAlignControl.GetIcon(bIsHighContrastModeActive)); 3903cac12cfSAndre Fischer maAlignToolBox->SetItemImage(TOOLBOX_ITEM2, maCenterAlignControl.GetIcon(bIsHighContrastModeActive)); 3913cac12cfSAndre Fischer maAlignToolBox->SetItemImage(TOOLBOX_ITEM3, maRightAlignControl.GetIcon(bIsHighContrastModeActive)); 3923cac12cfSAndre Fischer maAlignToolBox->SetItemImage(TOOLBOX_ITEM4, maJustifyAlignControl.GetIcon(bIsHighContrastModeActive)); 3933cac12cfSAndre Fischer 394766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, AlignStyleModifyHdl_Impl ); 395766ce4d0SZheng Fan maAlignToolBox->SetSelectHdl( aLink ); 396766ce4d0SZheng Fan Size aTbxSize (maAlignToolBox->CalcWindowSizePixel()); 397766ce4d0SZheng Fan maAlignToolBox->SetOutputSizePixel( aTbxSize ); 398766ce4d0SZheng Fan } 399766ce4d0SZheng Fan 400766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxVertAlign() 401766ce4d0SZheng Fan { 4023cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 4033cac12cfSAndre Fischer maTBxVertAlign->SetItemImage(IID_VERT_TOP, maVertTop.GetIcon(bIsHighContrastModeActive)); 4043cac12cfSAndre Fischer maTBxVertAlign->SetItemImage(IID_VERT_CENTER, maVertCenter.GetIcon(bIsHighContrastModeActive)); 4053cac12cfSAndre Fischer maTBxVertAlign->SetItemImage(IID_VERT_BOTTOM, maVertBottom.GetIcon(bIsHighContrastModeActive)); 406766ce4d0SZheng Fan maTBxVertAlign->SetSelectHdl(LINK(this,ParaPropertyPanel,VertTbxSelectHandler)); 407766ce4d0SZheng Fan Size aTbxSize (maTBxVertAlign->CalcWindowSizePixel()); 408766ce4d0SZheng Fan maTBxVertAlign->SetOutputSizePixel( aTbxSize ); 409766ce4d0SZheng Fan } 410766ce4d0SZheng Fan 411766ce4d0SZheng Fan 412766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxIndent() 413766ce4d0SZheng Fan { 414766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, ModifyIndentHdl_Impl ); 415766ce4d0SZheng Fan maLeftIndent->SetModifyHdl( aLink ); 416766ce4d0SZheng Fan maRightIndent->SetModifyHdl( aLink ); 417766ce4d0SZheng Fan maFLineIndent->SetModifyHdl( aLink ); 418766ce4d0SZheng Fan 419*5dda62ceSAndre Fischer maLeftIndent->SetAccessibleName(maLeftIndent->GetQuickHelpText()); 420*5dda62ceSAndre Fischer maRightIndent->SetAccessibleName(maRightIndent->GetQuickHelpText()); 421*5dda62ceSAndre Fischer maFLineIndent->SetAccessibleName(maFLineIndent->GetQuickHelpText()); 422*5dda62ceSAndre Fischer 4233cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 4243cac12cfSAndre Fischer 425766ce4d0SZheng Fan if( Application::GetSettings().GetLayoutRTL()) 426766ce4d0SZheng Fan { 4273cac12cfSAndre Fischer maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1, maIncIndentControl.GetIcon(bIsHighContrastModeActive)); 4283cac12cfSAndre Fischer maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2, maDecIndentControl.GetIcon(bIsHighContrastModeActive)); 429766ce4d0SZheng Fan } 430766ce4d0SZheng Fan else 431766ce4d0SZheng Fan { 4323cac12cfSAndre Fischer maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1, maIncIndentControl.GetIcon(bIsHighContrastModeActive)); 4333cac12cfSAndre Fischer maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2, maDecIndentControl.GetIcon(bIsHighContrastModeActive)); 434766ce4d0SZheng Fan } 435766ce4d0SZheng Fan maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM3,maIndHang); 436766ce4d0SZheng Fan aLink = LINK( this, ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl ); 437766ce4d0SZheng Fan maTbxIndent_IncDec->SetSelectHdl(aLink); 438766ce4d0SZheng Fan m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); 439766ce4d0SZheng Fan Size aTbxSize = maTbxIndent_IncDec->CalcWindowSizePixel(); 440766ce4d0SZheng Fan maTbxIndent_IncDec->SetOutputSizePixel( aTbxSize ); 441766ce4d0SZheng Fan 442766ce4d0SZheng Fan if( Application::GetSettings().GetLayoutRTL()) 443766ce4d0SZheng Fan { 4443cac12cfSAndre Fischer maTbxProDemote->SetItemImage(TOOLBOX_ITEM1, maOutLineLeftControl.GetIcon(bIsHighContrastModeActive)); 4453cac12cfSAndre Fischer maTbxProDemote->SetItemImage(TOOLBOX_ITEM2, maOutLineRightControl.GetIcon(bIsHighContrastModeActive)); 446766ce4d0SZheng Fan } 447766ce4d0SZheng Fan else 448766ce4d0SZheng Fan { 4493cac12cfSAndre Fischer maTbxProDemote->SetItemImage(TOOLBOX_ITEM1, maOutLineLeftControl.GetIcon(bIsHighContrastModeActive)); 4503cac12cfSAndre Fischer maTbxProDemote->SetItemImage(TOOLBOX_ITEM2, maOutLineRightControl.GetIcon(bIsHighContrastModeActive)); 451766ce4d0SZheng Fan } 452766ce4d0SZheng Fan maTbxProDemote->SetItemImage(TOOLBOX_ITEM3,maIndHang); 453766ce4d0SZheng Fan aLink = LINK( this, ParaPropertyPanel, ClickProDemote_Hdl_Impl ); 454766ce4d0SZheng Fan maTbxProDemote->SetSelectHdl(aLink); 455766ce4d0SZheng Fan m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); 456766ce4d0SZheng Fan aTbxSize = maTbxProDemote->CalcWindowSizePixel(); 457766ce4d0SZheng Fan maTbxProDemote->SetOutputSizePixel( aTbxSize ); 458766ce4d0SZheng Fan } 459766ce4d0SZheng Fan 460766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxBGColor() 461766ce4d0SZheng Fan { 462766ce4d0SZheng Fan mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, TBI_BACK_COLOR, maTBxBackColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW )); 463766ce4d0SZheng Fan 464766ce4d0SZheng Fan maTBxBackColor->SetItemImage(TBI_BACK_COLOR, GetDisplayBackground().GetColor().IsDark()? maImgBackColorHigh : maImgBackColor); 465766ce4d0SZheng Fan maTBxBackColor->SetItemBits( TBI_BACK_COLOR, maTBxBackColor->GetItemBits( TBI_BACK_COLOR ) | TIB_DROPDOWNONLY ); 466766ce4d0SZheng Fan 467766ce4d0SZheng Fan Link aLink = LINK(this, ParaPropertyPanel, ToolBoxBackColorDDHandler); 468766ce4d0SZheng Fan maTBxBackColor->SetDropdownClickHdl ( aLink ); 469766ce4d0SZheng Fan maTBxBackColor->SetSelectHdl ( aLink ); 470766ce4d0SZheng Fan Size aTbxSize (maTBxBackColor->CalcWindowSizePixel()); 471766ce4d0SZheng Fan maTBxBackColor->SetOutputSizePixel( aTbxSize ); 472766ce4d0SZheng Fan } 473766ce4d0SZheng Fan 474766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxBulletsNumbering() 475766ce4d0SZheng Fan { 4763cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 4773cac12cfSAndre Fischer maTBxNumBullet->SetItemImage(IID_BULLET, maBulletOnOff.GetIcon(bIsHighContrastModeActive)); 4783cac12cfSAndre Fischer maTBxNumBullet->SetItemImage(IID_NUMBER, maNumberOnOff.GetIcon(bIsHighContrastModeActive)); 479766ce4d0SZheng Fan 480766ce4d0SZheng Fan maTBxNumBullet->SetDropdownClickHdl(LINK(this,ParaPropertyPanel,NumBTbxDDHandler)); 481766ce4d0SZheng Fan maTBxNumBullet->SetSelectHdl(LINK(this,ParaPropertyPanel,NumBTbxSelectHandler)); 482766ce4d0SZheng Fan Size aTbxSize (maTBxNumBullet->CalcWindowSizePixel()); 483766ce4d0SZheng Fan maTBxNumBullet->SetOutputSizePixel( aTbxSize ); 484766ce4d0SZheng Fan } 485766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxSpacing() 486766ce4d0SZheng Fan { 487766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, ULSpaceHdl_Impl ); 488766ce4d0SZheng Fan maTopDist->SetModifyHdl(aLink); 489766ce4d0SZheng Fan maBottomDist->SetModifyHdl( aLink ); 490766ce4d0SZheng Fan 491*5dda62ceSAndre Fischer mpTopDist->SetAccessibleName(mpTopDist->GetQuickHelpText()); 492*5dda62ceSAndre Fischer mpBottomDist->SetAccessibleName(mpBottomDist->GetQuickHelpText()); 493*5dda62ceSAndre Fischer 4943cac12cfSAndre Fischer maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM1, maParInc); 4953cac12cfSAndre Fischer maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM2, maParDec); 496766ce4d0SZheng Fan aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl ); 497766ce4d0SZheng Fan maTbxUL_IncDec->SetSelectHdl(aLink); 498766ce4d0SZheng Fan m_eULSpaceUnit = maULSpaceControl.GetCoreMetric(); 499766ce4d0SZheng Fan Size aTbxSize = maTbxUL_IncDec->CalcWindowSizePixel(); 500766ce4d0SZheng Fan maTbxUL_IncDec->SetOutputSizePixel( aTbxSize ); 501766ce4d0SZheng Fan } 502766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxLineSpacing() 503766ce4d0SZheng Fan { 504766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, ClickLineSPDropDownHdl_Impl ); 505766ce4d0SZheng Fan maLineSPTbx->SetDropdownClickHdl( aLink ); 506766ce4d0SZheng Fan maLineSPTbx->SetSelectHdl( aLink ); //support keyinput "ENTER" 507766ce4d0SZheng Fan maLineSPTbx->SetItemBits( TOOLBOX_ITEM1, maLineSPTbx->GetItemBits( TOOLBOX_ITEM1 ) | TIB_DROPDOWNONLY ); 508766ce4d0SZheng Fan maLineSPTbx->SetItemImage(TOOLBOX_ITEM1,maSpace3); 509766ce4d0SZheng Fan Size aTbxSize = maLineSPTbx->CalcWindowSizePixel(); 510766ce4d0SZheng Fan maLineSPTbx->SetOutputSizePixel( aTbxSize ); 511766ce4d0SZheng Fan } 512766ce4d0SZheng Fan 513766ce4d0SZheng Fan void ParaPropertyPanel::initial() 514766ce4d0SZheng Fan { 51537fee4fdSAndre Fischer maFTUL->SetBackground(Wallpaper()); 51637fee4fdSAndre Fischer maFTIndent->SetBackground(Wallpaper()); 51737fee4fdSAndre Fischer maFISpace1.SetBackground(Wallpaper()); 51837fee4fdSAndre Fischer maFISpace2.SetBackground(Wallpaper()); 51937fee4fdSAndre Fischer maFIndent1.SetBackground(Wallpaper()); 52037fee4fdSAndre Fischer maFIndent2.SetBackground(Wallpaper()); 52137fee4fdSAndre Fischer maFIndent3.SetBackground(Wallpaper()); 52237fee4fdSAndre Fischer 52337fee4fdSAndre Fischer maFISpace1.SetImage(maSpace1); 524766ce4d0SZheng Fan maFISpace2.SetImage(maSpace2); 525766ce4d0SZheng Fan maFIndent1.SetImage(maIndent3); 526766ce4d0SZheng Fan maFIndent2.SetImage(maIndent2); 527766ce4d0SZheng Fan maFIndent3.SetImage(maIndent1); 528766ce4d0SZheng Fan 529766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_LEFT,sal_True,sal_False); 530766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_CENTER,sal_True,sal_False); 531766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_RIGHT,sal_True,sal_False); 532766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_BLOCK,sal_True,sal_False); 533766ce4d0SZheng Fan 534766ce4d0SZheng Fan //toolbox 535766ce4d0SZheng Fan InitToolBoxAlign(); 536766ce4d0SZheng Fan InitToolBoxVertAlign(); 537766ce4d0SZheng Fan InitToolBoxIndent(); 538766ce4d0SZheng Fan InitToolBoxBGColor(); 539766ce4d0SZheng Fan InitToolBoxBulletsNumbering(); 540766ce4d0SZheng Fan InitToolBoxSpacing(); 541766ce4d0SZheng Fan InitToolBoxLineSpacing(); 542766ce4d0SZheng Fan 543766ce4d0SZheng Fan #ifdef HAS_IA2 544766ce4d0SZheng Fan maAlignToolBox->SetAccRelationLabeledBy(&maAlignToolBox); 545766ce4d0SZheng Fan maTBxVertAlign->SetMpSubEditAccLableBy(&maTBxVertAlign); 546766ce4d0SZheng Fan maTBxNumBullet->SetAccRelationLabeledBy(&maTBxNumBullet); 547766ce4d0SZheng Fan maTBxBackColor->SetMpSubEditAccLableBy(&maTBxBackColor); 548766ce4d0SZheng Fan maFTUL->SetAccRelationLabeledBy(&maFTUL); 549766ce4d0SZheng Fan maTbxUL_IncDec->SetAccRelationLabeledBy(&maTbxUL_IncDec); 550766ce4d0SZheng Fan maTopDist->SetAccRelationLabeledBy(&maTopDist); 551766ce4d0SZheng Fan maBottomDist->SetAccRelationLabeledBy(&maBottomDist); 552766ce4d0SZheng Fan maLineSPTbx->SetAccRelationLabeledBy(&maLineSPTbx); 553766ce4d0SZheng Fan maFTIndent->SetAccRelationLabeledBy(&maFTIndent); 554766ce4d0SZheng Fan maTbxIndent_IncDec->SetAccRelationLabeledBy(&maTbxIndent_IncDec); 555766ce4d0SZheng Fan maTbxProDemote->SetAccRelationLabeledBy(&maTbxProDemote); 556766ce4d0SZheng Fan maLeftIndent->SetAccRelationLabeledBy(&maLeftIndent); 557766ce4d0SZheng Fan maRightIndent->SetAccRelationLabeledBy(&maRightIndent); 558766ce4d0SZheng Fan maFLineIndent->SetAccRelationLabeledBy(&maFLineIndent); 559766ce4d0SZheng Fan mpColorUpdater->SetAccRelationLabeledBy(&mpColorUpdater); 560766ce4d0SZheng Fan #endif 561766ce4d0SZheng Fan } 562766ce4d0SZheng Fan 563766ce4d0SZheng Fan void ParaPropertyPanel::InitImageList(::boost::scoped_ptr<ToolBox>& rTbx, ImageList& rImglst, ImageList& rImgHlst) 564766ce4d0SZheng Fan { 565766ce4d0SZheng Fan sal_Bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); 566766ce4d0SZheng Fan 567766ce4d0SZheng Fan ImageList& rImgLst = bHighContrast ? rImgHlst : rImglst; 568766ce4d0SZheng Fan 569766ce4d0SZheng Fan sal_uInt16 nCount = rTbx->GetItemCount(); 570766ce4d0SZheng Fan for (sal_uInt16 i = 0; i < nCount; i++) 571766ce4d0SZheng Fan { 572766ce4d0SZheng Fan sal_uInt16 nId = rTbx->GetItemId(i); 573766ce4d0SZheng Fan rTbx->SetItemImage( nId, rImgLst.GetImage( nId ) ); 574766ce4d0SZheng Fan } 575766ce4d0SZheng Fan } 576766ce4d0SZheng Fan 577766ce4d0SZheng Fan //===========================for Numbering & Bullet================================================ 578766ce4d0SZheng Fan 579766ce4d0SZheng Fan 580766ce4d0SZheng Fan 581766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, NumBTbxDDHandler, ToolBox*, pToolBox) 582766ce4d0SZheng Fan { 583766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 584766ce4d0SZheng Fan 585766ce4d0SZheng Fan EndTracking(); 586766ce4d0SZheng Fan pToolBox->SetItemDown( nId, sal_True ); 587766ce4d0SZheng Fan 588766ce4d0SZheng Fan if (nId == 1) 589766ce4d0SZheng Fan { 590766ce4d0SZheng Fan maBulletsPopup.UpdateValueSet(); 591766ce4d0SZheng Fan maBulletsPopup.Show(*pToolBox); 592766ce4d0SZheng Fan } 593766ce4d0SZheng Fan else if (nId == 2) 594766ce4d0SZheng Fan { 595766ce4d0SZheng Fan maNumberingPopup.UpdateValueSet(); 596766ce4d0SZheng Fan maNumberingPopup.Show(*pToolBox); 597766ce4d0SZheng Fan } 598766ce4d0SZheng Fan pToolBox->SetItemDown( nId, sal_False ); 599766ce4d0SZheng Fan return 0; 600766ce4d0SZheng Fan } 601766ce4d0SZheng Fan 602766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, NumBTbxSelectHandler, ToolBox*, pToolBox) 603766ce4d0SZheng Fan { 604766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 605766ce4d0SZheng Fan sal_uInt16 nSID = SID_TABLE_VERT_NONE; 606766ce4d0SZheng Fan 607766ce4d0SZheng Fan EndTracking(); 608766ce4d0SZheng Fan if (nId == 1) 609766ce4d0SZheng Fan { 610766ce4d0SZheng Fan nSID = FN_NUM_BULLET_ON; 611766ce4d0SZheng Fan } 612766ce4d0SZheng Fan else if ( nId == 2) 613766ce4d0SZheng Fan { 614766ce4d0SZheng Fan nSID = FN_NUM_NUMBERING_ON; 615766ce4d0SZheng Fan } 616766ce4d0SZheng Fan SfxBoolItem aBoolItem(nSID, sal_True); 617766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(nSID, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 618766ce4d0SZheng Fan 619766ce4d0SZheng Fan return 0; 620766ce4d0SZheng Fan } 621766ce4d0SZheng Fan 622766ce4d0SZheng Fan 623766ce4d0SZheng Fan //================================for Vertical Alignment======================================== 624766ce4d0SZheng Fan 625766ce4d0SZheng Fan 626766ce4d0SZheng Fan 627766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, VertTbxSelectHandler, ToolBox*, pToolBox) 628766ce4d0SZheng Fan { 629766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 630766ce4d0SZheng Fan sal_uInt16 nSID = SID_TABLE_VERT_NONE; 631766ce4d0SZheng Fan EndTracking(); 632766ce4d0SZheng Fan if (nId == 1) 633766ce4d0SZheng Fan { 634766ce4d0SZheng Fan nSID = SID_TABLE_VERT_NONE; 6353cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_CHECK); 6363cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 6373cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 638766ce4d0SZheng Fan } 639766ce4d0SZheng Fan else if (nId == 2) 640766ce4d0SZheng Fan { 641766ce4d0SZheng Fan nSID = SID_TABLE_VERT_CENTER; 6423cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 6433cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_CHECK); 6443cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 645766ce4d0SZheng Fan } 646766ce4d0SZheng Fan else if (nId == 3) 647766ce4d0SZheng Fan { 648766ce4d0SZheng Fan nSID = SID_TABLE_VERT_BOTTOM; 6493cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 6503cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 6513cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_CHECK); 652766ce4d0SZheng Fan } 653766ce4d0SZheng Fan SfxBoolItem aBoolItem(nSID, sal_True); 654766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(nSID, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 655766ce4d0SZheng Fan 656766ce4d0SZheng Fan return 0; 657766ce4d0SZheng Fan } 658766ce4d0SZheng Fan 659766ce4d0SZheng Fan void ParaPropertyPanel::VertStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) 660766ce4d0SZheng Fan { 661766ce4d0SZheng Fan if (eState < SFX_ITEM_DONTCARE) 662766ce4d0SZheng Fan { 6633cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 6643cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 6653cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 6663cac12cfSAndre Fischer maTBxVertAlign->EnableItem(IID_VERT_TOP, sal_False); 6673cac12cfSAndre Fischer maTBxVertAlign->EnableItem(IID_VERT_CENTER, sal_False); 6683cac12cfSAndre Fischer maTBxVertAlign->EnableItem(IID_VERT_BOTTOM, sal_False); 669766ce4d0SZheng Fan } 670766ce4d0SZheng Fan else 671766ce4d0SZheng Fan { 6723cac12cfSAndre Fischer maTBxVertAlign->EnableItem(IID_VERT_TOP, sal_True); 6733cac12cfSAndre Fischer maTBxVertAlign->EnableItem(IID_VERT_CENTER, sal_True); 6743cac12cfSAndre Fischer maTBxVertAlign->EnableItem(IID_VERT_BOTTOM, sal_True); 675766ce4d0SZheng Fan if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem))) 676766ce4d0SZheng Fan { 677766ce4d0SZheng Fan const SfxBoolItem* pItem= (const SfxBoolItem*)pState; 678766ce4d0SZheng Fan sal_Bool aBool = (sal_Bool)pItem->GetValue(); 679766ce4d0SZheng Fan 680766ce4d0SZheng Fan if (aBool) 681766ce4d0SZheng Fan { 682766ce4d0SZheng Fan if (nSID == SID_TABLE_VERT_NONE) 683766ce4d0SZheng Fan { 6843cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_CHECK); 6853cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 6863cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 687766ce4d0SZheng Fan } 688766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_CENTER) 689766ce4d0SZheng Fan { 6903cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 6913cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_CHECK); 6923cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 693766ce4d0SZheng Fan } 694766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_BOTTOM) 695766ce4d0SZheng Fan { 6963cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 6973cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 6983cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_CHECK); 699766ce4d0SZheng Fan } 700766ce4d0SZheng Fan } 701766ce4d0SZheng Fan else 702766ce4d0SZheng Fan { 703766ce4d0SZheng Fan if (nSID == SID_TABLE_VERT_NONE) 704766ce4d0SZheng Fan { 7053cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 706766ce4d0SZheng Fan } 707766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_CENTER) 708766ce4d0SZheng Fan { 7093cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 710766ce4d0SZheng Fan } 711766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_BOTTOM) 712766ce4d0SZheng Fan { 7133cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 714766ce4d0SZheng Fan } 715766ce4d0SZheng Fan } 716766ce4d0SZheng Fan } 717766ce4d0SZheng Fan else 718766ce4d0SZheng Fan { 7193cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 7203cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 7213cac12cfSAndre Fischer maTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 722766ce4d0SZheng Fan } 723766ce4d0SZheng Fan } 724766ce4d0SZheng Fan } 725766ce4d0SZheng Fan //==================================for Background color===================== 726766ce4d0SZheng Fan 727766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ToolBoxBackColorDDHandler,ToolBox*, pToolBox) 728766ce4d0SZheng Fan { 729766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 730766ce4d0SZheng Fan OSL_ASSERT(nId == TBI_BACK_COLOR); 731766ce4d0SZheng Fan if(nId == TBI_BACK_COLOR) 732766ce4d0SZheng Fan { 733766ce4d0SZheng Fan pToolBox->SetItemDown( nId, true ); 734766ce4d0SZheng Fan maBGColorPopup.Show(*pToolBox); 735766ce4d0SZheng Fan maBGColorPopup.SetCurrentColor(maColor, mbColorAvailable); 736766ce4d0SZheng Fan } 737766ce4d0SZheng Fan return 0; 738766ce4d0SZheng Fan } 739766ce4d0SZheng Fan 740766ce4d0SZheng Fan IMPL_LINK( ParaPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG ) 741766ce4d0SZheng Fan { 742766ce4d0SZheng Fan return 0; 743766ce4d0SZheng Fan } 744766ce4d0SZheng Fan 745766ce4d0SZheng Fan void ParaPropertyPanel::ShowMenu (void) 746766ce4d0SZheng Fan { 747766ce4d0SZheng Fan if (mpBindings != NULL) 748766ce4d0SZheng Fan { 749766ce4d0SZheng Fan SfxDispatcher* pDispatcher = mpBindings->GetDispatcher(); 750766ce4d0SZheng Fan if (pDispatcher != NULL) 751766ce4d0SZheng Fan pDispatcher->Execute(SID_PARA_DLG, SFX_CALLMODE_ASYNCHRON); 752766ce4d0SZheng Fan } 753766ce4d0SZheng Fan } 754766ce4d0SZheng Fan 7551715803bSPavel Janík void ParaPropertyPanel::ParaBKGStateChanged(sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState) 756766ce4d0SZheng Fan { 757445e496eSZheng Fan if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxColorItem)) 758766ce4d0SZheng Fan { 759445e496eSZheng Fan const SvxColorItem* pItem = (const SvxColorItem*)pState; 760445e496eSZheng Fan maColor = pItem->GetValue(); 761766ce4d0SZheng Fan mbColorAvailable = sal_True; 762766ce4d0SZheng Fan mpColorUpdater->Update(maColor); 763766ce4d0SZheng Fan } 764766ce4d0SZheng Fan else 765766ce4d0SZheng Fan { 766766ce4d0SZheng Fan mbColorAvailable = sal_False; 767766ce4d0SZheng Fan maColor.SetColor(COL_AUTO); 768766ce4d0SZheng Fan mpColorUpdater->Update(maColor); 769766ce4d0SZheng Fan } 770766ce4d0SZheng Fan } 771766ce4d0SZheng Fan 772766ce4d0SZheng Fan void ParaPropertyPanel::SetBGColor ( 7731715803bSPavel Janík const String& /* rsColorName */, 774766ce4d0SZheng Fan const Color aColor) 775766ce4d0SZheng Fan { 776766ce4d0SZheng Fan SvxColorItem aColorItem(aColor, SID_BACKGROUND_COLOR); 777766ce4d0SZheng Fan mpBindings->GetDispatcher()->Execute(SID_BACKGROUND_COLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L); 778766ce4d0SZheng Fan maColor = aColor; 779766ce4d0SZheng Fan } 780766ce4d0SZheng Fan 781766ce4d0SZheng Fan //==================================for Paragraph Alignment===================== 782766ce4d0SZheng Fan IMPL_LINK( ParaPropertyPanel, AlignStyleModifyHdl_Impl, ToolBox*, pBox ) 783766ce4d0SZheng Fan { 784766ce4d0SZheng Fan switch (pBox->GetCurItemId()) 785766ce4d0SZheng Fan { 786766ce4d0SZheng Fan case BT_SUBSTLEFT: 787766ce4d0SZheng Fan { 788766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK); 789766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 790766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 791766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 792766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_LEFT, sal_True ); 793766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_LEFT, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 794766ce4d0SZheng Fan } 795766ce4d0SZheng Fan break; 796766ce4d0SZheng Fan case BT_SUBSTCENTER: 797766ce4d0SZheng Fan { 798766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK); 799766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 800766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 801766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 802766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_CENTER, sal_True ); 803766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_CENTER, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 804766ce4d0SZheng Fan } 805766ce4d0SZheng Fan break; 806766ce4d0SZheng Fan case BT_SUBSTRIGHT: 807766ce4d0SZheng Fan { 808766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK); 809766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 810766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 811766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 812766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, sal_True ); 813766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_RIGHT, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 814766ce4d0SZheng Fan } 815766ce4d0SZheng Fan break; 816766ce4d0SZheng Fan case BT_SUBSTJUSTIFY: 817766ce4d0SZheng Fan { 818766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK); 819766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 820766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 821766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 822766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, sal_True ); 823766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_BLOCK, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 824766ce4d0SZheng Fan } 825766ce4d0SZheng Fan break; 826766ce4d0SZheng Fan } 827766ce4d0SZheng Fan 828766ce4d0SZheng Fan return 0; 829766ce4d0SZheng Fan } 830766ce4d0SZheng Fan //==================================for Paragraph Indent===================== 8311715803bSPavel Janík IMPL_LINK( ParaPropertyPanel, ModifyIndentHdl_Impl, SvxRelativeField*, /* pBox */ ) 832766ce4d0SZheng Fan { 833512ec161SZheng Fan SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 834766ce4d0SZheng Fan aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) ); 835766ce4d0SZheng Fan aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) ); 836766ce4d0SZheng Fan aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) ); 837766ce4d0SZheng Fan 838766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 839512ec161SZheng Fan SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 840766ce4d0SZheng Fan return 0; 841766ce4d0SZheng Fan } 842766ce4d0SZheng Fan 843766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl) 844766ce4d0SZheng Fan { 8458eda4adfSOliver-Rainer Wittmann switch (pControl->GetCurItemId()) 8468eda4adfSOliver-Rainer Wittmann { 8478eda4adfSOliver-Rainer Wittmann case INDENT_INCREMENT: 8488eda4adfSOliver-Rainer Wittmann { 8498eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 8508eda4adfSOliver-Rainer Wittmann { 8518eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 8528eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 8538eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 8548eda4adfSOliver-Rainer Wittmann { 8558eda4adfSOliver-Rainer Wittmann SfxBoolItem aMargin( SID_INC_INDENT, sal_True ); 8568eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 8578eda4adfSOliver-Rainer Wittmann SID_INC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L); 8588eda4adfSOliver-Rainer Wittmann } 8598eda4adfSOliver-Rainer Wittmann break; 8608eda4adfSOliver-Rainer Wittmann default: 8618eda4adfSOliver-Rainer Wittmann { 8628eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 8638eda4adfSOliver-Rainer Wittmann 8648eda4adfSOliver-Rainer Wittmann maTxtLeft += INDENT_STEP; 8658eda4adfSOliver-Rainer Wittmann sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 8668eda4adfSOliver-Rainer Wittmann nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 8678eda4adfSOliver-Rainer Wittmann aMargin.SetTxtLeft( (const long)nVal ); 8688eda4adfSOliver-Rainer Wittmann aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) ); 8698eda4adfSOliver-Rainer Wittmann aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) ); 8708eda4adfSOliver-Rainer Wittmann 8718eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 8728eda4adfSOliver-Rainer Wittmann SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 8738eda4adfSOliver-Rainer Wittmann } 8748eda4adfSOliver-Rainer Wittmann } 8758eda4adfSOliver-Rainer Wittmann } 8768eda4adfSOliver-Rainer Wittmann break; 8778eda4adfSOliver-Rainer Wittmann case INDENT_DECREMENT: 8788eda4adfSOliver-Rainer Wittmann { 8798eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 8808eda4adfSOliver-Rainer Wittmann { 8818eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 8828eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 8838eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 8848eda4adfSOliver-Rainer Wittmann { 8858eda4adfSOliver-Rainer Wittmann SfxBoolItem aMargin( SID_DEC_INDENT, sal_True ); 8868eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 8878eda4adfSOliver-Rainer Wittmann SID_DEC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L); 8888eda4adfSOliver-Rainer Wittmann } 8898eda4adfSOliver-Rainer Wittmann break; 8908eda4adfSOliver-Rainer Wittmann default: 8918eda4adfSOliver-Rainer Wittmann { 8928eda4adfSOliver-Rainer Wittmann if((maTxtLeft - INDENT_STEP) < 0) 8938eda4adfSOliver-Rainer Wittmann maTxtLeft = DEFAULT_VALUE; 8948eda4adfSOliver-Rainer Wittmann else 8958eda4adfSOliver-Rainer Wittmann maTxtLeft -= INDENT_STEP; 8968eda4adfSOliver-Rainer Wittmann 8978eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 8988eda4adfSOliver-Rainer Wittmann 8998eda4adfSOliver-Rainer Wittmann sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 9008eda4adfSOliver-Rainer Wittmann nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 9018eda4adfSOliver-Rainer Wittmann 9028eda4adfSOliver-Rainer Wittmann aMargin.SetTxtLeft( (const long)nVal ); 9038eda4adfSOliver-Rainer Wittmann aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) ); 9048eda4adfSOliver-Rainer Wittmann aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) ); 9058eda4adfSOliver-Rainer Wittmann 9068eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 9078eda4adfSOliver-Rainer Wittmann SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 9088eda4adfSOliver-Rainer Wittmann } 9098eda4adfSOliver-Rainer Wittmann } 9108eda4adfSOliver-Rainer Wittmann } 9118eda4adfSOliver-Rainer Wittmann break; 9128eda4adfSOliver-Rainer Wittmann case ID_HANGING_INDENT: 9138eda4adfSOliver-Rainer Wittmann { 9148eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 9158eda4adfSOliver-Rainer Wittmann aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) ); 9168eda4adfSOliver-Rainer Wittmann aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) ); 9178eda4adfSOliver-Rainer Wittmann aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ))*(-1) ); 918766ce4d0SZheng Fan 9198eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 9208eda4adfSOliver-Rainer Wittmann SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 9218eda4adfSOliver-Rainer Wittmann } 9228eda4adfSOliver-Rainer Wittmann break; 9238eda4adfSOliver-Rainer Wittmann } 9248eda4adfSOliver-Rainer Wittmann return( 0L ); 925766ce4d0SZheng Fan } 926766ce4d0SZheng Fan 927766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ClickProDemote_Hdl_Impl, ToolBox *, pControl) 928766ce4d0SZheng Fan { 929395b75f9SOliver-Rainer Wittmann switch (pControl->GetCurItemId()) 930395b75f9SOliver-Rainer Wittmann { 931395b75f9SOliver-Rainer Wittmann case BT_TBX_INDENT_PROMOTE: 932395b75f9SOliver-Rainer Wittmann { 933395b75f9SOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( SID_OUTLINE_RIGHT, SFX_CALLMODE_RECORD ); 934395b75f9SOliver-Rainer Wittmann } 935395b75f9SOliver-Rainer Wittmann break; 936395b75f9SOliver-Rainer Wittmann case BT_TBX_INDENT_DEMOTE: 937395b75f9SOliver-Rainer Wittmann { 938395b75f9SOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( SID_OUTLINE_LEFT, SFX_CALLMODE_RECORD ); 939395b75f9SOliver-Rainer Wittmann } 940395b75f9SOliver-Rainer Wittmann break; 941395b75f9SOliver-Rainer Wittmann case SD_HANGING_INDENT: 942395b75f9SOliver-Rainer Wittmann { 943395b75f9SOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 944395b75f9SOliver-Rainer Wittmann aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) ); 945395b75f9SOliver-Rainer Wittmann aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) ); 946395b75f9SOliver-Rainer Wittmann aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ))*(-1) ); 947395b75f9SOliver-Rainer Wittmann 948395b75f9SOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 949395b75f9SOliver-Rainer Wittmann } 950395b75f9SOliver-Rainer Wittmann break; 951395b75f9SOliver-Rainer Wittmann } 952395b75f9SOliver-Rainer Wittmann return( 0L ); 953766ce4d0SZheng Fan } 954766ce4d0SZheng Fan //==================================for Paragraph Line Spacing===================== 955766ce4d0SZheng Fan 956766ce4d0SZheng Fan IMPL_LINK( ParaPropertyPanel, ClickLineSPDropDownHdl_Impl, ToolBox*, pBox ) 957766ce4d0SZheng Fan { 958766ce4d0SZheng Fan 959766ce4d0SZheng Fan const sal_uInt16 nId = pBox->GetCurItemId(); 960766ce4d0SZheng Fan OSL_ASSERT(nId == TOOLBOX_ITEM1); 961766ce4d0SZheng Fan if(nId == TOOLBOX_ITEM1) 962766ce4d0SZheng Fan { 963766ce4d0SZheng Fan pBox->SetItemDown( nId, true ); 964766ce4d0SZheng Fan maLineSpacePopup.Rearrange(meLnSpState,m_eMetricUnit,mpLnSPItem,maContext); 965766ce4d0SZheng Fan maLineSpacePopup.Show(*pBox); 966766ce4d0SZheng Fan 967766ce4d0SZheng Fan } 968766ce4d0SZheng Fan return (0L); 969766ce4d0SZheng Fan } 970766ce4d0SZheng Fan 971766ce4d0SZheng Fan //==================================for Paragraph Spacing===================== 9721715803bSPavel Janík IMPL_LINK( ParaPropertyPanel, ULSpaceHdl_Impl, SvxRelativeField*, /* pBox */) 973766ce4d0SZheng Fan { 974512ec161SZheng Fan SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); 975766ce4d0SZheng Fan aMargin.SetUpper( (sal_uInt16)GetCoreValue( *maTopDist.get(), m_eULSpaceUnit ) ); 976766ce4d0SZheng Fan aMargin.SetLower( (sal_uInt16)GetCoreValue( *maBottomDist.get(), m_eULSpaceUnit ) ); 977766ce4d0SZheng Fan 978766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 979512ec161SZheng Fan SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 980766ce4d0SZheng Fan return 0L; 981766ce4d0SZheng Fan } 982766ce4d0SZheng Fan 983766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl) 984766ce4d0SZheng Fan { 985766ce4d0SZheng Fan switch (pControl->GetCurItemId()) 986766ce4d0SZheng Fan { 987766ce4d0SZheng Fan case UL_INCREMENT: 988766ce4d0SZheng Fan { 989512ec161SZheng Fan SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); 990766ce4d0SZheng Fan 991766ce4d0SZheng Fan maUpper += UL_STEP; 992766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 993766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 994766ce4d0SZheng Fan aMargin.SetUpper( (const sal_uInt16)nVal ); 995766ce4d0SZheng Fan 996766ce4d0SZheng Fan maLower += UL_STEP; 997766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 998766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 999766ce4d0SZheng Fan aMargin.SetLower( (const sal_uInt16)nVal ); 1000766ce4d0SZheng Fan 1001766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 1002512ec161SZheng Fan SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 1003766ce4d0SZheng Fan } 1004766ce4d0SZheng Fan break; 1005766ce4d0SZheng Fan case UL_DECREMENT: 1006766ce4d0SZheng Fan { 1007512ec161SZheng Fan SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); 1008766ce4d0SZheng Fan 1009766ce4d0SZheng Fan if( maUpper >= UL_STEP ) 1010766ce4d0SZheng Fan { 1011766ce4d0SZheng Fan maUpper -= UL_STEP; 1012766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1013766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 1014766ce4d0SZheng Fan aMargin.SetUpper( (const sal_uInt16)nVal ); 1015766ce4d0SZheng Fan } 1016766ce4d0SZheng Fan else 1017766ce4d0SZheng Fan aMargin.SetUpper( DEFAULT_VALUE ); 1018766ce4d0SZheng Fan if( maLower >= UL_STEP ) 1019766ce4d0SZheng Fan { 1020766ce4d0SZheng Fan maLower -= UL_STEP; 1021766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1022766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 1023766ce4d0SZheng Fan aMargin.SetLower( (const sal_uInt16)nVal ); 1024766ce4d0SZheng Fan } 1025766ce4d0SZheng Fan else 1026766ce4d0SZheng Fan aMargin.SetLower( DEFAULT_VALUE ); 1027766ce4d0SZheng Fan 1028766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 1029512ec161SZheng Fan SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 1030766ce4d0SZheng Fan } 1031766ce4d0SZheng Fan break; 1032766ce4d0SZheng Fan } 1033766ce4d0SZheng Fan return( 0L ); 1034766ce4d0SZheng Fan } 1035766ce4d0SZheng Fan 1036766ce4d0SZheng Fan //==================================for Paragraph State change===================== 103745da7d5eSAndre Fischer void ParaPropertyPanel::NotifyItemUpdate( 103845da7d5eSAndre Fischer sal_uInt16 nSID, 103945da7d5eSAndre Fischer SfxItemState eState, 104045da7d5eSAndre Fischer const SfxPoolItem* pState, 104145da7d5eSAndre Fischer const bool bIsEnabled) 104245da7d5eSAndre Fischer { 104345da7d5eSAndre Fischer (void)bIsEnabled; 1044766ce4d0SZheng Fan 1045af89ca6eSOliver-Rainer Wittmann switch (nSID) 1046af89ca6eSOliver-Rainer Wittmann { 1047af89ca6eSOliver-Rainer Wittmann case SID_ATTR_METRIC: 1048af89ca6eSOliver-Rainer Wittmann { 1049af89ca6eSOliver-Rainer Wittmann m_eMetricUnit = GetCurrentUnit(eState,pState); 1050af89ca6eSOliver-Rainer Wittmann if( m_eMetricUnit!=m_last_eMetricUnit ) 1051af89ca6eSOliver-Rainer Wittmann { 1052af89ca6eSOliver-Rainer Wittmann SetFieldUnit( *maLeftIndent.get(), m_eMetricUnit ); 1053af89ca6eSOliver-Rainer Wittmann SetFieldUnit( *maRightIndent.get(), m_eMetricUnit ); 1054af89ca6eSOliver-Rainer Wittmann SetFieldUnit( *maFLineIndent.get(), m_eMetricUnit ); 1055af89ca6eSOliver-Rainer Wittmann SetFieldUnit( *maTopDist.get(), m_eMetricUnit ); 1056af89ca6eSOliver-Rainer Wittmann SetFieldUnit( *maBottomDist.get(), m_eMetricUnit ); 1057af89ca6eSOliver-Rainer Wittmann } 1058af89ca6eSOliver-Rainer Wittmann m_last_eMetricUnit = m_eMetricUnit; 1059af89ca6eSOliver-Rainer Wittmann } 1060af89ca6eSOliver-Rainer Wittmann break; 1061766ce4d0SZheng Fan 1062af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_LRSPACE: 1063af89ca6eSOliver-Rainer Wittmann StateChangedIndentImpl( nSID, eState, pState ); 1064af89ca6eSOliver-Rainer Wittmann break; 1065766ce4d0SZheng Fan 1066af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_LINESPACE: 1067af89ca6eSOliver-Rainer Wittmann StateChangedLnSPImpl( nSID, eState, pState ); 1068af89ca6eSOliver-Rainer Wittmann break; 1069766ce4d0SZheng Fan 1070af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ULSPACE: 1071af89ca6eSOliver-Rainer Wittmann StateChangedULImpl( nSID, eState, pState ); 1072af89ca6eSOliver-Rainer Wittmann break; 1073766ce4d0SZheng Fan 1074af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_LEFT: 1075af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_CENTER: 1076af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_RIGHT: 1077af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_BLOCK: 1078af89ca6eSOliver-Rainer Wittmann StateChangedAlignmentImpl( nSID, eState, pState ); 1079af89ca6eSOliver-Rainer Wittmann break; 1080766ce4d0SZheng Fan 1081af89ca6eSOliver-Rainer Wittmann case SID_OUTLINE_LEFT: 1082af89ca6eSOliver-Rainer Wittmann case SID_OUTLINE_RIGHT: 1083af89ca6eSOliver-Rainer Wittmann StateChangeOutLineImpl( nSID, eState, pState ); 1084af89ca6eSOliver-Rainer Wittmann break; 1085766ce4d0SZheng Fan 1086af89ca6eSOliver-Rainer Wittmann case SID_INC_INDENT: 1087af89ca6eSOliver-Rainer Wittmann case SID_DEC_INDENT: 1088af89ca6eSOliver-Rainer Wittmann StateChangeIncDecImpl( nSID, eState, pState ); 1089af89ca6eSOliver-Rainer Wittmann break; 1090af89ca6eSOliver-Rainer Wittmann 1091af89ca6eSOliver-Rainer Wittmann case FN_NUM_NUMBERING_ON: 1092af89ca6eSOliver-Rainer Wittmann case FN_NUM_BULLET_ON: 1093af89ca6eSOliver-Rainer Wittmann StateChangeBulletNumImpl( nSID, eState, pState ); 1094af89ca6eSOliver-Rainer Wittmann break; 1095af89ca6eSOliver-Rainer Wittmann 1096af89ca6eSOliver-Rainer Wittmann case FN_BUL_NUM_RULE_INDEX: 1097af89ca6eSOliver-Rainer Wittmann case FN_NUM_NUM_RULE_INDEX: 1098af89ca6eSOliver-Rainer Wittmann StateChangeBulletNumRuleImpl( nSID, eState, pState ); 1099af89ca6eSOliver-Rainer Wittmann break; 1100af89ca6eSOliver-Rainer Wittmann 1101af89ca6eSOliver-Rainer Wittmann case SID_TABLE_VERT_NONE: 1102af89ca6eSOliver-Rainer Wittmann case SID_TABLE_VERT_CENTER: 1103af89ca6eSOliver-Rainer Wittmann case SID_TABLE_VERT_BOTTOM: 1104af89ca6eSOliver-Rainer Wittmann VertStateChanged( nSID, eState, pState); 1105af89ca6eSOliver-Rainer Wittmann break; 1106af89ca6eSOliver-Rainer Wittmann 1107af89ca6eSOliver-Rainer Wittmann case SID_BACKGROUND_COLOR: 1108af89ca6eSOliver-Rainer Wittmann ParaBKGStateChanged(nSID, eState, pState); 1109af89ca6eSOliver-Rainer Wittmann break; 1110af89ca6eSOliver-Rainer Wittmann } 1111766ce4d0SZheng Fan } 1112766ce4d0SZheng Fan 111345da7d5eSAndre Fischer 111445da7d5eSAndre Fischer 111545da7d5eSAndre Fischer 1116766ce4d0SZheng Fan void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1117766ce4d0SZheng Fan { 1118766ce4d0SZheng Fan if( eState >= SFX_ITEM_AVAILABLE ) 1119766ce4d0SZheng Fan { 1120766ce4d0SZheng Fan const SfxBoolItem* pItem = (const SfxBoolItem*)pState; 1121766ce4d0SZheng Fan bool IsChecked = (bool)pItem->GetValue(); 1122766ce4d0SZheng Fan switch (nSID) 1123766ce4d0SZheng Fan { 1124766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_LEFT: 1125766ce4d0SZheng Fan { 1126766ce4d0SZheng Fan if(IsChecked) 1127766ce4d0SZheng Fan { 1128766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK); 1129766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1130766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1131766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1132766ce4d0SZheng Fan } 1133766ce4d0SZheng Fan else 1134766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1135766ce4d0SZheng Fan } 1136766ce4d0SZheng Fan break; 1137766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_CENTER: 1138766ce4d0SZheng Fan { 1139766ce4d0SZheng Fan if(IsChecked) 1140766ce4d0SZheng Fan { 1141766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK); 1142766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1143766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1144766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1145766ce4d0SZheng Fan } 1146766ce4d0SZheng Fan else 1147766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1148766ce4d0SZheng Fan } 1149766ce4d0SZheng Fan break; 1150766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_RIGHT: 1151766ce4d0SZheng Fan { 1152766ce4d0SZheng Fan if(IsChecked) 1153766ce4d0SZheng Fan { 1154766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK); 1155766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1156766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1157766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1158766ce4d0SZheng Fan } 1159766ce4d0SZheng Fan else 1160766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1161766ce4d0SZheng Fan } 1162766ce4d0SZheng Fan break; 1163766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_BLOCK: 1164766ce4d0SZheng Fan { 1165766ce4d0SZheng Fan if(IsChecked) 1166766ce4d0SZheng Fan { 1167766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK); 1168766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1169766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1170766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1171766ce4d0SZheng Fan } 1172766ce4d0SZheng Fan else 1173766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1174766ce4d0SZheng Fan } 1175766ce4d0SZheng Fan break; 1176766ce4d0SZheng Fan } 1177766ce4d0SZheng Fan } 1178766ce4d0SZheng Fan else if( eState == SFX_ITEM_DISABLED ) 1179766ce4d0SZheng Fan { 1180766ce4d0SZheng Fan } 1181766ce4d0SZheng Fan else if ( eState == SFX_ITEM_DONTCARE ) 1182766ce4d0SZheng Fan { 1183766ce4d0SZheng Fan switch (nSID) 1184766ce4d0SZheng Fan { 1185766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_LEFT: 1186766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1187766ce4d0SZheng Fan break; 1188766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_CENTER: 1189766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1190766ce4d0SZheng Fan break; 1191766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_RIGHT: 1192766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1193766ce4d0SZheng Fan break; 1194766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_BLOCK: 1195766ce4d0SZheng Fan maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1196766ce4d0SZheng Fan break; 1197766ce4d0SZheng Fan } 1198766ce4d0SZheng Fan } 1199766ce4d0SZheng Fan } 1200766ce4d0SZheng Fan 12011715803bSPavel Janík void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState ) 1202766ce4d0SZheng Fan { 12038eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 12048eda4adfSOliver-Rainer Wittmann { 1205766ce4d0SZheng Fan 12068eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_DrawText): 12078eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Annotation): 12088eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_Calc, Context_DrawText): 12098eda4adfSOliver-Rainer Wittmann { 12108eda4adfSOliver-Rainer Wittmann maLeftIndent->SetMin( DEFAULT_VALUE ); 12118eda4adfSOliver-Rainer Wittmann maRightIndent->SetMin( DEFAULT_VALUE ); 12128eda4adfSOliver-Rainer Wittmann maFLineIndent->SetMin( DEFAULT_VALUE ); 12138eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->Show(); 12148eda4adfSOliver-Rainer Wittmann maTbxProDemote->Hide(); 12158eda4adfSOliver-Rainer Wittmann } 12168eda4adfSOliver-Rainer Wittmann break; 12178eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_DrawText): 12188eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Draw): 12198eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_TextObject): 12208eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Graphic): 12218eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Table): 12228eda4adfSOliver-Rainer Wittmann { 12238eda4adfSOliver-Rainer Wittmann maLeftIndent->SetMin( DEFAULT_VALUE ); 12248eda4adfSOliver-Rainer Wittmann maRightIndent->SetMin( DEFAULT_VALUE ); 12258eda4adfSOliver-Rainer Wittmann maFLineIndent->SetMin( DEFAULT_VALUE ); 12268eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->Hide(); 12278eda4adfSOliver-Rainer Wittmann maTbxProDemote->Show(); 12288eda4adfSOliver-Rainer Wittmann } 12298eda4adfSOliver-Rainer Wittmann break; 12308eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 12318eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 12328eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 12338eda4adfSOliver-Rainer Wittmann { 12348eda4adfSOliver-Rainer Wittmann maLeftIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); 12358eda4adfSOliver-Rainer Wittmann maRightIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); 12368eda4adfSOliver-Rainer Wittmann maFLineIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); 12378eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->Show(); 12388eda4adfSOliver-Rainer Wittmann maTbxProDemote->Hide(); 12398eda4adfSOliver-Rainer Wittmann } 12408eda4adfSOliver-Rainer Wittmann break; 12418eda4adfSOliver-Rainer Wittmann } 1242766ce4d0SZheng Fan 12438eda4adfSOliver-Rainer Wittmann if( pState && eState >= SFX_ITEM_AVAILABLE ) 12448eda4adfSOliver-Rainer Wittmann { 12458eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem* pSpace = ( SvxLRSpaceItem*)pState; 12468eda4adfSOliver-Rainer Wittmann maTxtLeft = pSpace->GetTxtLeft(); 12478eda4adfSOliver-Rainer Wittmann maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); 12488eda4adfSOliver-Rainer Wittmann maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 12498eda4adfSOliver-Rainer Wittmann 12508eda4adfSOliver-Rainer Wittmann long aTxtRight = pSpace->GetRight(); 12518eda4adfSOliver-Rainer Wittmann aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); 12528eda4adfSOliver-Rainer Wittmann aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 12538eda4adfSOliver-Rainer Wittmann 12548eda4adfSOliver-Rainer Wittmann long aTxtFirstLineOfst = pSpace->GetTxtFirstLineOfst(); 12558eda4adfSOliver-Rainer Wittmann aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); 12568eda4adfSOliver-Rainer Wittmann aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 12578eda4adfSOliver-Rainer Wittmann 12588eda4adfSOliver-Rainer Wittmann long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 12598eda4adfSOliver-Rainer Wittmann nVal = (long)maLeftIndent->Normalize( (long)nVal ); 12608eda4adfSOliver-Rainer Wittmann maLeftIndent->SetValue( nVal, FUNIT_100TH_MM ); 12618eda4adfSOliver-Rainer Wittmann 12628eda4adfSOliver-Rainer Wittmann if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) 12638eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) 12648eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table)) 12658eda4adfSOliver-Rainer Wittmann { 12668eda4adfSOliver-Rainer Wittmann maFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM ); 12678eda4adfSOliver-Rainer Wittmann } 1268766ce4d0SZheng Fan 12698eda4adfSOliver-Rainer Wittmann long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 12708eda4adfSOliver-Rainer Wittmann nrVal = (long)maRightIndent->Normalize( (long)nrVal ); 12718eda4adfSOliver-Rainer Wittmann maRightIndent->SetValue( nrVal, FUNIT_100TH_MM ); 1272766ce4d0SZheng Fan 12738eda4adfSOliver-Rainer Wittmann long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 12748eda4adfSOliver-Rainer Wittmann nfVal = (long)maFLineIndent->Normalize( (long)nfVal ); 12758eda4adfSOliver-Rainer Wittmann maFLineIndent->SetValue( nfVal, FUNIT_100TH_MM ); 12768eda4adfSOliver-Rainer Wittmann 12778eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 12788eda4adfSOliver-Rainer Wittmann { 12798eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_DrawText): 12808eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 12818eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 12828eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 12838eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Annotation): 12848eda4adfSOliver-Rainer Wittmann { 12858eda4adfSOliver-Rainer Wittmann maLeftIndent->SetMax( MAX_SW - nrVal, FUNIT_100TH_MM ); 12868eda4adfSOliver-Rainer Wittmann maRightIndent->SetMax( MAX_SW - nVal, FUNIT_100TH_MM ); 12878eda4adfSOliver-Rainer Wittmann maFLineIndent->SetMax( MAX_SW - nVal - nrVal, FUNIT_100TH_MM ); 12888eda4adfSOliver-Rainer Wittmann } 12898eda4adfSOliver-Rainer Wittmann break; 12908eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_DrawText): 12918eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Draw): 12928eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Table): 12938eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_TextObject): 12948eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Graphic): 12958eda4adfSOliver-Rainer Wittmann { 12968eda4adfSOliver-Rainer Wittmann maLeftIndent->SetMax( MAX_SC_SD - nrVal, FUNIT_100TH_MM ); 12978eda4adfSOliver-Rainer Wittmann maRightIndent->SetMax( MAX_SC_SD - nVal, FUNIT_100TH_MM ); 12988eda4adfSOliver-Rainer Wittmann maFLineIndent->SetMax( MAX_SC_SD - nVal - nrVal, FUNIT_100TH_MM ); 12998eda4adfSOliver-Rainer Wittmann } 13008eda4adfSOliver-Rainer Wittmann } 1301766ce4d0SZheng Fan 1302eeb4e5d3SOliver-Rainer Wittmann maTbxIndent_IncDec->Enable(); 1303eeb4e5d3SOliver-Rainer Wittmann maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_True); 13048eda4adfSOliver-Rainer Wittmann if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) 13058eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) 13068eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) 1307eeb4e5d3SOliver-Rainer Wittmann { 1308eeb4e5d3SOliver-Rainer Wittmann maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True); 1309eeb4e5d3SOliver-Rainer Wittmann maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True); 1310eeb4e5d3SOliver-Rainer Wittmann } 1311766ce4d0SZheng Fan 13128eda4adfSOliver-Rainer Wittmann maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True); 13138eda4adfSOliver-Rainer Wittmann } 13148eda4adfSOliver-Rainer Wittmann else if( eState == SFX_ITEM_DISABLED ) 13158eda4adfSOliver-Rainer Wittmann { 13168eda4adfSOliver-Rainer Wittmann maLeftIndent-> Disable(); 13178eda4adfSOliver-Rainer Wittmann maRightIndent->Disable(); 13188eda4adfSOliver-Rainer Wittmann maFLineIndent->Disable(); 13198eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->Disable(); 13208eda4adfSOliver-Rainer Wittmann if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && 13218eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) && 13228eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) 13238eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->Disable(); 13248eda4adfSOliver-Rainer Wittmann else 13258eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False); 13268eda4adfSOliver-Rainer Wittmann 13278eda4adfSOliver-Rainer Wittmann // maTbxProDemote->Disable(); 13288eda4adfSOliver-Rainer Wittmann maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False); 13298eda4adfSOliver-Rainer Wittmann } 13308eda4adfSOliver-Rainer Wittmann else 13318eda4adfSOliver-Rainer Wittmann { 13328eda4adfSOliver-Rainer Wittmann maLeftIndent->SetEmptyFieldValue(); 13338eda4adfSOliver-Rainer Wittmann maRightIndent->SetEmptyFieldValue(); 13348eda4adfSOliver-Rainer Wittmann maFLineIndent->SetEmptyFieldValue(); 13358eda4adfSOliver-Rainer Wittmann if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && 13368eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) && 13378eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) 13388eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->Disable(); 13398eda4adfSOliver-Rainer Wittmann else 13408eda4adfSOliver-Rainer Wittmann maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False); 13418eda4adfSOliver-Rainer Wittmann maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False); 13428eda4adfSOliver-Rainer Wittmann } 1343766ce4d0SZheng Fan } 1344766ce4d0SZheng Fan 13451715803bSPavel Janík void ParaPropertyPanel::StateChangedLnSPImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState ) 1346766ce4d0SZheng Fan { 1347766ce4d0SZheng Fan meLnSpState = eState; 1348766ce4d0SZheng Fan 1349766ce4d0SZheng Fan if( pState && eState >= SFX_ITEM_AVAILABLE ) 1350766ce4d0SZheng Fan { 1351766ce4d0SZheng Fan if(mpLnSPItem) 1352766ce4d0SZheng Fan delete mpLnSPItem; 1353766ce4d0SZheng Fan mpLnSPItem = ( SvxLineSpacingItem *)pState->Clone(); 1354766ce4d0SZheng Fan } 1355766ce4d0SZheng Fan } 1356766ce4d0SZheng Fan 13571715803bSPavel Janík void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState ) 1358766ce4d0SZheng Fan { 1359766ce4d0SZheng Fan maTopDist->SetMax( maTopDist->Normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) ); 1360766ce4d0SZheng Fan maBottomDist->SetMax( maBottomDist->Normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) ); 1361766ce4d0SZheng Fan 1362766ce4d0SZheng Fan if( pState && eState >= SFX_ITEM_AVAILABLE ) 1363766ce4d0SZheng Fan { 1364766ce4d0SZheng Fan SvxULSpaceItem* pOldItem = (SvxULSpaceItem*)pState; 1365766ce4d0SZheng Fan 1366766ce4d0SZheng Fan maUpper = pOldItem->GetUpper(); 1367766ce4d0SZheng Fan maUpper = OutputDevice::LogicToLogic( maUpper, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM ); 1368766ce4d0SZheng Fan maUpper = OutputDevice::LogicToLogic( maUpper, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 1369766ce4d0SZheng Fan 1370766ce4d0SZheng Fan maLower = pOldItem->GetLower(); 1371766ce4d0SZheng Fan maLower = OutputDevice::LogicToLogic( maLower, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM ); 1372766ce4d0SZheng Fan maLower = OutputDevice::LogicToLogic( maLower, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 1373766ce4d0SZheng Fan 1374766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1375766ce4d0SZheng Fan nVal = maTopDist->Normalize( nVal ); 1376766ce4d0SZheng Fan maTopDist->SetValue( nVal, FUNIT_100TH_MM ); 1377766ce4d0SZheng Fan 1378766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1379766ce4d0SZheng Fan nVal = maBottomDist->Normalize( nVal ); 1380766ce4d0SZheng Fan maBottomDist->SetValue( nVal, FUNIT_100TH_MM ); 1381766ce4d0SZheng Fan maTbxUL_IncDec->Enable(); 1382766ce4d0SZheng Fan } 1383512ec161SZheng Fan else if(eState == SFX_ITEM_DISABLED ) 1384766ce4d0SZheng Fan { 1385766ce4d0SZheng Fan maTopDist->Disable(); 1386766ce4d0SZheng Fan maBottomDist->Disable(); 1387766ce4d0SZheng Fan maTbxUL_IncDec->Disable(); 1388766ce4d0SZheng Fan } 1389512ec161SZheng Fan else 1390766ce4d0SZheng Fan { 1391766ce4d0SZheng Fan maTopDist->SetEmptyFieldValue(); 1392766ce4d0SZheng Fan maBottomDist->SetEmptyFieldValue(); 1393766ce4d0SZheng Fan maTbxUL_IncDec->Disable(); 1394766ce4d0SZheng Fan } 1395766ce4d0SZheng Fan } 1396766ce4d0SZheng Fan 1397766ce4d0SZheng Fan void ParaPropertyPanel::StateChangeOutLineImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1398766ce4d0SZheng Fan { 1399766ce4d0SZheng Fan if (nSID==SID_OUTLINE_LEFT) 1400766ce4d0SZheng Fan { 1401766ce4d0SZheng Fan if( pState && eState == SFX_ITEM_UNKNOWN ) 1402766ce4d0SZheng Fan mbOutLineLeft = 1; 1403766ce4d0SZheng Fan else 1404766ce4d0SZheng Fan mbOutLineLeft = 0; 1405766ce4d0SZheng Fan } 1406766ce4d0SZheng Fan if (nSID==SID_OUTLINE_RIGHT) 1407766ce4d0SZheng Fan { 1408766ce4d0SZheng Fan if( pState && eState == SFX_ITEM_UNKNOWN ) 1409766ce4d0SZheng Fan mbOutLineRight = 1; 1410766ce4d0SZheng Fan else 1411766ce4d0SZheng Fan mbOutLineRight = 0; 1412766ce4d0SZheng Fan } 1413766ce4d0SZheng Fan if(mbOutLineLeft) 1414766ce4d0SZheng Fan maTbxProDemote->EnableItem(BT_TBX_INDENT_DEMOTE, sal_True); 1415766ce4d0SZheng Fan else 1416766ce4d0SZheng Fan maTbxProDemote->EnableItem(BT_TBX_INDENT_DEMOTE, sal_False); 1417766ce4d0SZheng Fan 1418766ce4d0SZheng Fan if(mbOutLineRight) 1419766ce4d0SZheng Fan maTbxProDemote->EnableItem(BT_TBX_INDENT_PROMOTE, sal_True); 1420766ce4d0SZheng Fan else 1421766ce4d0SZheng Fan maTbxProDemote->EnableItem(BT_TBX_INDENT_PROMOTE, sal_False); 1422766ce4d0SZheng Fan 1423766ce4d0SZheng Fan } 1424766ce4d0SZheng Fan 1425766ce4d0SZheng Fan void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1426766ce4d0SZheng Fan { 14278eda4adfSOliver-Rainer Wittmann if ( ( maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Text) 14288eda4adfSOliver-Rainer Wittmann || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Default) 14298eda4adfSOliver-Rainer Wittmann || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Table) ) 1430eeb4e5d3SOliver-Rainer Wittmann && ( nSID == SID_INC_INDENT || nSID == SID_DEC_INDENT ) ) 1431eeb4e5d3SOliver-Rainer Wittmann { 1432eeb4e5d3SOliver-Rainer Wittmann // Writer's text shell is the only one which provides reasonable states for Slots SID_INC_INDENT and SID_DEC_INDENT 1433eeb4e5d3SOliver-Rainer Wittmann // - namely SFX_ITEM_UNKNOWN and SFX_ITEM_DISABLED 1434eeb4e5d3SOliver-Rainer Wittmann maTbxIndent_IncDec->EnableItem( 1435eeb4e5d3SOliver-Rainer Wittmann nSID == SID_INC_INDENT ? BT_TBX_INDENT_INC : BT_TBX_INDENT_DEC, 1436eeb4e5d3SOliver-Rainer Wittmann ( pState && eState == SFX_ITEM_UNKNOWN ) ? sal_True : sal_False ); 1437eeb4e5d3SOliver-Rainer Wittmann } 1438766ce4d0SZheng Fan } 1439eeb4e5d3SOliver-Rainer Wittmann 1440eeb4e5d3SOliver-Rainer Wittmann 144137fee4fdSAndre Fischer // Add toggle state for numbering and bullet icons 1442766ce4d0SZheng Fan void ParaPropertyPanel::StateChangeBulletNumImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1443766ce4d0SZheng Fan { 14447aed46aaSOliver-Rainer Wittmann if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem)) ) 14457aed46aaSOliver-Rainer Wittmann { 1446af89ca6eSOliver-Rainer Wittmann const SfxBoolItem* pItem= (const SfxBoolItem*)pState; 1447af89ca6eSOliver-Rainer Wittmann const sal_Bool aBool = (sal_Bool)pItem->GetValue(); 14487aed46aaSOliver-Rainer Wittmann if (nSID==FN_NUM_NUMBERING_ON) 14497aed46aaSOliver-Rainer Wittmann { 1450af89ca6eSOliver-Rainer Wittmann maTBxNumBullet->SetItemState( 1451af89ca6eSOliver-Rainer Wittmann IID_NUMBER, 1452af89ca6eSOliver-Rainer Wittmann aBool ? STATE_CHECK : STATE_NOCHECK ); 14537aed46aaSOliver-Rainer Wittmann } 14547aed46aaSOliver-Rainer Wittmann else if (nSID==FN_NUM_BULLET_ON) 14557aed46aaSOliver-Rainer Wittmann { 1456af89ca6eSOliver-Rainer Wittmann maTBxNumBullet->SetItemState( 1457af89ca6eSOliver-Rainer Wittmann IID_BULLET, 1458af89ca6eSOliver-Rainer Wittmann aBool ? STATE_CHECK : STATE_NOCHECK ); 14597aed46aaSOliver-Rainer Wittmann } 14607aed46aaSOliver-Rainer Wittmann } 1461766ce4d0SZheng Fan } 14627aed46aaSOliver-Rainer Wittmann 14637aed46aaSOliver-Rainer Wittmann 14647aed46aaSOliver-Rainer Wittmann void ParaPropertyPanel::StateChangeBulletNumRuleImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1465766ce4d0SZheng Fan { 14667aed46aaSOliver-Rainer Wittmann if ( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxUInt16Item) ) 14677aed46aaSOliver-Rainer Wittmann { 14687aed46aaSOliver-Rainer Wittmann sal_uInt16 nValue = (sal_uInt16)0xFFFF; 14697aed46aaSOliver-Rainer Wittmann { 14707aed46aaSOliver-Rainer Wittmann const SfxUInt16Item* pIt = (const SfxUInt16Item*)pState; 14717aed46aaSOliver-Rainer Wittmann if ( pIt ) 14727aed46aaSOliver-Rainer Wittmann nValue = pIt->GetValue(); 14737aed46aaSOliver-Rainer Wittmann } 1474766ce4d0SZheng Fan 14757aed46aaSOliver-Rainer Wittmann if ( nSID == FN_BUL_NUM_RULE_INDEX ) 14767aed46aaSOliver-Rainer Wittmann { 14777aed46aaSOliver-Rainer Wittmann mnBulletTypeIndex = nValue; 14787aed46aaSOliver-Rainer Wittmann } 14797aed46aaSOliver-Rainer Wittmann else if ( nSID == FN_NUM_NUM_RULE_INDEX ) 14807aed46aaSOliver-Rainer Wittmann { 14817aed46aaSOliver-Rainer Wittmann mnNumTypeIndex = nValue; 14827aed46aaSOliver-Rainer Wittmann } 14837aed46aaSOliver-Rainer Wittmann } 1484766ce4d0SZheng Fan } 14857aed46aaSOliver-Rainer Wittmann 14867aed46aaSOliver-Rainer Wittmann 1487766ce4d0SZheng Fan FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState ) 1488766ce4d0SZheng Fan { 1489766ce4d0SZheng Fan FieldUnit eUnit = FUNIT_NONE; 1490766ce4d0SZheng Fan 1491766ce4d0SZheng Fan if ( pState && eState >= SFX_ITEM_DEFAULT ) 1492766ce4d0SZheng Fan eUnit = (FieldUnit)( (const SfxUInt16Item*)pState )->GetValue(); 1493766ce4d0SZheng Fan else 1494766ce4d0SZheng Fan { 1495766ce4d0SZheng Fan SfxViewFrame* pFrame = SfxViewFrame::Current(); 1496766ce4d0SZheng Fan SfxObjectShell* pSh = NULL; 1497766ce4d0SZheng Fan if ( pFrame ) 1498766ce4d0SZheng Fan pSh = pFrame->GetObjectShell(); 1499766ce4d0SZheng Fan if ( pSh ) //the object shell is not always available during reload 1500766ce4d0SZheng Fan { 1501766ce4d0SZheng Fan SfxModule* pModule = pSh->GetModule(); 1502766ce4d0SZheng Fan if ( pModule ) 1503766ce4d0SZheng Fan { 1504766ce4d0SZheng Fan const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); 1505766ce4d0SZheng Fan if ( pItem ) 1506766ce4d0SZheng Fan eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); 1507766ce4d0SZheng Fan } 1508766ce4d0SZheng Fan else 1509766ce4d0SZheng Fan { 1510766ce4d0SZheng Fan DBG_ERRORFILE( "GetModuleFieldUnit(): no module found" ); 1511766ce4d0SZheng Fan } 1512766ce4d0SZheng Fan } 1513766ce4d0SZheng Fan } 1514766ce4d0SZheng Fan 1515766ce4d0SZheng Fan return eUnit; 1516766ce4d0SZheng Fan } 15177aed46aaSOliver-Rainer Wittmann 1518766ce4d0SZheng Fan 1519766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateLineSpacingControl (PopupContainer* pParent) 1520766ce4d0SZheng Fan { 1521766ce4d0SZheng Fan return new ParaLineSpacingControl(pParent, *this); 1522766ce4d0SZheng Fan } 1523766ce4d0SZheng Fan 1524766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateBulletsPopupControl (PopupContainer* pParent) 1525766ce4d0SZheng Fan { 1526766ce4d0SZheng Fan return new ParaBulletsControl(pParent, *this); 1527766ce4d0SZheng Fan } 1528766ce4d0SZheng Fan 1529766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateNumberingPopupControl (PopupContainer* pParent) 1530766ce4d0SZheng Fan { 1531766ce4d0SZheng Fan return new ParaNumberingControl(pParent, *this); 1532766ce4d0SZheng Fan } 1533766ce4d0SZheng Fan 1534b7a56e95SArmin Le Grand namespace 1535b7a56e95SArmin Le Grand { 1536b7a56e95SArmin Le Grand Color GetNoBackgroundColor(void) 1537b7a56e95SArmin Le Grand { 1538b7a56e95SArmin Le Grand return COL_TRANSPARENT; 1539b7a56e95SArmin Le Grand } 1540b7a56e95SArmin Le Grand } // end of anonymous namespace 1541b7a56e95SArmin Le Grand 1542766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateBGColorPopupControl (PopupContainer* pParent) 1543766ce4d0SZheng Fan { 1544b7a56e95SArmin Le Grand const ResId aResId(SVX_RES(STR_NOFILL)); 1545b7a56e95SArmin Le Grand 1546b7a56e95SArmin Le Grand return new ColorControl( 1547766ce4d0SZheng Fan pParent, 1548766ce4d0SZheng Fan mpBindings, 1549b7a56e95SArmin Le Grand SVX_RES(RID_POPUPPANEL_PARAPAGE_BACK_COLOR), 1550766ce4d0SZheng Fan SVX_RES(VS_FONT_COLOR), 1551b7a56e95SArmin Le Grand ::boost::bind(GetNoBackgroundColor), 1552766ce4d0SZheng Fan ::boost::bind(&ParaPropertyPanel::SetBGColor, this, _1,_2), 1553766ce4d0SZheng Fan pParent, 1554b7a56e95SArmin Le Grand &aResId); 1555766ce4d0SZheng Fan } 1556766ce4d0SZheng Fan 1557766ce4d0SZheng Fan 1558766ce4d0SZheng Fan ParaPropertyPanel::ParaPropertyPanel(Window* pParent, 15593cac12cfSAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 156037fee4fdSAndre Fischer SfxBindings* pBindings, 156137fee4fdSAndre Fischer const cssu::Reference<css::ui::XSidebar>& rxSidebar) 156237fee4fdSAndre Fischer : Control(pParent, SVX_RES(RID_SIDEBAR_PARA_PANEL)), 156337fee4fdSAndre Fischer maAlignToolBoxBackground(ControlFactory::CreateToolBoxBackground(this)), 156437fee4fdSAndre Fischer maAlignToolBox (ControlFactory::CreateToolBox(maAlignToolBoxBackground.get(),SVX_RES(TBX_HORIZONTALALIGNMENT))), 156537fee4fdSAndre Fischer maTBxVertAlignBackground(ControlFactory::CreateToolBoxBackground(this)), 156637fee4fdSAndre Fischer maTBxVertAlign (ControlFactory::CreateToolBox(maTBxVertAlignBackground.get(),SVX_RES(TBX_VERT_ALIGN))), 156737fee4fdSAndre Fischer maTBxNumBulletBackground(ControlFactory::CreateToolBoxBackground(this)), 156837fee4fdSAndre Fischer maTBxNumBullet (ControlFactory::CreateToolBox(maTBxNumBulletBackground.get(),SVX_RES(TBX_NUM_BULLET))), 156937fee4fdSAndre Fischer maTBxBackColorBackground(ControlFactory::CreateToolBoxBackground(this)), 157037fee4fdSAndre Fischer maTBxBackColor (ControlFactory::CreateToolBox(maTBxBackColorBackground.get(),SVX_RES(TBX_BACK_COLOR))), 157137fee4fdSAndre Fischer maFTUL (new FixedText(this, SVX_RES(FT_SPACING))), 157237fee4fdSAndre Fischer maTbxUL_IncDecBackground(ControlFactory::CreateToolBoxBackground(this)), 157337fee4fdSAndre Fischer maTbxUL_IncDec (ControlFactory::CreateToolBox(maTbxUL_IncDecBackground.get(),SVX_RES(TBX_UL_INC_DEC))), 157437fee4fdSAndre Fischer maFTIndent (new FixedText(this, SVX_RES(FT_INDENT))), 157537fee4fdSAndre Fischer maTbxIndent_IncDecBackground(ControlFactory::CreateToolBoxBackground(this)), 157637fee4fdSAndre Fischer maTbxIndent_IncDec (ControlFactory::CreateToolBox(maTbxIndent_IncDecBackground.get(),SVX_RES(TBX_INDENT_INC_DEC))), 157752d13b84SAndre Fischer 157852d13b84SAndre Fischer maTopDist (new SvxRelativeField(this, SVX_RES(MF_ABOVE_PARASPACING))), 157937fee4fdSAndre Fischer maLeftIndent (new SvxRelativeField(this, SVX_RES(MF_BEFORE_INDENT))), 158052d13b84SAndre Fischer 158152d13b84SAndre Fischer maBottomDist (new SvxRelativeField(this, SVX_RES(MF_BELOW_PARASPACING))), 158237fee4fdSAndre Fischer maRightIndent (new SvxRelativeField(this, SVX_RES(MF_AFTER_INDENT))), 158352d13b84SAndre Fischer 158452d13b84SAndre Fischer maLineSPTbxBackground(ControlFactory::CreateToolBoxBackground(this)), 158552d13b84SAndre Fischer maLineSPTbx (ControlFactory::CreateToolBox(maLineSPTbxBackground.get(),SVX_RES(TBX_LINESP))), 158637fee4fdSAndre Fischer maFLineIndent (new SvxRelativeField(this, SVX_RES(MF_FL_INDENT))), 158752d13b84SAndre Fischer 158852d13b84SAndre Fischer maTbxProDemoteBackground(ControlFactory::CreateToolBoxBackground(this)), 158952d13b84SAndre Fischer maTbxProDemote (ControlFactory::CreateToolBox(maTbxProDemoteBackground.get(),SVX_RES(TBX_INDENT_PRO_DEMOTE))), 159037fee4fdSAndre Fischer mpColorUpdater (), 159137fee4fdSAndre Fischer maFISpace1 ( this, SVX_RES( FI_SPACE1)), 159237fee4fdSAndre Fischer maFISpace2 ( this, SVX_RES( FI_SPACE2)), 159337fee4fdSAndre Fischer maFIndent1 ( this, SVX_RES( FI_INDENT1)), 159437fee4fdSAndre Fischer maFIndent2 ( this, SVX_RES( FI_INDENT2)), 159537fee4fdSAndre Fischer maFIndent3 ( this, SVX_RES( FI_INDENT3)), 159637fee4fdSAndre Fischer maSpace1 (SVX_RES(IMG_SPACE1)), 159737fee4fdSAndre Fischer maSpace2 (SVX_RES(IMG_SPACE2)), 159837fee4fdSAndre Fischer maSpace3 (SVX_RES(IMG_SPACE3)), 159937fee4fdSAndre Fischer maIndent1 (SVX_RES(IMG_INDENT1)), 160037fee4fdSAndre Fischer maIndent2 (SVX_RES(IMG_INDENT2)), 160137fee4fdSAndre Fischer maIndent3 (SVX_RES(IMG_INDENT3)), 160237fee4fdSAndre Fischer maIndHang (SVX_RES(IMG_INDENT_HANG)), 160337fee4fdSAndre Fischer maParInc (SVX_RES(IMG_PARA_INC)), 160437fee4fdSAndre Fischer maParDec (SVX_RES(IMG_PARA_DEC)), 160537fee4fdSAndre Fischer maNumBImageList (SVX_RES(IL_NUM_BULLET)), 160637fee4fdSAndre Fischer maNumBImageListH (SVX_RES(ILH_NUM_BULLET)), 160737fee4fdSAndre Fischer maNumBImageListRTL (SVX_RES(IL_NUM_BULLET_RTL)), 160837fee4fdSAndre Fischer maImgBackColorHigh (SVX_RES(IMG_BACK_COLOR_H)), 160937fee4fdSAndre Fischer maImgBackColor (SVX_RES(IMG_BACK_COLOR)), 161037fee4fdSAndre Fischer maTxtLeft (0), 161137fee4fdSAndre Fischer mpLnSPItem (NULL), 161237fee4fdSAndre Fischer meLnSpState (SFX_ITEM_DONTCARE), 161337fee4fdSAndre Fischer mbOutLineLeft (false), 161437fee4fdSAndre Fischer mbOutLineRight (false), 161537fee4fdSAndre Fischer maUpper (0), 161637fee4fdSAndre Fischer maLower (0), 161737fee4fdSAndre Fischer mnBulletTypeIndex ((sal_uInt16)0xFFFF), 161837fee4fdSAndre Fischer mnNumTypeIndex ((sal_uInt16)0xFFFF), 161937fee4fdSAndre Fischer maColor (COL_AUTO), 162037fee4fdSAndre Fischer mbColorAvailable (true), 162137fee4fdSAndre Fischer m_eLRSpaceUnit(), 162237fee4fdSAndre Fischer m_eULSpaceUnit(), 16233cac12cfSAndre Fischer maLeftAlignControl(SID_ATTR_PARA_ADJUST_LEFT, *pBindings, *this, A2S("LeftPara"), rxFrame), 16243cac12cfSAndre Fischer maCenterAlignControl(SID_ATTR_PARA_ADJUST_CENTER, *pBindings, *this, A2S("CenterPara"), rxFrame), 16253cac12cfSAndre Fischer maRightAlignControl(SID_ATTR_PARA_ADJUST_RIGHT, *pBindings, *this, A2S("RightPara"), rxFrame), 16263cac12cfSAndre Fischer maJustifyAlignControl(SID_ATTR_PARA_ADJUST_BLOCK, *pBindings, *this, A2S("JustifyPara"), rxFrame), 162737fee4fdSAndre Fischer maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*pBindings,*this), 162837fee4fdSAndre Fischer maLNSpaceControl (SID_ATTR_PARA_LINESPACE, *pBindings,*this), 162937fee4fdSAndre Fischer maULSpaceControl (SID_ATTR_PARA_ULSPACE, *pBindings,*this), 16303cac12cfSAndre Fischer maOutLineLeftControl(SID_OUTLINE_LEFT, *pBindings, *this, A2S("OutlineRight"), rxFrame), 16313cac12cfSAndre Fischer maOutLineRightControl(SID_OUTLINE_RIGHT, *pBindings, *this, A2S("OutlineLeft"), rxFrame), 16323cac12cfSAndre Fischer maDecIndentControl(SID_DEC_INDENT, *pBindings,*this, A2S("DecrementIndent"), rxFrame), 16333cac12cfSAndre Fischer maIncIndentControl(SID_INC_INDENT, *pBindings,*this, A2S("IncrementIndent"), rxFrame), 16343cac12cfSAndre Fischer maVertTop (SID_TABLE_VERT_NONE, *pBindings, *this, A2S("CellVertTop"), rxFrame), 16353cac12cfSAndre Fischer maVertCenter (SID_TABLE_VERT_CENTER, *pBindings,*this, A2S("CellVertCenter"), rxFrame), 16363cac12cfSAndre Fischer maVertBottom (SID_TABLE_VERT_BOTTOM,*pBindings,*this, A2S("CellVertBottom"), rxFrame), 16373cac12cfSAndre Fischer maBulletOnOff(FN_NUM_BULLET_ON, *pBindings, *this, A2S("DefaultBullet"), rxFrame), 16383cac12cfSAndre Fischer maNumberOnOff(FN_NUM_NUMBERING_ON, *pBindings, *this, A2S("DefaultNumbering"), rxFrame), 163937fee4fdSAndre Fischer maBackColorControl (SID_BACKGROUND_COLOR, *pBindings,*this), 164037fee4fdSAndre Fischer m_aMetricCtl (SID_ATTR_METRIC, *pBindings,*this), 164137fee4fdSAndre Fischer maBulletNumRuleIndex (FN_BUL_NUM_RULE_INDEX, *pBindings,*this), 164237fee4fdSAndre Fischer maNumNumRuleIndex (FN_NUM_NUM_RULE_INDEX, *pBindings,*this), 16438cdef556SPavel Janík mxFrame(rxFrame), 164437fee4fdSAndre Fischer maContext(), 164537fee4fdSAndre Fischer mpBindings(pBindings), 164637fee4fdSAndre Fischer maLineSpacePopup(this, ::boost::bind(&ParaPropertyPanel::CreateLineSpacingControl, this, _1)), 164737fee4fdSAndre Fischer maBulletsPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBulletsPopupControl, this, _1)), 164837fee4fdSAndre Fischer maNumberingPopup(this, ::boost::bind(&ParaPropertyPanel::CreateNumberingPopupControl, this, _1)), 164937fee4fdSAndre Fischer maBGColorPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBGColorPopupControl, this, _1)), 165037fee4fdSAndre Fischer mxSidebar(rxSidebar) 1651766ce4d0SZheng Fan { 1652766ce4d0SZheng Fan initial(); 16533cac12cfSAndre Fischer FreeResource(); 1654766ce4d0SZheng Fan } 1655766ce4d0SZheng Fan 165637fee4fdSAndre Fischer } } // end of namespace svx::sidebar 1657